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" :readonly="true"
:placeholder="$t('user.deptName')"></el-input> :placeholder="$t('user.deptName')"></el-input>
</el-form-item> </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="用户类型" <el-form-item label="用户类型"
prop="userTagKey"> prop="userTagKey">
<el-select v-model="dataForm.userTagKey" <el-select v-model="dataForm.userTagKey"
@ -163,7 +174,7 @@
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { isEmail, isMobile } from '@/utils/validate' import { isEmail, isMobile } from '@/utils/validate'
import Cookies from "js-cookie" import Cookies from 'js-cookie'
export default { export default {
data () { data () {
return { return {
@ -178,6 +189,8 @@ export default {
username: '', username: '',
deptId: '0', deptId: '0',
deptName: '', deptName: '',
projectName: '',
projectId: '',
password: '', password: '',
comfirmPassword: '', comfirmPassword: '',
realName: '', realName: '',
@ -204,6 +217,7 @@ export default {
}, },
verifyMobileList: [], verifyMobileList: [],
userTagDictList: [], userTagDictList: [],
projectList: [],
loading: false loading: false
} }
}, },
@ -275,7 +289,7 @@ export default {
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}` this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
Promise.all([ Promise.all([
this.getDeptList(), this.getDeptList(),
this.getRoleList() this.getRoleList(),
]).then(() => { ]).then(() => {
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo() this.getInfo()
@ -283,6 +297,7 @@ export default {
}) })
}) })
this.getUserTagDicList() this.getUserTagDicList()
this.getProjectList()
}, },
// //
relationEpmetStaffUser (mobile) { relationEpmetStaffUser (mobile) {
@ -329,6 +344,14 @@ export default {
this.roleList = res.data this.roleList = res.data
}).catch(() => { }) }).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 () { getUserTagDicList () {
this.$http.get(`/sys/dict/listSimple/user_tag`).then(({ data: res }) => { this.$http.get(`/sys/dict/listSimple/user_tag`).then(({ data: res }) => {
@ -338,6 +361,16 @@ export default {
this.userTagDictList = res.data this.userTagDictList = res.data
}).catch(() => { }) }).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 () { getInfo () {
this.$http.get(`/sys/user/${this.dataForm.id}`).then(({ data: res }) => { this.$http.get(`/sys/user/${this.dataForm.id}`).then(({ data: res }) => {
@ -433,6 +466,14 @@ export default {
}, },
handelError () { handelError () {
this.loading = false 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