import type { CrudSchema } from '@/hooks/web/useCrudSchemas' 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"; import {dateFormatter} from '@/utils/formatTime' // 表单校验 export const EquipmentReportRepairRequestRules = reactive({ number: [required], type: [required], equipmentCode: [required], urgency: [required], repairmaner: [required], status: [required], shutDown:[required], repairPhone:[required], available:[required], }) export const EquipmentReportRepairRequest = useCrudSchemas(reactive([ { label: '报修编号', field: 'number', sort: 'custom', isSearch: true, isForm: false, isDetail:true, }, { label: '类型', field: 'type', sort: 'custom', dictType: DICT_TYPE.DEVICE_TYPE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: false, }, { 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: '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, }, { label: '故障描述', field: 'describing', sort: 'custom', isSearch: false }, { label: '是否停机', field: 'shutDown', sort: 'custom', dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true, form: { component: 'Radio' } }, { label: '报修图片', field: 'images', sort: 'custom', isSearch: false, }, // { // label: '所属厂区编号', // field: 'factoryAreaCode', // sort: 'custom', // isSearch: false, // }, { label: '车间编号', field: 'workshopCode', sort: 'custom', isSearch: false, 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: 'repairmaner', sort: 'custom', isSearch: false, }, { label: '报修人联系电话', field: 'repairPhone', sort: 'custom', isSearch: false }, { label: '报修状态', field: 'status', sort: 'custom', dictType: DICT_TYPE.EAM_REPAIR_STATUS, dictClass: 'string', isSearch: false, isForm: false, }, { label: '审核人', field: 'approver', sort: 'custom', isSearch: false, }, { label: '审核内容', field: 'approveContent', sort: 'custom', isSearch: false, }, { label: '审核时间', field: 'approveTime', 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: 'autoExamine', // sort: 'custom', // isSearch: true // }, // { // label: '自动通过', // field: 'autoAgree', // sort: 'custom', // isSearch: true // }, // { // label: '自动确认', // field: 'autoVerify', // sort: 'custom', // isSearch: true // }, { label: '备注', field: 'remark', sort: 'custom', isSearch: false, }, { label: '是否可用', field: 'available', sort: 'custom', dictType: DICT_TYPE.TRUE_FALSE, dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isSearch: true }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))