| | |
| | | * @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[] { |
| | |
| | | * @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](); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | }; |