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.
127 lines
2.6 KiB
127 lines
2.6 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'
|
|
},
|
|
{
|
|
label: '检验类型编码',
|
|
field: 'testTypeCode',
|
|
sort: 'custom',
|
|
isSearch: true
|
|
},
|
|
{
|
|
label: '供应商编码',
|
|
field: 'supplierCode',
|
|
sort: 'custom',
|
|
isSearch: true
|
|
},
|
|
{
|
|
label: '连续合格次数',
|
|
field: 'qualifiedTimes',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
},
|
|
{
|
|
label: '最后合格批次',
|
|
field: 'lastQualifiedBatch',
|
|
sort: 'custom',
|
|
isSearch: false
|
|
},
|
|
{
|
|
label: '最后合格时间',
|
|
field: 'lastQualifiedTime',
|
|
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: 'unqualifiedTimes',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
form: {
|
|
component: 'InputNumber',
|
|
value: 0
|
|
}
|
|
},
|
|
{
|
|
label: '最后不合格批次',
|
|
field: 'lastUnqualifiedBatch',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
form: {
|
|
component: 'InputNumber',
|
|
value: 0
|
|
}
|
|
},
|
|
{
|
|
label: '最后不合格时间',
|
|
field: 'lastUnqualifiedTime',
|
|
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: 'nextStage',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
},
|
|
// {
|
|
// label: '操作',
|
|
// field: 'action',
|
|
// isForm: false,
|
|
// table: {
|
|
// width: 150,
|
|
// fixed: 'right'
|
|
// }
|
|
// }
|
|
]))
|
|
|