From f4c73e3d36ff577aed91bed9bcd635c9eb6dcaa6 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期二, 09 六月 2026 16:38:11 +0800
Subject: [PATCH] 增加废品库存从销售到入库流程

---
 src/views/inventoryManagement/wasteStockManagement/WasteRecord.vue           |   83 -----
 src/api/inventoryManagement/stockUninventory.js                              |   18 +
 src/views/inventoryManagement/wasteStockManagement/WasteBatchNoQtyDetail.vue |   51 ---
 src/views/salesManagement/salesLedger/index.vue                              |  582 ++++++++++++++++++++++++--------------------
 4 files changed, 341 insertions(+), 393 deletions(-)

diff --git a/src/api/inventoryManagement/stockUninventory.js b/src/api/inventoryManagement/stockUninventory.js
index a80474e..56584c2 100644
--- a/src/api/inventoryManagement/stockUninventory.js
+++ b/src/api/inventoryManagement/stockUninventory.js
@@ -61,3 +61,21 @@
         data: params,
     });
 };
+
+// 搴熷搧搴撳垎椤垫煡璇紙鏂版帴鍙o紝閬垮厤褰卞搷鍘熸湁搴撳瓨鏌ヨ娴佺▼锛�
+export const pageWasteQuery = (params) => {
+    return request({
+        url: "/stockUninventory/pageWasteQuery",
+        method: "get",
+        params,
+    });
+};
+
+// 搴熷搧搴撴壒娆¤鎯呮煡璇�
+export const getWasteBatchNoQty = (params) => {
+    return request({
+        url: "/stockUninventory/getWasteBatchNoQty",
+        method: "get",
+        params,
+    });
+};
diff --git a/src/views/inventoryManagement/wasteStockManagement/WasteBatchNoQtyDetail.vue b/src/views/inventoryManagement/wasteStockManagement/WasteBatchNoQtyDetail.vue
index b3502b2..f325dac 100644
--- a/src/views/inventoryManagement/wasteStockManagement/WasteBatchNoQtyDetail.vue
+++ b/src/views/inventoryManagement/wasteStockManagement/WasteBatchNoQtyDetail.vue
@@ -28,7 +28,7 @@
           <el-table-column label="鏉ユ簮"
                            show-overflow-tooltip>
             <template #default="scope">
-              {{ scope.row.wasteSourceText || scope.row.qualifiedSourceText || scope.row.unQualifiedSourceText || "--" }}
+              {{ scope.row.sourceText || "--" }}
             </template>
           </el-table-column>
           <el-table-column label="鍗曚綅"
@@ -40,43 +40,12 @@
           <el-table-column label="搴撳瓨鏁伴噺"
                            prop="qualitity"
                            show-overflow-tooltip />
-          <el-table-column label="鍐荤粨鏁伴噺"
-                           prop="lockedQuantity"
-                           show-overflow-tooltip />
-          <el-table-column label="鍙敤鏁伴噺"
-                           prop="unLockedQuantity"
-                           show-overflow-tooltip />
           <el-table-column label="澶囨敞"
                            prop="remark"
                            show-overflow-tooltip />
           <el-table-column label="鏈�杩戞洿鏂版椂闂�"
                            prop="updateTime"
                            show-overflow-tooltip />
-          <el-table-column fixed="right"
-                           label="鎿嶄綔"
-                           min-width="180"
-                           align="center">
-            <template #default="scope">
-              <el-button link
-                         type="primary"
-                         @click="handleSubtract(scope.row)"
-                         :disabled="
-                  (scope.row.unLockedQuantity || 0) <= 0
-                ">棰嗙敤</el-button>
-              <el-button link
-                         type="primary"
-                         v-if="
-                  (scope.row.unLockedQuantity || 0) > 0
-                "
-                         @click="handleFrozen(scope.row)">鍐荤粨</el-button>
-              <el-button link
-                         type="primary"
-                         v-if="
-                  (scope.row.lockedQuantity || 0) > 0
-                "
-                         @click="handleThaw(scope.row)">瑙e喕</el-button>
-            </template>
-          </el-table-column>
         </el-table>
       </div>
       <pagination v-show="total > 0"
@@ -92,7 +61,7 @@
 <script setup>
   import pagination from "@/components/PIMTable/Pagination.vue";
   import { computed, reactive, ref, watch, onMounted } from "vue";
