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.
 
 
 

275 lines
5.7 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const CounterRules = reactive({
itemCode: [required],
qualifiedTimes: [required],
unqualifiedTimes: [required],
lastUnqualifiedBatch: [required],
lastUnqualifiedTime: [required],
nextStage: [required],
available: [required],
concurrencyStamp: [required]
})
export const Counter = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '物料编码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
fixed: 'left',
isForm: false,
table: {
fixed: 'left',
width: 175
}
},
{
label: '检验类型编码',
field: 'inspectionType',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.INSPECTION_TYPE,
isForm: false,
table: {
width: 175
}
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 175
}
},
{
label: '连续合格次数',
field: 'qualifiedTimes',
sort: 'custom',
isSearch: false,
isForm: false,
table: {
width: 140
}
},
{
label: '最后合格批次',
field: 'lastQualifiedBatch',
sort: 'custom',
isSearch: false,
isForm: false,
table: {
width: 140
}
},
{
label: '最后合格时间',
field: 'lastQualifiedTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
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'
}
},
table: {
width: 175
}
},
{
label: '连续不合格次数',
field: 'unqualifiedTimes',
sort: 'custom',
isSearch: false,
isForm: false,
form: {
component: 'InputNumber',
value: 0
},
table: {
width: 140
}
},
{
label: '最后不合格批次',
field: 'lastUnqualifiedBatch',
sort: 'custom',
isSearch: false,
isForm: false,
form: {
component: 'InputNumber',
value: 0
},
table: {
width: 175
}
},
{
label: '最后不合格时间',
field: 'lastUnqualifiedTime',
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'
}
},
table: {
width: 175
}
},
{
label: '下一检验阶段',
field: 'nextStage',
sort: 'custom',
isSearch: false,
form: {
component: 'Select',
componentProps: {
options: [],
optionsAlias: {
labelField: 'stage',
valueField: 'stage'
}
}
},
table: {
width: 140
}
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
isSearch: true,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
search: {
value: 'TRUE'
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 110
}
},
{
label: '创建时间',
field: 'createTime',
isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
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')]
}
}
},
{
label: '创建者',
field: 'creator',
table: {
width: 130
},
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width: '100%' },
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: true,
table: {
width: 150
}
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
])
)