Browse Source

维修工单维修人多选BUG

master
zhang_li 8 months ago
parent
commit
b53ea9884e
  1. 2
      src/components/Detail/src/Detail.vue
  2. 86
      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)

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

@ -25,7 +25,7 @@ export const DeviceMaintenanceMainRules = reactive({
type: [required], type: [required],
classes: [required], classes: [required],
faultType: [required], faultType: [required],
describes : [ describes: [
required, required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, { max: 200, message: '不得超过200个字符', trigger: 'blur' },
], ],
@ -159,13 +159,13 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
placeholder: "请先选择设备" placeholder: "请先选择设备"
}, },
}, },
isSearch:true, isSearch: true,
search:{ search: {
component: 'Select', component: 'Select',
api: () => userListAll, api: () => userListAll,
componentProps: { componentProps: {
collapseTags:true, collapseTags: true,
collapseTagsTooltip:true, collapseTagsTooltip: true,
optionsAlias: { optionsAlias: {
labelField: 'nickname', labelField: 'nickname',
valueField: 'id' valueField: 'id'
@ -259,7 +259,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
type: 'textarea', type: 'textarea',
} }
}, },
}, },
{ {
@ -295,7 +295,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 300, width: 300,
fixed: 'right' fixed: 'right'
}, },
isDetail:false isDetail: false
} }
])) ]))
@ -324,7 +324,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
type: 'textarea', type: 'textarea',
} }
}, },
}, },
{ {
@ -339,7 +339,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
type: 'textarea', type: 'textarea',
} }
}, },
}, },
{ {
@ -354,7 +354,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
type: 'textarea', type: 'textarea',
} }
}, },
}, },
{ {
@ -362,31 +362,38 @@ 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,
multiple:true, multiple: true,
collapseTags:true, collapseTags: true,
collapseTagsTooltip:true, collapseTagsTooltip: true,
optionsAlias: { optionsAlias: {
labelField: 'nickname', labelField: 'nickname',
valueField: 'id' valueField: 'id'
} }
}, },
form:{ form: {
component: 'Select', component: 'Select',
// api: () => dutyUserList, // api: () => dutyUserList,
componentProps: { componentProps: {
multiple:true, multiple: true,
collapseTags:true, collapseTags: true,
collapseTagsTooltip:true, collapseTagsTooltip: true,
optionsAlias: { optionsAlias: {
labelField: 'name', labelField: 'name',
valueField: 'id' valueField: 'id'
@ -394,18 +401,27 @@ 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',
sort: 'custom', sort: 'custom',
table: { table: {
}, },
tableForm:{ tableForm: {
isInpuFocusShow: true, // 开启查询弹窗 isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择备件', searchListPlaceholder: '请选择备件',
searchField: 'itemNumbers1', searchField: 'itemNumbers1',
searchTitle: '备件', searchTitle: '备件',
multiple:true, multiple: true,
searchAllSchemas: ItemSearchTable.allSchemas, searchAllSchemas: ItemSearchTable.allSchemas,
searchPage: ItemApi.getItemList, searchPage: ItemApi.getItemList,
searchCondition: [{ searchCondition: [{
@ -422,9 +438,9 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '请选择备件', // 输入框占位文本 searchListPlaceholder: '请选择备件', // 输入框占位文本
searchField: 'itemNumbers1', // 查询弹窗赋值字段 searchField: 'itemNumbers1', // 查询弹窗赋值字段
searchTitle: '备件', // 查询弹窗标题 searchTitle: '备件', // 查询弹窗标题
multiple:true, multiple: true,
searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'number', key: 'number',
value: 'deviceNumber', value: 'deviceNumber',
@ -441,9 +457,9 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
table: { table: {
}, },
isForm:false, isForm: false,
isDetail:false, isDetail: false,
isTable:false, isTable: false,
isSearch: false, isSearch: false,
isTableForm: false, isTableForm: false,
}, },
@ -489,7 +505,7 @@ export const DeviceMaintenanceMainSecRules = reactive({
type: [required], type: [required],
classes: [required], classes: [required],
faultType: [required], faultType: [required],
describes : [ describes: [
required, required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, { max: 200, message: '不得超过200个字符', trigger: 'blur' },
], ],
@ -722,7 +738,7 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
type: 'textarea', type: 'textarea',
} }
}, },
}, },
{ {
@ -758,6 +774,6 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
width: 300, width: 300,
fixed: 'right' fixed: 'right'
}, },
isDetail:false isDetail: false
} }
])) ]))

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