diff --git a/src/views/qms/inspectionRecordFirst/addForm.vue b/src/views/qms/inspectionRecordFirst/addForm.vue index e0bcf9785..095c3d0bd 100644 --- a/src/views/qms/inspectionRecordFirst/addForm.vue +++ b/src/views/qms/inspectionRecordFirst/addForm.vue @@ -34,9 +34,12 @@
- + @@ -45,7 +48,7 @@ - + @@ -59,8 +62,14 @@ + @blur=" + onInspectionSchemeBlur( + 'inspectionSchemeCode', + InspectionSchemeApi.InspectionSchemePage + ) + " + @focus="onFocus" + /> - - + @@ -130,424 +139,427 @@
-
检验工序
- - - - - - - - - - - - - - - - - - - - - - - - -
检验特性
- -
+
检验工序
+ - - - - - - - - - - - - -
- -
-
-
- - -
+ + -
-
-
- - -
+ + + + -
-
-
- - - -
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + +
+
+
检验特性
+ +
+ + + + + + + + + + + + + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
- - - - - - - - - - + + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - -
- - + + + + - + + - - + - + + - - - - + + - - + + + + + + + - + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
-
-
-
-
-
+
+
-
{ - editableTabsValue.value = 1 - list.forEach((item, index) => { - item.name = index + 1 - item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionRecordCharacteristicsRespVO - item.isPass = '' //判断是否显示对号错误图标 - // 总数量值是 样品份数 乘 每份样品量 - allSamplePieceSize.value += parseFloat( - ( - parseFloat(item.samplingProcessRespVO.sampleQty) * - parseFloat(InspectionSchemeObj.samplePieceSize) - ).toFixed(6) - ) - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1 ? item.inspectionJobCharacteristicsUpdateReqVO.qualitativeRespVOList : item.inspectionJobCharacteristicsUpdateReqVO.quantifyRespVOList - - if (!item?.inspectionJobCharacteristicsUpdateReqVO?.recordInspectionQuantifyList) { - // 单个录入时 - if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) { - // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] - for ( - let i = 0; - i < parseInt(item.samplingProcessRespVO.sampleQty); - i++ - ) { - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ - inspectionValue: '', //检验值 - qualitativeCode: '', //定性字典项值 - defectLevel: '', //缺陷级别 - qualifiedQuantity: '', //合格数量 - unqualifiedQuantity: '' //不合格数量 - }) - } - } else { - // 汇总录入时 - console.log(2333,item.inspectionJobCharacteristicsUpdateReqVO) - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false +const processList = async (InspectionSchemeObj, list) => { + editableTabsValue.value = 1 + list.forEach((item, index) => { + item.name = index + 1 + item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionRecordCharacteristicsRespVO + item.isPass = '' //判断是否显示对号错误图标 + // 总数量值是 样品份数 乘 每份样品量 + allSamplePieceSize.value += parseFloat( + ( + parseFloat(item.samplingProcessRespVO.sampleQty) * + parseFloat(InspectionSchemeObj.samplePieceSize) + ).toFixed(6) + ) + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = + item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1 + ? item.inspectionJobCharacteristicsUpdateReqVO.qualitativeRespVOList + : item.inspectionJobCharacteristicsUpdateReqVO.quantifyRespVOList + + if (!item?.inspectionJobCharacteristicsUpdateReqVO?.recordInspectionQuantifyList) { + // 单个录入时 + if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) { + // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + for (let i = 0; i < parseInt(item.samplingProcessRespVO.sampleQty); i++) { item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ inspectionValue: '', //检验值 qualitativeCode: '', //定性字典项值 defectLevel: '', //缺陷级别 - qualifiedQuantity: parseFloat( - ( - parseFloat(item.samplingProcessRespVO.sampleQty) * - parseFloat(InspectionSchemeObj.samplePieceSize) - ).toFixed(6) - ), //合格数量 - unqualifiedQuantity: '0' //不合格数量 + qualifiedQuantity: '', //合格数量 + unqualifiedQuantity: '' //不合格数量 }) } - } - - // 编辑判断上限下限目标值是否必填 - if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true } else { + // 汇总录入时 + console.log(2333, item.inspectionJobCharacteristicsUpdateReqVO) + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ + inspectionValue: '', //检验值 + qualitativeCode: '', //定性字典项值 + defectLevel: '', //缺陷级别 + qualifiedQuantity: parseFloat( + ( + parseFloat(item.samplingProcessRespVO.sampleQty) * + parseFloat(InspectionSchemeObj.samplePieceSize) + ).toFixed(6) + ), //合格数量 + unqualifiedQuantity: '0' //不合格数量 + }) } - if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false - } - if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false - } - if (item.samplingProcessRespVO.evaluationMode == 1) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false - } - }) - - data.value.subList = list + } + + // 编辑判断上限下限目标值是否必填 + if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false + } + if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false + } + if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false + } + if (item.samplingProcessRespVO.evaluationMode == 1) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false + } + }) + + data.value.subList = list } defineExpose({ open, dialogVisible, formLoading }) // 提供 open 方法,用于打开弹窗 import type { TabPaneName } from 'element-plus' @@ -941,7 +948,7 @@ const validateForm = (formRef) => { } const submitForm = async () => { try { -await formMainRef.value.validate() + await formMainRef.value.validate() const bol2 = await validateForm(formFeaturesRef.value) if (!bol2) { message.error(`模板中有检验工序和检验特性未填写完全`) @@ -1092,9 +1099,9 @@ const opensearchItemsTable = () => { ) } const opensearchInspectionTable = () => { - if(!data.value.itemCode){ + if (!data.value.itemCode) { message.error(`请选择物料`) - return; + return } const _searchCondition = {} const filters: any[] = [] @@ -1167,161 +1174,157 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => { let list = await InspectionJobDetailApi.getBySchemeCode(data.value.inspectionSchemeCode) editableTabsValue.value = 1 list.forEach((item, index) => { - item.name = index + 1 - item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO - item.isPass = '' //判断是否显示对号错误图标 - // 总数量值是 样品份数 乘 每份样品量 - allSamplePieceSize.value += parseFloat( - ( - parseFloat(item.samplingProcessRespVO.sampleQty) * - parseFloat(InspectionSchemeObj.samplePieceSize) - ).toFixed(6) - ) + item.name = index + 1 + item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO + item.isPass = '' //判断是否显示对号错误图标 + // 总数量值是 样品份数 乘 每份样品量 + allSamplePieceSize.value += parseFloat( + ( + parseFloat(item.samplingProcessRespVO.sampleQty) * + parseFloat(InspectionSchemeObj.samplePieceSize) + ).toFixed(6) + ) rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - if (!item?.inspectionJobCharacteristicsUpdateReqVO?.recordInspectionQuantifyList) { - // 单个录入时 - if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) { - // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] - for ( - let i = 0; - i < parseInt(item.samplingProcessRespVO.sampleQty); - i++ - ) { + if (!item?.inspectionJobCharacteristicsUpdateReqVO?.recordInspectionQuantifyList) { + // 单个录入时 + if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) { + // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + for (let i = 0; i < parseInt(item.samplingProcessRespVO.sampleQty); i++) { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ + inspectionValue: '', //检验值 + qualitativeCode: '', //定性字典项值 + defectLevel: '', //缺陷级别 + qualifiedQuantity: '', //合格数量 + unqualifiedQuantity: '' //不合格数量 + }) + } + } else { + // 汇总录入时 + console.log(2333, item.inspectionJobCharacteristicsUpdateReqVO) + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = + false item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ inspectionValue: '', //检验值 qualitativeCode: '', //定性字典项值 defectLevel: '', //缺陷级别 - qualifiedQuantity: '', //合格数量 - unqualifiedQuantity: '' //不合格数量 + qualifiedQuantity: parseFloat( + ( + parseFloat(item.samplingProcessRespVO.sampleQty) * + parseFloat(InspectionSchemeObj.samplePieceSize) + ).toFixed(6) + ), //合格数量 + unqualifiedQuantity: '0' //不合格数量 }) } + } + + // 编辑判断上限下限目标值是否必填 + if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true } else { - // 汇总录入时 - console.log(2333,item.inspectionJobCharacteristicsUpdateReqVO) - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ - inspectionValue: '', //检验值 - qualitativeCode: '', //定性字典项值 - defectLevel: '', //缺陷级别 - qualifiedQuantity: parseFloat( - ( - parseFloat(item.samplingProcessRespVO.sampleQty) * - parseFloat(InspectionSchemeObj.samplePieceSize) - ).toFixed(6) - ), //合格数量 - unqualifiedQuantity: '0' //不合格数量 - }) } - } + if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = + false + } + if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false + } + if (item.samplingProcessRespVO.evaluationMode == 1) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false + } + }) - // 编辑判断上限下限目标值是否必填 - if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false - } - if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false - } - if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false - } - if (item.samplingProcessRespVO.evaluationMode == 1) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false - } - }) - - data.value.subList = list + data.value.subList = list } else if (formField == 'inspectionSchemeCode') { console.log(val[0]) - const InspectionSchemeObj =val[0] + const InspectionSchemeObj = val[0] data.value.samplePieceSize = InspectionSchemeObj.samplePieceSize data.value.inspectionSchemeCode = InspectionSchemeObj.code let list = await InspectionJobDetailApi.getBySchemeCode(data.value.inspectionSchemeCode) editableTabsValue.value = 1 list.forEach((item, index) => { - item.name = index + 1 - item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO - item.isPass = '' //判断是否显示对号错误图标 - // 总数量值是 样品份数 乘 每份样品量 - allSamplePieceSize.value += parseFloat( - ( - parseFloat(item.samplingProcessRespVO.sampleQty) * - parseFloat(InspectionSchemeObj.samplePieceSize) - ).toFixed(6) - ) + item.name = index + 1 + item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO + item.isPass = '' //判断是否显示对号错误图标 + // 总数量值是 样品份数 乘 每份样品量 + allSamplePieceSize.value += parseFloat( + ( + parseFloat(item.samplingProcessRespVO.sampleQty) * + parseFloat(InspectionSchemeObj.samplePieceSize) + ).toFixed(6) + ) rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - if (!item?.inspectionJobCharacteristicsUpdateReqVO?.recordInspectionQuantifyList) { - // 单个录入时 - if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) { - // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] - for ( - let i = 0; - i < parseInt(item.samplingProcessRespVO.sampleQty); - i++ - ) { + if (!item?.inspectionJobCharacteristicsUpdateReqVO?.recordInspectionQuantifyList) { + // 单个录入时 + if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) { + // rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + for (let i = 0; i < parseInt(item.samplingProcessRespVO.sampleQty); i++) { + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ + inspectionValue: '', //检验值 + qualitativeCode: '', //定性字典项值 + defectLevel: '', //缺陷级别 + qualifiedQuantity: '', //合格数量 + unqualifiedQuantity: '' //不合格数量 + }) + } + } else { + // 汇总录入时 + console.log(2333, item.inspectionJobCharacteristicsUpdateReqVO) + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = + false item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ inspectionValue: '', //检验值 qualitativeCode: '', //定性字典项值 defectLevel: '', //缺陷级别 - qualifiedQuantity: '', //合格数量 - unqualifiedQuantity: '' //不合格数量 + qualifiedQuantity: parseFloat( + ( + parseFloat(item.samplingProcessRespVO.sampleQty) * + parseFloat(InspectionSchemeObj.samplePieceSize) + ).toFixed(6) + ), //合格数量 + unqualifiedQuantity: '0' //不合格数量 }) } + } + + // 编辑判断上限下限目标值是否必填 + if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true } else { - // 汇总录入时 - console.log(2333,item.inspectionJobCharacteristicsUpdateReqVO) - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = [] rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ - inspectionValue: '', //检验值 - qualitativeCode: '', //定性字典项值 - defectLevel: '', //缺陷级别 - qualifiedQuantity: parseFloat( - ( - parseFloat(item.samplingProcessRespVO.sampleQty) * - parseFloat(InspectionSchemeObj.samplePieceSize) - ).toFixed(6) - ), //合格数量 - unqualifiedQuantity: '0' //不合格数量 - }) } - } + if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = + false + } + if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false + } + if (item.samplingProcessRespVO.evaluationMode == 1) { + rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = true + } else { + rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false + } + }) - // 编辑判断上限下限目标值是否必填 - if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false - } - if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false - } - if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false - } - if (item.samplingProcessRespVO.evaluationMode == 1) { - rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = true - } else { - rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false - } - }) - - data.value.subList = list - } + data.value.subList = list + } } // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) } @@ -1383,94 +1386,179 @@ const boxList = ref() // }) // } const inspectionValueInput = (item, cur) => { - for ( let i = 0;i < item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.length;i++) { - item.isPass = true -// 如果上限值存在,下限值和目标值不存在 大于上限值显示红色图标 - if ( - item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && - !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && - !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&& - parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) - ) { - item.isPass = false - return - } - // 如果下限值存在,上限值和目标值不存在 小于下限值显示红色图标 - if ( - !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && - item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && - !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&& - parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit) - ) { - item.isPass = false - return - } - // 如果目标值存在,上限值和下限值不存在 小于目标值显示红色图标 - if ( - !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && - !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && - item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&& - parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget) - ) { - item.isPass = false - return - } - // 如果上限值和下限值存在,目标值不存在 大于上限并且小于下限值显示红色图标 - if ( - item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && - item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && - !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&& - ( parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) || - parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit)) - ) { - item.isPass = false - return - } - // 如果上限值和目标值存在,下限值不存在 大于上限并且小于目标值显示红色图标 - if ( - item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && - !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && - item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&& - (parseFloat(cur.inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping)|| - parseFloat(cur.inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget)) - ) { - item.isPass = false - return - } - // 如果下限值和目标值存在,下限值不存在 大于上限并且小于目标值显示红色图标 - if ( - item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && - !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && - item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && - (parseFloat(cur.inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget)|| - parseFloat(cur.inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit)) + for ( + let i = 0; + i < item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.length; + i++ ) { - item.isPass = false - return - } + item.isPass = true + // 如果上限值存在,下限值和目标值不存在 大于上限值显示红色图标 + if ( + item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && + !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && + !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i] + .inspectionValue && + parseFloat( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue + ) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) + ) { + item.isPass = false + return + } + // 如果下限值存在,上限值和目标值不存在 小于下限值显示红色图标 + if ( + !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && + item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && + !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i] + .inspectionValue && + parseFloat( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue + ) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit) + ) { + item.isPass = false + return + } + // 如果目标值存在,上限值和下限值不存在 小于目标值显示红色图标 + if ( + !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && + !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && + item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i] + .inspectionValue && + parseFloat( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue + ) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget) + ) { + item.isPass = false + return + } + // 如果上限值和下限值存在,目标值不存在 大于上限并且小于下限值显示红色图标 + if ( + item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && + item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && + !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i] + .inspectionValue && + (parseFloat( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue + ) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) || + parseFloat( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i] + .inspectionValue + ) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit)) + ) { + item.isPass = false + return + } + // 如果上限值和目标值存在,下限值不存在 大于上限并且小于目标值显示红色图标 + if ( + item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && + !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && + item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i] + .inspectionValue && + (parseFloat(cur.inspectionValue) > + parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) || + parseFloat(cur.inspectionValue) < + parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget)) + ) { + item.isPass = false + return + } + // 如果下限值和目标值存在,下限值不存在 大于上限并且小于目标值显示红色图标 + if ( + item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && + !item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && + item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && + (parseFloat(cur.inspectionValue) > + parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget) || + parseFloat(cur.inspectionValue) < + parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit)) + ) { + item.isPass = false + return + } // 如果上限值和下限值,目标值存在 大于上限并且小于下限值显示红色图标 if ( item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping && item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit && item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget && - item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&& - (parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) || - parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit)) + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i] + .inspectionValue && + (parseFloat( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue + ) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) || + parseFloat( + item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i] + .inspectionValue + ) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit)) ) { item.isPass = false return } } } +const onItemBlur = async (field, pageApi) => { + if (data.value[field]) { + const _searchCondition = {} + const filters: any[] = [] + filters.push( + { + action: '==', + column: 'available', + value: 'TRUE' + }, + { + column: 'type', + action: 'in', + value: 'BCP,CCP' + }, + { + column: 'code', + action: '==', + value: data.value[field]?.trim() + } + ) + // 参数整理 + _searchCondition.isSearch = true + _searchCondition.filters = filters + _searchCondition.pageNo = 1 + _searchCondition.pageSize = 20 + _searchCondition.by = 'ASC' + const array = await pageApi(_searchCondition) + Butttondata = [ + defaultButtons.formSaveBtn(null), // 保存 + defaultButtons.formCloseBtn(null) // 关闭 + ] + count.value++ + const obj = array.list[0] + if (obj) { + // data.value['itemName'] = obj.name + // data.value['desc1'] = obj.desc1 + // const searchTableSuccess = async(formField, searchField, val, type, row) + searchTableSuccess(field,'code',array.list,'main') + } else { + message.alert('暂无数据') + data.value[field] = '' + data.value['itemName'] = '' + data.value['desc1'] = '' + data.value['inspectionSchemeCode'] = '' + data.value.subList =[] + } + } else { + data.value[field] = '' + Butttondata = [ + defaultButtons.formSaveBtn(null), // 保存 + defaultButtons.formCloseBtn(null) // 关闭 + ] + count.value++ + } +} //失去焦点 -const onBlur = async (field, pageApi, item) => { - const dataObj = item ? item.inspectionCharacteristicsBaseVO : data.value - if (dataObj[field + 'Code']) { +const onInspectionSchemeBlur = async (field, pageApi) => { + if (data.value[field]) { const _searchCondition = {} const filters: any[] = [] filters.push( @@ -1482,12 +1570,25 @@ const onBlur = async (field, pageApi, item) => { { column: 'code', action: '==', - value: dataObj[field + 'Code']?.trim() + value: data.value[field]?.trim() + }, + { + column: 'itemCode', + action: '==', + value: data.value.itemCode + }, + { + column: 'inspectionType', + action: '==', + value: data.value.inspectionType } ) // 参数整理 _searchCondition.isSearch = true _searchCondition.filters = filters + _searchCondition.pageNo = 1 + _searchCondition.pageSize = 20 + _searchCondition.by = 'ASC' const array = await pageApi(_searchCondition) Butttondata = [ defaultButtons.formSaveBtn(null), // 保存 @@ -1496,14 +1597,15 @@ const onBlur = async (field, pageApi, item) => { count.value++ const obj = array.list[0] if (obj) { - dataObj[field + 'Name'] = obj.description + searchTableSuccess(field,'code',array.list,'main') } else { message.alert('暂无数据') - dataObj[field + 'Code'] = '' - dataObj[field + 'Name'] = '' + data.value[field] = '' + data.value['inspectionSchemeName'] = '' + data.value.subList =[] } } else { - dataObj[field + 'Name'] = '' + data.value['inspectionSchemeName'] = '' Butttondata = [ defaultButtons.formSaveBtn(null), // 保存 defaultButtons.formCloseBtn(null) // 关闭 @@ -1528,8 +1630,8 @@ const onFocus = () => { color: #1a8bfc; font-size: 16px; } -.tabs-box{ - max-height:calc(80vh - 40px) ; +.tabs-box { + max-height: calc(80vh - 40px); overflow-x: hidden; overflow-y: auto; }