|
|
@ -20,35 +20,23 @@ |
|
|
|
<el-input v-model="dataForm.name" placeholder="请输入名称" style="width:250px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<!-- 下拉框组织的参数 --> |
|
|
|
<el-form-item prop="orgId" label="所属组织" v-if="orgListSwitch"> |
|
|
|
<el-form-item prop="agencyId" label="所属组织" v-if="orgListSwitch"> |
|
|
|
<el-cascader |
|
|
|
v-model="dataForm.orgId" |
|
|
|
v-model="dataForm.agencyId" |
|
|
|
:options="agencytree" |
|
|
|
placeholder="请选择所属组织" |
|
|
|
:props="{ expandTrigger: 'hover', label: 'orgName', value: 'orgId', children: 'subOrgList' }" |
|
|
|
></el-cascader> |
|
|
|
:props="{ expandTrigger: 'hover', emitPath: false, label: 'orgName', value: 'orgId', children: 'subOrgList' }" |
|
|
|
:show-all-levels="false" |
|
|
|
clearable /> |
|
|
|
</el-form-item> |
|
|
|
<!-- 网格党支部下拉框 --> |
|
|
|
<el-form-item prop="pid" label="所属上级" v-if="GridPartyBranchSwitch"> |
|
|
|
<el-select v-model="dataForm.pid" placeholder="请选择所属上级"> |
|
|
|
<el-option |
|
|
|
v-for="item in GridPartyBranchList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<!-- 党委下拉框 --> |
|
|
|
<el-form-item prop="pid" label="所属上级" v-if="partyCommSwitch"> |
|
|
|
<el-select v-model="dataForm.pid" placeholder="请选择所属上级"> |
|
|
|
<el-option |
|
|
|
v-for="item in PartyCommList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-form-item prop="pid" label="所属上级" v-if="!orgListSwitch"> |
|
|
|
<el-cascader |
|
|
|
placeholder="请选择所属上级" |
|
|
|
:options="parentStructTree" |
|
|
|
v-model="dataForm.pid" |
|
|
|
:props="{ expandTrigger: 'hover', emitPath: false, label: 'name', value: 'id', children: 'children' }" |
|
|
|
:show-all-levels="false" |
|
|
|
clearable /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="排序"> |
|
|
|
<el-input-number v-model="dataForm.sort" :min="0" :max="10" label="请输入排序"></el-input-number> |
|
|
@ -120,7 +108,6 @@ export default { |
|
|
|
name:'', |
|
|
|
agencyId:'', |
|
|
|
agencyName:'', |
|
|
|
orgId: '', |
|
|
|
agencyType:'', |
|
|
|
pid:'', |
|
|
|
categoryCode:'', |
|
|
@ -132,11 +119,8 @@ export default { |
|
|
|
structCategoryArr: [], // 查询动力主轴标签类别 |
|
|
|
leaderCategoryArr: [], // 查询动力主轴负责人标签类别 |
|
|
|
agencytree: [], // 绑定组织列表 |
|
|
|
GridPartyBranchList:[], // 上级网格党支部列表 |
|
|
|
PartyCommList:[], // 党委列表 |
|
|
|
orgListSwitch:false, // 组织列表开关 |
|
|
|
GridPartyBranchSwitch:false, // 上级网格党支部列表 |
|
|
|
partyCommSwitch:false, // 党委下拉框列表开关 |
|
|
|
parentStructTree: [], // 上级节点列表 |
|
|
|
orgListSwitch: false, // 组织列表开关 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -148,7 +132,7 @@ export default { |
|
|
|
name:[ |
|
|
|
{ required: true, message: "名称不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
orgId:[ |
|
|
|
agencyId:[ |
|
|
|
{ required: true, message: "所属组织不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
pid:[ |
|
|
@ -243,6 +227,18 @@ export default { |
|
|
|
}) |
|
|
|
return orgArray; |
|
|
|
}, |
|
|
|
removeEmptyStructTree (structArray) { |
|
|
|
structArray.forEach((structInfo) => { |
|
|
|
if (structInfo && structInfo.children) { |
|
|
|
if (structInfo.children.length === 0) { |
|
|
|
structInfo.children = undefined |
|
|
|
} else { |
|
|
|
this.removeEmptyStructTree(structInfo.children) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
return structArray; |
|
|
|
}, |
|
|
|
// 获取信息 |
|
|
|
getInfo () { |
|
|
|
this.$http.post(`/pli/power/axisStruct/queryModifyById/${this.dataForm.id}`).then(({ data: res }) => { |
|
|
@ -253,48 +249,27 @@ export default { |
|
|
|
...this.dataForm, |
|
|
|
...res.data |
|
|
|
} |
|
|
|
if(this.dataForm.categoryCode === 'community_party') { |
|
|
|
this.orgListSwitch = true |
|
|
|
this.GridPartyBranchSwitch = false |
|
|
|
this.partyCommSwitch = false |
|
|
|
} |
|
|
|
if(this.dataForm.categoryCode === 'grid_party') { |
|
|
|
this.orgListSwitch = false |
|
|
|
this.GridPartyBranchSwitch = false |
|
|
|
this.partyCommSwitch = true |
|
|
|
this.getPartyCommList() |
|
|
|
} |
|
|
|
if(this.dataForm.categoryCode === 'group_party') { |
|
|
|
this.GridPartyBranchSwitch = true |
|
|
|
this.partyCommSwitch = false |
|
|
|
this.getGridPartyBranchList() |
|
|
|
} |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
// 获取上级网格党支部 |
|
|
|
async getGridPartyBranchList(){ |
|
|
|
const url = '/pli/power/axisStruct/GridPartyBranchList' |
|
|
|
|
|
|
|
let params = {} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url,params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.GridPartyBranchList = data |
|
|
|
let selectedLevel |
|
|
|
this.structCategoryArr.forEach((item) => { |
|
|
|
if(item.categoryCode === this.dataForm.categoryCode){ |
|
|
|
selectedLevel = item.structLevel |
|
|
|
} |
|
|
|
}) |
|
|
|
if(selectedLevel === 0) { |
|
|
|
this.orgListSwitch = true |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
this.orgListSwitch = false |
|
|
|
this.getParentStructTree(selectedLevel) |
|
|
|
} |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
// 获取上级组织党委 |
|
|
|
async getPartyCommList(){ |
|
|
|
const url = '/pli/power/axisStruct/getPartyCommList' |
|
|
|
|
|
|
|
// 获取上级动力主轴节点 |
|
|
|
async getParentStructTree(structLevel){ |
|
|
|
const url = `/pli/power/axisStruct/bylevel/${structLevel}/parenttree` |
|
|
|
let params = {} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url,params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.PartyCommList = data |
|
|
|
this.parentStructTree = this.removeEmptyStructTree(data) |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
@ -309,23 +284,12 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
if (selectedLevel === 0) { |
|
|
|
this.orgListSwitch = true |
|
|
|
this.GridPartyBranchSwitch = false |
|
|
|
this.partyCommSwitch = false |
|
|
|
this.dataForm.pid = '0' |
|
|
|
} |
|
|
|
if(selectedLevel === 1) { |
|
|
|
this.orgListSwitch = false |
|
|
|
this.GridPartyBranchSwitch = false |
|
|
|
this.partyCommSwitch = true |
|
|
|
this.dataForm.pid = '' |
|
|
|
this.getPartyCommList() |
|
|
|
} |
|
|
|
if(selectedLevel === 2) { |
|
|
|
this.GridPartyBranchSwitch = true |
|
|
|
this.partyCommSwitch = false |
|
|
|
this.dataForm.pid = '' |
|
|
|
this.getGridPartyBranchList() |
|
|
|
this.orgListSwitch = true |
|
|
|
this.dataForm.pid = '0' |
|
|
|
} else { |
|
|
|
this.orgListSwitch = false |
|
|
|
this.dataForm.pid = '' |
|
|
|
this.getParentStructTree(selectedLevel) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
@ -457,7 +421,6 @@ export default { |
|
|
|
}, 1000, { 'leading': true, 'trailing': false }), |
|
|
|
// 修改 |
|
|
|
async submitModifyOrg(){ |
|
|
|
this.dataForm.agencyId = this.dataForm.orgId[this.dataForm.orgId.length - 1] |
|
|
|
const url = '/pli/power/axisStruct/update' |
|
|
|
const { data, code, msg } = await requestPost(url,this.dataForm) |
|
|
|
if (code === 0) { |
|
|
@ -477,7 +440,6 @@ export default { |
|
|
|
// 新增 |
|
|
|
async submitAddNewOrg(){ |
|
|
|
const url = '/pli/power/axisStruct/save' |
|
|
|
this.dataForm.agencyId = this.dataForm.orgId[this.dataForm.orgId.length - 1] |
|
|
|
const { data, code, msg } = await requestPost(url,this.dataForm) |
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|