diff --git a/src/views/business/taskMeasure/measureData/components/ninth/templateDetail.vue b/src/views/business/taskMeasure/measureData/components/ninth/templateDetail.vue index 8f41c87..abd4e88 100644 --- a/src/views/business/taskMeasure/measureData/components/ninth/templateDetail.vue +++ b/src/views/business/taskMeasure/measureData/components/ninth/templateDetail.vue @@ -400,14 +400,13 @@ itemFormData.value.appearanceFunctionCheck = Number(res.data.appearanceFunctionCheck)// 外观及功能检查 itemFormData.value.appearanceRemark = res.data.appearanceRemark // 外观及功能检查 - console.log(res, 'res') const params = { id: itemFormData.value.itemId, itemCategoryName: itemFormData.value.itemCategoryName, // 检定项分类名字 belongStandardEquipment: itemFormData.value.belongStandardEquipment, // 检校标准装置字典code } - const response = await getItemInfo(params) - mesureItemData.value = JSON.parse(JSON.stringify(response.data.measureItemDataSpectrumAnalyzerList)) + // const response = await getItemInfo(params) + // mesureItemData.value = JSON.parse(JSON.stringify(response.data.measureItemDataSpectrumAnalyzerList)) initInputData(res.data.measureDataSpectrumAnalyzerList) // =======================================表单公共组件数据处理======================================================= useSolveFormData(res, templateFormAndTableRef.value) @@ -439,6 +438,20 @@ // 初始化输入数据 function initInputData(data: any) { initAllData() + // 处理referencePoint字段 + const handlerReferencePoint = (row: any) => { + if(String(row.referencePoint) === '1') { + return 'contain' + } + else { + if(row.conclusion === '参考点') { + return 'conclusion' + } + else { + return 'none' + } + } + } data.forEach((item: any, index: number) => { switch (item.dataType) { case '1': @@ -455,11 +468,31 @@ break case '4': // 中频带宽转换偏差 - transitionDeviationList.value.push({ ...item, params: '中频带宽转换偏差', conclusion: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : item.conclusion || '', upperConvertDeviation: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.upperConvertDeviation || clearSymbol(item.technicalIndex) || '/'), convertDeviation: Number(mesureItemData.value[index].referencePoint) === 1 ? '/' : (item.convertDeviation === '/' ? '' : item.convertDeviation), lowerConvertDeviation: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.lowerConvertDeviation || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/'), oneValue: removeLetters(item.oneValue || '') || '' }) + transitionDeviationList.value.push({ ...item, params: '中频带宽转换偏差', + // conclusion: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : item.conclusion || '', + conclusion: handlerReferencePoint(item) === 'none' ? item.conclusion || '' : '参考点', + // upperConvertDeviation: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.upperConvertDeviation || clearSymbol(item.technicalIndex) || '/'), + upperConvertDeviation: handlerReferencePoint(item) === 'none' ? (item.upperConvertDeviation || clearSymbol(item.technicalIndex) || '/') : '参考点', + + // convertDeviation: Number(mesureItemData.value[index].referencePoint) === 1 ? '/' : (item.convertDeviation === '/' ? '' : item.convertDeviation), + convertDeviation: handlerReferencePoint(item) === 'none' ? (item.convertDeviation === '/' ? '' : item.convertDeviation) : '', + // lowerConvertDeviation: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.lowerConvertDeviation || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/'), + lowerConvertDeviation: handlerReferencePoint(item) === 'none' ? (item.lowerConvertDeviation || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/') : '参考点', + oneValue: removeLetters(item.oneValue || '') || '' + }) break case '5': // 参考电平 - referenceElectricalLevelList.value.push({ ...item, params: '参考电平', signalSourceAmplitude: Number(item.amplitude) || Number(item.signalSourceAmplitude) || '', standardAttenuatorAttenuation: item.standardAttenuatorAttenuation || '/', upperIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), lowerIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/'), conclusion: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : item.conclusion || '/', oneValue: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.oneValue || '/') }) + referenceElectricalLevelList.value.push({ ...item, params: '参考电平', + signalSourceAmplitude: Number(item.amplitude) || Number(item.signalSourceAmplitude) || '', + standardAttenuatorAttenuation: item.standardAttenuatorAttenuation || '/', + // upperIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), + upperIndex: handlerReferencePoint(item) === 'none' ? (item.upperIndex || clearSymbol(item.technicalIndex) || '/') : '参考点' , + // lowerIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/'), + lowerIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/'), + conclusion: handlerReferencePoint(item) !== 'none' ? '参考点' : item.conclusion || '/', + oneValue: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.oneValue || '/') + }) break case '6': // 垂直刻度 @@ -467,7 +500,10 @@ break case '7': // 输入频响 - inputFrequencyResponseList.value.push({ ...item, params: '输入频响', oneValue: item.oneValue || '', twoValue: item.twoValue || '', threeValue: item.threeValue || '', conclusion: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : item.conclusion || '/', upperIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), lowerIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/') }) + inputFrequencyResponseList.value.push({ ...item, params: '输入频响', oneValue: item.oneValue || '', twoValue: item.twoValue || '', threeValue: item.threeValue || '', + conclusion: handlerReferencePoint(item) !== 'none' ? '参考点' : item.conclusion || '/', + upperIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), + lowerIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/') }) break case '8': // 平均噪声电平 @@ -479,7 +515,11 @@ break case '10': // 输入衰减 - inputAttenuatorList.value.push({ ...item, params: '输入衰减', oneValue: item.oneValue || '', inputAttenuator: Number(item.referencePoint) === 1 ? '参考点' : item.inputAttenuator || '', conclusion: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : item.conclusion || '/', upperIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), lowerIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/') }) + inputAttenuatorList.value.push({ ...item, params: '输入衰减', oneValue: item.oneValue || '', + inputAttenuator: handlerReferencePoint(item) !== 'none' ? '参考点' : item.inputAttenuator || '', + conclusion: handlerReferencePoint(item) !== 'none' ? '参考点' : item.conclusion || '/', + upperIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), + lowerIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/') }) break case '11': // 1dB增益压缩点 @@ -514,9 +554,9 @@ } getItemInfo(params).then((res) => { itemFormData.value.appearanceFunctionCheck = res.data.appearanceFunctionCheck // 外观及功能检查 1有外观,2没有外观 - mesureItemData.value = JSON.parse(JSON.stringify(res.data.measureItemDataSpectrumAnalyzerList)) + // mesureItemData.value = JSON.parse(JSON.stringify(res.data.measureItemDataSpectrumAnalyzerList)) initInputData(res.data.measureItemDataSpectrumAnalyzerList) - console.log(res.data.measureItemDataSpectrumAnalyzerList, 'res.data.measureItemDataSpectrumAnalyzerList') + // console.log(res.data.measureItemDataSpectrumAnalyzerList, 'res.data.measureItemDataSpectrumAnalyzerList') }) } @@ -916,6 +956,9 @@ +