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.

438 lines
8.2 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[]>([
1 year ago
{
label: '编码',
1 year ago
field: 'number',
sort: 'custom',
isSearch: true,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '申请单号',
field: 'requestNumber',
1 year ago
sort: 'custom',
isSearch: true,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '物料编码',
field: 'materialCode',
sort: 'custom',
isSearch: true,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '物料批次',
field: 'materialBatch',
sort: 'custom',
isSearch: false,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '订单号',
field: 'orderCode',
sort: 'custom',
isSearch: false,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '订单行',
field: 'orderRow',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
1 year ago
value: 0,
componentProps:{
disabled:true
}
1 year ago
},
},
{
label: '凭证号',
field: 'certificateCode',
sort: 'custom',
isSearch: false,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '凭证行',
field: 'certificateRow',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
1 year ago
value: 0,
componentProps:{
disabled:true
}
1 year ago
},
},
{
label: '检验方案编码',
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: false,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
// {
// label: '检验方案Json',
// field: 'inspectionSchemeJson',
// sort: 'custom',
// isSearch: false,
// },
1 year ago
{
label: '检验批次',
field: 'inspectionBatch',
sort: 'custom',
isSearch: false,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '检验批数量',
field: 'inspectionBatchAmount',
sort: 'custom',
isSearch: false,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '采样总数量',
field: 'sampleTatalAmount',
sort: 'custom',
isSearch: false,
1 year ago
form: {
componentProps:{
disabled:true
}
},
1 year ago
},
{
label: '检验类型',
field: 'inspectionType',
sort: 'custom',
isSearch: false,
form: {
1 year ago
component: 'Select',
componentProps:{
disabled:true
}
1 year ago
},
},
{
label: '检验批来源',
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: false,
1 year ago
form:{
componentProps:{
disabled:true
}
}
1 year ago
},
{
label: '检验阶段',
field: 'inspectionStage',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
1 year ago
value: 0,
componentProps:{
disabled:true
}
1 year ago
},
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: false,
1 year ago
form:{
componentProps:{
disabled:true
}
}
1 year ago
},
{
label: '检验任务包装列表',
field: 'inspectionTaskPackageCode',
sort: 'custom',
isSearch: false,
1 year ago
form:{
componentProps:{
disabled:true
}
}
1 year ago
},
{
label: '检验任务工序列表',
field: 'inspectionTaskProcessCode',
sort: 'custom',
isSearch: false,
1 year ago
form:{
componentProps:{
disabled:true
}
}
1 year ago
},
{
label: '计划开始时间',
field: 'planStartTime',
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',
1 year ago
valueFormat: 'x',
disabled:true
1 year ago
}
},
},
{
label: '计划结束时间',
field: 'planEndTime',
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',
1 year ago
valueFormat: 'x',
disabled:true
1 year ago
}
},
},
{
label: '检验水平',
field: 'inspectionLevel',
sort: 'custom',
isSearch: false,
1 year ago
form:{
componentProps:{
disabled:true
}
}
1 year ago
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: false,
1 year ago
form:{
componentProps:{
disabled:true
}
}
},
{
label: '使用决策',
field: 'usageDecision',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.USAGE_DECISION,
form:{
componentProps:{
}
}
1 year ago
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: false,
1 year ago
form:{
componentProps:{
disabled:true
}
}
1 year ago
},
{
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[]>([
1 year ago
{
1 year ago
label: '编码',
1 year ago
field: 'number',
sort: 'custom',
isSearch: true,
},
{
1 year ago
label: '检验方案模板编码',
field: 'inspectionCode',
1 year ago
sort: 'custom',
isSearch: true,
},
{
1 year ago
label: '描述',
1 year ago
field: 'processDescribe',
sort: 'custom',
isSearch: true,
},
{
label: '顺序号',
field: 'sequenceCode',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
1 year ago
},
{
label: '检验特性编号',
1 year ago
field: 'inspectionCharCode',
1 year ago
sort: 'custom',
isSearch: true,
},
{
1 year ago
label: '检验特性编码',
field: 'inspectionJobCharacteristicsRespVO.number',
1 year ago
sort: 'custom',
},
{
1 year ago
label: '检验特性描述',
field: 'inspectionJobCharacteristicsRespVO.description',
sort: 'custom',
},{
label: '检验方法',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethodName',
sort: 'custom',
},{
label: '采样过程编码',
field: 'inspectionMethod',
sort: 'custom',
},{
label: '动态修改规则编码',
field: 'dynamicUpdateCode',
sort: 'custom',
},{
label: '是否允许修改特征值',
field: 'inspectionJobCharacteristicsRespVO.isCanUpdate',
sort: 'custom',
},{
label: '结果录入方式',
field: 'resultEntryMethod',
sort: 'custom',
},{
label: '特征类型',
field: 'featureType',
sort: 'custom',
}
]))
//表单校验
export const InspectionJobDetailRules = reactive({
taskCode: [required],
processCode: [required],
sequenceCode: [required],
available: [required],
})