From 9b2776e533d7ddd0c0e8e8f46287639ee9fa7239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Wed, 10 Dec 2025 15:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E4=BC=B0=E9=80=80=E7=A8=8E=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E8=87=AA=E5=AE=9A=E4=B9=89=E8=BE=93?= =?UTF-8?q?=E5=85=A5=20=E9=87=8D=E6=96=B0=E8=AE=A1=E7=AE=97=E5=88=A9?= =?UTF-8?q?=E6=B6=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useStockingForm.ts | 15 +++++++++++++++ src/views/crmpc/stocking/Add.vue | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) 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 @@ -