From 1094c29e03ee0efc7121babda0532c8138aa801f Mon Sep 17 00:00:00 2001 From: YangYuGang <1378265336@qq.com> Date: 星期六, 08 三月 2025 20:20:54 +0800 Subject: [PATCH] 收货单、退货单页面添加 --- src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RECEIPT.ts | 523 +++++++++++++ /dev/null | 0 src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RECEIPT_DTL.ts | 522 +++++++++++++ src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN.ts | 2 src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RETURN_DTL.ts | 524 +++++++++++++ src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RETURN.ts | 523 +++++++++++++ src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN_DTL.ts | 237 +++++ 7 files changed, 2,306 insertions(+), 25 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN.ts index fe8cd04..6ab3c86 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN.ts @@ -48,7 +48,7 @@ data.map((x) => { if (x.name == 'goDetail') { x.onClick = goDetail.bind(null, args[5], params); - x.tooltip = '宸ュ崟鎵规'; + x.tooltip = '鍗曟嵁鍙�'; } }); return data; diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN_DTL.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN_DTL.ts index bb83fe6..8cd75d2 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN_DTL.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN_DTL.ts @@ -1,9 +1,9 @@ /* * @Description: 閫佽揣鍗�(U9)鏄庣粏 - * @Author: Ben Lin + * @Author: 鏉ㄤ簯鍒� * @version: * @Date: 2024-06-19 20:34:27 - * @LastEditors: Ben Lin + * @LastEditors: 鏉ㄤ簯鍒� * @LastEditTime: 2024-09-29 21:28:37 */ @@ -85,16 +85,8 @@ resizable: true, }, { - dataIndex: 'ITEM_CODE', - title: '鐗╂枡缂栫爜', - ifShow: true, - sorter: true, - resizable: true, - customRender: () => {}, - }, - { - dataIndex: 'ITEM_NAME', - title: '鐗╂枡鍚嶇О', + dataIndex: 'LINE_NO', + title: '鍗曟嵁琛屽彿', ifShow: true, sorter: true, resizable: true, @@ -149,6 +141,63 @@ }, }, { + dataIndex: 'ITEM_CODE', + title: '鐗╂枡缂栫爜', + ifShow: true, + sorter: true, + resizable: true, + customRender: () => {}, + }, + { + dataIndex: 'UNIT', + title: '鍗曚綅', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY', + title: '鍗曟嵁鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_PACKING', + title: '鍖呰鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_IN', + title: '鍏ュ簱鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_OK', + title: '鑹搧鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_RETURN', + title: '閫�璐ф暟閲�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_GIFT', + title: '鏄惁璧犲搧(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { dataIndex: 'SUPP_CODE', title: '渚涘簲鍟嗙紪鐮�', ifShow: true, @@ -156,43 +205,50 @@ resizable: true, }, { - dataIndex: 'SUPP_NAME', - title: '渚涘簲鍟嗗悕绉�', + dataIndex: 'SUPP_LOTNO', + title: '渚涘簲鍟嗘壒娆″彿', ifShow: true, sorter: true, resizable: true, }, { - dataIndex: 'ORDER_DATE', - title: '鍗曟嵁鏃ユ湡', + dataIndex: 'LOTNO', + title: '鎵规鍙�', ifShow: true, sorter: true, resizable: true, }, { - dataIndex: 'DELIVERY_DATE', - title: '閫佽揣鏃ユ湡', + dataIndex: 'PO_ID', + title: '閲囪喘鍗旾D', ifShow: true, sorter: true, resizable: true, }, { - dataIndex: 'PLANARRIVED_DATE', - title: '棰勮閫佽揪鏃ユ湡', + dataIndex: 'PO_NO', + title: '閲囪喘鍗曞彿', ifShow: true, sorter: true, resizable: true, }, { - dataIndex: 'RECEIVER', - title: '鏀惰揣浜�', + dataIndex: 'PO_LINE', + title: '閲囪喘鍗曡鍙�', ifShow: true, sorter: true, resizable: true, }, { - dataIndex: 'RECEIVE_DATE', - title: '鏀惰揣鏃ユ湡', + dataIndex: 'IQC_ID', + title: '閫佽揣鍗旾D', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IQC_NO', + title: '閫佹鍗曞彿', ifShow: true, sorter: true, resizable: true, @@ -204,6 +260,7 @@ sorter: true, resizable: true, }, + ]; case 'BIZ_U9_ASN_SN': return [ @@ -225,6 +282,138 @@ sorter: true, resizable: true, }, + { + dataIndex: 'META_SN', + title: '鍏冩潯鐮�', + sorter: true, + resizable: true, + }, + { + dataIndex: 'ITEM_CODE', + title: '鐗╂枡缂栫爜', + ifShow: true, + sorter: true, + resizable: true, + customRender: () => {}, + }, + { + dataIndex: 'STATUS', + title: '鐘舵��', + ifShow: true, + sorter: true, + resizable: true, + customRender: ({ record }) => { + let color = ''; + let text = ''; + switch ( + record.STATUS //鐘舵��(0Init鍒濆鍖東1Imported宸插鍏2Release宸蹭笅鍙憒3Working鐢熶骇涓瓅4Paused宸叉殏鍋渱5Closed宸插叧闂�) + ) { + case 0: + text = '鍒濆鍖�'; + color = '#8a8a8a'; + break; + case 1: + text = '宸插鍏�'; + color = 'blue'; + break; + case 2: + text = '宸查�佽揪'; + color = 'green'; + break; + case 3: + text = '娓呯偣涓�'; + color = 'orange'; + break; + case 4: + text = '涓婃灦涓�'; + color = 'red'; + break; + case 5: + text = '寰呭鏍�'; + color = '#e1822c'; + break; + case 6: + text = '宸插畬鎴�'; + color = '#009966'; + break; + case 7: + text = '宸蹭綔搴�'; + color = '#CCCCCC'; + break; + } + return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); + }, + }, + { + dataIndex: 'QTY', + title: '鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'UNIT', + title: '鍗曚綅', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_GIFT', + title: '鏄惁璧犲搧(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_OK', + title: '鏄惁鑹搧(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_IN', + title: '鏄惁鍏ュ簱(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_RETURN', + title: '鏄惁閫�璐�(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'LOTNO', + title: '鎵规鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'CARTON_NO', + title: '绠卞彿', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'PALLET_NO', + title: '鏍堟澘鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'REMARK', + title: '澶囨敞', + ifShow: true, + sorter: true, + resizable: true, + }, ]; } }, diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN_SN.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN_SN.ts deleted file mode 100644 index e69de29..0000000 --- a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_ASN_SN.ts +++ /dev/null diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RECEIPT.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RECEIPT.ts new file mode 100644 index 0000000..9aa9392 --- /dev/null +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RECEIPT.ts @@ -0,0 +1,523 @@ +/* + * @Description: 鏀惰揣鍗�(U9) + * @Author: 鏉ㄤ簯鍒� + * @version: + * @Date: 2024-06-19 20:34:27 + * @LastEditors: 鏉ㄤ簯鍒� + * @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 { 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 { 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 = { + width: 180, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }; + /** + * @description: 宸ュ崟绠$悊鐨勪竴浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ + const methods = { + /** + * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� + * @return {*} + */ + CreateAction: (type: string, fnName: string) => { + return { + action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) + }; + }, + /** + * @description: 鎿嶄綔瀛楁鑷畾涔夋寜閽� + * @return {*} + */ + ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { + data.map((x) => { + if (x.name == 'goDetail') { + x.onClick = goDetail.bind(null, args[5], params); + x.tooltip = '璇︽儏'; + } + }); + return data; + }, + /** + * @desc 鍒濆鍖栬〃鍗� + */ + GetUseForm: () => { + return { + forminfo: useForm({ + labelWidth: 120, + schemas: woformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + woinfo: useForm({ + labelWidth: 120, + schemas: woCfgformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + prodinfo: useForm({ + labelWidth: 120, + schemas: prodCfgformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + tmpinfo: useForm({ + labelWidth: 120, + schemas: prodCfgformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + }; + }, + /** + * @description: 鑷畾涔夋柟娉� + * @param {string} type + * @param {array} args + * @return {*} + */ + CustFunc: (param: CustModalParams) => { + switch (param.cType) { + case 'BIZ_MES_WO': + case 'BIZ_MES_WO_Config': + return getWoFns[param.FnName](param) as Promise<any>; + // break; + default: + return new Promise((resolve, reject) => { + try { + (e) => {}; + resolve(true); + } catch { + reject(false); + } finally { + // args[0][0]({ confirmLoading: false }); + } + }); + // break; + } + }, + /** + * @description: 鑾峰彇澶氳〃鍗曟彃妲藉垪琛� + * @return {*} + */ + GetDtlSlots: (type: string) => { + let result = [] as any[]; + switch (type) { + case 'BIZ_MES_WO_Config': + result = [ + { name: 'woinfo', slots: [], preIcons: {}, title: '宸ュ崟淇℃伅' }, + { + name: 'prodinfo', + slots: ['addRot', 'setRot'], + preIcons: { addRot: 'search|svg', setRot: 'config|svg' }, + title: '浜у搧淇℃伅', + }, + { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '宸ヨ壓淇℃伅' }, + ]; + break; + case 'BIZ_MES_WO': + result = [ + { + name: 'forminfo', + slots: ['add', 'set'], + preIcons: { add: 'search|svg', set: 'config|svg' }, //濡傛灉鏄涓〃鍗曪紝澧炲姞澶氫釜鎻掓Ы銆俿lots鏄脊鍑烘鎸夐挳鐨勬彃妲斤紝preIcons鏄彃妲藉搴旂殑鎸夐挳鍥炬爣 + title: '涓嬪彂閰嶇疆', + }, + ]; + break; + } + return result; + }, + /** + * @description: 鑾峰彇妯℃�佹搴旂敤鍒楄〃 + * @return {*} + */ + GetUseModals: () => { + return { + useModalData: { + add: useModal(), + set: useModal(), + addRot: useModal(), + setRot: useModal(), + }, + }; + }, + /** + * @description: 鑾峰彇鑷畾涔夋暟鎹� + * @return {*} + */ + GetCustData: () => { + return { + isCustEl: { + forminfo: false, + woinfo: false, + prodinfo: false, + rotinfo: true, + }, + }; + }, + /** + * @description: 寮瑰嚭閫夋嫨妗嗛�夋嫨鎴愬姛杩斿洖鏂规硶 + * @param {*} d + * @param {*} u + * @return {*} + */ + GetSelectSuccess: (d, u) => { + return { + ROUTE_CODE: d.values['val'], + // ID: d.values['id'], + ROT_ID: d.values['id'], + }; + }, + /** + * @description: 鎵撳紑寮瑰嚭閫夋嫨妗� + * @param {Fn} openItemModal + * @param {array} args + * @return {*} + */ + OpenSelectItem: (openItemModal: Fn, ...args) => { + const slotName = args[0]; + const openRvModal = args[1]; + const selectVals = args[2]; + switch (slotName) { + case 'addRot': + case 'add': + openItemModal(true, { + title: '宸ヨ壓璺嚎鍒楄〃', + schemas: [ + { + field: 'ROT_CODE', + component: 'Input', + label: '宸ヨ壓璺嚎缂栫爜', + colProps: { + span: 12, + }, + }, + ], + ItemColumns: [ + { + title: t('宸ヨ壓璺嚎缂栫爜'), + dataIndex: 'ROT_CODE', + resizable: true, + sorter: true, + width: 200, + }, + { + title: t('宸ヨ壓璺嚎鍚嶇О'), + dataIndex: 'ROT_NAME', + resizable: true, + sorter: true, + width: 180, + }, + ], + tableName: 'MES_ROUTE', + rowKey: 'ROT_CODE', + returnFieldName: ['ROUTE_CODE', 'ROT_ID'], //杩斿洖鍊艰璧嬪�肩殑瀛楁鍚嶇О + searchInfo: { TABLE_NAME: 'MES_ROUTE' }, + }); + break; + case 'set': + openRvModal(true, { rotId: selectVals.value['ROUTE_CODE'], slotName: slotName }); + break; + case 'setRot': + break; + } + }, + /** + * @description: 鑾峰彇鏍囬淇℃伅 + * @param {string} type + * @return {*} + */ + GetTitle: () => { + return { + importTitle: '宸ュ崟璁″垝瀵煎叆' /* 鎵撳紑妯℃�佺獥鍙f樉绀虹殑鏍囬 */, + }; + }, + }; + + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 璺宠浆鍒拌鎯呴〉闈㈡柟娉� + * @param {Fn} go + * @return {*} + */ + function goDetail(go: Fn, params: Recordable) { + const id = { + ID: params['record'].ID, + CODE: params['record']['ORDER_NO'], + Name: 'BIZ_U9_RECEIPT_DTL', + firstTabName: '鏀惰揣鍗�(U9)', + secondTabName: '鏀惰揣鍗昐N', //'鏍囩杩囩▼鍙橀噺', + firstTitle: '鏄庣粏', + secondTitle: '', //'杩囩▼鍙橀噺', + Tabs: [ + { + name: '鏀惰揣鍗曟槑缁�', + tableTitle: '鏄庣粏', + entityName: 'BIZ_U9_RECEIPT_DTL', + NeedInclude: true, + key: 'BIZ_U9_RECEIPT_DTL' + }, + { + name: '鏀惰揣鍗昐N', + tableTitle: 'SN', + entityName: 'BIZ_U9_RECEIPT_SN', + NeedInclude: true, + key: 'BIZ_U9_RECEIPT_SN' + } + ], + pageTitle: '鏀惰揣鍗�(U9)璇︽儏', //璇︽儏椤甸潰鏍囬 + contentStr: '杩欓噷鏄敹璐у崟(U9)鏄庣粏绠$悊椤甸潰锛屽彲浠ユ樉绀烘敹璐у崟(U9)鐨勬墍鏈夋壒娆¤鎯�', + detailName: `鏀惰揣鍗昜${params['record'].ORDER_NO}]鎵规璇︽儏`, + keyFieldValues: { ORDER_NO: params['record']['ORDER_NO'] }, + colSlots: params['colSlots'].value, + SessionName: 'BIZ_U9_RECEIPT_DTL_update', + ifSave: false, + }; + // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage + sessionStorage.removeItem(`${id.SessionName}_params`); + sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id))); + go(`/BIZ_U9_RECEIPT_DTL/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`); + } + + + + + const woformSchema: FormSchema[] = [ + { + field: 'PLAN_QTY', + label: '宸ュ崟鏁伴噺', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + dynamicDisabled: ({ values }) => { + return true; + }, + }, + { + field: 'RELEASE_QTY', + label: '宸ュ崟涓嬪彂鏁伴噺', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '瀹為檯浜х嚎', + field: 'ACT_LINE', + component: 'ApiSelect', + required: true, + colProps: { + span: 24, + }, + componentProps: { + api: getEntity, + params: { entityName: 'MES_LINE', sqlcmd: ' 1=1 ', order: '' }, + resultField: 'Data.Items', + labelField: 'LINE_NAME', + valueField: 'LINE_CODE', + }, + }, + { + field: 'IfToCust', + component: 'Switch', + label: '鏄惁淇濆瓨宸ヨ壓璺嚎鍒板鎴�', + defaultValue: true, + colProps: { + span: 8, + }, + labelWidth: 200, + }, + // { + // label: '宸ヨ壓璺嚎', + // field: 'ROUTE_CODE', + // component: 'Input', + // required: true, + // colProps: { + // span: 22, + // }, + // }, + // { + // field: 'add', + // component: 'Input', + // label: '1', + // colSlot: 'add', + // defaultValue: 'MES_ROUTE', + // colProps: { + // span: 1, + // }, + // }, + // { + // field: 'set', + // component: 'Input', + // label: '1', + // colSlot: 'set', + // defaultValue: 'MES_ROUTE', + // colProps: { + // span: 1, + // }, + // }, + ]; + + const woCfgformSchema: FormSchema[] = [ + { + field: 'ORDER_NO', + component: 'Input', + label: '宸ュ崟鍙�', + colProps: { + span: 8, + }, + componentProps: { + placeholder: '璇疯緭鍏ュ伐鍗曞彿', + onChange: (e: any) => { + console.log(e); + }, + }, + dynamicDisabled: true, + }, + { + field: 'ORDER_TYPE', + component: 'ApiSelect', + label: '宸ュ崟绫诲瀷', + colProps: { + span: 8, + }, + defaultValue: 0, + componentProps: { + api: GetEnum, + params: { name: 'BIZ_MES_WO+ORDER_TYPEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + placeholder: '璇烽�夋嫨宸ュ崟绫诲瀷', + }, + dynamicDisabled: true, + }, + { + field: 'PLAN_QTY', + component: 'Input', + label: '璁″垝鏁伴噺', + colProps: { + span: 8, + }, + dynamicDisabled: true, + }, + ]; + + const prodCfgformSchema: FormSchema[] = [ + { + field: 'ITEM_CODE', + component: 'Input', + label: '鐗╂枡缂栫爜', + required: true, + colProps: { + span: 12, + }, + componentProps: { + placeholder: '璇疯緭鍏ョ墿鏂欑紪鐮�', + onChange: (e: any) => { + console.log(e); + }, + }, + dynamicDisabled: true, + }, + { + field: 'ITEM_TYPE', + component: 'Input', + label: '鐗╂枡绫诲瀷', + colProps: { + span: 12, + }, + }, + { + label: '宸ヨ壓璺嚎', + field: 'ROUTE_CODE', + component: 'Input', + required: true, + colProps: { + span: 12, + }, + }, + { + field: 'addRot', + component: 'Input', + label: '1', + colSlot: 'addRot', + defaultValue: 'MES_ROUTE', + colProps: { + span: 1, + }, + }, + { + field: 'setRot', + component: 'Input', + label: '1', + colSlot: 'setRot', + defaultValue: 'MES_ROUTE', + colProps: { + span: 1, + }, + }, + { + label: '宸ヨ壓璺嚎', + field: 'ROT_ID', + component: 'Input', + show: false, + colProps: { + span: 12, + }, + }, + // { + // field: 'fieldsc', + // component: 'Upload', + // label: '鎵撳嵃妯℃澘', + // colProps: { + // span: 10, + // }, + // rules: [{ required: true, message: '璇烽�夋嫨涓婁紶鏂囦欢' }], + // componentProps: { + // api: uploadApi, + // multiple: false, + // }, + // }, + ]; + + return [methods, ActionColumn]; +} + +export default _default; diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RECEIPT_DTL.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RECEIPT_DTL.ts new file mode 100644 index 0000000..f2fe492 --- /dev/null +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RECEIPT_DTL.ts @@ -0,0 +1,522 @@ +/* + * @Description: 鏀惰揣鍗�(U9)鏄庣粏 + * @Author: 鏉ㄤ簯鍒� + * @version: + * @Date: 2024-06-19 20:34:27 + * @LastEditors: 鏉ㄤ簯鍒� + * @LastEditTime: 2024-09-29 21:28:37 + */ + +import { Tag, Tooltip } from 'ant-design-vue'; +import { ActionItem, BasicColumn } from '/@/components/Table'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { h } from 'vue'; +import { useModal } from '/@/components/Modal'; +import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; +import { useForm } from '/@/components/Form'; + +const { t } = useI18n(); + +function _default() { + const ActionColumn: BasicColumn = { + width: 180, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }; + + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ + const methods = { + /** + * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓猴紝蹇呴渶瑕佹湁鐨勬柟娉� + * @return {*} + */ + CreateAction: (type: string) => { + return { + action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) + }; + }, + /** + * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽紝蹇呴渶瑕佹湁鐨勬柟娉� + * @return {*} + */ + ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { + data.map((x) => { + // if (x.name == 'handlePause') { + // x.onClick = handlePause.bind(null, args, params); + // x.color = 'error'; + // x.tooltip = '鏆傚仠'; + // } + // if (x.name == 'handleStart') { + // x.onClick = handleStart.bind(null, args, params); + // x.tooltip = '鍙栨秷鏆傚仠'; + // } + // if (x.name == 'handleRelease') { + // x.onClick = handleRelease.bind(null, args, params); + // x.tooltip = '涓嬪彂'; + // } + // if (x.name == 'handleUnRelease') { + // x.onClick = handleUnRelease.bind(null, args, params); + // x.tooltip = '鍙栨秷涓嬪彂'; + // } + }); + return data; + }, + /** + * @description: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl + * @return {*} + */ + GetHomeUrl: (params: {}) => { + return `/BIZ_U9_RECEIPT/LC/${encodeURI(JSON.stringify({ ID: 'BIZ_U9_RECEIPT', EntityName: 'BIZ_U9_RECEIPT', colSlots: params['colSlots'], crudColSlots: [] }))}`; + }, + GetBaseColumns: (type: string) => { + switch (type) { + case 'BIZ_U9_RECEIPT_DTL': + return [ + { + dataIndex: 'ORDER_NO', + title: '鍗曟嵁鍙�', + // ifShow: false, + sorter: true, + resizable: true, + }, + { + dataIndex: 'LINE_NO', + title: '鍗曟嵁琛屽彿', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'STATUS', + title: '鐘舵��', + ifShow: true, + sorter: true, + resizable: true, + customRender: ({ record }) => { + let color = ''; + let text = ''; + switch ( + record.STATUS //鐘舵��(0Init鍒濆鍖東1Imported宸插鍏2Release宸蹭笅鍙憒3Working鐢熶骇涓瓅4Paused宸叉殏鍋渱5Closed宸插叧闂�) + ) { + case 0: + text = '鍒濆鍖�'; + color = '#8a8a8a'; + break; + case 1: + text = '宸插鍏�'; + color = 'blue'; + break; + case 2: + text = '宸查�佽揪'; + color = 'green'; + break; + case 3: + text = '娓呯偣涓�'; + color = 'orange'; + break; + case 4: + text = '涓婃灦涓�'; + color = 'red'; + break; + case 5: + text = '寰呭鏍�'; + color = '#e1822c'; + break; + case 6: + text = '宸插畬鎴�'; + color = '#009966'; + break; + case 7: + text = '宸蹭綔搴�'; + color = '#CCCCCC'; + break; + } + return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); + }, + }, + { + dataIndex: 'ITEM_CODE', + title: '鐗╂枡缂栫爜', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'UNIT', + title: '鍗曚綅', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY', + title: '鍗曟嵁鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_PACKING', + title: '鍖呰鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_IN', + title: '鍏ュ簱鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_OK', + title: '鑹搧鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_NG', + title: '涓嶈壇鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_SCRAP', + title: '鎶ュ簾鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'LOTNO', + title: '鎵规鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'ASN_ID', + title: '閫佽揣鍗旾D', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'ASN_LINE', + title: '閫佽揣鍗曡鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IQC_ORDER', + title: '閫佹鍗曞彿', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'REMARK', + title: '澶囨敞', + ifShow: true, + sorter: true, + resizable: true, + }, + ]; + case 'BIZ_U9_RECEIPT_SN': + return [ + { + dataIndex: 'ORDER_NO', + title: '鍗曟嵁鍙�', + sorter: true, + resizable: true, + }, + { + dataIndex: 'LINE_NO', + title: '鍗曟嵁琛屽彿', + sorter: true, + resizable: true, + }, + { + dataIndex: 'SN', + title: '鏉$爜', + sorter: true, + resizable: true, + }, + { + dataIndex: 'META_SN', + title: '鍏冩潯鐮�', + sorter: true, + resizable: true, + }, + { + dataIndex: 'ITEM_CODE', + title: '鐗╂枡缂栫爜', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'STATUS', + title: '鐘舵��', + ifShow: true, + sorter: true, + resizable: true, + customRender: ({ record }) => { + let color = ''; + let text = ''; + switch ( + record.STATUS //鐘舵��(0Init鍒濆鍖東1Imported宸插鍏2Release宸蹭笅鍙憒3Working鐢熶骇涓瓅4Paused宸叉殏鍋渱5Closed宸插叧闂�) + ) { + case 0: + text = '鍒濆鍖�'; + color = '#8a8a8a'; + break; + case 1: + text = '宸插鍏�'; + color = 'blue'; + break; + case 2: + text = '宸查�佽揪'; + color = 'green'; + break; + case 3: + text = '娓呯偣涓�'; + color = 'orange'; + break; + case 4: + text = '涓婃灦涓�'; + color = 'red'; + break; + case 5: + text = '寰呭鏍�'; + color = '#e1822c'; + break; + case 6: + text = '宸插畬鎴�'; + color = '#009966'; + break; + case 7: + text = '宸蹭綔搴�'; + color = '#CCCCCC'; + break; + } + return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); + }, + + }, + { + dataIndex: 'ITEM_CODE', + title: '鐗╂枡缂栫爜', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY', + title: '鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'UNIT', + title: '鍗曚綅', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_OK', + title: '鏄惁鑹搧(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_IN', + title: '鏄惁鍏ュ簱(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_SCRAP', + title: '鏄惁鎶ュ簾(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'LOTNO', + title: '鎵规鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'CARTON_NO', + title: '绠卞彿', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'PALLET_NO', + title: '鏍堟澘鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'REMARK', + title: '澶囨敞', + ifShow: true, + sorter: true, + resizable: true, + }, + + ]; + } + }, + GetSearchForm: (type: string) => { + switch (type) { + case 'BIZ_U9_RECEIPT_DTL': + return [ + { + field: 'ORDER_NO', + label: t('鍗曟嵁鍙�'), + colProps: { span: 8 }, + component: 'Input', + }, + ]; + case 'BIZ_U9_RECEIPT_SN': + return [ + { + field: 'ORDER_NO', + label: t('鍗曟嵁鍙�'), + colProps: { span: 8 }, + component: 'Input', + }, + ]; + }; + }, + GetCrudForm: () => { + return []; + }, + KeyFieldValues: (val: string, id: string) => { + return { ORDER_NO: val }; + }, + GetUseForm: () => { + return { + forminfo: useForm({ + labelWidth: 120, + schemas: [], //woformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + }; + }, + /** + * @description: 鑷畾涔夋柟娉� + * @param {string} type + * @param {array} args + * @return {*} + */ + CustFunc: (param: CustModalParams) => { + // switch (param.cType) { + // case 'BIZ_U9_ASN_DTL': + // return getWoFns[param.FnName](param) as Promise<any>; + // break; + // default: + // return new Promise((resolve, reject) => { + // try { + // (e) => {}; + // resolve(true); + // } catch { + // reject(false); + // } finally { + // // args[0][0]({ confirmLoading: false }); + // } + // }); + // // break; + // } + }, + /** + * @description: 鑾峰彇澶氳〃鍗曟彃妲藉垪琛� + * @return {*} + */ + GetDtlSlots: (type: string) => { + let result = [] as any[]; + switch (type) { + case 'BIZ_MES_WO_BATCH': + result = [ + { + name: 'forminfo', + slots: ['add', 'set'], + preIcons: { add: 'search|svg', set: 'config|svg' }, //濡傛灉鏄涓〃鍗曪紝澧炲姞澶氫釜鎻掓Ы銆俿lots鏄脊鍑烘鎸夐挳鐨勬彃妲斤紝preIcons鏄彃妲藉搴旂殑鎸夐挳鍥炬爣 + title: '涓嬪彂閰嶇疆', + }, + ]; + break; + } + return result; + }, + /** + * @description: 鑾峰彇妯℃�佹搴旂敤鍒楄〃 + * @return {*} + */ + GetUseModals: () => { + return { + useModalData: { + add: useModal(), + set: useModal(), + addRot: useModal(), + setRot: useModal(), + }, + }; + }, + /** + * @description: 寮瑰嚭閫夋嫨妗嗛�夋嫨鎴愬姛杩斿洖鏂规硶 + * @param {*} d + * @param {*} u + * @return {*} + */ + GetSelectSuccess: (d, u) => { + return { + ROUTE_CODE: d.values['val'], + // ID: d.values['id'], + ROT_ID: d.values['id'], + }; + }, + /** + * @description: 鎵撳紑寮瑰嚭閫夋嫨妗� + * @param {Fn} openItemModal + * @param {array} args + * @return {*} + */ + OpenSelectItem: (openItemModal: Fn, ...args) => { + const slotName = args[0]; + switch (slotName) { + case 'addRot': + break; + } + }, + }; + + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + return [methods, ActionColumn]; +} + +export default _default; diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RETURN.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RETURN.ts new file mode 100644 index 0000000..559bb37 --- /dev/null +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RETURN.ts @@ -0,0 +1,523 @@ +/* + * @Description: 閫�璐у崟(U9) + * @Author: 鏉ㄤ簯鍒� + * @version: + * @Date: 2024-06-19 20:34:27 + * @LastEditors: 鏉ㄤ簯鍒� + * @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 { 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 { 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 = { + width: 180, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }; + /** + * @description: 宸ュ崟绠$悊鐨勪竴浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ + const methods = { + /** + * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓� + * @return {*} + */ + CreateAction: (type: string, fnName: string) => { + return { + action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) + }; + }, + /** + * @description: 鎿嶄綔瀛楁鑷畾涔夋寜閽� + * @return {*} + */ + ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { + data.map((x) => { + if (x.name == 'goDetail') { + x.onClick = goDetail.bind(null, args[5], params); + x.tooltip = '鍗曟嵁鍙�'; + } + }); + return data; + }, + /** + * @desc 鍒濆鍖栬〃鍗� + */ + GetUseForm: () => { + return { + forminfo: useForm({ + labelWidth: 120, + schemas: woformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + woinfo: useForm({ + labelWidth: 120, + schemas: woCfgformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + prodinfo: useForm({ + labelWidth: 120, + schemas: prodCfgformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + tmpinfo: useForm({ + labelWidth: 120, + schemas: prodCfgformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + }; + }, + /** + * @description: 鑷畾涔夋柟娉� + * @param {string} type + * @param {array} args + * @return {*} + */ + CustFunc: (param: CustModalParams) => { + switch (param.cType) { + case 'BIZ_MES_WO': + case 'BIZ_MES_WO_Config': + return getWoFns[param.FnName](param) as Promise<any>; + // break; + default: + return new Promise((resolve, reject) => { + try { + (e) => {}; + resolve(true); + } catch { + reject(false); + } finally { + // args[0][0]({ confirmLoading: false }); + } + }); + // break; + } + }, + /** + * @description: 鑾峰彇澶氳〃鍗曟彃妲藉垪琛� + * @return {*} + */ + GetDtlSlots: (type: string) => { + let result = [] as any[]; + switch (type) { + case 'BIZ_MES_WO_Config': + result = [ + { name: 'woinfo', slots: [], preIcons: {}, title: '宸ュ崟淇℃伅' }, + { + name: 'prodinfo', + slots: ['addRot', 'setRot'], + preIcons: { addRot: 'search|svg', setRot: 'config|svg' }, + title: '浜у搧淇℃伅', + }, + { name: 'rotinfo', slots: ['add'], preIcons: { add: 'search|svg' }, title: '宸ヨ壓淇℃伅' }, + ]; + break; + case 'BIZ_MES_WO': + result = [ + { + name: 'forminfo', + slots: ['add', 'set'], + preIcons: { add: 'search|svg', set: 'config|svg' }, //濡傛灉鏄涓〃鍗曪紝澧炲姞澶氫釜鎻掓Ы銆俿lots鏄脊鍑烘鎸夐挳鐨勬彃妲斤紝preIcons鏄彃妲藉搴旂殑鎸夐挳鍥炬爣 + title: '涓嬪彂閰嶇疆', + }, + ]; + break; + } + return result; + }, + /** + * @description: 鑾峰彇妯℃�佹搴旂敤鍒楄〃 + * @return {*} + */ + GetUseModals: () => { + return { + useModalData: { + add: useModal(), + set: useModal(), + addRot: useModal(), + setRot: useModal(), + }, + }; + }, + /** + * @description: 鑾峰彇鑷畾涔夋暟鎹� + * @return {*} + */ + GetCustData: () => { + return { + isCustEl: { + forminfo: false, + woinfo: false, + prodinfo: false, + rotinfo: true, + }, + }; + }, + /** + * @description: 寮瑰嚭閫夋嫨妗嗛�夋嫨鎴愬姛杩斿洖鏂规硶 + * @param {*} d + * @param {*} u + * @return {*} + */ + GetSelectSuccess: (d, u) => { + return { + ROUTE_CODE: d.values['val'], + // ID: d.values['id'], + ROT_ID: d.values['id'], + }; + }, + /** + * @description: 鎵撳紑寮瑰嚭閫夋嫨妗� + * @param {Fn} openItemModal + * @param {array} args + * @return {*} + */ + OpenSelectItem: (openItemModal: Fn, ...args) => { + const slotName = args[0]; + const openRvModal = args[1]; + const selectVals = args[2]; + switch (slotName) { + case 'addRot': + case 'add': + openItemModal(true, { + title: '宸ヨ壓璺嚎鍒楄〃', + schemas: [ + { + field: 'ROT_CODE', + component: 'Input', + label: '宸ヨ壓璺嚎缂栫爜', + colProps: { + span: 12, + }, + }, + ], + ItemColumns: [ + { + title: t('宸ヨ壓璺嚎缂栫爜'), + dataIndex: 'ROT_CODE', + resizable: true, + sorter: true, + width: 200, + }, + { + title: t('宸ヨ壓璺嚎鍚嶇О'), + dataIndex: 'ROT_NAME', + resizable: true, + sorter: true, + width: 180, + }, + ], + tableName: 'MES_ROUTE', + rowKey: 'ROT_CODE', + returnFieldName: ['ROUTE_CODE', 'ROT_ID'], //杩斿洖鍊艰璧嬪�肩殑瀛楁鍚嶇О + searchInfo: { TABLE_NAME: 'MES_ROUTE' }, + }); + break; + case 'set': + openRvModal(true, { rotId: selectVals.value['ROUTE_CODE'], slotName: slotName }); + break; + case 'setRot': + break; + } + }, + /** + * @description: 鑾峰彇鏍囬淇℃伅 + * @param {string} type + * @return {*} + */ + GetTitle: () => { + return { + importTitle: '宸ュ崟璁″垝瀵煎叆' /* 鎵撳紑妯℃�佺獥鍙f樉绀虹殑鏍囬 */, + }; + }, + }; + + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + /** + * @description: 璺宠浆鍒拌鎯呴〉闈㈡柟娉� + * @param {Fn} go + * @return {*} + */ + function goDetail(go: Fn, params: Recordable) { + const id = { + ID: params['record'].ID, + CODE: params['record']['ORDER_NO'], + Name: 'BIZ_U9_RETURN_DTL', + firstTabName: '閫�璐у崟(U9)', + secondTabName: '閫�璐у崟SN', //'鏍囩杩囩▼鍙橀噺', + firstTitle: '鏄庣粏', + secondTitle: '', //'杩囩▼鍙橀噺', + Tabs: [ + { + name: '閫�璐у崟鏄庣粏', + tableTitle: '鏄庣粏', + entityName: 'BIZ_U9_RETURN_DTL', + NeedInclude: true, + key: 'BIZ_U9_RETURN_DTL' + }, + { + name: '閫�璐у崟SN', + tableTitle: 'SN', + entityName: 'BIZ_U9_RETURN_SN', + NeedInclude: true, + key: 'BIZ_U9_RETURN_SN' + } + ], + pageTitle: '閫�璐у崟(U9)璇︽儏', //璇︽儏椤甸潰鏍囬 + contentStr: '杩欓噷鏄��璐у崟(U9)鏄庣粏绠$悊椤甸潰锛屽彲浠ユ樉绀洪��璐у崟(U9)鐨勬墍鏈夋壒娆¤鎯�', + detailName: `閫�璐у崟[${params['record'].ORDER_NO}]鎵规璇︽儏`, + keyFieldValues: { ORDER_NO: params['record']['ORDER_NO'] }, + colSlots: params['colSlots'].value, + SessionName: 'BIZ_U9_RETURN_DTL_update', + ifSave: false, + }; + // 灏嗗璞¤浆鎹负JSON瀛楃涓插苟淇濆瓨鍒皊essionStorage + sessionStorage.removeItem(`${id.SessionName}_params`); + sessionStorage.setItem(`${id.SessionName}_params`, encodeURI(JSON.stringify(id))); + go(`/BIZ_U9_RETURN_DTL/${encodeURI(JSON.stringify({ sName: id.SessionName, Name: id.Name }))}`); + } + + + + + const woformSchema: FormSchema[] = [ + { + field: 'PLAN_QTY', + label: '宸ュ崟鏁伴噺', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + dynamicDisabled: ({ values }) => { + return true; + }, + }, + { + field: 'RELEASE_QTY', + label: '宸ュ崟涓嬪彂鏁伴噺', + component: 'Input', + required: true, + colProps: { + span: 24, + }, + }, + { + label: '瀹為檯浜х嚎', + field: 'ACT_LINE', + component: 'ApiSelect', + required: true, + colProps: { + span: 24, + }, + componentProps: { + api: getEntity, + params: { entityName: 'MES_LINE', sqlcmd: ' 1=1 ', order: '' }, + resultField: 'Data.Items', + labelField: 'LINE_NAME', + valueField: 'LINE_CODE', + }, + }, + { + field: 'IfToCust', + component: 'Switch', + label: '鏄惁淇濆瓨宸ヨ壓璺嚎鍒板鎴�', + defaultValue: true, + colProps: { + span: 8, + }, + labelWidth: 200, + }, + // { + // label: '宸ヨ壓璺嚎', + // field: 'ROUTE_CODE', + // component: 'Input', + // required: true, + // colProps: { + // span: 22, + // }, + // }, + // { + // field: 'add', + // component: 'Input', + // label: '1', + // colSlot: 'add', + // defaultValue: 'MES_ROUTE', + // colProps: { + // span: 1, + // }, + // }, + // { + // field: 'set', + // component: 'Input', + // label: '1', + // colSlot: 'set', + // defaultValue: 'MES_ROUTE', + // colProps: { + // span: 1, + // }, + // }, + ]; + + const woCfgformSchema: FormSchema[] = [ + { + field: 'ORDER_NO', + component: 'Input', + label: '宸ュ崟鍙�', + colProps: { + span: 8, + }, + componentProps: { + placeholder: '璇疯緭鍏ュ伐鍗曞彿', + onChange: (e: any) => { + console.log(e); + }, + }, + dynamicDisabled: true, + }, + { + field: 'ORDER_TYPE', + component: 'ApiSelect', + label: '宸ュ崟绫诲瀷', + colProps: { + span: 8, + }, + defaultValue: 0, + componentProps: { + api: GetEnum, + params: { name: 'BIZ_MES_WO+ORDER_TYPEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + placeholder: '璇烽�夋嫨宸ュ崟绫诲瀷', + }, + dynamicDisabled: true, + }, + { + field: 'PLAN_QTY', + component: 'Input', + label: '璁″垝鏁伴噺', + colProps: { + span: 8, + }, + dynamicDisabled: true, + }, + ]; + + const prodCfgformSchema: FormSchema[] = [ + { + field: 'ITEM_CODE', + component: 'Input', + label: '鐗╂枡缂栫爜', + required: true, + colProps: { + span: 12, + }, + componentProps: { + placeholder: '璇疯緭鍏ョ墿鏂欑紪鐮�', + onChange: (e: any) => { + console.log(e); + }, + }, + dynamicDisabled: true, + }, + { + field: 'ITEM_TYPE', + component: 'Input', + label: '鐗╂枡绫诲瀷', + colProps: { + span: 12, + }, + }, + { + label: '宸ヨ壓璺嚎', + field: 'ROUTE_CODE', + component: 'Input', + required: true, + colProps: { + span: 12, + }, + }, + { + field: 'addRot', + component: 'Input', + label: '1', + colSlot: 'addRot', + defaultValue: 'MES_ROUTE', + colProps: { + span: 1, + }, + }, + { + field: 'setRot', + component: 'Input', + label: '1', + colSlot: 'setRot', + defaultValue: 'MES_ROUTE', + colProps: { + span: 1, + }, + }, + { + label: '宸ヨ壓璺嚎', + field: 'ROT_ID', + component: 'Input', + show: false, + colProps: { + span: 12, + }, + }, + // { + // field: 'fieldsc', + // component: 'Upload', + // label: '鎵撳嵃妯℃澘', + // colProps: { + // span: 10, + // }, + // rules: [{ required: true, message: '璇烽�夋嫨涓婁紶鏂囦欢' }], + // componentProps: { + // api: uploadApi, + // multiple: false, + // }, + // }, + ]; + + return [methods, ActionColumn]; +} + +export default _default; diff --git a/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RETURN_DTL.ts b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RETURN_DTL.ts new file mode 100644 index 0000000..3145403 --- /dev/null +++ b/src/views/tigerprojects/system/lowcode/entityts/BIZ_U9_RETURN_DTL.ts @@ -0,0 +1,524 @@ +/* + * @Description: 閫�璐у崟(U9)鏄庣粏 + * @Author: 鏉ㄤ簯鍒� + * @version: + * @Date: 2024-06-19 20:34:27 + * @LastEditors: 鏉ㄤ簯鍒� + * @LastEditTime: 2024-09-29 21:28:37 + */ + +import { Tag, Tooltip } from 'ant-design-vue'; +import { ActionItem, BasicColumn } from '/@/components/Table'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { h } from 'vue'; +import { useModal } from '/@/components/Modal'; +import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; +import { useForm } from '/@/components/Form'; + +const { t } = useI18n(); + +function _default() { + const ActionColumn: BasicColumn = { + width: 180, + title: '鎿嶄綔', + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }; + + /** + * @description: 涓�浜涜嚜瀹氫箟鏂规硶 + * @return {*} + */ + const methods = { + /** + * @description: 鑾峰彇鏂板鎸夐挳鐨勮涓猴紝蹇呴渶瑕佹湁鐨勬柟娉� + * @return {*} + */ + CreateAction: (type: string) => { + return { + action: 'drawer', //drawer(鎵撳紑宸︿晶鎶藉眽妗�) | go(璺宠浆鍒版柊鐨勯〉闈�) + }; + }, + /** + * @description: 浜у搧缁戝畾宸ヨ壓璺嚎鎿嶄綔瀛楁鑷畾涔夋寜閽紝蹇呴渶瑕佹湁鐨勬柟娉� + * @return {*} + */ + ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { + data.map((x) => { + // if (x.name == 'handlePause') { + // x.onClick = handlePause.bind(null, args, params); + // x.color = 'error'; + // x.tooltip = '鏆傚仠'; + // } + // if (x.name == 'handleStart') { + // x.onClick = handleStart.bind(null, args, params); + // x.tooltip = '鍙栨秷鏆傚仠'; + // } + // if (x.name == 'handleRelease') { + // x.onClick = handleRelease.bind(null, args, params); + // x.tooltip = '涓嬪彂'; + // } + // if (x.name == 'handleUnRelease') { + // x.onClick = handleUnRelease.bind(null, args, params); + // x.tooltip = '鍙栨秷涓嬪彂'; + // } + }); + return data; + }, + /** + * @description: 楂樼骇琛ㄥ崟鍜岃鎯呴〉闈㈣繑鍥炰富椤甸潰鐨剈rl + * @return {*} + */ + GetHomeUrl: (params: {}) => { + return `/BIZ_U9_RETURN/LC/${encodeURI(JSON.stringify({ ID: 'BIZ_U9_RETURN', EntityName: 'BIZ_U9_RETURN', colSlots: params['colSlots'], crudColSlots: [] }))}`; + }, + GetBaseColumns: (type: string) => { + switch (type) { + case 'BIZ_U9_RETURN_DTL': + return [ + { + dataIndex: 'ORDER_NO', + title: '鍗曟嵁鍙�', + // ifShow: false, + sorter: true, + resizable: true, + }, + { + dataIndex: 'LINE_NO', + title: '鍗曟嵁琛屽彿', + ifShow: true, + sorter: true, + resizable: true, + customRender: () => {}, + }, + { + dataIndex: 'STATUS', + title: '鐘舵��', + ifShow: true, + sorter: true, + resizable: true, + customRender: ({ record }) => { + let color = ''; + let text = ''; + switch ( + record.STATUS //鐘舵��(0Init鍒濆鍖東1Imported宸插鍏2Release宸蹭笅鍙憒3Working鐢熶骇涓瓅4Paused宸叉殏鍋渱5Closed宸插叧闂�) + ) { + case 0: + text = '鍒濆鍖�'; + color = '#8a8a8a'; + break; + case 1: + text = '宸插鍏�'; + color = 'blue'; + break; + case 2: + text = '宸查�佽揪'; + color = 'green'; + break; + case 3: + text = '娓呯偣涓�'; + color = 'orange'; + break; + case 4: + text = '涓婃灦涓�'; + color = 'red'; + break; + case 5: + text = '寰呭鏍�'; + color = '#e1822c'; + break; + case 6: + text = '宸插畬鎴�'; + color = '#009966'; + break; + case 7: + text = '宸蹭綔搴�'; + color = '#CCCCCC'; + break; + } + return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); + }, + }, + { + dataIndex: 'ITEM_CODE', + title: '鐗╂枡缂栫爜', + ifShow: true, + sorter: true, + resizable: true, + customRender: () => {}, + }, + { + dataIndex: 'UNIT', + title: '鍗曚綅', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY', + title: '鍗曟嵁鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_PACKING', + title: '鍖呰鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_IN', + title: '鍏ュ簱鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_OK', + title: '鑹搧鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_NG', + title: '涓嶈壇鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'QTY_SCRAP', + title: '鎶ュ簾鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'LOTNO', + title: '鎵规鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'PO_NO', + title: '閲囪喘鍗曞彿', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'PO_LINE', + title: '閲囪喘鍗曡鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IQC_NO', + title: '閫佹鍗曞彿', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'REMARK', + title: '澶囨敞', + ifShow: true, + sorter: true, + resizable: true, + }, + + ]; + case 'BIZ_U9_RETURN_SN': + return [ + { + dataIndex: 'ORDER_NO', + title: '鍗曟嵁鍙�', + sorter: true, + resizable: true, + }, + { + dataIndex: 'LINE_NO', + title: '鍗曟嵁琛屽彿', + sorter: true, + resizable: true, + }, + { + dataIndex: 'SN', + title: '鏉$爜', + sorter: true, + resizable: true, + }, + { + dataIndex: 'META_SN', + title: '鍏冩潯鐮�', + sorter: true, + resizable: true, + }, + { + dataIndex: 'ITEM_CODE', + title: '鐗╂枡缂栫爜', + ifShow: true, + sorter: true, + resizable: true, + customRender: () => {}, + }, + { + dataIndex: 'STATUS', + title: '鐘舵��', + ifShow: true, + sorter: true, + resizable: true, + customRender: ({ record }) => { + let color = ''; + let text = ''; + switch ( + record.STATUS //鐘舵��(0Init鍒濆鍖東1Imported宸插鍏2Release宸蹭笅鍙憒3Working鐢熶骇涓瓅4Paused宸叉殏鍋渱5Closed宸插叧闂�) + ) { + case 0: + text = '鍒濆鍖�'; + color = '#8a8a8a'; + break; + case 1: + text = '宸插鍏�'; + color = 'blue'; + break; + case 2: + text = '宸查�佽揪'; + color = 'green'; + break; + case 3: + text = '娓呯偣涓�'; + color = 'orange'; + break; + case 4: + text = '涓婃灦涓�'; + color = 'red'; + break; + case 5: + text = '寰呭鏍�'; + color = '#e1822c'; + break; + case 6: + text = '宸插畬鎴�'; + color = '#009966'; + break; + case 7: + text = '宸蹭綔搴�'; + color = '#CCCCCC'; + break; + } + return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); + }, + }, + { + dataIndex: 'QTY', + title: '鏁伴噺', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'UNIT', + title: '鍗曚綅', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_GIFT', + title: '鏄惁璧犲搧(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_OK', + title: '鏄惁鑹搧(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_IN', + title: '鏄惁鍏ュ簱(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'IS_RETURN', + title: '鏄惁閫�璐�(Y/N)', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'LOTNO', + title: '鎵规鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'CARTON_NO', + title: '绠卞彿', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'PALLET_NO', + title: '鏍堟澘鍙�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'REMARK', + title: '澶囨敞', + ifShow: true, + sorter: true, + resizable: true, + }, + ]; + } + }, + GetSearchForm: (type: string) => { + switch (type) { + case 'BIZ_U9_RETURN_DTL': + return [ + { + field: 'ORDER_NO', + label: t('鍗曟嵁鍙�'), + colProps: { span: 8 }, + component: 'Input', + }, + ]; + case 'BIZ_U9_RETURN_SN': + return [ + { + field: 'ORDER_NO', + label: t('鍗曟嵁鍙�'), + colProps: { span: 8 }, + component: 'Input', + }, + ]; + }; + }, + GetCrudForm: () => { + return []; + }, + KeyFieldValues: (val: string, id: string) => { + return { ORDER_NO: val }; + }, + GetUseForm: () => { + return { + forminfo: useForm({ + labelWidth: 120, + schemas: [], //woformSchema, + actionColOptions: { + span: 24, + }, + showActionButtonGroup: false, + }), + }; + }, + /** + * @description: 鑷畾涔夋柟娉� + * @param {string} type + * @param {array} args + * @return {*} + */ + CustFunc: (param: CustModalParams) => { + // switch (param.cType) { + // case 'BIZ_U9_ASN_DTL': + // return getWoFns[param.FnName](param) as Promise<any>; + // break; + // default: + // return new Promise((resolve, reject) => { + // try { + // (e) => {}; + // resolve(true); + // } catch { + // reject(false); + // } finally { + // // args[0][0]({ confirmLoading: false }); + // } + // }); + // // break; + // } + }, + /** + * @description: 鑾峰彇澶氳〃鍗曟彃妲藉垪琛� + * @return {*} + */ + GetDtlSlots: (type: string) => { + let result = [] as any[]; + switch (type) { + case 'BIZ_MES_WO_BATCH': + result = [ + { + name: 'forminfo', + slots: ['add', 'set'], + preIcons: { add: 'search|svg', set: 'config|svg' }, //濡傛灉鏄涓〃鍗曪紝澧炲姞澶氫釜鎻掓Ы銆俿lots鏄脊鍑烘鎸夐挳鐨勬彃妲斤紝preIcons鏄彃妲藉搴旂殑鎸夐挳鍥炬爣 + title: '涓嬪彂閰嶇疆', + }, + ]; + break; + } + return result; + }, + /** + * @description: 鑾峰彇妯℃�佹搴旂敤鍒楄〃 + * @return {*} + */ + GetUseModals: () => { + return { + useModalData: { + add: useModal(), + set: useModal(), + addRot: useModal(), + setRot: useModal(), + }, + }; + }, + /** + * @description: 寮瑰嚭閫夋嫨妗嗛�夋嫨鎴愬姛杩斿洖鏂规硶 + * @param {*} d + * @param {*} u + * @return {*} + */ + GetSelectSuccess: (d, u) => { + return { + ROUTE_CODE: d.values['val'], + // ID: d.values['id'], + ROT_ID: d.values['id'], + }; + }, + /** + * @description: 鎵撳紑寮瑰嚭閫夋嫨妗� + * @param {Fn} openItemModal + * @param {array} args + * @return {*} + */ + OpenSelectItem: (openItemModal: Fn, ...args) => { + const slotName = args[0]; + switch (slotName) { + case 'addRot': + break; + } + }, + }; + + /* 浠ヤ笅鏄唴閮ㄦ柟娉曪紝涓峞xport锛屼緵涓婇潰鐨勬柟娉曡皟鐢� */ + + return [methods, ActionColumn]; +} + +export default _default; -- Gitblit v1.9.3