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"; import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data"; import * as WorkshopApi from "@/api/wms/workshop"; // 表单校验 export const EquipmentMaintenanceMainRules = reactive({ number: [required], equipmentCode: [required], planNumber: [required], status: [required], factoryAreaCode: [required], }) export const EquipmentMaintenanceMain = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, }, { label: '保养工单编号', field: 'number', sort: 'custom', isForm: false, isSearch: true, }, { label: '描述', field: 'describing', sort: 'custom', isSearch: true, }, { label: '设备类别', field: 'type', dictType: DICT_TYPE.DEVICE_TYPE, dictClass: 'string', sort: 'custom', 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: 'classes', sort: 'custom', isSearch: true, }, { label: '保养计划工单号', field: 'planNumber', sort: 'custom', isSearch: true, }, { label: '故障类型枚举', field: 'faultType', sort: 'custom', isSearch: true, }, { label: '保养周期', field: 'cycle', sort: 'custom', isSearch: true, }, { label: '保养次数', field: 'times', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 }, }, { label: '验证人', field: 'verifyer', sort: 'custom', isSearch: true, }, { label: '验证内容', field: 'verifyContent', sort: 'custom', isSearch: true, }, { 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: '保养人id', field: 'maintenancer', sort: 'custom', isSearch: true, }, { label: '保养人联系电话', field: 'maintenancePhone', sort: 'custom', isSearch: true, }, { label: '结果枚举临时措施、完成', field: 'completeResult', sort: 'custom', isSearch: true, }, { 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: 'status', sort: 'custom', isSearch: true, dictType: DICT_TYPE.EAM_ORDER_STATUS, dictClass: 'string', }, { label: '所属厂区编号', field: 'factoryAreaCode', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, }, { label: '车间编号', field: 'workshopCode', sort: 'custom', isSearch: true, required: true, form: { // labelMessage: '信息提示说明!!!', componentProps: { isSearchList: true, // 开启查询弹窗 searchListPlaceholder: '车间', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段 searchTitle: '车间信息', // 查询弹窗标题 searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类 searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'available', value: 'TRUE', isMainValue: false }] } }, }, { 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: false, isTable: false, isForm: false, isDetail:false, }, { label: '备注', field: 'remark', sort: 'custom', isSearch: true, }, { label: '地点ID', field: 'siteId', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, }, { label: '是否可用默认TRUE', field: 'available', sort: 'custom', isSearch: true, dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 }, { label: '删除时间', field: 'deletionTime', 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: '删除人id', field: 'deleterId', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, form: { component: 'InputNumber', value: 0 }, }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ])) export const EquipmentMaintenanceDetailRules = reactive({ number: [required], contents: [required], }) export const EquipmentMaintenanceDetail = useCrudSchemas(reactive([ { label: 'id', field: 'id', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, }, { label: '保养工单号', field: 'number', sort: 'custom', isSearch: true, }, { label: '主表id', field: 'masterId', sort: 'custom', isSearch: true, }, { label: '人数', field: 'peoples', sort: 'custom', isSearch: true, }, { label: '预计分钟', field: 'estimatedMinutes', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 }, }, { label: '实际分钟', field: 'actualMinutes', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 }, }, { label: '责任人多选', field: 'chargePeoples', sort: 'custom', isSearch: true, }, { 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: 'uncompletedCause', sort: 'custom', isSearch: true, }, { label: '结果枚举', field: 'result', sort: 'custom', isSearch: true, }, { label: '保养名称', field: 'name', sort: 'custom', isSearch: true, }, { label: '保养内容', field: 'content', sort: 'custom', isSearch: true, }, { label: '保养部位', field: 'equipmentParts', 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: false, isTable: false, isForm: false, isDetail:false, }, { label: '备注', field: 'remark', sort: 'custom', isSearch: true, }, { label: '地点ID', field: 'siteId', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, }, { label: '是否可用', field: 'available', sort: 'custom', isSearch: true, dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 }, { label: '删除时间', field: 'deletionTime', 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: '删除人id', field: 'deleterId', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, form: { component: 'InputNumber', value: 0 }, }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))