Browse Source

维修工单维修人多选BUG

master
zhang_li 8 months ago
parent
commit
b53ea9884e
  1. 2
      src/components/Detail/src/Detail.vue
  2. 30
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  3. 5
      src/views/eam/device/devicemaintenancejob/index.vue

2
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)

30
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -362,13 +362,20 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
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,
@ -394,6 +401,15 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '维修人',
field: 'maintenancesName',
sort: 'custom',
isForm:false,
isDetail:true,
isTable:true,
isTableForm:false
},
{
label: '备件',
field: 'itemNumbers1',

5
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') {

Loading…
Cancel
Save