|
@ -1,28 +1,36 @@ |
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
import { selectAllFactoryArea } from '@/api/system/dept' |
|
|
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' |
|
|
import { useUserStore } from '@/store/modules/user' |
|
|
|
|
|
import { selecUserByType } from '@/api/system/dept' |
|
|
import { selecUserByType } from '@/api/system/dept' |
|
|
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' |
|
|
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain' |
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
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' |
|
|
const userStore = useUserStore() |
|
|
import { validateHanset, validateNumDot, validateEmail } from '@/utils/validator' |
|
|
|
|
|
import * as UserApi from '@/api/system/user' |
|
|
|
|
|
const userListAll = await UserApi.getSimpleUserList() |
|
|
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 dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: undefined }) |
|
|
const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: undefined }) |
|
|
const engineerList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 2}) |
|
|
|
|
|
const repairList = await DeviceMaintenanceMainApi.getDeviceMainTempList('DEVICE') |
|
|
const repairList = await DeviceMaintenanceMainApi.getDeviceMainTempList('DEVICE') |
|
|
// 表单校验
|
|
|
// 表单校验
|
|
|
export const DeviceInspectionMainRules = reactive({ |
|
|
export const DeviceInspectionMainRules = reactive({ |
|
|
number: [required], |
|
|
number: [required], |
|
|
// maintenanceNumber: [required],
|
|
|
deviceNumber: [ |
|
|
deviceNumber: [required], |
|
|
required, |
|
|
factoryAreaNumber: [required], |
|
|
], |
|
|
|
|
|
factoryAreaNumber: [ |
|
|
|
|
|
required, |
|
|
|
|
|
], |
|
|
|
|
|
describes: [ |
|
|
|
|
|
], |
|
|
|
|
|
maintenancePhone: [ |
|
|
|
|
|
{ max: 11, message: '不得超过11个字符', trigger: 'blur' }, |
|
|
|
|
|
{ validator:validateHanset, message: '请输入数字格式', trigger: 'blur'} |
|
|
|
|
|
], |
|
|
status: [required], |
|
|
status: [required], |
|
|
type: [required], |
|
|
type: [required], |
|
|
concurrencyStamp: [required], |
|
|
|
|
|
faultType: [required], |
|
|
faultType: [required], |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
@ -141,16 +149,16 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '维修人', |
|
|
label: '检修人', |
|
|
field: 'maintenance', |
|
|
field: 'maintenance', |
|
|
sort: 'custom', |
|
|
sort: 'custom', |
|
|
isSearch: false, |
|
|
isSearch: false, |
|
|
table: { |
|
|
table: { |
|
|
width: '150', |
|
|
width: '150', |
|
|
}, |
|
|
}, |
|
|
api: () => userList, |
|
|
api: () => userListAll, |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|
|
return userList.find((account) => account.id == cellValue)?.name |
|
|
return userListAll.find((account) => account.id == cellValue)?.nickname |
|
|
}, |
|
|
}, |
|
|
search: { |
|
|
search: { |
|
|
show: true, |
|
|
show: true, |
|
@ -172,15 +180,18 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ |
|
|
labelField: 'name', |
|
|
labelField: 'name', |
|
|
valueField: 'id' |
|
|
valueField: 'id' |
|
|
}, |
|
|
}, |
|
|
placeholder: "请选择维修人" |
|
|
placeholder: "请选择检修人" |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// {
|
|
|
{ |
|
|
// label: '维修人联系电话',
|
|
|
label: '检修人联系电话', |
|
|
// field: 'maintenancePhone',
|
|
|
field: 'maintenancePhone', |
|
|
// sort: 'custom',
|
|
|
sort: 'custom', |
|
|
// },
|
|
|
table: { |
|
|
|
|
|
width: '150', |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
{ |
|
|
{ |
|
|
label: '状态', |
|
|
label: '状态', |
|
|
field: 'status', |
|
|
field: 'status', |
|
|