From 5b9f20c1511ed2e454cebb28056b89bb2ebec46d Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Sun, 7 Apr 2024 17:10:31 +0800 Subject: [PATCH 01/32] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionTemplate/addForm.vue | 116 ++++++++++-------- 1 file changed, 62 insertions(+), 54 deletions(-) diff --git a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue index 2d701589d..b97f28bdd 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue @@ -25,6 +25,45 @@ + + +
+ + +
+
+
+
检验特性
@@ -146,11 +186,11 @@
@@ -160,7 +200,7 @@ style="width: 40px" @click=" opensearchTable( - 'inspectionMethod', + 'samplingProcessCode', null, '采样过程编码', SamplingProcess.allSchemas, @@ -182,45 +222,7 @@
- - -
- - -
-
-
+
@@ -376,7 +378,7 @@ } ], false, - null, + 'features', item ) " @@ -474,6 +476,7 @@ const data = ref({ code: '', description: '', version: '', + dynamicUpdateCode:'', process: [] }) @@ -499,12 +502,12 @@ const rules = ref({ 'inspectionCharacteristicsBaseVO.inspectionMethodCode': [ { required: true, message: '请选择检验方法编码', trigger: 'blur' } ], - 'inspectionCharacteristicsBaseVO.dynamicUpdateCode': [ - { required: true, message: '请选择采样过程编码', trigger: ['blur', 'change'] } - ], - 'inspectionCharacteristicsBaseVO.inspectionMethod': [ + dynamicUpdateCode: [ { required: true, message: '请选择动态修改规则编码', trigger: ['blur', 'change'] } ], + 'inspectionCharacteristicsBaseVO.samplingProcessCode': [ + { required: true, message: '请选择采样过程', trigger: ['blur', 'change'] } + ], 'inspectionCharacteristicsBaseVO.resultEntryMethod': [ { required: true, message: '请选择结果录入方式', trigger: ['blur', 'change'] } ], @@ -617,13 +620,13 @@ const buttonBaseClick1 = (val) => { description: nameForm.value.name, name: newTabName, inspectionCode: '', + dynamicUpdateCode:'', sequenceCode: '', inspectionCharCode: '', inspectionCharacteristicsBaseVO: { describe: '', inspectionMethodCode: '', - dynamicUpdateCode: '', - inspectionMethod: '', + samplingProcessCode: '', isCanUpdate: '', isDestructionInspection: '', resultEntryMethod: '', @@ -821,10 +824,15 @@ const searchTableSuccess = (formField, searchField, val, type, row) => { row.inspectionCharacteristicsBaseVO[formField] = val[0].code if(formField == 'inspectionMethodCode'){ row.inspectionCharacteristicsBaseVO.inspectionMethodName = val[0].description - }else if(formField == 'dynamicUpdateCode'){ - row.inspectionCharacteristicsBaseVO.dynamicUpdateName = val[0].description - }else if(formField == 'inspectionMethod'){ - row.inspectionCharacteristicsBaseVO.inspectionName = val[0].description + }else if(formField == 'samplingProcessCode'){ + row.inspectionCharacteristicsBaseVO.samplingProcessName = val[0].description + }else if(formField == 'quantifyQuantifyCode'){ + row.inspectionCharacteristicsBaseVO.quantifyQuantifyName = val[0].description + } + }else{ + if(formField == 'dynamicUpdateCode'){ + data.value[formField] = val[0].code + data.value.dynamicUpdateName = val[0].description } } From 0a0f7393793188a88d79fbf0addc62ddb7ce41a7 Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Sun, 7 Apr 2024 19:27:18 +0800 Subject: [PATCH 02/32] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=A4=96=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=A2=9E=E5=8A=A0=E6=89=93=E5=8D=B0=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unplannedreceiptRequestMain/index.vue | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue index 78cbb6234..08c26203e 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue @@ -113,6 +113,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as ItembasicApi from "@/api/wms/itembasic"; import * as PackageApi from "@/api/wms/package"; import { formatTime } from '@/utils/index' +import { getAccessToken } from '@/utils/auth' // 计划外入库申请 defineOptions({ name: 'UnplannedreceiptRequestMain' }) @@ -284,16 +285,17 @@ const butttondata = (row) => { defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:unplannedreceipt-request-main:handle'}), // 处理 defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:unplannedreceipt-request-main:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'wms:unplannedreceipt-request-main:delete'}), // 删除 - { - label: '创建标签', - name: 'cjbq', - hide: isShowMainButton(row,['3']), - type: 'primary', - icon: '', - color: '', - hasPermi: '', - link: true, // 文本展现按钮 - }, + { + label: '创建标签', + name: 'cjbq', + hide: isShowMainButton(row,['3']), + type: 'primary', + icon: '', + color: '', + hasPermi: '', + link: true, // 文本展现按钮 + }, + defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3','8']) }), // 标签打印 ] } @@ -322,6 +324,9 @@ const buttonTableClick = async (val, row) => { openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) + } else if (val == 'point') { + // 标签打印 + labelPrint(row) } else if( val == 'cjbq'){// 创建标签 // 判断 是否已创建标签 let isCreateLabel = false @@ -643,6 +648,13 @@ const tableFormSelectOnBlur = (field, val, row, index) => { } } +// 标签打印 +const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL +const src = ref(BASE_URL + '/jmreport/view/936912164754612224?token=' + getAccessToken()) +const labelPrint = async (row) => { + window.open(src.value + '&request_number=' + row.number) +} + /** 初始化 **/ onMounted(async () => { getList() From fcae4f14c560f17b3f01e33e607e4e23634ba20d Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Sun, 7 Apr 2024 20:01:34 +0800 Subject: [PATCH 03/32] =?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 | 2 + .../qms/inspection/inspectionJob/addForm.vue | 127 ++++++++++-------- .../qms/inspection/inspectionJob/index.vue | 6 +- .../inspectionJob/inspectionJobMain.data.ts | 75 +++++++---- 4 files changed, 122 insertions(+), 88 deletions(-) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 4ddb4d195..c204f0772 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -300,6 +300,8 @@ export enum DICT_TYPE { DEFECT_LEVEL = "defect_level", // 缺陷级别 DICTIONARY_CLASS = "dictionary_class", // 字典分类 USAGE_DECISION = "usage_decision", // 使用决策 + INSPECTION_BATCH_SOURCE = "inspection_batch_source", // 检验批来源 + INSPECTION_TYPE = "inspection_type", // 检验类型 // ========== 业务 - mes -gaojs ========== QUALIFY_STATUS = 'qualify_status',//质检状态 diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue index 4cca5460d..d6051c4d7 100644 --- a/src/views/qms/inspection/inspectionJob/addForm.vue +++ b/src/views/qms/inspection/inspectionJob/addForm.vue @@ -28,7 +28,7 @@ :stretch="false" > - + - + + + + + + + + + + + - + + @@ -410,58 +433,17 @@ const rules = ref({ { required: true, message: '请输入小数位', trigger: 'blur' } ], 'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [ - { required: true, message: '请输入选择集编码', trigger: 'blur' } - ] + { required: true, message: '请输入选择集编码', trigger: 'change' } + ], + 'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [ + { required: true, message: '请输入选择开始时间', trigger: 'change'} + ], + 'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [ + { required: true, message: '请输入选择结束时间', trigger: 'blur' } +], + + }) -// const rules = ref({ -// itemCode: [{ required: true, message: '请选择物料编码', trigger: 'blur' }], -// version: [{ required: true, message: '请填写版本', trigger: 'blur' }], -// testTypeCode: [{ required: true, message: '请选择检验类型编码', trigger: ['blur', 'change'] }], -// programmeTemplateCode: [ -// { required: true, message: '请选择检验模板编码', trigger: ['blur', 'change'] } -// ], -// splitRule: [{ required: true, message: '请选择拆分规则', trigger: ['blur', 'change'] }], -// aql: [{ required: true, message: '请选择aql', trigger: ['blur', 'change'] }], -// inspectionLevel: [{ required: true, message: '请选择检验水平', trigger: ['blur', 'change'] }], -// effectiveDate: [{ required: true, message: '请选择生效时间', trigger: ['blur', 'change'] }], -// expirationDate: [{ required: true, message: '请选择失效时间', trigger: ['blur', 'change'] }], -// 'inspectionJobCharacteristicsUpdateReqVO.description': [ -// { required: true, message: '请填写描述', trigger: ['blur', 'change'] } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.inspectionMethodCode': [ -// { required: true, message: '请选择检验方法编码', trigger: 'blur' } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.dynamicUpdateCode': [ -// { required: true, message: '请选择采样过程编码', trigger: ['blur', 'change'] } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.inspectionMethod': [ -// { required: true, message: '请选择动态修改规则编码', trigger: ['blur', 'change'] } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod': [ -// { required: true, message: '请选择结果录入方式', trigger: ['blur', 'change'] } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.featureType': [ -// { required: true, message: '请选择特征类型', trigger: ['blur', 'change'] } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.quantifyTarget': [ -// { required: true, message: '请输入目标值', trigger: 'blur' } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.quantifyCapping': [ -// { required: true, message: '请输入上限值', trigger: 'blur' } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit': [ -// { required: true, message: '请输入下限值', trigger: 'blur' } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.quantifyUom': [ -// { required: true, message: '请选择计量单位', trigger: 'blur' } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.quantifyDecimal': [ -// { required: true, message: '请输入小数位', trigger: 'blur' } -// ], -// 'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [ -// { required: true, message: '请输入选择集编码', trigger: 'blur' } -// ] -// }) /** 打开弹窗 */ let tabIndex = 1 @@ -647,9 +629,36 @@ const validateForm = (formRef) => { const submitForm = async () => { try { - const validateForm1 = await validateForm(formProcessRef.value) - // console.log(validateForm1) - // await formMainRef.value.validate() + + console.log(data.value.subList) + // const validateForm1 = await validateForm(formMainRef.value) + const elForm = unref(formMainRef)?.getElFormRef() + // 校验表单 + if (!elForm) return + const valid = await elForm.validate() + if (!valid) return + // const bol1 = await validateForm(formProcessRef.value) + // const bol2 = await validateForm(formFeaturesRef.value) + // console.log(bol2) + // if (!bol2) { + // message.error(`模板中有检验工序和检验特性未填写完全`) + // return + // } + // 判断附加费用数组是否有未填的选项 + let arrBol = data.value.subList.map((item, index) => { + if(item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1){ + return item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some((cur,key) =>{ + return !cur.qualifiedQuantity || !cur.unqualifiedQuantity + }) + } + }) + console.log(arrBol) + let isEmpty1 = arrBol.some(item=>item== true) + if (isEmpty1) { + proxy.$modal.msgError("请填写完整信息"); + return; + } + return // if (!data.value.process || data.value.process.length == 0) { // message.error(`请添加工序`) // return diff --git a/src/views/qms/inspection/inspectionJob/index.vue b/src/views/qms/inspection/inspectionJob/index.vue index e74a0128d..66577f3c3 100644 --- a/src/views/qms/inspection/inspectionJob/index.vue +++ b/src/views/qms/inspection/inspectionJob/index.vue @@ -39,7 +39,7 @@ :formAllSchemasFeatures="InspectionTemplateFeatures.allSchemas" :formAllSchemasProcess="InspectionTemplateProcess.allSchemas" :formAllSchemasMain="InspectionTemplateMain.allSchemas" - :rules="InspectionTemplateRules" + :rules="InspectionJobMainRules" :formAllSchemas="InspectionJobMain.allSchemas" @submitForm="submitForm" /> @@ -50,7 +50,7 @@ :apiUpdate="InspectionJobDetailApi.updateInspectionJobDetail" :apiPage="InspectionJobDetailApi.getInspectionJobDetailPage" :apiDelete="InspectionJobDetailApi.deleteInspectionJobDetail" @searchTableSuccessDetail="searchTableSuccessDetail" - :isShowAddBtn="false" :detailButtonIsShow="true" /> + :isShowAddBtn="false" :detailButtonIsShow="true"/> ([ field: 'inspectionType', sort: 'custom', isSearch: false, + dictType: DICT_TYPE.INSPECTION_TYPE, + dictClass: 'string', form: { component: 'Select', componentProps:{ @@ -178,6 +190,8 @@ export const InspectionJobMain = useCrudSchemas(reactive([ field: 'inspectionBatchSource', sort: 'custom', isSearch: false, + dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE, + dictClass: 'string', form:{ componentProps:{ disabled:true @@ -202,6 +216,8 @@ export const InspectionJobMain = useCrudSchemas(reactive([ field: 'inspectionStringency', sort: 'custom', isSearch: false, + dictType: DICT_TYPE.INSPECTION_SEVERITY, + dictClass: 'string', form:{ componentProps:{ disabled:true @@ -281,6 +297,8 @@ export const InspectionJobMain = useCrudSchemas(reactive([ field: 'inspectionLevel', sort: 'custom', isSearch: false, + dictType: DICT_TYPE.INSPECTION_LEVEL, + dictClass: 'string', form:{ componentProps:{ disabled:true @@ -292,6 +310,8 @@ export const InspectionJobMain = useCrudSchemas(reactive([ field: 'aqlValue', sort: 'custom', isSearch: false, + dictType: DICT_TYPE.BASIC_AQL, + dictClass: 'string', form:{ componentProps:{ disabled:true @@ -312,13 +332,22 @@ export const InspectionJobMain = useCrudSchemas(reactive([ { label: '是否可用', field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, sort: 'custom', - isSearch: false, - form:{ - componentProps:{ + table: { + width: 150 + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', disabled:true } - } + }, }, { label: '操作', @@ -334,24 +363,7 @@ export const InspectionJobMain = useCrudSchemas(reactive([ //表单校验 export const InspectionJobMainRules = reactive({ - number: [required], - inspectionCode: [required], - supplierCode: [required], - materialCode: [required], - materialBatch: [required], - orderCode: [required], - certificateRow: [required], - inspectionSchemeCode: [required], - inspectionSchemeJson: [required], - inspectionBatch: [required], - inspectionBatchAmount: [required], - sampleTatalAmount: [required], - inspectionType: [required], - inspectionBatchSource: [required], - inspectionStage: [required], - inspectionStringency: [required], - inspectionLevel: [required], - available: [required], + usageDecision: [required], }) /** @@ -407,24 +419,35 @@ export const InspectionJobDetail = useCrudSchemas(reactive([ sort: 'custom', },{ label: '采样过程编码', - field: 'inspectionMethod', + field: 'inspectionJobCharacteristicsRespVO.inspectionMethod', sort: 'custom', },{ label: '动态修改规则编码', - field: 'dynamicUpdateCode', + 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: 'resultEntryMethod', + 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: 'featureType', + field: 'inspectionJobCharacteristicsRespVO.featureType', sort: 'custom', + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return featureTypeList.find((account) => account.value == cellValue)?.label + }, } ])) From 54ff700b559f0c77260b4882393dae3e75a3e86c Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Mon, 8 Apr 2024 08:23:58 +0800 Subject: [PATCH 04/32] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qms/inspectionMethod/index.ts | 1 + src/components/UploadFile/src/UploadFile.vue | 12 ++++ src/views/qms/inspectionMethod/index.vue | 59 +++++++++++++++---- .../inspectionMethod/inspectionMethod.data.ts | 35 ++++++++++- 4 files changed, 96 insertions(+), 11 deletions(-) diff --git a/src/api/qms/inspectionMethod/index.ts b/src/api/qms/inspectionMethod/index.ts index dae6cc6bc..5721037b9 100644 --- a/src/api/qms/inspectionMethod/index.ts +++ b/src/api/qms/inspectionMethod/index.ts @@ -33,6 +33,7 @@ export const createInspectionMethod = async (data: InspectionMethodVO) => { // 修改检验方法 export const updateInspectionMethod = async (data: InspectionMethodVO) => { + // debugger return await request.put({ url: `/qms/inspection-method/update`, data }) } diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index 1f8b90948..36fed8b4b 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -137,6 +137,7 @@ const handleRemove = (file) => { } const handlePreview: UploadProps['onPreview'] = (uploadFile) => { console.log(uploadFile) + window.open(uploadFile.url) } // 对象转成指定字符串分隔 const listToString = (list: UploadUserFile[], separator?: string) => { @@ -147,6 +148,17 @@ const listToString = (list: UploadUserFile[], separator?: string) => { } return strs != '' ? strs.substr(0, strs.length - 1) : '' } +watch( + () => props.modelValue, + (data) => { + if (!data) return + fileList.value = data + }, + { + deep: true, + immediate: true + } +) + diff --git a/src/views/qms/inspection/inspectionJob/index.vue b/src/views/qms/inspection/inspectionJob/index.vue index 66577f3c3..b5e4ed1cb 100644 --- a/src/views/qms/inspection/inspectionJob/index.vue +++ b/src/views/qms/inspection/inspectionJob/index.vue @@ -43,14 +43,23 @@ :formAllSchemas="InspectionJobMain.allSchemas" @submitForm="submitForm" /> + - + :isShowAddBtn="false" :detailButtonIsShow="true"/> --> +
+ + + + + + + + +
检验工序
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
检验特性
+ + + + + + + + + + + + + + +
+ +
+
+
+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+ + + + + diff --git a/src/views/qms/inspection/inspectionRecord/index.vue b/src/views/qms/inspection/inspectionRecord/index.vue index 7116df0d8..89e8ab19d 100644 --- a/src/views/qms/inspection/inspectionRecord/index.vue +++ b/src/views/qms/inspection/inspectionRecord/index.vue @@ -35,17 +35,23 @@ @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> - - + @searchTableSuccessDetail="searchTableSuccessDetail" :isShowAddBtn="false" :detailButtonIsShow="true" /> --> + - diff --git a/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js b/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js index bb71d4420..e0da73e77 100644 --- a/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js +++ b/src/components/bpmnProcessDesigner/src/utils/directive/clickOutSide.js @@ -22,9 +22,13 @@ export default { methodName: binding.expression, bindingFn: binding.value } - - setTimeout(() => { + let timer + timer = setTimeout(() => { document.addEventListener('touchstart', documentHandler) // 为document绑定事件 + if(timer){ + clearTimeout(timer) + timer = null + } }) }, update(el, binding) { diff --git a/src/components/iFrame/src/IFrame.vue b/src/components/iFrame/src/IFrame.vue index 85b3e3c34..5d2626d6d 100644 --- a/src/components/iFrame/src/IFrame.vue +++ b/src/components/iFrame/src/IFrame.vue @@ -14,6 +14,8 @@ const init = () => { height.value = document.documentElement.clientHeight - 94.5 + 'px' loading.value = false } +const timer1 = ref() +const timer2 = ref() console.log(props.src); function populateIframe(iframe, headers) { @@ -37,14 +39,33 @@ function populateIframe(iframe, headers) { onMounted(() => { - setTimeout(() => { + timer1.value = setTimeout(() => { var iframe = document.querySelector("#iframe"); populateIframe(iframe, [["Authorization", 'Bearer ' + getAccessToken()], ["tenant-id", getTenantId()]]); + if(timer1.value){ + clearTimeout(timer1.value) + timer1.value = 0 + } }, 300); - setTimeout(() => { + timer2.value = setTimeout(() => { init() + if(timer2.value){ + clearTimeout(timer2.value) + timer2.value = 0 + } }, 300) }) + +onBeforeUnmount(() => { + if(timer1.value){ + clearTimeout(timer1.value) + timer1.value = 0 + } + if(timer2.value){ + clearTimeout(timer2.value) + timer2.value = 0 + } +}) From aa9df7d4e059a85c6f266025f178626c69fb405d Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 8 Apr 2024 16:34:07 +0800 Subject: [PATCH 32/32] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E5=8F=91=E5=B8=83=E5=92=8C=E4=BD=BF=E7=94=A8=E5=86=B3?= =?UTF-8?q?=E7=AD=96=EF=BC=8C=E6=A3=80=E9=AA=8C=E4=BB=BB=E5=8A=A1=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionRecordMain/index.ts | 4 ++ src/locales/en-US.ts | 3 +- src/locales/zh-CN.ts | 3 +- src/utils/disposition/defaultButtons.ts | 13 +++- .../inspectionPlan/addForm.vue | 2 - .../qms/inspection/inspectionJob/addForm.vue | 61 ++++++++++--------- .../qms/inspection/inspectionRecord/index.vue | 41 +++++++++++-- .../inspectionRecordMain.data.ts | 35 +++++++++++ 8 files changed, 123 insertions(+), 39 deletions(-) diff --git a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts b/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts index 02663e294..c04557bd6 100644 --- a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts +++ b/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts @@ -63,3 +63,7 @@ export const exportInspectionRecordMain = async (params) => { export const importTemplate = () => { return request.download({ url: '/qms/inspection-record-main/get-import-template' }) } +// 发布 +export const publishInspectionRecordMain = async (data ) => { + return await request.put({ url: `/qms/inspection-record-main/publish`, data }) +} diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 05d1cd48a..4590ca435 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -313,7 +313,8 @@ export default { dataUpdate: 'Dict Data Eidt', fileUpload: 'File Upload', createLabel: 'create label', - viewDetail:'Detailed list' + viewDetail:'Detailed list', + updataRecode:'Updata recode' }, dialog: { dialog: 'Dialog', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 979826038..37dc11cb8 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -312,7 +312,8 @@ export default { dataCreate: '字典数据新增', dataUpdate: '字典数据编辑', createLabel: '创建标签', - viewDetail:'明细列表' + viewDetail:'明细列表', + updataRecode:'更新记录' }, dialog: { dialog: '弹窗', diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 7f81426e2..998e0a9ac 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -811,7 +811,18 @@ export function mainThawRequesttBtn(option:any) { hasPermi: '' }) } - +// 主列表-更新检验记录 +export function mainUpdataRecodeBtn(option:any) { + return __defaultBtnOption(option,{ + label: '更新检验记录', + name: 'updataRecode', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue index 8b584fb2c..967a5833b 100644 --- a/src/views/qms/basicDataManage/inspectionPlan/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionPlan/addForm.vue @@ -886,8 +886,6 @@ const validateForm = (formRef) => { const submitForm = async () => { try { const validateForm1 = await validateForm(formProcessRef.value) - console.log(validateForm1) - console.log(data.value) await formMainRef.value.validate() if (!data.value.process || data.value.process.length == 0) { message.error(`请添加工序`) diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue index 10fa03b5c..d562c7be1 100644 --- a/src/views/qms/inspection/inspectionJob/addForm.vue +++ b/src/views/qms/inspection/inspectionJob/addForm.vue @@ -515,11 +515,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any editableTabsValue.value = index + 1 item.name = index + 1 item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) { // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - for (let i = 0; i < data.value.sampleTotalAmount; i++) { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + for (let i = 0; i < parseInt(data.value.sampleTotalAmount); i++) { item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ inspectionValue: '', //检验值 qualitativeCode: '', //定性字典项值 @@ -530,17 +530,17 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any }) } } else { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [ - { - inspectionValue: '', //检验值 - qualitativeCode: '', //定性字典项值 - estimateCode: '', //评估代码 - defectLevel: '', //缺陷级别 - qualifiedQuantity: '', //合格数量 - unqualifiedQuantity: '' //不合格数量 - } - ] + // item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ + // inspectionValue: '', //检验值 + // qualitativeCode: '', //定性字典项值 + // estimateCode: '', //评估代码 + // defectLevel: '', //缺陷级别 + // qualifiedQuantity: '', //合格数量 + // unqualifiedQuantity: '' //不合格数量 + // } + // ) } // 编辑判断上限下限目标值是否必填 if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { @@ -700,10 +700,11 @@ const submitForm = async () => { return } // 判断附加费用数组是否有未填的选项 - let arrBol = data.value.subList.map((item, index) => { - let arr1 = [] + let arrBol = [] + let isOutweigh = []//结束时间是否大于开始时间 + data.value.subList.forEach((item, index) => { if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { - arr1.push( + arrBol.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( (cur, key) => { return !cur.qualifiedQuantity || !cur.unqualifiedQuantity @@ -712,7 +713,7 @@ const submitForm = async () => { ) } if (item.samplingProcessRespVO.evaluationMode == 1) { - arr1.push( + arrBol.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( (cur, key) => { return !cur.estimateCode || !cur.defectLevel @@ -721,7 +722,7 @@ const submitForm = async () => { ) } if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { - arr1.push( + arrBol.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( (cur, key) => { return !cur.inspectionValue @@ -730,7 +731,7 @@ const submitForm = async () => { ) } if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1) { - arr1.push( + arrBol.push( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( (cur, key) => { return !cur.qualitativeCode @@ -738,17 +739,21 @@ const submitForm = async () => { ) ) } - return arr1 + // 开始时间大于结束时间放入数组中 + if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { + isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) + } }) - // console.log(arrBol) - // let isEmpty1 = arrBol.filter(item=>item == true) - // arrBol.forEach(item=>{ - // console.log('1q1q') - // console.log(typeof item) - // }) - // setTimeout(()=>{ - // console.log(arrBol.includes(true)) - // },2000) + let isEmpty1 = arrBol.some(item=>item == true) + if(isEmpty1){ + message.error('检验工序和检验特性有字段未填写完全') + return; + } + if(isOutweigh.length>0){ + message.error('检验特性中有开始时间大于结束时间') + return; + } + return; if (formType.value == 'create') { // 主子表——提交请求 emit('submitForm', formType.value, data.value) diff --git a/src/views/qms/inspection/inspectionRecord/index.vue b/src/views/qms/inspection/inspectionRecord/index.vue index 46d6b961c..ae0e3ab24 100644 --- a/src/views/qms/inspection/inspectionRecord/index.vue +++ b/src/views/qms/inspection/inspectionRecord/index.vue @@ -58,7 +58,7 @@ diff --git a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts index 11ea76270..436752732 100644 --- a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts +++ b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts @@ -13,72 +13,84 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'number', sort: 'custom', isSearch: true, + isForm:false }, { label: '申请编码', field: 'applicationCode', sort: 'custom', isSearch: true, + isForm:false }, { label: '任务编码', field: 'taskCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '供应商编码', field: 'supplierCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '物料编码', field: 'materialCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '批次', field: 'batch', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验方案编码', field: 'inspectionSchemeCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验方案Json', field: 'inspectionSchemeJson', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验批次', field: 'inspectionBatch', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验批数量', field: 'inspectionBatchAmount', sort: 'custom', isSearch: false, + isForm:false }, { label: '采样总数量', field: 'sampleTatalAmount', sort: 'custom', isSearch: false, + isForm:false }, { label: '检验类型', field: 'inspectionType', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'Select' }, @@ -88,18 +100,21 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionBatchSource', sort: 'custom', isSearch: false, + isForm:false }, { label: '订单号', field: 'orderCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '订单行', field: 'orderRow', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'InputNumber', value: 0 @@ -110,12 +125,14 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'certificateCode', sort: 'custom', isSearch: false, + isForm:false }, { label: '凭证行', field: 'certificateRow', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'InputNumber', value: 0 @@ -126,6 +143,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionStage', sort: 'custom', isSearch: false, + isForm:false, form: { component: 'InputNumber', value: 0 @@ -136,12 +154,14 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionStringency', sort: 'custom', isSearch: false, + isForm:false, }, { label: '使用决策', field: 'useDecision', sort: 'custom', isSearch: false, + isForm:false }, { label: '计划开始时间', @@ -149,6 +169,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -171,6 +192,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -193,6 +215,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -215,6 +238,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -236,18 +260,29 @@ export const InspectionRecordMain = useCrudSchemas(reactive([ field: 'inspectionLevel', sort: 'custom', isSearch: false, + isForm:false, }, { label: 'AQL值', field: 'aqlValue', sort: 'custom', isSearch: false, + isForm:false, }, { label: '是否可用', field: 'available', sort: 'custom', isSearch: false, + isForm:false, + }, + { + label: '使用决策', + field: 'useDecision', + sort: 'custom', + isSearch: false, + dictType: DICT_TYPE.USAGE_DECISION, + }, { label: '创建时间',