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.
280 lines
7.1 KiB
280 lines
7.1 KiB
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
// 表单校验
|
|
|
|
export const InspectionTemplateRules = reactive({
|
|
description: [{ required: true, message: '请填写描述', trigger: 'blur' }],
|
|
version: [{ required: true, message: '请填写版本', trigger: 'blur' }],
|
|
inspectionCode: [{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' }],
|
|
sequenceCode: [{ required: true, message: '请填写顺序号', trigger: 'blur' }],
|
|
inspectionCharCode: [{ required: true, message: '请选择检验特性编码', trigger: 'blur' }],
|
|
describe: [{ required: true, message: '请填写描述', trigger: 'blur' }],
|
|
inspectionMethodCode: [{ required: true, message: '请选择检验方法编码', trigger: 'blur' }],
|
|
dynamicUpdateCode: [{ required: true, message: '请选择采样过程编码', trigger: 'blur' }],
|
|
inspectionMethod: [{ required: true, message: '请选择动态修改规则编码', trigger: 'blur' }],
|
|
isCanUpdate: [{ required: true, message: '请选择是否允许修改特征值', trigger: 'blur' }],
|
|
isDestructionInspection: [{ required: true, message: '请选择是否破坏性检验', trigger: 'blur' }],
|
|
resultEntryMethod: [{ required: true, message: '请选择结果录入方式', trigger: 'blur' }],
|
|
featureType: [{ required: true, message: '请选择特征类型', trigger: 'blur' }],
|
|
quantifyIsCapping: [{ required: true, message: '请选择是否设定上限', trigger: 'blur' }],
|
|
quantifyIsLowlimit: [{ required: true, message: '请选择是否设定下限', trigger: 'blur' }],
|
|
quantifyTarget: [{ required: true, message: '请输入目标值', trigger: 'blur' }],
|
|
quantifyCapping: [{ required: true, message: '请输入上限值', trigger: 'blur' }],
|
|
quantifyLowlimit: [{ required: true, message: '请输入下限值', trigger: 'blur' }],
|
|
quantifyquantifyUomLowlimit: [{ required: true, message: '请选择计量单位', trigger: 'blur' }],
|
|
quantifyDecimal: [{ required: true, message: '请输入小数位', trigger: 'blur' }],
|
|
quantifyQuantifyCode: [{ required: true, message: '请输入选择集编码', trigger: 'blur' }]
|
|
})
|
|
export const InspectionSchemeMain = useCrudSchemas(
|
|
reactive<CrudSchema[]>([
|
|
{
|
|
label: '编码',
|
|
field: 'code',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 220,
|
|
fixed: 'left'
|
|
},
|
|
isSearch: true,
|
|
form: {
|
|
componentProps: {
|
|
disabled: true,
|
|
placeholder: '系统自动获取'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '物料名称',
|
|
field: 'itemName',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 200
|
|
},
|
|
isSearch: true
|
|
},
|
|
{
|
|
label: '物料编码',
|
|
field: 'itemCode',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
},
|
|
isSearch: true
|
|
},
|
|
{
|
|
label: '描述',
|
|
field: 'description',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
}
|
|
},
|
|
{
|
|
label: '版本',
|
|
field: 'version',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
}
|
|
},
|
|
{
|
|
label: '检验类型编码',
|
|
field: 'inspectionType',
|
|
dictType: DICT_TYPE.INSPECTION_TYPE,
|
|
dictClass: 'string',
|
|
sort: 'custom',
|
|
isSearch: true,
|
|
table: {
|
|
width: 175
|
|
}
|
|
},
|
|
{
|
|
label: '检验模板编码',
|
|
field: 'programmeTemplateCode',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 175
|
|
}
|
|
},
|
|
{
|
|
label: '拆分规则',
|
|
field: 'splitRule',
|
|
sort: 'custom',
|
|
dictType: DICT_TYPE.SPLIT_RULES,
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
table: {
|
|
width: 175
|
|
}
|
|
},
|
|
{
|
|
label: 'aql',
|
|
field: 'aql',
|
|
sort: 'custom',
|
|
dictType: DICT_TYPE.BASIC_AQL,
|
|
dictClass: 'string',
|
|
table: {
|
|
width: 150
|
|
}
|
|
},
|
|
{
|
|
label: '检验水平',
|
|
field: 'inspectionLevel',
|
|
sort: 'custom',
|
|
dictType: DICT_TYPE.INSPECTION_LEVEL,
|
|
dictClass: 'string',
|
|
table: {
|
|
width: 150
|
|
},
|
|
isSearch: true
|
|
},
|
|
{
|
|
label: '每份样品量',
|
|
field: 'samplePieceSize',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 140
|
|
}
|
|
},
|
|
{
|
|
label: '生效时间',
|
|
field: 'effectiveDate',
|
|
sort: 'custom',
|
|
formatter: dateFormatter,
|
|
isForm: false,
|
|
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'
|
|
}
|
|
},
|
|
table: {
|
|
width: 175
|
|
}
|
|
},
|
|
{
|
|
label: '失效时间',
|
|
field: 'expirationDate',
|
|
sort: 'custom',
|
|
formatter: dateFormatter,
|
|
isForm: false,
|
|
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'
|
|
}
|
|
},
|
|
table: {
|
|
width: 175
|
|
}
|
|
},
|
|
{
|
|
label: '是否可用',
|
|
field: 'available',
|
|
sort: 'custom',
|
|
isSearch: true,
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
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'
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '创建者',
|
|
field: 'creator',
|
|
table: {
|
|
width: 130
|
|
},
|
|
isForm: false,
|
|
isTable: true
|
|
},
|
|
{
|
|
label: '最后更新时间',
|
|
field: 'updateTime',
|
|
sort: 'custom',
|
|
isDetail: true,
|
|
isForm: false,
|
|
isTable: false,
|
|
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: false,
|
|
table: {
|
|
width: 150
|
|
}
|
|
},
|
|
{
|
|
label: '操作',
|
|
field: 'action',
|
|
isForm: false,
|
|
isDetail: false,
|
|
table: {
|
|
width: 180,
|
|
fixed: 'right'
|
|
}
|
|
}
|
|
])
|
|
)
|
|
|