Ben Lin
2024-06-24 c8f8a9c645f7857859a9d56fac96192d994be70b
src/views/tigerprojects/wms/warehousemodel/WareHouseTree.vue
@@ -1,5 +1,5 @@
<template>
  <div class="m-4 mr-0 overflow-hidden bg-white" >
  <div class="m-4 mr-0 overflow-hidden bg-white">
    <TigerTree
      :title="t('仓库')"
      toolbar
@@ -11,7 +11,7 @@
      :fieldNames="{ key: 'id', title: 'houseName' }"
      :beforeRightClick="getRightMenuList"
      @select="handleSelect"
      @addHouse="addHouse"
      @handleAdd="addHouse"
    />
    <!-- <button :onClick="aa" style="
    position: absolute;
@@ -35,13 +35,13 @@
  import { getTreeList, DeleteWareHouse, getWHList } from '/@/api/tigerapi/wms/house';
  import { useMessage } from '/@/hooks/web/useMessage';
  import { useI18n } from '/@/hooks/web/useI18n';
  const { t } = useI18n('WMS.WareHouse');
  const { t } = useI18n();
  export default defineComponent({
    name: 'HouseTree',
    components: { TigerTree, RegionModal, WareHouseModal, ShelfModal },
    emits: ['select', 'success','delete'],
    emits: ['select', 'success', 'delete'],
    setup(_, { emit }) {
      const treeData = ref<TreeItem[]>();
      const [registerWareHouse, { openModal: openWareHouseModal }] = useModal();
@@ -63,7 +63,7 @@
        //         regions.children.forEach(shelf => {
        //           createIcon(shelf.houseType)
        //         });
        //       }else{
        //       }else{
        //         createIcon(regions.houseType);
        //       }
        //     });
@@ -88,7 +88,7 @@
        fetch();
      }
      async function getRightMenuList(node: any): Promise<ContextMenuItem[]> {
      function getRightMenuList(node: any): ContextMenuItem[] {
        var name = node.houseType === 'Warehouse' ? t('新增储区') : t('新增货架');
        if (node.houseType === 'Shelf') {
@@ -154,18 +154,19 @@
          ];
        }
      }
      async function GetORG_CODE(params: string) {
        var org = await getWHList(params);
        return org[0].AUTH_ORG;
      function GetORG_CODE(params: string) {
        getWHList(params).then((org) => {
          return org[0].AUTH_ORG;
        });
      }
      function createIcon({ houseType }) {
        if (houseType === 'Warehouse') {
      function createIcon(params: Recordable) {
        if (params['houseType'] === 'Warehouse') {
          return 'warehouse|svg';
        }
        if (houseType === 'Region') {
        if (params['houseType'] === 'Region') {
          return 'Region|svg';
        }
        if (houseType === 'Shelf') {
        if (params['houseType'] === 'Shelf') {
          return 'Shelf|svg';
        }
        return '';