-  import { getStockInventoryBatchNoQty } from "@/api/inventoryManagement/stockInventory.js";
+  import { getWasteBatchNoQty } from "@/api/inventoryManagement/stockUninventory.js";
   import { getManufacturerOptions } from "@/api/inspectionManagement/manufacturerManageFile.js";
 
   const props = defineProps({
@@ -106,7 +75,7 @@
     },
   });
 
-  const emit = defineEmits(["update:visible", "subtract", "frozen", "thaw"]);
+  const emit = defineEmits(["update:visible"]);
 
   const isShow = computed({
     get() {
@@ -151,7 +120,7 @@
     }
 
     tableLoading.value = true;
-    getStockInventoryBatchNoQty({
+    getWasteBatchNoQty({
       current: page.current,
       size: page.size,
       productId: props.record.productId,
@@ -171,18 +140,6 @@
     page.current = obj.page;
     page.size = obj.limit;
     getList();
-  };
-
-  const handleSubtract = row => {
-    emit("subtract", row);
-  };
-
-  const handleFrozen = row => {
-    emit("frozen", row);
-  };
-
-  const handleThaw = row => {
-    emit("thaw", row);
   };
 
   const closeModal = () => {
diff --git a/src/views/inventoryManagement/wasteStockManagement/WasteRecord.vue b/src/views/inventoryManagement/wasteStockManagement/WasteRecord.vue
index 4a2d95b..c41bebf 100644
--- a/src/views/inventoryManagement/wasteStockManagement/WasteRecord.vue
+++ b/src/views/inventoryManagement/wasteStockManagement/WasteRecord.vue
@@ -82,12 +82,6 @@
         <el-table-column label="搴撳瓨鏁伴噺"
                          prop="qualitity"
                          show-overflow-tooltip />
-        <el-table-column label="鍐荤粨鏁伴噺"
-                         prop="lockedQuantity"
-                         show-overflow-tooltip />
-        <el-table-column label="鍙敤鏁伴噺"
-                         prop="unLockedQuantity"
-                         show-overflow-tooltip />
         <el-table-column label="澶囨敞"
                          prop="remark"
                          show-overflow-tooltip />
@@ -114,22 +108,7 @@
     </div>
     <waste-batch-no-qty-detail v-if="isShowDetailModal"
                                v-model:visible="isShowDetailModal"
-                               :record="record"
-                               @subtract="handleDetailSubtract"
-                               @frozen="handleDetailFrozen"
-                               @thaw="handleDetailThaw" />
-    <subtract-stock-inventory v-if="isShowSubtractModal"
-                              v-model:visible="isShowSubtractModal"
-                              :record="record"
-                              type="waste"
-                              @completed="handleQuery" />
-    <!-- 鍐荤粨/瑙e喕搴撳瓨-->
-    <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal"
-                                     v-model:visible="isShowFrozenAndThawModal"
-                                     :record="record"
-                                     :operation-type="operationType"
-                                     type="waste"
-                                     @completed="handleQuery" />
+                               :record="record" />
   </div>
 </template>
 
@@ -144,7 +123,7 @@
     defineAsyncComponent,
   } from "vue";
   import { ElMessageBox } from "element-plus";
-  import { getStockInventoryListPageCombined } from "@/api/inventoryManagement/stockInventory.js";
+  import { pageWasteQuery } from "@/api/inventoryManagement/stockUninventory.js";
 
   const props = defineProps({
     productId: {
@@ -154,12 +133,6 @@
     },
   });
 
-  const SubtractStockInventory = defineAsyncComponent(() =>
-    import("@/views/inventoryManagement/stockManagement/Subtract.vue")
-  );
-  const FrozenAndThawStockInventory = defineAsyncComponent(() =>
-    import("@/views/inventoryManagement/stockManagement/FrozenAndThaw.vue")
-  );
   const WasteBatchNoQtyDetail = defineAsyncComponent(() =>
     import(
       "@/views/inventoryManagement/wasteStockManagement/WasteBatchNoQtyDetail.vue"
@@ -176,14 +149,8 @@
     size: 100,
   });
   const total = ref(0);
-  // 鏄惁鏄剧ず棰嗙敤寮规
-  const isShowSubtractModal = ref(false);
-  // 鏄惁鏄剧ず鍐荤粨/瑙e喕寮规
-  const isShowFrozenAndThawModal = ref(false);
   // 鏄惁鏄剧ず璇︽儏寮规
   const isShowDetailModal = ref(false);
-  // 鎿嶄綔绫诲瀷
-  const operationType = ref("frozen");
 
   const data = reactive({
     searchForm: {
@@ -191,7 +158,6 @@
       model: "",
       batchNo: "",
       topParentProductId: props.productId,
-      type: "waste",
     },
   });
   const { searchForm } = toRefs(data);
@@ -216,21 +182,15 @@
   };
   const getList = () => {
     tableLoading.value = true;
-    getStockInventoryListPageCombined({ ...searchForm.value, ...page })
+    pageWasteQuery({ ...searchForm.value, ...page })
       .then(res => {
         tableLoading.value = false;
-        tableData.value = res.data.records;
-        total.value = res.data.total;
+        tableData.value = res.data?.records || [];
+        total.value = res.data?.total || 0;
       })
       .catch(() => {
         tableLoading.value = false;
       });
-  };
-
-  // 鐐瑰嚮棰嗙敤
-  const showSubtractModal = row => {
-    record.value = row;
-    isShowSubtractModal.value = true;
   };
 
   // 鐐瑰嚮璇︽儏
@@ -241,35 +201,6 @@
     }
     record.value = row;
     isShowDetailModal.value = true;
-  };
-
-  const handleDetailSubtract = row => {
-    isShowDetailModal.value = false;
-    showSubtractModal(row);
-  };
-
-  const handleDetailFrozen = row => {
-    isShowDetailModal.value = false;
-    showFrozenModal(row);
-  };
-
-  const handleDetailThaw = row => {
-    isShowDetailModal.value = false;
-    showThawModal(row);
-  };
-
-  // 鐐瑰嚮鍐荤粨
-  const showFrozenModal = row => {
-    record.value = row;
-    isShowFrozenAndThawModal.value = true;
-    operationType.value = "frozen";
-  };
-
-  // 鐐瑰嚮瑙e喕
-  const showThawModal = row => {
-    record.value = row;
-    isShowFrozenAndThawModal.value = true;
-    operationType.value = "thaw";
   };
 
   // 琛ㄦ牸閫夋嫨鏁版嵁
@@ -293,8 +224,8 @@
     })
       .then(() => {
         proxy.download(
-          "/stockInventory/exportStockInventory",
-          { topParentProductId: props.productId, type: "waste" },
+          "/stockUninventory/exportWasteQuery",
+          { topParentProductId: props.productId },
           "搴熷搧搴撳瓨淇℃伅.xlsx"
         );
       })
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 1027a1a..a571042 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -24,6 +24,18 @@
                     prefix-icon="Search"
                     @change="handleQuery" />
         </el-form-item>
