|
|
@ -5,11 +5,13 @@ import { useUserStore } from '@/store/modules/user' |
|
|
|
import { selecUserByType } from '@/api/system/dept' |
|
|
|
import { ItemSearchTable } from '../../basic/item/item.data' |
|
|
|
import * as ItemApi from '@/api/eam/basic/item' |
|
|
|
import * as UserApi from '@/api/system/user' |
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
|
const userStore = useUserStore() |
|
|
|
const factoryList = await selectAllFactoryArea() |
|
|
|
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) |
|
|
|
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) |
|
|
|
const userListAll = await UserApi.getSimpleUserList() |
|
|
|
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') |
|
|
|
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) |
|
|
|
// 表单校验
|
|
|
@ -123,13 +125,17 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
table: { |
|
|
|
width: '150', |
|
|
|
}, |
|
|
|
api: () => userListAll, |
|
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
|
return userListAll.find((account) => account.id == cellValue)?.nickname |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Select', |
|
|
|
api: () => userList, |
|
|
|
api: () => userListAll, |
|
|
|
componentProps: { |
|
|
|
disabled: true, |
|
|
|
optionsAlias: { |
|
|
|
labelField: 'name', |
|
|
|
labelField: 'nickname', |
|
|
|
valueField: 'id' |
|
|
|
}, |
|
|
|
placeholder: "请先选择设备" |
|
|
@ -206,6 +212,9 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
}, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
type: 'textarea', |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
@ -222,6 +231,18 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
])) |
|
|
|
|
|
|
|
export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
{ |
|
|
|
label: '维修编号', |
|
|
|
field: 'number', |
|
|
|
sort: 'custom', |
|
|
|
isSearch: false, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
disabled: true |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '故障描述', |
|
|
|
field: 'describes', |
|
|
@ -229,6 +250,13 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
table: { |
|
|
|
}, |
|
|
|
isSearch: false, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
type: 'textarea', |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '故障真因', |
|
|
@ -237,6 +265,13 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
table: { |
|
|
|
}, |
|
|
|
isSearch: false, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
type: 'textarea', |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '解决措施', |
|
|
@ -245,6 +280,13 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
table: { |
|
|
|
}, |
|
|
|
isSearch: false, |
|
|
|
form: { |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
type: 'textarea', |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '维修人', |
|
|
@ -346,9 +388,17 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
|
])) |
|
|
|
// 表单校验
|
|
|
|
export const DeviceMaintenanceDetailRules = reactive({ |
|
|
|
describes: [required], |
|
|
|
describes1: [required], |
|
|
|
workOut: [required], |
|
|
|
maintenance: [required], |
|
|
|
itemNumbers: [required], |
|
|
|
describes: [ |
|
|
|
required, |
|
|
|
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
describes1: [ |
|
|
|
required, |
|
|
|
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
workOut: [ |
|
|
|
required, |
|
|
|
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, |
|
|
|
], |
|
|
|
maintenances: [required], |
|
|
|
}) |