| | |
| | | @ok="handleSubmit" |
| | | > |
| | | <div> |
| | | <a-alert |
| | | v-if="showAlert" |
| | | :message="message" |
| | | :description="description" |
| | | type="info" |
| | | show-icon |
| | | /> |
| | | <BasicTable @register="registerTable" @edit-change="onEditChange"> |
| | | <template #toolbar> |
| | | <a-button @click="openImg" type="primary"> 预览 </a-button> |
| | |
| | | import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; |
| | | import { CustModalParams } from '/@/api/tigerapi/model/systemModel'; |
| | | import { EntityCustFunctionType } from '/@/api/tigerapi/model/basModel'; |
| | | import { Alert } from 'ant-design-vue'; |
| | | |
| | | const AAlert = Alert; |
| | | const { t } = useI18n(); |
| | | const title = ref(''); |
| | | const tableName = ref(''); |
| | |
| | | const entityName = ref(''); |
| | | const ctype = ref(''); |
| | | const others = ref({}); |
| | | const showAlert = ref(false); |
| | | const message = ref(''); |
| | | const description = ref(''); |
| | | |
| | | //列表 |
| | | const ItemColumns = ref([] as BasicColumn[]); |
| | |
| | | } |
| | | } |
| | | }); |
| | | if(isNullOrEmpty(path)){ |
| | | path = dataSource.filter((q) => isNullOrEmpty(q.WORK_ORDER) || isNullOrEmpty(q.PROD_CODE))[0].LABEL_VIEW_PATH; |
| | | if (isNullOrEmpty(path)) { |
| | | path = dataSource.filter((q) => isNullOrEmpty(q.WORK_ORDER) || isNullOrEmpty(q.PROD_CODE))[0] |
| | | .LABEL_VIEW_PATH; |
| | | } |
| | | createImgPreview({ |
| | | imageList: [path], |
| | |
| | | entityName.value = data?.entityName; |
| | | ctype.value = data?.ctype; |
| | | others.value = data?.others; |
| | | showAlert.value = data?.alertConfig.showAlert; |
| | | message.value = data?.alertConfig.message; |
| | | description.value = data?.alertConfig.description; |
| | | // getForm().resetFields(); |
| | | /* 动态import实体名.ts的自定义方法 */ |
| | | try { |
| | |
| | | try { |
| | | const data = cloneDeep(record.editValueRefs); |
| | | console.log(data); |
| | | //TODO 此处将数据提交给服务器保存 |
| | | |
| | | const [{ CustFunc }] = isNullOrUnDef(custImport.value['default']) |
| | | ? EntityCustFunction.value |
| | | : custImport.value['default'](); |
| | |
| | | <template> |
| | | <BasicModal |
| | | width="800px" |
| | | :height="450" |
| | | width="1200px" |
| | | :height="700" |
| | | v-bind="$attrs" |
| | | @register="register" |
| | | :title="title" |
| | |
| | | labelWidth: 120, |
| | | schemas: schemas, |
| | | }, |
| | | size: 'small', |
| | | useSearchForm: true, |
| | | showTableSetting: false, |
| | | scroll: { y: 350 }, |
| | | scroll: { y: 550 }, |
| | | canResize: false, |
| | | rowKey: rowKey, |
| | | rowSelection: { |
| | |
| | | EntityJson: JSON.stringify(tableListRef.value[0].dataSource), |
| | | CheckJson: checkJson.value, |
| | | where: where.value, |
| | | typeFullName: typeFullName.value |
| | | typeFullName: typeFullName.value, |
| | | }); |
| | | if (res.IsSuccessed) { |
| | | tableListRef.value[0].dataSource = res.Data; |
| | | err.value = ''; |
| | | } else { |
| | | tableListRef.value = []; |
| | | tableListRef.value = [ |
| | | { |
| | | title: '列表信息', |
| | | columns: [ |
| | | { |
| | | title: '字段1', |
| | | dataIndex: 'field1', |
| | | width: 200, |
| | | sorter: true, |
| | | resizable: true, |
| | | }, |
| | | { |
| | | title: '字段2', |
| | | dataIndex: 'field2', |
| | | width: 200, |
| | | sorter: true, |
| | | resizable: true, |
| | | }, |
| | | ], |
| | | dataSource: [], |
| | | }, |
| | | ]; |
| | | createMessage.error('导入失败' + res.Message); |
| | | err.value = res.Message; |
| | | } |
| | |
| | | title: () => h('span', t('导入信息')), |
| | | content: () => h('span', t('确认有修改的数据是否正确,有异常的数据无法导入')), |
| | | onOk: async () => { |
| | | const apiAction = await ImportExcel(entityName.value, tableListRef.value[0]['dataSource'] as any[]); |
| | | const apiAction = await ImportExcel( |
| | | entityName.value, |
| | | tableListRef.value[0]['dataSource'] as any[], |
| | | ); |
| | | if (apiAction.IsSuccessed) { |
| | | closeModal(); |
| | | createMessage.success(t('导入成功')); |
| | |
| | | v-show="showOtherTable[item]" |
| | | class="mt-1" |
| | | > |
| | | <div :style="custTableStyle" > |
| | | <BasicTable @register="useTables[item][0]" v-if="showOtherTable[item]"> |
| | | <template #action="{ record }"> |
| | | <TableAction :actions="createActions(record, item)" /> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <div :style="custTableStyle"> |
| | | <BasicTable @register="useTables[item][0]" v-if="showOtherTable[item]"> |
| | | <template #action="{ record }"> |
| | | <TableAction :actions="createActions(record, item)" /> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <normalDrawer @register="useDrawers[item][0]" @success="(d, u) => EditSuccess(d, u, item)" /> |
| | | <GeneralCrudModal @register="useModalsCrud[item][0]"></GeneralCrudModal> |
| | | </Card> |
| | |
| | | useModalsCrud.value[x] = useModal(); |
| | | }); |
| | | const custTableStyle = ref({ |
| | | height: window.screen.width == 1366? '350px': '450px' |
| | | height: window.screen.width == 1366 ? '350px' : '450px', |
| | | }); |
| | | |
| | | /* 注入选中节点数据 */ |
| | | const selectedNodes = inject('selectedNodes') as Ref<any>; |
| | | const mainRecord = ref(objParams.value.record); |
| | | watch( |
| | | () => selectedNodes.value, |
| | | (newVal, oldVal) => { |
| | |
| | | // useModalData, |
| | | // useFormData, |
| | | crudColSlots: objParams.value['crudColSlots'][name], |
| | | mainRecord: mainRecord.value, |
| | | }; |
| | | |
| | | const actionItem = [ |
| | |
| | | |
| | | /** |
| | | * @description: 点击打开弹出选择列表框 |
| | | * @param {*} item |
| | | * @param {*} item slot名字 |
| | | * @return {*} |
| | | */ |
| | | function SelectItemInForm(item) { |
| | |
| | | useModalsCrudInForm.value[item][1].openModal, |
| | | record, |
| | | objParams.value['CODE'], |
| | | mainRecord.value, |
| | | ); |
| | | } |
| | | |
| | |
| | | span: 12, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'LABEL_NAME', |
| | | component: 'Input', |
| | | label: '模板名称', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | |
| | | action = { |
| | | action: 'importModal', //drawer(打开左侧抽屉框) | go(跳转到新的页面) | modal(打开模态窗口) | importModal(打开导入模态窗口) |
| | | params: { |
| | | tmpHeader: ['工单号', '计划日期', '计划数量'], /* 下载模板的标题字段 */ |
| | | filename: '工单计划模板.xlsx', /* 下载模板的文件名 */ |
| | | entityName: 'BIZ_MES_WO_BATCH', /* 导入表的表名 */ |
| | | checkJson: ['ORDER_NO', 'PLAN_DATE', 'PLAN_QTY'], /* 导入表需要检查的字段列表 */ |
| | | where: ['ORDER_NO'], /* 导入表需要查询的字段列表 */ |
| | | typeFullName:'Tiger.IBusiness.MES.IImportWoPlan,Tiger.IBusiness.MES', /* 导入的方法全名,通用导入用这个:Tiger.IBusiness.ICommonImportExcel,Tiger.IBusiness */ |
| | | baseColumns: [ /* 导入时界面显示数据的字段 */ |
| | | tmpHeader: ['工单号', '计划日期', '计划数量'] /* 下载模板的标题字段 */, |
| | | filename: '工单计划模板.xlsx' /* 下载模板的文件名 */, |
| | | entityName: 'BIZ_MES_WO_BATCH' /* 导入表的表名 */, |
| | | checkJson: ['ORDER_NO', 'PLAN_DATE', 'PLAN_QTY'] /* 导入表需要检查的字段列表 */, |
| | | where: ['ORDER_NO'] /* 导入表需要查询的字段列表 */, |
| | | typeFullName: |
| | | 'Tiger.IBusiness.MES.IImportWoPlan,Tiger.IBusiness.MES' /* 导入的方法全名,通用导入用这个:Tiger.IBusiness.ICommonImportExcel,Tiger.IBusiness */, |
| | | baseColumns: [ |
| | | /* 导入时界面显示数据的字段 */ |
| | | { |
| | | title: '工单号', |
| | | dataIndex: 'ORDER_NO', |
| | | ifShow: true, |
| | | width: 180, |
| | | }, |
| | | { |
| | | title: '工单批次号', |
| | | dataIndex: 'BATCH_NO', |
| | | ifShow: true, |
| | | width: 180, |
| | | // customRender: ({ record }) => { |
| | | // record.BATCH_NO = record.ORDER_NO+'-01' |
| | | // return record.BATCH_NO |
| | | // }, |
| | | }, |
| | | // { |
| | | // title: '工单批次号', |
| | | // dataIndex: 'BATCH_NO', |
| | | // ifShow: true, |
| | | // width: 180, |
| | | // // customRender: ({ record }) => { |
| | | // // record.BATCH_NO = record.ORDER_NO+'-01' |
| | | // // return record.BATCH_NO |
| | | // // }, |
| | | // }, |
| | | { |
| | | title: '计划日期', |
| | | dataIndex: 'PLAN_DATE', |
| | |
| | | title: '计划数量', |
| | | dataIndex: 'PLAN_QTY', |
| | | ifShow: true, |
| | | width: 180, |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: '处理方式', |
| | | dataIndex: 'VALIDATION_TYPE', |
| | | ifShow: true, |
| | | width: 180, |
| | | width: 100, |
| | | customRender: ({ record }) => { |
| | | const status = record.VALIDATION_TYPE; |
| | | var text = ''; |
| | | var color = 'green'; |
| | | if (status == '数据异常') { |
| | | if (status == '异常') { |
| | | color = 'red'; |
| | | text = status; |
| | | } else if (status == '修改') { |
| | |
| | | title: '处理结果', |
| | | dataIndex: 'VALIDATION_RESULT', |
| | | ifShow: true, |
| | | width: 180, |
| | | width: 280, |
| | | customRender: ({ record }) => { |
| | | const status = record.VALIDATION_TYPE; |
| | | var text = record.VALIDATION_RESULT; |
| | | var color = 'green'; |
| | | if (status == '异常') { |
| | | color = 'red'; |
| | | } else if (status == '修改') { |
| | | color = 'yellow'; |
| | | } |
| | | return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | */ |
| | | GetTitle: () => { |
| | | return { |
| | | importTitle: '工单计划导入', /* 打开模态窗口显示的标题 */ |
| | | importTitle: '工单计划导入' /* 打开模态窗口显示的标题 */, |
| | | }; |
| | | }, |
| | | }; |
| | |
| | | Name: 'WoRouteBinding', |
| | | CODE: params['record'].ORDER_NO, |
| | | Title: `工单[${params['record'].ORDER_NO}]工艺绑定`, |
| | | colSlots: |
| | | params['colSlots'].value /* 表格内的查询表单字段的插槽列表,一般用于弹出选择框按钮 */, |
| | | colSlots: params['colSlots'].value /* 表格内的查询表单字段的插槽列表,一般用于弹出选择框按钮 */, |
| | | crudColSlots: { |
| | | BAS_PKG_DTL: ['BAS_LABEL_TEMP1add'], |
| | | ItemCode: ['BAS_CODE_RULE1add'], |
| | |
| | | 'BAS_PKG_DTL', |
| | | 'ItemCode', |
| | | ] /* 自定义显示列表的表名,跟上面增删改的表名一致,有多个就放列表中 */, |
| | | record: params['record'], |
| | | dense: true, |
| | | pageTitle: `工单工艺绑定`, |
| | | pageContent: `这里是管理工单的工艺绑定,一个工单可以绑定一个工艺路线,并可以保存为客户专用的工艺路线`, |
| | |
| | | ItemColumns: TemplateBasColumn, //弹出框中表格字段结构 |
| | | schemas: [], //查询条件字段结构 |
| | | others: { WORK_ORDER: OrderNo }, //需要带到弹出窗口中的数据 |
| | | alertConfig: { |
| | | showAlert: false, |
| | | message: '销售订单备注', |
| | | description: '', |
| | | }, |
| | | searchInfo: { |
| | | TABLE_NAME: 'BAS_LABEL_VAR_WO', //实体名称 |
| | | LabelId: record.LABEL_CODE, //模板ID |
| | |
| | | const openCrudModal = args[0]; |
| | | // const OrderNo = args[2]; |
| | | const ProdCode = args[2]; |
| | | const WoRecord = args[4]; |
| | | openCrudModal(true, { |
| | | isUpdate: true, //是否更新操作 |
| | | entityName: 'ProdRouteBinding', //是哪个页面 |
| | |
| | | ItemColumns: TemplateBasColumn, //弹出框中表格字段结构 |
| | | schemas: [], //查询条件字段结构 |
| | | others: { WORK_ORDER: '', PROD_CODE: ProdCode }, //需要带到弹出窗口中的数据 |
| | | alertConfig: { |
| | | showAlert: false, |
| | | message: '销售订单备注', |
| | | description: WoRecord.SALES_REMARK, |
| | | }, |
| | | searchInfo: { |
| | | TABLE_NAME: 'BAS_LABEL_VAR_WO', //实体名称 |
| | | LabelId: params['record'].LABEL_ID, //模板ID |
| | |
| | | OpenSelectItem: (openItemModal: Fn, ...args) => { |
| | | let config = {}; |
| | | const openCrudModal = args[1]; |
| | | const record = args[2]; |
| | | const record = args[2]; //带过来的记录 |
| | | const OrderNo = args[3]; |
| | | switch (args[0]) { |
| | | const WoRecord = args[4]; |
| | | /* args[0]是界面上的slot名字,根据slot名字来写不同的逻辑实现 */ |
| | | switch (args[0]) { |
| | | case 'scanadd': |
| | | config = ruleModalCfg; |
| | | break; |
| | |
| | | config = pkgModalCfg; |
| | | break; |
| | | } |
| | | /* 如果slot是'labeladd',打开增删改模态窗口,可编辑行 */ |
| | | if (args[0] == 'labeladd') { |
| | | openCrudModal(true, { |
| | | isUpdate: true, //是否更新操作 |
| | |
| | | width: '1024px', //弹出框宽度 |
| | | ItemColumns: TemplateBasColumn, //弹出框中表格字段结构 |
| | | schemas: [], //查询条件字段结构 |
| | | others: { WORK_ORDER: OrderNo }, //需要带到弹出窗口中的数据 |
| | | others: { WORK_ORDER: OrderNo}, //需要带到弹出窗口中的数据 |
| | | alertConfig: { |
| | | showAlert: true, |
| | | message: '销售订单备注', |
| | | description: WoRecord.SALES_REMARK, |
| | | }, /* 在弹出窗口最上位置显示提醒信息,显示销售订单备注 */ |
| | | searchInfo: { |
| | | TABLE_NAME: 'BAS_LABEL_VAR_WO', //实体名称 |
| | | LabelId: record.LABEL_CODE, //模板ID |
| | |
| | | span: 12, |
| | | }, |
| | | }, |
| | | { |
| | | field: 'LABEL_NAME', |
| | | component: 'Input', |
| | | label: '模板名称', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | |
| | | function handleTemplate(args, params: Recordable) { |
| | | const openCrudModal = args[0]; |
| | | const OrderNo = args[2]; |
| | | const WoRecord = params['mainRecord']; |
| | | openCrudModal(true, { |
| | | isUpdate: true, //是否更新操作 |
| | | entityName: 'WoRouteBinding', //是哪个页面 |
| | |
| | | ItemColumns: TemplateBasColumn, //弹出框中表格字段结构 |
| | | schemas: [], //查询条件字段结构 |
| | | others: { WORK_ORDER: OrderNo }, //需要带到弹出窗口中的数据 |
| | | alertConfig: { |
| | | showAlert: true, |
| | | message: '销售订单备注', |
| | | description: WoRecord.SALES_REMARK, |
| | | }, /* 在弹出窗口最上位置显示提醒信息,显示销售订单备注 */ |
| | | searchInfo: { |
| | | TABLE_NAME: 'BAS_LABEL_VAR_WO', //实体名称 |
| | | LabelId: params['record'].LABEL_ID, //模板ID |