Browse Source

用户管理增加关联部门信息,用于居民端跳转工作端和数据端关联账号使用

feature/syp_points
liuchuang 5 years ago
parent
commit
72a46953e8
  1. 34
      src/views/modules/sys/user-add-or-update.vue

34
src/views/modules/sys/user-add-or-update.vue

@ -35,6 +35,28 @@
:readonly="true"
:placeholder="$t('user.deptName')"></el-input>
</el-form-item>
<el-form-item prop="relationDeptName"
label="关联部门"
class="dept-list">
<el-popover v-model="relationDeptListVisible"
ref="relationDeptListPopover"
placement="bottom-start"
trigger="click">
<el-tree :data="relationDeptList"
:props="{ label: 'name', children: 'children' }"
node-key="id"
ref="relationDeptListTree"
:highlight-current="true"
:expand-on-click-node="false"
accordion
@current-change="relationDeptListTreeCurrentChangeHandle">
</el-tree>
</el-popover>
<el-input v-model="dataForm.relationDeptName"
v-popover:relationDeptListPopover
:readonly="true"
placeholder="关联部门"></el-input>
</el-form-item>
<el-form-item label="用户类型"
prop="userTagKey">
<el-select v-model="dataForm.userTagKey"
@ -120,7 +142,9 @@ export default {
return {
visible: false,
deptList: [],
relationDeptList: [],
deptListVisible: false,
relationDeptListVisible: false,
roleList: [],
roleIdListDefault: [],
dataForm: {
@ -128,6 +152,8 @@ export default {
username: '',
deptId: '0',
deptName: '',
relationDeptId: '',
relationDeptName: '',
password: '',
comfirmPassword: '',
realName: '',
@ -224,6 +250,7 @@ export default {
return this.$message.error(res.msg)
}
this.deptList = res.data
this.relationDeptList = res.data
}).catch(() => { })
},
//
@ -256,6 +283,7 @@ export default {
roleIdList: []
}
this.$refs.deptListTree.setCurrentKey(this.dataForm.deptId)
this.$refs.relationDeptListTree.setCurrentKey(this.dataForm.relationDeptId)
// ,
for (var i = 0; i < res.data.roleIdList.length; i++) {
if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) {
@ -272,6 +300,12 @@ export default {
this.dataForm.deptName = data.name
this.deptListVisible = false
},
// ,
relationDeptListTreeCurrentChangeHandle (data, node) {
this.dataForm.relationDeptId = data.id
this.dataForm.relationDeptName = data.name
this.relationDeptListVisible = false
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {

Loading…
Cancel
Save