[bug] 收入合同关联项目--普通项目科室问题;

This commit is contained in:
zhaoxiao
2021-10-27 18:08:18 +08:00
parent 12b72221dd
commit 51e8ee5d7c
2 changed files with 19 additions and 25 deletions
@@ -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)
}
})
},
/**
@@ -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