diff --git a/package.json b/package.json index aaef066..5c5ea58 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "dependencies": { "@tinymce/tinymce-vue": "^3.2.4", "axios": "^0.18.1", + "babel-eslint": "^7.2.3", "babel-plugin-component": "^1.1.1", "echarts": "^4.8.0", "element-theme": "^2.0.1", diff --git a/public/index.html b/public/index.html index d4853dc..74f5604 100644 --- a/public/index.html +++ b/public/index.html @@ -37,9 +37,9 @@ <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> <% } %> diff --git a/src/views/modules/sys/user-add-or-update.vue b/src/views/modules/sys/user-add-or-update.vue index 957753b..4ca646f 100644 --- a/src/views/modules/sys/user-add-or-update.vue +++ b/src/views/modules/sys/user-add-or-update.vue @@ -127,6 +127,15 @@ + +
+ + 点击绑定 + 清空 +
+
@@ -188,7 +197,17 @@ export default { mobile: '', roleIdList: [], status: 1, - userTagKey: '' + userTagKey: '', + wgyInfo: { + id: '', + sysUserId: '', + staffId: '', + staffName: '', + mobile: '', + agencyId: '', + agencyAllName: '', + customerId: '' + } }, userTagDictList: [] } @@ -269,6 +288,39 @@ export default { }) this.getUserTagDicList() }, + // 根据手机号获取产品工作人员信息 + relationEpmetStaffUser (mobile) { + if (mobile === '') { + return this.$message.warning('请先填写手机号') + } + this.$http.get(`/sys/sysepmetuserrelation/getstaffuser/${mobile}`).then(({ data: res }) => { + this.dataForm.wgyInfo.staffId = '888' + this.dataForm.wgyInfo.staffName = '888' + this.dataForm.wgyInfo.mobile = '18800112088' + this.dataForm.wgyInfo.agencyId = '888' + this.dataForm.wgyInfo.agencyAllName = '888' + this.dataForm.wgyInfo.customerId = '888' + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.dataForm.wgyInfo = { + ...this.dataForm.wgyInfo, + ...res.data + } + if (res.data.staffId === '') { + return this.$message.warning('未匹配到当前手机号绑定网格员') + } + }).catch(() => { }) + }, + // 清空已绑定的产品工作人员信息 + unbindEpmetUser () { + this.dataForm.wgyInfo.staffId = '' + this.dataForm.wgyInfo.staffName = '' + this.dataForm.wgyInfo.mobile = '' + this.dataForm.wgyInfo.agencyId = '' + this.dataForm.wgyInfo.agencyAllName = '' + this.dataForm.wgyInfo.customerId = '' + }, // 获取部门列表 getDeptList () { return this.$http.get('/sys/dept/list').then(({ data: res }) => { @@ -351,6 +403,10 @@ export default { if (this.dataForm.relationLeaderDeptName === '') { this.dataForm.relationLeaderDeptId = '' } + // 判断当前用户手机号是否与网格员手机号匹配 + if (this.dataForm.wgyInfo.mobile !== '' && this.dataForm.mobile !== this.dataForm.wgyInfo.mobile) { + return this.$message.error('当前手机号与网格员信息不匹配,请重新绑定') + } this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/user', { ...this.dataForm, roleIdList: [