diff --git a/src/views/qms/inspectionJob/addForm.vue b/src/views/qms/inspectionJob/addForm.vue index 6fc8fc810..88e5dc8d3 100644 --- a/src/views/qms/inspectionJob/addForm.vue +++ b/src/views/qms/inspectionJob/addForm.vue @@ -370,30 +370,35 @@ // 总数量值是 样品份数 乘 每份样品量 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 - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] - for (let i = 0; i < parseInt(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty); i++) { + if(!item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList){ + // 单个录入时 + if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) { + // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + for (let i = 0; i < parseInt(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty); i++) { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ + inspectionValue: '', //检验值 + qualitativeCode: '', //定性字典项值 + defectLevel: '', //缺陷级别 + qualifiedQuantity: '', //合格数量 + unqualifiedQuantity: '' //不合格数量 + }) + } + } else { + // 汇总录入时 + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ inspectionValue: '', //检验值 qualitativeCode: '', //定性字典项值 defectLevel: '', //缺陷级别 qualifiedQuantity: '', //合格数量 unqualifiedQuantity: '' //不合格数量 - }) - } - } else { - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ - inspectionValue: '', //检验值 - qualitativeCode: '', //定性字典项值 - defectLevel: '', //缺陷级别 - qualifiedQuantity: '', //合格数量 - unqualifiedQuantity: '' //不合格数量 + } + ) } - ) } + // 编辑判断上限下限目标值是否必填 if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true @@ -424,13 +429,15 @@ */ for (let i = 0; i < data.value.packageList.length; i++) { - if (allSamplePieceSize.value > data.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; + if(data.value.packageList[i].sampleAmount==null){ + if (allSamplePieceSize.value > data.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=>{ @@ -802,6 +809,7 @@ return; } await InspectionJobMainApi.stagingInspectionJobMain(data.value); + message.success("暂存成功") } catch { console.log(111) }