|
|
|
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<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
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: '紧急程度',
|
|
|
|
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: '是否停机',
|
|
|
|
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: '报修状态',
|
|
|
|
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: 'remark',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '是否可用',
|
|
|
|
field: 'available',
|
|
|
|
sort: 'custom',
|
|
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
isSearch: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '操作',
|
|
|
|
field: 'action',
|
|
|
|
isForm: false,
|
|
|
|
table: {
|
|
|
|
width: 150,
|
|
|
|
fixed: 'right'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]))
|