diff --git a/src/pages/revert/index.vue b/src/pages/revert/index.vue index c34ea84..faf00de 100644 --- a/src/pages/revert/index.vue +++ b/src/pages/revert/index.vue @@ -459,9 +459,9 @@ const salesChange = async () => { await nextTick() const val = form?.items || [] const sales = val.reduce((a, b) => { - // if(b.operator=='-' || b.operator=='+') return sub(a, b?.sales ?? 0) - if(b.operator=='-' || b.operator=='+') return a - return add(a, b?.sales ?? 0) + if(b.operator=='-') return sub(a, b?.sales ?? 0) + else if(b.operator=='+') return add(a, b?.sales ?? 0) + return a }, 0) form.sales = sales || 0 @@ -471,9 +471,9 @@ 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=='-' || b.operator=='+') return a - return add(a, b?.expenditure ?? 0) + if(b.operator=='-') return sub(a, b?.expenditure ?? 0) + else if(b.operator=='+') return add(a, b?.expenditure ?? 0) + return a }, 0) form.expenditure = expenditure || 0 }