From 0c116b0f5624786bd06990b86c467be25e2411fd Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 26 一月 2026 17:51:38 +0800
Subject: [PATCH] feat: BOM导入模板下载,导入导出接口添加菜单权限

---
 src/views/inventoryManagement/stockManagement/Qualified.vue |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/src/views/inventoryManagement/stockManagement/Qualified.vue b/src/views/inventoryManagement/stockManagement/Qualified.vue
index cfc9ed1..0e78990 100644
--- a/src/views/inventoryManagement/stockManagement/Qualified.vue
+++ b/src/views/inventoryManagement/stockManagement/Qualified.vue
@@ -11,6 +11,10 @@
       </div>
       <div>
          <el-button type="primary" @click="isShowNewModal = true">鏂板搴撳瓨</el-button>
+        <el-button @click="importTemplate">涓嬭浇瀵煎叆妯℃澘</el-button>
+        <el-button type="info" plain icon="Upload" @click="isShowImportModal = true">
+          瀵煎叆搴撳瓨
+        </el-button>
         <el-button @click="handleOut">瀵煎嚭</el-button>
       </div>
     </div>
@@ -45,17 +49,22 @@
                  v-model:visible="isShowSubtractModal"
                  :record="record"
                  @completed="handleQuery" />
+    <!-- 瀵煎叆搴撳瓨-->
+    <import-stock-inventory v-if="isShowImportModal"
+                 v-model:visible="isShowImportModal"
+                 type="qualified"
+                 @uploadSuccess="handleQuery" />
   </div>
 </template>
 
 <script setup>
 import pagination from '@/components/PIMTable/Pagination.vue'
 import { ref, reactive, toRefs, onMounted, getCurrentInstance } from 'vue'
-import { ElMessageBox } from "element-plus";
+import {ElMessage, ElMessageBox} from "element-plus";
 import { getStockInventoryListPage } from "@/api/inventoryManagement/stockInventory.js";
 const NewStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/New.vue"));
 const SubtractStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/Subtract.vue"));
-
+const ImportStockInventory = defineAsyncComponent(() => import("@/views/inventoryManagement/stockManagement/Import.vue"));
 const { proxy } = getCurrentInstance()
 const tableData = ref([])
 const selectedRows = ref([])
@@ -70,6 +79,8 @@
 const isShowNewModal = ref(false)
 // 鏄惁鏄剧ず棰嗙敤寮规
 const isShowSubtractModal = ref(false)
+// 鏄惁鏄剧ず瀵煎叆寮规
+const isShowImportModal = ref(false)
 const data = reactive({
   searchForm: {
     productName: '',
@@ -100,6 +111,17 @@
     tableLoading.value = false
   })
 }
+
+const handleFileSuccess = (response) => {
+  const { code, msg } = response;
+  if (code == 200) {
+    ElMessage({ message: "瀵煎叆鎴愬姛", type: "success" });
+    upload.open = false;
+    emits("uploadSuccess");
+  } else {
+    ElMessage({ message: msg, type: "error" });
+  }
+};
 
 // 鐐瑰嚮棰嗙敤
 const showSubtractModal = (row) => {
@@ -141,6 +163,10 @@
   })
 }
 
+const importTemplate =() =>{
+  proxy.download("/stockInventory/downloadStockInventory", {}, "搴撳瓨瀵煎叆妯℃澘.xlsx");
+}
+
 onMounted(() => {
   getList()
 })

--
Gitblit v1.9.3