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