From 38b2a8369513ebcc34c6dd01a176593b825fe71e Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 09 六月 2024 17:06:08 +0800 Subject: [PATCH] 工单管理更新 --- src/views/components/data.ts | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/views/components/data.ts b/src/views/components/data.ts index c571570..cbb4c0b 100644 --- a/src/views/components/data.ts +++ b/src/views/components/data.ts @@ -1,20 +1,40 @@ -import { getFns, woGetSelectSuccess, woCustFn, woformSchema, woCfgformSchema } from './bizMesWo'; -import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table'; +import { + getWoFns, + woGetSelectSuccess, + woCustFn, + woformSchema, + woCfgformSchema, + prodCfgformSchema, + xxCfgformSchema, +} from './bizMesWo'; +import { FormSchema } from '/@/components/Table'; import { useI18n } from '/@/hooks/web/useI18n'; const { t } = useI18n(); export const formSchema: FormSchema[] = []; -export function custFunction(e: any, fnName: string, type: string, ...args) { +export async function custFunction<T = any>( + e: any, + fnName: string, + type: string, + ...args +): Promise<T> { switch (type) { case 'BIZ_MES_WO': - getFns[fnName](e, args); - break; case 'BIZ_MES_WO_Config': - getFns[fnName](e, args); - break; + return getWoFns[fnName](e, args); + // break; default: - break; - (e) => {}; + return new Promise((resolve, reject) => { + try { + (e) => {}; + resolve(true); + } catch { + reject(false); + } finally { + args[0][0]({ confirmLoading: false }); + } + }); + // break; } } @@ -24,8 +44,14 @@ case 'BIZ_MES_WO': _formSchema = woformSchema; break; - case 'BIZ_MES_WO_Config': + case 'woinfo': _formSchema = woCfgformSchema; + break; + case 'prodinfo': + _formSchema = prodCfgformSchema; + break; + case 'xxinfo': + _formSchema = xxCfgformSchema; break; default: break; @@ -39,6 +65,7 @@ let data = {}; switch (entityName) { case 'BIZ_MES_WO': + case 'BIZ_MES_WO_Config': data = woGetSelectSuccess(d, u); break; default: @@ -60,9 +87,10 @@ ) { switch (entityName) { case 'BIZ_MES_WO': + case 'BIZ_MES_WO_Config': //鏍规嵁甯﹀叆鐨勫悕绉版墦寮�涓嶅悓鐨勫疄浣撳垪琛� woCustFn(openItemModal, slotName, others, args); break; - default: + default: //榛樿鎵撳紑鐗╂枡鍒楄〃 openItemModal(true, { title: '鐗╂枡鍒楄〃', schemas: [ -- Gitblit v1.9.3