采购合同合同金额 联动

master
Harry Yang 2023-01-05 19:24:18 +08:00
parent 7932299cb3
commit d6f62e53ce
2 changed files with 21 additions and 36 deletions

View File

@ -687,6 +687,15 @@
* 保存 业务采购合同清单明细,返回上一级的表单界面
*/
saveProcurementContractDetail() {
let contractAmount = 0
for (let element of this.procurementDetails) {
const children = element['children'] || []
contractAmount += element['totalTaxInclude'] || 0
for (let child of children) {
contractAmount += child['totalTaxInclude'] || 0
}
}
this.contractAmount = contractAmount
this.goToProcurementContract()
},
@ -836,6 +845,7 @@
}
ret.push(parent)
}
console.log(ret)
return ret
}
@ -1298,24 +1308,6 @@
this.applyDeptSectorOptions = JSON.parse('${applyDeptSectorOptions}')
},
watch: {
// 每当 question 改变时,这个函数就会执行
procurementDetails(newValue, oldValue) {
if (this.processType === procurementContract) {
let contractAmount = 0
for (let element of newValue) {
const children = element['children'] || []
contractAmount = newValue['totalTaxInclude'] || 0
for (let child of children) {
contractAmount = contractAmount + child['contractAmount'] || 0
}
}
this.contractAmount = contractAmount
}
}
},
filters: {
ellipsis(value, limit = 40) {
if (!value) return ''

View File

@ -255,7 +255,7 @@
</el-form-item>
<el-form-item label="合同金额">
<span v-if="projectSelected">{{processForm.contractAmount}}元</span>
<span v-if="projectSelected">{{processForm.contractAmount|numberFormat}}元</span>
<span v-else>未选择项目</span>
</el-form-item>
@ -834,10 +834,20 @@
* 保存 业务采购合同清单明细
*/
saveProcurementContractDetail() {
let contractAmount = 0
for (let element of this.procurementDetails) {
const children = element['children'] || []
contractAmount += element['totalTaxInclude'] || 0
for (let child of children) {
contractAmount += child['totalTaxInclude'] || 0
}
}
this.processForm['contractAmount'] = contractAmount
this.changeMode(procurementContractProcess)
this.processType = procurementContract
},
goToContractDetail() {
const { projectId } = this.processForm
if (projectId) {
@ -1475,23 +1485,6 @@
// this.handleSelectProject({ id: 135 })
this.applyDeptSectorOptions = JSON.parse('${applyDeptSectorOptions}')
},
watch: {
// 每当 question 改变时,这个函数就会执行
procurementDetails(newValue, oldValue) {
if (this.processType === procurementContract) {
let contractAmount = 0
for (let element of newValue) {
const children = element['children'] || []
contractAmount = newValue['totalTaxInclude'] || 0
for (let child of children) {
contractAmount = contractAmount + child['contractAmount'] || 0
}
}
this.processForm['contractAmount'] = contractAmount
}
}
},
filters: {
ellipsis(value, limit = 40) {