From 539a9c4efc47708b343217f8e50182565ec9ea6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=A5=89=E6=BA=90?= <1976974459@qq.com> Date: Fri, 8 Sep 2023 17:38:15 +0800 Subject: [PATCH] =?UTF-8?q?2023-09-08=20plm=E5=AE=A2=E6=88=B7=E6=8F=90?= =?UTF-8?q?=E4=BA=A42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../customerInformationManagement.vue | 239 ++++++++++++++---- 1 file changed, 191 insertions(+), 48 deletions(-) diff --git a/src/views/modules/customer/customerInformationManagement.vue b/src/views/modules/customer/customerInformationManagement.vue index 767216e..013fc62 100644 --- a/src/views/modules/customer/customerInformationManagement.vue +++ b/src/views/modules/customer/customerInformationManagement.vue @@ -3,13 +3,18 @@ - + - + - + + + + + + 查询 @@ -179,8 +184,8 @@ - - + + @@ -520,29 +525,41 @@ - + +
确定 - 取消 + 取消
- + +
确定 - 取消 + 取消
@@ -631,7 +648,7 @@
确定 - 取消 + 取消
@@ -1600,6 +1617,13 @@ message: ' ', trigger: 'change' } + ], + contactPhoneNumber1: [ + { + required: true, + message: ' ', + trigger: 'change' + } ] }, addressRules: { @@ -2287,31 +2311,68 @@ this.$message.warning('请勾选要删除的联系人!') return } - this.$confirm(`是否删除这 `+ this.contactSelections.length +` 条联系人信息?`, '提示', { + this.$confirm(`是否删除这 `+ this.contactSelections.length +` 条联系人信息?`, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { - let tempData = { - contactList: this.contactSelections + let tempContactName = null + for (let i = 0; i < this.contactSelections.length; i++){ + // 判断是否有主联系人 + if (this.contactSelections[i].primaryContact === 'Y') { + tempContactName = this.contactSelections[i].contactName + } } - customerContactDelete(tempData).then(({data}) => { - if (data && data.code === 0) { - this.getDataList() - this.contactSelections = [] - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { + if (tempContactName !== '' || tempContactName != null) { + this.$confirm(tempContactName +` 为主联系人,是否确认删除?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let tempData = { + contactList: this.contactSelections + } + customerContactDelete(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getCustomerContactList() + this.contactSelections = [] + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) } }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + }).catch(() => { + }) + } else { + let tempData = { + contactList: this.contactSelections } - }) + customerContactDelete(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getCustomerContactList() + this.contactSelections = [] + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } }).catch(() => { }) }, @@ -2328,26 +2389,63 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { - let tempData = { - addressList: this.addressSelections + let tempAddressName = null + for (let i = 0; i < this.addressSelections.length; i++){ + // 判断是否有主联系地址 + if (this.addressSelections[i].primaryAddress === 'Y') { + tempAddressName = this.addressSelections[i].addressName + } } - customerAddressDelete(tempData).then(({data}) => { - if (data && data.code === 0) { - this.getCustomerAddressList() - this.addressSelections = [] - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { + if (tempAddressName !== '' || tempAddressName != null) { + this.$confirm(tempAddressName +` 为主联系地址,是否确认删除?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let tempData = { + addressList: this.addressSelections + } + customerAddressDelete(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getCustomerAddressList() + this.addressSelections = [] + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) } }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + }).catch(() => { + }) + } else { + let tempData = { + addressList: this.addressSelections } - }) + customerAddressDelete(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getCustomerAddressList() + this.addressSelections = [] + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } }).catch(() => { }) }, @@ -2437,6 +2535,10 @@ this.$message.warning('请输入联系人!') return } + if (this.contactModalData.contactPhoneNumber1 === '' || this.contactModalData.contactPhoneNumber1 == null) { + this.$message.warning('请输入联系人电话(1)!') + return + } if (this.contactModalData.position === '' || this.contactModalData.position == null) { this.$message.warning('请输入公司职务!') return @@ -2732,6 +2834,11 @@ * 项目经理选择模态框 */ managerChooseModal () { + // 清空穿梭框的选中值 + this.$nextTick(() => { + this.$refs.managerTransfer.$refs.leftPanel.checked = [] + this.$refs.managerTransfer.$refs.rightPanel.checked = [] + }) let inData = { site: this.projectInformationModalData.site, projectId: this.projectInformationModalData.projectId, @@ -2739,14 +2846,14 @@ searchOperatorWithSite(inData).then(({data}) => { this.operatorList = data.rows }) - this.projectManagerList = JSON.parse(JSON.stringify(this.projectInformationModalData.projectManagerList)); + this.projectManagerList = JSON.parse(JSON.stringify(this.projectInformationModalData.projectManagerList)) this.managerFlag = true }, /** * 项目经理选择 */ saveManagerList () { - let projectManagerName = ''; + let projectManagerName = '' for (let i = 0; i < this.projectManagerList.length; i++) { let select = this.operatorList.filter(item => item.operatorId === this.projectManagerList[i]) if (select.length > 0) { @@ -2754,13 +2861,18 @@ } } this.projectInformationModalData.projectManagerName = projectManagerName - this.projectInformationModalData.projectManagerList = JSON.parse(JSON.stringify(this.projectManagerList)); + this.projectInformationModalData.projectManagerList = JSON.parse(JSON.stringify(this.projectManagerList)) this.managerFlag = false }, /** * 项目负责人选择模态框 */ ownerChooseModal () { + // 清空穿梭框的选中值 + this.$nextTick(() => { + this.$refs.ownerTransfer.$refs.leftPanel.checked = [] + this.$refs.ownerTransfer.$refs.rightPanel.checked = [] + }) let inData = { site: this.projectInformationModalData.site, projectId: this.projectInformationModalData.projectId, @@ -2899,5 +3011,36 @@ /deep/ .customer-tab .el-tabs__content { padding: 0px !important; } +.el-transfer-panel { + border: 2px solid #17b3a3; + border-radius: 4px; + overflow: hidden; + background: #fff; + display: inline-block; + vertical-align: middle; + width: 200px; + max-height: 100%; + -webkit-box-sizing: border-box; + box-sizing: border-box; + position: relative; +} + +.el-transfer-panel .el-transfer-panel__header { + height: 40px; + line-height: 40px; + background: #17b3a3; + margin: 0; + padding-left: 15px; + border-bottom: 1px solid #17b3a3; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: #000; +} + +.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label { + font-size: 14px; + color: #303133; + font-weight: 400; +}