From c153a50b5de2780fe7b072fd360b97e00e54b897 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 11 九月 2024 21:31:27 +0800 Subject: [PATCH] 规则维护更新 --- src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts | 46 +++++++++++++++++++++++++++++++++------------- 1 files changed, 33 insertions(+), 13 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts index 01d9385..8e21676 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_PKG_DTL.ts @@ -4,17 +4,16 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-09-11 00:47:09 + * @LastEditTime: 2024-09-11 20:51:11 */ -import { Ref, ref } from 'vue'; -import { DeleteEntity, getEntity } from '/@/api/tigerapi/system'; +import { Ref, ref, unref } from 'vue'; +import { DeleteEntity, getEntity, SaveEntity } from '/@/api/tigerapi/system'; import { ActionItem, BasicColumn, FormSchema, useTable } from '/@/components/Table'; import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; import { useDrawer } from '/@/components/Drawer'; import { EditOperation, Search, custDel } from '../data'; -import { dateUtil } from '/@/utils/dateUtil'; -import { SaveBasPkgRule } from '/@/api/tigerapi/mes/pkgrule'; +import { SaveBasPkgRule } from '/@/api/tigerapi/mes/baserule'; import { BAS_PKG_RULE } from '/@/api/tigerapi/model/mesModel'; function _default(): any[] { @@ -315,14 +314,35 @@ * @return {*} */ SubmitAll: (data: Ref<any[]>, keyFieldValues: Ref<{}>, ...args) => { - SaveBasPkgRule({ - PkgDtl: data.value['BAS_PKG_DTL'], - PkgProd: data.value['BAS_PKG_PROD'], - PkgRule: {} as unknown as BAS_PKG_RULE - }).then((action) => { - if (action.IsSuccessed) { - args[0](); - } + const validates = args[1].validates; + const Keys = args[1].Keys; + const isAllUpdate = args[1].isAllUpdate; + const baseCards = args[1].baseCards; + const IsExist = args[1].IsExist; + /* 寰幆淇濆瓨楂樼骇琛ㄥ崟涓富琛ㄥ崟淇℃伅锛屽鏋滄湁澶氫釜鐨勮瘽锛屾墍浠ヨ寰幆 */ + let i; + let p = [] as Promise<any>[]; + for (i = 0; i < Keys.length; i++) { + p.push( + SaveEntity( + validates[Keys[i]], + unref(isAllUpdate), + baseCards.value[i]['entityName'], + `${IsExist}='${validates[Keys[i]][IsExist]}'`, + true, + ), + ); + } + Promise.all(p).then(() => { + SaveBasPkgRule({ + PkgDtl: data.value['BAS_PKG_DTL'], + PkgProd: data.value['BAS_PKG_PROD'], + PkgRule: {} as unknown as BAS_PKG_RULE, + }).then((action) => { + if (action.IsSuccessed) { + args[0](); + } + }); }); }, }; -- Gitblit v1.9.3