hsy
9 天以前 29baff0abf45daffa2a546df592fbcb52f7c0443
feat(wls): 库区与库位列表页面增加返回上级功能

- 在库区列表页面(`wls/warehouse/location`)顶部提示框补充“返回”按钮,点击后关闭当前标签页并路由回“仓库列表”。
- 在库位列表页面(`wls/warehouse/area`)顶部提示框补充“返回”按钮,点击后关闭当前标签页并携带 warehouseId 回退至“库区列表”。
- 优化了用户在从列表操作列下钻进入子页面后,无法便捷返回上级目录的交互体验。
已修改2个文件
39 ■■■■■ 文件已修改
src/views/wls/warehouse/area/index.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/wls/warehouse/location/index.vue 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>
src/views/wls/warehouse/location/index.vue
@@ -7,6 +7,7 @@
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';
@@ -57,6 +58,14 @@
  }
}
loadWarehouseName();
const tabs = useTabs();
/** 返回上级 */
function handleBack() {
  tabs.closeCurrentTab();
  router.push({ path: '/wls/warehouse' });
}
/** 刷新表格 */
function handleRefresh() {
@@ -158,7 +167,11 @@
      :message="`当前仓库:${currentWarehouse.name || `#${currentWarehouse.id}`}`"
      show-icon
      type="info"
    />
    >
      <template #action>
        <Button size="small" type="primary" @click="handleBack"> 返回 </Button>
      </template>
    </Alert>
    <Grid table-title="库区列表">
      <template #toolbar-tools>