From bdf3aeaacfcd87de9836b52d8b706f2eb643b11b Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Fri, 9 Aug 2024 11:45:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/dict.ts | 1 + src/views/qms/inspectionJob/index.vue | 15 +- .../inspectionJob/inspectionJobMain.data.ts | 2 +- .../qms/inspectionJobProduction/addForm.vue | 1551 +++++++++++++++++ .../qms/inspectionJobProduction/detail.vue | 194 +++ .../qms/inspectionJobProduction/index.vue | 438 +++++ .../inspectionJobMain.data.ts | 864 +++++++++ .../qms/inspectionJobPurchase/addForm.vue | 1551 +++++++++++++++++ .../qms/inspectionJobPurchase/detail.vue | 194 +++ src/views/qms/inspectionJobPurchase/index.vue | 438 +++++ .../inspectionJobMain.data.ts | 864 +++++++++ 11 files changed, 6108 insertions(+), 4 deletions(-) create mode 100644 src/views/qms/inspectionJobProduction/addForm.vue create mode 100644 src/views/qms/inspectionJobProduction/detail.vue create mode 100644 src/views/qms/inspectionJobProduction/index.vue create mode 100644 src/views/qms/inspectionJobProduction/inspectionJobMain.data.ts create mode 100644 src/views/qms/inspectionJobPurchase/addForm.vue create mode 100644 src/views/qms/inspectionJobPurchase/detail.vue create mode 100644 src/views/qms/inspectionJobPurchase/index.vue create mode 100644 src/views/qms/inspectionJobPurchase/inspectionJobMain.data.ts diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 79b9bfc0b..22c46d617 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -203,6 +203,7 @@ export enum DICT_TYPE { CARRIER_TYPE = 'carrier_type', // 承运商类型 INSPECT_TYPE = 'inspect_type', // 检验类型 INSPECTION_TYPE = 'inspection_type', // 质量管理检验类型 + INSPECTION_TYPE_NEW = 'inspection_type_new', // 质量管理检验类型 NEXT_ACTION = 'next_action', // 下一步检验动作 SAMPLE_METHOD = 'sample_method', // 抽检方式 WAREHOUSE_TYPE = 'warehouse_type', // 仓库类型 diff --git a/src/views/qms/inspectionJob/index.vue b/src/views/qms/inspectionJob/index.vue index 957192bd0..0a6e5d666 100644 --- a/src/views/qms/inspectionJob/index.vue +++ b/src/views/qms/inspectionJob/index.vue @@ -414,6 +414,14 @@ const handleImport = () => { // 筛选提交 const searchFormClick = (searchData) => { + let isHave = searchData?.filters?.some((item) => item.column == 'inspectionType') + if (!isHave) { + searchData.filters.push({ + action: 'notIn', + column: 'inspectionType', + value: '1,4' + }) + } tableObject.params = { isSearch: true, filters: searchData.filters @@ -423,9 +431,10 @@ const searchFormClick = (searchData) => { /** 初始化 **/ onMounted(async () => { -   tableObject.params = { -    available: true -  } + tableObject.params = { + available: true, + excludeInspectionType: '1,4' + } getList() // importTemplateData.templateUrl = await InspectionJobMainApi.importTemplate() }) diff --git a/src/views/qms/inspectionJob/inspectionJobMain.data.ts b/src/views/qms/inspectionJob/inspectionJobMain.data.ts index baef7aaa7..7bc8cf351 100644 --- a/src/views/qms/inspectionJob/inspectionJobMain.data.ts +++ b/src/views/qms/inspectionJob/inspectionJobMain.data.ts @@ -272,7 +272,7 @@ export const InspectionJobMain = useCrudSchemas( label: '检验类型', field: 'inspectionType', sort: 'custom', - dictType: DICT_TYPE.INSPECTION_TYPE, + dictType: DICT_TYPE.INSPECTION_TYPE_NEW, dictClass: 'string', isSearch: true, form: { diff --git a/src/views/qms/inspectionJobProduction/addForm.vue b/src/views/qms/inspectionJobProduction/addForm.vue new file mode 100644 index 000000000..93b717cd3 --- /dev/null +++ b/src/views/qms/inspectionJobProduction/addForm.vue @@ -0,0 +1,1551 @@ + + + + diff --git a/src/views/qms/inspectionJobProduction/detail.vue b/src/views/qms/inspectionJobProduction/detail.vue new file mode 100644 index 000000000..3dc132caf --- /dev/null +++ b/src/views/qms/inspectionJobProduction/detail.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/src/views/qms/inspectionJobProduction/index.vue b/src/views/qms/inspectionJobProduction/index.vue new file mode 100644 index 000000000..6c52ef85c --- /dev/null +++ b/src/views/qms/inspectionJobProduction/index.vue @@ -0,0 +1,438 @@ + + + diff --git a/src/views/qms/inspectionJobProduction/inspectionJobMain.data.ts b/src/views/qms/inspectionJobProduction/inspectionJobMain.data.ts new file mode 100644 index 000000000..3eb07993c --- /dev/null +++ b/src/views/qms/inspectionJobProduction/inspectionJobMain.data.ts @@ -0,0 +1,864 @@ +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() // 国际化 +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 + } +] + +/** + * @returns {Array} 检验任务主表 + */ +export const InspectionJobMain = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'number', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 200, + fixed: 'left' + } + }, + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 200 + } + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } + }, + { + label: '供应商编码', + field: 'supplierCode', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 175 + } + }, + { + label: '供应商名称', + field: 'supplierName', + sort: 'custom', + isSearch: false, + table: { + width: 175 + }, + 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: 175 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '物料批次', + field: 'batch', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '参考订单号', + field: 'referenceOrderCode', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + 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, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '参考凭证行', + field: 'referenceCertificateRow', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0, + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '检验方案编码', + field: 'inspectionSchemeCode', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 200 + } + }, + { + label: '批次', + field: 'inspectionBatch', + sort: 'custom', + isSearch: false, + isDetail: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '供应商批次', + field: 'supplierBatch', + sort: 'custom', + isSearch: false, + isDetail: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '检验批数量', + field: 'inspectionBatchAmount', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + // { + // label: '采样总数量', + // field: 'sampleTotalAmount', + // sort: 'custom', + // isSearch: false, + // form: { + // componentProps:{ + // disabled:true + // } + // }, + // table: { + // width: 150 + // } + // }, + { + label: '检验类型', + field: 'inspectionType', + sort: 'custom', + dictType: DICT_TYPE.INSPECTION_TYPE, + dictClass: 'string', + isSearch: false, + form: { + component: 'Select', + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '完成人', + field: 'completeUser', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isTable: false, + isDetail: false, + isSearch: true, + isTableForm: false, + isForm: false + }, + // { + // label: '检验批来源', + // field: 'inspectionBatchSource', + // sort: 'custom', + // isSearch: false, + // dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE, + // dictClass: 'string', + // form:{ + // 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', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.INSPECTION_SEVERITY, + dictClass: 'string', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + 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: 'inspectionLevel', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.INSPECTION_LEVEL, + dictClass: 'string', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: 'AQL值', + field: 'aqlValue', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.BASIC_AQL, + dictClass: 'string', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + // { + // label: '使用决策', + // field: 'usageDecision', + // sort: 'custom', + // isSearch: false, + // dictType: DICT_TYPE.USAGE_DECISION, + // form:{ + // componentProps:{ + // } + // } + // }, + // { + // 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 + // } + // } + // }, + { + label: '承接人', + field: 'acceptUserName', + table: { + width: 130 + }, + isForm: false, + isTable: false, + isDetail: true + }, + { + label: '承接时间', + field: 'acceptTime', + isForm: false, + table: { + width: 180 + }, + isTable: false, + isDetail: true, + 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: '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: 'completeUserName', + table: { + width: 130 + }, + isForm: false, + isTable: true, + isDetail: true + }, + { + label: '完成时间', + field: 'completeTime', + 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: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isForm: false, + isTable: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + 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: 300, + fixed: 'right' + } + } + ]) +) + +//表单校验 +export const InspectionJobMainRules = reactive({ + // usageDecision: [required], +}) + +/** + * @returns {Array} 检验任务子表 + */ +export const InspectionJobDetail = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'number', + sort: 'custom', + isSearch: true + }, + { + label: '检验方案模板编码', + field: 'inspectionCode', + sort: 'custom', + isSearch: true + }, + { + label: '描述', + field: 'processDescribe', + sort: 'custom', + isSearch: true + }, + { + label: '顺序号', + field: 'sequenceCode', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '检验特性编号', + field: 'inspectionCharCode', + sort: 'custom', + isSearch: true + }, + { + label: '检验特性编码', + field: 'inspectionJobCharacteristicsRespVO.number', + sort: 'custom' + }, + { + label: '检验特性描述', + field: 'inspectionJobCharacteristicsRespVO.description', + sort: 'custom' + }, + { + label: '检验方法', + field: 'inspectionJobCharacteristicsRespVO.inspectionMethodCode', + sort: 'custom' + }, + { + label: '采样过程编码', + field: 'inspectionJobCharacteristicsRespVO.samplingProcessCode', + sort: 'custom' + }, + { + label: '动态修改规则编码', + field: 'inspectionJobCharacteristicsRespVO.dynamicUpdateCode', + sort: 'custom' + }, + { + label: '是否允许修改特征值', + field: 'inspectionJobCharacteristicsRespVO.isCanUpdate', + sort: 'custom', + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return isCanUpdateList.find((account) => account.value == cellValue)?.label + } + }, + { + label: '结果录入方式', + field: 'inspectionJobCharacteristicsRespVO.resultEntryMethod', + sort: 'custom', + // dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY, + // dictClass: 'string', + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return resultEntryMethodList.find((account) => account.value == cellValue)?.label + } + }, + { + label: '特征类型', + field: 'inspectionJobCharacteristicsRespVO.featureType', + sort: 'custom', + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return featureTypeList.find((account) => account.value == cellValue)?.label + } + } + ]) +) + +//表单校验 +export const InspectionJobDetailRules = reactive({ + taskCode: [required], + processCode: [required], + sequenceCode: [required], + available: [required] +}) +/** + * @returns {Array} 检验任务包装 + */ +export const InspectionJobPackage = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'number', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true + }, + table: { + width: 200 + } + }, + { + label: '包装号', + field: 'packageCode', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true + }, + table: { + width: 200 + } + }, + { + label: '包装规格', + field: 'packageSpecificationCode', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true + }, + table: { + width: 180 + } + }, + { + label: '数量', + field: 'amount', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + tableForm: { + disabled: true + }, + table: { + width: 150 + } + }, + { + label: '计量单位', + field: 'measuringUnit', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true + }, + table: { + width: 150 + } + }, + { + label: '采样数量', + field: 'sampleAmount', + sort: 'custom', + isSearch: true, + isTable: false, + table: { + width: 150 + } + } + ]) +) +//表单校验 +export const InspectionJobPackageRules = reactive({ + sampleAmount: [required, { validator: validateSixNum, trigger: 'blur' }] +}) diff --git a/src/views/qms/inspectionJobPurchase/addForm.vue b/src/views/qms/inspectionJobPurchase/addForm.vue new file mode 100644 index 000000000..93b717cd3 --- /dev/null +++ b/src/views/qms/inspectionJobPurchase/addForm.vue @@ -0,0 +1,1551 @@ + + + + diff --git a/src/views/qms/inspectionJobPurchase/detail.vue b/src/views/qms/inspectionJobPurchase/detail.vue new file mode 100644 index 000000000..3dc132caf --- /dev/null +++ b/src/views/qms/inspectionJobPurchase/detail.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/src/views/qms/inspectionJobPurchase/index.vue b/src/views/qms/inspectionJobPurchase/index.vue new file mode 100644 index 000000000..7fc015821 --- /dev/null +++ b/src/views/qms/inspectionJobPurchase/index.vue @@ -0,0 +1,438 @@ + + + diff --git a/src/views/qms/inspectionJobPurchase/inspectionJobMain.data.ts b/src/views/qms/inspectionJobPurchase/inspectionJobMain.data.ts new file mode 100644 index 000000000..3eb07993c --- /dev/null +++ b/src/views/qms/inspectionJobPurchase/inspectionJobMain.data.ts @@ -0,0 +1,864 @@ +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() // 国际化 +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 + } +] + +/** + * @returns {Array} 检验任务主表 + */ +export const InspectionJobMain = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'number', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 200, + fixed: 'left' + } + }, + { + label: '申请单号', + field: 'requestNumber', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 200 + } + }, + { + label: '发货单号', + field: 'asnNumber', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 180 + } + }, + { + label: '供应商编码', + field: 'supplierCode', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 175 + } + }, + { + label: '供应商名称', + field: 'supplierName', + sort: 'custom', + isSearch: false, + table: { + width: 175 + }, + 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: 175 + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '物料批次', + field: 'batch', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '参考订单号', + field: 'referenceOrderCode', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + 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, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '参考凭证行', + field: 'referenceCertificateRow', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0, + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '检验方案编码', + field: 'inspectionSchemeCode', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 200 + } + }, + { + label: '批次', + field: 'inspectionBatch', + sort: 'custom', + isSearch: false, + isDetail: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '供应商批次', + field: 'supplierBatch', + sort: 'custom', + isSearch: false, + isDetail: true, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '检验批数量', + field: 'inspectionBatchAmount', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + // { + // label: '采样总数量', + // field: 'sampleTotalAmount', + // sort: 'custom', + // isSearch: false, + // form: { + // componentProps:{ + // disabled:true + // } + // }, + // table: { + // width: 150 + // } + // }, + { + label: '检验类型', + field: 'inspectionType', + sort: 'custom', + dictType: DICT_TYPE.INSPECTION_TYPE, + dictClass: 'string', + isSearch: false, + form: { + component: 'Select', + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: '完成人', + field: 'completeUser', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isTable: false, + isDetail: false, + isSearch: true, + isTableForm: false, + isForm: false + }, + // { + // label: '检验批来源', + // field: 'inspectionBatchSource', + // sort: 'custom', + // isSearch: false, + // dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE, + // dictClass: 'string', + // form:{ + // 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', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.INSPECTION_SEVERITY, + dictClass: 'string', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + 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: 'inspectionLevel', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.INSPECTION_LEVEL, + dictClass: 'string', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + { + label: 'AQL值', + field: 'aqlValue', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.BASIC_AQL, + dictClass: 'string', + form: { + componentProps: { + disabled: true + } + }, + table: { + width: 150 + } + }, + // { + // label: '使用决策', + // field: 'usageDecision', + // sort: 'custom', + // isSearch: false, + // dictType: DICT_TYPE.USAGE_DECISION, + // form:{ + // componentProps:{ + // } + // } + // }, + // { + // 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 + // } + // } + // }, + { + label: '承接人', + field: 'acceptUserName', + table: { + width: 130 + }, + isForm: false, + isTable: false, + isDetail: true + }, + { + label: '承接时间', + field: 'acceptTime', + isForm: false, + table: { + width: 180 + }, + isTable: false, + isDetail: true, + 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: '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: 'completeUserName', + table: { + width: 130 + }, + isForm: false, + isTable: true, + isDetail: true + }, + { + label: '完成时间', + field: 'completeTime', + 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: 'status', + dictType: DICT_TYPE.JOB_STATUS, + dictClass: 'string', + isForm: false, + isTable: true, + sort: 'custom', + table: { + width: 150 + } + }, + { + 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: 300, + fixed: 'right' + } + } + ]) +) + +//表单校验 +export const InspectionJobMainRules = reactive({ + // usageDecision: [required], +}) + +/** + * @returns {Array} 检验任务子表 + */ +export const InspectionJobDetail = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'number', + sort: 'custom', + isSearch: true + }, + { + label: '检验方案模板编码', + field: 'inspectionCode', + sort: 'custom', + isSearch: true + }, + { + label: '描述', + field: 'processDescribe', + sort: 'custom', + isSearch: true + }, + { + label: '顺序号', + field: 'sequenceCode', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '检验特性编号', + field: 'inspectionCharCode', + sort: 'custom', + isSearch: true + }, + { + label: '检验特性编码', + field: 'inspectionJobCharacteristicsRespVO.number', + sort: 'custom' + }, + { + label: '检验特性描述', + field: 'inspectionJobCharacteristicsRespVO.description', + sort: 'custom' + }, + { + label: '检验方法', + field: 'inspectionJobCharacteristicsRespVO.inspectionMethodCode', + sort: 'custom' + }, + { + label: '采样过程编码', + field: 'inspectionJobCharacteristicsRespVO.samplingProcessCode', + sort: 'custom' + }, + { + label: '动态修改规则编码', + field: 'inspectionJobCharacteristicsRespVO.dynamicUpdateCode', + sort: 'custom' + }, + { + label: '是否允许修改特征值', + field: 'inspectionJobCharacteristicsRespVO.isCanUpdate', + sort: 'custom', + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return isCanUpdateList.find((account) => account.value == cellValue)?.label + } + }, + { + label: '结果录入方式', + field: 'inspectionJobCharacteristicsRespVO.resultEntryMethod', + sort: 'custom', + // dictType: DICT_TYPE.INSPECTION_CHARACTERISTICS_RESULT_ENTRY, + // dictClass: 'string', + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return resultEntryMethodList.find((account) => account.value == cellValue)?.label + } + }, + { + label: '特征类型', + field: 'inspectionJobCharacteristicsRespVO.featureType', + sort: 'custom', + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return featureTypeList.find((account) => account.value == cellValue)?.label + } + } + ]) +) + +//表单校验 +export const InspectionJobDetailRules = reactive({ + taskCode: [required], + processCode: [required], + sequenceCode: [required], + available: [required] +}) +/** + * @returns {Array} 检验任务包装 + */ +export const InspectionJobPackage = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'number', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true + }, + table: { + width: 200 + } + }, + { + label: '包装号', + field: 'packageCode', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true + }, + table: { + width: 200 + } + }, + { + label: '包装规格', + field: 'packageSpecificationCode', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true + }, + table: { + width: 180 + } + }, + { + label: '数量', + field: 'amount', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + }, + tableForm: { + disabled: true + }, + table: { + width: 150 + } + }, + { + label: '计量单位', + field: 'measuringUnit', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true + }, + table: { + width: 150 + } + }, + { + label: '采样数量', + field: 'sampleAmount', + sort: 'custom', + isSearch: true, + isTable: false, + table: { + width: 150 + } + } + ]) +) +//表单校验 +export const InspectionJobPackageRules = reactive({ + sampleAmount: [required, { validator: validateSixNum, trigger: 'blur' }] +})