From 7e56ec73b8e4df28cfd12a97277067f8004d2cc1 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Mon, 6 May 2024 11:47:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C=E6=97=B6=EF=BC=8C=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=8C=85=E8=A3=85=E4=BD=9C=E4=B8=BA=E5=8F=96?= =?UTF-8?q?=E6=A0=B7=E5=8C=85=E8=A3=85=EF=BC=8C=E5=A6=82=E6=9E=9C=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E7=AC=AC=E4=B8=80=E4=B8=AA=E5=8C=85=E8=A3=85?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E4=B8=8D=E8=B6=B3=EF=BC=8C=E5=86=8D=E7=94=A8?= =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E4=B8=AA=E5=8C=85=E8=A3=85=E3=80=82=E6=A3=80?= =?UTF-8?q?=E9=AA=8C=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=A3=80=E9=AA=8C=E5=B7=A5=E5=BA=8F=E6=98=BE=E7=A4=BA=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/disposition/defaultButtons.ts | 12 ++ .../inspectionTemplate/addForm.vue | 116 ++++++++++++++---- .../inspectionTemplate/index.vue | 3 + .../qms/inspection/inspectionJob/addForm.vue | 41 ++++++- .../qms/inspection/inspectionJob/detail.vue | 17 ++- .../inspection/inspectionRecord/detail.vue | 96 ++++++++------- 6 files changed, 215 insertions(+), 70 deletions(-) diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 0d150fc98..b17c3eb2d 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -896,6 +896,18 @@ export function mainApplyDecisionBtn(option:any) { hasPermi: '' }) } +// 主列表-复制 +export function mainCopyBtn(option:any) { + return __defaultBtnOption(option,{ + label: '复制', + name: 'copy', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue index 729e1fcef..aa72e0a49 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue +++ b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue @@ -562,30 +562,99 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any } formType.value = type if (row) { - data.value = JSON.parse(JSON.stringify(row)) - data.value.version = String(data.value.version) - let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) - list.forEach((item, index) => { - editableTabsValue.value = index + 1 - item.name = index + 1 - // 编辑判断上限下限目标值是否必填 - if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { - rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true - } else { - rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false + console.log(row) + // 如果点击复制进入 + if(formType.value == 'create'){ + data.value ={ + code: '', + description:row.description, + version:String(row.version), + dynamicUpdateCode:row.dynamicUpdateCode, + dynamicUpdateName:row.dynamicUpdateName, + process: [] } - if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { - rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true - } else { - rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false - } - if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { - rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true - } else { - rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false - } - }) - data.value.process = list + let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) + let arr = [] + list.forEach((item, index) => { + editableTabsValue.value = index + 1 + item.name = index + 1 + console.log(item.inspectionCharacteristicsBaseVO) + + let obj = { + description:item.description, + inspectionCharCode:item.inspectionCharCode, + inspectionCode:item.inspectionCode, + sequenceCode:item.sequenceCode, + name : index + 1, + inspectionCharacteristicsBaseVO:{ + description:item.inspectionCharacteristicsBaseVO.description, + featureType:item.inspectionCharacteristicsBaseVO.featureType, + inspectionMethodCode:item.inspectionCharacteristicsBaseVO.inspectionMethodCode, + inspectionMethodName:item.inspectionCharacteristicsBaseVO.inspectionMethodName, + isCanUpdate:item.inspectionCharacteristicsBaseVO.isCanUpdate, + isDestructionInspection:item.inspectionCharacteristicsBaseVO.isDestructionInspection, + quantifyCapping:item.inspectionCharacteristicsBaseVO.quantifyCapping, + quantifyDecimal:item.inspectionCharacteristicsBaseVO.quantifyDecimal, + quantifyIsCapping:item.inspectionCharacteristicsBaseVO.quantifyIsCapping, + quantifyIsLowlimit:item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit, + quantifyIsTarget:item.inspectionCharacteristicsBaseVO.quantifyIsTarget, + quantifyLowlimit:item.inspectionCharacteristicsBaseVO.quantifyLowlimit, + quantifyQuantifyCode:item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode, + quantifyQuantifyName:item.inspectionCharacteristicsBaseVO.quantifyQuantifyName, + quantifyTarget:item.inspectionCharacteristicsBaseVO.quantifyTarget, + quantifyUom:item.inspectionCharacteristicsBaseVO.quantifyUom, + resultEntryMethod:item.inspectionCharacteristicsBaseVO.resultEntryMethod, + samplingProcessCode:item.inspectionCharacteristicsBaseVO.samplingProcessCode, + samplingProcessName:item.inspectionCharacteristicsBaseVO.samplingProcessName, + } + } + + // 编辑判断上限下限目标值是否必填 + if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { + rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true + } else { + rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false + } + if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { + rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true + } else { + rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false + } + if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { + rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true + } else { + rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false + } + arr.push(obj) + }) + data.value.process = arr + }else{ + data.value = JSON.parse(JSON.stringify(row)) + data.value.version = String(data.value.version) + let list = await InspectionProcessPageApi.getListByTempleteCode(row.code) + list.forEach((item, index) => { + editableTabsValue.value = index + 1 + item.name = index + 1 + // 编辑判断上限下限目标值是否必填 + if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { + rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true + } else { + rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false + } + if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { + rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true + } else { + rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false + } + if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { + rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true + } else { + rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false + } + }) + data.value.process = list + } + } else { data.value = { code: '', @@ -643,7 +712,6 @@ const buttonBaseClick1 = (val) => { sequenceCode: '', inspectionCharCode: '', inspectionCharacteristicsBaseVO: { - describe: '', inspectionMethodCode: '', samplingProcessCode: '', isCanUpdate: '', diff --git a/src/views/qms/basicDataManage/inspectionTemplate/index.vue b/src/views/qms/basicDataManage/inspectionTemplate/index.vue index c04889e45..dd0a4cea7 100644 --- a/src/views/qms/basicDataManage/inspectionTemplate/index.vue +++ b/src/views/qms/basicDataManage/inspectionTemplate/index.vue @@ -138,6 +138,7 @@ const butttondata = (row) => { defaultButtons.mainListEditBtn({hasPermi: 'qms:programme-template:update'}), defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:programme-template:enable'}), defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:programme-template:disable'}), + defaultButtons.mainCopyBtn({hasPermi:'qms:programme-template:copy'}), ] } @@ -151,6 +152,8 @@ const buttonTableClick = async (val, row) => { handleEnable(row.id) }else if (val == 'disable') { handleDisable(row.id) + }else if (val == 'copy') { + openForm('create', row) } } diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue index 300bdc829..8d3704a9a 100644 --- a/src/views/qms/inspection/inspectionJob/addForm.vue +++ b/src/views/qms/inspection/inspectionJob/addForm.vue @@ -8,7 +8,7 @@ - +
检验工序
@@ -64,10 +64,17 @@
- +
+
+ + +
+ +
+
@@ -316,7 +323,7 @@ const rules = ref({ ], qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }] }) - +const allSamplePieceSize = ref(0) /** 打开弹窗 */ let tabIndex = 1 const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => { @@ -326,6 +333,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any dialogTitle.value = t('action.' + type) } formType.value = type + allSamplePieceSize.value =0//打开时候归0 if (row) { data.value = JSON.parse(JSON.stringify(row)) // console.log(data.value)// 发起承接 @@ -337,6 +345,9 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any editableTabsValue.value = index + 1 item.name = index + 1 item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO + + // 总数量值是 样品份数 乘 每份样品量 + allSamplePieceSize.value += parseFloat((parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) * parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)).toFixed(2)) // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) { // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true @@ -384,8 +395,25 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false } }) + console.log(22,allSamplePieceSize.value ) data.value.subList = list + /** + 设置采样数量,默认第一个包装采样数量<总数量,显示数量字段,第二个包装和剩下的总数量对比,以此类推, + 第一个包装采样数量>总数量 则显示总数量 + */ + for(let i = 0; idata.value.packageList[i].amount){ + data.value.packageList[i].sampleAmount = data.value.packageList[i].amount + allSamplePieceSize.value = parseFloat((allSamplePieceSize.value - data.value.packageList[i].amount).toFixed(2)) + }else{ + data.value.packageList[i].sampleAmount = allSamplePieceSize.value + allSamplePieceSize.value=0 + // return; + } + } + // data.value.packageList.forEach(item=>{ + // }) dialogVisible.value = true nextTick(() => { formMainRef.value.setValues(row) @@ -522,7 +550,12 @@ const submitForm = async () => { console.log(11,data.value.packageList) if(data.value.packageList?.length>0){ const validateForm1 = await tableFormRef.value.validateForm() - if (!validateForm1) return + if (!validateForm1) return + let isPass = data.value.packageList.some(cur=>parseFloat(cur.sampleAmount)>parseFloat(cur.amount)) + if(isPass){ + message.error(`采样数量不能大于数量`) + return + } // let number = 0 // data.value.packageList.forEach(cur=>{ // number += parseFloat(cur.sampleAmount) diff --git a/src/views/qms/inspection/inspectionJob/detail.vue b/src/views/qms/inspection/inspectionJob/detail.vue index 3d93cde1d..a345b6424 100644 --- a/src/views/qms/inspection/inspectionJob/detail.vue +++ b/src/views/qms/inspection/inspectionJob/detail.vue @@ -11,7 +11,7 @@ - +
检验工序
@@ -59,6 +59,21 @@
+ + +
+ +
+
+
+ + + +
+ +
+
+
diff --git a/src/views/qms/inspection/inspectionRecord/detail.vue b/src/views/qms/inspection/inspectionRecord/detail.vue index 2ce5af780..5a8f664d4 100644 --- a/src/views/qms/inspection/inspectionRecord/detail.vue +++ b/src/views/qms/inspection/inspectionRecord/detail.vue @@ -76,47 +76,61 @@ - -
- -
-
-
- - -
- -
-
-
- + +
+ +
+
+ + + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ Date: Mon, 6 May 2024 13:22:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inventorymove/inventorymoveRequestMain/index.vue | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue index b5228220e..0c45941bd 100644 --- a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue +++ b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue @@ -84,7 +84,6 @@ import { InventorymoveRequestMain,InventorymoveRequestMainRules,InventorymoveReq import * as InventorymoveRequestMainApi from '@/api/wms/inventorymoveRequestMain' import * as InventorymoveRequestDetailApi from '@/api/wms/inventorymoveRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import { log } from 'console' // 库存转移申请 defineOptions({ name: 'InventorymoveRequestMain' }) @@ -602,8 +601,6 @@ const submitForm = async (formType, data) => { data.subList = tableData.value // 拼接子表数据参数 let isExist = false tableData.value.forEach(item => { - console.log(item,777777777777); - let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber == item.fromPackingNumber) ) console.log(rs,5666); if(rs.length > 1) isExist = true