普通项目;工作组变更--文件维护接口;批量开票
This commit is contained in:
@@ -169,7 +169,7 @@ export default {
|
||||
dataSource: [],
|
||||
inputIncomingAmount: null, // 输入的来款金额
|
||||
disableMixinCreated: true,
|
||||
sumAmountOwed: 0, // 总欠款金额
|
||||
sumAmountOwed: 0 // 总欠款金额
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -203,6 +203,7 @@ export default {
|
||||
this.loadData()
|
||||
},
|
||||
close() {
|
||||
this.form.resetFields()
|
||||
this.clearThisTimeAmount()
|
||||
this.$emit('update:visible', false)
|
||||
},
|
||||
@@ -218,21 +219,16 @@ export default {
|
||||
this.$message.warn('来款金额大于总欠款金额,请修改')
|
||||
return
|
||||
}
|
||||
this.clearThisTimeAmount().then(() => {
|
||||
this.calculateThisTimeAmount()
|
||||
this.$forceUpdate()
|
||||
})
|
||||
this.clearThisTimeAmount()
|
||||
this.calculateThisTimeAmount()
|
||||
},
|
||||
/**
|
||||
* 清空本次来款金额
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
clearThisTimeAmount() {
|
||||
return new Promise(resolve => {
|
||||
this.dataSource.forEach(item => {
|
||||
item.thisIncomingAmount = 0.00
|
||||
})
|
||||
resolve()
|
||||
this.dataSource.forEach(item => {
|
||||
item.thisIncomingAmount = 0.00
|
||||
})
|
||||
},
|
||||
/**
|
||||
@@ -243,23 +239,22 @@ export default {
|
||||
this.$message.warn('请输入大于0的来款金额')
|
||||
return
|
||||
}
|
||||
this.dataSource.forEach(item => {
|
||||
this.dataSource.forEach((item, index) => {
|
||||
// 当前项目欠款是否 >0
|
||||
if (Number(item.amountOwed) > 0) {
|
||||
// 输入的来款金额是否 >= 当前项目欠款
|
||||
if (this.inputIncomingAmount >= Number(item.amountOwed)) {
|
||||
item.thisIncomingAmount = this.getAddZero(Number(item.amountOwed))
|
||||
this.inputIncomingAmount -= Number(item.amountOwed)
|
||||
// item.amountOwed = 0
|
||||
} else {
|
||||
// 输入的来款金额小于当前项目欠款且剩余的输入来款金额大于0,则将剩余全部来款算入当前项目的此次来款
|
||||
if (this.inputIncomingAmount > 0) {
|
||||
item.thisIncomingAmount = this.getAddZero(this.inputIncomingAmount)
|
||||
// item.amountOwed = Number(item.amountOwed) - item.thisIncomingAmount
|
||||
this.inputIncomingAmount = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$set(this.dataSource, index, item)
|
||||
})
|
||||
}
|
||||
,
|
||||
|
||||
Reference in New Issue
Block a user