+        <el-form-item label="閿�鍞被鍨嬶細">
+          <el-select v-model="searchForm.stockType"
+                     placeholder="璇烽�夋嫨"
+                     clearable
+                     @change="handleQuery"
+                     style="width: 150px">
+            <el-option label="闈炲簾鍝侀攢鍞�"
+                       value="qualified" />
+            <el-option label="搴熷搧閿�鍞�"
+                       value="waste" />
+          </el-select>
+        </el-form-item>
         <el-form-item label="褰曞叆鏃ユ湡锛�">
           <el-date-picker v-model="searchForm.entryDate"
                           value-format="YYYY-MM-DD"
@@ -214,6 +226,16 @@
                          prop="salesman"
                          width="100"
                          show-overflow-tooltip />
+        <el-table-column label="閿�鍞被鍨�"
+                         prop="stockType"
+                         width="120"
+                         align="center">
+          <template #default="scope">
+            <el-tag :type="scope.row.stockType === 'waste' ? 'warning' : 'success'">
+              {{ scope.row.stockType === 'waste' ? '搴熷搧閿�鍞�' : '闈炲簾鍝侀攢鍞�' }}
+            </el-tag>
+          </template>
+        </el-table-column>
         <el-table-column label="椤圭洰鍚嶇О"
                          prop="projectName"
                          width="180"
@@ -375,6 +397,21 @@
                         placeholder="璇疯緭鍏�"
                         clearable
                         :disabled="operationType === 'view'" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="閿�鍞被鍨嬶細"
+                          prop="stockType">
+              <el-select v-model="form.stockType"
+                         placeholder="璇烽�夋嫨"
+                         clearable
+                         :disabled="operationType === 'view'"
+                         style="width: 100%">
+                <el-option label="闈炲簾鍝侀攢鍞�"
+                           value="qualified" />
+                <el-option label="搴熷搧閿�鍞�"
+                           value="waste" />
+              </el-select>
             </el-form-item>
           </el-col>
         </el-row>
