From a241b66efcc41e973290a6722fb7a4d79b833ea1 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 13 十月 2026 09:54:32 +0800
Subject: [PATCH] feat(bi): 为图表配置接口添加名称字段

---
 src/views/wls/materialstock/index.vue |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/src/views/wls/materialstock/index.vue b/src/views/wls/materialstock/index.vue
index 3ae7731..ba1d713 100644
--- a/src/views/wls/materialstock/index.vue
+++ b/src/views/wls/materialstock/index.vue
@@ -19,7 +19,11 @@
 import { MdItemTypeTree } from '#/views/mes/md/item/type/components';
 import { WmBatchDetail } from '#/views/wls/batch/components';
 import AreaForm from '#/views/wls/warehouse/area/modules/form.vue';
-import { WmStockAdjustModal } from './components';
+import {
+  WmMaterialStockImportModal,
+  WmStockAdjustModal,
+  WmStockMoveModal,
+} from './components';
 
 import { useGridColumns, useGridFormSchema } from './data';
 
@@ -30,6 +34,16 @@
 
 const [StockAdjustModal, stockAdjustModalApi] = useVbenModal({
   connectedComponent: WmStockAdjustModal,
+  destroyOnClose: true,
+});
+
+const [StockMoveModal, stockMoveModalApi] = useVbenModal({
+  connectedComponent: WmStockMoveModal,
+  destroyOnClose: true,
+});
+
+const [ImportModal, importModalApi] = useVbenModal({
+  connectedComponent: WmMaterialStockImportModal,
   destroyOnClose: true,
 });
 
@@ -69,8 +83,28 @@
   stockAdjustModalApi.setData({}).open();
 }
 
+/** 鎵撳紑搴撳瓨鐜版湁閲忓鍏ュ脊绐� */
+function handleOpenImport() {
+  importModalApi.open();
+}
+
+/** 瀵煎叆鎴愬姛鍥炶皟 */
+function handleStockImportSuccess() {
+  gridApi.query();
+}
+
 /** 搴撳瓨璋冩暣鎴愬姛鍥炶皟 */
 function handleStockAdjustSuccess() {
+  gridApi.query();
+}
+
+/** 鎵撳紑绉诲簱寮圭獥 */
+function handleOpenStockMove(row: MesWmMaterialStockApi.MaterialStock) {
+  stockMoveModalApi.setData(row).open();
+}
+
+/** 绉诲簱鎴愬姛鍥炶皟 */
+function handleStockMoveSuccess() {
   gridApi.query();
 }
 
@@ -108,7 +142,7 @@
     schema: useGridFormSchema(),
   },
   gridOptions: {
-    columns: useGridColumns(handleFrozenChange),
+    columns: useGridColumns(handleFrozenChange, handleOpenStockMove),
     height: 'auto',
     keepSource: true,
     proxyConfig: {
@@ -139,6 +173,8 @@
   <Page auto-content-height><AreaModal />
     <WmBatchDetail ref="batchDetailRef" />
     <StockAdjustModal @success="handleStockAdjustSuccess" />
+    <StockMoveModal @success="handleStockMoveSuccess" />
+    <ImportModal @success="handleStockImportSuccess" />
 
     <div class="flex h-full w-full">
       <!-- 宸︿晶鐗╂枡鍒嗙被鏍� -->
@@ -157,6 +193,13 @@
                   icon: ACTION_ICON.EDIT,
                   auth: ['mes:wm-material-stock:adjust'],
                   onClick: handleOpenStockAdjust,
+                },
+                {
+                  label: '瀵煎叆',
+                  type: 'primary',
+                  icon: ACTION_ICON.UPLOAD,
+                  auth: ['mes:wm-material-stock:import'],
+                  onClick: handleOpenImport,
                 },
                 {
                   label: $t('ui.actionTitle.export'),
@@ -192,6 +235,19 @@
             </Button>
             <span v-else>-</span>
           </template>
+          <template #actions="{ row }">
+            <TableAction
+              :actions="[
+                {
+                  label: '绉诲簱',
+                  type: 'link',
+                  auth: ['mes:wm-material-stock:update'],
+                  ifShow: !row.frozen,
+                  onClick: handleOpenStockMove.bind(null, row),
+                },
+              ]"
+            />
+          </template>
         </Grid>
       </div>
     </div>

--
Gitblit v1.9.3