修改自动计算

main
unknown 2024-05-14 13:39:33 +08:00
parent 197ac83ccb
commit 244e81890c
1 changed files with 4 additions and 2 deletions

View File

@ -459,7 +459,8 @@ const salesChange = async () => {
await nextTick()
const val = form?.items || []
const sales = val.reduce((a, b) => {
if(b.operator=='-') return sub(a, b?.sales ?? 0)
// if(b.operator=='-' || b.operator=='+') return sub(a, b?.sales ?? 0)
if(b.operator=='-' || b.operator=='+') return a
return add(a, b?.sales ?? 0)
}, 0)
@ -470,7 +471,8 @@ const expenditureChange = async () => {
await nextTick()
const val = form?.items || []
const expenditure = val.reduce((a, b) => {
if(b.operator=='-') return sub(a, b?.expenditure ?? 0)
// if(b.operator=='-') return sub(a, b?.expenditure ?? 0)
if(b.operator=='-' || b.operator=='+') return a
return add(a, b?.expenditure ?? 0)
}, 0)
form.expenditure = expenditure || 0