From 2b2cd8357357685ef8bca6a29db2e0ecefbc9567 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期四, 23 四月 2026 09:06:45 +0800
Subject: [PATCH] Merge branch 'dev_河南_鹤壁天沐玻璃厂' of http://114.132.189.42:9002/r/product-inventory-management into dev_河南_鹤壁天沐玻璃厂

---
 src/views/salesManagement/salesLedger/index.vue |   61 ++++++++++++++++++++++++++++--
 1 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index c69c168..e9b1ff9 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -109,6 +109,20 @@
           <el-button type="primary"
                      plain
                      @click="handleImport">瀵煎叆</el-button>
+          <el-dropdown @command="handleHistoryImportCommand">
+            <el-button type="primary"
+                       plain>
+              鍘嗗彶杩佺Щ<el-icon class="el-icon--right">
+                <ArrowDown />
+              </el-icon>
+            </el-button>
+            <template #dropdown>
+              <el-dropdown-menu>
+                <el-dropdown-item command="notShipped">鏈嚭搴�</el-dropdown-item>
+                <el-dropdown-item command="shipped">宸插嚭搴�</el-dropdown-item>
+              </el-dropdown-menu>
+            </template>
+          </el-dropdown>
           <el-button @click="handleOut">瀵煎嚭</el-button>
           <el-button type="danger"
                      plain
@@ -144,7 +158,7 @@
                 style="width: 100%"
                 :summary-method="summarizeMainTable"
                 @expand-change="expandChange"
-                height="calc(100vh - 18.5em)">
+                height="calc(100vh - 22em)">
         <el-table-column align="center"
                          type="selection"
                          width="55"
@@ -369,6 +383,8 @@
                     type="success">閮ㄥ垎鍏ュ簱</el-tag>
             <el-tag v-else-if="Number(scope.row.stockStatus) === 2"
                     type="success">宸插叆搴�</el-tag>
+            <el-tag v-else-if="Number(scope.row.stockStatus) === 3"
+                    type="warning">瀹℃壒涓�</el-tag>
             <el-tag v-else
                     type="info">-</el-tag>
           </template>
@@ -2890,7 +2906,19 @@
       proxy.$modal.msgError("瀵煎叆澶辫触锛岃閲嶈瘯");
     },
   });
-
+  const HISTORY_IMPORT_URL_MAP = {
+    notShipped: "/sales/ledger/salesHistory/notShippingImport",
+    shipped: "/sales/ledger/salesHistory/shippingImport",
+  };
+  const HISTORY_IMPORT_TEMPLATE_URL_MAP = {
+    notShipped: "/sales/ledger/salesHistory/notShippingImportTemplate",
+    shipped: "/sales/ledger/salesHistory/shippingImportTemplate",
+  };
+  const HISTORY_IMPORT_TEMPLATE_FILE_NAME_MAP = {
+    notShipped: "閿�鍞彂璐у巻鍙叉暟鎹鍏ユā鏉�-鏈彂璐�.xlsx",
+    shipped: "閿�鍞彂璐у巻鍙叉暟鎹鍏ユā鏉�-宸插彂璐�.xlsx",
+  };
+  const currentImportCommand = ref("default");
   const changeDaterange = value => {
     if (value) {
       searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
@@ -3846,17 +3874,40 @@
     otherAmountAddDialogVisible.value = false;
     otherAmountAddId.value = null;
   };
-  // 瀵煎叆
-  const handleImport = () => {
-    importUpload.title = "瀵煎叆閿�鍞彴璐�";
+  const openImportDialog = (title, url) => {
+    importUpload.title = title;
+    importUpload.url = import.meta.env.VITE_APP_BASE_API + url;
     importUpload.open = true;
+    importUpload.isUploading = false;
     if (importUploadRef.value) {
       importUploadRef.value.clearFiles();
     }
   };
+  // 瀵煎叆
+  const handleImport = () => {
+    currentImportCommand.value = "default";
+    openImportDialog("瀵煎叆閿�鍞彴璐�", "/sales/ledger/import");
+  };
+  // 鍘嗗彶杩佺Щ
+  const handleHistoryImportCommand = command => {
+    const url = HISTORY_IMPORT_URL_MAP[command];
+    if (!url) return;
+    currentImportCommand.value = command;
+    const title = command === "shipped" ? "鍘嗗彶杩佺Щ-宸插嚭搴�" : "鍘嗗彶杩佺Щ-鏈嚭搴�";
+    openImportDialog(title, url);
+  };
 
   // 涓嬭浇瀵煎叆妯℃澘
   const downloadTemplate = () => {
+    const command = currentImportCommand.value;
+    if (command && command !== "default") {
+      const templateUrl = HISTORY_IMPORT_TEMPLATE_URL_MAP[command];
+      const fileName = HISTORY_IMPORT_TEMPLATE_FILE_NAME_MAP[command];
+      if (templateUrl) {
+        proxy.download(templateUrl, {}, fileName || "閿�鍞彂璐у巻鍙叉暟鎹鍏ユā鏉�.xlsx");
+        return;
+      }
+    }
     proxy.download("/sales/ledger/exportTemplate", {}, "閿�鍞彴璐﹀鍏ユā鏉�.xlsx");
   };
   const onClose = () => {

--
Gitblit v1.9.3