|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
import {EquipmentAccounts} from "@/views/eam/equipmentAccounts/equipmentAccounts.data";
|
|
|
|
import * as EquipmentItemApi from "@/api/eam/equipmentAccounts";
|
|
|
|
|
|
|
|
// 表单校验
|
|
|
|
export const EquipmentRepairRecordMainRules = reactive({
|
|
|
|
number: [required],
|
|
|
|
type: [required],
|
|
|
|
sources: [required],
|
|
|
|
urgency: [required],
|
|
|
|
level: [required],
|
|
|
|
equipmentCode: [required],
|
|
|
|
totalMinutes: [required],
|
|
|
|
faultType: [required],
|
|
|
|
})
|
|
|
|
|
|
|
|
export const EquipmentRepairRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '维修编号',
|
|
|
|
field: 'number',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '类型',
|
|
|
|
field: 'type',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.DEVICE_TYPE,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
isSearch: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '报修工单号',
|
|
|
|
field: 'repairNumber',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '来源字典',
|
|
|
|
field: 'sources',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.EAM_MAINTENANCE_SOURCES,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
isSearch: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '维修描述',
|
|
|
|
field: 'maintenanceDesc',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '紧急程度',
|
|
|
|
field: 'urgency',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.EAM_MAINTENANCE_URGENCY,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
isSearch: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '维修级别',
|
|
|
|
field: 'level',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.EAM_MAINTENANCE_LEVEL,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
isSearch: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '设备编号',
|
|
|
|
field: 'equipmentCode',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
isForm: true,
|
|
|
|
form: {
|
|
|
|
componentProps: {
|
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchTitle: '设备信息', // 查询弹窗标题
|
|
|
|
searchListPlaceholder: '请选择 设备编号', // 输入框占位文本
|
|
|
|
searchAllSchemas: EquipmentAccounts.allSchemas, // 查询弹窗所需类
|
|
|
|
searchField: 'code', // 查询弹窗赋值字段
|
|
|
|
searchPage: EquipmentItemApi.getEquipmentAccountsPage, // 查询弹窗所需分页方法
|
|
|
|
multiple:true,
|
|
|
|
searchCondition: [{
|
|
|
|
key: 'status',
|
|
|
|
value: 'NORMAL',
|
|
|
|
action: '==',
|
|
|
|
isSearch: true,
|
|
|
|
isMainValue: false
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '是否停机',
|
|
|
|
field: 'shutDown',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
isSearch: true,
|
|
|
|
form: {
|
|
|
|
component: 'Radio'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '维修开始时间',
|
|
|
|
field: 'startTime',
|
|
|
|
sort: 'custom',
|
|
|
|
formatter: dateFormatter,
|
|
|
|
isSearch: false,
|
|
|
|
search: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
type: 'daterange',
|
|
|
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
type: 'datetime',
|
|
|
|
valueFormat: 'x'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '维修结束时间',
|
|
|
|
field: 'endTime',
|
|
|
|
sort: 'custom',
|
|
|
|
formatter: dateFormatter,
|
|
|
|
isSearch: false,
|
|
|
|
search: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
type: 'daterange',
|
|
|
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
type: 'datetime',
|
|
|
|
valueFormat: 'x'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '维修时间',
|
|
|
|
field: 'totalMinutes',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '验证人',
|
|
|
|
field: 'verifyer',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '验证内容',
|
|
|
|
field: 'verifyContent',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
form: {
|
|
|
|
component: 'Editor',
|
|
|
|
componentProps: {
|
|
|
|
valueHtml: '',
|
|
|
|
height: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '验证时间',
|
|
|
|
field: 'verifyTime',
|
|
|
|
sort: 'custom',
|
|
|
|
formatter: dateFormatter,
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
search: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
type: 'daterange',
|
|
|
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
type: 'datetime',
|
|
|
|
valueFormat: 'x'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '执行人',
|
|
|
|
field: 'maintenancer',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '维修人联系电话',
|
|
|
|
field: 'maintenancePhone',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '结果枚举',
|
|
|
|
field: 'completeResult',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.EAM_COMPLETE_RESULT,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '完成时间',
|
|
|
|
field: 'completionTime',
|
|
|
|
sort: 'custom',
|
|
|
|
formatter: dateFormatter,
|
|
|
|
isSearch: false,
|
|
|
|
search: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
type: 'daterange',
|
|
|
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
type: 'datetime',
|
|
|
|
valueFormat: 'x'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '执行时间',
|
|
|
|
field: 'maintenanceTime',
|
|
|
|
sort: 'custom',
|
|
|
|
formatter: dateFormatter,
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
search: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
type: 'daterange',
|
|
|
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
type: 'datetime',
|
|
|
|
valueFormat: 'x'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '报修时间',
|
|
|
|
field: 'repairTime',
|
|
|
|
sort: 'custom',
|
|
|
|
formatter: dateFormatter,
|
|
|
|
isSearch: false,
|
|
|
|
search: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
type: 'daterange',
|
|
|
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
type: 'datetime',
|
|
|
|
valueFormat: 'x'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '报修人',
|
|
|
|
field: 'repairer',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '故障类型',
|
|
|
|
field: 'faultType',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.FAILURE_REASON,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
isSearch: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '流程状态',
|
|
|
|
field: 'status',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.EAM_REPAIR_STATUS,
|
|
|
|
dictClass: 'string',
|
|
|
|
isSearch: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '维修经验',
|
|
|
|
field: 'isExperience',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '自动接单',
|
|
|
|
field: 'autoOrder',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '自动执行',
|
|
|
|
field: 'autoPerform',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '自动验证',
|
|
|
|
field: 'autoVerify',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '直接生成记录',
|
|
|
|
field: 'directCreateRecord',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '班组类型',
|
|
|
|
field: 'classType',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '所属厂区编号',
|
|
|
|
field: 'factoryAreaCode',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '车间编号',
|
|
|
|
field: 'workshopCode',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '工段编号',
|
|
|
|
field: 'workshopSectionCode',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '备注',
|
|
|
|
field: 'remark',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '是否可用',
|
|
|
|
field: 'available',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
isSearch: false,
|
|
|
|
isTable: false,
|
|
|
|
isForm: false,
|
|
|
|
isDetail:false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '操作',
|
|
|
|
field: 'action',
|
|
|
|
isForm: false,
|
|
|
|
table: {
|
|
|
|
width: 150,
|
|
|
|
fixed: 'right'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]))
|