| | |
| | | <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 |
| | |
| | | :fieldNames="{ key: 'id', title: 'houseName' }" |
| | | :beforeRightClick="getRightMenuList" |
| | | @select="handleSelect" |
| | | @addHouse="addHouse" |
| | | @handleAdd="addHouse" |
| | | /> |
| | | <!-- <button :onClick="aa" style=" |
| | | position: absolute; |
| | |
| | | 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(); |
| | |
| | | // regions.children.forEach(shelf => { |
| | | // createIcon(shelf.houseType) |
| | | // }); |
| | | // }else{ |
| | | // }else{ |
| | | // createIcon(regions.houseType); |
| | | // } |
| | | // }); |
| | |
| | | fetch(); |
| | | } |
| | | |
| | | async function getRightMenuList(node: any): Promise<ContextMenuItem[]> { |
| | | function getRightMenuList(node: any): ContextMenuItem[] { |
| | | var name = node.houseType === 'Warehouse' ? t('新增储区') : t('新增货架'); |
| | | |
| | | if (node.houseType === 'Shelf') { |
| | |
| | | ]; |
| | | } |
| | | } |
| | | 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 ''; |