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.

245 lines
5.5 KiB

11 months ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const InspectionTemplateRules = reactive({
description: [
11 months ago
{ required: true, message: '请填写描述', trigger: 'blur' }
11 months ago
],
version: [
11 months ago
{ required: true, message: '请填写版本', trigger: 'blur' }
11 months ago
],
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' }
],
})
11 months ago
export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
11 months ago
{
label: '编码',
field: 'code',
sort: 'custom',
11 months ago
table: {
width: 220,
fixed: 'left'
},
11 months ago
isSearch: true,
form: {
componentProps: {
disabled: true,
placeholder: '系统自动获取'
11 months ago
}
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
11 months ago
width: 200
},
11 months ago
isSearch: true,
},
11 months ago
{
label: '物料编码',
field: 'itemCode',
11 months ago
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
isSearch: true,
}, {
label: '描述',
field: 'description',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
}, {
11 months ago
label: '版本',
field: 'version',
sort: 'custom',
11 months ago
table: {
width: 150
}
11 months ago
}, {
label: '检验类型编码',
field: 'inspectionType',
dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string',
11 months ago
sort: 'custom',
11 months ago
table: {
11 months ago
width: 175
11 months ago
}
11 months ago
}, {
label: '检验模板编码',
field: 'programmeTemplateCode',
11 months ago
sort: 'custom',
11 months ago
table: {
11 months ago
width: 175
11 months ago
}
11 months ago
}, {
label: '拆分规则',
field: 'splitRule',
11 months ago
sort: 'custom',
dictType: DICT_TYPE.SPLIT_RULES,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
11 months ago
table: {
11 months ago
width: 175
11 months ago
},
}, {
label: 'aql',
field: 'aql',
11 months ago
sort: 'custom',
dictType: DICT_TYPE.BASIC_AQL,
11 months ago
dictClass: 'string',
table: {
width: 150
}
11 months ago
}, {
label: '检验水平',
field: 'inspectionLevel',
11 months ago
sort: 'custom',
dictType: DICT_TYPE.INSPECTION_LEVEL,
11 months ago
dictClass: 'string',
table: {
width: 150
11 months ago
},
isSearch: true,
},
11 months ago
{
label: '每份样品量',
field: 'samplePieceSize',
sort: 'custom',
table: {
width: 140
}
},
11 months ago
{
label: '生效时间',
field: 'effectiveDate',
11 months ago
sort: 'custom',
11 months ago
formatter: dateFormatter,
11 months ago
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',
}
},
11 months ago
table: {
width: 175
},
11 months ago
},
{
label: '失效时间',
field: 'expirationDate',
11 months ago
sort: 'custom',
11 months ago
formatter: dateFormatter,
11 months ago
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',
}
},
11 months ago
table: {
width: 175
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 110
}
},
{
label: '操作',
field: 'action',
11 months ago
isDetail: false,
11 months ago
isForm: false,
table: {
width: 150,
fixed: 'right'
11 months ago
},
11 months ago
}
]))