diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue new file mode 100644 index 0000000..263ff3c --- /dev/null +++ b/src/views/equipement/standard/checkData/components/thirteenth/11.vue @@ -0,0 +1,79 @@ + diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue new file mode 100644 index 0000000..263ff3c --- /dev/null +++ b/src/views/equipement/standard/checkData/components/thirteenth/11.vue @@ -0,0 +1,79 @@ + diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index e6eebf6..f34605c 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -3,28 +3,42 @@ import { ref, watch } from 'vue' import { ElLoading, ElMessage } from 'element-plus' import saveCheckRecord from '../../dialog/saveCheckRecord.vue' +import { clearDateValue, handleDetailTableTableHead, handleSaveDateParams, solveHistoryIndicationTableData } from '../useStabilityCaculate' import type { IList } from './thirteenth-interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' +import { useCheckList } from '@/commonMethods/useCheckList' import multiTable from '@/components/MultiHeaderTable/index.vue' -// import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' -// import { addCheckData, calculateHandle, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' +import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' +import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' +const props = defineProps({ + selectStandardId: { // 选择的标准装置id + type: String, + }, + pageType: { // 页面类型 + type: String, + }, + checkDate: { // 核查日期 + type: String, + }, +}) const user = useUserStore() // 用户信息 const $router = useRouter() // 关闭页面使用 const $route = useRoute() // 路由参数 -const pageType = ref('add') // 页面类型: add, edit, detail const infoId = ref('') -const belongStandardEquipment = ref('9') +const belongStandardEquipment = ref('13') const itemCategoryId = ref('') // 核查项分类id const itemCategoryName = ref('') // 核查项分类名称 - +const form = ref({ + remark: '/', // 备注 +}) +const equipmentId = ref('') // 设备id +const dateArrStability = ref([]) // 稳定性日期数组 +const currentDate = ref('') // 要查询历史稳定性的日期 // ----------------------------------路由参数------------------------------------------------ if ($route.params && $route.params.type) { - pageType.value = $route.params.type as string - console.log(pageType.value) - if ($route.params.id) { infoId.value = $route.params.id as string } @@ -42,7 +56,7 @@ text: '测量值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '160', children: [ { text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -57,8 +71,8 @@ { text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) const columns_repeatability_voltage_flatness = ref([ // 重复性表头--稳幅正弦信号电压平坦度 { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, @@ -70,7 +84,7 @@ text: 'X1', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -82,7 +96,7 @@ text: 'X2', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -94,7 +108,7 @@ text: 'X3', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -106,7 +120,7 @@ text: 'X4', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -118,7 +132,7 @@ text: 'X5', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -130,7 +144,7 @@ text: 'X6', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -142,7 +156,7 @@ text: 'X7', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -154,7 +168,7 @@ text: 'X8', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -166,7 +180,7 @@ text: 'X9', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -178,7 +192,7 @@ text: 'X10', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -186,8 +200,8 @@ { text: '平坦度/%', value: 'flatnessTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) const columns_repeatability_risetime = ref([ // 重复性表头--上升时间 @@ -206,7 +220,7 @@ text: '核查点均值', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -217,10 +231,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_timeMark_checkDate = ref([ // 稳定性表头--时标 + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: '-', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 方波电压(50Ω)--稳定性 const columns_stability_squareWaveVoltage50Ω = ref([ @@ -230,7 +267,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -241,10 +278,34 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +// 方波电压(50Ω)--稳定性 +const columns_stability_squareWaveVoltage50Ω_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 方波电压(1MΩ)--稳定性 const columns_stability_squareWaveVoltage1MΩ = ref([ @@ -254,7 +315,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -265,10 +326,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_squareWaveVoltage1MΩ_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 直流电压(50Ω)--稳定性 const columns_stability_directVoltage50Ω = ref([ @@ -278,7 +362,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -289,10 +373,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_directVoltage50Ω_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 直流电压(1MΩ)--稳定性 const columns_stability_directVoltage1MΩ = ref([ @@ -302,7 +409,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -313,10 +420,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_directVoltage1MΩ_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 输入阻抗--稳定性 const columns_stability_inputImpedance = ref([ @@ -326,7 +456,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -337,10 +467,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_inputImpedance_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 稳幅正弦信号电压平坦度--稳定性 const columns_stability_voltage_flatness = ref([ // 稳定性表头--稳幅正弦信号电压平坦度 @@ -351,7 +504,7 @@ text: '核查点均值', value: '-', align: 'center', - required: true, + required: false, width: '160', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -362,21 +515,45 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_voltage_flatness_checkDate = ref([ // 稳定性表头--稳幅正弦信号电压平坦度 + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '类型', value: 'typeValue', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: '-', + align: 'center', + required: false, + width: '160', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 上升时间--稳定性 const columns_stability_risetime = ref([ // 稳定性表头--上升时间 - { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '快沿', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, - { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: true, type: 'text' }, - { text: '探头设备名称', value: 'equipmentName', align: 'center', required: true, type: 'text' }, - { text: '探头规格型号', value: 'model', align: 'center', required: true, type: 'text' }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true, type: 'text' }, - { text: '技术指标', value: 'technicalIndexDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '核查项目', value: 'params', align: 'center', required: false, type: 'text' }, + { text: '快沿', value: 'checkPointDefineFront', align: 'center', required: false, type: 'text' }, + { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false, type: 'text' }, + { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false, type: 'text' }, + { text: '探头规格型号', value: 'model', align: 'center', required: false, type: 'text' }, + { text: '测量值', value: 'testValueOne', align: 'center', required: false, type: 'text' }, + { text: '技术指标', value: 'technicalIndexDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) const listTimeMarkRepeatability = ref([]) // 时标-重复性 @@ -388,32 +565,49 @@ const listVoltageFlatnessRepeatability = ref([]) // 稳幅正弦信号电压平坦度-重复性 const listRisetimeRepeatability = ref([]) // 上升时间-重复性 -const listTimeMarkRepeatabilityLoading = ref([]) // 时标-重复性Loading -const listSquareWaveVoltage50ΩRepeatabilityLoading = ref([]) // 方波电压(50Ω)-重复性Loading -const listSquareWaveVoltage1MΩRepeatabilityLoading = ref([]) // 方波电压(1MΩ)-重复性Loading -const listDirectVoltage50ΩRepeatabilityLoading = ref([]) // 直流电压(50Ω)-重复性Loading -const listDirectVoltage1MΩRepeatabilityLoading = ref([]) // 直流电压(1MΩ)-重复性Loading -const listInputImpedanceRepeatabilityLoading = ref([]) // 输入阻抗-重复性Loading -const listVoltageFlatnessRepeatabilityLoading = ref([]) // 稳幅正弦信号电压平坦度-重复性Loading -const listRisetimeRepeatabilityLoading = ref([]) // 上升时间-重复性Loading +const listTimeMarkRepeatabilityLoading = ref(false) // 时标-重复性Loading +const listSquareWaveVoltage50ΩRepeatabilityLoading = ref(false) // 方波电压(50Ω)-重复性Loading +const listSquareWaveVoltage1MΩRepeatabilityLoading = ref(false) // 方波电压(1MΩ)-重复性Loading +const listDirectVoltage50ΩRepeatabilityLoading = ref(false) // 直流电压(50Ω)-重复性Loading +const listDirectVoltage1MΩRepeatabilityLoading = ref(false) // 直流电压(1MΩ)-重复性Loading +const listInputImpedanceRepeatabilityLoading = ref(false) // 输入阻抗-重复性Loading +const listVoltageFlatnessRepeatabilityLoading = ref(false) // 稳幅正弦信号电压平坦度-重复性Loading +const listRisetimeRepeatabilityLoading = ref(false) // 上升时间-重复性Loading -const listTimeMarkStability = ref([]) // 时标-稳定性 -const listSquareWaveVoltage50ΩStability = ref([]) // 方波电压(50Ω)-稳定性 -const listSquareWaveVoltage1MΩStability = ref([]) // 方波电压(1MΩ)-稳定性 -const listDirectVoltage50ΩStability = ref([]) // 直流电压(50Ω)-稳定性 -const listDirectVoltage1MΩStability = ref([]) // 直流电压(1MΩ)-稳定性 -const listInputImpedanceStability = ref([]) // 输入阻抗-稳定性 -const listVoltageFlatnessStability = ref([]) // 稳幅正弦信号电压平坦度-稳定性 -const listRisetimeStability = ref([]) // 上升时间-稳定性 +const listTimeMarkStability = ref([]) // 时标-稳定性 +const listSquareWaveVoltage50ΩStability = ref([]) // 方波电压(50Ω)-稳定性 +const listSquareWaveVoltage1MΩStability = ref([]) // 方波电压(1MΩ)-稳定性 +const listDirectVoltage50ΩStability = ref([]) // 直流电压(50Ω)-稳定性 +const listDirectVoltage1MΩStability = ref([]) // 直流电压(1MΩ)-稳定性 +const listInputImpedanceStability = ref([]) // 输入阻抗-稳定性 +const listVoltageFlatnessStability = ref([]) // 稳幅正弦信号电压平坦度-稳定性 +const listRisetimeStability = ref([]) // 上升时间-稳定性 -const listTimeMarkStabilityLoading = ref([]) // 时标-稳定性Loading -const listSquareWaveVoltage50ΩStabilityLoading = ref([]) // 方波电压(50Ω)-稳定性Loading -const listSquareWaveVoltage1MΩStabilityLoading = ref([]) // 方波电压(1MΩ)-稳定性Loading -const listDirectVoltage50ΩStabilityLoading = ref([]) // 直流电压(50Ω)-稳定性Loading -const listDirectVoltage1MΩStabilityLoading = ref([]) // 直流电压(1MΩ)-稳定性Loading -const listInputImpedanceStabilityLoading = ref([]) // 输入阻抗-稳定性Loading -const listVoltageFlatnessStabilityLoading = ref([]) // 稳幅正弦信号电压平坦度-稳定性Loading -const listRisetimeStabilityLoading = ref([]) // 上升时间-稳定性Loading +const listTimeMarkStabilityLoading = ref(false) // 时标-稳定性Loading +const listSquareWaveVoltage50ΩStabilityLoading = ref(false) // 方波电压(50Ω)-稳定性Loading +const listSquareWaveVoltage1MΩStabilityLoading = ref(false) // 方波电压(1MΩ)-稳定性Loading +const listDirectVoltage50ΩStabilityLoading = ref(false) // 直流电压(50Ω)-稳定性Loading +const listDirectVoltage1MΩStabilityLoading = ref(false) // 直流电压(1MΩ)-稳定性Loading +const listInputImpedanceStabilityLoading = ref(false) // 输入阻抗-稳定性Loading +const listVoltageFlatnessStabilityLoading = ref(false) // 稳幅正弦信号电压平坦度-稳定性Loading +const listRisetimeStabilityLoading = ref(false) // 上升时间-稳定性Loading + +const listTimeMarkRepeatabilityCheckDate = ref([]) // 时标-重复性 +const listSquareWaveVoltage50ΩRepeatabilityCheckDate = ref([]) // 方波电压(50Ω)-重复性 +const listSquareWaveVoltage1MΩRepeatabilityCheckDate = ref([]) // 方波电压(1MΩ)-重复性 +const listDirectVoltage50ΩRepeatabilityCheckDate = ref([]) // 直流电压(50Ω)-重复性 +const listDirectVoltage1MΩRepeatabilityCheckDate = ref([]) // 直流电压(1MΩ)-重复性 +const listInputImpedanceRepeatabilityCheckDate = ref([]) // 输入阻抗-重复性 +const listVoltageFlatnessRepeatabilityCheckDate = ref([]) // 稳幅正弦信号电压平坦度-重复性 +const listRisetimeRepeatabilityCheckDate = ref([]) // 上升时间-重复性 +const listTimeMarkStabilityCheckDate = ref([]) // 时标-稳定性 +const listSquareWaveVoltage50ΩStabilityCheckDate = ref([]) // 方波电压(50Ω)-稳定性 +const listSquareWaveVoltage1MΩStabilityCheckDate = ref([]) // 方波电压(1MΩ)-稳定性 +const listDirectVoltage50ΩStabilityCheckDate = ref([]) // 直流电压(50Ω)-稳定性 +const listDirectVoltage1MΩStabilityCheckDate = ref([]) // 直流电压(1MΩ)-稳定性 +const listInputImpedanceStabilityCheckDate = ref([]) // 输入阻抗-稳定性 +const listVoltageFlatnessStabilityCheckDate = ref([]) // 稳幅正弦信号电压平坦度-稳定性 +const listRisetimeStabilityCheckDate = ref([]) // 上升时间-稳定性 // 获取配置详情 function fetchCheckItemDetail(equipmentId: string, belongStandardEquipmentParam: string, itemCategoryIdParam: string, itemCategoryNameParam: string) { @@ -432,19 +626,20 @@ } getCheckItemDetail(params).then((res) => { loading.close() - handleData(res.data.checkItemDataResistanceThermometerList) - fetchHistoryIndication() // 获取稳定性 + handleData(res.data.checkItemDataOscilloscopeList) + // fetchHistoryIndication() // 获取稳定性 + fetchHistoryIndication('时标') // 重新拉取稳定性 + fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性 + fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性 + fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性 + fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性 + fetchHistoryIndication('输入阻抗') // 重新拉取稳定性 + fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性 }) } // 初始化数据(查询配置检定项) function handleData(list: any, type = 'edit') { - const listSquareWaveVoltage1MΩRepeatability = ref([]) // 方波电压(1MΩ)-重复性 - const listDirectVoltage50ΩRepeatability = ref([]) // 直流电压(50Ω)-重复性 - const listDirectVoltage1MΩRepeatability = ref([]) // 直流电压(1MΩ)-重复性 - const listInputImpedanceRepeatability = ref([]) // 输入阻抗-重复性 - const listVoltageFlatnessRepeatability = ref([]) // 稳幅正弦信号电压平坦度-重复性 - const listRisetimeRepeatability = ref([]) // 上升时间-重复性 // 时标 listTimeMarkRepeatability.value = list.filter((item: { params: string }) => item.params === '时标') // 时标重复性 @@ -463,10 +658,21 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } - }) + }) as any // 时标稳定性 - listTimeMarkStability.value = listTimeMarkRepeatability.value.map((e) => { + listTimeMarkStability.value = listTimeMarkRepeatability.value.map((e: any) => { return { editable: props.pageType !== 'detail', dataId: e.dataId, // 核查数据管理基础信息表id @@ -507,7 +713,7 @@ } }) // 方波电压(50Ω)稳定性 - listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩRepeatability.value.map((e) => { + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩRepeatability.value.map((e: any) => { return { editable: props.pageType !== 'detail', dataId: e.dataId, // 核查数据管理基础信息表id @@ -547,7 +753,7 @@ } }) // 方波电压(1MΩ)稳定性 - listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩRepeatability.value.map((e) => { + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩRepeatability.value.map((e: any) => { return { editable: props.pageType !== 'detail', dataId: e.dataId, // 核查数据管理基础信息表id @@ -565,40 +771,1081 @@ conclusion: '', // 结论 } }) + + // 直流电压(50Ω) + listDirectVoltage50ΩRepeatability.value = list.filter((item: { params: string }) => item.params === '直流电压(50Ω)') + // 直流电压(50Ω)重复性 + listDirectVoltage50ΩRepeatability.value = listDirectVoltage50ΩRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + } + }) + // 直流电压(50Ω)稳定性 + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 直流电压(1MΩ) + listDirectVoltage1MΩRepeatability.value = list.filter((item: { params: string }) => item.params === '直流电压(1MΩ)') + // 直流电压(1MΩ)重复性 + listDirectVoltage1MΩRepeatability.value = listDirectVoltage1MΩRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + } + }) + // 直流电压(1MΩ)稳定性 + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 输入阻抗 + listInputImpedanceRepeatability.value = list.filter((item: { params: string }) => item.params === '输入阻抗') + // 输入阻抗重复性 + listInputImpedanceRepeatability.value = listInputImpedanceRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + } + }) + // 输入阻抗稳定性 + listInputImpedanceStability.value = listInputImpedanceRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 稳幅正弦信号电压平坦度 + listVoltageFlatnessRepeatability.value = list.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') + // 稳幅正弦信号电压平坦度重复性 + listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + typeValue: e.typeValue, // 类型 + testValueUnit: 'mW', // 测量值单位 + convertVoltageUnit: 'V', // 转换为电压值单位 + checkPoint: e.checkPoint, // 核查点 + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + flatnessOne: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度1/% + flatnessTwo: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度2/% + flatnessThree: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度3/% + flatnessFour: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度4/% + flatnessFive: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度5/% + flatnessSix: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度6/% + flatnessSeven: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度7/% + flatnessEight: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度8/% + flatnessNine: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度9/% + flatnessTen: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度10/% + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + } + }) + // 稳幅正弦信号电压平坦度稳定性 + listVoltageFlatnessStability.value = listVoltageFlatnessRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, // 核查点 + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 上升时间 + listRisetimeRepeatability.value = list.filter((item: { params: string }) => item.params === '上升时间') + // 上升时间重复性 + listRisetimeRepeatability.value = listRisetimeRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + typeValue: e.typeValue, // 类型 + checkPoint: e.checkPoint, // 快沿 + unit: e.unit, // 快沿单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 快沿 + manufactureNo: e.manufactureNo, // 探头出厂编号 + equipmentName: e.equipmentName, // 探头设备名称 + model: e.model, // 探头规格型号 + testValueOne: '', // 测量值 + technicalIndex: e.technicalIndex, // 技术指标 + technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 + technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 + } + }) + // 上升时间稳定性 + listRisetimeStability.value = listRisetimeRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, // 快沿 + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 快沿 + checkType: '稳定性', + manufactureNo: e.manufactureNo, // 探头出厂编号 + equipmentName: e.equipmentName, // 探头设备名称 + model: e.model, // 探头规格型号 + testValueOne: '', // 测量值 + technicalIndex: e.technicalIndex, // 技术指标 + technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 + technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 + conclusion: '', // 结论 + } + }) } -// 点击生成结果处理 -const createResult = () => { - // +// 点击计算结果 +const createResult = (type: string) => { + let checkDataOscilloscopeListParams: any // 要传的重复或者稳定性参数 + if (current.value === 'stability') { // 计算稳定性 + switch (type) { + case '时标': + if (!listTimeMarkRepeatability.value.length) { + ElMessage.warning('时标 未配置重复性,请检查') + return false + } + if (`${listTimeMarkRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listTimeMarkStability.value + break + case '方波电压(50Ω)': + if (!listSquareWaveVoltage50ΩRepeatability.value.length) { + ElMessage.warning('方波电压(50Ω) 未配置重复性,请检查') + return false + } + if (`${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩStability.value + break + case '方波电压(1MΩ)': + if (!listSquareWaveVoltage1MΩRepeatability.value.length) { + ElMessage.warning('方波电压(1MΩ) 未配置重复性,请检查') + return false + } + if (`${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩStability.value + break + case '直流电压(50Ω)': + if (!listDirectVoltage50ΩRepeatability.value.length) { + ElMessage.warning('直流电压(50Ω) 未配置重复性,请检查') + return false + } + if (`${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listDirectVoltage50ΩStability.value + break + case '直流电压(1MΩ)': + if (!listDirectVoltage1MΩRepeatability.value.length) { + ElMessage.warning('直流电压(1MΩ) 未配置重复性,请检查') + return false + } + if (`${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listDirectVoltage1MΩStability.value + break + case '输入阻抗': + if (!listInputImpedanceRepeatability.value.length) { + ElMessage.warning('输入阻抗 未配置重复性,请检查') + return false + } + if (`${listInputImpedanceRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listInputImpedanceStability.value + break + case '稳幅正弦信号电压平坦度': + if (!listVoltageFlatnessRepeatability.value.length) { + ElMessage.warning('稳幅正弦信号电压平坦度 未配置重复性,请检查') + return false + } + if (`${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listVoltageFlatnessStability.value + break + case '上升时间': + if (!listRisetimeRepeatability.value.length) { + ElMessage.warning('上升时间 未配置重复性,请检查') + return false + } + if (`${listRisetimeRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listRisetimeStability.value + break + default: + break + } + } + + if (current.value === 'repeatability') { + switch (type) { + case '时标': + if (!useCheckList(listTimeMarkRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listTimeMarkRepeatability.value + break + case '方波电压(50Ω)': + if (!useCheckList(listSquareWaveVoltage50ΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩRepeatability.value + break + case '方波电压(1MΩ)': + if (!useCheckList(listSquareWaveVoltage1MΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩRepeatability.value + break + case '直流电压(50Ω)': + if (!useCheckList(listDirectVoltage50ΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listDirectVoltage50ΩRepeatability.value + break + case '直流电压(1MΩ)': + if (!useCheckList(listDirectVoltage1MΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listDirectVoltage1MΩRepeatability.value + break + case '输入阻抗': + if (!useCheckList(listInputImpedanceRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listInputImpedanceRepeatability.value + break + case '稳幅正弦信号电压平坦度': + if (!useCheckList(listVoltageFlatnessRepeatability.value, columns_repeatability_voltage_flatness.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listVoltageFlatnessRepeatability.value + break + case '上升时间': + if (!useCheckList(listRisetimeRepeatability.value, columns_repeatability_risetime.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listRisetimeRepeatability.value + break + default: + break + } + } + + const params = { + belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 + checkDataOscilloscopeList: checkDataOscilloscopeListParams, + itemCategoryId: itemCategoryId.value, // 核查项分类id + itemCategoryName: itemCategoryName.value, // 核查项分类id + } + // 重复性Loading + listTimeMarkRepeatabilityLoading.value = type === '时标' && current.value === 'repeatability' + listSquareWaveVoltage50ΩRepeatabilityLoading.value = type === '方波电压(50Ω)' && current.value === 'repeatability' + listSquareWaveVoltage1MΩRepeatabilityLoading.value = type === '方波电压(1MΩ)' && current.value === 'repeatability' + listDirectVoltage50ΩRepeatabilityLoading.value = type === '直流电压(50Ω)' && current.value === 'repeatability' + listDirectVoltage1MΩRepeatabilityLoading.value = type === '直流电压(1MΩ)' && current.value === 'repeatability' + listInputImpedanceRepeatabilityLoading.value = type === '输入阻抗' && current.value === 'repeatability' + listVoltageFlatnessRepeatabilityLoading.value = type === '稳幅正弦信号电压平坦度' && current.value === 'repeatability' + listRisetimeRepeatabilityLoading.value = type === '上升时间' && current.value === 'repeatability' + // 稳定性loading + listTimeMarkStabilityLoading.value = type === '时标' && current.value === 'stability' + listSquareWaveVoltage50ΩStabilityLoading.value = type === '方波电压(50Ω)' && current.value === 'stability' + listSquareWaveVoltage1MΩStabilityLoading.value = type === '方波电压(1MΩ)' && current.value === 'stability' + listDirectVoltage50ΩStabilityLoading.value = type === '直流电压(50Ω)' && current.value === 'stability' + listDirectVoltage1MΩStabilityLoading.value = type === '直流电压(1MΩ)' && current.value === 'stability' + listInputImpedanceStabilityLoading.value = type === '输入阻抗' && current.value === 'stability' + listVoltageFlatnessStabilityLoading.value = type === '稳幅正弦信号电压平坦度' && current.value === 'stability' + listRisetimeStabilityLoading.value = type === '上升时间' && current.value === 'stability' + + calculateHandle(params).then((res) => { + const result = res.data.filter((item: { params: string }) => item.params === type).map((item: any) => { + return { + ...item, + checkPointDefineFront: item.checkPoint + item.unit, // 核查点 + editable: props.pageType !== 'detail', + } + }) + switch (type) { + case '时标': + if (current.value === 'repeatability') { // 重复性 + listTimeMarkRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listTimeMarkStability.value = listTimeMarkStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listTimeMarkRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listTimeMarkStability.value = result + } + break + case '方波电压(50Ω)': + if (current.value === 'repeatability') { // 重复性 + listSquareWaveVoltage50ΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listSquareWaveVoltage50ΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listSquareWaveVoltage50ΩStability.value = result + } + break + case '方波电压(1MΩ)': + if (current.value === 'repeatability') { // 重复性 + listSquareWaveVoltage1MΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listSquareWaveVoltage1MΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listSquareWaveVoltage1MΩStability.value = result + } + break + case '直流电压(50Ω)': + if (current.value === 'repeatability') { // 重复性 + listDirectVoltage50ΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listDirectVoltage50ΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listDirectVoltage50ΩStability.value = result + } + break + case '直流电压(1MΩ)': + if (current.value === 'repeatability') { // 重复性 + listDirectVoltage1MΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listDirectVoltage1MΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listDirectVoltage1MΩStability.value = result + } + break + case '输入阻抗': + if (current.value === 'repeatability') { // 重复性 + listInputImpedanceRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listInputImpedanceStability.value = listInputImpedanceStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listInputImpedanceRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listInputImpedanceStability.value = result + } + break + case '稳幅正弦信号电压平坦度': + if (current.value === 'repeatability') { // 重复性 + listVoltageFlatnessRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listVoltageFlatnessStability.value = listVoltageFlatnessStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listVoltageFlatnessRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listVoltageFlatnessStability.value = result + } + break + case '上升时间': + if (current.value === 'repeatability') { // 重复性 + listRisetimeRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listRisetimeStability.value = listRisetimeStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listRisetimeRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listRisetimeStability.value = result + } + break + default: + break + } + + listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading + listSquareWaveVoltage50ΩRepeatabilityLoading.value = false // 方波电压(50Ω)-重复性Loading + listSquareWaveVoltage1MΩRepeatabilityLoading.value = false // 方波电压(1MΩ)-重复性Loading + listDirectVoltage50ΩRepeatabilityLoading.value = false // 直流电压(50Ω)-重复性Loading + listDirectVoltage1MΩRepeatabilityLoading.value = false // 直流电压(1MΩ)-重复性Loading + listInputImpedanceRepeatabilityLoading.value = false // 输入阻抗-重复性Loading + listVoltageFlatnessRepeatabilityLoading.value = false // 稳幅正弦信号电压平坦度-重复性Loading + listRisetimeRepeatabilityLoading.value = false // 上升时间-重复性Loading + + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }).catch(() => { + listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading + listSquareWaveVoltage50ΩRepeatabilityLoading.value = false // 方波电压(50Ω)-重复性Loading + listSquareWaveVoltage1MΩRepeatabilityLoading.value = false // 方波电压(1MΩ)-重复性Loading + listDirectVoltage50ΩRepeatabilityLoading.value = false // 直流电压(50Ω)-重复性Loading + listDirectVoltage1MΩRepeatabilityLoading.value = false // 直流电压(1MΩ)-重复性Loading + listInputImpedanceRepeatabilityLoading.value = false // 输入阻抗-重复性Loading + listVoltageFlatnessRepeatabilityLoading.value = false // 稳幅正弦信号电压平坦度-重复性Loading + listRisetimeRepeatabilityLoading.value = false // 上升时间-重复性Loading + + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }) } // ------------------------------------------------------------------------------------------ +// 处理详情数据 +const solveGetDetailData = (responseList: any) => { + console.log('处理详情数据', props.pageType) + const list = responseList.map((item: { editable: boolean }) => { + return { + ...item, + editable: props.pageType !== 'detail', + } + }) + + const listTimeMarkRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '时标') // 时标-重复性 + const listSquareWaveVoltage50ΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '方波电压(50Ω)') // 方波电压(50Ω)-重复性 + const listSquareWaveVoltage1MΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '方波电压(1MΩ)') // 方波电压(1MΩ)-重复性 + const listDirectVoltage50ΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '直流电压(50Ω)') // 直流电压(50Ω)-重复性 + const listDirectVoltage1MΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '直流电压(1MΩ)') // 直流电压(1MΩ)-重复性 + const listInputImpedanceRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '输入阻抗') // 输入阻抗-重复性 + const listVoltageFlatnessRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '稳幅正弦信号电压平坦度') // 稳幅正弦信号电压平坦度-重复性 + const listRisetimeRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '上升时间') // 上升时间-重复性 + + const listTimeMarkStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '时标') // 时标-稳定性 + const listSquareWaveVoltage50ΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '方波电压(50Ω)') // 方波电压(50Ω)-稳定性 + const listSquareWaveVoltage1MΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '方波电压(1MΩ)') // 方波电压(1MΩ)-稳定性 + const listDirectVoltage50ΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '直流电压(50Ω)') // 直流电压(50Ω)-稳定性 + const listDirectVoltage1MΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '直流电压(1MΩ)') // 直流电压(1MΩ)-稳定性 + const listInputImpedanceStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '输入阻抗') // 输入阻抗-稳定性 + const listVoltageFlatnessStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '稳幅正弦信号电压平坦度') // 稳幅正弦信号电压平坦度-稳定性 + const listRisetimeStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '上升时间') // 上升时间-稳定性 + + return { + templistTimeMarkRepeatability: listTimeMarkRepeatability, + templistSquareWaveVoltage50ΩRepeatability: listSquareWaveVoltage50ΩRepeatability, + templistSquareWaveVoltage1MΩRepeatability: listSquareWaveVoltage1MΩRepeatability, + templistDirectVoltage50ΩRepeatability: listDirectVoltage50ΩRepeatability, + templistDirectVoltage1MΩRepeatability: listDirectVoltage1MΩRepeatability, + templistInputImpedanceRepeatability: listInputImpedanceRepeatability, + templistVoltageFlatnessRepeatability: listVoltageFlatnessRepeatability, + templistRisetimeRepeatability: listRisetimeRepeatability, + + templistTimeMarkStability: listTimeMarkStability, + templistSquareWaveVoltage50ΩStability: listSquareWaveVoltage50ΩStability, + templistSquareWaveVoltage1MΩStability: listSquareWaveVoltage1MΩStability, + templistDirectVoltage50ΩStability: listDirectVoltage50ΩStability, + templistDirectVoltage1MΩStability: listDirectVoltage1MΩStability, + templistInputImpedanceStability: listInputImpedanceStability, + templistVoltageFlatnessStability: listVoltageFlatnessStability, + templistRisetimeStability: listRisetimeStability, + } +} // 获取详情 -function fetchInfo() { - // const loading = ElLoading.service({ - // lock: true, - // background: 'rgba(255, 255, 255, 0.8)', - // }) - // getInfo({ id: infoId.value }).then((res) => { - // form.value = { ...res.data } - // list.value = res.data.checkDataPistonGaugeList.map((item: any) => { - // return { - // ...item, - // editable: pageType.value !== 'detail', - // } - // }) - // loading.close() - // }) +function fetchInfo(id = '') { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + getInfo({ id: id || infoId.value }).then((res) => { + form.value = { ...res.data } + equipmentId.value = res.data.equipmentId + const { + templistTimeMarkRepeatability, + templistSquareWaveVoltage50ΩRepeatability, + templistSquareWaveVoltage1MΩRepeatability, + templistDirectVoltage50ΩRepeatability, + templistDirectVoltage1MΩRepeatability, + templistInputImpedanceRepeatability, + templistVoltageFlatnessRepeatability, + templistRisetimeRepeatability, + + templistTimeMarkStability, + templistSquareWaveVoltage50ΩStability, + templistSquareWaveVoltage1MΩStability, + templistDirectVoltage50ΩStability, + templistDirectVoltage1MΩStability, + templistInputImpedanceStability, + templistVoltageFlatnessStability, + templistRisetimeStability, + } = solveGetDetailData(res.data.checkDataOscilloscopeList) + if (id !== '') { // 查询的日期获得的数据 + listTimeMarkRepeatabilityCheckDate.value = templistTimeMarkRepeatability + listSquareWaveVoltage50ΩRepeatabilityCheckDate.value = templistSquareWaveVoltage50ΩRepeatability + listSquareWaveVoltage1MΩRepeatabilityCheckDate.value = templistSquareWaveVoltage1MΩRepeatability + listDirectVoltage50ΩRepeatabilityCheckDate.value = templistDirectVoltage50ΩRepeatability + listDirectVoltage1MΩRepeatabilityCheckDate.value = templistDirectVoltage1MΩRepeatability + listInputImpedanceRepeatabilityCheckDate.value = templistInputImpedanceRepeatability + listVoltageFlatnessRepeatabilityCheckDate.value = templistVoltageFlatnessRepeatability + listRisetimeRepeatabilityCheckDate.value = templistRisetimeRepeatability + + listTimeMarkStabilityCheckDate.value = templistTimeMarkStability + listSquareWaveVoltage50ΩStabilityCheckDate.value = templistSquareWaveVoltage50ΩStability + listSquareWaveVoltage1MΩStabilityCheckDate.value = templistSquareWaveVoltage1MΩStability + listDirectVoltage50ΩStabilityCheckDate.value = templistDirectVoltage50ΩStability + listDirectVoltage1MΩStabilityCheckDate.value = templistDirectVoltage1MΩStability + listInputImpedanceStabilityCheckDate.value = templistInputImpedanceStability + listVoltageFlatnessStabilityCheckDate.value = templistVoltageFlatnessStability + listRisetimeStabilityCheckDate.value = templistRisetimeStability + } + else { + listTimeMarkRepeatability.value = templistTimeMarkRepeatability + listSquareWaveVoltage50ΩRepeatability.value = templistSquareWaveVoltage50ΩRepeatability + listSquareWaveVoltage1MΩRepeatability.value = templistSquareWaveVoltage1MΩRepeatability + listDirectVoltage50ΩRepeatability.value = templistDirectVoltage50ΩRepeatability + listDirectVoltage1MΩRepeatability.value = templistDirectVoltage1MΩRepeatability + listInputImpedanceRepeatability.value = templistInputImpedanceRepeatability + listVoltageFlatnessRepeatability.value = templistVoltageFlatnessRepeatability + listRisetimeRepeatability.value = templistRisetimeRepeatability + + listTimeMarkStability.value = templistTimeMarkStability + listSquareWaveVoltage50ΩStability.value = templistSquareWaveVoltage50ΩStability + listSquareWaveVoltage1MΩStability.value = templistSquareWaveVoltage1MΩStability + listDirectVoltage50ΩStability.value = templistDirectVoltage50ΩStability + listDirectVoltage1MΩStability.value = templistDirectVoltage1MΩStability + listInputImpedanceStability.value = templistInputImpedanceStability + listVoltageFlatnessStability.value = templistVoltageFlatnessStability + listRisetimeStability.value = templistRisetimeStability + } + + nextTick(() => { + if (id !== '') { // 稳定性表头---查询历史的稳定性日期数据 + const tempColumn = [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ] as any + columns_stability_timeMark.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_directVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_directVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_inputImpedance.value[2].children = [...tempColumn] + columns_stability_voltage_flatness.value[3].children = [...tempColumn] + + fetchHistoryIndication(currentDate.value) // 获取稳定性 + } + else { // 正常核查数据处理表头 + columns_stability_timeMark.value = handleDetailTableTableHead(columns_stability_timeMark.value, listTimeMarkRepeatability.value, 2) + columns_stability_squareWaveVoltage50Ω.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩRepeatability.value, 2) + columns_stability_squareWaveVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩRepeatability.value, 2) + columns_stability_directVoltage50Ω.value = handleDetailTableTableHead(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩRepeatability.value, 2) + columns_stability_directVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩRepeatability.value, 2) + columns_stability_inputImpedance.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listInputImpedanceRepeatability.value, 2) + columns_stability_voltage_flatness.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listVoltageFlatnessRepeatability.value, 3) + } + }) + + if (props.pageType === 'edit') { + fetchHistoryIndication('时标') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 + fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + } + loading.close() + }) +} + +/** + * 获取稳定性示值 + * @param date 查询日期 + */ +function fetchHistoryIndication(type: string, date = '') { + const params = { + belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) + checkDate: date || props.checkDate!, // 核查日期 + checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) + conclusion: '是', // 结论 + equipmentId: equipmentId.value, // 被核查设备id + params: type, // 核查项目 + stabilityExamine: '1', // 是否用于稳定性考核(1/0) + standardEquipmentId: props.selectStandardId!, // 被核查标准装置id + } + if (props.selectStandardId && equipmentId.value) { + switch (type) { + case '时标': + listTimeMarkStabilityLoading.value = true + break + case '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityLoading.value = true + break + case '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStabilityLoading.value = true + break + case '直流电压(50Ω)': + listDirectVoltage50ΩStabilityLoading.value = true + break + case '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityLoading.value = true + break + case '输入阻抗': + listInputImpedanceStabilityLoading.value = true + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityLoading.value = true + break + case '上升时间': + listRisetimeStabilityLoading.value = true + break + default: + break + } + getHistoryIndication(params).then((res) => { + if (date === '') { // 正常核查数据 + const num = props.pageType === 'edit' ? 5 : 4 + switch (type) { + case '时标': + listTimeMarkRepeatability.value = listTimeMarkRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_timeMark.value, num, 2) + columns_stability_timeMark.value = columnsData + return item = itemData + }) + listTimeMarkRepeatability.value = handleSaveDateParams(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + break + case '方波电压(50Ω)': + listSquareWaveVoltage50ΩRepeatability.value = listSquareWaveVoltage50ΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_squareWaveVoltage50Ω.value, num, 2) + columns_stability_squareWaveVoltage50Ω.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩRepeatability.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + break + case '方波电压(1MΩ)': + listSquareWaveVoltage1MΩRepeatability.value = listSquareWaveVoltage1MΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_squareWaveVoltage1MΩ.value, num, 2) + columns_stability_squareWaveVoltage1MΩ.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩRepeatability.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + break + case '直流电压(50Ω)': + listDirectVoltage50ΩRepeatability.value = listDirectVoltage50ΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage50Ω.value, num, 2) + columns_stability_directVoltage50Ω.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩRepeatability.value = handleSaveDateParams(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + break + case '直流电压(1MΩ)': + listDirectVoltage1MΩRepeatability.value = listDirectVoltage1MΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage1MΩ.value, num, 2) + columns_stability_directVoltage1MΩ.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩRepeatability.value = handleSaveDateParams(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + break + case '输入阻抗': + listInputImpedanceRepeatability.value = listInputImpedanceRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_inputImpedance.value, num, 2) + columns_stability_inputImpedance.value = columnsData + return item = itemData + }) + listInputImpedanceRepeatability.value = handleSaveDateParams(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_voltage_flatness.value, num, 3) + columns_stability_voltage_flatness.value = columnsData + return item = itemData + }) + listVoltageFlatnessRepeatability.value = handleSaveDateParams(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) + break + default: + break + } + } + else { + const num = props.pageType === 'edit' ? 5 : 4 + switch (type) { + case '时标': + listTimeMarkStabilityCheckDate.value = listTimeMarkStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_timeMark_checkDate.value, 5, 2) + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listTimeMarkStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listTimeMarkStabilityCheckDate.value, 2) + break + case '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityCheckDate.value = listSquareWaveVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_timeMark_checkDate.value, 5, 2) + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listSquareWaveVoltage50ΩStabilityCheckDate.value, 2) + break + case '方波电压(1MΩ)': + listSquareWaveVoltage1MΩRepeatabilityCheckDate.value = listSquareWaveVoltage1MΩRepeatabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_squareWaveVoltage1MΩ_checkDate.value, 5, 2) + columns_stability_squareWaveVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩRepeatabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ_checkDate.value, listSquareWaveVoltage1MΩRepeatabilityCheckDate.value, 2) + break + case '直流电压(50Ω)': + listDirectVoltage50ΩStabilityCheckDate.value = listDirectVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage50Ω_checkDate.value, 5, 2) + columns_stability_directVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage50Ω_checkDate.value, listDirectVoltage50ΩStabilityCheckDate.value, 2) + break + case '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityCheckDate.value = listDirectVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage1MΩ_checkDate.value, 5, 2) + columns_stability_directVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage1MΩ_checkDate.value, listDirectVoltage1MΩStabilityCheckDate.value, 2) + break + case '输入阻抗': + listInputImpedanceStabilityCheckDate.value = listInputImpedanceStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_inputImpedance_checkDate.value, 5, 2) + columns_stability_inputImpedance_checkDate.value = columnsData + return item = itemData + }) + listInputImpedanceStabilityCheckDate.value = handleSaveDateParams(columns_stability_inputImpedance_checkDate.value, listInputImpedanceStabilityCheckDate.value, 2) + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityCheckDate.value = listVoltageFlatnessStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_voltage_flatness_checkDate.value, 5, 3) + columns_stability_voltage_flatness_checkDate.value = columnsData + return item = itemData + }) + listVoltageFlatnessStabilityCheckDate.value = handleSaveDateParams(columns_stability_voltage_flatness_checkDate.value, listVoltageFlatnessStabilityCheckDate.value, 3) + break + default: + break + } + } + + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }).catch(() => { + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }) + } +} + +/** + * 保存之前的校验 + */ +function checkList() { + // 新建核查数据的时候,在保存之前要先校验一下本次核查日期有没有数据,没有不允许保存 + if (listTimeMarkRepeatability.value.length && `${listTimeMarkRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 时标 的重复性') + return false + } + if (listSquareWaveVoltage50ΩRepeatability.value.length && `${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 方波电压(50Ω) 重复性') + return false + } + if (listSquareWaveVoltage1MΩRepeatability.value.length && `${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 方波电压(1MΩ) 重复性') + return false + } + if (listDirectVoltage50ΩRepeatability.value.length && `${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 直流电压(50Ω) 重复性') + return false + } + if (listDirectVoltage1MΩRepeatability.value.length && `${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 直流电压(1MΩ) 重复性') + return false + } + if (listInputImpedanceRepeatability.value.length && `${listInputImpedanceRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 输入阻抗 重复性') + return false + } + if (listVoltageFlatnessRepeatability.value.length && `${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 稳幅正弦信号电压平坦度 重复性') + return false + } + return true +} + +// 点击表头日期查询历史稳定性数据 +const handleClickHeader = (val: any, checkDateDetailId: string) => { + dateArrStability.value = ['核查数据', val.label] + fetchInfo(checkDateDetailId) // 获取此次历史日期的详情 +} + +// 日期变化 +const handleChangeRadio = (date: string) => { + currentDate.value = date } // -------------------------------------钩子----------------------------------------------------- +// 统计日期 +const dateCount = (columns: TableColumn[]) => { + let dateNum = 0 // 稳定性表格有几个日期 -onMounted(async () => { - if (pageType.value !== 'add') { - // fetchInfo() + // 统计有几个日期 + columns[3].children?.forEach((item) => { + if (item.text !== '-' && item.text !== '') { + dateNum += 1 + } + }) + return dateNum +} + +watch(() => props.pageType, (newValue) => { + if (newValue === 'detail') { + listTimeMarkRepeatability.value = listTimeMarkRepeatability.value.map((item) => { item.editable = false; return item }) + listSquareWaveVoltage50ΩRepeatability.value = listSquareWaveVoltage50ΩRepeatability.value.map((item) => { item.editable = false; return item }) + listSquareWaveVoltage1MΩRepeatability.value = listSquareWaveVoltage1MΩRepeatability.value.map((item) => { item.editable = false; return item }) + listDirectVoltage50ΩRepeatability.value = listDirectVoltage50ΩRepeatability.value.map((item) => { item.editable = false; return item }) + listDirectVoltage1MΩRepeatability.value = listDirectVoltage1MΩRepeatability.value.map((item) => { item.editable = false; return item }) + listInputImpedanceRepeatability.value = listInputImpedanceRepeatability.value.map((item) => { item.editable = false; return item }) + listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((item) => { item.editable = false; return item }) + listRisetimeRepeatability.value = listRisetimeRepeatability.value.map((item) => { item.editable = false; return item }) } }) +/** + * 初始化表头 + * @param soveLastColumnDate 是否处理最后一列 + */ +function initColumns() { + const tempColumn = [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ] as any + columns_stability_timeMark.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_directVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_directVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_inputImpedance.value[2].children = [...tempColumn] + columns_stability_voltage_flatness.value[3].children = [...tempColumn] + + columns_stability_timeMark.value[2].children![5].text = props.checkDate! // 最后一列的表头日期 + columns_stability_squareWaveVoltage50Ω.value[2].children![5].text = props.checkDate! // 最后一列的表头日期 + columns_stability_squareWaveVoltage1MΩ.value[2].children![5].text = props.checkDate! + columns_stability_directVoltage50Ω.value[2].children![5].text = props.checkDate! + columns_stability_directVoltage1MΩ.value[2].children![5].text = props.checkDate! + columns_stability_inputImpedance.value[2].children![5].text = props.checkDate! + columns_stability_voltage_flatness.value[3].children![5].text = props.checkDate! +} +// 监听核查日期变化 +watch(() => props.checkDate, (newValue) => { + initColumns() + nextTick(() => { + fetchHistoryIndication('时标') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 + fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + }) +}, { immediate: true }) + +watch(() => current.value, (value) => { + console.log('重复性') + console.log(listTimeMarkRepeatability.value) + console.log('稳定性') + console.log(listTimeMarkStability.value) + listTimeMarkRepeatability.value = [...listTimeMarkRepeatability.value] + listTimeMarkStability.value = [...listTimeMarkStability.value] +}) + +onMounted(async () => { + belongStandardEquipment.value = $route.query.belongStandardEquipment as string // 检校标准装置 + itemCategoryId.value = $route.query.itemCategoryId as string // 核查项分类id + itemCategoryName.value = $route.query.itemCategoryName as string // 核查项分类名称 + if (props.pageType !== 'add') { + fetchInfo() + } +}) defineExpose({ fetchCheckItemDetail }) @@ -615,128 +1862,416 @@
时标
- + 计算结果
+ + + + + + +
方波电压(50Ω)
- + 计算结果
+ + - -
-
方波电压(10Ω)
- - 计算结果 - -
+ + +
方波电压(1MΩ)
- + 计算结果
+ + + + + + +
直流电压(50Ω)
- + 计算结果
+ + + + + + +
直流电压(1MΩ)
- + 计算结果
+ + + + + + +
输入阻抗
- + 计算结果
+ + + + + + +
稳幅正弦信号电压平坦度
- + 计算结果
+ + + + + + +
上升时间
- + 计算结果
- + + + + + + + + + + + + + + + diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue new file mode 100644 index 0000000..263ff3c --- /dev/null +++ b/src/views/equipement/standard/checkData/components/thirteenth/11.vue @@ -0,0 +1,79 @@ + diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index e6eebf6..f34605c 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -3,28 +3,42 @@ import { ref, watch } from 'vue' import { ElLoading, ElMessage } from 'element-plus' import saveCheckRecord from '../../dialog/saveCheckRecord.vue' +import { clearDateValue, handleDetailTableTableHead, handleSaveDateParams, solveHistoryIndicationTableData } from '../useStabilityCaculate' import type { IList } from './thirteenth-interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' +import { useCheckList } from '@/commonMethods/useCheckList' import multiTable from '@/components/MultiHeaderTable/index.vue' -// import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' -// import { addCheckData, calculateHandle, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' +import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' +import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' +const props = defineProps({ + selectStandardId: { // 选择的标准装置id + type: String, + }, + pageType: { // 页面类型 + type: String, + }, + checkDate: { // 核查日期 + type: String, + }, +}) const user = useUserStore() // 用户信息 const $router = useRouter() // 关闭页面使用 const $route = useRoute() // 路由参数 -const pageType = ref('add') // 页面类型: add, edit, detail const infoId = ref('') -const belongStandardEquipment = ref('9') +const belongStandardEquipment = ref('13') const itemCategoryId = ref('') // 核查项分类id const itemCategoryName = ref('') // 核查项分类名称 - +const form = ref({ + remark: '/', // 备注 +}) +const equipmentId = ref('') // 设备id +const dateArrStability = ref([]) // 稳定性日期数组 +const currentDate = ref('') // 要查询历史稳定性的日期 // ----------------------------------路由参数------------------------------------------------ if ($route.params && $route.params.type) { - pageType.value = $route.params.type as string - console.log(pageType.value) - if ($route.params.id) { infoId.value = $route.params.id as string } @@ -42,7 +56,7 @@ text: '测量值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '160', children: [ { text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -57,8 +71,8 @@ { text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) const columns_repeatability_voltage_flatness = ref([ // 重复性表头--稳幅正弦信号电压平坦度 { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, @@ -70,7 +84,7 @@ text: 'X1', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -82,7 +96,7 @@ text: 'X2', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -94,7 +108,7 @@ text: 'X3', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -106,7 +120,7 @@ text: 'X4', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -118,7 +132,7 @@ text: 'X5', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -130,7 +144,7 @@ text: 'X6', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -142,7 +156,7 @@ text: 'X7', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -154,7 +168,7 @@ text: 'X8', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -166,7 +180,7 @@ text: 'X9', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -178,7 +192,7 @@ text: 'X10', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -186,8 +200,8 @@ { text: '平坦度/%', value: 'flatnessTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) const columns_repeatability_risetime = ref([ // 重复性表头--上升时间 @@ -206,7 +220,7 @@ text: '核查点均值', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -217,10 +231,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_timeMark_checkDate = ref([ // 稳定性表头--时标 + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: '-', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 方波电压(50Ω)--稳定性 const columns_stability_squareWaveVoltage50Ω = ref([ @@ -230,7 +267,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -241,10 +278,34 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +// 方波电压(50Ω)--稳定性 +const columns_stability_squareWaveVoltage50Ω_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 方波电压(1MΩ)--稳定性 const columns_stability_squareWaveVoltage1MΩ = ref([ @@ -254,7 +315,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -265,10 +326,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_squareWaveVoltage1MΩ_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 直流电压(50Ω)--稳定性 const columns_stability_directVoltage50Ω = ref([ @@ -278,7 +362,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -289,10 +373,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_directVoltage50Ω_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 直流电压(1MΩ)--稳定性 const columns_stability_directVoltage1MΩ = ref([ @@ -302,7 +409,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -313,10 +420,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_directVoltage1MΩ_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 输入阻抗--稳定性 const columns_stability_inputImpedance = ref([ @@ -326,7 +456,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -337,10 +467,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_inputImpedance_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 稳幅正弦信号电压平坦度--稳定性 const columns_stability_voltage_flatness = ref([ // 稳定性表头--稳幅正弦信号电压平坦度 @@ -351,7 +504,7 @@ text: '核查点均值', value: '-', align: 'center', - required: true, + required: false, width: '160', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -362,21 +515,45 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_voltage_flatness_checkDate = ref([ // 稳定性表头--稳幅正弦信号电压平坦度 + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '类型', value: 'typeValue', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: '-', + align: 'center', + required: false, + width: '160', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 上升时间--稳定性 const columns_stability_risetime = ref([ // 稳定性表头--上升时间 - { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '快沿', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, - { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: true, type: 'text' }, - { text: '探头设备名称', value: 'equipmentName', align: 'center', required: true, type: 'text' }, - { text: '探头规格型号', value: 'model', align: 'center', required: true, type: 'text' }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true, type: 'text' }, - { text: '技术指标', value: 'technicalIndexDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '核查项目', value: 'params', align: 'center', required: false, type: 'text' }, + { text: '快沿', value: 'checkPointDefineFront', align: 'center', required: false, type: 'text' }, + { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false, type: 'text' }, + { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false, type: 'text' }, + { text: '探头规格型号', value: 'model', align: 'center', required: false, type: 'text' }, + { text: '测量值', value: 'testValueOne', align: 'center', required: false, type: 'text' }, + { text: '技术指标', value: 'technicalIndexDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) const listTimeMarkRepeatability = ref([]) // 时标-重复性 @@ -388,32 +565,49 @@ const listVoltageFlatnessRepeatability = ref([]) // 稳幅正弦信号电压平坦度-重复性 const listRisetimeRepeatability = ref([]) // 上升时间-重复性 -const listTimeMarkRepeatabilityLoading = ref([]) // 时标-重复性Loading -const listSquareWaveVoltage50ΩRepeatabilityLoading = ref([]) // 方波电压(50Ω)-重复性Loading -const listSquareWaveVoltage1MΩRepeatabilityLoading = ref([]) // 方波电压(1MΩ)-重复性Loading -const listDirectVoltage50ΩRepeatabilityLoading = ref([]) // 直流电压(50Ω)-重复性Loading -const listDirectVoltage1MΩRepeatabilityLoading = ref([]) // 直流电压(1MΩ)-重复性Loading -const listInputImpedanceRepeatabilityLoading = ref([]) // 输入阻抗-重复性Loading -const listVoltageFlatnessRepeatabilityLoading = ref([]) // 稳幅正弦信号电压平坦度-重复性Loading -const listRisetimeRepeatabilityLoading = ref([]) // 上升时间-重复性Loading +const listTimeMarkRepeatabilityLoading = ref(false) // 时标-重复性Loading +const listSquareWaveVoltage50ΩRepeatabilityLoading = ref(false) // 方波电压(50Ω)-重复性Loading +const listSquareWaveVoltage1MΩRepeatabilityLoading = ref(false) // 方波电压(1MΩ)-重复性Loading +const listDirectVoltage50ΩRepeatabilityLoading = ref(false) // 直流电压(50Ω)-重复性Loading +const listDirectVoltage1MΩRepeatabilityLoading = ref(false) // 直流电压(1MΩ)-重复性Loading +const listInputImpedanceRepeatabilityLoading = ref(false) // 输入阻抗-重复性Loading +const listVoltageFlatnessRepeatabilityLoading = ref(false) // 稳幅正弦信号电压平坦度-重复性Loading +const listRisetimeRepeatabilityLoading = ref(false) // 上升时间-重复性Loading -const listTimeMarkStability = ref([]) // 时标-稳定性 -const listSquareWaveVoltage50ΩStability = ref([]) // 方波电压(50Ω)-稳定性 -const listSquareWaveVoltage1MΩStability = ref([]) // 方波电压(1MΩ)-稳定性 -const listDirectVoltage50ΩStability = ref([]) // 直流电压(50Ω)-稳定性 -const listDirectVoltage1MΩStability = ref([]) // 直流电压(1MΩ)-稳定性 -const listInputImpedanceStability = ref([]) // 输入阻抗-稳定性 -const listVoltageFlatnessStability = ref([]) // 稳幅正弦信号电压平坦度-稳定性 -const listRisetimeStability = ref([]) // 上升时间-稳定性 +const listTimeMarkStability = ref([]) // 时标-稳定性 +const listSquareWaveVoltage50ΩStability = ref([]) // 方波电压(50Ω)-稳定性 +const listSquareWaveVoltage1MΩStability = ref([]) // 方波电压(1MΩ)-稳定性 +const listDirectVoltage50ΩStability = ref([]) // 直流电压(50Ω)-稳定性 +const listDirectVoltage1MΩStability = ref([]) // 直流电压(1MΩ)-稳定性 +const listInputImpedanceStability = ref([]) // 输入阻抗-稳定性 +const listVoltageFlatnessStability = ref([]) // 稳幅正弦信号电压平坦度-稳定性 +const listRisetimeStability = ref([]) // 上升时间-稳定性 -const listTimeMarkStabilityLoading = ref([]) // 时标-稳定性Loading -const listSquareWaveVoltage50ΩStabilityLoading = ref([]) // 方波电压(50Ω)-稳定性Loading -const listSquareWaveVoltage1MΩStabilityLoading = ref([]) // 方波电压(1MΩ)-稳定性Loading -const listDirectVoltage50ΩStabilityLoading = ref([]) // 直流电压(50Ω)-稳定性Loading -const listDirectVoltage1MΩStabilityLoading = ref([]) // 直流电压(1MΩ)-稳定性Loading -const listInputImpedanceStabilityLoading = ref([]) // 输入阻抗-稳定性Loading -const listVoltageFlatnessStabilityLoading = ref([]) // 稳幅正弦信号电压平坦度-稳定性Loading -const listRisetimeStabilityLoading = ref([]) // 上升时间-稳定性Loading +const listTimeMarkStabilityLoading = ref(false) // 时标-稳定性Loading +const listSquareWaveVoltage50ΩStabilityLoading = ref(false) // 方波电压(50Ω)-稳定性Loading +const listSquareWaveVoltage1MΩStabilityLoading = ref(false) // 方波电压(1MΩ)-稳定性Loading +const listDirectVoltage50ΩStabilityLoading = ref(false) // 直流电压(50Ω)-稳定性Loading +const listDirectVoltage1MΩStabilityLoading = ref(false) // 直流电压(1MΩ)-稳定性Loading +const listInputImpedanceStabilityLoading = ref(false) // 输入阻抗-稳定性Loading +const listVoltageFlatnessStabilityLoading = ref(false) // 稳幅正弦信号电压平坦度-稳定性Loading +const listRisetimeStabilityLoading = ref(false) // 上升时间-稳定性Loading + +const listTimeMarkRepeatabilityCheckDate = ref([]) // 时标-重复性 +const listSquareWaveVoltage50ΩRepeatabilityCheckDate = ref([]) // 方波电压(50Ω)-重复性 +const listSquareWaveVoltage1MΩRepeatabilityCheckDate = ref([]) // 方波电压(1MΩ)-重复性 +const listDirectVoltage50ΩRepeatabilityCheckDate = ref([]) // 直流电压(50Ω)-重复性 +const listDirectVoltage1MΩRepeatabilityCheckDate = ref([]) // 直流电压(1MΩ)-重复性 +const listInputImpedanceRepeatabilityCheckDate = ref([]) // 输入阻抗-重复性 +const listVoltageFlatnessRepeatabilityCheckDate = ref([]) // 稳幅正弦信号电压平坦度-重复性 +const listRisetimeRepeatabilityCheckDate = ref([]) // 上升时间-重复性 +const listTimeMarkStabilityCheckDate = ref([]) // 时标-稳定性 +const listSquareWaveVoltage50ΩStabilityCheckDate = ref([]) // 方波电压(50Ω)-稳定性 +const listSquareWaveVoltage1MΩStabilityCheckDate = ref([]) // 方波电压(1MΩ)-稳定性 +const listDirectVoltage50ΩStabilityCheckDate = ref([]) // 直流电压(50Ω)-稳定性 +const listDirectVoltage1MΩStabilityCheckDate = ref([]) // 直流电压(1MΩ)-稳定性 +const listInputImpedanceStabilityCheckDate = ref([]) // 输入阻抗-稳定性 +const listVoltageFlatnessStabilityCheckDate = ref([]) // 稳幅正弦信号电压平坦度-稳定性 +const listRisetimeStabilityCheckDate = ref([]) // 上升时间-稳定性 // 获取配置详情 function fetchCheckItemDetail(equipmentId: string, belongStandardEquipmentParam: string, itemCategoryIdParam: string, itemCategoryNameParam: string) { @@ -432,19 +626,20 @@ } getCheckItemDetail(params).then((res) => { loading.close() - handleData(res.data.checkItemDataResistanceThermometerList) - fetchHistoryIndication() // 获取稳定性 + handleData(res.data.checkItemDataOscilloscopeList) + // fetchHistoryIndication() // 获取稳定性 + fetchHistoryIndication('时标') // 重新拉取稳定性 + fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性 + fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性 + fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性 + fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性 + fetchHistoryIndication('输入阻抗') // 重新拉取稳定性 + fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性 }) } // 初始化数据(查询配置检定项) function handleData(list: any, type = 'edit') { - const listSquareWaveVoltage1MΩRepeatability = ref([]) // 方波电压(1MΩ)-重复性 - const listDirectVoltage50ΩRepeatability = ref([]) // 直流电压(50Ω)-重复性 - const listDirectVoltage1MΩRepeatability = ref([]) // 直流电压(1MΩ)-重复性 - const listInputImpedanceRepeatability = ref([]) // 输入阻抗-重复性 - const listVoltageFlatnessRepeatability = ref([]) // 稳幅正弦信号电压平坦度-重复性 - const listRisetimeRepeatability = ref([]) // 上升时间-重复性 // 时标 listTimeMarkRepeatability.value = list.filter((item: { params: string }) => item.params === '时标') // 时标重复性 @@ -463,10 +658,21 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } - }) + }) as any // 时标稳定性 - listTimeMarkStability.value = listTimeMarkRepeatability.value.map((e) => { + listTimeMarkStability.value = listTimeMarkRepeatability.value.map((e: any) => { return { editable: props.pageType !== 'detail', dataId: e.dataId, // 核查数据管理基础信息表id @@ -507,7 +713,7 @@ } }) // 方波电压(50Ω)稳定性 - listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩRepeatability.value.map((e) => { + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩRepeatability.value.map((e: any) => { return { editable: props.pageType !== 'detail', dataId: e.dataId, // 核查数据管理基础信息表id @@ -547,7 +753,7 @@ } }) // 方波电压(1MΩ)稳定性 - listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩRepeatability.value.map((e) => { + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩRepeatability.value.map((e: any) => { return { editable: props.pageType !== 'detail', dataId: e.dataId, // 核查数据管理基础信息表id @@ -565,40 +771,1081 @@ conclusion: '', // 结论 } }) + + // 直流电压(50Ω) + listDirectVoltage50ΩRepeatability.value = list.filter((item: { params: string }) => item.params === '直流电压(50Ω)') + // 直流电压(50Ω)重复性 + listDirectVoltage50ΩRepeatability.value = listDirectVoltage50ΩRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + } + }) + // 直流电压(50Ω)稳定性 + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 直流电压(1MΩ) + listDirectVoltage1MΩRepeatability.value = list.filter((item: { params: string }) => item.params === '直流电压(1MΩ)') + // 直流电压(1MΩ)重复性 + listDirectVoltage1MΩRepeatability.value = listDirectVoltage1MΩRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + } + }) + // 直流电压(1MΩ)稳定性 + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 输入阻抗 + listInputImpedanceRepeatability.value = list.filter((item: { params: string }) => item.params === '输入阻抗') + // 输入阻抗重复性 + listInputImpedanceRepeatability.value = listInputImpedanceRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + } + }) + // 输入阻抗稳定性 + listInputImpedanceStability.value = listInputImpedanceRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 稳幅正弦信号电压平坦度 + listVoltageFlatnessRepeatability.value = list.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') + // 稳幅正弦信号电压平坦度重复性 + listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + typeValue: e.typeValue, // 类型 + testValueUnit: 'mW', // 测量值单位 + convertVoltageUnit: 'V', // 转换为电压值单位 + checkPoint: e.checkPoint, // 核查点 + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + flatnessOne: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度1/% + flatnessTwo: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度2/% + flatnessThree: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度3/% + flatnessFour: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度4/% + flatnessFive: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度5/% + flatnessSix: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度6/% + flatnessSeven: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度7/% + flatnessEight: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度8/% + flatnessNine: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度9/% + flatnessTen: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度10/% + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + } + }) + // 稳幅正弦信号电压平坦度稳定性 + listVoltageFlatnessStability.value = listVoltageFlatnessRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, // 核查点 + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 上升时间 + listRisetimeRepeatability.value = list.filter((item: { params: string }) => item.params === '上升时间') + // 上升时间重复性 + listRisetimeRepeatability.value = listRisetimeRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + typeValue: e.typeValue, // 类型 + checkPoint: e.checkPoint, // 快沿 + unit: e.unit, // 快沿单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 快沿 + manufactureNo: e.manufactureNo, // 探头出厂编号 + equipmentName: e.equipmentName, // 探头设备名称 + model: e.model, // 探头规格型号 + testValueOne: '', // 测量值 + technicalIndex: e.technicalIndex, // 技术指标 + technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 + technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 + } + }) + // 上升时间稳定性 + listRisetimeStability.value = listRisetimeRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, // 快沿 + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 快沿 + checkType: '稳定性', + manufactureNo: e.manufactureNo, // 探头出厂编号 + equipmentName: e.equipmentName, // 探头设备名称 + model: e.model, // 探头规格型号 + testValueOne: '', // 测量值 + technicalIndex: e.technicalIndex, // 技术指标 + technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 + technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 + conclusion: '', // 结论 + } + }) } -// 点击生成结果处理 -const createResult = () => { - // +// 点击计算结果 +const createResult = (type: string) => { + let checkDataOscilloscopeListParams: any // 要传的重复或者稳定性参数 + if (current.value === 'stability') { // 计算稳定性 + switch (type) { + case '时标': + if (!listTimeMarkRepeatability.value.length) { + ElMessage.warning('时标 未配置重复性,请检查') + return false + } + if (`${listTimeMarkRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listTimeMarkStability.value + break + case '方波电压(50Ω)': + if (!listSquareWaveVoltage50ΩRepeatability.value.length) { + ElMessage.warning('方波电压(50Ω) 未配置重复性,请检查') + return false + } + if (`${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩStability.value + break + case '方波电压(1MΩ)': + if (!listSquareWaveVoltage1MΩRepeatability.value.length) { + ElMessage.warning('方波电压(1MΩ) 未配置重复性,请检查') + return false + } + if (`${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩStability.value + break + case '直流电压(50Ω)': + if (!listDirectVoltage50ΩRepeatability.value.length) { + ElMessage.warning('直流电压(50Ω) 未配置重复性,请检查') + return false + } + if (`${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listDirectVoltage50ΩStability.value + break + case '直流电压(1MΩ)': + if (!listDirectVoltage1MΩRepeatability.value.length) { + ElMessage.warning('直流电压(1MΩ) 未配置重复性,请检查') + return false + } + if (`${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listDirectVoltage1MΩStability.value + break + case '输入阻抗': + if (!listInputImpedanceRepeatability.value.length) { + ElMessage.warning('输入阻抗 未配置重复性,请检查') + return false + } + if (`${listInputImpedanceRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listInputImpedanceStability.value + break + case '稳幅正弦信号电压平坦度': + if (!listVoltageFlatnessRepeatability.value.length) { + ElMessage.warning('稳幅正弦信号电压平坦度 未配置重复性,请检查') + return false + } + if (`${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listVoltageFlatnessStability.value + break + case '上升时间': + if (!listRisetimeRepeatability.value.length) { + ElMessage.warning('上升时间 未配置重复性,请检查') + return false + } + if (`${listRisetimeRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listRisetimeStability.value + break + default: + break + } + } + + if (current.value === 'repeatability') { + switch (type) { + case '时标': + if (!useCheckList(listTimeMarkRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listTimeMarkRepeatability.value + break + case '方波电压(50Ω)': + if (!useCheckList(listSquareWaveVoltage50ΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩRepeatability.value + break + case '方波电压(1MΩ)': + if (!useCheckList(listSquareWaveVoltage1MΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩRepeatability.value + break + case '直流电压(50Ω)': + if (!useCheckList(listDirectVoltage50ΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listDirectVoltage50ΩRepeatability.value + break + case '直流电压(1MΩ)': + if (!useCheckList(listDirectVoltage1MΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listDirectVoltage1MΩRepeatability.value + break + case '输入阻抗': + if (!useCheckList(listInputImpedanceRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listInputImpedanceRepeatability.value + break + case '稳幅正弦信号电压平坦度': + if (!useCheckList(listVoltageFlatnessRepeatability.value, columns_repeatability_voltage_flatness.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listVoltageFlatnessRepeatability.value + break + case '上升时间': + if (!useCheckList(listRisetimeRepeatability.value, columns_repeatability_risetime.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listRisetimeRepeatability.value + break + default: + break + } + } + + const params = { + belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 + checkDataOscilloscopeList: checkDataOscilloscopeListParams, + itemCategoryId: itemCategoryId.value, // 核查项分类id + itemCategoryName: itemCategoryName.value, // 核查项分类id + } + // 重复性Loading + listTimeMarkRepeatabilityLoading.value = type === '时标' && current.value === 'repeatability' + listSquareWaveVoltage50ΩRepeatabilityLoading.value = type === '方波电压(50Ω)' && current.value === 'repeatability' + listSquareWaveVoltage1MΩRepeatabilityLoading.value = type === '方波电压(1MΩ)' && current.value === 'repeatability' + listDirectVoltage50ΩRepeatabilityLoading.value = type === '直流电压(50Ω)' && current.value === 'repeatability' + listDirectVoltage1MΩRepeatabilityLoading.value = type === '直流电压(1MΩ)' && current.value === 'repeatability' + listInputImpedanceRepeatabilityLoading.value = type === '输入阻抗' && current.value === 'repeatability' + listVoltageFlatnessRepeatabilityLoading.value = type === '稳幅正弦信号电压平坦度' && current.value === 'repeatability' + listRisetimeRepeatabilityLoading.value = type === '上升时间' && current.value === 'repeatability' + // 稳定性loading + listTimeMarkStabilityLoading.value = type === '时标' && current.value === 'stability' + listSquareWaveVoltage50ΩStabilityLoading.value = type === '方波电压(50Ω)' && current.value === 'stability' + listSquareWaveVoltage1MΩStabilityLoading.value = type === '方波电压(1MΩ)' && current.value === 'stability' + listDirectVoltage50ΩStabilityLoading.value = type === '直流电压(50Ω)' && current.value === 'stability' + listDirectVoltage1MΩStabilityLoading.value = type === '直流电压(1MΩ)' && current.value === 'stability' + listInputImpedanceStabilityLoading.value = type === '输入阻抗' && current.value === 'stability' + listVoltageFlatnessStabilityLoading.value = type === '稳幅正弦信号电压平坦度' && current.value === 'stability' + listRisetimeStabilityLoading.value = type === '上升时间' && current.value === 'stability' + + calculateHandle(params).then((res) => { + const result = res.data.filter((item: { params: string }) => item.params === type).map((item: any) => { + return { + ...item, + checkPointDefineFront: item.checkPoint + item.unit, // 核查点 + editable: props.pageType !== 'detail', + } + }) + switch (type) { + case '时标': + if (current.value === 'repeatability') { // 重复性 + listTimeMarkRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listTimeMarkStability.value = listTimeMarkStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listTimeMarkRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listTimeMarkStability.value = result + } + break + case '方波电压(50Ω)': + if (current.value === 'repeatability') { // 重复性 + listSquareWaveVoltage50ΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listSquareWaveVoltage50ΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listSquareWaveVoltage50ΩStability.value = result + } + break + case '方波电压(1MΩ)': + if (current.value === 'repeatability') { // 重复性 + listSquareWaveVoltage1MΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listSquareWaveVoltage1MΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listSquareWaveVoltage1MΩStability.value = result + } + break + case '直流电压(50Ω)': + if (current.value === 'repeatability') { // 重复性 + listDirectVoltage50ΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listDirectVoltage50ΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listDirectVoltage50ΩStability.value = result + } + break + case '直流电压(1MΩ)': + if (current.value === 'repeatability') { // 重复性 + listDirectVoltage1MΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listDirectVoltage1MΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listDirectVoltage1MΩStability.value = result + } + break + case '输入阻抗': + if (current.value === 'repeatability') { // 重复性 + listInputImpedanceRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listInputImpedanceStability.value = listInputImpedanceStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listInputImpedanceRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listInputImpedanceStability.value = result + } + break + case '稳幅正弦信号电压平坦度': + if (current.value === 'repeatability') { // 重复性 + listVoltageFlatnessRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listVoltageFlatnessStability.value = listVoltageFlatnessStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listVoltageFlatnessRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listVoltageFlatnessStability.value = result + } + break + case '上升时间': + if (current.value === 'repeatability') { // 重复性 + listRisetimeRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listRisetimeStability.value = listRisetimeStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listRisetimeRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listRisetimeStability.value = result + } + break + default: + break + } + + listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading + listSquareWaveVoltage50ΩRepeatabilityLoading.value = false // 方波电压(50Ω)-重复性Loading + listSquareWaveVoltage1MΩRepeatabilityLoading.value = false // 方波电压(1MΩ)-重复性Loading + listDirectVoltage50ΩRepeatabilityLoading.value = false // 直流电压(50Ω)-重复性Loading + listDirectVoltage1MΩRepeatabilityLoading.value = false // 直流电压(1MΩ)-重复性Loading + listInputImpedanceRepeatabilityLoading.value = false // 输入阻抗-重复性Loading + listVoltageFlatnessRepeatabilityLoading.value = false // 稳幅正弦信号电压平坦度-重复性Loading + listRisetimeRepeatabilityLoading.value = false // 上升时间-重复性Loading + + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }).catch(() => { + listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading + listSquareWaveVoltage50ΩRepeatabilityLoading.value = false // 方波电压(50Ω)-重复性Loading + listSquareWaveVoltage1MΩRepeatabilityLoading.value = false // 方波电压(1MΩ)-重复性Loading + listDirectVoltage50ΩRepeatabilityLoading.value = false // 直流电压(50Ω)-重复性Loading + listDirectVoltage1MΩRepeatabilityLoading.value = false // 直流电压(1MΩ)-重复性Loading + listInputImpedanceRepeatabilityLoading.value = false // 输入阻抗-重复性Loading + listVoltageFlatnessRepeatabilityLoading.value = false // 稳幅正弦信号电压平坦度-重复性Loading + listRisetimeRepeatabilityLoading.value = false // 上升时间-重复性Loading + + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }) } // ------------------------------------------------------------------------------------------ +// 处理详情数据 +const solveGetDetailData = (responseList: any) => { + console.log('处理详情数据', props.pageType) + const list = responseList.map((item: { editable: boolean }) => { + return { + ...item, + editable: props.pageType !== 'detail', + } + }) + + const listTimeMarkRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '时标') // 时标-重复性 + const listSquareWaveVoltage50ΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '方波电压(50Ω)') // 方波电压(50Ω)-重复性 + const listSquareWaveVoltage1MΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '方波电压(1MΩ)') // 方波电压(1MΩ)-重复性 + const listDirectVoltage50ΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '直流电压(50Ω)') // 直流电压(50Ω)-重复性 + const listDirectVoltage1MΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '直流电压(1MΩ)') // 直流电压(1MΩ)-重复性 + const listInputImpedanceRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '输入阻抗') // 输入阻抗-重复性 + const listVoltageFlatnessRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '稳幅正弦信号电压平坦度') // 稳幅正弦信号电压平坦度-重复性 + const listRisetimeRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '上升时间') // 上升时间-重复性 + + const listTimeMarkStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '时标') // 时标-稳定性 + const listSquareWaveVoltage50ΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '方波电压(50Ω)') // 方波电压(50Ω)-稳定性 + const listSquareWaveVoltage1MΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '方波电压(1MΩ)') // 方波电压(1MΩ)-稳定性 + const listDirectVoltage50ΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '直流电压(50Ω)') // 直流电压(50Ω)-稳定性 + const listDirectVoltage1MΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '直流电压(1MΩ)') // 直流电压(1MΩ)-稳定性 + const listInputImpedanceStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '输入阻抗') // 输入阻抗-稳定性 + const listVoltageFlatnessStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '稳幅正弦信号电压平坦度') // 稳幅正弦信号电压平坦度-稳定性 + const listRisetimeStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '上升时间') // 上升时间-稳定性 + + return { + templistTimeMarkRepeatability: listTimeMarkRepeatability, + templistSquareWaveVoltage50ΩRepeatability: listSquareWaveVoltage50ΩRepeatability, + templistSquareWaveVoltage1MΩRepeatability: listSquareWaveVoltage1MΩRepeatability, + templistDirectVoltage50ΩRepeatability: listDirectVoltage50ΩRepeatability, + templistDirectVoltage1MΩRepeatability: listDirectVoltage1MΩRepeatability, + templistInputImpedanceRepeatability: listInputImpedanceRepeatability, + templistVoltageFlatnessRepeatability: listVoltageFlatnessRepeatability, + templistRisetimeRepeatability: listRisetimeRepeatability, + + templistTimeMarkStability: listTimeMarkStability, + templistSquareWaveVoltage50ΩStability: listSquareWaveVoltage50ΩStability, + templistSquareWaveVoltage1MΩStability: listSquareWaveVoltage1MΩStability, + templistDirectVoltage50ΩStability: listDirectVoltage50ΩStability, + templistDirectVoltage1MΩStability: listDirectVoltage1MΩStability, + templistInputImpedanceStability: listInputImpedanceStability, + templistVoltageFlatnessStability: listVoltageFlatnessStability, + templistRisetimeStability: listRisetimeStability, + } +} // 获取详情 -function fetchInfo() { - // const loading = ElLoading.service({ - // lock: true, - // background: 'rgba(255, 255, 255, 0.8)', - // }) - // getInfo({ id: infoId.value }).then((res) => { - // form.value = { ...res.data } - // list.value = res.data.checkDataPistonGaugeList.map((item: any) => { - // return { - // ...item, - // editable: pageType.value !== 'detail', - // } - // }) - // loading.close() - // }) +function fetchInfo(id = '') { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + getInfo({ id: id || infoId.value }).then((res) => { + form.value = { ...res.data } + equipmentId.value = res.data.equipmentId + const { + templistTimeMarkRepeatability, + templistSquareWaveVoltage50ΩRepeatability, + templistSquareWaveVoltage1MΩRepeatability, + templistDirectVoltage50ΩRepeatability, + templistDirectVoltage1MΩRepeatability, + templistInputImpedanceRepeatability, + templistVoltageFlatnessRepeatability, + templistRisetimeRepeatability, + + templistTimeMarkStability, + templistSquareWaveVoltage50ΩStability, + templistSquareWaveVoltage1MΩStability, + templistDirectVoltage50ΩStability, + templistDirectVoltage1MΩStability, + templistInputImpedanceStability, + templistVoltageFlatnessStability, + templistRisetimeStability, + } = solveGetDetailData(res.data.checkDataOscilloscopeList) + if (id !== '') { // 查询的日期获得的数据 + listTimeMarkRepeatabilityCheckDate.value = templistTimeMarkRepeatability + listSquareWaveVoltage50ΩRepeatabilityCheckDate.value = templistSquareWaveVoltage50ΩRepeatability + listSquareWaveVoltage1MΩRepeatabilityCheckDate.value = templistSquareWaveVoltage1MΩRepeatability + listDirectVoltage50ΩRepeatabilityCheckDate.value = templistDirectVoltage50ΩRepeatability + listDirectVoltage1MΩRepeatabilityCheckDate.value = templistDirectVoltage1MΩRepeatability + listInputImpedanceRepeatabilityCheckDate.value = templistInputImpedanceRepeatability + listVoltageFlatnessRepeatabilityCheckDate.value = templistVoltageFlatnessRepeatability + listRisetimeRepeatabilityCheckDate.value = templistRisetimeRepeatability + + listTimeMarkStabilityCheckDate.value = templistTimeMarkStability + listSquareWaveVoltage50ΩStabilityCheckDate.value = templistSquareWaveVoltage50ΩStability + listSquareWaveVoltage1MΩStabilityCheckDate.value = templistSquareWaveVoltage1MΩStability + listDirectVoltage50ΩStabilityCheckDate.value = templistDirectVoltage50ΩStability + listDirectVoltage1MΩStabilityCheckDate.value = templistDirectVoltage1MΩStability + listInputImpedanceStabilityCheckDate.value = templistInputImpedanceStability + listVoltageFlatnessStabilityCheckDate.value = templistVoltageFlatnessStability + listRisetimeStabilityCheckDate.value = templistRisetimeStability + } + else { + listTimeMarkRepeatability.value = templistTimeMarkRepeatability + listSquareWaveVoltage50ΩRepeatability.value = templistSquareWaveVoltage50ΩRepeatability + listSquareWaveVoltage1MΩRepeatability.value = templistSquareWaveVoltage1MΩRepeatability + listDirectVoltage50ΩRepeatability.value = templistDirectVoltage50ΩRepeatability + listDirectVoltage1MΩRepeatability.value = templistDirectVoltage1MΩRepeatability + listInputImpedanceRepeatability.value = templistInputImpedanceRepeatability + listVoltageFlatnessRepeatability.value = templistVoltageFlatnessRepeatability + listRisetimeRepeatability.value = templistRisetimeRepeatability + + listTimeMarkStability.value = templistTimeMarkStability + listSquareWaveVoltage50ΩStability.value = templistSquareWaveVoltage50ΩStability + listSquareWaveVoltage1MΩStability.value = templistSquareWaveVoltage1MΩStability + listDirectVoltage50ΩStability.value = templistDirectVoltage50ΩStability + listDirectVoltage1MΩStability.value = templistDirectVoltage1MΩStability + listInputImpedanceStability.value = templistInputImpedanceStability + listVoltageFlatnessStability.value = templistVoltageFlatnessStability + listRisetimeStability.value = templistRisetimeStability + } + + nextTick(() => { + if (id !== '') { // 稳定性表头---查询历史的稳定性日期数据 + const tempColumn = [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ] as any + columns_stability_timeMark.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_directVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_directVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_inputImpedance.value[2].children = [...tempColumn] + columns_stability_voltage_flatness.value[3].children = [...tempColumn] + + fetchHistoryIndication(currentDate.value) // 获取稳定性 + } + else { // 正常核查数据处理表头 + columns_stability_timeMark.value = handleDetailTableTableHead(columns_stability_timeMark.value, listTimeMarkRepeatability.value, 2) + columns_stability_squareWaveVoltage50Ω.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩRepeatability.value, 2) + columns_stability_squareWaveVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩRepeatability.value, 2) + columns_stability_directVoltage50Ω.value = handleDetailTableTableHead(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩRepeatability.value, 2) + columns_stability_directVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩRepeatability.value, 2) + columns_stability_inputImpedance.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listInputImpedanceRepeatability.value, 2) + columns_stability_voltage_flatness.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listVoltageFlatnessRepeatability.value, 3) + } + }) + + if (props.pageType === 'edit') { + fetchHistoryIndication('时标') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 + fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + } + loading.close() + }) +} + +/** + * 获取稳定性示值 + * @param date 查询日期 + */ +function fetchHistoryIndication(type: string, date = '') { + const params = { + belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) + checkDate: date || props.checkDate!, // 核查日期 + checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) + conclusion: '是', // 结论 + equipmentId: equipmentId.value, // 被核查设备id + params: type, // 核查项目 + stabilityExamine: '1', // 是否用于稳定性考核(1/0) + standardEquipmentId: props.selectStandardId!, // 被核查标准装置id + } + if (props.selectStandardId && equipmentId.value) { + switch (type) { + case '时标': + listTimeMarkStabilityLoading.value = true + break + case '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityLoading.value = true + break + case '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStabilityLoading.value = true + break + case '直流电压(50Ω)': + listDirectVoltage50ΩStabilityLoading.value = true + break + case '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityLoading.value = true + break + case '输入阻抗': + listInputImpedanceStabilityLoading.value = true + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityLoading.value = true + break + case '上升时间': + listRisetimeStabilityLoading.value = true + break + default: + break + } + getHistoryIndication(params).then((res) => { + if (date === '') { // 正常核查数据 + const num = props.pageType === 'edit' ? 5 : 4 + switch (type) { + case '时标': + listTimeMarkRepeatability.value = listTimeMarkRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_timeMark.value, num, 2) + columns_stability_timeMark.value = columnsData + return item = itemData + }) + listTimeMarkRepeatability.value = handleSaveDateParams(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + break + case '方波电压(50Ω)': + listSquareWaveVoltage50ΩRepeatability.value = listSquareWaveVoltage50ΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_squareWaveVoltage50Ω.value, num, 2) + columns_stability_squareWaveVoltage50Ω.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩRepeatability.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + break + case '方波电压(1MΩ)': + listSquareWaveVoltage1MΩRepeatability.value = listSquareWaveVoltage1MΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_squareWaveVoltage1MΩ.value, num, 2) + columns_stability_squareWaveVoltage1MΩ.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩRepeatability.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + break + case '直流电压(50Ω)': + listDirectVoltage50ΩRepeatability.value = listDirectVoltage50ΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage50Ω.value, num, 2) + columns_stability_directVoltage50Ω.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩRepeatability.value = handleSaveDateParams(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + break + case '直流电压(1MΩ)': + listDirectVoltage1MΩRepeatability.value = listDirectVoltage1MΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage1MΩ.value, num, 2) + columns_stability_directVoltage1MΩ.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩRepeatability.value = handleSaveDateParams(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + break + case '输入阻抗': + listInputImpedanceRepeatability.value = listInputImpedanceRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_inputImpedance.value, num, 2) + columns_stability_inputImpedance.value = columnsData + return item = itemData + }) + listInputImpedanceRepeatability.value = handleSaveDateParams(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_voltage_flatness.value, num, 3) + columns_stability_voltage_flatness.value = columnsData + return item = itemData + }) + listVoltageFlatnessRepeatability.value = handleSaveDateParams(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) + break + default: + break + } + } + else { + const num = props.pageType === 'edit' ? 5 : 4 + switch (type) { + case '时标': + listTimeMarkStabilityCheckDate.value = listTimeMarkStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_timeMark_checkDate.value, 5, 2) + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listTimeMarkStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listTimeMarkStabilityCheckDate.value, 2) + break + case '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityCheckDate.value = listSquareWaveVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_timeMark_checkDate.value, 5, 2) + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listSquareWaveVoltage50ΩStabilityCheckDate.value, 2) + break + case '方波电压(1MΩ)': + listSquareWaveVoltage1MΩRepeatabilityCheckDate.value = listSquareWaveVoltage1MΩRepeatabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_squareWaveVoltage1MΩ_checkDate.value, 5, 2) + columns_stability_squareWaveVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩRepeatabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ_checkDate.value, listSquareWaveVoltage1MΩRepeatabilityCheckDate.value, 2) + break + case '直流电压(50Ω)': + listDirectVoltage50ΩStabilityCheckDate.value = listDirectVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage50Ω_checkDate.value, 5, 2) + columns_stability_directVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage50Ω_checkDate.value, listDirectVoltage50ΩStabilityCheckDate.value, 2) + break + case '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityCheckDate.value = listDirectVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage1MΩ_checkDate.value, 5, 2) + columns_stability_directVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage1MΩ_checkDate.value, listDirectVoltage1MΩStabilityCheckDate.value, 2) + break + case '输入阻抗': + listInputImpedanceStabilityCheckDate.value = listInputImpedanceStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_inputImpedance_checkDate.value, 5, 2) + columns_stability_inputImpedance_checkDate.value = columnsData + return item = itemData + }) + listInputImpedanceStabilityCheckDate.value = handleSaveDateParams(columns_stability_inputImpedance_checkDate.value, listInputImpedanceStabilityCheckDate.value, 2) + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityCheckDate.value = listVoltageFlatnessStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_voltage_flatness_checkDate.value, 5, 3) + columns_stability_voltage_flatness_checkDate.value = columnsData + return item = itemData + }) + listVoltageFlatnessStabilityCheckDate.value = handleSaveDateParams(columns_stability_voltage_flatness_checkDate.value, listVoltageFlatnessStabilityCheckDate.value, 3) + break + default: + break + } + } + + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }).catch(() => { + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }) + } +} + +/** + * 保存之前的校验 + */ +function checkList() { + // 新建核查数据的时候,在保存之前要先校验一下本次核查日期有没有数据,没有不允许保存 + if (listTimeMarkRepeatability.value.length && `${listTimeMarkRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 时标 的重复性') + return false + } + if (listSquareWaveVoltage50ΩRepeatability.value.length && `${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 方波电压(50Ω) 重复性') + return false + } + if (listSquareWaveVoltage1MΩRepeatability.value.length && `${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 方波电压(1MΩ) 重复性') + return false + } + if (listDirectVoltage50ΩRepeatability.value.length && `${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 直流电压(50Ω) 重复性') + return false + } + if (listDirectVoltage1MΩRepeatability.value.length && `${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 直流电压(1MΩ) 重复性') + return false + } + if (listInputImpedanceRepeatability.value.length && `${listInputImpedanceRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 输入阻抗 重复性') + return false + } + if (listVoltageFlatnessRepeatability.value.length && `${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 稳幅正弦信号电压平坦度 重复性') + return false + } + return true +} + +// 点击表头日期查询历史稳定性数据 +const handleClickHeader = (val: any, checkDateDetailId: string) => { + dateArrStability.value = ['核查数据', val.label] + fetchInfo(checkDateDetailId) // 获取此次历史日期的详情 +} + +// 日期变化 +const handleChangeRadio = (date: string) => { + currentDate.value = date } // -------------------------------------钩子----------------------------------------------------- +// 统计日期 +const dateCount = (columns: TableColumn[]) => { + let dateNum = 0 // 稳定性表格有几个日期 -onMounted(async () => { - if (pageType.value !== 'add') { - // fetchInfo() + // 统计有几个日期 + columns[3].children?.forEach((item) => { + if (item.text !== '-' && item.text !== '') { + dateNum += 1 + } + }) + return dateNum +} + +watch(() => props.pageType, (newValue) => { + if (newValue === 'detail') { + listTimeMarkRepeatability.value = listTimeMarkRepeatability.value.map((item) => { item.editable = false; return item }) + listSquareWaveVoltage50ΩRepeatability.value = listSquareWaveVoltage50ΩRepeatability.value.map((item) => { item.editable = false; return item }) + listSquareWaveVoltage1MΩRepeatability.value = listSquareWaveVoltage1MΩRepeatability.value.map((item) => { item.editable = false; return item }) + listDirectVoltage50ΩRepeatability.value = listDirectVoltage50ΩRepeatability.value.map((item) => { item.editable = false; return item }) + listDirectVoltage1MΩRepeatability.value = listDirectVoltage1MΩRepeatability.value.map((item) => { item.editable = false; return item }) + listInputImpedanceRepeatability.value = listInputImpedanceRepeatability.value.map((item) => { item.editable = false; return item }) + listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((item) => { item.editable = false; return item }) + listRisetimeRepeatability.value = listRisetimeRepeatability.value.map((item) => { item.editable = false; return item }) } }) +/** + * 初始化表头 + * @param soveLastColumnDate 是否处理最后一列 + */ +function initColumns() { + const tempColumn = [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ] as any + columns_stability_timeMark.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_directVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_directVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_inputImpedance.value[2].children = [...tempColumn] + columns_stability_voltage_flatness.value[3].children = [...tempColumn] + + columns_stability_timeMark.value[2].children![5].text = props.checkDate! // 最后一列的表头日期 + columns_stability_squareWaveVoltage50Ω.value[2].children![5].text = props.checkDate! // 最后一列的表头日期 + columns_stability_squareWaveVoltage1MΩ.value[2].children![5].text = props.checkDate! + columns_stability_directVoltage50Ω.value[2].children![5].text = props.checkDate! + columns_stability_directVoltage1MΩ.value[2].children![5].text = props.checkDate! + columns_stability_inputImpedance.value[2].children![5].text = props.checkDate! + columns_stability_voltage_flatness.value[3].children![5].text = props.checkDate! +} +// 监听核查日期变化 +watch(() => props.checkDate, (newValue) => { + initColumns() + nextTick(() => { + fetchHistoryIndication('时标') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 + fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + }) +}, { immediate: true }) + +watch(() => current.value, (value) => { + console.log('重复性') + console.log(listTimeMarkRepeatability.value) + console.log('稳定性') + console.log(listTimeMarkStability.value) + listTimeMarkRepeatability.value = [...listTimeMarkRepeatability.value] + listTimeMarkStability.value = [...listTimeMarkStability.value] +}) + +onMounted(async () => { + belongStandardEquipment.value = $route.query.belongStandardEquipment as string // 检校标准装置 + itemCategoryId.value = $route.query.itemCategoryId as string // 核查项分类id + itemCategoryName.value = $route.query.itemCategoryName as string // 核查项分类名称 + if (props.pageType !== 'add') { + fetchInfo() + } +}) defineExpose({ fetchCheckItemDetail }) @@ -615,128 +1862,416 @@
时标
- + 计算结果
+ + + + + + +
方波电压(50Ω)
- + 计算结果
+ + - -
-
方波电压(10Ω)
- - 计算结果 - -
+ + +
方波电压(1MΩ)
- + 计算结果
+ + + + + + +
直流电压(50Ω)
- + 计算结果
+ + + + + + +
直流电压(1MΩ)
- + 计算结果
+ + + + + + +
输入阻抗
- + 计算结果
+ + + + + + +
稳幅正弦信号电压平坦度
- + 计算结果
+ + + + + + +
上升时间
- + 计算结果
- + + + + + + + + + + + + + + + diff --git a/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts b/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts index 6001704..1fad7f9 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts +++ b/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts @@ -2,6 +2,7 @@ dataId: string // 核查数据管理基础信息表id id: string // id checkType: string // 核查类型(字典value) + editable?: boolean // 是否可编辑 params?: string // 核查项目(字典value) checkPoint?: string // 核查点/快沿(上升时间)(字典value) diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue new file mode 100644 index 0000000..263ff3c --- /dev/null +++ b/src/views/equipement/standard/checkData/components/thirteenth/11.vue @@ -0,0 +1,79 @@ + diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index e6eebf6..f34605c 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -3,28 +3,42 @@ import { ref, watch } from 'vue' import { ElLoading, ElMessage } from 'element-plus' import saveCheckRecord from '../../dialog/saveCheckRecord.vue' +import { clearDateValue, handleDetailTableTableHead, handleSaveDateParams, solveHistoryIndicationTableData } from '../useStabilityCaculate' import type { IList } from './thirteenth-interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import useUserStore from '@/store/modules/user' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' +import { useCheckList } from '@/commonMethods/useCheckList' import multiTable from '@/components/MultiHeaderTable/index.vue' -// import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' -// import { addCheckData, calculateHandle, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' +import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' +import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' +const props = defineProps({ + selectStandardId: { // 选择的标准装置id + type: String, + }, + pageType: { // 页面类型 + type: String, + }, + checkDate: { // 核查日期 + type: String, + }, +}) const user = useUserStore() // 用户信息 const $router = useRouter() // 关闭页面使用 const $route = useRoute() // 路由参数 -const pageType = ref('add') // 页面类型: add, edit, detail const infoId = ref('') -const belongStandardEquipment = ref('9') +const belongStandardEquipment = ref('13') const itemCategoryId = ref('') // 核查项分类id const itemCategoryName = ref('') // 核查项分类名称 - +const form = ref({ + remark: '/', // 备注 +}) +const equipmentId = ref('') // 设备id +const dateArrStability = ref([]) // 稳定性日期数组 +const currentDate = ref('') // 要查询历史稳定性的日期 // ----------------------------------路由参数------------------------------------------------ if ($route.params && $route.params.type) { - pageType.value = $route.params.type as string - console.log(pageType.value) - if ($route.params.id) { infoId.value = $route.params.id as string } @@ -42,7 +56,7 @@ text: '测量值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '160', children: [ { text: 'X1', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -57,8 +71,8 @@ { text: 'X10', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) const columns_repeatability_voltage_flatness = ref([ // 重复性表头--稳幅正弦信号电压平坦度 { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, @@ -70,7 +84,7 @@ text: 'X1', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -82,7 +96,7 @@ text: 'X2', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -94,7 +108,7 @@ text: 'X3', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -106,7 +120,7 @@ text: 'X4', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -118,7 +132,7 @@ text: 'X5', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -130,7 +144,7 @@ text: 'X6', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -142,7 +156,7 @@ text: 'X7', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -154,7 +168,7 @@ text: 'X8', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -166,7 +180,7 @@ text: 'X9', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -178,7 +192,7 @@ text: 'X10', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { text: '测量值', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, @@ -186,8 +200,8 @@ { text: '平坦度/%', value: 'flatnessTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '重复性S(x)', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) const columns_repeatability_risetime = ref([ // 重复性表头--上升时间 @@ -206,7 +220,7 @@ text: '核查点均值', value: '-', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -217,10 +231,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_timeMark_checkDate = ref([ // 稳定性表头--时标 + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: '-', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 方波电压(50Ω)--稳定性 const columns_stability_squareWaveVoltage50Ω = ref([ @@ -230,7 +267,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -241,10 +278,34 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +// 方波电压(50Ω)--稳定性 +const columns_stability_squareWaveVoltage50Ω_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 方波电压(1MΩ)--稳定性 const columns_stability_squareWaveVoltage1MΩ = ref([ @@ -254,7 +315,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -265,10 +326,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_squareWaveVoltage1MΩ_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 直流电压(50Ω)--稳定性 const columns_stability_directVoltage50Ω = ref([ @@ -278,7 +362,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -289,10 +373,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_directVoltage50Ω_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 直流电压(1MΩ)--稳定性 const columns_stability_directVoltage1MΩ = ref([ @@ -302,7 +409,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -313,10 +420,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_directVoltage1MΩ_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 输入阻抗--稳定性 const columns_stability_inputImpedance = ref([ @@ -326,7 +456,7 @@ text: '核查点均值', value: 'indicatingValue', align: 'center', - required: true, + required: false, width: '180', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -337,10 +467,33 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_inputImpedance_checkDate = ref([ + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: 'indicatingValue', + align: 'center', + required: false, + width: '180', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 稳幅正弦信号电压平坦度--稳定性 const columns_stability_voltage_flatness = ref([ // 稳定性表头--稳幅正弦信号电压平坦度 @@ -351,7 +504,7 @@ text: '核查点均值', value: '-', align: 'center', - required: true, + required: false, width: '160', children: [ { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, @@ -362,21 +515,45 @@ { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: true, type: 'text' }, - { text: '稳定性', value: 'stability', align: 'center', required: true, type: 'text' }, - { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, +]) +const columns_stability_voltage_flatness_checkDate = ref([ // 稳定性表头--稳幅正弦信号电压平坦度 + { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, + { text: '类型', value: 'typeValue', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { + text: '核查点均值', + value: '-', + align: 'center', + required: false, + width: '160', + children: [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ], + }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '稳定性', value: 'stability', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差的绝对值', value: 'maximumErrorAbsoluteDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 上升时间--稳定性 const columns_stability_risetime = ref([ // 稳定性表头--上升时间 - { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '快沿', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, - { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: true, type: 'text' }, - { text: '探头设备名称', value: 'equipmentName', align: 'center', required: true, type: 'text' }, - { text: '探头规格型号', value: 'model', align: 'center', required: true, type: 'text' }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true, type: 'text' }, - { text: '技术指标', value: 'technicalIndexDefineFront', align: 'center', required: true, type: 'text' }, - { text: '结论', value: 'conclusion', align: 'center', required: true, type: 'text' }, + { text: '核查项目', value: 'params', align: 'center', required: false, type: 'text' }, + { text: '快沿', value: 'checkPointDefineFront', align: 'center', required: false, type: 'text' }, + { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false, type: 'text' }, + { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false, type: 'text' }, + { text: '探头规格型号', value: 'model', align: 'center', required: false, type: 'text' }, + { text: '测量值', value: 'testValueOne', align: 'center', required: false, type: 'text' }, + { text: '技术指标', value: 'technicalIndexDefineFront', align: 'center', required: false, type: 'text' }, + { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) const listTimeMarkRepeatability = ref([]) // 时标-重复性 @@ -388,32 +565,49 @@ const listVoltageFlatnessRepeatability = ref([]) // 稳幅正弦信号电压平坦度-重复性 const listRisetimeRepeatability = ref([]) // 上升时间-重复性 -const listTimeMarkRepeatabilityLoading = ref([]) // 时标-重复性Loading -const listSquareWaveVoltage50ΩRepeatabilityLoading = ref([]) // 方波电压(50Ω)-重复性Loading -const listSquareWaveVoltage1MΩRepeatabilityLoading = ref([]) // 方波电压(1MΩ)-重复性Loading -const listDirectVoltage50ΩRepeatabilityLoading = ref([]) // 直流电压(50Ω)-重复性Loading -const listDirectVoltage1MΩRepeatabilityLoading = ref([]) // 直流电压(1MΩ)-重复性Loading -const listInputImpedanceRepeatabilityLoading = ref([]) // 输入阻抗-重复性Loading -const listVoltageFlatnessRepeatabilityLoading = ref([]) // 稳幅正弦信号电压平坦度-重复性Loading -const listRisetimeRepeatabilityLoading = ref([]) // 上升时间-重复性Loading +const listTimeMarkRepeatabilityLoading = ref(false) // 时标-重复性Loading +const listSquareWaveVoltage50ΩRepeatabilityLoading = ref(false) // 方波电压(50Ω)-重复性Loading +const listSquareWaveVoltage1MΩRepeatabilityLoading = ref(false) // 方波电压(1MΩ)-重复性Loading +const listDirectVoltage50ΩRepeatabilityLoading = ref(false) // 直流电压(50Ω)-重复性Loading +const listDirectVoltage1MΩRepeatabilityLoading = ref(false) // 直流电压(1MΩ)-重复性Loading +const listInputImpedanceRepeatabilityLoading = ref(false) // 输入阻抗-重复性Loading +const listVoltageFlatnessRepeatabilityLoading = ref(false) // 稳幅正弦信号电压平坦度-重复性Loading +const listRisetimeRepeatabilityLoading = ref(false) // 上升时间-重复性Loading -const listTimeMarkStability = ref([]) // 时标-稳定性 -const listSquareWaveVoltage50ΩStability = ref([]) // 方波电压(50Ω)-稳定性 -const listSquareWaveVoltage1MΩStability = ref([]) // 方波电压(1MΩ)-稳定性 -const listDirectVoltage50ΩStability = ref([]) // 直流电压(50Ω)-稳定性 -const listDirectVoltage1MΩStability = ref([]) // 直流电压(1MΩ)-稳定性 -const listInputImpedanceStability = ref([]) // 输入阻抗-稳定性 -const listVoltageFlatnessStability = ref([]) // 稳幅正弦信号电压平坦度-稳定性 -const listRisetimeStability = ref([]) // 上升时间-稳定性 +const listTimeMarkStability = ref([]) // 时标-稳定性 +const listSquareWaveVoltage50ΩStability = ref([]) // 方波电压(50Ω)-稳定性 +const listSquareWaveVoltage1MΩStability = ref([]) // 方波电压(1MΩ)-稳定性 +const listDirectVoltage50ΩStability = ref([]) // 直流电压(50Ω)-稳定性 +const listDirectVoltage1MΩStability = ref([]) // 直流电压(1MΩ)-稳定性 +const listInputImpedanceStability = ref([]) // 输入阻抗-稳定性 +const listVoltageFlatnessStability = ref([]) // 稳幅正弦信号电压平坦度-稳定性 +const listRisetimeStability = ref([]) // 上升时间-稳定性 -const listTimeMarkStabilityLoading = ref([]) // 时标-稳定性Loading -const listSquareWaveVoltage50ΩStabilityLoading = ref([]) // 方波电压(50Ω)-稳定性Loading -const listSquareWaveVoltage1MΩStabilityLoading = ref([]) // 方波电压(1MΩ)-稳定性Loading -const listDirectVoltage50ΩStabilityLoading = ref([]) // 直流电压(50Ω)-稳定性Loading -const listDirectVoltage1MΩStabilityLoading = ref([]) // 直流电压(1MΩ)-稳定性Loading -const listInputImpedanceStabilityLoading = ref([]) // 输入阻抗-稳定性Loading -const listVoltageFlatnessStabilityLoading = ref([]) // 稳幅正弦信号电压平坦度-稳定性Loading -const listRisetimeStabilityLoading = ref([]) // 上升时间-稳定性Loading +const listTimeMarkStabilityLoading = ref(false) // 时标-稳定性Loading +const listSquareWaveVoltage50ΩStabilityLoading = ref(false) // 方波电压(50Ω)-稳定性Loading +const listSquareWaveVoltage1MΩStabilityLoading = ref(false) // 方波电压(1MΩ)-稳定性Loading +const listDirectVoltage50ΩStabilityLoading = ref(false) // 直流电压(50Ω)-稳定性Loading +const listDirectVoltage1MΩStabilityLoading = ref(false) // 直流电压(1MΩ)-稳定性Loading +const listInputImpedanceStabilityLoading = ref(false) // 输入阻抗-稳定性Loading +const listVoltageFlatnessStabilityLoading = ref(false) // 稳幅正弦信号电压平坦度-稳定性Loading +const listRisetimeStabilityLoading = ref(false) // 上升时间-稳定性Loading + +const listTimeMarkRepeatabilityCheckDate = ref([]) // 时标-重复性 +const listSquareWaveVoltage50ΩRepeatabilityCheckDate = ref([]) // 方波电压(50Ω)-重复性 +const listSquareWaveVoltage1MΩRepeatabilityCheckDate = ref([]) // 方波电压(1MΩ)-重复性 +const listDirectVoltage50ΩRepeatabilityCheckDate = ref([]) // 直流电压(50Ω)-重复性 +const listDirectVoltage1MΩRepeatabilityCheckDate = ref([]) // 直流电压(1MΩ)-重复性 +const listInputImpedanceRepeatabilityCheckDate = ref([]) // 输入阻抗-重复性 +const listVoltageFlatnessRepeatabilityCheckDate = ref([]) // 稳幅正弦信号电压平坦度-重复性 +const listRisetimeRepeatabilityCheckDate = ref([]) // 上升时间-重复性 +const listTimeMarkStabilityCheckDate = ref([]) // 时标-稳定性 +const listSquareWaveVoltage50ΩStabilityCheckDate = ref([]) // 方波电压(50Ω)-稳定性 +const listSquareWaveVoltage1MΩStabilityCheckDate = ref([]) // 方波电压(1MΩ)-稳定性 +const listDirectVoltage50ΩStabilityCheckDate = ref([]) // 直流电压(50Ω)-稳定性 +const listDirectVoltage1MΩStabilityCheckDate = ref([]) // 直流电压(1MΩ)-稳定性 +const listInputImpedanceStabilityCheckDate = ref([]) // 输入阻抗-稳定性 +const listVoltageFlatnessStabilityCheckDate = ref([]) // 稳幅正弦信号电压平坦度-稳定性 +const listRisetimeStabilityCheckDate = ref([]) // 上升时间-稳定性 // 获取配置详情 function fetchCheckItemDetail(equipmentId: string, belongStandardEquipmentParam: string, itemCategoryIdParam: string, itemCategoryNameParam: string) { @@ -432,19 +626,20 @@ } getCheckItemDetail(params).then((res) => { loading.close() - handleData(res.data.checkItemDataResistanceThermometerList) - fetchHistoryIndication() // 获取稳定性 + handleData(res.data.checkItemDataOscilloscopeList) + // fetchHistoryIndication() // 获取稳定性 + fetchHistoryIndication('时标') // 重新拉取稳定性 + fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性 + fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性 + fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性 + fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性 + fetchHistoryIndication('输入阻抗') // 重新拉取稳定性 + fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性 }) } // 初始化数据(查询配置检定项) function handleData(list: any, type = 'edit') { - const listSquareWaveVoltage1MΩRepeatability = ref([]) // 方波电压(1MΩ)-重复性 - const listDirectVoltage50ΩRepeatability = ref([]) // 直流电压(50Ω)-重复性 - const listDirectVoltage1MΩRepeatability = ref([]) // 直流电压(1MΩ)-重复性 - const listInputImpedanceRepeatability = ref([]) // 输入阻抗-重复性 - const listVoltageFlatnessRepeatability = ref([]) // 稳幅正弦信号电压平坦度-重复性 - const listRisetimeRepeatability = ref([]) // 上升时间-重复性 // 时标 listTimeMarkRepeatability.value = list.filter((item: { params: string }) => item.params === '时标') // 时标重复性 @@ -463,10 +658,21 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } - }) + }) as any // 时标稳定性 - listTimeMarkStability.value = listTimeMarkRepeatability.value.map((e) => { + listTimeMarkStability.value = listTimeMarkRepeatability.value.map((e: any) => { return { editable: props.pageType !== 'detail', dataId: e.dataId, // 核查数据管理基础信息表id @@ -507,7 +713,7 @@ } }) // 方波电压(50Ω)稳定性 - listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩRepeatability.value.map((e) => { + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩRepeatability.value.map((e: any) => { return { editable: props.pageType !== 'detail', dataId: e.dataId, // 核查数据管理基础信息表id @@ -547,7 +753,7 @@ } }) // 方波电压(1MΩ)稳定性 - listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩRepeatability.value.map((e) => { + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩRepeatability.value.map((e: any) => { return { editable: props.pageType !== 'detail', dataId: e.dataId, // 核查数据管理基础信息表id @@ -565,40 +771,1081 @@ conclusion: '', // 结论 } }) + + // 直流电压(50Ω) + listDirectVoltage50ΩRepeatability.value = list.filter((item: { params: string }) => item.params === '直流电压(50Ω)') + // 直流电压(50Ω)重复性 + listDirectVoltage50ΩRepeatability.value = listDirectVoltage50ΩRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + } + }) + // 直流电压(50Ω)稳定性 + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 直流电压(1MΩ) + listDirectVoltage1MΩRepeatability.value = list.filter((item: { params: string }) => item.params === '直流电压(1MΩ)') + // 直流电压(1MΩ)重复性 + listDirectVoltage1MΩRepeatability.value = listDirectVoltage1MΩRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + } + }) + // 直流电压(1MΩ)稳定性 + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 输入阻抗 + listInputImpedanceRepeatability.value = list.filter((item: { params: string }) => item.params === '输入阻抗') + // 输入阻抗重复性 + listInputImpedanceRepeatability.value = listInputImpedanceRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + } + }) + // 输入阻抗稳定性 + listInputImpedanceStability.value = listInputImpedanceRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 稳幅正弦信号电压平坦度 + listVoltageFlatnessRepeatability.value = list.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') + // 稳幅正弦信号电压平坦度重复性 + listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + typeValue: e.typeValue, // 类型 + testValueUnit: 'mW', // 测量值单位 + convertVoltageUnit: 'V', // 转换为电压值单位 + checkPoint: e.checkPoint, // 核查点 + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + flatnessOne: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度1/% + flatnessTwo: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度2/% + flatnessThree: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度3/% + flatnessFour: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度4/% + flatnessFive: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度5/% + flatnessSix: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度6/% + flatnessSeven: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度7/% + flatnessEight: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度8/% + flatnessNine: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度9/% + flatnessTen: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度10/% + averageValue: '', // 平均值 + standardDeviation: '', // 重复性 + } + }) + // 稳幅正弦信号电压平坦度稳定性 + listVoltageFlatnessStability.value = listVoltageFlatnessRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, // 核查点 + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkType: '稳定性', + averageValue: '', // 平均值 + stability: '', // 稳定性 + maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 + maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 + maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + conclusion: '', // 结论 + } + }) + + // 上升时间 + listRisetimeRepeatability.value = list.filter((item: { params: string }) => item.params === '上升时间') + // 上升时间重复性 + listRisetimeRepeatability.value = listRisetimeRepeatability.value.map((e: any) => { + return { + editable: type === 'edit', + dataId: e.id, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + checkType: '重复性', + params: e.params, // 核查项目 + typeValue: e.typeValue, // 类型 + checkPoint: e.checkPoint, // 快沿 + unit: e.unit, // 快沿单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 快沿 + manufactureNo: e.manufactureNo, // 探头出厂编号 + equipmentName: e.equipmentName, // 探头设备名称 + model: e.model, // 探头规格型号 + testValueOne: '', // 测量值 + technicalIndex: e.technicalIndex, // 技术指标 + technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 + technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 + } + }) + // 上升时间稳定性 + listRisetimeStability.value = listRisetimeRepeatability.value.map((e: any) => { + return { + editable: props.pageType !== 'detail', + dataId: e.dataId, // 核查数据管理基础信息表id + id: '', // id,更新/删除使用参数 + params: e.params, // 核查项目 + checkPoint: e.checkPoint, // 快沿 + unit: e.unit, // 单位(直接存字典value) + checkPointDefineFront: e.checkPoint + e.unit, // 快沿 + checkType: '稳定性', + manufactureNo: e.manufactureNo, // 探头出厂编号 + equipmentName: e.equipmentName, // 探头设备名称 + model: e.model, // 探头规格型号 + testValueOne: '', // 测量值 + technicalIndex: e.technicalIndex, // 技术指标 + technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 + technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 + conclusion: '', // 结论 + } + }) } -// 点击生成结果处理 -const createResult = () => { - // +// 点击计算结果 +const createResult = (type: string) => { + let checkDataOscilloscopeListParams: any // 要传的重复或者稳定性参数 + if (current.value === 'stability') { // 计算稳定性 + switch (type) { + case '时标': + if (!listTimeMarkRepeatability.value.length) { + ElMessage.warning('时标 未配置重复性,请检查') + return false + } + if (`${listTimeMarkRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listTimeMarkStability.value + break + case '方波电压(50Ω)': + if (!listSquareWaveVoltage50ΩRepeatability.value.length) { + ElMessage.warning('方波电压(50Ω) 未配置重复性,请检查') + return false + } + if (`${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩStability.value + break + case '方波电压(1MΩ)': + if (!listSquareWaveVoltage1MΩRepeatability.value.length) { + ElMessage.warning('方波电压(1MΩ) 未配置重复性,请检查') + return false + } + if (`${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩStability.value + break + case '直流电压(50Ω)': + if (!listDirectVoltage50ΩRepeatability.value.length) { + ElMessage.warning('直流电压(50Ω) 未配置重复性,请检查') + return false + } + if (`${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listDirectVoltage50ΩStability.value + break + case '直流电压(1MΩ)': + if (!listDirectVoltage1MΩRepeatability.value.length) { + ElMessage.warning('直流电压(1MΩ) 未配置重复性,请检查') + return false + } + if (`${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listDirectVoltage1MΩStability.value + break + case '输入阻抗': + if (!listInputImpedanceRepeatability.value.length) { + ElMessage.warning('输入阻抗 未配置重复性,请检查') + return false + } + if (`${listInputImpedanceRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listInputImpedanceStability.value + break + case '稳幅正弦信号电压平坦度': + if (!listVoltageFlatnessRepeatability.value.length) { + ElMessage.warning('稳幅正弦信号电压平坦度 未配置重复性,请检查') + return false + } + if (`${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listVoltageFlatnessStability.value + break + case '上升时间': + if (!listRisetimeRepeatability.value.length) { + ElMessage.warning('上升时间 未配置重复性,请检查') + return false + } + if (`${listRisetimeRepeatability.value[0].averageValue}` === '') { + ElMessage.warning(`请先计算 ${type} 重复性`) + return false + } + checkDataOscilloscopeListParams = listRisetimeStability.value + break + default: + break + } + } + + if (current.value === 'repeatability') { + switch (type) { + case '时标': + if (!useCheckList(listTimeMarkRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listTimeMarkRepeatability.value + break + case '方波电压(50Ω)': + if (!useCheckList(listSquareWaveVoltage50ΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩRepeatability.value + break + case '方波电压(1MΩ)': + if (!useCheckList(listSquareWaveVoltage1MΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩRepeatability.value + break + case '直流电压(50Ω)': + if (!useCheckList(listDirectVoltage50ΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listDirectVoltage50ΩRepeatability.value + break + case '直流电压(1MΩ)': + if (!useCheckList(listDirectVoltage1MΩRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listDirectVoltage1MΩRepeatability.value + break + case '输入阻抗': + if (!useCheckList(listInputImpedanceRepeatability.value, columns_repeatability_timeMark.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listInputImpedanceRepeatability.value + break + case '稳幅正弦信号电压平坦度': + if (!useCheckList(listVoltageFlatnessRepeatability.value, columns_repeatability_voltage_flatness.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listVoltageFlatnessRepeatability.value + break + case '上升时间': + if (!useCheckList(listRisetimeRepeatability.value, columns_repeatability_risetime.value, `${type}-重复性`)) { + return false + } + checkDataOscilloscopeListParams = listRisetimeRepeatability.value + break + default: + break + } + } + + const params = { + belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 + checkDataOscilloscopeList: checkDataOscilloscopeListParams, + itemCategoryId: itemCategoryId.value, // 核查项分类id + itemCategoryName: itemCategoryName.value, // 核查项分类id + } + // 重复性Loading + listTimeMarkRepeatabilityLoading.value = type === '时标' && current.value === 'repeatability' + listSquareWaveVoltage50ΩRepeatabilityLoading.value = type === '方波电压(50Ω)' && current.value === 'repeatability' + listSquareWaveVoltage1MΩRepeatabilityLoading.value = type === '方波电压(1MΩ)' && current.value === 'repeatability' + listDirectVoltage50ΩRepeatabilityLoading.value = type === '直流电压(50Ω)' && current.value === 'repeatability' + listDirectVoltage1MΩRepeatabilityLoading.value = type === '直流电压(1MΩ)' && current.value === 'repeatability' + listInputImpedanceRepeatabilityLoading.value = type === '输入阻抗' && current.value === 'repeatability' + listVoltageFlatnessRepeatabilityLoading.value = type === '稳幅正弦信号电压平坦度' && current.value === 'repeatability' + listRisetimeRepeatabilityLoading.value = type === '上升时间' && current.value === 'repeatability' + // 稳定性loading + listTimeMarkStabilityLoading.value = type === '时标' && current.value === 'stability' + listSquareWaveVoltage50ΩStabilityLoading.value = type === '方波电压(50Ω)' && current.value === 'stability' + listSquareWaveVoltage1MΩStabilityLoading.value = type === '方波电压(1MΩ)' && current.value === 'stability' + listDirectVoltage50ΩStabilityLoading.value = type === '直流电压(50Ω)' && current.value === 'stability' + listDirectVoltage1MΩStabilityLoading.value = type === '直流电压(1MΩ)' && current.value === 'stability' + listInputImpedanceStabilityLoading.value = type === '输入阻抗' && current.value === 'stability' + listVoltageFlatnessStabilityLoading.value = type === '稳幅正弦信号电压平坦度' && current.value === 'stability' + listRisetimeStabilityLoading.value = type === '上升时间' && current.value === 'stability' + + calculateHandle(params).then((res) => { + const result = res.data.filter((item: { params: string }) => item.params === type).map((item: any) => { + return { + ...item, + checkPointDefineFront: item.checkPoint + item.unit, // 核查点 + editable: props.pageType !== 'detail', + } + }) + switch (type) { + case '时标': + if (current.value === 'repeatability') { // 重复性 + listTimeMarkRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listTimeMarkStability.value = listTimeMarkStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listTimeMarkRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listTimeMarkStability.value = result + } + break + case '方波电压(50Ω)': + if (current.value === 'repeatability') { // 重复性 + listSquareWaveVoltage50ΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listSquareWaveVoltage50ΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listSquareWaveVoltage50ΩStability.value = result + } + break + case '方波电压(1MΩ)': + if (current.value === 'repeatability') { // 重复性 + listSquareWaveVoltage1MΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listSquareWaveVoltage1MΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listSquareWaveVoltage1MΩStability.value = result + } + break + case '直流电压(50Ω)': + if (current.value === 'repeatability') { // 重复性 + listDirectVoltage50ΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listDirectVoltage50ΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listDirectVoltage50ΩStability.value = result + } + break + case '直流电压(1MΩ)': + if (current.value === 'repeatability') { // 重复性 + listDirectVoltage1MΩRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listDirectVoltage1MΩRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listDirectVoltage1MΩStability.value = result + } + break + case '输入阻抗': + if (current.value === 'repeatability') { // 重复性 + listInputImpedanceRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listInputImpedanceStability.value = listInputImpedanceStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listInputImpedanceRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listInputImpedanceStability.value = result + } + break + case '稳幅正弦信号电压平坦度': + if (current.value === 'repeatability') { // 重复性 + listVoltageFlatnessRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listVoltageFlatnessStability.value = listVoltageFlatnessStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listVoltageFlatnessRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listVoltageFlatnessStability.value = result + } + break + case '上升时间': + if (current.value === 'repeatability') { // 重复性 + listRisetimeRepeatability.value = result + // 填充稳定性最后一列的日期和数值 + listRisetimeStability.value = listRisetimeStability.value.map((item, index: number) => { + return { + ...item, + testValueSix: listRisetimeRepeatability.value[index].averageValue, // 测量差值 + testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + } + }) + } + else { // 稳定性 + listRisetimeStability.value = result + } + break + default: + break + } + + listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading + listSquareWaveVoltage50ΩRepeatabilityLoading.value = false // 方波电压(50Ω)-重复性Loading + listSquareWaveVoltage1MΩRepeatabilityLoading.value = false // 方波电压(1MΩ)-重复性Loading + listDirectVoltage50ΩRepeatabilityLoading.value = false // 直流电压(50Ω)-重复性Loading + listDirectVoltage1MΩRepeatabilityLoading.value = false // 直流电压(1MΩ)-重复性Loading + listInputImpedanceRepeatabilityLoading.value = false // 输入阻抗-重复性Loading + listVoltageFlatnessRepeatabilityLoading.value = false // 稳幅正弦信号电压平坦度-重复性Loading + listRisetimeRepeatabilityLoading.value = false // 上升时间-重复性Loading + + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }).catch(() => { + listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading + listSquareWaveVoltage50ΩRepeatabilityLoading.value = false // 方波电压(50Ω)-重复性Loading + listSquareWaveVoltage1MΩRepeatabilityLoading.value = false // 方波电压(1MΩ)-重复性Loading + listDirectVoltage50ΩRepeatabilityLoading.value = false // 直流电压(50Ω)-重复性Loading + listDirectVoltage1MΩRepeatabilityLoading.value = false // 直流电压(1MΩ)-重复性Loading + listInputImpedanceRepeatabilityLoading.value = false // 输入阻抗-重复性Loading + listVoltageFlatnessRepeatabilityLoading.value = false // 稳幅正弦信号电压平坦度-重复性Loading + listRisetimeRepeatabilityLoading.value = false // 上升时间-重复性Loading + + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }) } // ------------------------------------------------------------------------------------------ +// 处理详情数据 +const solveGetDetailData = (responseList: any) => { + console.log('处理详情数据', props.pageType) + const list = responseList.map((item: { editable: boolean }) => { + return { + ...item, + editable: props.pageType !== 'detail', + } + }) + + const listTimeMarkRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '时标') // 时标-重复性 + const listSquareWaveVoltage50ΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '方波电压(50Ω)') // 方波电压(50Ω)-重复性 + const listSquareWaveVoltage1MΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '方波电压(1MΩ)') // 方波电压(1MΩ)-重复性 + const listDirectVoltage50ΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '直流电压(50Ω)') // 直流电压(50Ω)-重复性 + const listDirectVoltage1MΩRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '直流电压(1MΩ)') // 直流电压(1MΩ)-重复性 + const listInputImpedanceRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '输入阻抗') // 输入阻抗-重复性 + const listVoltageFlatnessRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '稳幅正弦信号电压平坦度') // 稳幅正弦信号电压平坦度-重复性 + const listRisetimeRepeatability = list.filter((item: { params: string; checkType: string }) => item.checkType === '重复性' && item.params === '上升时间') // 上升时间-重复性 + + const listTimeMarkStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '时标') // 时标-稳定性 + const listSquareWaveVoltage50ΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '方波电压(50Ω)') // 方波电压(50Ω)-稳定性 + const listSquareWaveVoltage1MΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '方波电压(1MΩ)') // 方波电压(1MΩ)-稳定性 + const listDirectVoltage50ΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '直流电压(50Ω)') // 直流电压(50Ω)-稳定性 + const listDirectVoltage1MΩStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '直流电压(1MΩ)') // 直流电压(1MΩ)-稳定性 + const listInputImpedanceStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '输入阻抗') // 输入阻抗-稳定性 + const listVoltageFlatnessStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '稳幅正弦信号电压平坦度') // 稳幅正弦信号电压平坦度-稳定性 + const listRisetimeStability = list.filter((item: { params: string; checkType: string }) => item.checkType === '稳定性' && item.params === '上升时间') // 上升时间-稳定性 + + return { + templistTimeMarkRepeatability: listTimeMarkRepeatability, + templistSquareWaveVoltage50ΩRepeatability: listSquareWaveVoltage50ΩRepeatability, + templistSquareWaveVoltage1MΩRepeatability: listSquareWaveVoltage1MΩRepeatability, + templistDirectVoltage50ΩRepeatability: listDirectVoltage50ΩRepeatability, + templistDirectVoltage1MΩRepeatability: listDirectVoltage1MΩRepeatability, + templistInputImpedanceRepeatability: listInputImpedanceRepeatability, + templistVoltageFlatnessRepeatability: listVoltageFlatnessRepeatability, + templistRisetimeRepeatability: listRisetimeRepeatability, + + templistTimeMarkStability: listTimeMarkStability, + templistSquareWaveVoltage50ΩStability: listSquareWaveVoltage50ΩStability, + templistSquareWaveVoltage1MΩStability: listSquareWaveVoltage1MΩStability, + templistDirectVoltage50ΩStability: listDirectVoltage50ΩStability, + templistDirectVoltage1MΩStability: listDirectVoltage1MΩStability, + templistInputImpedanceStability: listInputImpedanceStability, + templistVoltageFlatnessStability: listVoltageFlatnessStability, + templistRisetimeStability: listRisetimeStability, + } +} // 获取详情 -function fetchInfo() { - // const loading = ElLoading.service({ - // lock: true, - // background: 'rgba(255, 255, 255, 0.8)', - // }) - // getInfo({ id: infoId.value }).then((res) => { - // form.value = { ...res.data } - // list.value = res.data.checkDataPistonGaugeList.map((item: any) => { - // return { - // ...item, - // editable: pageType.value !== 'detail', - // } - // }) - // loading.close() - // }) +function fetchInfo(id = '') { + const loading = ElLoading.service({ + lock: true, + background: 'rgba(255, 255, 255, 0.8)', + }) + getInfo({ id: id || infoId.value }).then((res) => { + form.value = { ...res.data } + equipmentId.value = res.data.equipmentId + const { + templistTimeMarkRepeatability, + templistSquareWaveVoltage50ΩRepeatability, + templistSquareWaveVoltage1MΩRepeatability, + templistDirectVoltage50ΩRepeatability, + templistDirectVoltage1MΩRepeatability, + templistInputImpedanceRepeatability, + templistVoltageFlatnessRepeatability, + templistRisetimeRepeatability, + + templistTimeMarkStability, + templistSquareWaveVoltage50ΩStability, + templistSquareWaveVoltage1MΩStability, + templistDirectVoltage50ΩStability, + templistDirectVoltage1MΩStability, + templistInputImpedanceStability, + templistVoltageFlatnessStability, + templistRisetimeStability, + } = solveGetDetailData(res.data.checkDataOscilloscopeList) + if (id !== '') { // 查询的日期获得的数据 + listTimeMarkRepeatabilityCheckDate.value = templistTimeMarkRepeatability + listSquareWaveVoltage50ΩRepeatabilityCheckDate.value = templistSquareWaveVoltage50ΩRepeatability + listSquareWaveVoltage1MΩRepeatabilityCheckDate.value = templistSquareWaveVoltage1MΩRepeatability + listDirectVoltage50ΩRepeatabilityCheckDate.value = templistDirectVoltage50ΩRepeatability + listDirectVoltage1MΩRepeatabilityCheckDate.value = templistDirectVoltage1MΩRepeatability + listInputImpedanceRepeatabilityCheckDate.value = templistInputImpedanceRepeatability + listVoltageFlatnessRepeatabilityCheckDate.value = templistVoltageFlatnessRepeatability + listRisetimeRepeatabilityCheckDate.value = templistRisetimeRepeatability + + listTimeMarkStabilityCheckDate.value = templistTimeMarkStability + listSquareWaveVoltage50ΩStabilityCheckDate.value = templistSquareWaveVoltage50ΩStability + listSquareWaveVoltage1MΩStabilityCheckDate.value = templistSquareWaveVoltage1MΩStability + listDirectVoltage50ΩStabilityCheckDate.value = templistDirectVoltage50ΩStability + listDirectVoltage1MΩStabilityCheckDate.value = templistDirectVoltage1MΩStability + listInputImpedanceStabilityCheckDate.value = templistInputImpedanceStability + listVoltageFlatnessStabilityCheckDate.value = templistVoltageFlatnessStability + listRisetimeStabilityCheckDate.value = templistRisetimeStability + } + else { + listTimeMarkRepeatability.value = templistTimeMarkRepeatability + listSquareWaveVoltage50ΩRepeatability.value = templistSquareWaveVoltage50ΩRepeatability + listSquareWaveVoltage1MΩRepeatability.value = templistSquareWaveVoltage1MΩRepeatability + listDirectVoltage50ΩRepeatability.value = templistDirectVoltage50ΩRepeatability + listDirectVoltage1MΩRepeatability.value = templistDirectVoltage1MΩRepeatability + listInputImpedanceRepeatability.value = templistInputImpedanceRepeatability + listVoltageFlatnessRepeatability.value = templistVoltageFlatnessRepeatability + listRisetimeRepeatability.value = templistRisetimeRepeatability + + listTimeMarkStability.value = templistTimeMarkStability + listSquareWaveVoltage50ΩStability.value = templistSquareWaveVoltage50ΩStability + listSquareWaveVoltage1MΩStability.value = templistSquareWaveVoltage1MΩStability + listDirectVoltage50ΩStability.value = templistDirectVoltage50ΩStability + listDirectVoltage1MΩStability.value = templistDirectVoltage1MΩStability + listInputImpedanceStability.value = templistInputImpedanceStability + listVoltageFlatnessStability.value = templistVoltageFlatnessStability + listRisetimeStability.value = templistRisetimeStability + } + + nextTick(() => { + if (id !== '') { // 稳定性表头---查询历史的稳定性日期数据 + const tempColumn = [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ] as any + columns_stability_timeMark.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_directVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_directVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_inputImpedance.value[2].children = [...tempColumn] + columns_stability_voltage_flatness.value[3].children = [...tempColumn] + + fetchHistoryIndication(currentDate.value) // 获取稳定性 + } + else { // 正常核查数据处理表头 + columns_stability_timeMark.value = handleDetailTableTableHead(columns_stability_timeMark.value, listTimeMarkRepeatability.value, 2) + columns_stability_squareWaveVoltage50Ω.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩRepeatability.value, 2) + columns_stability_squareWaveVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩRepeatability.value, 2) + columns_stability_directVoltage50Ω.value = handleDetailTableTableHead(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩRepeatability.value, 2) + columns_stability_directVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩRepeatability.value, 2) + columns_stability_inputImpedance.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listInputImpedanceRepeatability.value, 2) + columns_stability_voltage_flatness.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listVoltageFlatnessRepeatability.value, 3) + } + }) + + if (props.pageType === 'edit') { + fetchHistoryIndication('时标') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 + fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + } + loading.close() + }) +} + +/** + * 获取稳定性示值 + * @param date 查询日期 + */ +function fetchHistoryIndication(type: string, date = '') { + const params = { + belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) + checkDate: date || props.checkDate!, // 核查日期 + checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) + conclusion: '是', // 结论 + equipmentId: equipmentId.value, // 被核查设备id + params: type, // 核查项目 + stabilityExamine: '1', // 是否用于稳定性考核(1/0) + standardEquipmentId: props.selectStandardId!, // 被核查标准装置id + } + if (props.selectStandardId && equipmentId.value) { + switch (type) { + case '时标': + listTimeMarkStabilityLoading.value = true + break + case '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityLoading.value = true + break + case '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStabilityLoading.value = true + break + case '直流电压(50Ω)': + listDirectVoltage50ΩStabilityLoading.value = true + break + case '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityLoading.value = true + break + case '输入阻抗': + listInputImpedanceStabilityLoading.value = true + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityLoading.value = true + break + case '上升时间': + listRisetimeStabilityLoading.value = true + break + default: + break + } + getHistoryIndication(params).then((res) => { + if (date === '') { // 正常核查数据 + const num = props.pageType === 'edit' ? 5 : 4 + switch (type) { + case '时标': + listTimeMarkRepeatability.value = listTimeMarkRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_timeMark.value, num, 2) + columns_stability_timeMark.value = columnsData + return item = itemData + }) + listTimeMarkRepeatability.value = handleSaveDateParams(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + break + case '方波电压(50Ω)': + listSquareWaveVoltage50ΩRepeatability.value = listSquareWaveVoltage50ΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_squareWaveVoltage50Ω.value, num, 2) + columns_stability_squareWaveVoltage50Ω.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩRepeatability.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + break + case '方波电压(1MΩ)': + listSquareWaveVoltage1MΩRepeatability.value = listSquareWaveVoltage1MΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_squareWaveVoltage1MΩ.value, num, 2) + columns_stability_squareWaveVoltage1MΩ.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩRepeatability.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + break + case '直流电压(50Ω)': + listDirectVoltage50ΩRepeatability.value = listDirectVoltage50ΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage50Ω.value, num, 2) + columns_stability_directVoltage50Ω.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩRepeatability.value = handleSaveDateParams(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + break + case '直流电压(1MΩ)': + listDirectVoltage1MΩRepeatability.value = listDirectVoltage1MΩRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage1MΩ.value, num, 2) + columns_stability_directVoltage1MΩ.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩRepeatability.value = handleSaveDateParams(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + break + case '输入阻抗': + listInputImpedanceRepeatability.value = listInputImpedanceRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_inputImpedance.value, num, 2) + columns_stability_inputImpedance.value = columnsData + return item = itemData + }) + listInputImpedanceRepeatability.value = handleSaveDateParams(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_voltage_flatness.value, num, 3) + columns_stability_voltage_flatness.value = columnsData + return item = itemData + }) + listVoltageFlatnessRepeatability.value = handleSaveDateParams(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) + break + default: + break + } + } + else { + const num = props.pageType === 'edit' ? 5 : 4 + switch (type) { + case '时标': + listTimeMarkStabilityCheckDate.value = listTimeMarkStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_timeMark_checkDate.value, 5, 2) + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listTimeMarkStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listTimeMarkStabilityCheckDate.value, 2) + break + case '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityCheckDate.value = listSquareWaveVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_timeMark_checkDate.value, 5, 2) + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listSquareWaveVoltage50ΩStabilityCheckDate.value, 2) + break + case '方波电压(1MΩ)': + listSquareWaveVoltage1MΩRepeatabilityCheckDate.value = listSquareWaveVoltage1MΩRepeatabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_squareWaveVoltage1MΩ_checkDate.value, 5, 2) + columns_stability_squareWaveVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩRepeatabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ_checkDate.value, listSquareWaveVoltage1MΩRepeatabilityCheckDate.value, 2) + break + case '直流电压(50Ω)': + listDirectVoltage50ΩStabilityCheckDate.value = listDirectVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage50Ω_checkDate.value, 5, 2) + columns_stability_directVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage50Ω_checkDate.value, listDirectVoltage50ΩStabilityCheckDate.value, 2) + break + case '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityCheckDate.value = listDirectVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_directVoltage1MΩ_checkDate.value, 5, 2) + columns_stability_directVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage1MΩ_checkDate.value, listDirectVoltage1MΩStabilityCheckDate.value, 2) + break + case '输入阻抗': + listInputImpedanceStabilityCheckDate.value = listInputImpedanceStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_inputImpedance_checkDate.value, 5, 2) + columns_stability_inputImpedance_checkDate.value = columnsData + return item = itemData + }) + listInputImpedanceStabilityCheckDate.value = handleSaveDateParams(columns_stability_inputImpedance_checkDate.value, listInputImpedanceStabilityCheckDate.value, 2) + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityCheckDate.value = listVoltageFlatnessStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_voltage_flatness_checkDate.value, 5, 3) + columns_stability_voltage_flatness_checkDate.value = columnsData + return item = itemData + }) + listVoltageFlatnessStabilityCheckDate.value = handleSaveDateParams(columns_stability_voltage_flatness_checkDate.value, listVoltageFlatnessStabilityCheckDate.value, 3) + break + default: + break + } + } + + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }).catch(() => { + listTimeMarkStabilityLoading.value = false // 时标-稳定性Loading + listSquareWaveVoltage50ΩStabilityLoading.value = false // 方波电压(50Ω)-稳定性Loading + listSquareWaveVoltage1MΩStabilityLoading.value = false // 方波电压(1MΩ)-稳定性Loading + listDirectVoltage50ΩStabilityLoading.value = false // 直流电压(50Ω)-稳定性Loading + listDirectVoltage1MΩStabilityLoading.value = false // 直流电压(1MΩ)-稳定性Loading + listInputImpedanceStabilityLoading.value = false // 输入阻抗-稳定性Loading + listVoltageFlatnessStabilityLoading.value = false // 稳幅正弦信号电压平坦度-稳定性Loading + listRisetimeStabilityLoading.value = false // 上升时间-稳定性Loading + }) + } +} + +/** + * 保存之前的校验 + */ +function checkList() { + // 新建核查数据的时候,在保存之前要先校验一下本次核查日期有没有数据,没有不允许保存 + if (listTimeMarkRepeatability.value.length && `${listTimeMarkRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 时标 的重复性') + return false + } + if (listSquareWaveVoltage50ΩRepeatability.value.length && `${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 方波电压(50Ω) 重复性') + return false + } + if (listSquareWaveVoltage1MΩRepeatability.value.length && `${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 方波电压(1MΩ) 重复性') + return false + } + if (listDirectVoltage50ΩRepeatability.value.length && `${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 直流电压(50Ω) 重复性') + return false + } + if (listDirectVoltage1MΩRepeatability.value.length && `${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 直流电压(1MΩ) 重复性') + return false + } + if (listInputImpedanceRepeatability.value.length && `${listInputImpedanceRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 输入阻抗 重复性') + return false + } + if (listVoltageFlatnessRepeatability.value.length && `${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { + ElMessage.warning('请先计算 稳幅正弦信号电压平坦度 重复性') + return false + } + return true +} + +// 点击表头日期查询历史稳定性数据 +const handleClickHeader = (val: any, checkDateDetailId: string) => { + dateArrStability.value = ['核查数据', val.label] + fetchInfo(checkDateDetailId) // 获取此次历史日期的详情 +} + +// 日期变化 +const handleChangeRadio = (date: string) => { + currentDate.value = date } // -------------------------------------钩子----------------------------------------------------- +// 统计日期 +const dateCount = (columns: TableColumn[]) => { + let dateNum = 0 // 稳定性表格有几个日期 -onMounted(async () => { - if (pageType.value !== 'add') { - // fetchInfo() + // 统计有几个日期 + columns[3].children?.forEach((item) => { + if (item.text !== '-' && item.text !== '') { + dateNum += 1 + } + }) + return dateNum +} + +watch(() => props.pageType, (newValue) => { + if (newValue === 'detail') { + listTimeMarkRepeatability.value = listTimeMarkRepeatability.value.map((item) => { item.editable = false; return item }) + listSquareWaveVoltage50ΩRepeatability.value = listSquareWaveVoltage50ΩRepeatability.value.map((item) => { item.editable = false; return item }) + listSquareWaveVoltage1MΩRepeatability.value = listSquareWaveVoltage1MΩRepeatability.value.map((item) => { item.editable = false; return item }) + listDirectVoltage50ΩRepeatability.value = listDirectVoltage50ΩRepeatability.value.map((item) => { item.editable = false; return item }) + listDirectVoltage1MΩRepeatability.value = listDirectVoltage1MΩRepeatability.value.map((item) => { item.editable = false; return item }) + listInputImpedanceRepeatability.value = listInputImpedanceRepeatability.value.map((item) => { item.editable = false; return item }) + listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((item) => { item.editable = false; return item }) + listRisetimeRepeatability.value = listRisetimeRepeatability.value.map((item) => { item.editable = false; return item }) } }) +/** + * 初始化表头 + * @param soveLastColumnDate 是否处理最后一列 + */ +function initColumns() { + const tempColumn = [ + { width: '180', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '180', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ] as any + columns_stability_timeMark.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_squareWaveVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_directVoltage50Ω.value[2].children = [...tempColumn] + columns_stability_directVoltage1MΩ.value[2].children = [...tempColumn] + columns_stability_inputImpedance.value[2].children = [...tempColumn] + columns_stability_voltage_flatness.value[3].children = [...tempColumn] + + columns_stability_timeMark.value[2].children![5].text = props.checkDate! // 最后一列的表头日期 + columns_stability_squareWaveVoltage50Ω.value[2].children![5].text = props.checkDate! // 最后一列的表头日期 + columns_stability_squareWaveVoltage1MΩ.value[2].children![5].text = props.checkDate! + columns_stability_directVoltage50Ω.value[2].children![5].text = props.checkDate! + columns_stability_directVoltage1MΩ.value[2].children![5].text = props.checkDate! + columns_stability_inputImpedance.value[2].children![5].text = props.checkDate! + columns_stability_voltage_flatness.value[3].children![5].text = props.checkDate! +} +// 监听核查日期变化 +watch(() => props.checkDate, (newValue) => { + initColumns() + nextTick(() => { + fetchHistoryIndication('时标') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 + fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 + fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 + fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + }) +}, { immediate: true }) + +watch(() => current.value, (value) => { + console.log('重复性') + console.log(listTimeMarkRepeatability.value) + console.log('稳定性') + console.log(listTimeMarkStability.value) + listTimeMarkRepeatability.value = [...listTimeMarkRepeatability.value] + listTimeMarkStability.value = [...listTimeMarkStability.value] +}) + +onMounted(async () => { + belongStandardEquipment.value = $route.query.belongStandardEquipment as string // 检校标准装置 + itemCategoryId.value = $route.query.itemCategoryId as string // 核查项分类id + itemCategoryName.value = $route.query.itemCategoryName as string // 核查项分类名称 + if (props.pageType !== 'add') { + fetchInfo() + } +}) defineExpose({ fetchCheckItemDetail }) @@ -615,128 +1862,416 @@
时标
- + 计算结果
+ + + + + + +
方波电压(50Ω)
- + 计算结果
+ + - -
-
方波电压(10Ω)
- - 计算结果 - -
+ + +
方波电压(1MΩ)
- + 计算结果
+ + + + + + +
直流电压(50Ω)
- + 计算结果
+ + + + + + +
直流电压(1MΩ)
- + 计算结果
+ + + + + + +
输入阻抗
- + 计算结果
+ + + + + + +
稳幅正弦信号电压平坦度
- + 计算结果
+ + + + + + +
上升时间
- + 计算结果
- + + + + + + + + + + + + + + + diff --git a/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts b/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts index 6001704..1fad7f9 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts +++ b/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts @@ -2,6 +2,7 @@ dataId: string // 核查数据管理基础信息表id id: string // id checkType: string // 核查类型(字典value) + editable?: boolean // 是否可编辑 params?: string // 核查项目(字典value) checkPoint?: string // 核查点/快沿(上升时间)(字典value) diff --git a/src/views/equipement/standard/checkData/detail.vue b/src/views/equipement/standard/checkData/detail.vue index 26b4677..21aa900 100644 --- a/src/views/equipement/standard/checkData/detail.vue +++ b/src/views/equipement/standard/checkData/detail.vue @@ -839,7 +839,7 @@ - +