From 2c354c2d7ea51b0f78c858fef1edd93354405c6b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 12 十月 2026 18:20:16 +0800
Subject: [PATCH] fix(erp): 单据明细单价口径由「不含税单价」改为「含税单价」(前端)

---
 src/views/erp/sale/order/modules/print.vue |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/src/views/erp/sale/order/modules/print.vue b/src/views/erp/sale/order/modules/print.vue
index 12e3cc5..3bca712 100644
--- a/src/views/erp/sale/order/modules/print.vue
+++ b/src/views/erp/sale/order/modules/print.vue
@@ -99,21 +99,21 @@
 }
 
 /**
- * 鏄庣粏琛岋紙鍚庣涓嶈繑鍥炴槑缁嗚鐨� totalProductPrice/totalPrice锛岄渶鎸夊崟浠访楁暟閲忚绠楋細
- * 閲戦 = 鍗曚环 脳 鏁伴噺锛涚◣棰� = 閲戦 脳 绋庣巼锛涘惈绋庨噾棰� = 閲戦 + 绋庨锛�
+ * 鏄庣粏琛岋紙浼樺厛鐢ㄥ悗绔繑鍥炲�硷紱缂虹渷鏃舵寜銆屽崟浠蜂负鍚◣鍗曚环銆嶈绠楋細
+ * 鍚◣閲戦 = 鍚◣鍗曚环 脳 鏁伴噺锛涚◣棰� = 鍚◣閲戦 脳 绋庣巼锛涗笉鍚◣閲戦 = 鍚◣閲戦 - 绋庨锛�
  */
 const printRows = computed(() =>
   (printData.value.items || []).map((item) => {
-    const totalProductPrice =
-      item.totalProductPrice ?? multiplyPrice(item.productPrice, item.count) ?? 0;
+    const taxInclusivePrice = multiplyPrice(item.productPrice, item.count);
     const taxPrice =
-      item.taxPrice ?? multiplyPrice(totalProductPrice, (item.taxPercent ?? 0) / 100) ?? 0;
-    const totalPrice = item.totalPrice ?? totalProductPrice + taxPrice;
+      item.taxPrice ?? multiplyPrice(taxInclusivePrice, (item.taxPercent ?? 0) / 100) ?? 0;
+    const totalPrice = item.totalPrice ?? taxInclusivePrice ?? 0;
+    const totalProductPrice = item.totalProductPrice ?? totalPrice - taxPrice;
     return { ...item, totalProductPrice, taxPrice, totalPrice };
   }),
 );
 
-/** 鏄庣粏鍚堣锛氭暟閲�/閲戦浼樺厛鍙栬鍗曞ご锛堝悗绔潈濞佸�硷級锛岀◣棰濅笌鍚◣閲戦鎸夋槑缁嗙疮鍔狅紙璁㈠崟澶� totalPrice 涓轰紭鎯犲悗閲戦锛屽彟鍦ㄩ噾棰濅俊鎭尯灞曠ず锛� */
+/** 鏄庣粏鍚堣锛氭暟閲�/閲戦浼樺厛鍙栬鍗曞ご锛堝悗绔潈濞佸�硷級锛岀◣棰濅笌鍚◣閲戦鎸夋槑缁嗙疮鍔狅紙璁㈠崟澶� totalPrice 涓轰紭鎯犲悗鍚◣閲戦锛屽彟鍦ㄩ噾棰濅俊鎭尯灞曠ず锛� */
 const summaries = computed(() => {
   const rows = printRows.value;
   const count = rows.reduce((sum, item) => sum + (item.count || 0), 0);
@@ -262,17 +262,17 @@
             <th
               class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold"
             >
-              浜у搧鍗曚环(鍏�)
-            </th>
-            <th
-              class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold"
-            >
-              閲戦(鍏�)
+              鍚◣鍗曚环(鍏�)
             </th>
             <th
               class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold"
             >
               绋庣巼(%)
+            </th>
+            <th
+              class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold"
+            >
+              涓嶅惈绋庨噾棰�(鍏�)
             </th>
             <th
               class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right font-bold"
@@ -312,10 +312,10 @@
               {{ formatPrice(item.productPrice) }}
             </td>
             <td class="border border-solid border-[#dcdfe6] p-2 text-right">
-              {{ formatPrice(item.totalProductPrice) }}
+              {{ formatPrice(item.taxPercent) }}
             </td>
             <td class="border border-solid border-[#dcdfe6] p-2 text-right">
-              {{ formatPrice(item.taxPercent) }}
+              {{ formatPrice(item.totalProductPrice) }}
             </td>
             <td class="border border-solid border-[#dcdfe6] p-2 text-right">
               {{ formatPrice(item.taxPrice) }}
@@ -348,13 +348,13 @@
               class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2"
             ></td>
             <td
+              class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2"
+            ></td>
+            <td
               class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right"
             >
               {{ formatPrice(summaries.totalProductPrice) }}
             </td>
-            <td
-              class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2"
-            ></td>
             <td
               class="border border-solid border-[#dcdfe6] bg-[#f5f7fa] p-2 text-right"
             >
@@ -386,7 +386,7 @@
       >
         <div>浼樻儬鐜�(%)锛歿{ formatPrice(printData.discountPercent) }}</div>
         <div>浠樻浼樻儬(鍏�)锛歿{ formatPrice(printData.discountPrice) }}</div>
-        <div>浼樻儬鍚庨噾棰�(鍏�)锛歿{ formatPrice(printData.totalPrice) }}</div>
+        <div>浼樻儬鍚庡惈绋庨噾棰�(鍏�)锛歿{ formatPrice(printData.totalPrice) }}</div>
         <div>鏀跺彇璁㈤噾(鍏�)锛歿{ formatPrice(printData.depositPrice) }}</div>
       </div>
 

--
Gitblit v1.9.3