|
|
@@ -11,18 +11,34 @@ |
|
|
|
<div class="fl_navBox_body"> |
|
|
|
<div class="admin_treeBox navtree"> |
|
|
|
<div class="tree_list"> |
|
|
|
|
|
|
|
<div class="tree_list_item"> |
|
|
|
<div |
|
|
|
v-for="info in relationList" |
|
|
|
:key="info.key" |
|
|
|
class="tree_list_item" |
|
|
|
:class="{ active: info === currentRelationInfo }" |
|
|
|
@click="checkRelationDetail(info)" |
|
|
|
> |
|
|
|
<i class="el-icon-models" /> |
|
|
|
<span class="tree_list_item_label">企业名称</span> |
|
|
|
<span class="tree_list_item_label">{{ |
|
|
|
info.auditStatus == "1" && |
|
|
|
info.acceptCompanyId === mainCompanyId |
|
|
|
? "新申请" |
|
|
|
: info.thatCompanyName |
|
|
|
}}</span> |
|
|
|
</div> |
|
|
|
<div class="tree_list_empty"> |
|
|
|
|
|
|
|
<div class="tree_list_empty" v-if="!relationList.length"> |
|
|
|
暂无互链企业,请添加 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="bottombtn tree_list_bottom_button">添加互链企业</div> |
|
|
|
<div |
|
|
|
class="bottombtn tree_list_bottom_button" |
|
|
|
@click="searchModalVisible = true" |
|
|
|
> |
|
|
|
添加互链企业 |
|
|
|
</div> |
|
|
|
<!-- <div class="navtreebox fulltreebox list-company-dept"> --> |
|
|
|
<!-- 树形导航 --> |
|
|
|
<!-- 树形导航 --> |
|
|
|
<!-- </div> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@@ -31,63 +47,172 @@ |
|
|
|
<div class="admin_contentBox_body"> |
|
|
|
<div class="admin_contentBox_bodyPain"> |
|
|
|
<relation-company-info |
|
|
|
|
|
|
|
v-if="currentRelationInfo" |
|
|
|
:key="currentRelationInfo" |
|
|
|
:relationInfo="currentRelationInfo" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="ec_dialog" v-if="true"> |
|
|
|
<div class="ec_dialogBox"> |
|
|
|
<div class="ec_dialogBoxHead"> |
|
|
|
<h3 class="ec_dialogBoxHeadTitle fl">设置职员所在部门</h3> |
|
|
|
<i |
|
|
|
title="关闭" |
|
|
|
class="Cicon icon font_family icon-icon_quxiaohuoguanbi ec_dialogBoxHeadclose fr" |
|
|
|
@click="colseSet" |
|
|
|
></i> |
|
|
|
</div> |
|
|
|
<div class="line"></div> |
|
|
|
<div class="ec_dialogBoxBody"> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="line"></div> |
|
|
|
<div class="ec_dialogBoxfooter"> |
|
|
|
<el-button>取 消</el-button> |
|
|
|
<el-button type="primary">查 询</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-dialog |
|
|
|
title="通过手机号搜索外部企业职员" |
|
|
|
:visible.sync="searchModalVisible" |
|
|
|
width="460px" |
|
|
|
top="30vh" |
|
|
|
> |
|
|
|
<el-form :model="searchForm"> |
|
|
|
<el-form-item label=""> |
|
|
|
<el-input |
|
|
|
v-model="searchForm.keywords" |
|
|
|
placeholder="点击输入手机号" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="searchModalVisible = false">取 消</el-button> |
|
|
|
<el-button |
|
|
|
:disabled="!searchForm.keywords" |
|
|
|
type="primary" |
|
|
|
@click="searchCompanyByKeywords" |
|
|
|
>查 询</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog |
|
|
|
title="已查询到用户,请选择所在企业关系" |
|
|
|
:visible.sync="searchResultModalVisible" |
|
|
|
custom-class="relation_company_search_modal" |
|
|
|
width="460px" |
|
|
|
top="30vh" |
|
|
|
> |
|
|
|
<div |
|
|
|
class="search_result_item" |
|
|
|
v-for="result in searchResultsList" |
|
|
|
:key="result.companyId" |
|
|
|
@click="generateRelation(result)" |
|
|
|
> |
|
|
|
<div class="search_result_item_sub_label">{{result.contactor}}</div> |
|
|
|
<div class="search_result_item_label">{{result.companyName}}</div> |
|
|
|
<i |
|
|
|
class="el-collapse-item__arrow el-icon-arrow-right search_result_item_icon" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
import RelationCompanyInfo from './components/relation_company_info'; |
|
|
|
import RelationCompanyInfo from "./components/relation_company_info"; |
|
|
|
import { wrapErrorHint } from '@/utils/request'; |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
RelationCompanyInfo, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
const mainCompanyId = this.$store.state.currentCompanyId; |
|
|
|
return { |
|
|
|
mainCompanyId, |
|
|
|
relationList: [], |
|
|
|
searchModalVisible: false, |
|
|
|
searchForm: {}, |
|
|
|
searchResultModalVisible: false, |
|
|
|
searchResultsList: [], |
|
|
|
currentRelationInfo: undefined, |
|
|
|
}; |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
}, |
|
|
|
filters: {}, |
|
|
|
mounted: function () { |
|
|
|
this.fetchRelations() |
|
|
|
.then(() => { |
|
|
|
if(this.relationList.length) { |
|
|
|
this.checkRelationDetail(this.relationList[0]); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
searchModalVisible(v) { |
|
|
|
if(!v) { |
|
|
|
this.searchForm = {}; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
/** |
|
|
|
* 查询互链关系 |
|
|
|
*/ |
|
|
|
async fetchRelations() { |
|
|
|
this.relationList = [ |
|
|
|
{ |
|
|
|
sendCompanyId: this.mainCompanyId, |
|
|
|
sendCompanyName: "我方公司", |
|
|
|
acceptCompanyId: "对方公司id", |
|
|
|
acceptCompanyName: "对方公司", |
|
|
|
auditStatus: 0, |
|
|
|
linkStatus: 0, |
|
|
|
// 以下为前端解析数据插入 |
|
|
|
key: "对方公司id", |
|
|
|
thatCompanyId: "对方公司id", |
|
|
|
thatCompanyName: "对方企业", |
|
|
|
}, |
|
|
|
]; |
|
|
|
}, |
|
|
|
checkRelationDetail(nextRelationInfo) { |
|
|
|
this.currentRelationInfo = nextRelationInfo; |
|
|
|
}, |
|
|
|
async searchCompanyByKeywords() { |
|
|
|
const keywords = this.searchForm.keywords; |
|
|
|
const res = await this.$fetchApi('user/queryUserAndCompanyByUserPhone', { phone: keywords }); |
|
|
|
wrapErrorHint(res); |
|
|
|
if(res.Code !== 0) { return; } |
|
|
|
const data = res.Data; |
|
|
|
// 判断company是否已互链或者是本公司 |
|
|
|
if(data.companyId === this.mainCompanyId) { |
|
|
|
this.$notify({ type: 'error', message: '该职员与您在同一个企业。' }); |
|
|
|
return; |
|
|
|
} |
|
|
|
if(this.relationList.find(info => info.thatCompanyId === data.companyId)) { |
|
|
|
this.$notify({ type: 'error', message: '已存在与目标企业的互链或申请' }); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.searchResultsList = [{ |
|
|
|
companyId: data.companyId, |
|
|
|
companyName: data.companyName, |
|
|
|
contactor: data.userName, |
|
|
|
}]; |
|
|
|
this.searchModalVisible = false; |
|
|
|
this.searchResultModalVisible = true; |
|
|
|
}, |
|
|
|
generateRelation(result) { |
|
|
|
const newRelation = { |
|
|
|
sendCompanyId: this.mainCompanyId, |
|
|
|
// sendCompanyName: "我方公司", |
|
|
|
acceptCompanyId: result.companyId, |
|
|
|
acceptCompanyName: result.companyName, |
|
|
|
auditStatus: '-1', |
|
|
|
// linkStatus: 0, |
|
|
|
// 以下为前端解析数据插入 |
|
|
|
key: result.companyId, |
|
|
|
thatCompanyId: result.companyId, |
|
|
|
thatCompanyName: result.companyName, |
|
|
|
} |
|
|
|
this.currentRelationInfo = newRelation; |
|
|
|
this.searchResultModalVisible = false; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |
|
|
|
.list-company-dept .el-tree-node__content { |
|
|
|
margin: 0 10px 0 0; |
|
|
|
} |
|
|
|
.list-company-dept .el-tree-node__content { |
|
|
|
margin: 0 10px 0 0; |
|
|
|
} |
|
|
|
.relation_company_search_modal { |
|
|
|
background-color: #f8f8f8; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
@@ -102,7 +227,8 @@ export default { |
|
|
|
padding-left: 16px + 8px; |
|
|
|
border-radius: 5px; |
|
|
|
cursor: pointer; |
|
|
|
&:hover, .active { |
|
|
|
&:hover, |
|
|
|
.active { |
|
|
|
background-color: rgba(255, 255, 255, 0.2); |
|
|
|
} |
|
|
|
&_label { |
|
|
@@ -125,6 +251,36 @@ export default { |
|
|
|
color: #fff; |
|
|
|
} |
|
|
|
.tree_list_bottom_button { |
|
|
|
|
|
|
|
} |
|
|
|
.search_result_item { |
|
|
|
position: relative; |
|
|
|
background-color: #fff; |
|
|
|
height: 64px; |
|
|
|
padding: 11px 24px; |
|
|
|
box-sizing: border-box; |
|
|
|
cursor: pointer; |
|
|
|
&_sub_label { |
|
|
|
color: rgba(#000, 0.56); |
|
|
|
font-size: 16px; |
|
|
|
line-height: 1em; |
|
|
|
} |
|
|
|
&_label { |
|
|
|
color: #32323c; |
|
|
|
font-size: 20px; |
|
|
|
line-height: 1em; |
|
|
|
margin-top: 5px; |
|
|
|
} |
|
|
|
&_icon { |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
bottom: 0; |
|
|
|
right: 15px; |
|
|
|
margin: auto 0; |
|
|
|
width: 22px; |
|
|
|
height: 22px; |
|
|
|
|
|
|
|
color: #9b9b9b; |
|
|
|
font-size: 22px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |