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.
205 lines
4.7 KiB
205 lines
4.7 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: 150
|
|
},
|
|
isSearch:true,
|
|
},
|
|
{
|
|
label: '物料编码',
|
|
field: 'itemCode',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
},
|
|
isSearch:true,
|
|
}, {
|
|
label: '描述',
|
|
field: 'description',
|
|
sort: 'custom',
|
|
},{
|
|
label: '版本',
|
|
field: 'version',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
}
|
|
},{
|
|
label: '检验类型编码',
|
|
field: 'testTypeCode',
|
|
dictType: DICT_TYPE.INSPECTION_TYPE,
|
|
dictClass: 'string',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
}
|
|
},{
|
|
label: '检验模板编码',
|
|
field: 'programmeTemplateCode',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
}
|
|
},{
|
|
label: '拆分规则',
|
|
field: 'splitRule',
|
|
sort: 'custom',
|
|
dictType: DICT_TYPE.SPLIT_RULES,
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
table: {
|
|
width: 150
|
|
},
|
|
},{
|
|
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: 'effectiveDate',
|
|
sort: 'custom',
|
|
formatter: dateFormatter,
|
|
table: {
|
|
width: 180
|
|
}
|
|
},{
|
|
label: '失效时间',
|
|
field: 'expirationDate',
|
|
sort: 'custom',
|
|
formatter: dateFormatter,
|
|
table: {
|
|
width: 180
|
|
}
|
|
},{
|
|
label: '是否可用',
|
|
field: 'available',
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
dictClass: 'string',
|
|
isTable: true,
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
},
|
|
form: {
|
|
component: 'Switch',
|
|
value: 'TRUE',
|
|
componentProps: {
|
|
inactiveValue: 'FALSE',
|
|
activeValue: 'TRUE'
|
|
}
|
|
},
|
|
},
|
|
{
|
|
label: '操作',
|
|
field: 'action',
|
|
isDetail: false,
|
|
isForm: false ,
|
|
table: {
|
|
width: 150,
|
|
fixed: 'right'
|
|
},
|
|
}
|
|
]))
|
|
|