import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const EquipmentReportRepairRequestRules = reactive({ number: [required], type: [required], equipmentCode: [required], urgency: [required], repairmaner: [required], status: [required], concurrencyStamp: [required] }) export const EquipmentReportRepairRequest = 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: 'equipmentCode', sort: 'custom', isSearch: true }, { label: '紧急程度字典0:紧急故障1:重要故障2:一般故障', field: 'urgency', sort: 'custom', dictType: DICT_TYPE.FAILURE_DEGREE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true }, { label: '故障类型枚举', field: 'faultType', sort: 'custom', dictType: DICT_TYPE.FAILURE_REASON, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { component: 'SelectV2' } }, { label: '故障描述', field: 'describing', 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: 'images', sort: 'custom', isSearch: true }, { label: '所属厂区编号', field: 'factoryAreaCode', sort: 'custom', isSearch: true }, { label: '车间编号', field: 'workshopCode', sort: 'custom', isSearch: true }, { label: '工段编号', field: 'workshopSectionCode', sort: 'custom', isSearch: true }, { label: '报修人', field: 'repairmaner', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '报修人联系电话', field: 'repairPhone', sort: 'custom', isSearch: true }, { label: '报修状态0:待审核1:已撤回2:审核中3:已通过4:已驳回5:已创建6:已确认', field: 'status', sort: 'custom', isSearch: true, form: { component: 'Radio' } }, { label: '审核人', field: 'approver', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 } }, { label: '审核内容', field: 'approveContent', sort: 'custom', isSearch: true, form: { component: 'Editor', componentProps: { valueHtml: '', height: 200 } } }, { label: '审核时间', field: 'approveTime', 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: 'autoExamine', sort: 'custom', isSearch: true }, { label: '自动通过', field: 'autoAgree', sort: 'custom', isSearch: true }, { label: '自动确认', field: 'autoVerify', 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: '部门', field: 'departmentCode', sort: 'custom', isSearch: true }, { label: '备注', field: 'remark', sort: 'custom', isSearch: true }, { label: '地点', 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' } } ]))