|
|
@ -3,20 +3,22 @@ import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
|
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
import { selecUserByType } from '@/api/system/dept' |
|
|
|
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' |
|
|
|
const userStore = useUserStore() |
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) |
|
|
|
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) |
|
|
|
|
|
|
|
const repairList = await DeviceMaintenanceMainApi.getDeviceMainTempList('DEVICE') |
|
|
|
// 表单校验
|
|
|
|
export const DeviceInspectionMainRules = reactive({ |
|
|
|
number: [required], |
|
|
|
maintenanceNumber: [required], |
|
|
|
// maintenanceNumber: [required],
|
|
|
|
deviceNumber: [required], |
|
|
|
factoryAreaNumber: [required], |
|
|
|
status: [required], |
|
|
|
type: [required], |
|
|
|
concurrencyStamp: [required], |
|
|
|
faultType: [required], |
|
|
|
}) |
|
|
|
|
|
|
|
export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
@ -34,10 +36,34 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
label: '维修工单号', |
|
|
|
field: 'maintenanceNumber', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
api: () => repairList, |
|
|
|
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
|
|
|
|
// return repairList.find((account) => account.number == cellValue)?.name
|
|
|
|
// },
|
|
|
|
search: { |
|
|
|
show: true, |
|
|
|
component: 'Select', |
|
|
|
api: () => repairList, |
|
|
|
componentProps: { |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'number', |
|
|
|
valueField: 'number' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Select', |
|
|
|
api: () => repairList, |
|
|
|
componentProps: { |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'number', |
|
|
|
valueField: 'number' |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '设备', |
|
|
@ -74,7 +100,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '厂区编号', |
|
|
|
label: '厂区', |
|
|
|
field: 'factoryAreaNumber', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: false, |
|
|
@ -105,7 +131,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'id' |
|
|
|
}, |
|
|
|
placeholder: "请先选择设备" |
|
|
|
placeholder: "请选择设备" |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
@ -141,25 +167,10 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
labelField: 'name', |
|
|
|
valueField: 'id' |
|
|
|
}, |
|
|
|
placeholder: "请先选择设备" |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '描述', |
|
|
|
field: 'describe', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: false, |
|
|
|
table: { |
|
|
|
width: '230', |
|
|
|
placeholder: "请选择设备" |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
type: 'textarea', |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// {
|
|
|
|
// label: '维修人联系电话',
|
|
|
|
// field: 'maintenancePhone',
|
|
|
@ -169,7 +180,6 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
label: '状态', |
|
|
|
field: 'status', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: true, |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
@ -177,7 +187,11 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
dictType: DICT_TYPE.JX_STATUS, |
|
|
|
dictClass: 'string', |
|
|
|
form: { |
|
|
|
component: 'Select' |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
disabled: true, |
|
|
|
placeholder: "请选择设备" |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
@ -191,7 +205,30 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, |
|
|
|
dictClass: 'string', |
|
|
|
form: { |
|
|
|
component: 'Select' |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
disabled: true, |
|
|
|
placeholder: "请选择设备" |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '故障类型', |
|
|
|
field: 'faultType', |
|
|
|
sort: 'custom', |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
// isSearch: false,
|
|
|
|
dictType: DICT_TYPE.FAULT_TYPE, |
|
|
|
dictClass: 'string', |
|
|
|
form: { |
|
|
|
value: 'PM', |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
// disabled: true,
|
|
|
|
placeholder: "请选择故障类型" |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// {
|
|
|
@ -201,7 +238,21 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
// formatter: dateFormatter,
|
|
|
|
// isForm: false,
|
|
|
|
// },
|
|
|
|
|
|
|
|
{ |
|
|
|
label: '描述', |
|
|
|
field: 'describe', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: false, |
|
|
|
table: { |
|
|
|
width: '230', |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
type: 'textarea', |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '操作', |
|
|
|
field: 'action', |
|
|
|