From 29baff0abf45daffa2a546df592fbcb52f7c0443 Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期三, 02 九月 2026 13:28:15 +0800
Subject: [PATCH] feat(wls): 库区与库位列表页面增加返回上级功能

---
 src/views/wls/warehouse/area/index.vue |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/views/wls/warehouse/area/index.vue b/src/views/wls/warehouse/area/index.vue
index 0692436..930d01b 100644
--- a/src/views/wls/warehouse/area/index.vue
+++ b/src/views/wls/warehouse/area/index.vue
@@ -3,10 +3,11 @@
 import type { MesWmWarehouseAreaApi } from '#/api/mes/wm/warehouse/area';
 
 import { ref } from 'vue';
-import { useRoute } from 'vue-router';
+import { useRoute, useRouter } from 'vue-router';
 
 import { Page, useVbenModal } from '@vben/common-ui';
 import { BarcodeBizTypeEnum } from '@vben/constants';
+import { useTabs } from '@vben/hooks';
 
 import { Alert, Button, message } from 'ant-design-vue';
 
@@ -25,6 +26,8 @@
 defineOptions({ name: 'WlsArea' });
 
 const route = useRoute();
+const router = useRouter();
+const tabs = useTabs();
 
 const [FormModal, formModalApi] = useVbenModal({
   connectedComponent: Form,
@@ -63,6 +66,19 @@
   }
 }
 loadLocationName();
+
+/** 杩斿洖涓婄骇 */
+function handleBack() {
+  tabs.closeCurrentTab();
+  if (currentLocation.value.warehouseId) {
+    router.push({
+      path: '/wls/location',
+      query: { warehouseId: String(currentLocation.value.warehouseId) },
+    });
+  } else {
+    router.push({ path: '/wls/location' });
+  }
+}
 
 /** 鍒锋柊琛ㄦ牸 */
 function handleRefresh() {
@@ -157,7 +173,11 @@
       :message="`褰撳墠浠撳簱/搴撳尯锛�${currentLocation.warehouseName || `#${currentLocation.warehouseId || '-'}`} / ${currentLocation.name || `#${currentLocation.id}`}`"
       show-icon
       type="info"
-    />
+    >
+      <template #action>
+        <Button size="small" type="primary" @click="handleBack"> 杩斿洖 </Button>
+      </template>
+    </Alert>
 
     <Grid table-title="搴撲綅鍒楄〃">
       <template #toolbar-tools>

--
Gitblit v1.9.3