| | |
| | | * @version: |
| | | * @Date: 2024-05-25 00:27:00 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-03 20:51:05 |
| | | * @LastEditTime: 2024-07-16 16:44:47 |
| | | --> |
| | | <template> |
| | | <div> |
| | |
| | | <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> |
| | |
| | | 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'; |
| | | |
| | | const { t } = useI18n(); |
| | | const ASteps = Steps; |
| | |
| | | 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')); |
| | |
| | | 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 () => {}); |
| | | |
| | |
| | | * @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 = [ |
| | | { |
| | |
| | | title: '下发配置', |
| | | }, |
| | | ]; |
| | | formSchema.value = getFormSchema(cType.value); |
| | | // formSchema.value = getFormSchema(cType.value); |
| | | openCustModal(true, { |
| | | isUpdate: true, //是否更新操作 |
| | | ctype: cType, //是哪个页面 |
| | |
| | | formElName: ['forminfo'], //表单插槽名称 |
| | | RowKeys: { add: 'ROUTE_CODE', set: 'ROUTE_CODE' }, //插槽的弹出框选择的code |
| | | fnName: { BIZ_MES_WO: 'SaveWoBatch' }, //保存方法名 |
| | | initFnName: {}, //初始化方法名 |
| | | initFnName: {}, //初始化方法名,没有就留空{} |
| | | isCustEl: isCustEl.value, |
| | | values: record, //表单记录 |
| | | }); |
| | |
| | | selectVals.value['ROUTE_CODE'], |
| | | ); //[openRvModal], selectVals.value['ID']这是自定义参数,按实际需求 |
| | | } |
| | | |
| | | |
| | | function RvItemSuccess(d, u) { |
| | | closeModal(); |
| | | } |
| | | } |
| | | </script> |