diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 2118961..b626840 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -460,7 +460,7 @@ const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) - // emit('detailOpenForm',val, row) + emit('detailOpenForm',val, row) } else if (val == 'delete') { // 删除 handleDelete(row.id) diff --git a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts index 8a58e57..5cc9e32 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -25,7 +25,7 @@ export const DeviceMaintenanceMainRules = reactive({ type: [required], classes: [required], faultType: [required], - describes : [ + describes: [ required, { max: 200, message: '不得超过200个字符', trigger: 'blur' }, ], @@ -159,13 +159,13 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ placeholder: "请先选择设备" }, }, - isSearch:true, - search:{ + isSearch: true, + search: { component: 'Select', api: () => userListAll, componentProps: { - collapseTags:true, - collapseTagsTooltip:true, + collapseTags: true, + collapseTagsTooltip: true, optionsAlias: { labelField: 'nickname', valueField: 'id' @@ -259,7 +259,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ componentProps: { type: 'textarea', } - + }, }, { @@ -295,7 +295,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ width: 300, fixed: 'right' }, - isDetail:false + isDetail: false } ])) @@ -324,7 +324,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ componentProps: { type: 'textarea', } - + }, }, { @@ -339,7 +339,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ componentProps: { type: 'textarea', } - + }, }, { @@ -354,7 +354,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ componentProps: { type: 'textarea', } - + }, }, { @@ -362,31 +362,38 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ field: 'maintenances', sort: 'custom', isDetail: false, - formatter: (_: Recordable, __: TableColumn, cellValue) => { - const cellValueList = cellValue ? cellValue.split(',') : []; - return userListAll - .filter(item => cellValueList.includes(item.id.toString())) - .map(item => item.nickname) - .join(','); - }, + // 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: () => dutyUserList, componentProps: { - multiple:true, - collapseTags:true, - collapseTagsTooltip:true, + multiple: true, + collapseTags: true, + collapseTagsTooltip: true, optionsAlias: { labelField: 'name', valueField: 'id' @@ -394,18 +401,27 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ } } }, + { + label: '维修人', + field: 'maintenancesName', + sort: 'custom', + isForm:false, + isDetail:true, + isTable:true, + isTableForm:false + }, { label: '备件', field: 'itemNumbers1', sort: 'custom', table: { }, - tableForm:{ + tableForm: { isInpuFocusShow: true, // 开启查询弹窗 searchListPlaceholder: '请选择备件', searchField: 'itemNumbers1', searchTitle: '备件', - multiple:true, + multiple: true, searchAllSchemas: ItemSearchTable.allSchemas, searchPage: ItemApi.getItemList, searchCondition: [{ @@ -422,9 +438,9 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ searchListPlaceholder: '请选择备件', // 输入框占位文本 searchField: 'itemNumbers1', // 查询弹窗赋值字段 searchTitle: '备件', // 查询弹窗标题 - multiple:true, - searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 - searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 + multiple: true, + searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 + searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 searchCondition: [{ key: 'number', value: 'deviceNumber', @@ -441,9 +457,9 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ sort: 'custom', table: { }, - isForm:false, - isDetail:false, - isTable:false, + isForm: false, + isDetail: false, + isTable: false, isSearch: false, isTableForm: false, }, @@ -489,7 +505,7 @@ export const DeviceMaintenanceMainSecRules = reactive({ type: [required], classes: [required], faultType: [required], - describes : [ + describes: [ required, { max: 200, message: '不得超过200个字符', trigger: 'blur' }, ], @@ -722,7 +738,7 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive([ componentProps: { type: 'textarea', } - + }, }, { @@ -758,6 +774,6 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive([ width: 300, fixed: 'right' }, - isDetail:false + isDetail: false } ])) \ No newline at end of file diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index b95b205..ded6dd6 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -770,8 +770,9 @@ const submitFormSec = async (formType, data) => { const detailOpenForm = (type, row) =>{ - console.log("type",type); - console.log("row",row); + row.maintenances = row.maintenances.split(',').map(item=>Number(item)) + + console.log(row.maintenances) DeviceMaintenanceDetail.allSchemas.tableFormColumns.map((item) => { // if(purchaseReceiptRecordNumberRef.value == ''){ // if (item.field == 'itemCode') {