From 89a59eed9af9838897bf2b96d46febbe5b8e4460 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Tue, 13 Aug 2024 10:46:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=8C=E5=B7=A5=E3=80=81?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=A3=80=E9=AA=8C=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/inspectionRecord/index.vue | 6 +- .../inspectionRecordProduction/addForm.vue | 1571 +++++++++++++++++ .../qms/inspectionRecordProduction/detail.vue | 402 +++++ .../qms/inspectionRecordProduction/index.vue | 450 +++++ .../inspectionRecordMain.data.ts | 964 ++++++++++ .../inspectionRecordProduction/useAddForm.vue | 312 ++++ .../qms/inspectionRecordPurchase/addForm.vue | 1571 +++++++++++++++++ .../qms/inspectionRecordPurchase/detail.vue | 402 +++++ .../qms/inspectionRecordPurchase/index.vue | 450 +++++ .../inspectionRecordMain.data.ts | 964 ++++++++++ .../inspectionRecordPurchase/useAddForm.vue | 312 ++++ 11 files changed, 7401 insertions(+), 3 deletions(-) create mode 100644 src/views/qms/inspectionRecordProduction/addForm.vue create mode 100644 src/views/qms/inspectionRecordProduction/detail.vue create mode 100644 src/views/qms/inspectionRecordProduction/index.vue create mode 100644 src/views/qms/inspectionRecordProduction/inspectionRecordMain.data.ts create mode 100644 src/views/qms/inspectionRecordProduction/useAddForm.vue create mode 100644 src/views/qms/inspectionRecordPurchase/addForm.vue create mode 100644 src/views/qms/inspectionRecordPurchase/detail.vue create mode 100644 src/views/qms/inspectionRecordPurchase/index.vue create mode 100644 src/views/qms/inspectionRecordPurchase/inspectionRecordMain.data.ts create mode 100644 src/views/qms/inspectionRecordPurchase/useAddForm.vue diff --git a/src/views/qms/inspectionRecord/index.vue b/src/views/qms/inspectionRecord/index.vue index 705aaac2d..d437324cf 100644 --- a/src/views/qms/inspectionRecord/index.vue +++ b/src/views/qms/inspectionRecord/index.vue @@ -430,9 +430,9 @@ const searchFormClick = (searchData) => { let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') if (!isHave) { searchData.filters.push({ - action: '!=', + action: 'notIn', column: 'inspectionType', - value: '11' + value: '1,4,11' }) } tableObject.params = { @@ -446,7 +446,7 @@ const searchFormClick = (searchData) => { onMounted(async () => { tableObject.params = { available: true, - excludeInspectionType: '11' + excludeInspectionType: '1,4,11' } getList() }) diff --git a/src/views/qms/inspectionRecordProduction/addForm.vue b/src/views/qms/inspectionRecordProduction/addForm.vue new file mode 100644 index 000000000..037c9456b --- /dev/null +++ b/src/views/qms/inspectionRecordProduction/addForm.vue @@ -0,0 +1,1571 @@ + + + + diff --git a/src/views/qms/inspectionRecordProduction/detail.vue b/src/views/qms/inspectionRecordProduction/detail.vue new file mode 100644 index 000000000..4b27eddbf --- /dev/null +++ b/src/views/qms/inspectionRecordProduction/detail.vue @@ -0,0 +1,402 @@ + + + + + diff --git a/src/views/qms/inspectionRecordProduction/index.vue b/src/views/qms/inspectionRecordProduction/index.vue new file mode 100644 index 000000000..59c7e9b79 --- /dev/null +++ b/src/views/qms/inspectionRecordProduction/index.vue @@ -0,0 +1,450 @@ + + + diff --git a/src/views/qms/inspectionRecordProduction/inspectionRecordMain.data.ts b/src/views/qms/inspectionRecordProduction/inspectionRecordMain.data.ts new file mode 100644 index 000000000..9c106671b --- /dev/null +++ b/src/views/qms/inspectionRecordProduction/inspectionRecordMain.data.ts @@ -0,0 +1,964 @@ +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' +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 检验任务主表 + */ +export const InspectionRecordMain = useCrudSchemas( + reactive([ + { + label: '记录编码', + field: 'number', + sort: 'custom', + isSearch: true, + table: { + width: 200, + fixed: 'left' + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '申请编码', + field: 'requestNumber', + sort: 'custom', + isSearch: true, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '任务编码', + field: 'jobNumber', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + isSearch: true, + isForm: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } + }, + { + label: '供应商编码', + field: 'supplierCode', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '供应商名称', + field: 'supplierName', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '物料编码', + field: 'itemCode', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '物料名称', + field: 'itemName', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '供应商批次', + field: 'supplierBatch', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '检验方案编码', + field: 'inspectionSchemeCode', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '检验批次', + field: 'inspectionBatch', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '检验批数量', + field: 'inspectionBatchAmount', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + // { + // label: '采样总数量', + // field: 'sampleTotalAmount', + // sort: 'custom', + // isSearch: false, + // isForm:false, + // table: { + // width: 150 + // } + // }, + { + label: '检验类型', + field: 'inspectionType', + dictType: DICT_TYPE.INSPECTION_TYPE, + sort: 'custom', + isSearch: false, + form: { + component: 'Select', + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '参考订单号', + field: 'referenceOrderCode', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '参考订单行', + field: 'referenceOrderRow', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0, + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '参考凭证号', + field: 'referenceCertificateCode', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + // reference_certificate_row + label: '参考凭证行', + field: 'referenceCertificateRow', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0, + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '检验阶段', + field: 'inspectionStage', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0, + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '检验严格性', + field: 'inspectionStringency', + dictType: DICT_TYPE.INSPECTION_SEVERITY, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + 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', + valueFormat: 'x', + disabled: true + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + { + 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', + valueFormat: 'x', + disabled: true + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + { + label: '实际开始时间', + field: 'realStartTime', + 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', + valueFormat: 'x', + disabled: true + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + { + label: '实际结束时间', + field: 'realEndTime', + 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', + valueFormat: 'x', + disabled: true + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + + { + label: '收货时间', + field: 'deliveryTime', + 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', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + { + label: '检验水平', + field: 'inspectionLevel', + dictType: DICT_TYPE.INSPECTION_LEVEL, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: 'AQL值', + field: 'aqlValue', + dictType: DICT_TYPE.BASIC_AQL, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '使用决策', + field: 'useDecision', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.USAGE_DECISION, + table: { + width: 150 + }, + isForm: false + }, + { + label: '执行结果', + field: 'estimateCode', + dictType: DICT_TYPE.EVALUATION_CODE, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '包装号', + field: 'packageCode', + sort: 'custom', + isSearch: true, + isTable: false, + isForm: false, + tableForm: { + disabled: false + } + }, + { + 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' + } + }, + isSearch: true, + 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')] + } + } + }, + { + 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: 300, + fixed: 'right' + } + } + ]) +) + +//表单校验 +export const InspectionRecordMainRules = reactive({ + useDecision: [required], + +}) + +/** + * @returns {Array} 检验任务子表 + */ +export const InspectionRecordDetail = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isTable: false, + isSearch: false, + isForm: false, + }, + { + label: '记录编码', + field: 'recordCode', + sort: 'custom', + isSearch: false, + }, + { + label: '工序编码', + field: 'processCode', + sort: 'custom', + isSearch: false, + }, + { + label: '工序描述', + field: 'processDescribe', + sort: 'custom', + isSearch: false, + }, + { + label: '顺序号', + field: 'sequenceCode', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '是否破坏性检验', + field: 'isDestroyInspection', + sort: 'custom', + isSearch: false, + form: { + component: 'Radio' + }, + }, + { + label: '检验开始时间', + field: 'inspectionStartTime', + 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', + valueFormat: 'x' + } + }, + }, + { + label: '检验结束时间', + field: 'inspectionEndTime', + 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', + valueFormat: 'x' + } + }, + }, + { + label: '检验人', + field: 'inspectionOperator', + sort: 'custom', + isSearch: false, + }, + { + label: '检验特性编码', + field: 'inspectionFeaturesCode', + sort: 'custom', + isSearch: false, + }, + // { + // label: '是否可用', + // field: 'available', + // sort: 'custom', + // isSearch: false, + // }, + { + label: '创建时间', + field: 'createTime', + 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')] + } + }, + isForm: false, + }, + + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 150, + fixed: 'right' + }, + isTableForm: false, + } +])) + +//表单校验 +export const InspectionRecordDetailRules = reactive({ + recordCode: [required], + processCode: [required], + sequenceCode: [required], + isDestroyInspection: [required], + available: [required], +}) + +/** + * @returns {Array} 检验记录包装 + */ +export const InspectionRecordPackage = useCrudSchemas(reactive([ + { + label: '编码', + field: 'number', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 200 + }, + table: { + width: 150 + } + }, + { + label: '包装号', + field: 'packageCode', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 160 + }, + table: { + width: 150 + } + }, + { + label: '包装规格', + field: 'packageSpecificationCode', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 150 + }, + table: { + width: 150 + } + }, + { + label: '数量', + field: 'amount', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + tableForm: { + disabled: true, + width: 120 + }, + table: { + width: 150 + } + }, + { + label: '计量单位', + field: 'measuringUnit', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 120 + }, + table: { + width: 150 + } + }, + { + label: '采样数量', + field: 'sampleAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + }, + { + label: '合格数量', + field: 'qualifiedAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + }, + { + label: '不合格数量', + field: 'noQualifiedAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + }, + { + label: '破坏数量', + field: 'destroyAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + }, + { + label: '冻结数量', + field: 'frozenAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + } +])) + +//表单校验 +export const InspectionRecordPackageRules = reactive({ + qualifiedAmount: [ + required, + { validator: validateSixNum, message: '小数点后最多6位', trigger: 'blur' } + ], + frozenAmount: [ + required, + { validator: validateSixNum, message: '小数点后最多6位', trigger: 'blur' } + ], + destroyAmount: [ + required, + { validator: validateSixNum, message: '小数点后最多6位', trigger: 'blur' } + ], + noQualifiedAmount: [ + required, + { validator: validateSixNum, message: '小数点后最多6位', trigger: 'blur' } + ], +}) + + +//表单校验 +export const InspectionRecordUserRules = reactive({ + useDecision: [required], + +}) + +/** + * @returns {Array} 检验任务子表 + */ +export const InspectionRecordUser = useCrudSchemas(reactive([ + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } + }, + { + label: '使用决策', + field: 'useDecision', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.USAGE_DECISION, + table: { + width: 150 + } + }, +])) diff --git a/src/views/qms/inspectionRecordProduction/useAddForm.vue b/src/views/qms/inspectionRecordProduction/useAddForm.vue new file mode 100644 index 000000000..c430495c8 --- /dev/null +++ b/src/views/qms/inspectionRecordProduction/useAddForm.vue @@ -0,0 +1,312 @@ + + + + + diff --git a/src/views/qms/inspectionRecordPurchase/addForm.vue b/src/views/qms/inspectionRecordPurchase/addForm.vue new file mode 100644 index 000000000..037c9456b --- /dev/null +++ b/src/views/qms/inspectionRecordPurchase/addForm.vue @@ -0,0 +1,1571 @@ + + + + diff --git a/src/views/qms/inspectionRecordPurchase/detail.vue b/src/views/qms/inspectionRecordPurchase/detail.vue new file mode 100644 index 000000000..4b27eddbf --- /dev/null +++ b/src/views/qms/inspectionRecordPurchase/detail.vue @@ -0,0 +1,402 @@ + + + + + diff --git a/src/views/qms/inspectionRecordPurchase/index.vue b/src/views/qms/inspectionRecordPurchase/index.vue new file mode 100644 index 000000000..652820c96 --- /dev/null +++ b/src/views/qms/inspectionRecordPurchase/index.vue @@ -0,0 +1,450 @@ + + + diff --git a/src/views/qms/inspectionRecordPurchase/inspectionRecordMain.data.ts b/src/views/qms/inspectionRecordPurchase/inspectionRecordMain.data.ts new file mode 100644 index 000000000..9c106671b --- /dev/null +++ b/src/views/qms/inspectionRecordPurchase/inspectionRecordMain.data.ts @@ -0,0 +1,964 @@ +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' +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 检验任务主表 + */ +export const InspectionRecordMain = useCrudSchemas( + reactive([ + { + label: '记录编码', + field: 'number', + sort: 'custom', + isSearch: true, + table: { + width: 200, + fixed: 'left' + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '申请编码', + field: 'requestNumber', + sort: 'custom', + isSearch: true, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '任务编码', + field: 'jobNumber', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + isSearch: true, + isForm: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } + }, + { + label: '供应商编码', + field: 'supplierCode', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '供应商名称', + field: 'supplierName', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '物料编码', + field: 'itemCode', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '物料名称', + field: 'itemName', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '供应商批次', + field: 'supplierBatch', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '检验方案编码', + field: 'inspectionSchemeCode', + sort: 'custom', + isSearch: false, + table: { + width: 200 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '检验批次', + field: 'inspectionBatch', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '检验批数量', + field: 'inspectionBatchAmount', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + // { + // label: '采样总数量', + // field: 'sampleTotalAmount', + // sort: 'custom', + // isSearch: false, + // isForm:false, + // table: { + // width: 150 + // } + // }, + { + label: '检验类型', + field: 'inspectionType', + dictType: DICT_TYPE.INSPECTION_TYPE, + sort: 'custom', + isSearch: false, + form: { + component: 'Select', + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '参考订单号', + field: 'referenceOrderCode', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '参考订单行', + field: 'referenceOrderRow', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0, + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '参考凭证号', + field: 'referenceCertificateCode', + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + // reference_certificate_row + label: '参考凭证行', + field: 'referenceCertificateRow', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0, + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '检验阶段', + field: 'inspectionStage', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0, + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '检验严格性', + field: 'inspectionStringency', + dictType: DICT_TYPE.INSPECTION_SEVERITY, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + 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', + valueFormat: 'x', + disabled: true + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + { + 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', + valueFormat: 'x', + disabled: true + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + { + label: '实际开始时间', + field: 'realStartTime', + 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', + valueFormat: 'x', + disabled: true + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + { + label: '实际结束时间', + field: 'realEndTime', + 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', + valueFormat: 'x', + disabled: true + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + + { + label: '收货时间', + field: 'deliveryTime', + 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', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } + }, + { + label: '检验水平', + field: 'inspectionLevel', + dictType: DICT_TYPE.INSPECTION_LEVEL, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: 'AQL值', + field: 'aqlValue', + dictType: DICT_TYPE.BASIC_AQL, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '使用决策', + field: 'useDecision', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.USAGE_DECISION, + table: { + width: 150 + }, + isForm: false + }, + { + label: '执行结果', + field: 'estimateCode', + dictType: DICT_TYPE.EVALUATION_CODE, + sort: 'custom', + isSearch: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '包装号', + field: 'packageCode', + sort: 'custom', + isSearch: true, + isTable: false, + isForm: false, + tableForm: { + disabled: false + } + }, + { + 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' + } + }, + isSearch: true, + 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')] + } + } + }, + { + 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: 300, + fixed: 'right' + } + } + ]) +) + +//表单校验 +export const InspectionRecordMainRules = reactive({ + useDecision: [required], + +}) + +/** + * @returns {Array} 检验任务子表 + */ +export const InspectionRecordDetail = useCrudSchemas(reactive([ + { + label: 'id', + field: 'id', + sort: 'custom', + isTable: false, + isSearch: false, + isForm: false, + }, + { + label: '记录编码', + field: 'recordCode', + sort: 'custom', + isSearch: false, + }, + { + label: '工序编码', + field: 'processCode', + sort: 'custom', + isSearch: false, + }, + { + label: '工序描述', + field: 'processDescribe', + sort: 'custom', + isSearch: false, + }, + { + label: '顺序号', + field: 'sequenceCode', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '是否破坏性检验', + field: 'isDestroyInspection', + sort: 'custom', + isSearch: false, + form: { + component: 'Radio' + }, + }, + { + label: '检验开始时间', + field: 'inspectionStartTime', + 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', + valueFormat: 'x' + } + }, + }, + { + label: '检验结束时间', + field: 'inspectionEndTime', + 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', + valueFormat: 'x' + } + }, + }, + { + label: '检验人', + field: 'inspectionOperator', + sort: 'custom', + isSearch: false, + }, + { + label: '检验特性编码', + field: 'inspectionFeaturesCode', + sort: 'custom', + isSearch: false, + }, + // { + // label: '是否可用', + // field: 'available', + // sort: 'custom', + // isSearch: false, + // }, + { + label: '创建时间', + field: 'createTime', + 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')] + } + }, + isForm: false, + }, + + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 150, + fixed: 'right' + }, + isTableForm: false, + } +])) + +//表单校验 +export const InspectionRecordDetailRules = reactive({ + recordCode: [required], + processCode: [required], + sequenceCode: [required], + isDestroyInspection: [required], + available: [required], +}) + +/** + * @returns {Array} 检验记录包装 + */ +export const InspectionRecordPackage = useCrudSchemas(reactive([ + { + label: '编码', + field: 'number', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 200 + }, + table: { + width: 150 + } + }, + { + label: '包装号', + field: 'packageCode', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 160 + }, + table: { + width: 150 + } + }, + { + label: '包装规格', + field: 'packageSpecificationCode', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 150 + }, + table: { + width: 150 + } + }, + { + label: '数量', + field: 'amount', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + tableForm: { + disabled: true, + width: 120 + }, + table: { + width: 150 + } + }, + { + label: '计量单位', + field: 'measuringUnit', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 120 + }, + table: { + width: 150 + } + }, + { + label: '采样数量', + field: 'sampleAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + }, + { + label: '合格数量', + field: 'qualifiedAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + }, + { + label: '不合格数量', + field: 'noQualifiedAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + }, + { + label: '破坏数量', + field: 'destroyAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + }, + { + label: '冻结数量', + field: 'frozenAmount', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true, + width: 100 + }, + table: { + width: 150 + } + } +])) + +//表单校验 +export const InspectionRecordPackageRules = reactive({ + qualifiedAmount: [ + required, + { validator: validateSixNum, message: '小数点后最多6位', trigger: 'blur' } + ], + frozenAmount: [ + required, + { validator: validateSixNum, message: '小数点后最多6位', trigger: 'blur' } + ], + destroyAmount: [ + required, + { validator: validateSixNum, message: '小数点后最多6位', trigger: 'blur' } + ], + noQualifiedAmount: [ + required, + { validator: validateSixNum, message: '小数点后最多6位', trigger: 'blur' } + ], +}) + + +//表单校验 +export const InspectionRecordUserRules = reactive({ + useDecision: [required], + +}) + +/** + * @returns {Array} 检验任务子表 + */ +export const InspectionRecordUser = useCrudSchemas(reactive([ + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } + }, + { + label: '使用决策', + field: 'useDecision', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.USAGE_DECISION, + table: { + width: 150 + } + }, +])) diff --git a/src/views/qms/inspectionRecordPurchase/useAddForm.vue b/src/views/qms/inspectionRecordPurchase/useAddForm.vue new file mode 100644 index 000000000..c430495c8 --- /dev/null +++ b/src/views/qms/inspectionRecordPurchase/useAddForm.vue @@ -0,0 +1,312 @@ + + + + +