From 8879c0ffe5a7b28ec48d6619f5f8ff81ff5e73cc Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Fri, 22 Mar 2024 17:48:41 +0800 Subject: [PATCH] BUG --- .../eam/mold/moldmaintenancejob/index.vue | 4 +- .../moldMaintenanceMain.data.ts | 48 ++++++++++++------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/views/eam/mold/moldmaintenancejob/index.vue b/src/views/eam/mold/moldmaintenancejob/index.vue index d0bc6f1..3df7775 100644 --- a/src/views/eam/mold/moldmaintenancejob/index.vue +++ b/src/views/eam/mold/moldmaintenancejob/index.vue @@ -595,8 +595,8 @@ const submitForm = async (formType, data) => { } } const detailOpenForm = (type, row) =>{ - console.log("type",type); - console.log("row",row); + + row.maintenances = row.maintenances.split(',').map(item=>Number(item)) MoldMaintenanceDetail.allSchemas.tableFormColumns.map((item) => { // if(purchaseReceiptRecordNumberRef.value == ''){ // if (item.field == 'itemCode') { diff --git a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts index 99cb637..71f5fb9 100644 --- a/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts +++ b/src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts @@ -313,32 +313,39 @@ export const MoldMaintenanceDetail = useCrudSchemas(reactive([ label: '维修人', field: 'maintenances', sort: 'custom', - api: () => userListAll, - formatter: (_: Recordable, __: TableColumn, cellValue) => { - const cellValueList = cellValue ? cellValue.split(',') : []; - return userListAll - .filter(item => cellValueList.includes(item.id.toString())) - .map(item => item.nickname) - .join(','); - }, + isDetail: false, + // formatter: (_: Recordable, __: TableColumn, cellValue) => { + // let cellValueList = [] + // if (Array.isArray(cellValue)) { + // cellValueList = cellValue + // } else { + // cellValueList = cellValue ? cellValue.split(',') : []; + // } + // // const cellValueList = cellValue ? cellValue.split(',') : []; + // return userListAll + // .filter(item => cellValueList.includes(item.id.toString())) + // .map(item => item.nickname) + // .join(','); + // }, + isTable:false, tableForm: { type: 'Select', initOptions: userListAll, - multiple:true, - collapseTags:true, - collapseTagsTooltip:true, + multiple: true, + collapseTags: true, + collapseTagsTooltip: true, optionsAlias: { labelField: 'nickname', valueField: 'id' } }, - form:{ + form: { component: 'Select', - api: () => userListAll, + // api: () => dutyUserList, componentProps: { - multiple:true, - collapseTags:true, - collapseTagsTooltip:true, + multiple: true, + collapseTags: true, + collapseTagsTooltip: true, optionsAlias: { labelField: 'name', valueField: 'id' @@ -346,6 +353,15 @@ export const MoldMaintenanceDetail = useCrudSchemas(reactive([ } } }, + { + label: '维修人', + field: 'maintenancesName', + sort: 'custom', + isForm:false, + isDetail:true, + isTable:true, + isTableForm:false + }, { label: '备件', field: 'itemNumbers1',