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.

330 lines
6.6 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
const { t } = useI18n() // 国际化
/**
* @returns {Array}
*/
export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '申请编码',
field: 'inspectionCode',
sort: 'custom',
isSearch: true,
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
},
{
label: '物料编码',
field: 'materialCode',
sort: 'custom',
isSearch: true,
},
{
label: '物料批次',
field: 'materialBatch',
sort: 'custom',
isSearch: true,
},
{
label: '订单号',
field: 'orderCode',
sort: 'custom',
isSearch: true,
},
{
label: '订单行',
field: 'orderRow',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '凭证号',
field: 'certificateCode',
sort: 'custom',
isSearch: true,
},
{
label: '凭证行',
field: 'certificateRow',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '检验方案编码',
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: true,
},
{
label: '检验方案Json',
field: 'inspectionSchemeJson',
sort: 'custom',
isSearch: true,
},
{
label: '检验批次',
field: 'inspectionBatch',
sort: 'custom',
isSearch: true,
},
{
label: '检验批数量',
field: 'inspectionBatchAmount',
sort: 'custom',
isSearch: true,
},
{
label: '采样总数量',
field: 'sampleTatalAmount',
sort: 'custom',
isSearch: true,
},
{
label: '检验类型',
field: 'inspectionType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '检验批来源',
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: true,
},
{
label: '检验阶段',
field: 'inspectionStage',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: true,
},
{
label: '检验任务包装列表',
field: 'inspectionTaskPackageCode',
sort: 'custom',
isSearch: true,
},
{
label: '检验任务工序列表',
field: 'inspectionTaskProcessCode',
sort: 'custom',
isSearch: true,
},
{
label: '计划开始时间',
field: 'planStartTime',
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: 'planEndTime',
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: 'inspectionLevel',
sort: 'custom',
isSearch: true,
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
//表单校验
export const InspectionJobMainRules = reactive({
number: [required],
inspectionCode: [required],
supplierCode: [required],
materialCode: [required],
materialBatch: [required],
orderCode: [required],
certificateRow: [required],
inspectionSchemeCode: [required],
inspectionSchemeJson: [required],
inspectionBatch: [required],
inspectionBatchAmount: [required],
sampleTatalAmount: [required],
inspectionType: [required],
inspectionBatchSource: [required],
inspectionStage: [required],
inspectionStringency: [required],
inspectionLevel: [required],
available: [required],
})
/**
* @returns {Array}
*/
export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isSearch: true,
isForm: false,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '任务编码',
field: 'taskCode',
sort: 'custom',
isSearch: true,
},
{
label: '工序编码',
field: 'processCode',
sort: 'custom',
isSearch: true,
},
{
label: '工序描述',
field: 'processDescribe',
sort: 'custom',
isSearch: true,
},
{
label: '顺序号',
field: 'sequenceCode',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '检验特性编号',
field: 'inspectionFeatureCode',
sort: 'custom',
isSearch: true,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
}
]))
//表单校验
export const InspectionJobDetailRules = reactive({
taskCode: [required],
processCode: [required],
sequenceCode: [required],
available: [required],
})