| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-22 18:38:48 |
| | | * @LastEditTime: 2024-07-24 00:05:00 |
| | | */ |
| | | |
| | | import { Ref, h, ref, render, unref } from 'vue'; |
| | | import { GetRoutePTree, GetWoPTree, RouteToCust, RouteToProd, SP_MES_PROD2WO, SP_MES_WO2CUST } from '/@/api/tigerapi/mes/router'; |
| | | import { DeleteWoRoute, GetRoutePTree, GetWoPTree, RouteToCust, RouteToProd, SP_MES_PROD2WO, SP_MES_WO2CUST } from '/@/api/tigerapi/mes/router'; |
| | | import { GetEnum, SaveEntity, convertToTree, getEntity } from '/@/api/tigerapi/system'; |
| | | import { useLocale } from '/@/locales/useLocale'; |
| | | import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; |
| | |
| | | import { initRoute } from '../data'; |
| | | import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | import { EventDataNode } from 'ant-design-vue/lib/tree'; |
| | | import { ContextMenuItem } from '/@/components/TigerTree'; |
| | | |
| | | const { t } = useI18n(); |
| | | const { createErrorModal } = useMessage(); |
| | |
| | | GetBaseCards: (type: string) => { |
| | | let reusts: any[] = []; |
| | | switch (type) { |
| | | case 'Product': |
| | | case 'WorkOrder': |
| | | reusts = []; |
| | | break; |
| | | case 'Route': |
| | |
| | | GetUseForm: () => { |
| | | return {}; |
| | | }, |
| | | /** |
| | | * @description: 获取右键菜单列表 |
| | | * @param {EventDataNode} node |
| | | * @return {*} |
| | | */ |
| | | GetRightMenuList: (node: EventDataNode, ...args): ContextMenuItem[] => { |
| | | const emit = args[0]; |
| | | const menu = [ |
| | | // { |
| | | // label: '新增', |
| | | // handler: () => { |
| | | // console.log('点击了新增', node); |
| | | // }, |
| | | // icon: 'bi:plus', |
| | | // }, |
| | | { |
| | | label: '删除', |
| | | handler: () => { |
| | | console.log('点击了删除', node); |
| | | DeleteWoRoute({rotId:'',rotCode: node.code, wo: node.wo}).then((action) => { |
| | | if(action.IsSuccessed){ |
| | | emit('deletenode', node); |
| | | }else{ |
| | | createErrorModal({ |
| | | title: t('sys.api.errorTip'), |
| | | content: t(action.LocaleMsg), |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | icon: 'bx:bxs-folder-open', |
| | | }, |
| | | ]; |
| | | return node.type == 'Route'? menu: []; |
| | | }, |
| | | }; |
| | | |
| | | /* 以下是内部方法,不export,供上面的方法调用 */ |