From 2abb91c893f2eed3761bd09aabe12400460d2863 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期五, 21 六月 2024 00:16:35 +0800 Subject: [PATCH] 产品工艺路线更新 --- src/views/tigerprojects/system/lowcode/normal/basDefectGrp.ts | 62 ++++++++++++++++++++++++++++-- 1 files changed, 57 insertions(+), 5 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/normal/basDefectGrp.ts b/src/views/tigerprojects/system/lowcode/normal/basDefectGrp.ts index c6a85ec..54cb082 100644 --- a/src/views/tigerprojects/system/lowcode/normal/basDefectGrp.ts +++ b/src/views/tigerprojects/system/lowcode/normal/basDefectGrp.ts @@ -1,10 +1,13 @@ -import { h, unref } from 'vue'; +import { Ref, h, unref } from 'vue'; import { ActionItem, BasicColumn, FormSchema } from '/@/components/Table'; import { useI18n } from '/@/hooks/web/useI18n'; import { useLocale } from '/@/locales/useLocale'; import { Tag } from 'ant-design-vue'; import { DeleteEntity, GetEnum, getEntity } from '/@/api/tigerapi/system'; import { isNullOrEmpty } from '/@/utils/is'; +import { buildUUID } from '/@/utils/uuid'; +import { useUserStore } from '/@/store/modules/user'; +import { formatToDateTime } from '/@/utils/dateUtil'; const { t } = useI18n(); const { getLocale } = useLocale(); @@ -61,7 +64,7 @@ * @return {*} */ export function DftGrpEdit(args: Fn[], params: {}) { - const param = { CODE: params['record']['DFTG_CODE'], ID: params['record']['ID'], Name: 'BAS_DEFECT', Title: `缂栬緫涓嶈壇浠g爜缁勶細${params['record']['DFTG_CODE']}`, pCode: 'DFTG_CODE' }; + const param = { CODE: params['record']['DFTG_CODE'], ID: params['record']['ID'], Name: 'BAS_DEFECT', Title: `缂栬緫涓嶈壇浠g爜缁勶細${params['record']['DFTG_CODE']}`, pCode: 'DFTG_CODE', IsID: false }; args[5](`/BAS_DEFECT/High/${encodeURI(JSON.stringify(param))}`); } @@ -82,12 +85,51 @@ dataSource: params['data'], }); args[1](); - }else{ + } else { DeleteEntity(params['record'], params['entityName']).then((action) => { if (action.IsSuccessed) { args[1](); } }); + } +} + +/** + * @description: 鑷畾涔夋槑缁嗚〃涓紪杈戣繑鍥炴柟娉� + * @param {string} type + * @param {*} d + * @param {*} u + * @return {*} + */ +export function dftEditeOperation(data: Ref<any[]>, d, u) { + if (u.isUpdate) { + //鏇存柊 + var _data = data.value.map((item) => { + if (item['ID'] == d.ID) + return { + ...item, + DFT_CODE: d.DFT_CODE, + DFT_NAME: d.DFT_NAME, + DFT_LEVEL: d.DFT_LEVEL, + REMARK: d.REMARK, + }; + return item; + }); + data.value = _data; + } else { + //鏂板 + d.ID = buildUUID(); + d.CREATE_USER = useUserStore().getUserInfo.userId as string; + d.UPDATE_TIME = formatToDateTime(new Date()); + d.UPDATE_USER = useUserStore().getUserInfo.userId as string; + var _data2: any[] = []; + if (!isNullOrEmpty(data.value)) { + _data2 = data.value.map((item) => { + return item; + }); + } + _data2.push(d); + data.value = _data2; } } @@ -152,11 +194,12 @@ ], tableName: 'BAS_ITEM', rowKey: 'ITEM_CODE', + searchInfo: {TABLE_NAME: 'BAS_ITEM'} }); } /** - * @description: 鍩烘湰淇℃伅 + * @description: 涓嶈壇浠g爜鍩烘湰淇℃伅 * @return {*} */ export const baseSchema: FormSchema[] = [ @@ -186,6 +229,15 @@ span: 8, }, }, + { + label: 'ID', + field: 'ID', + component: 'Input', + colProps: { + span: 8, + }, + show: false, + }, ]; export const searchSchema: FormSchema[] = [ @@ -208,7 +260,7 @@ ]; /** - * @description: 鑾峰彇澧炲垹鏀硅〃鍗� + * @description: 鑾峰彇涓嶈壇浠g爜澧炲垹鏀硅〃鍗� * @return {*} */ export const crudSchema: FormSchema[] = [ -- Gitblit v1.9.3