From 51e8ee5d7cf620025e621fb38c3e5fc2017e287a Mon Sep 17 00:00:00 2001 From: zhaoxiao Date: Wed, 27 Oct 2021 18:08:18 +0800 Subject: [PATCH] =?UTF-8?q?[bug]=20=E6=94=B6=E5=85=A5=E5=90=88=E5=90=8C?= =?UTF-8?q?=E5=85=B3=E8=81=94=E9=A1=B9=E7=9B=AE--=E6=99=AE=E9=80=9A?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=A7=91=E5=AE=A4=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/RevenueContractModule.vue | 40 ++++++++----------- .../modules/SelectProjectModule.vue | 4 +- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/views/contractManagement/revenueContract/modules/RevenueContractModule.vue b/src/views/contractManagement/revenueContract/modules/RevenueContractModule.vue index d2ddc59..1cc827f 100644 --- a/src/views/contractManagement/revenueContract/modules/RevenueContractModule.vue +++ b/src/views/contractManagement/revenueContract/modules/RevenueContractModule.vue @@ -502,6 +502,7 @@ export default { this.accountsReceivableNum = record.accountsReceivableAmount this.amountReceivedNum = record.amountReceived this.model = Object.assign({}, record) + this.getUserDetailByUserId() this.$nextTick(() => { this.form.setFieldsValue(pick(this.model, 'contractNum', 'contractName', 'signedCompany', 'signedContactsId', 'opening', 'principalId', 'departmentName', 'contractAmount', 'rate', 'noTaxAmount', 'contractDate', 'terminationDate', 'contractTimePoints', 'accountsReceivableAmount', 'amountReceived', 'outstandingAmount', 'accountStatus', 'contractPaymentTimes', 'pack', 'packYear')) this.confirmLoading = false @@ -806,21 +807,16 @@ export default { switch (type) { // 普通项目 case 1: - this.getUserDetailByUserId().then(res => { - this.departId = res - // 混入筛选条件 - this.$refs.selectProjectModule.filters = { - chargeCompanyId: this.selectedCompany.id, - contractId: this.contractId, - departId: this.departId // 一个用户多部门情况下传给后端第一个部门id - } - // 获取负责人列表 - this.$refs.selectProjectModule.departChange(this.departId) - // 打开弹窗 - this.$refs.selectProjectModule.open() - }).catch((err) => { - this.$message.warn(err) - }) + // 混入筛选条件 + this.$refs.selectProjectModule.filters = { + chargeCompanyId: this.selectedCompany.id, + contractId: this.contractId + // departId: this.departId // 一个用户多部门情况下传给后端第一个部门id + } + // 获取负责人列表 + this.$refs.selectProjectModule.departChange(this.departId) + // 打开弹窗 + this.$refs.selectProjectModule.open() break // 工作组项目 case 2: @@ -855,14 +851,12 @@ export default { let param = { id: this.model.principalId } - return new Promise((resolve, reject) => { - queryUserByDepartId(param).then(res => { - if (res.success) { - resolve(res.result[0].departIds) - } else { - reject(res.message) - } - }) + queryUserByDepartId(param).then(res => { + if (res.success) { + this.departId = res.result[0].departIds + } else { + console.log(res.message) + } }) }, /** diff --git a/src/views/contractManagement/revenueContract/modules/SelectProjectModule.vue b/src/views/contractManagement/revenueContract/modules/SelectProjectModule.vue index 3313212..b9b86fc 100644 --- a/src/views/contractManagement/revenueContract/modules/SelectProjectModule.vue +++ b/src/views/contractManagement/revenueContract/modules/SelectProjectModule.vue @@ -150,6 +150,7 @@ export default { requird: false, default: null }, + // 负责人id principal: { type: String, requird: false, @@ -261,7 +262,6 @@ export default { } }, methods: { - /** * 运行年份变化 */ @@ -278,7 +278,7 @@ export default { // 运行年份默认为当年 this.queryParam.year = new Date().getFullYear().toString() this.lastQueryParam.year = new Date().getFullYear().toString() - // + // 默认科室、负责人 this.queryParam.principalId = this.principal this.lastQueryParam.principalId = this.principal this.queryParam.departId = this.departId