lion 3 months ago
commit f1597cc1fe

@ -354,6 +354,7 @@ export default {
// total // total
const totalInput = dom.querySelector('input[data-field="total"]') const totalInput = dom.querySelector('input[data-field="total"]')
console.log('totalInput', totalInput.value)
if (totalInput) { if (totalInput) {
totalInput.removeEventListener('input', this.updateUpperCaseFromTotal) totalInput.removeEventListener('input', this.updateUpperCaseFromTotal)
totalInput.removeEventListener('change', this.updateUpperCaseFromTotal) totalInput.removeEventListener('change', this.updateUpperCaseFromTotal)
@ -545,11 +546,22 @@ export default {
console.log('计算得到的总金额:', total) console.log('计算得到的总金额:', total)
// //
const totalInput = dom.querySelector('input[data-field="total"]') const totalInput = dom.querySelector('input[data-field="total"]')
if (totalInput) { if (totalInput) {
totalInput.value = "¥"+total.toFixed(2) if (amountInputs.length > 0) {
console.log('更新总金额输入框:', totalInput.value) totalInput.value = "¥"+total.toFixed(2)
console.log('更新总金额输入框:', totalInput.value)
} else {
// amountInputs.length0
const currentValue = parseFloat(totalInput.value.replace(/¥/g, '')) || 0
totalInput.value = "¥" + currentValue.toFixed(2)
console.log('更新总金额输入框(无amount输入框时):', totalInput.value)
total = currentValue
}
} }
// //

Loading…
Cancel
Save