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

86
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<CrudSchema[]>([
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<CrudSchema[]>([
componentProps: {
type: 'textarea',
}
},
},
{
@ -295,7 +295,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 300,
fixed: 'right'
},
isDetail:false
isDetail: false
}
]))
@ -324,7 +324,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
type: 'textarea',
}
},
},
{
@ -339,7 +339,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
type: 'textarea',
}
},
},
{
@ -354,7 +354,7 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: {
type: 'textarea',
}
},
},
{
@ -362,31 +362,38 @@ 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,
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<CrudSchema[]>([
}
}
},
{
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<CrudSchema[]>([
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<CrudSchema[]>([
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<CrudSchema[]>([
componentProps: {
type: 'textarea',
}
},
},
{
@ -758,6 +774,6 @@ export const DeviceMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
width: 300,
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) =>{
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