| | |
| | | * @version: |
| | | * @Date: 2024-06-05 15:46:07 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-21 20:29:30 |
| | | * @LastEditTime: 2024-07-22 00:51:10 |
| | | --> |
| | | <template> |
| | | <BasicModal |
| | |
| | | @register="registerModal" |
| | | :title="title" |
| | | @ok="handleSuccess" |
| | | @cancel="handleCancel" |
| | | :width="width" |
| | | > |
| | | <a-layout> |
| | |
| | | const ALayout = Layout; |
| | | const ACard = Card; |
| | | const ALayoutContent = LayoutContent; |
| | | const emit = defineEmits(['success', 'register', 'modalInner']); |
| | | const emit = defineEmits(['success', 'register', 'modalInner', 'cancel']); |
| | | const isUpdate = ref(true); |
| | | const cType = ref(''); |
| | | const title = ref(''); |
| | |
| | | setModalProps({ confirmLoading: false }); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description: åæ¶æé®è§¦ååæ¶äºä»¶ |
| | | * @return {*} |
| | | */ |
| | | function handleCancel() { |
| | | emit('cancel'); |
| | | } |
| | | </script> |
| | |
| | | ROT_VER: currRoute.value.ROT_VER, |
| | | IS_ACTIVE: currRoute.value.IS_ACTIVE, |
| | | REMARK: currRoute.value.REMARK, |
| | | AUTH_ORG: '', |
| | | AUTH_ORG: useUserStore().getUserInfo.orgCode, |
| | | AUTH_PROD: '', |
| | | AUTH_WH: '', |
| | | }, |
| | |
| | | GPH_PROP: JSON.stringify(n.properties), |
| | | GPH_TEXT: n.text.value, |
| | | REMARK: a.REMARK, |
| | | AUTH_ORG: '', |
| | | AUTH_ORG: useUserStore().getUserInfo.orgCode, |
| | | AUTH_PROD: '', |
| | | AUTH_WH: '', |
| | | OPTION_1: '', |
| | |
| | | IS_CALC_FPY: nd.IS_CALC_FPY, |
| | | CAN_SKIP: nd.CAN_SKIP, |
| | | REMARK: nd.REMARK, |
| | | AUTH_ORG: '', |
| | | AUTH_ORG: useUserStore().getUserInfo.orgCode, |
| | | AUTH_PROD: '', |
| | | AUTH_WH: '', |
| | | IS_FIRST_NODE: 'N', |
| | |
| | | GPH_PROP: JSON.stringify(e.properties), |
| | | GPH_POTS: JSON.stringify(e.pointsList), |
| | | REMARK: '', |
| | | AUTH_ORG: '', |
| | | AUTH_ORG: useUserStore().getUserInfo.orgCode, |
| | | AUTH_PROD: '', |
| | | AUTH_WH: '', |
| | | EDGE_TYPE: 0, |
| | |
| | | IS_CALC_FPY: 'N', |
| | | CAN_SKIP: 'N', |
| | | REMARK: '', |
| | | AUTH_ORG: '', |
| | | AUTH_ORG: useUserStore().getUserInfo.orgCode, |
| | | AUTH_PROD: '', |
| | | AUTH_WH: '', |
| | | IS_FIRST_NODE: '', |
| | |
| | | UPDATE_TIME: currRoute.value.UPDATE_TIME, |
| | | UPDATE_USER: useUserStore().getUserInfo.userId as string, |
| | | GHOST_ROW: false, |
| | | AUTH_ORG: '', |
| | | AUTH_ORG: useUserStore().getUserInfo.orgCode, |
| | | AUTH_PROD: '', |
| | | AUTH_WH: '', |
| | | ACT_NAME: `${selectnode.value.text.value}_0`, |
| | |
| | | UPDATE_TIME: currRoute.value.UPDATE_TIME, |
| | | UPDATE_USER: useUserStore().getUserInfo.userId as string, |
| | | GHOST_ROW: false, |
| | | AUTH_ORG: '', |
| | | AUTH_PROD: '', |
| | | AUTH_WH: '', |
| | | AUTH_ORG: _act.AUTH_ORG, |
| | | AUTH_PROD: _act.AUTH_PROD, |
| | | AUTH_WH: _act.AUTH_WH, |
| | | ACT_NAME: _act.ACT_NAME, |
| | | ACT_CODE: _act.ACT_CODE, |
| | | ROT_ID: currRoute.value.ID, |
| | |
| | | UPDATE_TIME: currRoute.value.UPDATE_TIME, |
| | | UPDATE_USER: useUserStore().getUserInfo.userId as string, |
| | | GHOST_ROW: false, |
| | | AUTH_ORG: _node.AUTH_ORG, |
| | | AUTH_PROD: _node.AUTH_PROD, |
| | | AUTH_WH: _node.AUTH_WH, |
| | | NODE_NAME: _node.NODE_NAME ?? '', |
| | | ROT_ID: currRoute.value.ID, |
| | | SEGMENT: _node.SEGMENT, |
| | |
| | | * @version: |
| | | * @Date: 2024-06-20 12:13:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-03 20:31:07 |
| | | * @LastEditTime: 2024-07-22 03:45:38 |
| | | --> |
| | | <template> |
| | | <Card :title="GetTitle(props.configType)['navTitle']"> |
| | |
| | | import { useTabs } from '/@/hooks/web/useTabs'; |
| | | import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; |
| | | |
| | | const ACard = Card; |
| | | const objParams = inject('objParams') as Ref<any>; |
| | |
| | | GetBaseCards(type: string | undefined) {}, |
| | | GetSelectSuccess(d, u, ...args) {}, |
| | | GenerateHtml(ype: string | null) {}, |
| | | CustFunc(type: string | undefined, ...args) {}, |
| | | CustFunc(param: CustModalParams) {}, |
| | | } as EntityCustFunctionType, |
| | | ]); |
| | | /* 卿importå®ä½å.tsçèªå®ä¹æ¹æ³ */ |
| | |
| | | <template #toolbar> |
| | | <a-button |
| | | type="primary" |
| | | v-for="item in buttons.filter((m) => m['BUTTON_TYPE'] == 0)" |
| | | @click="handleCreate(item['DO_METHOD'])" |
| | | :preIcon="item['ICON_URL']" |
| | | v-for="item in buttons.filter((m) => m['BUTTON_TYPE'] == 0)" |
| | | :key="item" |
| | | > |
| | | {{ item['FUNC_NAME'] }} |
| | |
| | | /> |
| | | </template> |
| | | </BasicTable> |
| | | <Suspense> |
| | | <CustModal |
| | | @register="registerCust" |
| | | @success="custSuccess" |
| | | @cancel="custCancel" |
| | | :type="cType" |
| | | :entityName="entityName" |
| | | @modalInner="getdtlSlots" |
| | | > |
| | | <!-- ç¨ææ§½èªå®ä¹å¤è¡¨å --> |
| | | <template #[item.name] v-for="item in dtlSlots" :key="item.name"> |
| | | <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]"> |
| | | <!-- ç¨ææ§½èªå®ä¹å¼¹åºéæ©æ¡ --> |
| | | <template #[name]="{ field }" v-for="name in item.slots" :key="name"> |
| | | <a-button |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="handleCustClick(field)" |
| | | :preIcon="item.preIcons[name]" |
| | | /> |
| | | <GeneralModal |
| | | @register="useModalData[name][0]" |
| | | @success="(d, u) => handleEntSuccess(d, u, item.name)" |
| | | /> |
| | | </template> |
| | | </BasicForm> |
| | | <!-- èªå®ä¹å
容 --> |
| | | </template> |
| | | </CustModal> |
| | | </Suspense> |
| | | <normalDrawer @register="registerDrawer" @success="handleSuccess" /> |
| | | </div> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { Ref, inject, onMounted, ref } from 'vue'; |
| | | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| | | import { useForm } from '/@/components/Form/index'; |
| | | import { BasicForm, useForm } from '/@/components/Form/index'; |
| | | import { useDrawer } from '/@/components/Drawer'; |
| | | import GeneralModal from '/@/views/components/GeneralModal.vue'; |
| | | import normalDrawer from '../normalDrawer.vue'; |
| | | import CustModal from '/@/views/components/CustModal.vue'; |
| | | import { isFunction, isNullOrUnDef } from '/@/utils/is'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | |
| | | const go = useGo(); |
| | | const [registerDrawer, { openDrawer }] = useDrawer(); |
| | | const [registerItemAdd, { openModal: openItemModal }] = useModal(); |
| | | const [registerCust, { openModal: openCustModal }] = useModal(); |
| | | const cType = ref(''); |
| | | const selectVals = ref({}); |
| | | const colSlots = ref<any>(objParams['colSlots']); //æé®ææ§½ |
| | | const dtlSlots = ref([] as any[]); |
| | | const useModalData = ref({}); //表åä¸ææ§½æ¸²ææé®æå¼æ¨¡ææ¡useModalæ¹æ³ |
| | | const useFormData = ref({}); |
| | | const custImport = ref<any[]>([]); |
| | | const EntityCustFunction = ref([ |
| | | { |
| | |
| | | KeyFieldValues, |
| | | GetSelectSuccess, |
| | | OpenSelectItem, |
| | | GetUseForm, |
| | | GetUseModals, |
| | | }, |
| | | ] = isNullOrUnDef(custImport.value['default']) |
| | | ? EntityCustFunction.value |
| | |
| | | KeyFieldValues && isFunction(KeyFieldValues) |
| | | ? KeyFieldValues(objParams['CODE'], objParams['ID']) |
| | | : []; |
| | | const useformdata = GetUseForm && isFunction(GetUseForm) ? GetUseForm() : {}; |
| | | const useFormData = ref<any>(useformdata); |
| | | /* 表åä¸ææ§½æ¸²ææé®æå¼æ¨¡ææ¡useModalæ¹æ³ */ |
| | | const modals = GetUseModals && isFunction(GetUseModals) ? GetUseModals() : { useModalData: {} }; |
| | | const useModalData = ref(modals['useModalData']); |
| | | const [registerTable, { getForm, reload, setProps }] = useTable({ |
| | | title: `${objParams['firstTitle']}å表`, |
| | | api: getListByPage, |
| | |
| | | useFormData, |
| | | crudColSlots: colSlots.value, |
| | | data, |
| | | selectVals, |
| | | colSlots, |
| | | }; |
| | | const actionItem = GenerateActionButton(params, buttons, openDrawer, reload); |
| | | if (isNullOrUnDef(custImport.value['default'])) { |
| | |
| | | useModal, |
| | | go, |
| | | setProps, |
| | | openCustModal, |
| | | ); |
| | | } |
| | | |
| | |
| | | function handleSelectItem(item) { |
| | | OpenSelectItem(openItemModal); |
| | | } |
| | | |
| | | /** |
| | | * @description: å¼¹åºæ¡ç¡®å®è¿å |
| | | * @param {*} d |
| | | * @return {*} |
| | | */ |
| | | function custSuccess(d) { |
| | | reload(); |
| | | } |
| | | |
| | | /** |
| | | * @description: å¼¹åºæ¡åæ¶è¿å |
| | | * @param {*} reload |
| | | * @return {*} |
| | | */ |
| | | function custCancel() { |
| | | reload(); |
| | | } |
| | | |
| | | /** |
| | | * @description: å表åå
å¼¹åºéæ©æ¡éæ©æååæ¹æ³ |
| | | * @param {*} d |
| | | * @param {*} u |
| | | * @param {*} item |
| | | * @return {*} |
| | | */ |
| | | function handleEntSuccess(d, u, item) { |
| | | /* 卿importå®ä½å.tsçèªå®ä¹æ¹æ³ */ |
| | | try { |
| | | var values = GetSelectSuccess(d, u); |
| | | selectVals.value = values; //ä¿åå¼¹åºæ¡éæ©çç»æ |
| | | let _val = {}; |
| | | d.returnFieldName.map((x) => { |
| | | _val[x] = values[x]; |
| | | }); |
| | | useFormData.value[item][1].setFieldsValue(_val); |
| | | } catch (e) {} |
| | | } |
| | | |
| | | /** |
| | | * @description: æå¼è¡¨åä¸çæ¨¡ææ¡ |
| | | * @param {*} item |
| | | * @return {*} |
| | | */ |
| | | function handleCustClick(item) { |
| | | OpenSelectItem( |
| | | useModalData.value[item][1].openModal, //带å
¥openModalæ¹æ³ |
| | | item, |
| | | null, |
| | | selectVals, |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * @description: è·åå¤è¡¨åææ§½å表 |
| | | * @param {*} d |
| | | * @return {*} |
| | | */ |
| | | function getdtlSlots(d, callback) { |
| | | dtlSlots.value = d; |
| | | callback(); |
| | | // setTimeout(() => { |
| | | // callback(); |
| | | // }, 100); |
| | | } |
| | | </script> |
| | |
| | | * @version: |
| | | * @Date: 2024-05-30 13:28:20 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-21 18:02:52 |
| | | * @LastEditTime: 2024-07-22 01:55:07 |
| | | --> |
| | | <template> |
| | | <PageWrapper :title="pageTitle" :content="contentStr" contentBackground @back="goBack"> |
| | |
| | | <Suspense></Suspense> |
| | | </div> |
| | | </div> |
| | | <Suspense> |
| | | <CustModal |
| | | @register="registerCust" |
| | | @success="custSuccess" |
| | | :type="cType" |
| | | :detailSlots="dtlSlots" |
| | | :entityName="entityName" |
| | | > |
| | | <!-- ç¨ææ§½èªå®ä¹å¤è¡¨å --> |
| | | <template #[item.name] v-for="item in dtlSlots" :key="item.name"> |
| | | <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]"> |
| | | <!-- ç¨ææ§½èªå®ä¹å¼¹åºéæ©æ¡ --> |
| | | <template #[name]="{ field }" v-for="name in item.slots" :key="name"> |
| | | <a-button |
| | | class="mt-1 ml-1" |
| | | size="small" |
| | | @click="handleCustClick(field)" |
| | | :preIcon="item.preIcons[name]" |
| | | /> |
| | | <GeneralModal |
| | | @register="useModalData[name][0]" |
| | | @success="(d, u) => handleEntSuccess(d, u, item.name)" |
| | | /> |
| | | </template> |
| | | </BasicForm> |
| | | <!-- èªå®ä¹å
容 --> |
| | | </template> |
| | | </CustModal> |
| | | </Suspense> |
| | | </PageWrapper> |
| | | </template> |
| | | |
| | |
| | | import detail from './detail.vue'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import GeneralModal from '/@/views/components/GeneralModal.vue'; |
| | | import CustModal from '/@/views/components/CustModal.vue'; |
| | | import { BasicForm } from '/@/components/Form/index'; |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | |
| | | const { t } = useI18n(); |
| | | |
| | |
| | | const entityName = ref(routeParams.value.Name); |
| | | const detailName = ref(objParams.value.detailName); |
| | | const globSetting = useGlobSetting(); |
| | | const formSchemas = ref({}); //å¼¹åºæ¡å¤è¡¨åç»æ |
| | | const useModalData = ref({}); //表åä¸ææ§½æ¸²ææé®æå¼æ¨¡ææ¡useModalæ¹æ³ |
| | | const useFormData = ref({}); |
| | | const secondColSlots = ref<any>(objParams.value.secondColSlots); //æé®ææ§½ |
| | | const crudColSlots = ref<any>(objParams.value.colSlots); |
| | | const cType = ref(''); |
| | | const dtlSlots = ref([] as any[]); |
| | | const selectVals = ref({}); |
| | | const keyFieldValues = ref<any>(null); |
| | | provide<Ref<any>>('objParams', objParams.value); |
| | | provide<Ref<any>>('keyFieldValues', keyFieldValues); |
| | | const [registerCust] = useModal(); |
| | | |
| | | var currentKey = ref('detailfirst'); |
| | | const { setTitle } = useTabs(); |
| | |
| | | }; |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description: èªå®ä¹å¼¹åºæ¡ç¡®å®è¿å |
| | | * @param {*} d |
| | | * @return {*} |
| | | */ |
| | | function custSuccess(d) { |
| | | // reload(); |
| | | } |
| | | |
| | | /** |
| | | * @description: å表åå
å¼¹åºéæ©æ¡éæ©æååæ¹æ³ |
| | | * @param {*} d |
| | | * @param {*} u |
| | | * @param {*} item |
| | | * @return {*} |
| | | */ |
| | | function handleEntSuccess(d, u, item) { |
| | | /* 卿importå®ä½å.tsçèªå®ä¹æ¹æ³ */ |
| | | try { |
| | | import(`../entityts/${cType.value}.ts`).then((m) => { |
| | | const [{ GetSelectSuccess }] = m.default(); |
| | | var values = GetSelectSuccess(d, u); |
| | | selectVals.value = values; //ä¿åå¼¹åºæ¡éæ©çç»æ |
| | | let _val = {}; |
| | | d.returnFieldName.map((x) => { |
| | | _val[x] = values[x]; |
| | | }); |
| | | useFormData.value[item][1].setFieldsValue(_val); |
| | | }); |
| | | } catch (e) {} |
| | | } |
| | | |
| | | /** |
| | | * @description: æå¼èªå®ä¹æ¨¡ææ¡ |
| | | * @param {*} item |
| | | * @return {*} |
| | | */ |
| | | function handleCustClick(item) { |
| | | OpenCustModal( |
| | | useModalData.value[item][1].openModal, //带å
¥openModalæ¹æ³ |
| | | cType.value, |
| | | item, |
| | | [], |
| | | // selectVals.value['ROUTE_CODE'], |
| | | ); //[openRvModal], selectVals.value['ID']è¿æ¯èªå®ä¹åæ°ï¼æå®é
éæ± |
| | | } |
| | | </script> |
| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-21 20:55:33 |
| | | * @LastEditTime: 2024-07-22 02:58:01 |
| | | */ |
| | | |
| | | import { Ref, h, ref, render, unref } from 'vue'; |
| | |
| | | const isPrint = (type: number) => type === 5; |
| | | const isPackage = (type: number) => type === 6; |
| | | const ActionColumn: BasicColumn = { |
| | | width: 220, |
| | | width: 180, |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | |
| | | }); |
| | | break; |
| | | case 'set': |
| | | case 'setRot': |
| | | openRvModal(true, { rotId: selectVals.value['ROUTE_CODE'], slotName: slotName }); |
| | | break; |
| | | case 'setRot': |
| | | const id = { |
| | | ID: params['record'].ID, |
| | | Name: 'WoRouteBinding', |
| | | CODE: params['record'].ITEM_CODE, |
| | | Title: `å·¥å[${params['record'].ITEM_CODE}]å·¥èºç»å®`, |
| | | colSlots: [] /* è¡¨æ ¼å
çæ¥è¯¢è¡¨ååæ®µçææ§½å表ï¼ä¸è¬ç¨äºå¼¹åºéæ©æ¡æé® */, |
| | | crudColSlots: [] /* å¢å æ¹è¡¨ååæ®µçææ§½å表ï¼ä¸è¬ç¨äºå¼¹åºéæ©æ¡æé® */, |
| | | dense: true, |
| | | pageTitle: `å·¥åå·¥èºç»å®`, |
| | | pageContent: `è¿éæ¯ç®¡çå·¥åçå·¥èºç»å®ï¼ä¸ä¸ªå·¥åå¯ä»¥ç»å®å¤ä¸ªå·¥èºè·¯çº¿`, |
| | | }; |
| | | go(`/WoRouteBinding/CP/${encodeURI(JSON.stringify(id))}`); |
| | | break; |
| | | } |
| | | }, |
| | | }; |
| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-20 22:29:35 |
| | | * @LastEditTime: 2024-07-22 02:29:18 |
| | | */ |
| | | |
| | | import { Tag, Tooltip } from 'ant-design-vue'; |
| | | import { ActionItem, BasicColumn } from '/@/components/Table'; |
| | | import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { h, unref } from 'vue'; |
| | | import { GetEnum } from '/@/api/tigerapi/system'; |
| | | import { getEntity, GetEnum, SaveEntity } from '/@/api/tigerapi/system'; |
| | | import { useLocale } from '/@/locales/useLocale'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { CustModalParams, FunctionType } from '/@/api/tigerapi/model/systemModel'; |
| | | import { useForm } from '/@/components/Form'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | |
| | | const { getLocale } = useLocale(); |
| | | |
| | | const { createMessage, createErrorModal } = useMessage(); |
| | | const { t } = useI18n(); |
| | | |
| | | function _default() { |
| | |
| | | * @return {*} |
| | | */ |
| | | ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { |
| | | data.map((x) => { |
| | | if (x.name == 'handlePause') { |
| | | x.onClick = handlePause.bind(null, args, params); |
| | | x.tooltip = 'æå'; |
| | | } |
| | | if (x.name == 'handleRelease') { |
| | | x.onClick = handleRelease.bind(null, args, params); |
| | | x.tooltip = 'ä¸å'; |
| | | } |
| | | }); |
| | | return data; |
| | | }, |
| | | /** |
| | |
| | | return { ORDER_NO: val }; |
| | | }, |
| | | GetUseForm: () => { |
| | | return {}; |
| | | return { |
| | | forminfo: useForm({ |
| | | labelWidth: 120, |
| | | schemas: woformSchema, |
| | | actionColOptions: { |
| | | span: 24, |
| | | }, |
| | | showActionButtonGroup: false, |
| | | }), |
| | | }; |
| | | }, |
| | | /** |
| | | * @description: èªå®ä¹æ¹æ³ |
| | | * @param {string} type |
| | | * @param {array} args |
| | | * @return {*} |
| | | */ |
| | | CustFunc: (param: CustModalParams) => { |
| | | switch (param.cType) { |
| | | case 'BIZ_MES_WO_BATCH': |
| | | return getWoFns[param.FnName](param) as Promise<any>; |
| | | break; |
| | | default: |
| | | return new Promise((resolve, reject) => { |
| | | try { |
| | | (e) => {}; |
| | | resolve(true); |
| | | } catch { |
| | | reject(false); |
| | | } finally { |
| | | // args[0][0]({ confirmLoading: false }); |
| | | } |
| | | }); |
| | | // break; |
| | | } |
| | | }, |
| | | /** |
| | | * @description: è·åå¤è¡¨åææ§½å表 |
| | | * @return {*} |
| | | */ |
| | | GetDtlSlots: (type: string) => { |
| | | let result = [] as any[]; |
| | | switch (type) { |
| | | case 'BIZ_MES_WO_BATCH': |
| | | result = [ |
| | | { |
| | | name: 'forminfo', |
| | | slots: ['add', 'set'], |
| | | preIcons: { add: 'search|svg', set: 'config|svg' }, //妿æ¯å¤ä¸ªè¡¨åï¼å¢å å¤ä¸ªææ§½ãslotsæ¯å¼¹åºæ¡æé®çææ§½ï¼preIconsæ¯ææ§½å¯¹åºçæé®å¾æ |
| | | title: 'ä¸åé
ç½®', |
| | | }, |
| | | ]; |
| | | break; |
| | | } |
| | | return result; |
| | | }, |
| | | /** |
| | | * @description: è·åæ¨¡ææ¡åºç¨å表 |
| | | * @return {*} |
| | | */ |
| | | GetUseModals: () => { |
| | | return { |
| | | useModalData: { |
| | | add: useModal(), |
| | | set: useModal(), |
| | | addRot: useModal(), |
| | | setRot: useModal(), |
| | | }, |
| | | }; |
| | | }, |
| | | /** |
| | | * @description: å¼¹åºéæ©æ¡éæ©æåè¿åæ¹æ³ |
| | | * @param {*} d |
| | | * @param {*} u |
| | | * @return {*} |
| | | */ |
| | | GetSelectSuccess: (d, u) => { |
| | | return { |
| | | ROUTE_CODE: d.values['val'], |
| | | // ID: d.values['id'], |
| | | ROT_ID: d.values['id'], |
| | | }; |
| | | }, |
| | | /** |
| | | * @description: æå¼å¼¹åºéæ©æ¡ |
| | | * @param {Fn} openItemModal |
| | | * @param {array} args |
| | | * @return {*} |
| | | */ |
| | | OpenSelectItem: (openItemModal: Fn, ...args) => { |
| | | const slotName = args[0]; |
| | | switch (slotName) { |
| | | case 'addRot': |
| | | case 'add': |
| | | openItemModal(true, { |
| | | title: 'å·¥èºè·¯çº¿å表', |
| | | schemas: [ |
| | | { |
| | | field: 'ROT_CODE', |
| | | component: 'Input', |
| | | label: 'å·¥èºè·¯çº¿ç¼ç ', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('å·¥èºè·¯çº¿ç¼ç '), |
| | | dataIndex: 'ROT_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('å·¥èºè·¯çº¿åç§°'), |
| | | dataIndex: 'ROT_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'MES_ROUTE', |
| | | rowKey: 'ROT_CODE', |
| | | returnFieldName: ['ROUTE_CODE', 'ROT_ID'], //è¿åå¼è¦èµå¼çåæ®µåç§° |
| | | searchInfo: { TABLE_NAME: 'MES_ROUTE' }, |
| | | }); |
| | | break; |
| | | } |
| | | }, |
| | | }; |
| | | |
| | | /* 以䏿¯å
鍿¹æ³ï¼ä¸exportï¼ä¾ä¸é¢çæ¹æ³è°ç¨ */ |
| | | |
| | | /** |
| | | * @description: èªå®ä¹æ¹æ³ |
| | | * @return {*} |
| | | */ |
| | | const getWoFns: Record<string, FunctionType> = { |
| | | /** |
| | | * @description: å·¥åä¸åä¿åæ¹æ³ |
| | | * @param {CustModalParams} param |
| | | * @return {*} |
| | | */ |
| | | SaveWoBatch: (param: CustModalParams) => { |
| | | return new Promise((resolve, reject) => { |
| | | try { |
| | | const wo = param.values['mValues']; |
| | | wo.STATUS = 2; |
| | | wo.ACT_LINE = param.values['forminfo'].ACT_LINE; |
| | | SaveEntity(wo, true, 'BIZ_MES_WO_BATCH').then((action) => { |
| | | if (action.IsSuccessed) { |
| | | resolve(action); |
| | | } else { |
| | | reject(action); |
| | | } |
| | | }); |
| | | } catch { |
| | | reject(false); |
| | | } |
| | | }); |
| | | }, |
| | | }; |
| | | |
| | | /** |
| | | * @description: å·¥åæåæ¹æ³ |
| | | * @param {*} args |
| | | * @param {Recordable} params |
| | | * @return {*} |
| | | */ |
| | | function handlePause(args, params: Recordable) { |
| | | const reload = args[1]; |
| | | if (params['record'].STATUS == 0) { |
| | | createErrorModal({ |
| | | title: t('è¦å'), |
| | | content: t('工忝åå§åç¶æï¼ä¸è½æåï¼'), |
| | | getContainer: () => document.body, |
| | | }); |
| | | return; |
| | | } |
| | | if (params['record'].STATUS == 5) { |
| | | createErrorModal({ |
| | | title: t('è¦å'), |
| | | content: t('å·¥åæ¯å®æç¶æï¼ä¸è½æåï¼'), |
| | | getContainer: () => document.body, |
| | | }); |
| | | return; |
| | | } |
| | | params['record'].STATUS = 4; |
| | | SaveEntity(params['record'], true, 'BIZ_MES_WO_BATCH').then((action) => { |
| | | if (action.IsSuccessed) { |
| | | createMessage.success(t('å·²æå')); |
| | | reload(); |
| | | } else { |
| | | createMessage.success(t('æåæä½å¤±è´¥')); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * @description: å·¥åä¸åæ¹æ³ |
| | | * @param {*} args |
| | | * @param {Recordable} params |
| | | * @return {*} |
| | | */ |
| | | function handleRelease(args, params: Recordable) { |
| | | const openCustModal = args[7]; |
| | | openCustModal(true, { |
| | | isUpdate: true, //æ¯å¦æ´æ°æä½ |
| | | ctype: 'BIZ_MES_WO_BATCH', //æ¯åªä¸ªé¡µé¢ |
| | | title: 'å·¥åä¸å', //æ é¢ |
| | | width: '900px', //å¼¹åºæ¡å®½åº¦ |
| | | formEl: params['useFormData'].value, |
| | | formElName: ['forminfo'], //è¡¨åææ§½åç§° |
| | | RowKeys: { add: 'ROUTE_CODE', set: 'ROUTE_CODE' }, //ææ§½çå¼¹åºæ¡éæ©çcode |
| | | fnName: 'SaveWoBatch', //ä¿åæ¹æ³å |
| | | initFnName: {}, //åå§åæ¹æ³åï¼æ²¡æå°±ç空{} |
| | | values: params['record'], //表åè®°å½ |
| | | }); |
| | | } |
| | | |
| | | const woformSchema: FormSchema[] = [ |
| | | { |
| | | field: 'PLAN_QTY', |
| | | label: '工忰é', |
| | | component: 'Input', |
| | | required: true, |
| | | colProps: { |
| | | span: 24, |
| | | }, |
| | | dynamicDisabled: ({ values }) => { |
| | | return true; |
| | | }, |
| | | }, |
| | | // { |
| | | // field: 'RELEASE_QTY', |
| | | // label: 'å·¥åä¸åæ°é', |
| | | // component: 'Input', |
| | | // required: true, |
| | | // colProps: { |
| | | // span: 24, |
| | | // }, |
| | | // }, |
| | | { |
| | | label: '计å产线', |
| | | field: 'ACT_LINE', |
| | | component: 'ApiSelect', |
| | | required: true, |
| | | colProps: { |
| | | span: 24, |
| | | }, |
| | | componentProps: { |
| | | api: getEntity, |
| | | params: { entityName: 'MES_LINE', sqlcmd: ' 1=1 ', order: '' }, |
| | | resultField: 'Data.Items', |
| | | labelField: 'LINE_NAME', |
| | | valueField: 'LINE_CODE', |
| | | }, |
| | | }, |
| | | // { |
| | | // label: 'å·¥èºè·¯çº¿', |
| | | // field: 'ROUTE_CODE', |
| | | // component: 'Input', |
| | | // required: true, |
| | | // colProps: { |
| | | // span: 22, |
| | | // }, |
| | | // }, |
| | | // { |
| | | // field: 'add', |
| | | // component: 'Input', |
| | | // label: '1', |
| | | // colSlot: 'add', |
| | | // defaultValue: 'MES_ROUTE', |
| | | // colProps: { |
| | | // span: 1, |
| | | // }, |
| | | // }, |
| | | // { |
| | | // field: 'set', |
| | | // component: 'Input', |
| | | // label: '1', |
| | | // colSlot: 'set', |
| | | // defaultValue: 'MES_ROUTE', |
| | | // colProps: { |
| | | // span: 1, |
| | | // }, |
| | | // }, |
| | | ]; |
| | | |
| | | return [methods, ActionColumn]; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * @Description: 产åå·¥èºè·¯çº¿ç¸å
³ |
| | | * @Author: Ben Lin |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-21 18:26:07 |
| | | */ |
| | | |
| | | import { Ref, h, ref, render, unref } from 'vue'; |
| | | import { GetRoutePTree, RouteToCust, RouteToProd } 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 { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { NavItem } from '/@/api/tigerapi/model/basModel'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { FormSchema } from '/@/components/Table'; |
| | | import { initRoute } from '../data'; |
| | | import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | |
| | | const { t } = useI18n(); |
| | | const { createErrorModal } = useMessage(); |
| | | const { getLocale } = useLocale(); |
| | | function _default() { |
| | | /* å®ä¹åé */ |
| | | const isNormal = (type: number) => type === 0; |
| | | const isScan = (type: number) => type === 1; |
| | | const isAssy = (type: number) => type === 2; |
| | | const isTest = (type: number) => type === 3; |
| | | const isAudit = (type: number) => type === 4; |
| | | const isPrint = (type: number) => type === 5; |
| | | const isPackage = (type: number) => type === 6; |
| | | /** |
| | | * @description: 产åç»å®å·¥èºè·¯çº¿çä¸äºèªå®ä¹æ¹æ³ |
| | | * @return {*} |
| | | */ |
| | | const methods = { |
| | | /** |
| | | * @description: è·åæ 形徿 |
| | | * @param {Recordable} params |
| | | * @return {*} |
| | | */ |
| | | CreateIcon: (params: Recordable<any>) => { |
| | | let icon = ''; |
| | | switch (params['type']) { |
| | | case 'Product': |
| | | icon = 'similar-product|svg'; |
| | | break; |
| | | case 'Route': |
| | | icon = 'route|svg'; |
| | | break; |
| | | case 'Node': |
| | | icon = 'node|svg'; |
| | | break; |
| | | case 'Action': |
| | | icon = 'rot_action|svg'; |
| | | break; |
| | | case 'Customer': |
| | | icon = 'customer|svg'; |
| | | break; |
| | | } |
| | | return icon; |
| | | }, |
| | | /** |
| | | * @description: é«çº§è¡¨åå详æ
页é¢è¿å主页é¢çurl |
| | | * @return {*} |
| | | */ |
| | | GetHomeUrl: () => { |
| | | return `/V_BAS_PROD/LC/${encodeURI(JSON.stringify({ ID: 'V_BAS_PROD', colSlots: [], crudColSlots: [] }))}`; |
| | | }, |
| | | /** |
| | | * @description: è·åæ å½¢æ°æ® |
| | | * @param {string} type |
| | | * @return {*} |
| | | */ |
| | | fetchTreeData: async (type: string, itemCode: string) => { |
| | | let data = { title: '', treeData: [] as any[], fieldNames: {} }; |
| | | let prodTreeData = await GetRoutePTree({prodCode: itemCode, orgCode: useUserStore().getUserInfo.orgCode}); |
| | | // let uniqueArr = prodTreeData.reduce((acc, current) => { |
| | | // if (!acc.some((x) => x.pid == current.pid && x.id == current.id && x.seq == current.seq && x.type == current.type)) { |
| | | // acc.push(current); |
| | | // } |
| | | // return acc; |
| | | // }, [] as V_MES_ROUTE_PTREE[]); |
| | | data.treeData = convertToTree(prodTreeData, 'pid', 'tid', 'root'); |
| | | data.title = 'å·¥èºè·¯çº¿'; |
| | | data.fieldNames = { key: 'tid', title: 'name' }; |
| | | return data; |
| | | }, |
| | | /** |
| | | * @description: è·åé
置项表ååæ®µï¼æ ¹æ®æ å½¢èç¹typeä¸åèä¸å |
| | | * @param {string} type |
| | | * @return {*} |
| | | */ |
| | | GetCrudForm: (type: string) => { |
| | | let form: FormSchema[] = []; |
| | | switch (type) { |
| | | case 'Action': |
| | | form = actionFormShema; |
| | | break; |
| | | case 'Node': |
| | | form = nodeFormShema; |
| | | break; |
| | | } |
| | | return form; |
| | | }, |
| | | /** |
| | | * @description: è·å表åä¸çåæ®µææ§½å表 |
| | | * @return {*} |
| | | */ |
| | | GetCrudColSlots: () => { |
| | | return ['scanadd', 'assyadd', 'testadd', 'auditadd', 'printadd', 'pkgadd']; |
| | | }, |
| | | /** |
| | | * @description: 忢èç¹æ¶äºä»¶æ¹æ³ |
| | | * @return {*} |
| | | */ |
| | | nodeChange: (params: { |
| | | resetFields: any; |
| | | setFieldsValue: any; |
| | | objParams: Ref<any>; |
| | | selectedNodes: Ref<any[]>; |
| | | }) => { |
| | | let sqlcmd = ' 1=1 '; |
| | | if (!isNullOrEmpty(params['objParams'].value['CODE'])) { |
| | | sqlcmd += `And PROD_CODE = '${params['objParams'].value['CODE']}'`; |
| | | } |
| | | if (!isNullOrEmpty(params['selectedNodes'].value[0].cust)) { |
| | | sqlcmd += `And CUST_CODE = '${params['selectedNodes'].value[0].cust}'`; |
| | | } |
| | | if (!isNullOrEmpty(params['selectedNodes'].value[0].id)) { |
| | | sqlcmd += |
| | | params['selectedNodes'].value[0].type == 'Action' |
| | | ? `And ACT_ID = '${params['selectedNodes'].value[0].id}'` |
| | | : `And NODE_ID = '${params['selectedNodes'].value[0].id}'`; |
| | | } |
| | | getEntity({ |
| | | sqlcmd: sqlcmd, |
| | | entityName: |
| | | params['selectedNodes'].value[0].type == 'Action' ? 'MES_PROD_ACTION' : 'MES_PROD_OPER', |
| | | order: '', |
| | | }).then((res) => { |
| | | params['resetFields'](); |
| | | if (params['selectedNodes'].value[0].type == 'Action') { |
| | | params['setFieldsValue']({ |
| | | ID: res.Data.Items[0].ID, |
| | | ACT_ID: res.Data.Items[0].ACT_ID, |
| | | ROT_ID: res.Data.Items[0].ROT_ID, |
| | | NODE_ID: res.Data.Items[0].NODE_ID, |
| | | IS_ACTIVE: res.Data.Items[0].IS_ACTIVE, |
| | | ITEM_CODE: res.Data.Items[0].ITEM_CODE, |
| | | RULE_CODE: res.Data.Items[0].RULE_CODE, |
| | | TEST_CODE: res.Data.Items[0].TEST_CODE, |
| | | SAPL_CODE: res.Data.Items[0].SAPL_CODE, |
| | | LABEL_CODE: res.Data.Items[0].LABEL_CODE, |
| | | PKG_CODE: res.Data.Items[0].PKG_CODE, |
| | | ACT_CODE: res.Data.Items[0].ACT_CODE, |
| | | REMARK: res.Data.Items[0].REMARK, |
| | | PROD_CODE: params['objParams'].value['CODE'], |
| | | ACT_TYPE: res.Data.Items[0].ACT_TYPE, |
| | | CUST_CODE: params['selectedNodes'].value[0].cust, |
| | | }); |
| | | } |
| | | if (params['selectedNodes'].value[0].type == 'Node') { |
| | | params['setFieldsValue']({ |
| | | ID: res.Data.Items[0].ID, |
| | | OPER_CODE: res.Data.Items[0].OPER_CODE, |
| | | ROT_ID: res.Data.Items[0].ROT_ID, |
| | | NODE_ID: res.Data.Items[0].NODE_ID, |
| | | NODE_NAME: res.Data.Items[0].NODE_NAME, |
| | | IS_ACTIVE: res.Data.Items[0].IS_ACTIVE, |
| | | IS_CALC_FPY: res.Data.Items[0].IS_CALC_FPY, |
| | | CAN_SKIP: res.Data.Items[0].CAN_SKIP, |
| | | IS_INPUT: res.Data.Items[0].IS_INPUT, |
| | | IS_OUTPUT: res.Data.Items[0].IS_OUTPUT, |
| | | REMARK: res.Data.Items[0].REMARK, |
| | | PROD_CODE: params['objParams'].value['CODE'], |
| | | CUST_CODE: params['selectedNodes'].value[0].cust, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | /** |
| | | * @description: èªå®ä¹æäº¤æ¹æ³ |
| | | * @return {*} |
| | | */ |
| | | SubmitFunc: (values: Recordable<any>, type: string, emit) => { |
| | | let entityName = ''; |
| | | switch (type) { |
| | | case 'Action': |
| | | entityName = 'MES_PROD_ACTION'; |
| | | break; |
| | | case 'Node': |
| | | entityName = 'MES_PROD_OPER'; |
| | | break; |
| | | } |
| | | SaveEntity(values, true, entityName).then((action) => { |
| | | if (action.IsSuccessed) { |
| | | emit('success'); |
| | | } |
| | | }); |
| | | }, |
| | | /** |
| | | * @description: å¼¹åºéæ©æ¡æå¼æ¹æ³ |
| | | * @param {Fn} openItemModal |
| | | * @return {*} |
| | | */ |
| | | OpenSelectItem: (openItemModal: Fn, ...args) => { |
| | | let config = {}; |
| | | switch (args[0]) { |
| | | case 'scanadd': |
| | | config = ruleModalCfg; |
| | | break; |
| | | case 'assyadd': |
| | | config = itemCodeModalCfg; |
| | | break; |
| | | case 'testadd': |
| | | config = itemCodeModalCfg; |
| | | break; |
| | | case 'printadd': |
| | | config = printModalCfg; |
| | | break; |
| | | case 'pkgadd': |
| | | config = pkgModalCfg; |
| | | break; |
| | | } |
| | | openItemModal(true, config); |
| | | }, |
| | | /** |
| | | * @description: å¼¹åºéæ©æ¡éæ©æåè¿å |
| | | * @param {*} d |
| | | * @param {*} u |
| | | * @return {*} |
| | | */ |
| | | GetSelectSuccess: (d, u, ...args) => { |
| | | let value = {}; |
| | | switch (args[0]) { |
| | | case 'scanadd': |
| | | value = { |
| | | RULE_CODE: d.values['val'], |
| | | }; |
| | | break; |
| | | case 'assyadd': |
| | | value = { |
| | | ITEM_CODE: d.values['val'], |
| | | }; |
| | | break; |
| | | case 'printadd': |
| | | value = { |
| | | LABEL_CODE: d.values['val'], |
| | | }; |
| | | break; |
| | | case 'pkgadd': |
| | | value = { |
| | | pkgRULE_CODE: d.values['val'], |
| | | }; |
| | | case 'addRoute': |
| | | if (isNullOrEmpty(args[1]['CODE'])) { |
| | | createErrorModal({ |
| | | title: t('sys.api.errorTip'), |
| | | content: '产å为空ï¼ä¸è½æ·»å å·¥èºè·¯çº¿ï¼è¯·ç¹å»å·¦ä¾§éæ©äº§å', |
| | | }); |
| | | return; |
| | | } |
| | | let codes = d.values.id.split(','); |
| | | var i; |
| | | for (i = 0; i < codes.length; i++) { |
| | | if (d.which == 'addRoute') { |
| | | RouteToProd({ rotId: codes[i], prodCode: args[1]['CODE'] }); |
| | | } |
| | | } |
| | | |
| | | args[2](); |
| | | break; |
| | | case 'addCustomer': |
| | | if (isNullOrEmpty(args[1]['CODE'])) { |
| | | createErrorModal({ |
| | | title: t('sys.api.errorTip'), |
| | | content: '产å为空ï¼ä¸è½æ·»å å·¥èºè·¯çº¿ï¼è¯·ç¹å»å·¦ä¾§éæ©äº§å', |
| | | }); |
| | | return; |
| | | } |
| | | let rotIds = d.ROT_ID.split(','); |
| | | var i; |
| | | for (i = 0; i < rotIds.length; i++) { |
| | | RouteToCust({ rotId: rotIds[i], prodCode: args[1]['CODE'], custCode: d.CUST_CODE }); |
| | | } |
| | | |
| | | args[2](); |
| | | break; |
| | | } |
| | | return value; |
| | | }, |
| | | /** |
| | | * @description: è·åæ¨¡ææ¡åºç¨å表 |
| | | * @return {*} |
| | | */ |
| | | GetUseModals: () => { |
| | | return { |
| | | addRoute: useModal(), |
| | | addCustomer: useModal(), |
| | | editRoute: useModal(), |
| | | }; |
| | | }, |
| | | /** |
| | | * @description: è·åæ é¢ä¿¡æ¯ |
| | | * @param {string} type |
| | | * @return {*} |
| | | */ |
| | | GetTitle: (type: string) => { |
| | | return { |
| | | configTitle: type == 'Action' ? 'è¡ä¸ºé
ç½®' : 'å·¥åºé
ç½®', |
| | | navTitle: type == 'Product' ? 'æ·»å å·¥èºè·¯çº¿' : 'å·¥èºè·¯çº¿ç»´æ¤', |
| | | }; |
| | | }, |
| | | /** |
| | | * @description: æ ¹æ®éä¸çæ èç¹è¿å主页é¢ï¼èªå®ä¹æ¹æ³ï¼è¿éæ¯å¤æè¦åæ¢åªä¸ªç»ä»¶ |
| | | * @param {Ref} selectedNodes |
| | | * @return {*} |
| | | */ |
| | | SelectNode: (selectedNodes: Ref<any[]>) => { |
| | | let result = { |
| | | showConfig: false, |
| | | showNav: false, |
| | | type: selectedNodes.value[0].type, |
| | | nodes: selectedNodes.value, |
| | | }; |
| | | if (isNullOrUnDef(selectedNodes)) { |
| | | return result; |
| | | } |
| | | if (selectedNodes.value[0].type == 'Product' || selectedNodes.value[0].type == 'Route') { |
| | | result.showNav = true; |
| | | result.showConfig = false; |
| | | } |
| | | if (selectedNodes.value[0].type == 'Action' || selectedNodes.value[0].type == 'Node') { |
| | | result.showNav = false; |
| | | result.showConfig = true; |
| | | } |
| | | return result; |
| | | }, |
| | | /** |
| | | * @description: è·å导èªé¡¹ |
| | | * @return {*} |
| | | */ |
| | | GetNavItems: (type: string) => { |
| | | let item: NavItem[] = []; |
| | | switch (type) { |
| | | case 'Product': |
| | | item = [ |
| | | { |
| | | title: 'æ·»å 产åå·¥èºè·¯çº¿', |
| | | icon: 'add_green|svg', |
| | | color: '#1fdaca', |
| | | url: '/addRoute', |
| | | action: 'addRoute', |
| | | isStep: false, |
| | | }, |
| | | { |
| | | title: 'æ·»å 客æ·å·¥èºè·¯çº¿', |
| | | icon: 'add_customer|svg', |
| | | color: '#bf0c2c', |
| | | url: '/addCustomer', |
| | | action: 'addCustomer', |
| | | isStep: true, |
| | | }, |
| | | ]; |
| | | break; |
| | | case 'Route': |
| | | item = [ |
| | | { |
| | | title: 'ç¼è¾å·¥èºè·¯çº¿', |
| | | icon: 'clarity:note-edit-line', |
| | | color: '#1fdaca', |
| | | url: '/editRoute', |
| | | action: 'editRoute', |
| | | isStep: false, |
| | | }, |
| | | ]; |
| | | break; |
| | | } |
| | | return item; |
| | | }, |
| | | /** |
| | | * @description: 导èªé¡µé¢åæ¢æé®æ¶è°ç¨æ¹æ³ |
| | | * @param {any} action |
| | | * @return {*} |
| | | */ |
| | | navChangeItem: (action: any, ...args) => { |
| | | switch (action) { |
| | | case 'addRoute': |
| | | args[0](true, { |
| | | title: 'å·¥èºè·¯çº¿å表', |
| | | schemas: [ |
| | | { |
| | | field: 'ROT_CODE', |
| | | component: 'Input', |
| | | label: 'å·¥èºè·¯çº¿ç¼ç ', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('å·¥èºè·¯çº¿ç¼ç '), |
| | | dataIndex: 'ROT_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('å·¥èºè·¯çº¿åç§°'), |
| | | dataIndex: 'ROT_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'MES_ROUTE', |
| | | rowKey: 'ROT_CODE', |
| | | returnFieldName: ['ROUTE_CODE'], //è¿åå¼è¦èµå¼çåæ®µåç§° |
| | | searchInfo: { TABLE_NAME: 'MES_ROUTE' }, |
| | | which: action, |
| | | }); |
| | | break; |
| | | case 'addCustomer': |
| | | args[0](true, { |
| | | title: 'è¯·å®æä»¥ä¸æ¥éª¤', |
| | | }); |
| | | break; |
| | | case 'editRoute': |
| | | args[1](true, { rotId: args[2][0].id, slotName: '' }); |
| | | break; |
| | | } |
| | | }, |
| | | /** |
| | | * @description: è·åå¡çå
é
ç½®å表ï¼ä»¥å¾ªç¯æ¾ç¤ºå¤ä¸ªå¡çå¹¶é
ç½®å¤ä¸ªææ§½ |
| | | * @return {*} |
| | | */ |
| | | GetBaseCards: (type: string) => { |
| | | let reusts: any[] = []; |
| | | switch (type) { |
| | | case 'Product': |
| | | reusts = []; |
| | | break; |
| | | case 'Route': |
| | | reusts = [ |
| | | { |
| | | name: 'RotInfo', |
| | | slots: [], |
| | | preIcons: {}, |
| | | title: 'å·¥èºè·¯çº¿å¾', |
| | | entityName: '', |
| | | }, |
| | | ]; |
| | | break; |
| | | } |
| | | return reusts; |
| | | }, |
| | | /** |
| | | * @description: è·åææ§½å表 |
| | | * @return {*} |
| | | */ |
| | | GetSlots: () => { |
| | | return ['RotInfo']; |
| | | }, |
| | | /** |
| | | * @description: çæhtml |
| | | * @return {*} |
| | | */ |
| | | GenerateHtml: (type: string | null) => { |
| | | const newElement = document.createElement('div'); |
| | | // newElement.textContent = 'New Element =>'+type; |
| | | // newElement.style.height = '250px'; |
| | | newElement.id = 'lfContainer'; |
| | | newElement.className = 'h-full'; |
| | | // newElement.style.color = 'blue'; |
| | | // newElement.style.fontSize = '16px'; |
| | | return newElement; |
| | | }, |
| | | /** |
| | | * @description: èªå®ä¹æ¹æ³ |
| | | * @param {string} type |
| | | * @param {array} args |
| | | * @return {*} |
| | | */ |
| | | CustFunc: (param: CustModalParams) => { |
| | | if (param.cType == 'Route') { |
| | | // initRoute(args[0], args[1]); |
| | | } |
| | | }, |
| | | GetUseForm: () => { |
| | | return {}; |
| | | }, |
| | | }; |
| | | |
| | | /* 以䏿¯å
鍿¹æ³ï¼ä¸exportï¼ä¾ä¸é¢çæ¹æ³è°ç¨ */ |
| | | |
| | | /** |
| | | * @description: å¼¹åºéæ©æ¡-ç©æéæ©æ¡é
ç½® |
| | | * @return {*} |
| | | */ |
| | | const itemCodeModalCfg = { |
| | | title: 'ç©æå表', |
| | | schemas: [ |
| | | { |
| | | field: 'ITEM_CODE', |
| | | component: 'Input', |
| | | label: 'ç©æç¼ç ', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('ç©æç¼ç '), |
| | | dataIndex: 'ITEM_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('ç©æåç§°'), |
| | | dataIndex: 'ITEM_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'BAS_ITEM', |
| | | rowKey: 'ITEM_CODE', |
| | | searchInfo: { TABLE_NAME: 'BAS_ITEM' }, |
| | | }; |
| | | |
| | | /** |
| | | * @description: å¼¹åºéæ©æ¡-è§åéæ©æ¡é
ç½® |
| | | * @return {*} |
| | | */ |
| | | const ruleModalCfg = { |
| | | title: 'è§åå表', |
| | | schemas: [ |
| | | { |
| | | field: 'RULE_CODE', |
| | | component: 'Input', |
| | | label: 'è§åç¼ç ', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('è§åç¼ç '), |
| | | dataIndex: 'RULE_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('è§ååç§°'), |
| | | dataIndex: 'RULE_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'BAS_CODE_RULE', |
| | | rowKey: 'RULE_CODE', |
| | | searchInfo: { TABLE_NAME: 'BAS_CODE_RULE' }, |
| | | }; |
| | | |
| | | /** |
| | | * @description: å¼¹åºéæ©æ¡-æå°æ¨¡æ¿éæ©æ¡é
ç½® |
| | | * @return {*} |
| | | */ |
| | | const printModalCfg = { |
| | | title: 'æå°æ¨¡æ¿å表', |
| | | schemas: [ |
| | | { |
| | | field: 'LABEL_CODE', |
| | | component: 'Input', |
| | | label: '模æ¿ç¼ç ', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('模æ¿ç¼ç '), |
| | | dataIndex: 'LABEL_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('模æ¿åç§°'), |
| | | dataIndex: 'LABEL_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'BAS_LABEL_TEMP', |
| | | rowKey: 'LABEL_CODE', |
| | | searchInfo: { TABLE_NAME: 'BAS_LABEL_TEMP' }, |
| | | }; |
| | | |
| | | const pkgModalCfg = { |
| | | title: 'å
è£
è§åå表', |
| | | schemas: [ |
| | | { |
| | | field: 'RULE_CODE', |
| | | component: 'Input', |
| | | label: 'å
è£
è§åç¼ç ', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('å
è£
è§åç¼ç '), |
| | | dataIndex: 'RULE_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('å
è£
è§ååç§°'), |
| | | dataIndex: 'RULE_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'BAS_PKG_RULE', |
| | | rowKey: 'RULE_CODE', |
| | | searchInfo: { TABLE_NAME: 'BAS_PKG_RULE' }, |
| | | }; |
| | | |
| | | /** |
| | | * @description: è¡ä¸ºé
置表ååæ®µ |
| | | * @return {*} |
| | | */ |
| | | const actionFormShema: FormSchema[] = [ |
| | | { |
| | | field: 'PROD_CODE', |
| | | label: '产åç¼ç ', |
| | | component: 'Input', |
| | | dynamicDisabled: ({ values }) => { |
| | | return true; |
| | | }, |
| | | colProps: { span: 12 }, |
| | | }, |
| | | { |
| | | field: 'ID', |
| | | label: 'ID', |
| | | component: 'Input', |
| | | show: false, |
| | | }, |
| | | { |
| | | field: 'ACT_ID', |
| | | label: 'ACT_ID', |
| | | component: 'Input', |
| | | show: false, |
| | | }, |
| | | { |
| | | field: 'ROT_ID', |
| | | label: 'ROT_ID', |
| | | component: 'Input', |
| | | show: false, |
| | | }, |
| | | { |
| | | field: 'ACT_CODE', |
| | | label: 'ACT_CODE', |
| | | component: 'Input', |
| | | show: false, |
| | | }, |
| | | { |
| | | field: 'NODE_ID', |
| | | label: 'NODE_ID', |
| | | component: 'Input', |
| | | show: false, |
| | | }, |
| | | { |
| | | field: 'CUST_CODE', |
| | | label: '客æ·ç¼ç ', |
| | | component: 'Input', |
| | | dynamicDisabled: ({ values }) => { |
| | | return true; |
| | | }, |
| | | colProps: { span: 12 }, |
| | | }, |
| | | { |
| | | field: 'ACT_TYPE', |
| | | label: 'è¡ä¸ºç±»å', |
| | | component: 'ApiSelect', |
| | | colProps: { span: 12 }, |
| | | defaultValue: 0, |
| | | componentProps: { |
| | | api: GetEnum, |
| | | params: { name: 'MES_PROD_ACTION+ACT_TYPEs' }, |
| | | resultField: 'Data', |
| | | labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', |
| | | valueField: 'Value', |
| | | // onChange: (e, v) => { |
| | | // alert(e) |
| | | // console.log('ApiSelect====>:', e, v); |
| | | // }, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'IS_ACTIVE', |
| | | label: 'æ¯å¦å¯ç¨', |
| | | required: true, |
| | | component: 'Select', |
| | | colProps: { span: 12 }, |
| | | componentProps: { |
| | | options: [ |
| | | { |
| | | label: 'æ¯', |
| | | value: 'Y', |
| | | key: 'Y', |
| | | }, |
| | | { |
| | | label: 'å¦', |
| | | value: 'N', |
| | | key: 'N', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: 'RULE_CODE', |
| | | label: 'æ«ç éªè¯', |
| | | component: 'Input', |
| | | colProps: { span: 10 }, |
| | | ifShow: ({ values }) => isScan(values.ACT_TYPE), |
| | | }, |
| | | { |
| | | field: '0', |
| | | label: '1', |
| | | defaultValue: '', |
| | | component: 'Input', |
| | | colProps: { span: 2, pull: 1 }, |
| | | ifShow: ({ values }) => isScan(values.ACT_TYPE), |
| | | colSlot: 'scanadd', |
| | | }, |
| | | { |
| | | field: 'ITEM_CODE', |
| | | label: 'ç»è£
䏿', |
| | | colProps: { span: 10 }, |
| | | component: 'Input', |
| | | ifShow: ({ values }) => isAssy(values.ACT_TYPE), |
| | | }, |
| | | { |
| | | field: '00', |
| | | label: '1', |
| | | defaultValue: '', |
| | | component: 'Input', |
| | | colProps: { span: 2, pull: 1 }, |
| | | ifShow: ({ values }) => isAssy(values.ACT_TYPE), |
| | | colSlot: 'assyadd', |
| | | }, |
| | | { |
| | | field: 'TEST_CODE', |
| | | label: 'äº§åæµè¯', |
| | | colProps: { span: 10 }, |
| | | component: 'Input', |
| | | ifShow: ({ values }) => isTest(values.ACT_TYPE), |
| | | }, |
| | | { |
| | | field: 'test0', |
| | | label: '1', |
| | | defaultValue: '', |
| | | component: 'Input', |
| | | colProps: { span: 2, pull: 1 }, |
| | | ifShow: ({ values }) => isTest(values.ACT_TYPE), |
| | | colSlot: 'testadd', |
| | | }, |
| | | { |
| | | field: 'SAPL_CODE', |
| | | label: 'äº§åæ½æ£', |
| | | colProps: { span: 10 }, |
| | | component: 'Input', |
| | | ifShow: ({ values }) => isAudit(values.ACT_TYPE), |
| | | }, |
| | | { |
| | | field: 'audit0', |
| | | label: '1', |
| | | defaultValue: '', |
| | | component: 'Input', |
| | | colProps: { span: 2, pull: 1 }, |
| | | ifShow: ({ values }) => isAudit(values.ACT_TYPE), |
| | | colSlot: 'auditadd', |
| | | }, |
| | | { |
| | | field: 'LABEL_CODE', |
| | | label: 'æ ç¾æå°', |
| | | colProps: { span: 10 }, |
| | | component: 'Input', |
| | | ifShow: ({ values }) => isPrint(values.ACT_TYPE), |
| | | }, |
| | | { |
| | | field: 'print0', |
| | | label: '1', |
| | | defaultValue: '', |
| | | component: 'Input', |
| | | colProps: { span: 2, pull: 1 }, |
| | | ifShow: ({ values }) => isPrint(values.ACT_TYPE), |
| | | colSlot: 'printadd', |
| | | }, |
| | | { |
| | | field: 'pkgRULE_CODE', |
| | | label: 'å
è£
è§å', |
| | | colProps: { span: 10 }, |
| | | component: 'Input', |
| | | ifShow: ({ values }) => isPackage(values.ACT_TYPE), |
| | | }, |
| | | { |
| | | field: 'pkg0', |
| | | label: '1', |
| | | defaultValue: '', |
| | | component: 'Input', |
| | | colProps: { span: 2, pull: 1 }, |
| | | ifShow: ({ values }) => isPackage(values.ACT_TYPE), |
| | | colSlot: 'pkgadd', |
| | | }, |
| | | { |
| | | field: 'REMARK', |
| | | label: '夿³¨', |
| | | component: 'Input', |
| | | colProps: { span: 12 }, |
| | | }, |
| | | ]; |
| | | |
| | | /** |
| | | * @description: å·¥åºé
置表ååæ®µ |
| | | * @return {*} |
| | | */ |
| | | const nodeFormShema: FormSchema[] = [ |
| | | { |
| | | field: 'PROD_CODE', |
| | | label: '产åç¼ç ', |
| | | component: 'Input', |
| | | dynamicDisabled: ({ values }) => { |
| | | return true; |
| | | }, |
| | | colProps: { span: 12 }, |
| | | }, |
| | | { |
| | | field: 'ID', |
| | | label: 'ID', |
| | | component: 'Input', |
| | | show: false, |
| | | }, |
| | | { |
| | | field: 'ACT_ID', |
| | | label: 'ACT_ID', |
| | | component: 'Input', |
| | | show: false, |
| | | }, |
| | | { |
| | | field: 'ROT_ID', |
| | | label: 'ROT_ID', |
| | | component: 'Input', |
| | | show: false, |
| | | }, |
| | | { |
| | | field: 'NODE_ID', |
| | | label: 'NODE_ID', |
| | | component: 'Input', |
| | | show: false, |
| | | }, |
| | | { |
| | | field: 'NODE_NAME', |
| | | label: 'å·¥åºèç¹åç§°', |
| | | component: 'Input', |
| | | }, |
| | | { |
| | | field: 'CUST_CODE', |
| | | label: '客æ·ç¼ç ', |
| | | component: 'Input', |
| | | dynamicDisabled: ({ values }) => { |
| | | return true; |
| | | }, |
| | | colProps: { span: 12 }, |
| | | }, |
| | | { |
| | | field: 'OPER_CODE', |
| | | label: 'å·¥åºç¼ç ', |
| | | component: 'Input', |
| | | }, |
| | | { |
| | | field: 'IS_ACTIVE', |
| | | label: 'æ¯å¦å¯ç¨', |
| | | required: true, |
| | | component: 'Select', |
| | | colProps: { span: 12 }, |
| | | componentProps: { |
| | | options: [ |
| | | { |
| | | label: 'æ¯', |
| | | value: 'Y', |
| | | key: 'Y', |
| | | }, |
| | | { |
| | | label: 'å¦', |
| | | value: 'N', |
| | | key: 'N', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: 'IS_CALC_FPY', |
| | | label: 'æ¯å¦è®¡ç®ç´éç', |
| | | required: true, |
| | | component: 'Select', |
| | | colProps: { span: 12 }, |
| | | componentProps: { |
| | | options: [ |
| | | { |
| | | label: 'æ¯', |
| | | value: 'Y', |
| | | key: 'Y', |
| | | }, |
| | | { |
| | | label: 'å¦', |
| | | value: 'N', |
| | | key: 'N', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: 'CAN_SKIP', |
| | | label: 'æ¯å¦å
许跳ç«', |
| | | required: true, |
| | | component: 'Select', |
| | | colProps: { span: 12 }, |
| | | componentProps: { |
| | | options: [ |
| | | { |
| | | label: 'æ¯', |
| | | value: 'Y', |
| | | key: 'Y', |
| | | }, |
| | | { |
| | | label: 'å¦', |
| | | value: 'N', |
| | | key: 'N', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: 'IS_INPUT', |
| | | label: 'æ¯å¦æå
¥ç«', |
| | | required: true, |
| | | component: 'Select', |
| | | colProps: { span: 12 }, |
| | | componentProps: { |
| | | options: [ |
| | | { |
| | | label: 'æ¯', |
| | | value: 'Y', |
| | | key: 'Y', |
| | | }, |
| | | { |
| | | label: 'å¦', |
| | | value: 'N', |
| | | key: 'N', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: 'IS_OUTPUT', |
| | | label: 'æ¯å¦äº§åºç«', |
| | | required: true, |
| | | component: 'Select', |
| | | colProps: { span: 12 }, |
| | | componentProps: { |
| | | options: [ |
| | | { |
| | | label: 'æ¯', |
| | | value: 'Y', |
| | | key: 'Y', |
| | | }, |
| | | { |
| | | label: 'å¦', |
| | | value: 'N', |
| | | key: 'N', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | field: 'REMARK', |
| | | label: '夿³¨', |
| | | component: 'Input', |
| | | colProps: { span: 12 }, |
| | | }, |
| | | ]; |
| | | |
| | | return [methods]; |
| | | } |
| | | |
| | | export default _default; |
| | |
| | | <template #toolbar> |
| | | <a-button |
| | | type="primary" |
| | | v-for="item in buttons.filter((m) => m['BUTTON_TYPE'] == 0)" |
| | | @click="handleCreate(item['DO_METHOD'])" |
| | | :preIcon="item['ICON_URL']" |
| | | v-for="item in buttons.filter((m) => m['BUTTON_TYPE'] == 0)" |
| | | :key="item" |
| | | > |
| | | {{ item['FUNC_NAME'] }} |
| | |
| | | <CustModal |
| | | @register="registerCust" |
| | | @success="custSuccess" |
| | | @cancel="custCancel" |
| | | :type="cType" |
| | | :entityName="entityName" |
| | | @modalInner="getdtlSlots" |
| | |
| | | }); |
| | | } catch (e) {} |
| | | } |
| | | //å¼¹åºæ¡ç¡®å®è¿å |
| | | |
| | | /** |
| | | * @description: å¼¹åºæ¡ç¡®å®è¿å |
| | | * @param {*} d |
| | | * @return {*} |
| | | */ |
| | | function custSuccess(d) { |
| | | reload(); |
| | | } |
| | | |
| | | /** |
| | | * @description: å¼¹åºæ¡åæ¶è¿å |
| | | * @param {*} reload |
| | | * @return {*} |
| | | */ |
| | | function custCancel() {reload();} |
| | | |
| | | /** |
| | | * @description: å表åå
å¼¹åºéæ©æ¡éæ©æååæ¹æ³ |
| | | * @param {*} d |
| | | * @param {*} u |