|
|
|
|
@ -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) {
|
|
|
|
|
// previousPayment字段设置为this.fundLog中的total_act_money字段值
|
|
|
|
|
input.setAttribute('value', this.fundLog.total_act_money)
|
|
|
|
|
} else if (fieldName === 'totalPaid' && this.fundLog) {
|
|
|
|
|
// totalPaid字段设置为this.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)
|
|
|
|
|
}
|
|
|
|
|
|