From 0ff188212d1ce203f8e755a10f6caaad5b5d639c Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期四, 21 五月 2026 15:39:49 +0800
Subject: [PATCH] feat(inventory): 添加成品库存管理功能支持 - 在导入组件中新增 isFinishedProduct 属性以区分成品和半成品 - 修改库存导入接口路径,根据产品类型传递参数标识 - 更新模板下载接口,传入产品类型参数 - 调整记录表格中的来源列,直接使用 recordTypeName 字段显示 - 在导出库存数据时增加产品类型参数过滤 - 为合格库存页面添加成品类型参数配置 - 在记录页面的导出功能中集成产品类型参数传递

---
 src/views/inventoryManagement/dispatchLog/Record.vue        |    5 +----
 src/views/inventoryManagement/stockManagement/Import.vue    |    9 +++++++--
 src/views/inventoryManagement/stockManagement/Qualified.vue |    3 ++-
 src/views/inventoryManagement/stockManagement/Record.vue    |    3 ++-
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/views/inventoryManagement/dispatchLog/Record.vue b/src/views/inventoryManagement/dispatchLog/Record.vue
index 5caaa51..55fe152 100644
--- a/src/views/inventoryManagement/dispatchLog/Record.vue
+++ b/src/views/inventoryManagement/dispatchLog/Record.vue
@@ -87,11 +87,8 @@
 					show-overflow-tooltip
 				/>
         <el-table-column label="鏉ユ簮"
-                         prop="recordType"
+                         prop="recordTypeName"
                          show-overflow-tooltip>
-          <template #default="scope">
-            {{ getRecordType(scope.row.recordType) }}
-          </template>
         </el-table-column>
 			</el-table>
 			<pagination
diff --git a/src/views/inventoryManagement/stockManagement/Import.vue b/src/views/inventoryManagement/stockManagement/Import.vue
index 2f3ff00..5f35a0b 100644
--- a/src/views/inventoryManagement/stockManagement/Import.vue
+++ b/src/views/inventoryManagement/stockManagement/Import.vue
@@ -42,6 +42,11 @@
     required: true,
     default: 'qualified',
   },
+
+  isFinishedProduct: {
+    type: Boolean,
+    default: false,
+  },
 });
 
 const emit = defineEmits(['update:visible', 'uploadSuccess']);
@@ -65,7 +70,7 @@
   // 璁剧疆涓婁紶鐨勮姹傚ご閮�
   headers: { Authorization: "Bearer " + getToken() },
   // 涓婁紶鐨勫湴鍧�
-  url: import.meta.env.VITE_APP_BASE_API + "/stockInventory/importStockInventory",
+  url: import.meta.env.VITE_APP_BASE_API + "/stockInventory/importStockInventory?productType=" + (props.isFinishedProduct ? 1 : 0),
 });
 
 const submitFileForm = () => {
@@ -84,7 +89,7 @@
 };
 
 const downloadTemplate = () => {
-  proxy.download("/stockInventory/downloadStockInventory", {}, "搴撳瓨瀵煎叆妯℃澘.xlsx");
+  proxy.download("/stockInventory/downloadStockInventory", { productType: props.isFinishedProduct ? 1 : 0 }, "搴撳瓨瀵煎叆妯℃澘.xlsx");
 }
 
 const closeModal = () => {
diff --git a/src/views/inventoryManagement/stockManagement/Qualified.vue b/src/views/inventoryManagement/stockManagement/Qualified.vue
index f4fdfd9..6db14cd 100644
--- a/src/views/inventoryManagement/stockManagement/Qualified.vue
+++ b/src/views/inventoryManagement/stockManagement/Qualified.vue
@@ -63,6 +63,7 @@
     <import-stock-inventory v-if="isShowImportModal"
                  v-model:visible="isShowImportModal"
                  type="qualified"
+                 :is-finished-product="false"
                  @uploadSuccess="handleQuery" />
     <!-- 鍐荤粨/瑙e喕搴撳瓨-->
     <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal"
@@ -194,7 +195,7 @@
     type: 'warning',
   }
   ).then(() => {
-    proxy.download("/stockInventory/exportStockInventory", {}, '鍚堟牸搴撳瓨淇℃伅.xlsx')
+    proxy.download("/stockInventory/exportStockInventory", {productType: 0}, '鍚堟牸搴撳瓨淇℃伅.xlsx')
   }).catch(() => {
     proxy.$modal.msg("宸插彇娑�")
   })
diff --git a/src/views/inventoryManagement/stockManagement/Record.vue b/src/views/inventoryManagement/stockManagement/Record.vue
index 2168107..5cd4807 100644
--- a/src/views/inventoryManagement/stockManagement/Record.vue
+++ b/src/views/inventoryManagement/stockManagement/Record.vue
@@ -63,6 +63,7 @@
     <!-- 瀵煎叆搴撳瓨-->
     <import-stock-inventory v-if="isShowImportModal"
                  v-model:visible="isShowImportModal"
+                 :is-finished-product="props.isFinishedProduct"
                  @uploadSuccess="handleQuery" />
     <!-- 鍐荤粨/瑙e喕搴撳瓨-->
     <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal"
@@ -208,7 +209,7 @@
     type: 'warning',
   }
   ).then(() => {
-    proxy.download("/stockInventory/exportStockInventory", {topParentProductId: props.productId}, '搴撳瓨淇℃伅.xlsx')
+    proxy.download("/stockInventory/exportStockInventory", {topParentProductId: props.productId, productType: props.isFinishedProduct ? 1 : 0}, '搴撳瓨淇℃伅.xlsx')
   }).catch(() => {
     proxy.$modal.msg("宸插彇娑�")
   })

--
Gitblit v1.9.3