From 5a4d79d9765dfca8812638b57d5f5fe21f7a06ee Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 16 七月 2024 17:05:25 +0800 Subject: [PATCH] 工单下发更新 --- src/views/tigerprojects/system/lowcode/high/baseForm.vue | 6 src/api/tigerapi/mes/mesApi.ts | 4 src/api/tigerapi/model/systemModel.ts | 13 src/views/tigerprojects/system/lowcode/high/index.vue | 65 + src/api/tigerapi/mes/wo.ts | 26 src/views/tigerprojects/system/lowcode/detail/index.vue | 57 src/api/tigerapi/model/mesModel.ts | 6 src/utils/is.ts | 23 src/api/tigerapi/model/basModel.ts | 11 src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue | 133 +-- src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts | 71 + src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts | 7 src/views/tigerprojects/system/lowcode/composition/index.vue | 57 src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts | 1330 +++++++++++++++++++++++++++++++++++++++ src/views/components/bizMesWo.ts | 51 src/api/tigerapi/system.ts | 27 src/views/tigerprojects/system/lowcode/normal/index.vue | 62 src/views/components/CustModal.vue | 49 + 18 files changed, 1,720 insertions(+), 278 deletions(-) diff --git a/src/api/tigerapi/mes/mesApi.ts b/src/api/tigerapi/mes/mesApi.ts index 5424562..b33a973 100644 --- a/src/api/tigerapi/mes/mesApi.ts +++ b/src/api/tigerapi/mes/mesApi.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-04-27 15:54:50 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-19 23:52:56 + * @LastEditTime: 2024-07-16 09:53:13 */ export enum mesApi { GetRoute = '/MES/GetRoute', @@ -20,5 +20,5 @@ GetRoutePTree = '/MES/GetRoutePTree', RouteToProd = '/MES/RouteToProd', RouteToCust = '/MES/RouteToCust', - + SaveMesBatchWo = '/MES/SaveMesBatchWo', } diff --git a/src/api/tigerapi/mes/wo.ts b/src/api/tigerapi/mes/wo.ts index b1298ed..b3faa28 100644 --- a/src/api/tigerapi/mes/wo.ts +++ b/src/api/tigerapi/mes/wo.ts @@ -4,6 +4,7 @@ MesWolistPageParams, BIZ_MES_WOPageListGetResultModel, BIZ_MES_WO, + SaveWoBatchInput, } from '../model/mesModel'; import { genAction, Api, genActionPage } from '../system'; import { defHttp } from '/@/utils/http/axios'; @@ -45,7 +46,11 @@ return model; } -//淇濆瓨 +/** + * @description: 淇濆瓨宸ュ崟鏅�氭柟娉� + * @param {BIZ_MES_WO} params + * @return {*} + */ export const SaveMesWo = async (params: BIZ_MES_WO) => { params.CREATE_USER = useUserStore().getUserInfo.userId as string; params.UPDATE_USER = useUserStore().getUserInfo.userId as string; @@ -59,6 +64,25 @@ return data; }; +/** + * @description: 涓嬪彂淇濆瓨鎵规宸ュ崟淇℃伅 + * @param {SaveWoBatchInput} params + * @return {*} + */ +export const SaveMesBatchWo = async (params: SaveWoBatchInput) => { + params.Wo.UPDATE_USER = useUserStore().getUserInfo.userId as string; + params.WoBatch.CREATE_USER = useUserStore().getUserInfo.userId as string; + params.WoBatch.UPDATE_USER = useUserStore().getUserInfo.userId as string; + const data = await defHttp.post( + { url: mesApi.SaveMesBatchWo, params: genAction('BIZ_MES_WO_BATCH', params) }, + { + errorMessageMode: 'none', + isTransformResponse: false, + }, + ); + return data; +}; + /* * 鍒犻櫎宸ュ崟 */ diff --git a/src/api/tigerapi/model/basModel.ts b/src/api/tigerapi/model/basModel.ts index f08b314..876163a 100644 --- a/src/api/tigerapi/model/basModel.ts +++ b/src/api/tigerapi/model/basModel.ts @@ -1,6 +1,7 @@ import { Ref } from 'vue'; import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel'; import { ActionItem } from '/@/components/Table'; +import { CustModalParams } from './systemModel'; //鐗╂枡淇℃伅瀹炰綋 export type MaterialInfoParams = { ITEM_CODE?: string; @@ -128,7 +129,7 @@ GetHomeUrl: () => string; GetBaseColumns: (type: string | undefined) => [] | {}; GetSearchForm: (type: string | undefined) => [] | {}; - GetCrudForm: (type: string | undefined,) => [] | {}; + GetCrudForm: (type: string | undefined) => [] | {}; GetBaseForm: () => [] | {}; GetBaseCards: (type: string | undefined) => []; KeyFieldValues: (val: string, id: string) => {}; @@ -141,11 +142,13 @@ navChangeItem: (action: any, ...args) => void; GetUseModals: () => {}; GetUseDrawers: () => []; - GetUseTables: (data: Ref<Recordable[]>, ...args) => []; + GetUseTables: (data: Ref<Recordable[]>, ...args) => {}; + GetUseForm: (...args) => {}; SubmitFunc: (values: Recordable<any>, type: string, emit) => void; FormSearch: (d) => string | {}; GetSlots: (type: string | undefined) => {}; GenerateHtml: (type: string | null) => HTMLElement | null; - CustFunc: (type: string | undefined, ...args) => void | any; + CustFunc: (param: CustModalParams) => void | any; SubmitAll: (data: Ref<any[]>, keyFieldValues: Ref<{}>, ...args) => void | any; - CustInitData: (data: Ref<any[]>, keyFieldValues: Ref<{}>, type: string ) => void | any; \ No newline at end of file + CustInitData: (data: Ref<any[]>, keyFieldValues: Ref<{}>, type: string) => void | any; +} diff --git a/src/api/tigerapi/model/mesModel.ts b/src/api/tigerapi/model/mesModel.ts index 596e551..9fa4e6e 100644 --- a/src/api/tigerapi/model/mesModel.ts +++ b/src/api/tigerapi/model/mesModel.ts @@ -234,6 +234,7 @@ export interface BIZ_MES_WO_BATCH { ID: string; + BATCH_NO: string; CREATE_TIME: Date; CREATE_USER: string; UPDATE_TIME: Date; @@ -282,6 +283,11 @@ REMARK: string; } +export interface SaveWoBatchInput { + Wo: BIZ_MES_WO; + WoBatch: BIZ_MES_WO_BATCH; +} + export type OperPageListGetResultModel = BasicFetchResult<OperListItem>; export type CheckRulePageListGetResultModel = BasicFetchResult<CheckRuleListItem>; export type MeslinePageListGetResultModel = BasicFetchResult<MeslineListItem>; diff --git a/src/api/tigerapi/model/systemModel.ts b/src/api/tigerapi/model/systemModel.ts index 3f032e8..fd5366c 100644 --- a/src/api/tigerapi/model/systemModel.ts +++ b/src/api/tigerapi/model/systemModel.ts @@ -331,6 +331,19 @@ } /** + * @description: 鑷畾涔夊脊鍑烘鍙傛暟绫诲瀷 + * @return {*} + */ +export interface CustModalParams { + cType: string; //绫诲瀷 + values: {}; //Modal妗嗗唴琛ㄥ崟鏁版嵁 + mValues: {}; //涓昏〃鏁版嵁 + initFnName: string; //鍒濆鍖栨柟娉曞悕 + others: {}; //涓�浜涘叾浠栨暟鎹� + FnName: string; //鑷畾涔夋柟娉曞悕 +} + +/** * @description: Request list return value */ diff --git a/src/api/tigerapi/system.ts b/src/api/tigerapi/system.ts index ca7dd52..de350ff 100644 --- a/src/api/tigerapi/system.ts +++ b/src/api/tigerapi/system.ts @@ -31,6 +31,7 @@ } from './model/systemModel'; import { defHttp } from '/@/utils/http/axios'; import { isArray, isNullOrEmpty, isTimeViaRegExp8601 } from '/@/utils/is'; +import { isNumber } from 'xe-utils'; export enum Api { QueryUrl = '/Base/Query', @@ -709,17 +710,21 @@ if (!isNullOrEmpty(params['order'])) { order = params['order'] == 'descend' ? params['field'] + ' desc' : params['field']; } - const rParams = genAction(params['TABLE_NAME'], { - QueryAble_T: '', - where: sqlcmd, - order: order, - page: { - pageAble_T: 'string', - draw: 1, - pageIndex: params['page'], - pageSize: params['pageSize'], + const rParams = genAction( + params['TABLE_NAME'], + { + QueryAble_T: '', + where: sqlcmd, + order: order, + page: { + pageAble_T: 'string', + draw: 1, + pageIndex: params['page'], + pageSize: params['pageSize'], + }, }, - }); + params['option'], + ); return getListByPageAsync(rParams); } async function getListByPageAsync(params: any) { @@ -759,6 +764,8 @@ if (!isNullOrEmpty(params[Keys[k]].length) && isTimeViaRegExp8601(params[Keys[k]][0])) { sqlcmd += ` And ${Keys[k]} > '${params[Keys[k]][0]}'`; sqlcmd += ` And ${Keys[k]} < '${params[Keys[k]][1]}'`; + } else if (isNumber(params[Keys[k]])) { + sqlcmd += `And ${Keys[k]} = ${params[Keys[k]]}`; } else { sqlcmd += `And ${Keys[k]} like '%${params[Keys[k]]}%'`; } diff --git a/src/utils/is.ts b/src/utils/is.ts index 7080731..c2d74ac 100644 --- a/src/utils/is.ts +++ b/src/utils/is.ts @@ -1,12 +1,11 @@ -import { isEmpty } from 'lodash-es'; /* * @Description: file content * @Author: your name * @version: * @Date: 2024-06-17 14:51:26 - * @LastEditors: your name - * @LastEditTime: 2024-06-17 15:43:58 + * @LastEditors: Ben Lin + * @LastEditTime: 2024-07-15 20:37:07 */ export { isArguments, @@ -116,7 +115,23 @@ } export function isNullOrEmpty(val: unknown): val is null | undefined { - return isNullOrUnDef(val) || isEmpty(val); + return isNullOrUnDef(val) || isEmpty2(val); +} + +export function isEmpty2(value: any): boolean { + if (value === null || value === undefined) { + return true; + } + if (typeof value === 'string' && value.trim() === '') { + return true; + } + if (Array.isArray(value) && value.length === 0) { + return true; + } + if (typeof value === 'object' && value !== null && Object.keys(value).length === 0) { + return true; + } + return false; } diff --git a/src/views/components/CustModal.vue b/src/views/components/CustModal.vue index d621b8f..efbf7eb 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-03 19:19:16 + * @LastEditTime: 2024-07-16 16:55:52 --> <template> <BasicModal @@ -33,13 +33,12 @@ import { ref, unref, nextTick, watch, Ref } from 'vue'; import { BasicModal, useModalInner } from '/@/components/Modal'; import { FormSchema } from '/@/components/Form/index'; - import { custFunction } from './data'; import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; import { Layout, LayoutContent, Card } from 'ant-design-vue'; import { useMessage } from '/@/hooks/web/useMessage'; import { useI18n } from '/@/hooks/web/useI18n'; - import { initRoute } from '../tigerprojects/system/lowcode/data'; - import LogicFlow from '@logicflow/core'; + import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel'; + import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; const { t } = useI18n(); const { notification, createErrorModal } = useMessage(); @@ -60,7 +59,23 @@ const useFormData = ref<any>({}); const props = defineProps({ detailSlots: { type: Array, default: [] }, + entityName: { type: String }, }); + + const custImport = ref<any[]>([]); + const EntityCustFunction = ref([ + { + CustFunc(param: CustModalParams) {}, + } as EntityCustFunctionType, + ]); + /* 鍔ㄦ�乮mport瀹炰綋鍚�.ts鐨勮嚜瀹氫箟鏂规硶 */ + try { + custImport.value = await import(`../tigerprojects/system/lowcode/entityts/${props.entityName}.ts`); + } catch (e) {} + const [{ CustFunc }] = isNullOrUnDef(custImport.value['default']) + ? EntityCustFunction.value + : custImport.value['default'](); + watch( () => props.detailSlots, (v) => { @@ -97,13 +112,15 @@ //鍒濆鍖栨柟娉曡嚜瀹氫箟 if (!isNullOrEmpty(data?.initFnName)) { initFnName.value = data?.initFnName; - custFunction( - unref(isUpdate.value), - initFnName.value[cType.value], - cType.value, - mValues.value, - data?.others, - ); + let param: CustModalParams = { + cType: cType.value, + values: unref(isUpdate.value), + initFnName: initFnName.value[cType.value], + mValues: mValues.value, + others: data?.others, + FnName: '', + }; + CustFunc(param); } }); @@ -131,8 +148,12 @@ setModalProps({ confirmLoading: true }); //璋冪敤鑷畾涔変繚瀛樻柟娉曚繚瀛樻暟鎹� values['mValues'] = mValues.value; - const action = await custFunction(values, FnName.value[cType.value], cType.value); - if (action as boolean) { + const action = await CustFunc({ + cType: cType.value, + values: values, + FnName: FnName.value[cType.value], + } as unknown as CustModalParams); + if (action.IsSuccessed) { closeModal(); //鎴愬姛浜嬩欢锛屽皢鏁版嵁杩斿洖鍘熼〉闈� emit('success', { @@ -145,7 +166,7 @@ } else { createErrorModal({ title: t('璀﹀憡'), - content: t('淇濆瓨鏁版嵁澶辫触'), + content: t(action.LocaleMsg), getContainer: () => document.body, }); } diff --git a/src/views/components/bizMesWo.ts b/src/views/components/bizMesWo.ts index f2f4919..cd2420e 100644 --- a/src/views/components/bizMesWo.ts +++ b/src/views/components/bizMesWo.ts @@ -1,10 +1,10 @@ /* * @Description: 宸ュ崟鑷畾涔夋柟娉晅s * @Author: Ben Lin - * @version: + * @version: * @Date: 2024-06-05 16:10:24 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-03 21:56:56 + * @LastEditTime: 2024-07-16 10:06:44 */ /* 宸ュ崟鐩稿叧鑷畾涔夋柟娉� */ import { FunctionType } from '/@/api/tigerapi/model/systemModel'; @@ -27,7 +27,6 @@ import AssemblyNode from '/@/components/FlowChart/src/AssemblyNode'; import PackingNode from '/@/components/FlowChart/src/PackingNode'; import RepairNode from '/@/components/FlowChart/src/RepairNode'; -import { multiply } from 'lodash-es'; const { t } = useI18n(); const { getLocale } = useLocale(); @@ -74,13 +73,12 @@ } }); }, - /** * @description: 宸ュ崟閰嶇疆淇濆瓨鏂规硶 * @param {*} e * @param {array} args * @return {*} - */ + */ SaveCofig: (e, ...args) => { return new Promise((resolve, reject) => { try { @@ -104,7 +102,7 @@ * @param {*} e * @param {array} args * @return {*} - */ + */ SaveWoBatch: (e, ...args) => { return new Promise((resolve, reject) => { try { @@ -391,7 +389,16 @@ component: 'Input', required: true, colProps: { - span: 12, + span: 24, + }, + }, + { + field: 'RELEASE_QTY', + label: '宸ュ崟涓嬪彂鏁伴噺', + component: 'Input', + required: true, + colProps: { + span: 24, }, }, { @@ -400,7 +407,7 @@ component: 'ApiSelect', required: true, colProps: { - span: 12, + span: 24, }, componentProps: { api: getEntity, @@ -416,7 +423,7 @@ component: 'Input', required: true, colProps: { - span: 12, + span: 22, }, }, { @@ -439,18 +446,18 @@ span: 1, }, }, - { - field: 'fieldsc', - component: 'Upload', - label: '鎵撳嵃妯℃澘', - colProps: { - span: 10, - }, - rules: [{ required: true, message: '璇烽�夋嫨涓婁紶鏂囦欢' }], - componentProps: { - api: uploadApi, - }, - }, + // { + // field: 'fieldsc', + // component: 'Upload', + // label: '鎵撳嵃妯℃澘', + // colProps: { + // span: 10, + // }, + // rules: [{ required: true, message: '璇烽�夋嫨涓婁紶鏂囦欢' }], + // componentProps: { + // api: uploadApi, + // }, + // }, ]; /** @@ -509,7 +516,7 @@ tableName: 'MES_ROUTE', rowKey: 'ROT_CODE', returnFieldName: 'ROUTE_CODE', //杩斿洖鍊艰璧嬪�肩殑瀛楁鍚嶇О - searchInfo: {TABLE_NAME: 'MES_ROUTE' } + searchInfo: { TABLE_NAME: 'MES_ROUTE' }, }); break; case 'set': diff --git a/src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts b/src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts index 12b9e0f..6618bd9 100644 --- a/src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts +++ b/src/views/tigerprojects/mes/prod/biz_mes_wo/biz_mes_wo.data.ts @@ -35,13 +35,37 @@ let text = ''; let color = ''; switch (record.ORDER_TYPE) { - case 'Normal': - text = '姝e父'; + case 0: + text = '璁″垝'; + color = '#8a8a8a'; + break; + case 1: + text = '鏍囧噯'; color = 'green'; break; - case 'Rework': + case 2: text = '杩斿伐'; color = 'red'; + break; + case 3: + text = '鍦ㄥ簱鏀瑰埗'; + color = 'blue'; + break; + case 5: + text = '濮斿'; + color = 'yellow'; + break; + case 6: + text = '鐮斿彂'; + color = 'orange'; + break; + case 7: + text = '棰勬祴'; + color = '#078737'; + break; + case 8: + text = '鎷嗗嵏'; + color = '#e1822c'; break; default: break; @@ -263,20 +287,16 @@ { field: 'ORDER_TYPE', label: '宸ュ崟绫诲瀷', - component: 'Select', + component: 'ApiSelect', colProps: { span: 8 }, defaultValue: '', componentProps: { - options: [ - { - label: '姝e父', - value: 'Normal', - }, - { - label: '杩斿伐', - value: 'Rework', - }, - ], + api: GetEnum, + params: { name: 'BIZ_MES_WO+ORDER_TYPEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + placeholder: '璇烽�夋嫨宸ュ崟绫诲瀷', }, }, { @@ -329,20 +349,19 @@ { field: 'ORDER_TYPE', label: '宸ュ崟绫诲瀷', - component: 'Select', + component: 'ApiSelect', colProps: { span: 24 }, - defaultValue: 'Normal', + defaultValue: 1, componentProps: { - options: [ - { - label: '姝e父', - value: 'Normal', - }, - { - label: '杩斿伐', - value: 'Rework', - }, - ], + api: GetEnum, + params: { name: 'BIZ_MES_WO+ORDER_TYPEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + // onChange: (e, v) => { + // alert(e) + // console.log('ApiSelect====>:', e, v); + // }, }, }, { diff --git a/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue b/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue index f401942..9b3e0f8 100644 --- a/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue +++ b/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-05-25 00:27:00 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-03 20:51:05 + * @LastEditTime: 2024-07-16 16:44:47 --> <template> <div> @@ -70,37 +70,41 @@ <Loading :loading="compState.loading" :tip="compState.tip" /> <WoDrawer @register="registerDrawer" @success="handleSuccess" /> <WoModal @register="registerWo" @success="handleSuccess" :title="title" :mtitle="mtitle" /> - <!-- 鑷畾涔夋ā鎬佹锛屽彲浠ヨ嚜瀹氫箟澶氳〃鍗� --> - <CustModal - @register="registerCust" - @success="custSuccess" - :type="cType" - :detailSlots="dtlSlots" - > - <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� --> - <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> - <!-- 鑷畾涔夊唴瀹� --> - <!-- <div style="height: 200px" id="lfContainer" v-if="isCustEl[item.name]"></div> --> - <div class="h-full" style="height: 380px" v-if="isCustEl[item.name]"> - <FlowChartView :data="routeData" @init="init" /> - </div> - </template> - </CustModal> + <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> + <!-- 鑷畾涔夊唴瀹� --> + <!-- <div style="height: 200px" id="lfContainer" v-if="isCustEl[item.name]"></div> --> + <div class="h-full" style="height: 380px" v-if="isCustEl[item.name]"> + <FlowChartView :data="routeData" @init="init" /> + </div> + </template> + </CustModal> + <!-- <template #fallback> Loading... </template> --> + </Suspense> <RouteViewModal @register="registerRv" @success="RvItemSuccess" /> </div> </template> @@ -126,6 +130,7 @@ import { GetSelectSuccess, OpenSelectItem, getFormSchema } from '/@/views/components/data'; import LogicFlow from '@logicflow/core'; import { initRoute } from '../../../system/lowcode/data'; + import BIZ_MES_WO from '../../../system/lowcode/entityts/BIZ_MES_WO'; const { t } = useI18n(); const ASteps = Steps; @@ -172,6 +177,7 @@ nodes: [], edges: [], }); + const entityName = ref('BIZ_MES_WO'); const formSchema = ref([] as FormSchema[]); const woSchema = ref<FormSchema[]>(getFormSchema('woinfo')); const prodSchema = ref<FormSchema[]>(getFormSchema('prodinfo')); @@ -188,41 +194,10 @@ addRot: useModal(), setRot: useModal(), }); - //鑷畾涔夊琛ㄥ崟瀹炰緥 - const useFormData = ref({ - forminfo: useForm({ - labelWidth: 120, - schemas: formSchema, - actionColOptions: { - span: 24, - }, - showActionButtonGroup: false, - }), - woinfo: useForm({ - labelWidth: 120, - schemas: woSchema, - actionColOptions: { - span: 24, - }, - showActionButtonGroup: false, - }), - prodinfo: useForm({ - labelWidth: 120, - schemas: prodSchema, - actionColOptions: { - span: 24, - }, - showActionButtonGroup: false, - }), - // rotinfo: useForm({ - // labelWidth: 120, - // schemas: rotSchema, - // actionColOptions: { - // span: 24, - // }, - // showActionButtonGroup: false, - // }), - }); + + /* 鑾峰彇澶氳〃鍗曞疄渚� */ + const [{ GetUseForm }] = BIZ_MES_WO(); + const useFormData = ref<any>(GetUseForm()); onMounted(async () => {}); @@ -301,14 +276,14 @@ * @return {*} */ function handleRelease(record: Recordable) { - if (record.STATUS == 2) { - createErrorModal({ - title: t('璀﹀憡'), - content: t('宸ュ崟宸茬粡涓嬪彂锛屼笉鑳藉啀涓嬪彂锛�'), - getContainer: () => document.body, - }); - return; - } + // if (record.STATUS == 2) { + // createErrorModal({ + // title: t('璀﹀憡'), + // content: t('宸ュ崟宸茬粡涓嬪彂锛屼笉鑳藉啀涓嬪彂锛�'), + // getContainer: () => document.body, + // }); + // return; + // } cType.value = 'BIZ_MES_WO'; dtlSlots.value = [ { @@ -318,7 +293,7 @@ title: '涓嬪彂閰嶇疆', }, ]; - formSchema.value = getFormSchema(cType.value); + // formSchema.value = getFormSchema(cType.value); openCustModal(true, { isUpdate: true, //鏄惁鏇存柊鎿嶄綔 ctype: cType, //鏄摢涓〉闈� @@ -328,7 +303,7 @@ formElName: ['forminfo'], //琛ㄥ崟鎻掓Ы鍚嶇О RowKeys: { add: 'ROUTE_CODE', set: 'ROUTE_CODE' }, //鎻掓Ы鐨勫脊鍑烘閫夋嫨鐨刢ode fnName: { BIZ_MES_WO: 'SaveWoBatch' }, //淇濆瓨鏂规硶鍚� - initFnName: {}, //鍒濆鍖栨柟娉曞悕 + initFnName: {}, //鍒濆鍖栨柟娉曞悕锛屾病鏈夊氨鐣欑┖{} isCustEl: isCustEl.value, values: record, //琛ㄥ崟璁板綍 }); @@ -503,8 +478,8 @@ selectVals.value['ROUTE_CODE'], ); //[openRvModal], selectVals.value['ID']杩欐槸鑷畾涔夊弬鏁帮紝鎸夊疄闄呴渶姹� } - + function RvItemSuccess(d, u) { closeModal(); - } + } </script> diff --git a/src/views/tigerprojects/system/lowcode/composition/index.vue b/src/views/tigerprojects/system/lowcode/composition/index.vue index 78cb0db..2068333 100644 --- a/src/views/tigerprojects/system/lowcode/composition/index.vue +++ b/src/views/tigerprojects/system/lowcode/composition/index.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-18 23:30:30 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-03 19:21:09 + * @LastEditTime: 2024-07-15 22:22:58 --> <template> <PageWrapper @@ -43,32 +43,35 @@ </template> </BasicTable> --> <!-- <normalDrawer @register="registerDrawer" @success="handleSuccess" /> --> - <CustModal - @register="registerCust" - @success="custSuccess" - :type="cType" - :detailSlots="dtlSlots" - > - <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� --> - <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> + <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> <script lang="ts" setup> diff --git a/src/views/tigerprojects/system/lowcode/detail/index.vue b/src/views/tigerprojects/system/lowcode/detail/index.vue index 65c2228..65949ca 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-03 08:46:37 + * @LastEditTime: 2024-07-15 22:23:07 --> <template> <PageWrapper :title="pageTitle" :content="contentStr" contentBackground @back="goBack"> @@ -24,32 +24,35 @@ <Suspense></Suspense> </div> </div> - <CustModal - @register="registerCust" - @success="custSuccess" - :type="cType" - :detailSlots="dtlSlots" - > - <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� --> - <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> + <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> diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts new file mode 100644 index 0000000..6b3ab5a --- /dev/null +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_MES_WO.ts @@ -0,0 +1,1330 @@ +/* + * @Description: 宸ュ崟鐩稿叧 + * @Author: Ben Lin + * @version: + * @Date: 2024-06-19 20:34:27 + * @LastEditors: Ben Lin + * @LastEditTime: 2024-07-16 16:38:43 + */ + +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 { useUserStore } from '/@/store/modules/user'; +import { buildUUID } from '/@/utils/uuid'; +import { SaveWoBatchInput } from '/@/api/tigerapi/model/mesModel'; +import { CustModalParams, FunctionType } from '/@/api/tigerapi/model/systemModel'; +import { SaveMesBatchWo } from '/@/api/tigerapi/mes/wo'; +import { useForm } from '/@/components/Form/index'; +import { uploadApi } from '/@/api/sys/upload'; + +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(itemCode); + // 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(), + }; + }, + GetUseForm: () => { + return { + forminfo: useForm({ + labelWidth: 120, + schemas: woformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + woinfo: useForm({ + labelWidth: 120, + schemas: woCfgformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + prodinfo: useForm({ + labelWidth: 120, + schemas: prodCfgformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + }; + }, + /** + * @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) => { + switch (param.cType) { + case 'BIZ_MES_WO': + case 'BIZ_MES_WO_Config': + 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; + } + }, + }; + + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 鑷畾涔夋柟娉� + * @return {*} + */ + const getWoFns: Record<string, FunctionType> = { + /** + * @description: 宸ュ崟閰嶇疆淇濆瓨鏂规硶 + * @param {*} e + * @param {array} args + * @return {*} + */ + SaveCofig: (param: CustModalParams) => { + return new Promise((resolve, reject) => { + try { + const form = param.values['prodinfo']; + const wo = param.values['mValues']; + wo.ROUTE_STATUS = 1; + SaveEntity(wo, true, 'BIZ_MES_WO').then((action) => { + if (action.IsSuccessed) { + resolve(true); + } else { + reject(false); + } + }); + } catch { + reject(false); + } + }); + }, + /** + * @description: 宸ュ崟涓嬪彂淇濆瓨鏂规硶 + * @param {CustModalParams} param + * @return {*} + */ + SaveWoBatch: (param: CustModalParams) => { + return new Promise((resolve, reject) => { + try { + const form = param.values['forminfo']; + const wo = param.values['mValues']; + wo.ROUTE_CODE = form.ROUTE_CODE; + wo.STATUS = 2; + let input: SaveWoBatchInput = { + Wo: wo, + WoBatch: { + ID: buildUUID(), + CREATE_TIME: new Date(), + CREATE_USER: useUserStore().getUserInfo.userId as string, + UPDATE_TIME: new Date(), + UPDATE_USER: useUserStore().getUserInfo.userId as string, + GHOST_ROW: false, + AUTH_ORG: '', + AUTH_PROD: useUserStore().getUserInfo.prodCode as string, + AUTH_WH: '', + ORDER_NO: wo.ORDER_NO, + STATUS: wo.STATUS, + ITEM_CODE: wo.ITEM_CODE, + CUST_CODE: wo.CUST_CODE, + FACTORY: wo.FACTORY, + WS_CODE: wo.WS_CODE, + ACT_LINE: form.PLAN_LINE, + STD_WORKER_QTY: wo.STD_WORKER_QTY, + ACT_WORKER_QTY: wo.ACT_WORKER_QTY, + RELEASE_TIME: new Date(), + RELEASE_USER: useUserStore().getUserInfo.userId as string, + PLAN_QTY: form.RELEASE_QTY, + INPUT_QTY: wo.INPUT_QTY, + OUTPUT_QTY: wo.OUTPUT_QTY, + SCRAP_QTY: wo.SCRAP_QTY, + STOCK_IN_QTY: wo.STOCK_IN_QTY, + UPH: wo.UPH, + UPPH: wo.UPPH, + REMARK: wo.REMARK, + ACT_START_TIME: wo.ACT_START_TIME, + ACT_END_TIME: wo.ACT_END_TIME, + BATCH_NO: '', + }, + }; + SaveMesBatchWo(input).then((action) => { + resolve(action); + }); + } catch { + reject(false); + } + }); + }, + }; + + /** + * @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 }, + }, + ]; + + const woformSchema: FormSchema[] = [ + { + field: 'PLAN_QTY', + label: '宸ュ崟鏁伴噺', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + field: 'RELEASE_QTY', + label: '宸ュ崟涓嬪彂鏁伴噺', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '璁″垝浜х嚎', + field: 'PLAN_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, + }, + }, + ]; + + const woCfgformSchema: FormSchema[] = [ + { + field: 'ORDER_NO', + component: 'Input', + label: '宸ュ崟鍙�', + colProps: { + span: 8, + }, + componentProps: { + placeholder: '璇疯緭鍏ュ伐鍗曞彿', + onChange: (e: any) => { + console.log(e); + }, + }, + dynamicDisabled: true, + }, + { + field: 'ORDER_TYPE', + component: 'Select', + label: '宸ュ崟绫诲瀷', + colProps: { + span: 8, + }, + defaultValue: 'Normal', + componentProps: { + options: [ + { + label: '姝e父', + value: 'Normal', + }, + { + label: '杩斿伐', + value: 'Rework', + }, + ], + }, + dynamicDisabled: true, + }, + { + field: 'PLAN_QTY', + component: 'Input', + label: '璁″垝鏁伴噺', + colProps: { + span: 8, + }, + dynamicDisabled: true, + }, + ]; + + const prodCfgformSchema: FormSchema[] = [ + { + field: 'ITEM_CODE', + component: 'Input', + label: '鐗╂枡缂栫爜', + required: true, + colProps: { + span: 12, + }, + componentProps: { + placeholder: '璇疯緭鍏ョ墿鏂欑紪鐮�', + onChange: (e: any) => { + console.log(e); + }, + }, + dynamicDisabled: true, + }, + { + field: 'ITEM_TYPE', + component: 'Input', + label: '鐗╂枡绫诲瀷', + colProps: { + span: 12, + }, + }, + { + label: '宸ヨ壓璺嚎', + field: 'ROUTE_CODE', + component: 'Input', + required: true, + colProps: { + span: 12, + }, + }, + { + field: 'addRot', + component: 'Input', + label: '1', + colSlot: 'addRot', + defaultValue: 'MES_ROUTE', + colProps: { + span: 1, + }, + }, + { + field: 'setRot', + component: 'Input', + label: '1', + colSlot: 'setRot', + defaultValue: 'MES_ROUTE', + colProps: { + span: 1, + }, + }, + { + field: 'fieldsc', + component: 'Upload', + label: '鎵撳嵃妯℃澘', + colProps: { + span: 10, + }, + rules: [{ required: true, message: '璇烽�夋嫨涓婁紶鏂囦欢' }], + componentProps: { + api: uploadApi, + multiple: false, + }, + }, + ]; + + return [methods]; +} + +export default _default; diff --git a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts index 1caea9b..8f308e7 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/ProdRouteBinding.ts @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-03 21:57:20 + * @LastEditTime: 2024-07-15 22:05:16 */ import { Ref, h, ref, render, unref } from 'vue'; @@ -18,6 +18,7 @@ import { useModal } from '/@/components/Modal'; import { FormSchema } from '/@/components/Table'; import { initRoute } from '../data'; +import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; const { t } = useI18n(); const { createErrorModal } = useMessage(); @@ -485,8 +486,8 @@ * @param {array} args * @return {*} */ - CustFunc: (type: string | undefined, ...args) => { - if (type == 'Route') { + CustFunc: (param: CustModalParams) => { + if (param.cType == 'Route') { // initRoute(args[0], args[1]); } }, diff --git a/src/views/tigerprojects/system/lowcode/high/baseForm.vue b/src/views/tigerprojects/system/lowcode/high/baseForm.vue index 738c49f..beb35cf 100644 --- a/src/views/tigerprojects/system/lowcode/high/baseForm.vue +++ b/src/views/tigerprojects/system/lowcode/high/baseForm.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-23 17:21:29 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-06 22:25:35 + * @LastEditTime: 2024-07-15 21:13:35 --> <template> <a-card @@ -40,7 +40,9 @@ ] = custImport.value['default'](); const formSchemas = ref({ BaseForm: GetBaseForm(), - }); //寮瑰嚭妗嗘垨楂樼骇椤甸潰澶氳〃鍗曠粨鏋� + }); + + //寮瑰嚭妗嗘垨楂樼骇椤甸潰澶氳〃鍗曠粨鏋� useFormData.value = { BaseForm: useForm({ labelWidth: 120, diff --git a/src/views/tigerprojects/system/lowcode/high/index.vue b/src/views/tigerprojects/system/lowcode/high/index.vue index 875ea1f..689ef07 100644 --- a/src/views/tigerprojects/system/lowcode/high/index.vue +++ b/src/views/tigerprojects/system/lowcode/high/index.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-06-18 15:09:48 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-06 23:35:38 + * @LastEditTime: 2024-07-15 22:23:12 --> <!-- * _oo0oo_ @@ -70,32 +70,35 @@ <a-button class="mr-4" type="info" @click="cancel"> 鍙栨秷 </a-button> <a-button type="primary" @click="submitAll"> 鎻愪氦 </a-button> </template> - <CustModal - @register="registerCust" - @success="custSuccess" - :type="cType" - :detailSlots="dtlSlots" - > - <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� --> - <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> + <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> <script lang="ts" setup> @@ -203,7 +206,13 @@ let p = [] as Promise<any>[]; for (i = 0; i < Keys.length; i++) { p.push( - SaveEntity(validates[Keys[i]], unref(isAllUpdate), baseCards.value[i]['entityName'], `${objParams.value['IsExist']}='${validates[Keys[i]][objParams.value['IsExist']]}'`, true), + SaveEntity( + validates[Keys[i]], + unref(isAllUpdate), + baseCards.value[i]['entityName'], + `${objParams.value['IsExist']}='${validates[Keys[i]][objParams.value['IsExist']]}'`, + true, + ), ); } await Promise.all(p); diff --git a/src/views/tigerprojects/system/lowcode/normal/index.vue b/src/views/tigerprojects/system/lowcode/normal/index.vue index 6b2e713..83b1aeb 100644 --- a/src/views/tigerprojects/system/lowcode/normal/index.vue +++ b/src/views/tigerprojects/system/lowcode/normal/index.vue @@ -4,39 +4,42 @@ * @version: * @Date: 2024-05-30 13:28:20 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-14 00:58:50 + * @LastEditTime: 2024-07-16 16:24:23 --> <template> <div> <Suspense> <mainTable /> </Suspense> - <CustModal - @register="registerCust" - @success="custSuccess" - :type="cType" - :detailSlots="dtlSlots" - > - <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� --> - <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> + <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> </div> </template> <script lang="ts" setup> @@ -63,6 +66,7 @@ const { currentRoute } = useRouter(); const go = useGo(); const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); + const entityName = ref(objParams.value.ID); const _columns = ref([]); const _searchFormSchema = ref([]); const _crudFormSchema = ref([]); @@ -118,7 +122,7 @@ const data = await getEntity({ sqlcmd: "ASSEMBLY_NAME ='" + objParams.value.ID + "'", entityName: 'SYS_LOW_CODE', - order: '' + order: '', }); var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON); for (const i in searchForms) { @@ -167,7 +171,7 @@ _cruds[i].componentProps.api = uploadApi; _cruds[i].componentProps.multiple = false; _cruds[i].componentProps.maxNumber = 1; - _cruds[i].componentProps.uploadParams = {entityName: objParams.value.ID}; + _cruds[i].componentProps.uploadParams = { entityName: objParams.value.ID }; _cruds[i].rules = [{ required: true, message: '璇烽�夋嫨涓婁紶鏂囦欢' }]; } if (_cruds[i].isexist == 'Y') { -- Gitblit v1.9.3