From 9d7b3deff138a1c10ccf9b112e71fad8c0a8a004 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 30 十月 2026 16:16:03 +0800
Subject: [PATCH] fix(crm): 合同产品数量保留一位小数

---
 src/views/crm/product/components/edit-table.vue |    4 ++--
 src/adapter/vxe-table.ts                        |    6 ++++++
 src/views/crm/contract/detail/approve/index.vue |    4 ++--
 src/views/crm/product/components/data.ts        |    3 ++-
 4 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/adapter/vxe-table.ts b/src/adapter/vxe-table.ts
index 01f7374..01d64f7 100644
--- a/src/adapter/vxe-table.ts
+++ b/src/adapter/vxe-table.ts
@@ -373,6 +373,12 @@
         return erpCountInputFormatter(cellValue);
       },
     });
+    // 鍚堝悓浜у搧鏁伴噺锛氫繚鐣� 1 浣嶅皬鏁�
+    vxeUI.formats.add('formatAmount1', {
+      tableCellFormatMethod({ cellValue }) {
+        return `${erpNumberFormatter(cellValue, 1)}`;
+      },
+    });
     // add by 鏄熻锛氭暟閲忔牸寮忓寲锛屼繚鐣� 2 浣�
     vxeUI.formats.add('formatAmount2', {
       tableCellFormatMethod({ cellValue }, digits = 2) {
diff --git a/src/views/crm/contract/detail/approve/index.vue b/src/views/crm/contract/detail/approve/index.vue
index adc3157..fb32102 100644
--- a/src/views/crm/contract/detail/approve/index.vue
+++ b/src/views/crm/contract/detail/approve/index.vue
@@ -8,7 +8,7 @@
 import { ContentWrap } from '@vben/common-ui';
 import { DICT_TYPE } from '@vben/constants';
 import {
-  erpCountInputFormatter,
+  erpNumberFormatter,
   erpPriceInputFormatter,
   formatDateTime,
 } from '@vben/utils';
@@ -49,7 +49,7 @@
       field: 'count',
       title: '鏁伴噺',
       minWidth: 100,
-      formatter: ({ cellValue }) => erpCountInputFormatter(cellValue) || '-',
+      formatter: ({ cellValue }) => erpNumberFormatter(cellValue, 1) || '-',
     },
     {
       field: 'totalPrice',
diff --git a/src/views/crm/product/components/data.ts b/src/views/crm/product/components/data.ts
index 462508a..2c742e5 100644
--- a/src/views/crm/product/components/data.ts
+++ b/src/views/crm/product/components/data.ts
@@ -41,7 +41,8 @@
     {
       field: 'count',
       title: '鏁伴噺',
-      formatter: 'formatAmount3',
+      // 鍟嗘満淇濈暀 3 浣嶏紱鍚堝悓鏁伴噺淇濈暀 1 浣嶏紙瑙� adapter 鐨� formatAmount1锛�
+      formatter: showBusinessPrice ? 'formatAmount3' : 'formatAmount1',
     },
     {
       field: 'totalPrice',
diff --git a/src/views/crm/product/components/edit-table.vue b/src/views/crm/product/components/edit-table.vue
index f7cb97a..8427b1e 100644
--- a/src/views/crm/product/components/edit-table.vue
+++ b/src/views/crm/product/components/edit-table.vue
@@ -155,8 +155,8 @@
     <template #count="{ row }">
       <InputNumber
         v-model:value="row.count"
-        :min="0.001"
-        :precision="3"
+        :min="isBusiness ? 0.001 : 0.1"
+        :precision="isBusiness ? 3 : 1"
         @change="handlePriceChange(row)"
       />
     </template>

--
Gitblit v1.9.3