Browse Source

榆山大屏 增加物业用户关系表

origin/sync_user
zhangfh 4 years ago
parent
commit
92749971ed
  1. 45
      src/views/modules/sys/user-add-or-update.vue

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

@ -36,6 +36,17 @@
:readonly="true"
:placeholder="$t('user.deptName')"></el-input>
</el-form-item>
<el-form-item label="物业项目"
prop="projectName">
<el-select v-model="dataForm.projectId" placeholder="用户类型"
@change="projectHandleChange" style="width: 100%">
<el-option v-for="item in projectList"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="用户类型"
prop="userTagKey">
<el-select v-model="dataForm.userTagKey"
@ -163,7 +174,7 @@
<script>
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
}
}
}

Loading…
Cancel
Save