@@ -1169,6 +1206,7 @@
     searchForm: {
       customerName: "", // 瀹㈡埛鍚嶇О
       salesContractNo: "", // 閿�鍞悎鍚岀紪鍙�
+      stockType: "", // 閿�鍞被鍨�
       entryDate: null, // 褰曞叆鏃ユ湡
       entryDateStart: undefined,
       entryDateEnd: undefined,
@@ -1177,6 +1215,7 @@
       salesContractNo: "",
       autoGenerateContractNo: true,
       salesman: "",
+      stockType: "qualified",
       customerId: "",
       entryPerson: "",
       entryDate: "",
@@ -1189,6 +1228,7 @@
     },
     rules: {
       salesman: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+      stockType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
       customerId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
       entryPerson: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
       entryDate: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
@@ -1707,6 +1747,8 @@
       form.value.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
       // 榛樿鑷姩鐢熸垚閿�鍞悎鍚屽彿
       form.value.autoGenerateContractNo = true;
+      // 榛樿闈炲簾鍝侀攢鍞�
+      form.value.stockType = "qualified";
     } else {
       currentId.value = row.id;
       getSalesLedgerWithProducts({ id: row.id, type: 1 }).then(res => {
@@ -2175,286 +2217,286 @@
 
     // 鏋勫缓鎵撳嵃鍐呭
     let printContent = `
-                                                                                    <!DOCTYPE html>
-                                                                                    <html>
-                                                                                    <head>
-                                                                                      <meta charset="UTF-8">
-                                                                                      <title>鎵撳嵃棰勮</title>
-                                                                                      <style>
-                                                                                        body {
-                                                                                          margin: 0;
-                                                                                          padding: 0;
-                                                                                          font-family: "SimSun", serif;
-                                                                                          background: white;
-                                                                                        }
-                                                                                                                                     .print-page {
-                                                                                            width: 200mm;
-                                                                                            height: 75mm;
-                                                                                            padding: 10mm;
-                                                                                            padding-left: 20mm;
-                                                                                            background: white;
-                                                                                            box-sizing: border-box;
-                                                                                            page-break-after: always;
-                                                                                            page-break-inside: avoid;
-                                                                                          }
-                                                                                         .print-page:last-child {
-                                                                                           page-break-after: avoid;
-                                                                                         }
-                                                                                        .delivery-note {
-                                                                                          width: 100%;
-                                                                                          height: 100%;
-                                                                                          font-size: 12px;
-                                                                                          line-height: 1.2;
-                                                                                          display: flex;
-                                                                                          flex-direction: column;
-                                                                                          color: #000;
-                                                                                        }
-                                                                                        .header {
-                                                                                          text-align: center;
-                                                                                          margin-bottom: 8px;
-                                                                                        }
-                                                                                        .company-name {
-                                                                                          font-size: 18px;
-                                                                                          font-weight: bold;
-                                                                                          margin-bottom: 4px;
-                                                                                        }
-                                                                                        .document-title {
-                                                                                          font-size: 16px;
-                                                                                          font-weight: bold;
-                                                                                        }
-                                                                                        .info-section {
-                                                                                          margin-bottom: 8px;
-                                                                                          display: flex;
-                                                                                          justify-content: space-between;
-                                                                                          align-items: center;
-                                                                                        }
-                                                                                        .info-row {
-                                                                                          line-height: 20px;
-                                                                                        }
-                                                                                        .label {
-                                                                                          font-weight: bold;
-                                                                                          width: 60px;
-                                                                                          font-size: 12px;
-                                                                                        }
-                                                                                        .value {
-                                                                                          margin-right: 20px;
-                                                                                          min-width: 80px;
-                                                                                          font-size: 12px;
-                                                                                        }
-                                                                                                 .table-section {
-                                                                                                 margin-bottom: 40px;
-                                                                                          //  flex: 0.6;
-                                                                                         }
-                                                                                        .product-table {
-                                                                                          width: 100%;
-                                                                                          border-collapse: collapse;
-                                                                                          border: 1px solid #000;
-                                                                                        }
-                                                                                                 .product-table th, .product-table td {
-                                                                                           border: 1px solid #000;
-                                                                                           padding: 6px;
-                                                                                           text-align: center;
-                                                                                           font-size: 12px;
-                                                                                           line-height: 1.4;
-                                                                                         }
-                                                                                        .product-table th {
-                                                                                          font-weight: bold;
-                                                                                        }
-                                                                                        .total-value {
-                                                                                          font-weight: bold;
-                                                                                        }
-                                                                                        .footer-section {
-                                                                                          margin-top: auto;
-                                                                                        }
-                                                                                        .footer-row {
-                                                                                          display: flex;
-                                                                                          margin-bottom: 3px;
-                                                                                          line-height: 22px;
-                                                                                          justify-content: space-between;
-                                                                                        }
-                                                                                        .footer-item {
-                                                                                          display: flex;
-                                                                                          margin-right: 20px;
-                                                                                        }
-                                                                                        .footer-item .label {
-                                                                                          font-weight: bold;
-                                                                                          width: 80px;
-                                                                                          font-size: 12px;
-                                                                                        }
-                                                                                        .footer-item .value {
-                                                                                          min-width: 80px;
-                                                                                          font-size: 12px;
-                                                                                        }
-                                                                                        .address-item .address-value {
-                                                                                          min-width: 200px;
-                                                                                        }
-                                                                                        @media print {
-                                                                                          body {
-                                                                                            margin: 0;
-                                                                                            padding: 0;
-                                                                                          }
-                                                                                                     .print-page {
-                                                                                             margin: 0;
-                                                                                             padding: 10mm;
-                                                                                             /* padding-left: 20mm; */
-                                                                                             page-break-inside: avoid;
-                                                                                             page-break-after: always;
-                                                                                           }
-                                                                                           .print-page:last-child {
-                                                                                             page-break-after: avoid;
-                                                                                           }
-                                                                                        }
-                                                                                      </style>
-                                                                                    </head>
-                                                                                    <body>
-                                                                                  `;
+                                                                                                <!DOCTYPE html>
+                                                                                                <html>
+                                                                                                <head>
+                                                                                                  <meta charset="UTF-8">
+                                                                                                  <title>鎵撳嵃棰勮</title>
+                                                                                                  <style>
+                                                                                                    body {
+                                                                                                      margin: 0;
+                                                                                                      padding: 0;
+                                                                                                      font-family: "SimSun", serif;
+                                                                                                      background: white;
+                                                                                                    }
+                                                                                                                                                 .print-page {
+                                                                                                        width: 200mm;
+                                                                                                        height: 75mm;
+                                                                                                        padding: 10mm;
+                                                                                                        padding-left: 20mm;
+                                                                                                        background: white;
+                                                                                                        box-sizing: border-box;
+                                                                                                        page-break-after: always;
+                                                                                                        page-break-inside: avoid;
+                                                                                                      }
+                                                                                                     .print-page:last-child {
+                                                                                                       page-break-after: avoid;
+                                                                                                     }
+                                                                                                    .delivery-note {
+                                                                                                      width: 100%;
+                                                                                                      height: 100%;
+                                                                                                      font-size: 12px;
+                                                                                                      line-height: 1.2;
+                                                                                                      display: flex;
+                                                                                                      flex-direction: column;
+                                                                                                      color: #000;
+                                                                                                    }
+                                                                                                    .header {
+                                                                                                      text-align: center;
+                                                                                                      margin-bottom: 8px;
+                                                                                                    }
+                                                                                                    .company-name {
+                                                                                                      font-size: 18px;
+                                                                                                      font-weight: bold;
+                                                                                                      margin-bottom: 4px;
+                                                                                                    }
+                                                                                                    .document-title {
+                                                                                                      font-size: 16px;
+                                                                                                      font-weight: bold;
+                                                                                                    }
+                                                                                                    .info-section {
+                                                                                                      margin-bottom: 8px;
+                                                                                                      display: flex;
+                                                                                                      justify-content: space-between;
+                                                                                                      align-items: center;
+                                                                                                    }
+                                                                                                    .info-row {
+                                                                                                      line-height: 20px;
+                                                                                                    }
+                                                                                                    .label {
+                                                                                                      font-weight: bold;
+                                                                                                      width: 60px;
+                                                                                                      font-size: 12px;
+                                                                                                    }
+                                                                                                    .value {
+                                                                                                      margin-right: 20px;
+                                                                                                      min-width: 80px;
+                                                                                                      font-size: 12px;
+                                                                                                    }
+                                                                                                             .table-section {
+                                                                                                             margin-bottom: 40px;
+                                                                                                      //  flex: 0.6;
+                                                                                                     }
+                                                                                                    .product-table {
+                                                                                                      width: 100%;
+                                                                                                      border-collapse: collapse;
+                                                                                                      border: 1px solid #000;
+                                                                                                    }
+                                                                                                             .product-table th, .product-table td {
+                                                                                                       border: 1px solid #000;
+                                                                                                       padding: 6px;
+                                                                                                       text-align: center;
+                                                                                                       font-size: 12px;
+                                                                                                       line-height: 1.4;
+                                                                                                     }
+                                                                                                    .product-table th {
+                                                                                                      font-weight: bold;
+                                                                                                    }
+                                                                                                    .total-value {
+                                                                                                      font-weight: bold;
+                                                                                                    }
+                                                                                                    .footer-section {
+                                                                                                      margin-top: auto;
+                                                                                                    }
+                                                                                                    .footer-row {
+                                                                                                      display: flex;
+                                                                                                      margin-bottom: 3px;
+                                                                                                      line-height: 22px;
+                                                                                                      justify-content: space-between;
+                                                                                                    }
+                                                                                                    .footer-item {
+                                                                                                      display: flex;
+                                                                                                      margin-right: 20px;
+                                                                                                    }
+                                                                                                    .footer-item .label {
+                                                                                                      font-weight: bold;
+                                                                                                      width: 80px;
+                                                                                                      font-size: 12px;
+                                                                                                    }
+                                                                                                    .footer-item .value {
+                                                                                                      min-width: 80px;
+                                                                                                      font-size: 12px;
+                                                                                                    }
+                                                                                                    .address-item .address-value {
+                                                                                                      min-width: 200px;
+                                                                                                    }
+                                                                                                    @media print {
+                                                                                                      body {
+                                                                                                        margin: 0;
+                                                                                                        padding: 0;
+                                                                                                      }
+                                                                                                                 .print-page {
+                                                                                                         margin: 0;
+                                                                                                         padding: 10mm;
+                                                                                                         /* padding-left: 20mm; */
+                                                                                                         page-break-inside: avoid;
+                                                                                                         page-break-after: always;
+                                                                                                       }
+                                                                                                       .print-page:last-child {
+                                                                                                         page-break-after: avoid;
+                                                                                                       }
+                                                                                                    }
+                                                                                                  </style>
+                                                                                                </head>
+                                                                                                <body>
+                                                                                              `;
 
     // 涓烘瘡鏉℃暟鎹敓鎴愭墦鍗伴〉闈�
     printData.value.forEach((item, index) => {
       printContent += `
-                                                                                      <div class="print-page">
-                                                                                        <div class="delivery-note">
-                                                                                          <div class="header">
-                                                                                            <div class="document-title">闆跺敭鍙戣揣鍗�</div>
-                                                                                          </div>
+                                                                                                  <div class="print-page">
+                                                                                                    <div class="delivery-note">
+                                                                                                      <div class="header">
+                                                                                                        <div class="document-title">闆跺敭鍙戣揣鍗�</div>
+                                                                                                      </div>
 
-                                                                                          <div class="info-section">
-                                                                                            <div class="info-row">
-                                                                                              <div>
-                                                                                                <span class="label">鍙戣揣鏃ユ湡锛�</span>
-                                                                                                <span class="value">${formatDate(
-                                                                                                  item.createTime
-                                                                                                )}</span>
-                                                                                              </div>
-                                                                                              <div>
-                                                                                                <span class="label">瀹㈡埛鍚嶇О锛�</span>
-                                                                                                <span class="value">${
-                                                                                                  item.customerName
-                                                                                                }</span>
-                                                                                              </div>
-                                                                                            </div>
-                                                                                            <div class="info-row">
-                                                                                              <span class="label">鍗曞彿锛�</span>
-                                                                                              <span class="value">${
-                                                                                                item.salesContractNo ||
-                                                                                                ""
-                                                                                              }</span>
-                                                                                            </div>
-                                                                                          </div>
+                                                                                                      <div class="info-section">
+                                                                                                        <div class="info-row">
+                                                                                                          <div>
+                                                                                                            <span class="label">鍙戣揣鏃ユ湡锛�</span>
+                                                                                                            <span class="value">${formatDate(
+                                                                                                              item.createTime
+                                                                                                            )}</span>
+                                                                                                          </div>
+                                                                                                          <div>
+                                                                                                            <span class="label">瀹㈡埛鍚嶇О锛�</span>
+                                                                                                            <span class="value">${
+                                                                                                              item.customerName
+                                                                                                            }</span>
+                                                                                                          </div>
+                                                                                                        </div>
+                                                                                                        <div class="info-row">
+                                                                                                          <span class="label">鍗曞彿锛�</span>
+                                                                                                          <span class="value">${
+                                                                                                            item.salesContractNo ||
+                                                                                                            ""
+                                                                                                          }</span>
+                                                                                                        </div>
+                                                                                                      </div>
 
-                                                                                          <div class="table-section">
-                                                                                            <table class="product-table">
-                                                                                              <thead>
-                                                                                                <tr>
-                                                                                                  <th>浜у搧鍚嶇О</th>
-                                                                                                  <th>瑙勬牸鍨嬪彿</th>
-                                                                                                  <th>鍗曚綅</th>
-                                                                                                  <th>鍗曚环</th>
-                                                                                                  <th>闆跺敭鏁伴噺</th>
-                                                                                                  <th>闆跺敭閲戦</th>
-                                                                                                </tr>
-                                                                                              </thead>
-                                                                                              <tbody>
-                                                                                                ${
-                                                                                                  item.products &&
-                                                                                                  item
-                                                                                                    .products
-                                                                                                    .length >
-                                                                                                    0
-                                                                                                    ? item.products
-                                                                                                        .map(
-                                                                                                          product => `
-                                                                                                    <tr>
-                                                                                                      <td>${
-                                                                                                        product.productCategory ||
-                                                                                                        ""
-                                                                                                      }</td>
-                                                                                                      <td>${
-                                                                                                        product.specificationModel ||
-                                                                                                        ""
-                                                                                                      }</td>
-                                                                                                      <td>${
-                                                                                                        product.unit ||
-                                                                                                        ""
-                                                                                                      }</td>
-                                                                                                      <td>${
-                                                                                                        product.taxInclusiveUnitPrice ||
-                                                                                                        "0"
-                                                                                                      }</td>
-                                                                                                      <td>${
-                                                                                                        product.quantity ||
-                                                                                                        "0"
-                                                                                                      }</td>
-                                                                                                      <td>${
-                                                                                                        product.taxInclusiveTotalPrice ||
-                                                                                                        "0"
-                                                                                                      }</td>
-                                                                                                    </tr>
-                                                                                                  `
-                                                                                                        )
-                                                                                                        .join(
-                                                                                                          ""
-                                                                                                        )
-                                                                                                    : '<tr><td colspan="6" style="text-align: center; color: #999;">鏆傛棤浜у搧鏁版嵁</td></tr>'
-                                                                                                }
-                                                                                              </tbody>
-                                                                                              <tfoot>
-                                                                                                <tr>
-                                                                                                  <td class="label">鍚堣</td>
-                                                                                                  <td class="total-value"></td>
-                                                                                                  <td class="total-value"></td>
-                                                                                                  <td class="total-value"></td>
-                                                                                                  <td class="total-value">${getTotalQuantityForPrint(
-                                                                                                    item.products
-                                                                                                  )}</td>
-                                                                                                  <td class="total-value">${getTotalAmountForPrint(
-                                                                                                    item.products
-                                                                                                  )}</td>
-                                                                                                </tr>
-                                                                                              </tfoot>
-                                                                                            </table>
-                                                                                          </div>
+                                                                                                      <div class="table-section">
+                                                                                                        <table class="product-table">
+                                                                                                          <thead>
+                                                                                                            <tr>
+                                                                                                              <th>浜у搧鍚嶇О</th>
+                                                                                                              <th>瑙勬牸鍨嬪彿</th>
+                                                                                                              <th>鍗曚綅</th>
+                                                                                                              <th>鍗曚环</th>
+                                                                                                              <th>闆跺敭鏁伴噺</th>
+                                                                                                              <th>闆跺敭閲戦</th>
+                                                                                                            </tr>
+                                                                                                          </thead>
+                                                                                                          <tbody>
+                                                                                                            ${
+                                                                                                              item.products &&
+                                                                                                              item
+                                                                                                                .products
+                                                                                                                .length >
+                                                                                                                0
+                                                                                                                ? item.products
+                                                                                                                    .map(
+                                                                                                                      product => `
+                                                                                                                <tr>
+                                                                                                                  <td>${
+                                                                                                                    product.productCategory ||
+                                                                                                                    ""
+                                                                                                                  }</td>
+                                                                                                                  <td>${
+                                                                                                                    product.specificationModel ||
+                                                                                                                    ""
+                                                                                                                  }</td>
+                                                                                                                  <td>${
+                                                                                                                    product.unit ||
+                                                                                                                    ""
+                                                                                                                  }</td>
+                                                                                                                  <td>${
+                                                                                                                    product.taxInclusiveUnitPrice ||
+                                                                                                                    "0"
+                                                                                                                  }</td>
+                                                                                                                  <td>${
+                                                                                                                    product.quantity ||
+                                                                                                                    "0"
+                                                                                                                  }</td>
+                                                                                                                  <td>${
+                                                                                                                    product.taxInclusiveTotalPrice ||
+                                                                                                                    "0"
+                                                                                                                  }</td>
+                                                                                                                </tr>
+                                                                                                              `
+                                                                                                                    )
+                                                                                                                    .join(
+                                                                                                                      ""
+                                                                                                                    )
+                                                                                                                : '<tr><td colspan="6" style="text-align: center; color: #999;">鏆傛棤浜у搧鏁版嵁</td></tr>'
+                                                                                                            }
+                                                                                                          </tbody>
+                                                                                                          <tfoot>
+                                                                                                            <tr>
+                                                                                                              <td class="label">鍚堣</td>
+                                                                                                              <td class="total-value"></td>
+                                                                                                              <td class="total-value"></td>
+                                                                                                              <td class="total-value"></td>
+                                                                                                              <td class="total-value">${getTotalQuantityForPrint(
+                                                                                                                item.products
+                                                                                                              )}</td>
+                                                                                                              <td class="total-value">${getTotalAmountForPrint(
+                                                                                                                item.products
+                                                                                                              )}</td>
+                                                                                                            </tr>
+                                                                                                          </tfoot>
+                                                                                                        </table>
+                                                                                                      </div>
 
-                                                                                          <div class="footer-section">
-                                                                                            <div class="footer-row">
-                                                                                              <div class="footer-item">
-                                                                                                <span class="label">鏀惰揣鐢佃瘽锛�</span>
-                                                                                                <span class="value"></span>
-                                                                                              </div>
-                                                                                              <div class="footer-item">
-                                                                                                <span class="label">鏀惰揣浜猴細</span>
-                                                                                                <span class="value"></span>
-                                                                                              </div>
-                                                                                              <div class="footer-item address-item">
-                                                                                                <span class="label">鏀惰揣鍦板潃锛�</span>
-                                                                                                <span class="value address-value"></span>
-                                                                                              </div>
-                                                                                            </div>
-                                                                                            <div class="footer-row">
-                                                                                              <div class="footer-item">
-                                                                                                <span class="label">鎿嶄綔鍛橈細</span>
-                                                                                                <span class="value">${
-                                                                                                  userStore.nickName ||
-                                                                                                  "鎾曞紑鍓�"
-                                                                                                }</span>
-                                                                                              </div>
-                                                                                              <div class="footer-item">
-                                                                                                <span class="label">鎵撳嵃鏃ユ湡锛�</span>
-                                                                                                <span class="value">${formatDateTime(
-                                                                                                  new Date()
-                                                                                                )}</span>
-                                                                                              </div>
-                                                                                            </div>
-                                                                                          </div>
-                                                                                        </div>
-                                                                                      </div>
-                                                                                    `;
+                                                                                                      <div class="footer-section">
+                                                                                                        <div class="footer-row">
+                                                                                                          <div class="footer-item">
+                                                                                                            <span class="label">鏀惰揣鐢佃瘽锛�</span>
+                                                                                                            <span class="value"></span>
+                                                                                                          </div>
+                                                                                                          <div class="footer-item">
+                                                                                                            <span class="label">鏀惰揣浜猴細</span>
+                                                                                                            <span class="value"></span>
+                                                                                                          </div>
+                                                                                                          <div class="footer-item address-item">
+                                                                                                            <span class="label">鏀惰揣鍦板潃锛�</span>
+                                                                                                            <span class="value address-value"></span>
+                                                                                                          </div>
+                                                                                                        </div>
+                                                                                                        <div class="footer-row">
+                                                                                                          <div class="footer-item">
+                                                                                                            <span class="label">鎿嶄綔鍛橈細</span>
+                                                                                                            <span class="value">${
+                                                                                                              userStore.nickName ||
+                                                                                                              "鎾曞紑鍓�"
+                                                                                                            }</span>
+                                                                                                          </div>
+                                                                                                          <div class="footer-item">
+                                                                                                            <span class="label">鎵撳嵃鏃ユ湡锛�</span>
+                                                                                                            <span class="value">${formatDateTime(
+                                                                                                              new Date()
+                                                                                                            )}</span>
+                                                                                                          </div>
+                                                                                                        </div>
+                                                                                                      </div>
+                                                                                                    </div>
+                                                                                                  </div>
+                                                                                                `;
     });
 
     printContent += `
-                                                                                    </body>
-                                                                                    </html>
-                                                                                  `;
+                                                                                                </body>
+                                                                                                </html>
+                                                                                              `;
 
     // 鍐欏叆鍐呭鍒版柊绐楀彛
     printWindow.document.write(printContent);

--
Gitblit v1.9.3