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.

615 lines
12 KiB

12 months ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
import { validateTwoNum,validateSixNum} from '@/utils/validator'
12 months ago
const { t } = useI18n() // 国际化
11 months ago
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const resultEntryMethodList = getStrDictOptions(DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY)
const featureTypeList = getStrDictOptions( DICT_TYPE.INSPECTION_CHARACTERISTICS_FEATURE_TYPE )
const isCanUpdateList = [{
label:'是',
value:true
},{
label:'否',
value:false
}]
12 months ago
/**
* @returns {Array}
12 months ago
*/
export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
12 months ago
{
label: '编码',
12 months ago
field: 'number',
sort: 'custom',
isSearch: true,
11 months ago
form: {
componentProps:{
disabled:true
}
},
11 months ago
table: {
11 months ago
width: 200,
fixed: 'left'
11 months ago
}
12 months ago
},
{
label: '申请单号',
field: 'requestNumber',
12 months ago
sort: 'custom',
isSearch: true,
11 months ago
form: {
componentProps:{
disabled:true
}
},
11 months ago
table: {
11 months ago
width: 200
11 months ago
}
12 months ago
},
{
label: '供应商编码',
field: 'supplierCode',
sort: 'custom',
isSearch: true,
11 months ago
form: {
componentProps:{
disabled:true
}
},
11 months ago
table: {
11 months ago
width: 175
11 months ago
}
},{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isSearch: false,
table: {
11 months ago
width: 175
},
form: {
componentProps:{
disabled:true
}
},
12 months ago
},
{
label: '物料编码',
field: 'itemCode',
12 months ago
sort: 'custom',
isSearch: false,
table: {
width: 150
},
11 months ago
form: {
componentProps:{
disabled:true
}
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
11 months ago
table: {
11 months ago
width: 175
},
form: {
componentProps:{
disabled:true
}
},
12 months ago
},
{
label: '物料批次',
field: 'batch',
12 months ago
sort: 'custom',
isSearch: false,
11 months ago
form: {
componentProps:{
disabled:true
}
},
11 months ago
table: {
width: 150
}
12 months ago
},
{
11 months ago
label: '参考订单号',
field: 'referenceOrderCode',
12 months ago
sort: 'custom',
isSearch: false,
11 months ago
form: {
componentProps:{
disabled:true
}
},
11 months ago
table: {
width: 150
}
12 months ago
},
{
11 months ago
label: '参考订单行',
field: 'referenceOrderRow',
12 months ago
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
11 months ago
value: 0,
componentProps:{
disabled:true
}
12 months ago
},
11 months ago
table: {
width: 150
}
12 months ago
},
{
11 months ago
label: '参考凭证号',
field: 'referenceCertificateCode',
12 months ago
sort: 'custom',
isSearch: false,
11 months ago
form: {
componentProps:{
disabled:true
}
},
11 months ago
table: {
width: 150
}
12 months ago
},
{
11 months ago
label: '参考凭证行',
field: 'referenceCertificateRow',
12 months ago
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
11 months ago
value: 0,
componentProps:{
disabled:true
}
12 months ago
},
11 months ago
table: {
width: 150
}
12 months ago
},
{
label: '检验方案编码',
field: 'inspectionSchemeCode',
sort: 'custom',
isSearch: false,
11 months ago
form: {
componentProps:{
disabled:true
}
},
11 months ago
table: {
11 months ago
width: 200
11 months ago
}
12 months ago
},
{
label: '检验批次',
field: 'inspectionBatch',
sort: 'custom',
isSearch: false,
11 months ago
form: {
componentProps:{
disabled:true
}
},
11 months ago
table: {
width: 150
}
12 months ago
},
{
label: '检验批数量',
field: 'inspectionBatchAmount',
sort: 'custom',
isSearch: false,
11 months ago
form: {
componentProps:{
disabled:true
}
},
11 months ago
table: {
width: 150
}
12 months ago
},
// {
// label: '采样总数量',
// field: 'sampleTotalAmount',
// sort: 'custom',
// isSearch: false,
// form: {
// componentProps:{
// disabled:true
// }
// },
// table: {
// width: 150
// }
// },
12 months ago
{
label: '检验类型',
field: 'inspectionType',
sort: 'custom',
isSearch: false,
11 months ago
dictType: DICT_TYPE.INSPECTION_TYPE,
dictClass: 'string',
12 months ago
form: {
11 months ago
component: 'Select',
componentProps:{
disabled:true
}
12 months ago
},
11 months ago
table: {
width: 150
}
12 months ago
},
// {
// label: '检验批来源',
// field: 'inspectionBatchSource',
// sort: 'custom',
// isSearch: false,
// dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
// dictClass: 'string',
// form:{
// componentProps:{
// disabled:true
// }
// },
// table: {
// width: 150
// }
// },
12 months ago
{
label: '检验阶段',
field: 'inspectionStage',
sort: 'custom',
isSearch: false,
form: {
component: 'InputNumber',
11 months ago
value: 0,
componentProps:{
disabled:true
}
12 months ago
},
11 months ago
table: {
width: 150
}
12 months ago
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: false,
11 months ago
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string',
11 months ago
form:{
componentProps:{
disabled:true
}
11 months ago
},
table: {
width: 150
11 months ago
}
12 months 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',
11 months ago
valueFormat: 'x',
disabled:true
12 months ago
}
},
11 months ago
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
11 months ago
table: {
11 months ago
width: 175
11 months ago
}
12 months 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',
11 months ago
valueFormat: 'x',
disabled:true
12 months ago
}
},
11 months ago
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
11 months ago
table: {
11 months ago
width: 175
11 months ago
}
12 months ago
},
{
label: '检验水平',
field: 'inspectionLevel',
sort: 'custom',
isSearch: false,
11 months ago
dictType: DICT_TYPE.INSPECTION_LEVEL,
dictClass: 'string',
11 months ago
form:{
componentProps:{
disabled:true
}
11 months ago
},
table: {
width: 150
11 months ago
}
12 months ago
},
{
label: 'AQL值',
field: 'aqlValue',
sort: 'custom',
isSearch: false,
11 months ago
dictType: DICT_TYPE.BASIC_AQL,
dictClass: 'string',
11 months ago
form:{
componentProps:{
disabled:true
}
11 months ago
},
table: {
width: 150
11 months ago
}
},
// {
// label: '使用决策',
// field: 'usageDecision',
// sort: 'custom',
// isSearch: false,
// dictType: DICT_TYPE.USAGE_DECISION,
// form:{
// componentProps:{
// }
// }
// },
11 months ago
// {
// 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',
// disabled:true
// }
// }
// },
12 months ago
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
//表单校验
export const InspectionJobMainRules = reactive({
// usageDecision: [required],
12 months ago
})
/**
* @returns {Array}
12 months ago
*/
export const InspectionJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
12 months ago
{
11 months ago
label: '编码',
12 months ago
field: 'number',
sort: 'custom',
isSearch: true,
},
{
11 months ago
label: '检验方案模板编码',
field: 'inspectionCode',
12 months ago
sort: 'custom',
isSearch: true,
},
{
11 months ago
label: '描述',
12 months ago
field: 'processDescribe',
sort: 'custom',
isSearch: true,
},
{
label: '顺序号',
field: 'sequenceCode',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
12 months ago
},
12 months ago
},
{
label: '检验特性编号',
11 months ago
field: 'inspectionCharCode',
12 months ago
sort: 'custom',
isSearch: true,
},
{
11 months ago
label: '检验特性编码',
field: 'inspectionJobCharacteristicsRespVO.number',
12 months ago
sort: 'custom',
},
12 months ago
{
11 months ago
label: '检验特性描述',
field: 'inspectionJobCharacteristicsRespVO.description',
sort: 'custom',
},{
label: '检验方法',
field: 'inspectionJobCharacteristicsRespVO.inspectionMethodCode',
11 months ago
sort: 'custom',
},{
label: '采样过程编码',
field: 'inspectionJobCharacteristicsRespVO.samplingProcessCode',
11 months ago
sort: 'custom',
},{
label: '动态修改规则编码',
11 months ago
field: 'inspectionJobCharacteristicsRespVO.dynamicUpdateCode',
11 months ago
sort: 'custom',
},{
label: '是否允许修改特征值',
field: 'inspectionJobCharacteristicsRespVO.isCanUpdate',
sort: 'custom',
11 months ago
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return isCanUpdateList.find((account) => account.value == cellValue)?.label
},
11 months ago
},{
label: '结果录入方式',
11 months ago
field: 'inspectionJobCharacteristicsRespVO.resultEntryMethod',
11 months ago
sort: 'custom',
11 months ago
// dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY,
// dictClass: 'string',
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return resultEntryMethodList.find((account) => account.value == cellValue)?.label
},
11 months ago
},{
label: '特征类型',
11 months ago
field: 'inspectionJobCharacteristicsRespVO.featureType',
11 months ago
sort: 'custom',
11 months ago
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return featureTypeList.find((account) => account.value == cellValue)?.label
},
12 months ago
}
]))
//表单校验
export const InspectionJobDetailRules = reactive({
taskCode: [required],
processCode: [required],
sequenceCode: [required],
available: [required],
})
/**
* @returns {Array}
*/
export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
11 months ago
tableForm:{
disabled:true
},
table:{
width:200
11 months ago
}
},
{
label: '包装号',
field: 'packageCode',
sort: 'custom',
isSearch: true,
11 months ago
tableForm:{
disabled:true
},
table:{
width:200
11 months ago
}
},
{
label: '包装规格',
field: 'packageSpecificationCode',
sort: 'custom',
isSearch: true,
11 months ago
tableForm:{
disabled:true
},
table:{
width:180
11 months ago
}
},
{
label: '数量',
field: 'amount',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
11 months ago
tableForm:{
disabled:true
},
table:{
width:150
11 months ago
}
},
{
label: '计量单位',
field: 'measuringUnit',
sort: 'custom',
isSearch: true,
11 months ago
tableForm:{
disabled:true
},
table:{
width:150
11 months ago
}
},
{
label: '采样数量',
field: 'sampleAmount',
sort: 'custom',
isSearch: true,
isTable:false,
table:{
width:150,
}
},
11 months ago
]))
//表单校验
export const InspectionJobPackageRules = reactive({
sampleAmount: [required,
{ validator:validateSixNum, trigger: 'blur'}]
})