From 949d344cd69a74d93141ffe74fecc05c0f4f5d8a Mon Sep 17 00:00:00 2001
From: tuqin <tuqin@tuqin.cn>
Date: 星期一, 02 十一月 2026 10:17:38 +0800
Subject: [PATCH] fix(crm): 修正商机「整单折扣」算法错误
---
src/views/crm/business/data.ts | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/views/crm/business/data.ts b/src/views/crm/business/data.ts
index d1c9a3e..7f81ee9 100644
--- a/src/views/crm/business/data.ts
+++ b/src/views/crm/business/data.ts
@@ -151,15 +151,15 @@
dependencies: {
triggerFields: ['totalProductPrice', 'discountPercent'],
trigger(values, form) {
- const discountPrice =
- erpPriceMultiply(
- values.totalProductPrice,
- values.discountPercent / 100,
- ) ?? 0;
- form.setFieldValue(
- 'totalPrice',
- values.totalProductPrice - discountPrice,
- );
+ const totalProductPrice = values.totalProductPrice ?? 0;
+ const discountPercent = values.discountPercent;
+ // 涓� form.vue 淇濇寔涓�鑷达細98 琛ㄧず 98 鎶橈紱涓虹┖鎴� 0 瑙嗕负涓嶆墦鎶�
+ const totalPrice =
+ !discountPercent || discountPercent === 0
+ ? totalProductPrice
+ : (erpPriceMultiply(totalProductPrice, discountPercent / 100) ??
+ 0);
+ form.setFieldValue('totalPrice', totalPrice);
},
},
},
--
Gitblit v1.9.3