From 2ee69f2c07b7cdc5b1f209d3b4d9606374b94c25 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 02 十一月 2026 16:52:04 +0800
Subject: [PATCH] feat(erp): 采购/销售明细按含税单价口径联算,采购申请与申请采购单合并入口

---
 src/views/erp/sale/order/modules/item-form.vue |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/views/erp/sale/order/modules/item-form.vue b/src/views/erp/sale/order/modules/item-form.vue
index eea4f3c..6bff092 100644
--- a/src/views/erp/sale/order/modules/item-form.vue
+++ b/src/views/erp/sale/order/modules/item-form.vue
@@ -12,6 +12,7 @@
 import { Input, InputNumber, Select, Tag } from 'ant-design-vue';
 
 import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
+import { calcTaxIncludedLine } from '#/utils';
 import { MdmItemSelect } from '#/views/basicData/mdm/components';
 
 import { useFormItemColumns } from '../data';
@@ -170,7 +171,7 @@
   handleRowChange(row);
 }
 
-/** 澶勭悊琛屾暟鎹彉鏇� */
+/** 澶勭悊琛屾暟鎹彉鏇达細鏁伴噺銆佸惈绋庡崟浠枫�佺◣鐜囧彉鍖栧悗绔嬪嵆閲嶇畻閲戦 */
 function handleRowChange(row: any) {
   const index = tableData.value.findIndex((item) => item.seq === row.seq);
   if (index === -1) {
@@ -178,16 +179,14 @@
   } else {
     tableData.value[index] = row;
   }
+  calcTaxIncludedLine(row);
   emit('update:items', [...tableData.value]);
 }
 
 /** 鍒濆鍖栬鏁版嵁 */
 function initRow(row: ErpSaleOrderApi.SaleOrderItem) {
   if (row.productPrice && row.count) {
-    row.totalProductPrice = erpPriceMultiply(row.productPrice, row.count) ?? 0;
-    row.taxPrice =
-      erpPriceMultiply(row.totalProductPrice, (row.taxPercent || 0) / 100) ?? 0;
-    row.totalPrice = row.totalProductPrice + row.taxPrice;
+    calcTaxIncludedLine(row);
   }
   // 榛樿闇�瑕佺敓浜�
   if (row.needProduction === undefined) {
@@ -207,7 +206,7 @@
         throw new Error(`绗� ${i + 1} 琛岋細浜у搧鏁伴噺涓嶈兘涓虹┖`);
       }
       if (!item.productPrice || item.productPrice <= 0) {
-        throw new Error(`绗� ${i + 1} 琛岋細浜у搧鍗曚环涓嶈兘涓虹┖`);
+        throw new Error(`绗� ${i + 1} 琛岋細鍚◣鍗曚环涓嶈兘涓虹┖`);
       }
     }
   }
@@ -311,11 +310,11 @@
           <div class="flex space-x-4">
             <span>鏁伴噺锛歿{ erpCountInputFormatter(summaries.count) }}</span>
             <span>
-              閲戦锛歿{ erpPriceInputFormatter(summaries.totalProductPrice) }}
+              涓嶅惈绋庨噾棰濓細{{ erpPriceInputFormatter(summaries.totalProductPrice) }}
             </span>
             <span>绋庨锛歿{ erpPriceInputFormatter(summaries.taxPrice) }}</span>
             <span>
-              绋庨鍚堣锛歿{ erpPriceInputFormatter(summaries.totalPrice) }}
+              鍚◣鎬讳环锛歿{ erpPriceInputFormatter(summaries.totalPrice) }}
             </span>
           </div>
         </div>

--
Gitblit v1.9.3