You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

262 lines
6.4 KiB

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'
import {BasicFaultType} from "@/views/eam/basicFaultType/basicFaultType.data";
import * as BasicFaultTypeApi from "@/api/eam/basicFaultType";
// 表单校验
export const EquipmentReportRepairRequestRules = reactive({
number: [required],
type: [required],
equipmentCode: [required],
urgency: [required],
repairmaner: [required],
status: [required],
shutDown:[required],
repairPhone:[required],
available:[required],
workshopCode:[required],
faultType:[required],
})
export const EquipmentReportRepairRequest = useCrudSchemas(reactive<CrudSchema[]>([
{
11 months ago
label: '报修编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
isDetail:true,
},
{
11 months ago
label: '类型',
field: 'type',
sort: 'custom',
11 months ago
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
}]
}
}
},
{
11 months ago
label: '紧急程度',
field: 'urgency',
sort: 'custom',
11 months ago
dictType: DICT_TYPE.FAILURE_DEGREE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true
},
{
label: '故障类型枚举',
field: 'faultType',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择故障类型', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '故障类型信息', // 查询弹窗标题
searchAllSchemas: BasicFaultType.allSchemas, // 查询弹窗所需类
searchPage: BasicFaultTypeApi.getBasicFaultTypePage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
},
{
label: '故障描述',
field: 'describing',
sort: 'custom',
isSearch: false
},
{
11 months ago
label: '是否停机',
field: 'shutDown',
sort: 'custom',
11 months ago
dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
form: {
component: 'Radio'
}
},
{
11 months ago
label: '报修图片',
field: 'images',
sort: 'custom',
isSearch: false,
isForm: true,
isTable: true,
isDetail: false,
form: {
component: 'UploadImgs',
componentProps: {
limit:3,
upData:{
tableId:'1',
tableName:'request_equipment_report_repair'
}
}
}
},
// {
// 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
},
{
11 months ago
label: '报修状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.EAM_REPAIR_REPORT_STATUS,
dictClass: 'string',
isSearch: false,
isForm: false,
},
{
label: '审核人',
field: 'approver',
sort: 'custom',
isSearch: false,
isForm: false,
},
{
label: '审核内容',
field: 'approveContent',
sort: 'custom',
isSearch: false,
isForm: false,
},
{
label: '审核时间',
field: 'approveTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isForm: 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,
},
{
11 months ago
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true,
isForm: false
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))