From 323e576c64129723df20fd18effb20d96d8d18b3 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期一, 22 七月 2024 10:27:50 +0800 Subject: [PATCH] 工单更新 --- src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue | 5 src/views/tigerprojects/system/lowcode/detail/detail.vue | 114 ++++ src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts | 19 src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts | 310 +++++++++++ src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts | 1015 +++++++++++++++++++++++++++++++++++++ src/views/tigerprojects/system/lowcode/normal/mainTable.vue | 17 src/views/tigerprojects/system/lowcode/detail/index.vue | 90 --- src/views/components/CustModal.vue | 13 src/views/tigerprojects/mes/eng/route/index.vue | 21 9 files changed, 1,488 insertions(+), 116 deletions(-) diff --git a/src/views/components/CustModal.vue b/src/views/components/CustModal.vue index 5fd3061..06817d7 100644 --- a/src/views/components/CustModal.vue +++ b/src/views/components/CustModal.vue @@ -4,7 +4,7 @@ * @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 @@ -12,6 +12,7 @@ @register="registerModal" :title="title" @ok="handleSuccess" + @cancel="handleCancel" :width="width" > <a-layout> @@ -45,7 +46,7 @@ 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(''); @@ -178,4 +179,12 @@ setModalProps({ confirmLoading: false }); } } + + /** + * @description: 鍙栨秷鎸夐挳瑙﹀彂鍙栨秷浜嬩欢 + * @return {*} + */ + function handleCancel() { + emit('cancel'); + } </script> diff --git a/src/views/tigerprojects/mes/eng/route/index.vue b/src/views/tigerprojects/mes/eng/route/index.vue index 757a64a..f9221a4 100644 --- a/src/views/tigerprojects/mes/eng/route/index.vue +++ b/src/views/tigerprojects/mes/eng/route/index.vue @@ -187,7 +187,7 @@ 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: '', }, @@ -223,7 +223,7 @@ 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: '', @@ -280,7 +280,7 @@ 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', @@ -330,7 +330,7 @@ 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, @@ -439,7 +439,7 @@ IS_CALC_FPY: 'N', CAN_SKIP: 'N', REMARK: '', - AUTH_ORG: '', + AUTH_ORG: useUserStore().getUserInfo.orgCode, AUTH_PROD: '', AUTH_WH: '', IS_FIRST_NODE: '', @@ -472,7 +472,7 @@ 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`, @@ -509,9 +509,9 @@ 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, @@ -549,6 +549,9 @@ 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, diff --git a/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue b/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue index de55c76..2970147 100644 --- a/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue +++ b/src/views/tigerprojects/system/lowcode/composition/CarGridNav.vue @@ -4,7 +4,7 @@ * @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']"> @@ -54,6 +54,7 @@ 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>; @@ -72,7 +73,7 @@ GetBaseCards(type: string | undefined) {}, GetSelectSuccess(d, u, ...args) {}, GenerateHtml(ype: string | null) {}, - CustFunc(type: string | undefined, ...args) {}, + CustFunc(param: CustModalParams) {}, } as EntityCustFunctionType, ]); /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */ diff --git a/src/views/tigerprojects/system/lowcode/detail/detail.vue b/src/views/tigerprojects/system/lowcode/detail/detail.vue index 4705ff7..14ba342 100644 --- a/src/views/tigerprojects/system/lowcode/detail/detail.vue +++ b/src/views/tigerprojects/system/lowcode/detail/detail.vue @@ -4,9 +4,9 @@ <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'] }} @@ -30,16 +30,47 @@ /> </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'; @@ -62,11 +93,11 @@ 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([ { @@ -94,6 +125,8 @@ KeyFieldValues, GetSelectSuccess, OpenSelectItem, + GetUseForm, + GetUseModals, }, ] = isNullOrUnDef(custImport.value['default']) ? EntityCustFunction.value @@ -103,6 +136,11 @@ 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, @@ -146,6 +184,8 @@ useFormData, crudColSlots: colSlots.value, data, + selectVals, + colSlots, }; const actionItem = GenerateActionButton(params, buttons, openDrawer, reload); if (isNullOrUnDef(custImport.value['default'])) { @@ -161,6 +201,7 @@ useModal, go, setProps, + openCustModal, ); } @@ -241,4 +282,69 @@ 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) { + /* 鍔ㄦ�乮mport瀹炰綋鍚�.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> diff --git a/src/views/tigerprojects/system/lowcode/detail/index.vue b/src/views/tigerprojects/system/lowcode/detail/index.vue index c7375b0..d801e76 100644 --- a/src/views/tigerprojects/system/lowcode/detail/index.vue +++ b/src/views/tigerprojects/system/lowcode/detail/index.vue @@ -4,7 +4,7 @@ * @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"> @@ -24,35 +24,6 @@ <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> @@ -67,11 +38,7 @@ 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(); @@ -93,18 +60,10 @@ 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(); @@ -147,52 +106,5 @@ }; }; } - } - - /** - * @description: 鑷畾涔夊脊鍑烘纭畾杩斿洖 - * @param {*} d - * @return {*} - */ - function custSuccess(d) { - // reload(); - } - - /** - * @description: 鍚勮〃鍗曞唴寮瑰嚭閫夋嫨妗嗛�夋嫨鎴愬姛鍚庢柟娉� - * @param {*} d - * @param {*} u - * @param {*} item - * @return {*} - */ - function handleEntSuccess(d, u, item) { - /* 鍔ㄦ�乮mport瀹炰綋鍚�.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> diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts index 96365ce..432efb1 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts @@ -4,7 +4,7 @@ * @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'; @@ -40,7 +40,7 @@ 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' }, @@ -256,9 +256,22 @@ }); 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; } }, }; diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts index 20513be..504bccf 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO_BATCH.ts @@ -4,18 +4,22 @@ * @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() { @@ -46,6 +50,16 @@ * @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; }, /** @@ -173,10 +187,296 @@ 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' }, //濡傛灉鏄涓〃鍗曪紝澧炲姞澶氫釜鎻掓Ы銆俿lots鏄脊鍑烘鎸夐挳鐨勬彃妲斤紝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; + } }, }; + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @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' }, //鎻掓Ы鐨勫脊鍑烘閫夋嫨鐨刢ode + 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]; } diff --git a/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts new file mode 100644 index 0000000..e4f26ae --- /dev/null +++ b/src/views/tigerprojects/system/lowcode/entityts/WoRouteBinding.ts @@ -0,0 +1,1015 @@ +/* + * @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: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl + * @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 {}; + }, + }; + + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @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; diff --git a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue index 3df755c..ea56742 100644 --- a/src/views/tigerprojects/system/lowcode/normal/mainTable.vue +++ b/src/views/tigerprojects/system/lowcode/normal/mainTable.vue @@ -4,9 +4,9 @@ <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'] }} @@ -34,6 +34,7 @@ <CustModal @register="registerCust" @success="custSuccess" + @cancel="custCancel" :type="cType" :entityName="entityName" @modalInner="getdtlSlots" @@ -404,12 +405,24 @@ }); } catch (e) {} } - //寮瑰嚭妗嗙‘瀹氳繑鍥� + + /** + * @description: 寮瑰嚭妗嗙‘瀹氳繑鍥� + * @param {*} d + * @return {*} + */ function custSuccess(d) { reload(); } /** + * @description: 寮瑰嚭妗嗗彇娑堣繑鍥� + * @param {*} reload + * @return {*} + */ + function custCancel() {reload();} + + /** * @description: 鍚勮〃鍗曞唴寮瑰嚭閫夋嫨妗嗛�夋嫨鎴愬姛鍚庢柟娉� * @param {*} d * @param {*} u -- Gitblit v1.9.3