修改资金审批表中的前期累计金额和累计金额

master
linyongLynn 2 months ago
parent 9a6460408d
commit 1f5c6aa5f2

@ -770,6 +770,7 @@ export default {
return Number(val).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
},
printHtml() {
console.log('printHtml',this.fundLog)
// HTML
const dom = this.$refs.printtable
if (dom) {
@ -802,8 +803,22 @@ export default {
//
if (this.getForms && this.getForms.includes('资金划拨审批单')) {
const amountFields = ['contractAmount', 'auditAmount', 'previousPayment', 'currentPayment', 'currentDuePayment', 'totalPaid', 'totalPlanned']
if (amountFields.includes(fieldName) && (!input.value || input.value === '')) {
input.setAttribute('value', '0')
if (amountFields.includes(fieldName)) {
if (fieldName === 'previousPayment' && this.fundLog) {
// previousPaymentthis.fundLogtotal_act_money
input.setAttribute('value', this.fundLog.total_act_money)
} else if (fieldName === 'totalPaid' && this.fundLog) {
// totalPaidthis.fundLog.total_act_money + currentPayment
const currentPaymentInput = dom.querySelector('input[data-field="currentDuePayment"]')
console.log('currentPaymentInput',currentPaymentInput.value)
const currentPaymentValue = currentPaymentInput ? (parseFloat(currentPaymentInput.value) || 0) : 0
const totalPaidValue = (parseFloat(this.fundLog.total_act_money) || 0) + currentPaymentValue
input.setAttribute('value', totalPaidValue.toString())
} else if (!input.value || input.value === '') {
input.setAttribute('value', '0')
} else {
input.setAttribute('value', input.value)
}
} else {
input.setAttribute('value', input.value)
}

Loading…
Cancel
Save