import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const EquipmentRepairRecordMainRules = reactive({ number: [required], type: [required], sources: [required], urgency: [required], level: [required], equipmentCode: [required], totalMinutes: [required], faultType: [required], concurrencyStamp: [required] }) export const EquipmentRepairRecordMain = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isForm: false }, { label: '维修编号', field: 'number', sort: 'custom', isSearch: true }, { label: '设备或工装字典', field: 'type', sort: 'custom', dictType: DICT_TYPE.DEVICE_TYPE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { component: 'SelectV2' } }, { label: '报修工单申请号', field: 'repairNumber', sort: 'custom', isSearch: true }, { label: '来源字典0:报修工单1:临时工单', field: 'sources', sort: 'custom', dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true }, { label: '维修描述', field: 'maintenanceDesc', sort: 'custom', isSearch: true }, { label: '紧急程度字典0:紧急故障1:重要故障2:一般故障', field: 'urgency', sort: 'custom', dictType: DICT_TYPE.REPAIR_DEGREE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { component: 'SelectV2' } }, { label: '维修级别0:大修1:中修2:小修', field: 'level', sort: 'custom', dictType: DICT_TYPE.REPAIR_LEVEL, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { component: 'SelectV2' } }, { label: '设备编号', field: 'equipmentCode', sort: 'custom', isSearch: true }, { label: '是否停机1不停机0停机', 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: true, 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: true, 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: true }, { label: '验证人', field: 'verifyer', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '验证内容', field: 'verifyContent', sort: 'custom', isSearch: true, form: { component: 'Editor', componentProps: { valueHtml: '', height: 200 } } }, { label: '验证时间', field: 'verifyTime', sort: 'custom', formatter: dateFormatter, isSearch: true, 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: true, form: { component: 'InputNumber', value: 0 } }, { label: '维修人联系电话', field: 'maintenancePhone', sort: 'custom', isSearch: true }, { label: '结果枚举临时措施、完成', field: 'completeResult', sort: 'custom', dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { component: 'SelectV2' } }, { label: '完成时间', field: 'completionTime', sort: 'custom', formatter: dateFormatter, isSearch: true, 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: true, 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: true, 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: true, form: { component: 'InputNumber', value: 0 } }, { label: '故障类型关联基础数据', field: 'faultType', sort: 'custom', dictType: DICT_TYPE.FAILURE_REASON, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { component: 'SelectV2' } }, { label: '流程状态枚举0:待派工1:已逾期2:已退单3:待接单4:待执行5:执行中6:待验证7:已完成8:已作废', field: 'status', sort: 'custom', isSearch: true, form: { component: 'Radio' } }, { label: '自动接单', field: 'autoOrder', sort: 'custom', isSearch: true }, { label: '自动执行', field: 'autoPerform', sort: 'custom', isSearch: true }, { label: '自动验证', field: 'autoVerify', sort: 'custom', isSearch: true }, { label: '直接生成记录', field: 'directCreateRecord', sort: 'custom', isSearch: true }, { label: '班组类型', field: 'classType', sort: 'custom', isSearch: true, form: { component: 'SelectV2' } }, { label: '所属厂区编号', field: 'factoryAreaCode', sort: 'custom', isSearch: true }, { label: '车间编号', field: 'workshopCode', sort: 'custom', isSearch: true }, { label: '工段编号', field: 'workshopSectionCode', sort: 'custom', isSearch: true }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, isSearch: true, 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')] } }, isForm: false }, { label: '部门id', field: 'departmentCode', sort: 'custom', isSearch: true }, { label: '备注', field: 'remark', sort: 'custom', isSearch: true }, { label: '地点ID', field: 'siteId', sort: 'custom', isSearch: true }, { label: '是否可用默认TRUE', field: 'available', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true }, { label: '删除时间', field: 'deletionTime', sort: 'custom', formatter: dateFormatter, isSearch: true, 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: '删除人id', field: 'deleterId', sort: 'custom', isSearch: true }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))