diff --git a/src/views/modules/sys/user-add-or-update.vue b/src/views/modules/sys/user-add-or-update.vue index fe19e0a..12ff50d 100644 --- a/src/views/modules/sys/user-add-or-update.vue +++ b/src/views/modules/sys/user-add-or-update.vue @@ -36,6 +36,17 @@ :readonly="true" :placeholder="$t('user.deptName')"> + + + + + + import debounce from 'lodash/debounce' import { isEmail, isMobile } from '@/utils/validate' -import Cookies from "js-cookie" +import Cookies from 'js-cookie' export default { data () { return { @@ -178,6 +189,8 @@ export default { username: '', deptId: '0', deptName: '', + projectName: '', + projectId: '', password: '', comfirmPassword: '', realName: '', @@ -204,6 +217,7 @@ export default { }, verifyMobileList: [], userTagDictList: [], + projectList: [], loading: false } }, @@ -275,7 +289,7 @@ export default { this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` Promise.all([ this.getDeptList(), - this.getRoleList() + this.getRoleList(), ]).then(() => { if (this.dataForm.id) { this.getInfo() @@ -283,6 +297,7 @@ export default { }) }) this.getUserTagDicList() + this.getProjectList() }, // 根据手机号获取产品工作人员信息 relationEpmetStaffUser (mobile) { @@ -329,6 +344,14 @@ export default { this.roleList = res.data }).catch(() => { }) }, + getPropertyUserList () { + return this.$http.get('/sys/syspropertyuser/list').then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.propertyUserList = res.data + }).catch(() => { }) + }, // 获取用户标签字典列表 getUserTagDicList () { this.$http.get(`/sys/dict/listSimple/user_tag`).then(({ data: res }) => { @@ -338,6 +361,16 @@ export default { this.userTagDictList = res.data }).catch(() => { }) }, + // 获取用物业项目列表 + getProjectList () { + this.$http.get(`/property/project/dict`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.projectList = res.data + }).catch(() => { + }) + }, // 获取信息 getInfo () { this.$http.get(`/sys/user/${this.dataForm.id}`).then(({ data: res }) => { @@ -433,6 +466,14 @@ export default { }, handelError () { this.loading = false + }, + projectHandleChange (value) { + console.log(value) + let obj = this.projectList.find((item) => { + return item.dictValue === value + }) + console.log(obj.dictName) + this.dataForm.projectName = obj.dictName } } }