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') { if (val == 'edit') {
// //
openForm('update', row) openForm('update', row)
// emit('detailOpenForm',val, row) emit('detailOpenForm',val, row)
} else if (val == 'delete') { } else if (val == 'delete') {
// //
handleDelete(row.id) handleDelete(row.id)

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

@ -362,13 +362,20 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'maintenances', field: 'maintenances',
sort: 'custom', sort: 'custom',
isDetail: false, isDetail: false,
formatter: (_: Recordable, __: TableColumn, cellValue) => { // formatter: (_: Recordable, __: TableColumn, cellValue) => {
const cellValueList = cellValue ? cellValue.split(',') : []; // let cellValueList = []
return userListAll // if (Array.isArray(cellValue)) {
.filter(item => cellValueList.includes(item.id.toString())) // cellValueList = cellValue
.map(item => item.nickname) // } else {
.join(','); // 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: { tableForm: {
type: 'Select', type: 'Select',
initOptions: userListAll, 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: '备件', label: '备件',
field: 'itemNumbers1', field: 'itemNumbers1',

5
src/views/eam/device/devicemaintenancejob/index.vue

@ -770,8 +770,9 @@ const submitFormSec = async (formType, data) => {
const detailOpenForm = (type, row) =>{ const detailOpenForm = (type, row) =>{
console.log("type",type); row.maintenances = row.maintenances.split(',').map(item=>Number(item))
console.log("row",row);
console.log(row.maintenances)
DeviceMaintenanceDetail.allSchemas.tableFormColumns.map((item) => { DeviceMaintenanceDetail.allSchemas.tableFormColumns.map((item) => {
// if(purchaseReceiptRecordNumberRef.value == ''){ // if(purchaseReceiptRecordNumberRef.value == ''){
// if (item.field == 'itemCode') { // if (item.field == 'itemCode') {

Loading…
Cancel
Save