diff --git a/src/composables/useStockingForm.ts b/src/composables/useStockingForm.ts index 8860ae3..d54a3ed 100644 --- a/src/composables/useStockingForm.ts +++ b/src/composables/useStockingForm.ts @@ -1385,6 +1385,21 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) { { deep: true } ) + // 当用户手动输入预估退税额时,重新计算利润 + watch( + () => items.value.map((item: any) => item.tax_refund), + () => { + if (isPopulating.value) return + items.value.forEach((it: any, index: number) => { + if (!items.value[index]) return + const profit = calcProfit(it) + items.value[index].profit = isNaN(profit) ? 0 : Number(profit.toFixed(2)) + ;(items.value[index] as any).profit_currency = (it as any).profit_currency || 'CNY' + }) + }, + { deep: true } + ) + // 处理用户编辑状态的方法 const handleUserEdit = (index: number) => { // 标记用户正在编辑这一行 diff --git a/src/views/crmpc/stocking/Add.vue b/src/views/crmpc/stocking/Add.vue index a611eac..9a11444 100644 --- a/src/views/crmpc/stocking/Add.vue +++ b/src/views/crmpc/stocking/Add.vue @@ -455,8 +455,8 @@ -