|
|
@ -58,6 +58,21 @@ |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="areaCode" label="区域编码" class="dept-list"> |
|
|
|
<el-popover v-model="areaCodeListVisible" ref="areaCodeListPopover" placement="bottom-start" trigger="click"> |
|
|
|
<el-tree :data="areaCodeList" |
|
|
|
:props="{ label: 'name', children: 'children' }" |
|
|
|
node-key="code" |
|
|
|
ref="areaCodeListTree" |
|
|
|
:highlight-current="true" |
|
|
|
:expand-on-click-node="false" |
|
|
|
accordion |
|
|
|
@current-change="areaCodeListTreeCurrentChangeHandle"> |
|
|
|
</el-tree> |
|
|
|
</el-popover> |
|
|
|
<el-input v-model="dataForm.areaCode" v-popover:areaCodeListPopover :readonly="true" placeholder="区域编码"> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="sort" |
|
|
|
:label="$t('dept.sort')"> |
|
|
|
<el-input-number v-model="dataForm.sort" |
|
|
@ -81,7 +96,9 @@ export default { |
|
|
|
return { |
|
|
|
visible: false, |
|
|
|
deptList: [], |
|
|
|
areaCodeList: [], |
|
|
|
deptListVisible: false, |
|
|
|
areaCodeListVisible: false, |
|
|
|
dataForm: { |
|
|
|
id: '', |
|
|
|
name: '', |
|
|
@ -109,6 +126,9 @@ export default { |
|
|
|
], |
|
|
|
typeKey: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'change' } |
|
|
|
], |
|
|
|
areaCode: [ |
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'change' } |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
@ -130,6 +150,7 @@ export default { |
|
|
|
this.dataForm.typeKey = '' |
|
|
|
} |
|
|
|
}) |
|
|
|
this.getAreaCodeDeptList() |
|
|
|
}) |
|
|
|
this.getSecondOrgDicList() |
|
|
|
}, |
|
|
@ -146,6 +167,15 @@ export default { |
|
|
|
this.deptList = res.data |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
// 获取部门区域编码列表 |
|
|
|
getAreaCodeDeptList () { |
|
|
|
return this.$http.get('/sys/dept/getDeptCode').then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.areaCodeList = res.data.options |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
// 获取二级党委字典列表 |
|
|
|
getSecondOrgDicList () { |
|
|
|
this.$http.get(`/sys/dict/listSimple/org_type`).then(({ data: res }) => { |
|
|
@ -169,6 +199,7 @@ export default { |
|
|
|
return this.deptListTreeSetDefaultHandle() |
|
|
|
} |
|
|
|
this.$refs.deptListTree.setCurrentKey(this.dataForm.pid) |
|
|
|
this.$refs.areaCodeListTree.setCurrentKey(this.dataForm.areaCode) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
// 上级部门树, 设置默认值 |
|
|
@ -182,6 +213,11 @@ export default { |
|
|
|
this.dataForm.parentName = data.name |
|
|
|
this.deptListVisible = false |
|
|
|
}, |
|
|
|
// 上级部门区域编码树, 选中 |
|
|
|
areaCodeListTreeCurrentChangeHandle (data) { |
|
|
|
this.dataForm.areaCode = data.code |
|
|
|
this.areaCodeListVisible = false |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
@ -217,4 +253,11 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.el-popover { |
|
|
|
height: 320px; |
|
|
|
overflow-y: scroll; |
|
|
|
} |
|
|
|
.el-dialog__footer { |
|
|
|
margin-top: 100px; |
|
|
|
} |
|
|
|
</style> |
|
|
|