| | |
| | | * @LastEditTime: 2024-10-23 20:48:14 |
| | | */ |
| | | |
| | | import { Ref, h, ref, render, unref } from 'vue'; |
| | | import { GetEnum, SaveEntity, convertToTree, getEntity } from '/@/api/tigerapi/system'; |
| | | import { unref } from 'vue'; |
| | | import { GetEnum, getEntity } from '/@/api/tigerapi/system'; |
| | | import { useLocale } from '/@/locales/useLocale'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { ActionItem, BasicColumn, 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 { CustModalParams } from '/@/api/tigerapi/model/systemModel'; |
| | | import { useForm } from '/@/components/Form/index'; |
| | | import { cloneDeep } from 'lodash-es'; |
| | | import { useProdRouteStore } from '/@/store/modules/prodRoute'; |
| | | import { Tag, Tooltip } from 'ant-design-vue'; |
| | | |
| | | const { t } = useI18n(); |
| | | const { createErrorModal } = useMessage(); |
| | | const { getLocale } = useLocale(); |
| | | function _default() { |
| | | const ActionColumn: BasicColumn = { |
| | |
| | | }); |
| | | return data; |
| | | }, |
| | | /** |
| | | * @desc 初始化表单 |
| | | */ |
| | | GetUseForm: () => { |
| | | return { |
| | | forminfo: useForm({ |
| | |
| | | switch (param.cType) { |
| | | case 'BIZ_MES_WO': |
| | | case 'BIZ_MES_WO_Config': |
| | | return getWoFns[param.FnName](param) as Promise<any>; |
| | | // break; |
| | | // return getWoFns[param.FnName](param) as Promise<any>; |
| | | break; |
| | | default: |
| | | return new Promise((resolve, reject) => { |
| | | try { |
| | |
| | | /* 以下是内部方法,不export,供上面的方法调用 */ |
| | | |
| | | /** |
| | | * @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']; |
| | | const _wo = cloneDeep(wo); |
| | | _wo.ROUTE_STATUS = 1; |
| | | _wo.ROUTE_CODE = form.ROUTE_CODE; |
| | | SaveEntity(_wo, true, 'BIZ_MES_WO').then((action) => { |
| | | if (action.IsSuccessed) { |
| | | SP_MES_PROD2WO({ rotId: form.ROT_ID, wo: wo.ORDER_NO }).then((res) => { |
| | | if (!res.IsSuccessed) { |
| | | SaveEntity(wo, true, 'BIZ_MES_WO'); |
| | | } |
| | | resolve(res); |
| | | }); |
| | | } else { |
| | | reject(action); |
| | | } |
| | | }); |
| | | } 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.STATUS = wo.STATUS == 3 ? 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: useUserStore().getUserInfo.orgCode, |
| | | 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.ACT_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: '', |
| | | }, |
| | | IfToCust: form.IfToCust, |
| | | }; |
| | | SaveMesBatchWo(input).then((action) => { |
| | | resolve(action); |
| | | }); |
| | | } catch { |
| | | reject(false); |
| | | } |
| | | }); |
| | | }, |
| | | initRoute: () => {}, |
| | | }; |
| | | |
| | | /** |
| | | * @description: 跳转到详情页面方法 |
| | | * @param {Fn} go |
| | | * @return {*} |
| | |
| | | secondTabName: '送货单SN', //'标签过程变量', |
| | | firstTitle: '明细', |
| | | secondTitle: '', //'过程变量', |
| | | Tabs: [ |
| | | { |
| | | name: '送货单(U9)', |
| | | tableTitle: '明细', |
| | | entityName: 'BIZ_U9_ASN_DTL', |
| | | NeedInclude: true, |
| | | key: 'BIZ_U9_ASN_DTL', |
| | | }, |
| | | { |
| | | name: '送货单SN', |
| | | tableTitle: 'SN', |
| | | entityName: 'BIZ_U9_ASN_SN', |
| | | NeedInclude: true, |
| | | key: 'BIZ_U9_ASN_SN', |
| | | }, |
| | | ], |
| | | pageTitle: '送货单(U9)详情', //详情页面标题 |
| | | contentStr: '这里是送货单(U9)明细管理页面,可以显示送货单(U9)的所有批次详情', |
| | | detailName: `送货单[${params['record'].ORDER_NO}]批次详情`, |
| | |
| | | sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id))); |
| | | go(`/BIZ_U9_ASN_DTL/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | const woformSchema: FormSchema[] = [ |
| | | { |