From c9f779c19d920efcca14fd17bbcca8254f92790d Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期四, 22 八月 2024 10:22:40 +0800 Subject: [PATCH] 绑定工艺更新 --- src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue | 179 ++++++++++++++++++++++++++++------------------------------- 1 files changed, 85 insertions(+), 94 deletions(-) diff --git a/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue b/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue index f401942..b252f3c 100644 --- a/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue +++ b/src/views/tigerprojects/mes/prod/biz_mes_wo/index.vue @@ -4,7 +4,7 @@ * @version: * @Date: 2024-05-25 00:27:00 * @LastEditors: Ben Lin - * @LastEditTime: 2024-07-03 20:51:05 + * @LastEditTime: 2024-07-21 18:07:27 --> <template> <div> @@ -32,6 +32,7 @@ icon: 'clarity:note-edit-line', tooltip: '淇敼', onClick: handleEdit.bind(null, record), + name: undefined }, { icon: 'ant-design:delete-outlined', @@ -42,27 +43,30 @@ placement: 'left', confirm: handleDelete.bind(null, record), }, + name: undefined }, { icon: 'config|svg', tooltip: '閰嶇疆宸ヨ壓', onClick: handleConfig.bind(null, record), + name: undefined }, { icon: 'release|svg', tooltip: '涓嬪彂', onClick: handleRelease.bind(null, record), + name: undefined }, - { - icon: 'unrelease|svg', - tooltip: '鍙栨秷涓嬪彂', - onClick: handleUnRelease.bind(null, record), - }, - { - icon: 'suspend-blue|svg', - tooltip: '鏆傚仠', - onClick: handlePause.bind(null, record), - }, + // { + // icon: 'unrelease|svg', + // tooltip: '鍙栨秷涓嬪彂', + // onClick: handleUnRelease.bind(null, record), + // }, + // { + // icon: 'suspend-blue|svg', + // tooltip: '鏆傚仠', + // onClick: handlePause.bind(null, record), + // }, ]" /> </template> @@ -70,37 +74,41 @@ <Loading :loading="compState.loading" :tip="compState.tip" /> <WoDrawer @register="registerDrawer" @success="handleSuccess" /> <WoModal @register="registerWo" @success="handleSuccess" :title="title" :mtitle="mtitle" /> - <!-- 鑷畾涔夋ā鎬佹锛屽彲浠ヨ嚜瀹氫箟澶氳〃鍗� --> - <CustModal - @register="registerCust" - @success="custSuccess" - :type="cType" - :detailSlots="dtlSlots" - > - <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� --> - <template #[item.name] v-for="item in dtlSlots" :key="item.name"> - <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]"> - <!-- 鐢ㄦ彃妲借嚜瀹氫箟寮瑰嚭閫夋嫨妗� --> - <template #[name]="{ field }" v-for="name in item.slots" :key="name"> - <a-button - class="mt-1 ml-1" - size="small" - @click="handleCustClick(field)" - :preIcon="item.preIcons[name]" - /> - <GeneralModal - @register="useModalData[name][0]" - @success="(d, u) => handleEntSuccess(d, u, item.name)" - /> - </template> - </BasicForm> - <!-- 鑷畾涔夊唴瀹� --> - <!-- <div style="height: 200px" id="lfContainer" v-if="isCustEl[item.name]"></div> --> - <div class="h-full" style="height: 380px" v-if="isCustEl[item.name]"> - <FlowChartView :data="routeData" @init="init" /> - </div> - </template> - </CustModal> + <Suspense> + <!-- 鑷畾涔夋ā鎬佹锛屽彲浠ヨ嚜瀹氫箟澶氳〃鍗� --> + <CustModal + @register="registerCust" + @success="custSuccess" + :type="cType" + :detailSlots="dtlSlots" + :entityName="entityName" + > + <!-- 鐢ㄦ彃妲借嚜瀹氫箟澶氳〃鍗� --> + <template #[item.name] v-for="item in dtlSlots" :key="item.name"> + <BasicForm @register="useFormData[item.name][0]" v-if="useFormData[item.name]"> + <!-- 鐢ㄦ彃妲借嚜瀹氫箟寮瑰嚭閫夋嫨妗� --> + <template #[name]="{ field }" v-for="name in item.slots" :key="name"> + <a-button + class="mt-1 ml-1" + size="small" + @click="handleCustClick(field)" + :preIcon="item.preIcons[name]" + /> + <GeneralModal + @register="useModalData[name][0]" + @success="(d, u) => handleEntSuccess(d, u, item.name)" + /> + </template> + </BasicForm> + <!-- 鑷畾涔夊唴瀹� --> + <!-- <div style="height: 200px" id="lfContainer" v-if="isCustEl[item.name]"></div> --> + <div class="h-full" style="height: 380px" v-if="isCustEl[item.name]"> + <FlowChartView :data="routeData" @init="init" /> + </div> + </template> + </CustModal> + <!-- <template #fallback> Loading... </template> --> + </Suspense> <RouteViewModal @register="registerRv" @success="RvItemSuccess" /> </div> </template> @@ -126,6 +134,8 @@ import { GetSelectSuccess, OpenSelectItem, getFormSchema } from '/@/views/components/data'; import LogicFlow from '@logicflow/core'; import { initRoute } from '../../../system/lowcode/data'; + import BIZ_MES_WO from '../../../system/lowcode/entityts/BIZ_MES_WO'; + import { useUserStore } from '/@/store/modules/user'; const { t } = useI18n(); const ASteps = Steps; @@ -150,6 +160,15 @@ const [registerTable, { getForm, reload }] = useTable({ title: '宸ュ崟淇℃伅', api: getListByPage, + searchInfo: { + TABLE_NAME: 'BIZ_MES_WO', + option: { + //鏍规嵁鎹偣鏌ヨ锛屽繀闇�甯﹁繖涓弬鏁� + UserId: useUserStore().getUserInfo.userId, + ByOrg: true, + CurOrg: useUserStore().getUserInfo.orgCode, + }, + }, columns, formConfig: { labelWidth: 120, @@ -172,6 +191,7 @@ nodes: [], edges: [], }); + const entityName = ref('BIZ_MES_WO'); const formSchema = ref([] as FormSchema[]); const woSchema = ref<FormSchema[]>(getFormSchema('woinfo')); const prodSchema = ref<FormSchema[]>(getFormSchema('prodinfo')); @@ -188,41 +208,10 @@ addRot: useModal(), setRot: useModal(), }); - //鑷畾涔夊琛ㄥ崟瀹炰緥 - const useFormData = ref({ - forminfo: useForm({ - labelWidth: 120, - schemas: formSchema, - actionColOptions: { - span: 24, - }, - showActionButtonGroup: false, - }), - woinfo: useForm({ - labelWidth: 120, - schemas: woSchema, - actionColOptions: { - span: 24, - }, - showActionButtonGroup: false, - }), - prodinfo: useForm({ - labelWidth: 120, - schemas: prodSchema, - actionColOptions: { - span: 24, - }, - showActionButtonGroup: false, - }), - // rotinfo: useForm({ - // labelWidth: 120, - // schemas: rotSchema, - // actionColOptions: { - // span: 24, - // }, - // showActionButtonGroup: false, - // }), - }); + + /* 鑾峰彇澶氳〃鍗曞疄渚� */ + const [{ GetUseForm }] = BIZ_MES_WO(); + const useFormData = ref<any>(GetUseForm()); onMounted(async () => {}); @@ -287,9 +276,9 @@ formEl: useFormData.value, //濡傛灉鏄涓〃鍗曪紝澧炲姞澶氫釜鎻掓Ы formElName: ['woinfo', 'prodinfo', 'rotinfo'], //琛ㄥ崟鎻掓Ы鍚嶇О锛屾敮鎸佸涓〃鍗� RowKey: '', - fnName: { BIZ_MES_WO_Config: 'SaveCofig' }, //淇濆瓨鏂规硶鍚� - initFnName: { BIZ_MES_WO_Config: 'initRoute' }, //鍒濆鍖栨柟娉曞悕 - isCustEl: isCustEl.value, + fnName: 'SaveCofig', //淇濆瓨鏂规硶鍚� + // initFnName: { BIZ_MES_WO_Config: 'initRoute' }, //鍒濆鍖栨柟娉曞悕 + // isCustEl: isCustEl.value, others: routeData.value, values: record, //琛ㄥ崟璁板綍 }); @@ -301,14 +290,14 @@ * @return {*} */ function handleRelease(record: Recordable) { - if (record.STATUS == 2) { - createErrorModal({ - title: t('璀﹀憡'), - content: t('宸ュ崟宸茬粡涓嬪彂锛屼笉鑳藉啀涓嬪彂锛�'), - getContainer: () => document.body, - }); - return; - } + // if (record.STATUS == 2) { + // createErrorModal({ + // title: t('璀﹀憡'), + // content: t('宸ュ崟宸茬粡涓嬪彂锛屼笉鑳藉啀涓嬪彂锛�'), + // getContainer: () => document.body, + // }); + // return; + // } cType.value = 'BIZ_MES_WO'; dtlSlots.value = [ { @@ -318,7 +307,7 @@ title: '涓嬪彂閰嶇疆', }, ]; - formSchema.value = getFormSchema(cType.value); + // formSchema.value = getFormSchema(cType.value); openCustModal(true, { isUpdate: true, //鏄惁鏇存柊鎿嶄綔 ctype: cType, //鏄摢涓〉闈� @@ -327,8 +316,8 @@ formEl: useFormData.value, formElName: ['forminfo'], //琛ㄥ崟鎻掓Ы鍚嶇О RowKeys: { add: 'ROUTE_CODE', set: 'ROUTE_CODE' }, //鎻掓Ы鐨勫脊鍑烘閫夋嫨鐨刢ode - fnName: { BIZ_MES_WO: 'SaveWoBatch' }, //淇濆瓨鏂规硶鍚� - initFnName: {}, //鍒濆鍖栨柟娉曞悕 + fnName: 'SaveWoBatch', //淇濆瓨鏂规硶鍚� + initFnName: {}, //鍒濆鍖栨柟娉曞悕锛屾病鏈夊氨鐣欑┖{} isCustEl: isCustEl.value, values: record, //琛ㄥ崟璁板綍 }); @@ -474,7 +463,9 @@ var values = GetSelectSuccess(d, u, cType.value); selectVals.value = values; //淇濆瓨寮瑰嚭妗嗛�夋嫨鐨勭粨鏋� let _val = {}; - _val[d.returnFieldName] = values[d.returnFieldName]; + d.returnFieldName.map((x) => { + _val[x] = values[x]; + }); useFormData.value[item][1].setFieldsValue(_val); if (d.returnFieldName == 'ROUTE_CODE' && cType.value == 'BIZ_MES_WO_Config') { routeData.value = { @@ -503,8 +494,8 @@ selectVals.value['ROUTE_CODE'], ); //[openRvModal], selectVals.value['ID']杩欐槸鑷畾涔夊弬鏁帮紝鎸夊疄闄呴渶姹� } - + function RvItemSuccess(d, u) { closeModal(); - } + } </script> -- Gitblit v1.9.3