From 56f885d9b8fca8a2d23cdd9d1e271ce5690df4ac Mon Sep 17 00:00:00 2001 From: liuchuang Date: Tue, 13 Jul 2021 13:50:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AB=AF=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=E7=BD=91=E6=A0=BC=E5=91=98=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/sys/user-add-or-update.vue | 52 +++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/src/views/modules/sys/user-add-or-update.vue b/src/views/modules/sys/user-add-or-update.vue index bdafb95..dfd21dd 100644 --- a/src/views/modules/sys/user-add-or-update.vue +++ b/src/views/modules/sys/user-add-or-update.vue @@ -83,6 +83,15 @@ + +
+ + 点击绑定 + 清空 +
+
@@ -157,7 +166,17 @@ export default { status: 1, verifyFlag: '0', verifyMobile: '', - userTagKey: '' + userTagKey: '', + wgyInfo: { + id: '', + sysUserId: '', + staffId: '', + staffName: '', + mobile: '', + agencyId: '', + agencyAllName: '', + customerId: '' + } }, verifyMobileList: [], userTagDictList: [] @@ -239,6 +258,33 @@ export default { }) this.getUserTagDicList() }, + // 根据手机号获取产品工作人员信息 + relationEpmetStaffUser (mobile) { + if (mobile === '') { + return this.$message.warning('请先填写手机号') + } + this.$http.get(`/sys/sysepmetuserrelation/getstaffuser/${mobile}`).then(({ data: res }) => { + 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 }) => { @@ -324,6 +370,10 @@ export default { if (this.dataForm.verifyFlag === '0') { this.dataForm.verifyMobile = '' } + // 判断当前用户手机号是否与网格员手机号匹配 + 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: [