diff --git a/src/views/equipement/standard/book/components/config/tenth/config.vue b/src/views/equipement/standard/book/components/config/tenth/config.vue index 5fc9d30..f662e17 100644 --- a/src/views/equipement/standard/book/components/config/tenth/config.vue +++ b/src/views/equipement/standard/book/components/config/tenth/config.vue @@ -9,6 +9,7 @@ import { config, getCheckItemDetail } from '@/api/equipment/standard/book' import { calc } from '@/utils/useCalc' import { getDictByCode } from '@/api/system/dict' +import { differenceArray } from '@/utils/Array' const textMap: { [key: string]: string } = { edit: '编辑', @@ -59,7 +60,7 @@ const checkoutPhaseList = ref([]) // 调相相偏多选 const checkoutFrequencySpectrumList = ref([]) // 谐波多选 -const frequency = ref(true) // 是否显示频率 +const frequency = ref(true) // 频率 const powerLevel = ref(true) // 功率 const relativeLevel = ref(true) // 相对电平 const AMDepth = ref(true) // 调幅度 @@ -122,7 +123,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true }, + { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true, width: '180' }, { text: '调频频偏单位', value: 'frequencyDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -141,7 +142,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true }, + { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true, width: '180' }, { text: '调相相偏单位', value: 'phaseDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -488,7 +489,13 @@ ElMessage.warning('谐波 不能为空') return false } - + let frequencyResult = true // 频率 + let powerLevelResult = true // 功率 + let relativeLevelResult = true // 相对电平 + let AMDepthResult = true // 调幅度 + let frequencyModulationDeviationResult = true // 调频频偏 + let phaseResult = true // 调相相偏 + let frequencySpectrumResult = true // 谐波 if (frequency.value) { frequencyResult = checkList(listFrequency.value, '频率') } @@ -595,12 +602,11 @@ // 点击保存 const save = () => { - if (!checkReferencePoint()) { return false } if (!checkListBeforeSave()) { return false } const list = solveDataBeforeSave() const params = { itemCategoryId: form.value.itemCategoryId, // 核查项分类id - checkItemDataOscilloscopeList: list, + checkItemDataSignalGeneratorList: list, equipmentId: equipmentId.value, } const loading = ElLoading.service({ @@ -762,7 +768,7 @@ 增加行 - + 删除行 @@ -780,7 +786,7 @@ 增加行 - + 删除行 @@ -798,7 +804,7 @@ 增加行 - + 删除行 @@ -816,7 +822,7 @@ 增加行 - + 删除行 @@ -834,7 +840,7 @@ 增加行 - + 删除行 @@ -852,7 +858,7 @@ 增加行 - + 删除行 @@ -870,7 +876,7 @@ 增加行 - + 删除行 diff --git a/src/views/equipement/standard/book/components/config/tenth/config.vue b/src/views/equipement/standard/book/components/config/tenth/config.vue index 5fc9d30..f662e17 100644 --- a/src/views/equipement/standard/book/components/config/tenth/config.vue +++ b/src/views/equipement/standard/book/components/config/tenth/config.vue @@ -9,6 +9,7 @@ import { config, getCheckItemDetail } from '@/api/equipment/standard/book' import { calc } from '@/utils/useCalc' import { getDictByCode } from '@/api/system/dict' +import { differenceArray } from '@/utils/Array' const textMap: { [key: string]: string } = { edit: '编辑', @@ -59,7 +60,7 @@ const checkoutPhaseList = ref([]) // 调相相偏多选 const checkoutFrequencySpectrumList = ref([]) // 谐波多选 -const frequency = ref(true) // 是否显示频率 +const frequency = ref(true) // 频率 const powerLevel = ref(true) // 功率 const relativeLevel = ref(true) // 相对电平 const AMDepth = ref(true) // 调幅度 @@ -122,7 +123,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true }, + { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true, width: '180' }, { text: '调频频偏单位', value: 'frequencyDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -141,7 +142,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true }, + { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true, width: '180' }, { text: '调相相偏单位', value: 'phaseDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -488,7 +489,13 @@ ElMessage.warning('谐波 不能为空') return false } - + let frequencyResult = true // 频率 + let powerLevelResult = true // 功率 + let relativeLevelResult = true // 相对电平 + let AMDepthResult = true // 调幅度 + let frequencyModulationDeviationResult = true // 调频频偏 + let phaseResult = true // 调相相偏 + let frequencySpectrumResult = true // 谐波 if (frequency.value) { frequencyResult = checkList(listFrequency.value, '频率') } @@ -595,12 +602,11 @@ // 点击保存 const save = () => { - if (!checkReferencePoint()) { return false } if (!checkListBeforeSave()) { return false } const list = solveDataBeforeSave() const params = { itemCategoryId: form.value.itemCategoryId, // 核查项分类id - checkItemDataOscilloscopeList: list, + checkItemDataSignalGeneratorList: list, equipmentId: equipmentId.value, } const loading = ElLoading.service({ @@ -762,7 +768,7 @@ 增加行 - + 删除行 @@ -780,7 +786,7 @@ 增加行 - + 删除行 @@ -798,7 +804,7 @@ 增加行 - + 删除行 @@ -816,7 +822,7 @@ 增加行 - + 删除行 @@ -834,7 +840,7 @@ 增加行 - + 删除行 @@ -852,7 +858,7 @@ 增加行 - + 删除行 @@ -870,7 +876,7 @@ 增加行 - + 删除行 diff --git a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue index 24703fb..727432c 100644 --- a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue +++ b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue @@ -38,22 +38,28 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 +const standardFrequencyUnitList = ref([]) // 频率单位公用 +const standardAmplitudeUnitList = ref([]) // 幅度单位公用 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 幅度单位公用 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -86,10 +92,6 @@ emit('change') } -// 多选选中结果 -function selectionChange(selection: []) { - emit('selectionChange', selection) -} // 点击行 function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) @@ -105,7 +107,7 @@ }) // 多选 const handleSelectionChange = (val: any) => { - emit('multiSelect', val) + emit('selectionChange', val) } // 清除多选选中 const clearMulti = () => { @@ -149,6 +151,110 @@ + diff --git a/src/views/equipement/standard/book/components/config/tenth/config.vue b/src/views/equipement/standard/book/components/config/tenth/config.vue index 5fc9d30..f662e17 100644 --- a/src/views/equipement/standard/book/components/config/tenth/config.vue +++ b/src/views/equipement/standard/book/components/config/tenth/config.vue @@ -9,6 +9,7 @@ import { config, getCheckItemDetail } from '@/api/equipment/standard/book' import { calc } from '@/utils/useCalc' import { getDictByCode } from '@/api/system/dict' +import { differenceArray } from '@/utils/Array' const textMap: { [key: string]: string } = { edit: '编辑', @@ -59,7 +60,7 @@ const checkoutPhaseList = ref([]) // 调相相偏多选 const checkoutFrequencySpectrumList = ref([]) // 谐波多选 -const frequency = ref(true) // 是否显示频率 +const frequency = ref(true) // 频率 const powerLevel = ref(true) // 功率 const relativeLevel = ref(true) // 相对电平 const AMDepth = ref(true) // 调幅度 @@ -122,7 +123,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true }, + { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true, width: '180' }, { text: '调频频偏单位', value: 'frequencyDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -141,7 +142,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true }, + { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true, width: '180' }, { text: '调相相偏单位', value: 'phaseDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -488,7 +489,13 @@ ElMessage.warning('谐波 不能为空') return false } - + let frequencyResult = true // 频率 + let powerLevelResult = true // 功率 + let relativeLevelResult = true // 相对电平 + let AMDepthResult = true // 调幅度 + let frequencyModulationDeviationResult = true // 调频频偏 + let phaseResult = true // 调相相偏 + let frequencySpectrumResult = true // 谐波 if (frequency.value) { frequencyResult = checkList(listFrequency.value, '频率') } @@ -595,12 +602,11 @@ // 点击保存 const save = () => { - if (!checkReferencePoint()) { return false } if (!checkListBeforeSave()) { return false } const list = solveDataBeforeSave() const params = { itemCategoryId: form.value.itemCategoryId, // 核查项分类id - checkItemDataOscilloscopeList: list, + checkItemDataSignalGeneratorList: list, equipmentId: equipmentId.value, } const loading = ElLoading.service({ @@ -762,7 +768,7 @@ 增加行 - + 删除行 @@ -780,7 +786,7 @@ 增加行 - + 删除行 @@ -798,7 +804,7 @@ 增加行 - + 删除行 @@ -816,7 +822,7 @@ 增加行 - + 删除行 @@ -834,7 +840,7 @@ 增加行 - + 删除行 @@ -852,7 +858,7 @@ 增加行 - + 删除行 @@ -870,7 +876,7 @@ 增加行 - + 删除行 diff --git a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue index 24703fb..727432c 100644 --- a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue +++ b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue @@ -38,22 +38,28 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 +const standardFrequencyUnitList = ref([]) // 频率单位公用 +const standardAmplitudeUnitList = ref([]) // 幅度单位公用 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 幅度单位公用 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -86,10 +92,6 @@ emit('change') } -// 多选选中结果 -function selectionChange(selection: []) { - emit('selectionChange', selection) -} // 点击行 function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) @@ -105,7 +107,7 @@ }) // 多选 const handleSelectionChange = (val: any) => { - emit('multiSelect', val) + emit('selectionChange', val) } // 清除多选选中 const clearMulti = () => { @@ -149,6 +151,110 @@ + diff --git a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue index 34d583a..478196e 100644 --- a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue @@ -786,7 +786,7 @@ const num = props.pageType === 'edit' ? 5 : 4 // 温度值 temperatureListStability.value = temperatureListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_temperature.value, num, 3) columns_stability_temperature.value = columnsData return item = itemData @@ -794,7 +794,7 @@ temperatureListStability.value = handleSaveDateParams(columns_stability_temperature.value, temperatureListStability.value, 3) // RTP值 RTPListStability.value = RTPListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_RTP.value, num, 3) columns_stability_RTP.value = columnsData return item = itemData diff --git a/src/views/equipement/standard/book/components/config/tenth/config.vue b/src/views/equipement/standard/book/components/config/tenth/config.vue index 5fc9d30..f662e17 100644 --- a/src/views/equipement/standard/book/components/config/tenth/config.vue +++ b/src/views/equipement/standard/book/components/config/tenth/config.vue @@ -9,6 +9,7 @@ import { config, getCheckItemDetail } from '@/api/equipment/standard/book' import { calc } from '@/utils/useCalc' import { getDictByCode } from '@/api/system/dict' +import { differenceArray } from '@/utils/Array' const textMap: { [key: string]: string } = { edit: '编辑', @@ -59,7 +60,7 @@ const checkoutPhaseList = ref([]) // 调相相偏多选 const checkoutFrequencySpectrumList = ref([]) // 谐波多选 -const frequency = ref(true) // 是否显示频率 +const frequency = ref(true) // 频率 const powerLevel = ref(true) // 功率 const relativeLevel = ref(true) // 相对电平 const AMDepth = ref(true) // 调幅度 @@ -122,7 +123,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true }, + { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true, width: '180' }, { text: '调频频偏单位', value: 'frequencyDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -141,7 +142,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true }, + { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true, width: '180' }, { text: '调相相偏单位', value: 'phaseDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -488,7 +489,13 @@ ElMessage.warning('谐波 不能为空') return false } - + let frequencyResult = true // 频率 + let powerLevelResult = true // 功率 + let relativeLevelResult = true // 相对电平 + let AMDepthResult = true // 调幅度 + let frequencyModulationDeviationResult = true // 调频频偏 + let phaseResult = true // 调相相偏 + let frequencySpectrumResult = true // 谐波 if (frequency.value) { frequencyResult = checkList(listFrequency.value, '频率') } @@ -595,12 +602,11 @@ // 点击保存 const save = () => { - if (!checkReferencePoint()) { return false } if (!checkListBeforeSave()) { return false } const list = solveDataBeforeSave() const params = { itemCategoryId: form.value.itemCategoryId, // 核查项分类id - checkItemDataOscilloscopeList: list, + checkItemDataSignalGeneratorList: list, equipmentId: equipmentId.value, } const loading = ElLoading.service({ @@ -762,7 +768,7 @@ 增加行 - + 删除行 @@ -780,7 +786,7 @@ 增加行 - + 删除行 @@ -798,7 +804,7 @@ 增加行 - + 删除行 @@ -816,7 +822,7 @@ 增加行 - + 删除行 @@ -834,7 +840,7 @@ 增加行 - + 删除行 @@ -852,7 +858,7 @@ 增加行 - + 删除行 @@ -870,7 +876,7 @@ 增加行 - + 删除行 diff --git a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue index 24703fb..727432c 100644 --- a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue +++ b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue @@ -38,22 +38,28 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 +const standardFrequencyUnitList = ref([]) // 频率单位公用 +const standardAmplitudeUnitList = ref([]) // 幅度单位公用 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 幅度单位公用 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -86,10 +92,6 @@ emit('change') } -// 多选选中结果 -function selectionChange(selection: []) { - emit('selectionChange', selection) -} // 点击行 function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) @@ -105,7 +107,7 @@ }) // 多选 const handleSelectionChange = (val: any) => { - emit('multiSelect', val) + emit('selectionChange', val) } // 清除多选选中 const clearMulti = () => { @@ -149,6 +151,110 @@ + diff --git a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue index 34d583a..478196e 100644 --- a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue @@ -786,7 +786,7 @@ const num = props.pageType === 'edit' ? 5 : 4 // 温度值 temperatureListStability.value = temperatureListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_temperature.value, num, 3) columns_stability_temperature.value = columnsData return item = itemData @@ -794,7 +794,7 @@ temperatureListStability.value = handleSaveDateParams(columns_stability_temperature.value, temperatureListStability.value, 3) // RTP值 RTPListStability.value = RTPListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_RTP.value, num, 3) columns_stability_RTP.value = columnsData return item = itemData diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue deleted file mode 100644 index 263ff3c..0000000 --- a/src/views/equipement/standard/checkData/components/thirteenth/11.vue +++ /dev/null @@ -1,79 +0,0 @@ - diff --git a/src/views/equipement/standard/book/components/config/tenth/config.vue b/src/views/equipement/standard/book/components/config/tenth/config.vue index 5fc9d30..f662e17 100644 --- a/src/views/equipement/standard/book/components/config/tenth/config.vue +++ b/src/views/equipement/standard/book/components/config/tenth/config.vue @@ -9,6 +9,7 @@ import { config, getCheckItemDetail } from '@/api/equipment/standard/book' import { calc } from '@/utils/useCalc' import { getDictByCode } from '@/api/system/dict' +import { differenceArray } from '@/utils/Array' const textMap: { [key: string]: string } = { edit: '编辑', @@ -59,7 +60,7 @@ const checkoutPhaseList = ref([]) // 调相相偏多选 const checkoutFrequencySpectrumList = ref([]) // 谐波多选 -const frequency = ref(true) // 是否显示频率 +const frequency = ref(true) // 频率 const powerLevel = ref(true) // 功率 const relativeLevel = ref(true) // 相对电平 const AMDepth = ref(true) // 调幅度 @@ -122,7 +123,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true }, + { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true, width: '180' }, { text: '调频频偏单位', value: 'frequencyDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -141,7 +142,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true }, + { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true, width: '180' }, { text: '调相相偏单位', value: 'phaseDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -488,7 +489,13 @@ ElMessage.warning('谐波 不能为空') return false } - + let frequencyResult = true // 频率 + let powerLevelResult = true // 功率 + let relativeLevelResult = true // 相对电平 + let AMDepthResult = true // 调幅度 + let frequencyModulationDeviationResult = true // 调频频偏 + let phaseResult = true // 调相相偏 + let frequencySpectrumResult = true // 谐波 if (frequency.value) { frequencyResult = checkList(listFrequency.value, '频率') } @@ -595,12 +602,11 @@ // 点击保存 const save = () => { - if (!checkReferencePoint()) { return false } if (!checkListBeforeSave()) { return false } const list = solveDataBeforeSave() const params = { itemCategoryId: form.value.itemCategoryId, // 核查项分类id - checkItemDataOscilloscopeList: list, + checkItemDataSignalGeneratorList: list, equipmentId: equipmentId.value, } const loading = ElLoading.service({ @@ -762,7 +768,7 @@ 增加行 - + 删除行 @@ -780,7 +786,7 @@ 增加行 - + 删除行 @@ -798,7 +804,7 @@ 增加行 - + 删除行 @@ -816,7 +822,7 @@ 增加行 - + 删除行 @@ -834,7 +840,7 @@ 增加行 - + 删除行 @@ -852,7 +858,7 @@ 增加行 - + 删除行 @@ -870,7 +876,7 @@ 增加行 - + 删除行 diff --git a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue index 24703fb..727432c 100644 --- a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue +++ b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue @@ -38,22 +38,28 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 +const standardFrequencyUnitList = ref([]) // 频率单位公用 +const standardAmplitudeUnitList = ref([]) // 幅度单位公用 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 幅度单位公用 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -86,10 +92,6 @@ emit('change') } -// 多选选中结果 -function selectionChange(selection: []) { - emit('selectionChange', selection) -} // 点击行 function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) @@ -105,7 +107,7 @@ }) // 多选 const handleSelectionChange = (val: any) => { - emit('multiSelect', val) + emit('selectionChange', val) } // 清除多选选中 const clearMulti = () => { @@ -149,6 +151,110 @@ + diff --git a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue index 34d583a..478196e 100644 --- a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue @@ -786,7 +786,7 @@ const num = props.pageType === 'edit' ? 5 : 4 // 温度值 temperatureListStability.value = temperatureListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_temperature.value, num, 3) columns_stability_temperature.value = columnsData return item = itemData @@ -794,7 +794,7 @@ temperatureListStability.value = handleSaveDateParams(columns_stability_temperature.value, temperatureListStability.value, 3) // RTP值 RTPListStability.value = RTPListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_RTP.value, num, 3) columns_stability_RTP.value = columnsData return item = itemData diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue deleted file mode 100644 index 263ff3c..0000000 --- a/src/views/equipement/standard/checkData/components/thirteenth/11.vue +++ /dev/null @@ -1,79 +0,0 @@ - diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index f7f9a68..8fb2bb1 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -13,6 +13,8 @@ import multiTable from '@/components/MultiHeaderTable/index.vue' import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' +import { useGroup } from '@/commonMethods/useGroup' + const props = defineProps({ selectStandardId: { // 选择的标准装置id type: String, @@ -33,6 +35,7 @@ const itemCategoryName = ref('') // 核查项分类名称 const form = ref({ remark: '/', // 备注 + qualified: '', // 稳定性考核是否合格 }) const equipmentId = ref('') // 设备id const dateArrStability = ref([]) // 稳定性日期数组 @@ -210,7 +213,7 @@ { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false }, { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false }, { text: '探头规格型号', value: 'model', align: 'center', required: false }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180' }, + { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '220' }, ]) const columns_stability_timeMark = ref([ // 稳定性表头--时标 @@ -627,14 +630,7 @@ getCheckItemDetail(params).then((res) => { loading.close() handleData(res.data.checkItemDataOscilloscopeList) - // fetchHistoryIndication() // 获取稳定性 - fetchHistoryIndication('时标') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性 + fetchHistoryIndication() // 重新拉取稳定性 }) } @@ -679,6 +675,7 @@ dataId: e.dataId, // 核查数据管理基础信息表id id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 + dataType: '1', checkPoint: e.checkPoint, unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 @@ -732,6 +729,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '2', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -783,6 +781,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '3', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -834,6 +833,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '4', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -885,6 +885,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '5', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -936,6 +937,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '6', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -1004,9 +1006,11 @@ params: e.params, // 核查项目 checkPoint: e.checkPoint, // 核查点 unit: e.unit, // 单位(直接存字典value) - checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkPointDefineFront: e.checkPointDefineFront, // 核查点 referencePoint: e.referencePoint, // 是否为参考点 checkType: '稳定性', + dataType: '7', + typeValue: e.typeValue, // 类型 averageValue: '', // 平均值 stability: '', // 稳定性 maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 @@ -1015,6 +1019,9 @@ conclusion: '', // 结论 } }) + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') // 上升时间 listRisetimeRepeatability.value = list.filter((item: { params: string }) => item.params === '上升时间') @@ -1035,6 +1042,7 @@ equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: '', // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1051,10 +1059,12 @@ unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 快沿 checkType: '稳定性', + dataType: '8', manufactureNo: e.manufactureNo, // 探头出厂编号 equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: e.testValueOne, // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1137,7 +1147,12 @@ const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 - checkDataOscilloscopeList: checkDataOscilloscopeListParams, + checkDataOscilloscopeList: checkDataOscilloscopeListParams.map((item: { conclusion: string }) => { + return { + ...item, + conclusion: '', + } + }), itemCategoryId: itemCategoryId.value, // 核查项分类id itemCategoryName: itemCategoryName.value, // 核查项分类id } @@ -1151,14 +1166,14 @@ 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' + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true calculateHandle(params).then((res) => { const result = res.data.filter((item: { params: string }) => item.params === type).map((item: any) => { @@ -1168,9 +1183,9 @@ editable: props.pageType !== 'detail', } }) - switch (type) { - case '时标': - if (current.value === 'repeatability') { // 重复性 + if (current.value === 'repeatability') { // 重复性 + switch (type) { + case '时标': listTimeMarkRepeatability.value = result // 填充稳定性最后一列的日期和数值 listTimeMarkStability.value = listTimeMarkStability.value.map((item, index: number) => { @@ -1180,13 +1195,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listTimeMarkStability.value = result - } - break - case '方波电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(50Ω)': listSquareWaveVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item, index: number) => { @@ -1196,13 +1206,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage50ΩStability.value = result - } - break - case '方波电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(1MΩ)': listSquareWaveVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item, index: number) => { @@ -1212,13 +1217,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage1MΩStability.value = result - } - break - case '直流电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(50Ω)': listDirectVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item, index: number) => { @@ -1228,13 +1228,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage50ΩStability.value = result - } - break - case '直流电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(1MΩ)': listDirectVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item, index: number) => { @@ -1244,13 +1239,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage1MΩStability.value = result - } - break - case '输入阻抗': - if (current.value === 'repeatability') { // 重复性 + break + case '输入阻抗': listInputImpedanceRepeatability.value = result // 填充稳定性最后一列的日期和数值 listInputImpedanceStability.value = listInputImpedanceStability.value.map((item, index: number) => { @@ -1260,14 +1250,9 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listInputImpedanceStability.value = result - } - break - case '稳幅正弦信号电压平坦度': - if (current.value === 'repeatability') { // 重复性 - listVoltageFlatnessRepeatability.value = result.map((item) => { + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessRepeatability.value = result.map((item: any) => { let tempCheckPoint = item.checkPoint + item.unit if (`${item.referencePoint}` === '1') { tempCheckPoint = `${tempCheckPoint}(参考)` @@ -1283,15 +1268,13 @@ ...item, testValueSix: listVoltageFlatnessRepeatability.value[index].averageValue, // 测量差值 testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + testValueUnit: listVoltageFlatnessRepeatability.value[index].testValueUnit, // 测量值单位 + convertVoltageUnit: listVoltageFlatnessRepeatability.value[index].convertVoltageUnit, // 转换为电压值单位 } }) - } - else { // 稳定性 - listVoltageFlatnessStability.value = result - } - break - case '上升时间': - if (current.value === 'repeatability') { // 重复性 + + break + case '上升时间': listRisetimeRepeatability.value = result // 填充稳定性最后一列的日期和数值 listRisetimeStability.value = listRisetimeStability.value.map((item, index: number) => { @@ -1301,13 +1284,42 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) + break + default: + break + } + } + else if (current.value === 'stability') { // 稳定性 + const resultList = res.data.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (item.params === '稳幅正弦信号电压平坦度' && `${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` } - else { // 稳定性 - listRisetimeStability.value = result + return { + ...item, + conclusion: (`${item.conclusion}` === '1' || `${item.conclusion}` === '') ? '合格' : '不合格', + checkPointDefineFront: tempCheckPoint, // 核查点 + editable: props.pageType !== 'detail', + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, } - break - default: - break + }) + + listTimeMarkStability.value = resultList.filter((item: { params: string }) => item.params === '时标') + listSquareWaveVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(50Ω)') + listSquareWaveVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(1MΩ)') + listDirectVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(50Ω)') + listDirectVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(1MΩ)') + listInputImpedanceStability.value = resultList.filter((item: { params: string }) => item.params === '输入阻抗') + listVoltageFlatnessStability.value = resultList.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') + listRisetimeStability.value = resultList.filter((item: { params: string }) => item.params === '上升时间') + + // 计算稳定性考核是否合格 + if (resultList.every((item: { conclusion: string | number }) => item.conclusion === '合格')) { + form.value.qualified = '合格' + } + else { + form.value.qualified = '不合格' + } } listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading @@ -1351,10 +1363,28 @@ // 处理详情数据 const solveGetDetailData = (responseList: any) => { console.log('处理详情数据', props.pageType) - const list = responseList.map((item: { editable: boolean }) => { + form.value.qualified = responseList[0].qualified === 1 ? '合格' : '不合格' + const list = responseList.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (`${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` + } return { ...item, editable: props.pageType !== 'detail', + checkPointDefineFront: tempCheckPoint, // 核查点 + conclusion: `${item.conclusion}` === '1' ? '合格' : '不合格', + testValueOne: item.checkType === '稳定性' ? item.testValueOne : Number(item.testValueOne), // 测量值1/测量值(上升时间) + testValueTwo: item.checkType === '稳定性' ? item.testValueTwo : Number(item.testValueTwo), // 测量值2(示值) + testValueThree: item.checkType === '稳定性' ? item.testValueThree : Number(item.testValueThree), // 测量值3(示值) + testValueFour: item.checkType === '稳定性' ? item.testValueFour : Number(item.testValueFour), // 测量值4(示值) + testValueFive: item.checkType === '稳定性' ? item.testValueFive : Number(item.testValueFive), // 测量值5(示值) + testValueSix: item.checkType === '稳定性' ? item.testValueSix : Number(item.testValueSix), // 测量值6(本次示值) + testValueSeven: item.checkType === '稳定性' ? item.testValueSeven : Number(item.testValueSeven), // 测量值7 + testValueEight: item.checkType === '稳定性' ? item.testValueEight : Number(item.testValueEight), // 测量值8 + testValueNine: item.checkType === '稳定性' ? item.testValueNine : Number(item.testValueNine), // 测量值9 + testValueTen: item.checkType === '稳定性' ? item.testValueTen : Number(item.testValueTen), // 测量值10 + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, // 技术指标 } }) @@ -1433,6 +1463,8 @@ listDirectVoltage1MΩRepeatabilityCheckDate.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatabilityCheckDate.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatabilityCheckDate.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatabilityCheckDate.value = useGroup(listVoltageFlatnessRepeatabilityCheckDate.value, 'typeValue') listRisetimeRepeatabilityCheckDate.value = templistRisetimeRepeatability listTimeMarkStabilityCheckDate.value = templistTimeMarkStability @@ -1442,6 +1474,8 @@ listDirectVoltage1MΩStabilityCheckDate.value = templistDirectVoltage1MΩStability listInputImpedanceStabilityCheckDate.value = templistInputImpedanceStability listVoltageFlatnessStabilityCheckDate.value = templistVoltageFlatnessStability + // 数据根据类型分组 + listVoltageFlatnessStabilityCheckDate.value = useGroup(listVoltageFlatnessStabilityCheckDate.value, 'typeValue') listRisetimeStabilityCheckDate.value = templistRisetimeStability } else { @@ -1452,6 +1486,8 @@ listDirectVoltage1MΩRepeatability.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatability.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatability.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') listRisetimeRepeatability.value = templistRisetimeRepeatability listTimeMarkStability.value = templistTimeMarkStability @@ -1461,6 +1497,7 @@ listDirectVoltage1MΩStability.value = templistDirectVoltage1MΩStability listInputImpedanceStability.value = templistInputImpedanceStability listVoltageFlatnessStability.value = templistVoltageFlatnessStability + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') listRisetimeStability.value = templistRisetimeStability } @@ -1485,24 +1522,18 @@ 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) + columns_stability_timeMark.value = handleDetailTableTableHead(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + columns_stability_squareWaveVoltage50Ω.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + columns_stability_squareWaveVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + columns_stability_directVoltage50Ω.value = handleDetailTableTableHead(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + columns_stability_directVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + columns_stability_inputImpedance.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + columns_stability_voltage_flatness.value = handleDetailTableTableHead(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) } }) if (props.pageType === 'edit') { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 } loading.close() }) @@ -1512,207 +1543,161 @@ * 获取稳定性示值 * @param date 查询日期 */ -function fetchHistoryIndication(type: string, date = '') { +function fetchHistoryIndication(date = '') { + if (!equipmentId.value || !props.selectStandardId) { return false } const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) checkDate: date || props.checkDate!, // 核查日期 checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) - conclusion: '是', // 结论 + conclusion: '合格', // 结论 equipmentId: equipmentId.value, // 被核查设备id - params: type, // 核查项目 + params: '', // 核查项目 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 - }) + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true } + getHistoryIndication(params).then((res) => { + if (date === '') { // 正常核查数据 + const num = props.pageType === 'edit' ? 5 : 4 + // '时标': + listTimeMarkStability.value = listTimeMarkStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark.value, num, 2, '13') + console.log('columnsData', columnsData[2]) + + columns_stability_timeMark.value = columnsData + return item = itemData + }) + listTimeMarkStability.value = handleSaveDateParams(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω.value, num, 2, '13') + columns_stability_directVoltage50Ω.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStability.value = handleSaveDateParams(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ.value, num, 2, '13') + columns_stability_directVoltage1MΩ.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStability.value = handleSaveDateParams(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + // '输入阻抗': + listInputImpedanceStability.value = listInputImpedanceStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance.value, num, 2, '13') + columns_stability_inputImpedance.value = columnsData + return item = itemData + }) + listInputImpedanceStability.value = handleSaveDateParams(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStability.value = listVoltageFlatnessStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness.value, num, 3, '13') + columns_stability_voltage_flatness.value = columnsData + return item = itemData + }) + listVoltageFlatnessStability.value = handleSaveDateParams(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) + } + else { + const num = 5 + // '时标': + listTimeMarkStabilityCheckDate.value = listTimeMarkStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark_checkDate.value, num, 2, '13') + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listTimeMarkStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listTimeMarkStabilityCheckDate.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityCheckDate.value = listSquareWaveVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω_checkDate.value, listSquareWaveVoltage50ΩStabilityCheckDate.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStabilityCheckDate.value = listSquareWaveVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ_checkDate.value, listSquareWaveVoltage1MΩStabilityCheckDate.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStabilityCheckDate.value = listDirectVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_directVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage50Ω_checkDate.value, listDirectVoltage50ΩStabilityCheckDate.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityCheckDate.value = listDirectVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_directVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage1MΩ_checkDate.value, listDirectVoltage1MΩStabilityCheckDate.value, 2) + // '输入阻抗': + listInputImpedanceStabilityCheckDate.value = listInputImpedanceStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance_checkDate.value, num, 2, '13') + columns_stability_inputImpedance_checkDate.value = columnsData + return item = itemData + }) + listInputImpedanceStabilityCheckDate.value = handleSaveDateParams(columns_stability_inputImpedance_checkDate.value, listInputImpedanceStabilityCheckDate.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityCheckDate.value = listVoltageFlatnessStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness_checkDate.value, num, 3, '13') + columns_stability_voltage_flatness_checkDate.value = columnsData + return item = itemData + }) + listVoltageFlatnessStabilityCheckDate.value = handleSaveDateParams(columns_stability_voltage_flatness_checkDate.value, listVoltageFlatnessStabilityCheckDate.value, 3) + } + + 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 + }) } /** @@ -1751,6 +1736,33 @@ return true } +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + + tempList = tempList.concat( + listTimeMarkRepeatability.value, // 时标-重复性 + listSquareWaveVoltage50ΩRepeatability.value, // 方波电压(50Ω)-重复性 + listSquareWaveVoltage1MΩRepeatability.value, // 方波电压(1MΩ)-重复性 + listDirectVoltage50ΩRepeatability.value, // 直流电压(50Ω)-重复性 + listDirectVoltage1MΩRepeatability.value, // 直流电压(1MΩ)-重复性 + listInputImpedanceRepeatability.value, // 输入阻抗-重复性 + listVoltageFlatnessRepeatability.value, // 稳幅正弦信号电压平坦度-重复性 + listRisetimeRepeatability.value, // 上升时间-重复性 + + listTimeMarkStability.value, // 时标-稳定性 + listSquareWaveVoltage50ΩStability.value, // 方波电压(50Ω)-稳定性 + listSquareWaveVoltage1MΩStability.value, // 方波电压(1MΩ)-稳定性 + listDirectVoltage50ΩStability.value, // 直流电压(50Ω)-稳定性 + listDirectVoltage1MΩStability.value, // 直流电压(1MΩ)-稳定性 + listInputImpedanceStability.value, // 输入阻抗-稳定性 + listVoltageFlatnessStability.value, // 稳幅正弦信号电压平坦度-稳定性 + listRisetimeStability.value, // 上升时间-稳定性 + ) + return tempList +} + // 点击表头日期查询历史稳定性数据 const handleClickHeader = (val: any, checkDateDetailId: string) => { dateArrStability.value = ['核查数据', val.label] @@ -1827,13 +1839,7 @@ watch(() => props.checkDate, (newValue) => { initColumns() nextTick(() => { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 }) }, { immediate: true }) @@ -1845,12 +1851,12 @@ fetchInfo() } }) -defineExpose({ fetchCheckItemDetail, checkList }) +defineExpose({ fetchCheckItemDetail, checkList, solveDataBeforeSave, form }) @@ -2274,6 +2285,32 @@ + + + + + + + + + + + + + + + diff --git a/src/views/equipement/standard/book/components/config/tenth/config.vue b/src/views/equipement/standard/book/components/config/tenth/config.vue index 5fc9d30..f662e17 100644 --- a/src/views/equipement/standard/book/components/config/tenth/config.vue +++ b/src/views/equipement/standard/book/components/config/tenth/config.vue @@ -9,6 +9,7 @@ import { config, getCheckItemDetail } from '@/api/equipment/standard/book' import { calc } from '@/utils/useCalc' import { getDictByCode } from '@/api/system/dict' +import { differenceArray } from '@/utils/Array' const textMap: { [key: string]: string } = { edit: '编辑', @@ -59,7 +60,7 @@ const checkoutPhaseList = ref([]) // 调相相偏多选 const checkoutFrequencySpectrumList = ref([]) // 谐波多选 -const frequency = ref(true) // 是否显示频率 +const frequency = ref(true) // 频率 const powerLevel = ref(true) // 功率 const relativeLevel = ref(true) // 相对电平 const AMDepth = ref(true) // 调幅度 @@ -122,7 +123,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true }, + { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true, width: '180' }, { text: '调频频偏单位', value: 'frequencyDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -141,7 +142,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true }, + { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true, width: '180' }, { text: '调相相偏单位', value: 'phaseDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -488,7 +489,13 @@ ElMessage.warning('谐波 不能为空') return false } - + let frequencyResult = true // 频率 + let powerLevelResult = true // 功率 + let relativeLevelResult = true // 相对电平 + let AMDepthResult = true // 调幅度 + let frequencyModulationDeviationResult = true // 调频频偏 + let phaseResult = true // 调相相偏 + let frequencySpectrumResult = true // 谐波 if (frequency.value) { frequencyResult = checkList(listFrequency.value, '频率') } @@ -595,12 +602,11 @@ // 点击保存 const save = () => { - if (!checkReferencePoint()) { return false } if (!checkListBeforeSave()) { return false } const list = solveDataBeforeSave() const params = { itemCategoryId: form.value.itemCategoryId, // 核查项分类id - checkItemDataOscilloscopeList: list, + checkItemDataSignalGeneratorList: list, equipmentId: equipmentId.value, } const loading = ElLoading.service({ @@ -762,7 +768,7 @@ 增加行 - + 删除行 @@ -780,7 +786,7 @@ 增加行 - + 删除行 @@ -798,7 +804,7 @@ 增加行 - + 删除行 @@ -816,7 +822,7 @@ 增加行 - + 删除行 @@ -834,7 +840,7 @@ 增加行 - + 删除行 @@ -852,7 +858,7 @@ 增加行 - + 删除行 @@ -870,7 +876,7 @@ 增加行 - + 删除行 diff --git a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue index 24703fb..727432c 100644 --- a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue +++ b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue @@ -38,22 +38,28 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 +const standardFrequencyUnitList = ref([]) // 频率单位公用 +const standardAmplitudeUnitList = ref([]) // 幅度单位公用 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 幅度单位公用 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -86,10 +92,6 @@ emit('change') } -// 多选选中结果 -function selectionChange(selection: []) { - emit('selectionChange', selection) -} // 点击行 function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) @@ -105,7 +107,7 @@ }) // 多选 const handleSelectionChange = (val: any) => { - emit('multiSelect', val) + emit('selectionChange', val) } // 清除多选选中 const clearMulti = () => { @@ -149,6 +151,110 @@ + diff --git a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue index 34d583a..478196e 100644 --- a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue @@ -786,7 +786,7 @@ const num = props.pageType === 'edit' ? 5 : 4 // 温度值 temperatureListStability.value = temperatureListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_temperature.value, num, 3) columns_stability_temperature.value = columnsData return item = itemData @@ -794,7 +794,7 @@ temperatureListStability.value = handleSaveDateParams(columns_stability_temperature.value, temperatureListStability.value, 3) // RTP值 RTPListStability.value = RTPListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_RTP.value, num, 3) columns_stability_RTP.value = columnsData return item = itemData diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue deleted file mode 100644 index 263ff3c..0000000 --- a/src/views/equipement/standard/checkData/components/thirteenth/11.vue +++ /dev/null @@ -1,79 +0,0 @@ - diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index f7f9a68..8fb2bb1 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -13,6 +13,8 @@ import multiTable from '@/components/MultiHeaderTable/index.vue' import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' +import { useGroup } from '@/commonMethods/useGroup' + const props = defineProps({ selectStandardId: { // 选择的标准装置id type: String, @@ -33,6 +35,7 @@ const itemCategoryName = ref('') // 核查项分类名称 const form = ref({ remark: '/', // 备注 + qualified: '', // 稳定性考核是否合格 }) const equipmentId = ref('') // 设备id const dateArrStability = ref([]) // 稳定性日期数组 @@ -210,7 +213,7 @@ { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false }, { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false }, { text: '探头规格型号', value: 'model', align: 'center', required: false }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180' }, + { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '220' }, ]) const columns_stability_timeMark = ref([ // 稳定性表头--时标 @@ -627,14 +630,7 @@ getCheckItemDetail(params).then((res) => { loading.close() handleData(res.data.checkItemDataOscilloscopeList) - // fetchHistoryIndication() // 获取稳定性 - fetchHistoryIndication('时标') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性 + fetchHistoryIndication() // 重新拉取稳定性 }) } @@ -679,6 +675,7 @@ dataId: e.dataId, // 核查数据管理基础信息表id id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 + dataType: '1', checkPoint: e.checkPoint, unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 @@ -732,6 +729,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '2', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -783,6 +781,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '3', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -834,6 +833,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '4', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -885,6 +885,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '5', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -936,6 +937,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '6', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -1004,9 +1006,11 @@ params: e.params, // 核查项目 checkPoint: e.checkPoint, // 核查点 unit: e.unit, // 单位(直接存字典value) - checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkPointDefineFront: e.checkPointDefineFront, // 核查点 referencePoint: e.referencePoint, // 是否为参考点 checkType: '稳定性', + dataType: '7', + typeValue: e.typeValue, // 类型 averageValue: '', // 平均值 stability: '', // 稳定性 maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 @@ -1015,6 +1019,9 @@ conclusion: '', // 结论 } }) + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') // 上升时间 listRisetimeRepeatability.value = list.filter((item: { params: string }) => item.params === '上升时间') @@ -1035,6 +1042,7 @@ equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: '', // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1051,10 +1059,12 @@ unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 快沿 checkType: '稳定性', + dataType: '8', manufactureNo: e.manufactureNo, // 探头出厂编号 equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: e.testValueOne, // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1137,7 +1147,12 @@ const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 - checkDataOscilloscopeList: checkDataOscilloscopeListParams, + checkDataOscilloscopeList: checkDataOscilloscopeListParams.map((item: { conclusion: string }) => { + return { + ...item, + conclusion: '', + } + }), itemCategoryId: itemCategoryId.value, // 核查项分类id itemCategoryName: itemCategoryName.value, // 核查项分类id } @@ -1151,14 +1166,14 @@ 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' + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true calculateHandle(params).then((res) => { const result = res.data.filter((item: { params: string }) => item.params === type).map((item: any) => { @@ -1168,9 +1183,9 @@ editable: props.pageType !== 'detail', } }) - switch (type) { - case '时标': - if (current.value === 'repeatability') { // 重复性 + if (current.value === 'repeatability') { // 重复性 + switch (type) { + case '时标': listTimeMarkRepeatability.value = result // 填充稳定性最后一列的日期和数值 listTimeMarkStability.value = listTimeMarkStability.value.map((item, index: number) => { @@ -1180,13 +1195,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listTimeMarkStability.value = result - } - break - case '方波电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(50Ω)': listSquareWaveVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item, index: number) => { @@ -1196,13 +1206,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage50ΩStability.value = result - } - break - case '方波电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(1MΩ)': listSquareWaveVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item, index: number) => { @@ -1212,13 +1217,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage1MΩStability.value = result - } - break - case '直流电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(50Ω)': listDirectVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item, index: number) => { @@ -1228,13 +1228,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage50ΩStability.value = result - } - break - case '直流电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(1MΩ)': listDirectVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item, index: number) => { @@ -1244,13 +1239,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage1MΩStability.value = result - } - break - case '输入阻抗': - if (current.value === 'repeatability') { // 重复性 + break + case '输入阻抗': listInputImpedanceRepeatability.value = result // 填充稳定性最后一列的日期和数值 listInputImpedanceStability.value = listInputImpedanceStability.value.map((item, index: number) => { @@ -1260,14 +1250,9 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listInputImpedanceStability.value = result - } - break - case '稳幅正弦信号电压平坦度': - if (current.value === 'repeatability') { // 重复性 - listVoltageFlatnessRepeatability.value = result.map((item) => { + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessRepeatability.value = result.map((item: any) => { let tempCheckPoint = item.checkPoint + item.unit if (`${item.referencePoint}` === '1') { tempCheckPoint = `${tempCheckPoint}(参考)` @@ -1283,15 +1268,13 @@ ...item, testValueSix: listVoltageFlatnessRepeatability.value[index].averageValue, // 测量差值 testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + testValueUnit: listVoltageFlatnessRepeatability.value[index].testValueUnit, // 测量值单位 + convertVoltageUnit: listVoltageFlatnessRepeatability.value[index].convertVoltageUnit, // 转换为电压值单位 } }) - } - else { // 稳定性 - listVoltageFlatnessStability.value = result - } - break - case '上升时间': - if (current.value === 'repeatability') { // 重复性 + + break + case '上升时间': listRisetimeRepeatability.value = result // 填充稳定性最后一列的日期和数值 listRisetimeStability.value = listRisetimeStability.value.map((item, index: number) => { @@ -1301,13 +1284,42 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) + break + default: + break + } + } + else if (current.value === 'stability') { // 稳定性 + const resultList = res.data.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (item.params === '稳幅正弦信号电压平坦度' && `${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` } - else { // 稳定性 - listRisetimeStability.value = result + return { + ...item, + conclusion: (`${item.conclusion}` === '1' || `${item.conclusion}` === '') ? '合格' : '不合格', + checkPointDefineFront: tempCheckPoint, // 核查点 + editable: props.pageType !== 'detail', + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, } - break - default: - break + }) + + listTimeMarkStability.value = resultList.filter((item: { params: string }) => item.params === '时标') + listSquareWaveVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(50Ω)') + listSquareWaveVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(1MΩ)') + listDirectVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(50Ω)') + listDirectVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(1MΩ)') + listInputImpedanceStability.value = resultList.filter((item: { params: string }) => item.params === '输入阻抗') + listVoltageFlatnessStability.value = resultList.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') + listRisetimeStability.value = resultList.filter((item: { params: string }) => item.params === '上升时间') + + // 计算稳定性考核是否合格 + if (resultList.every((item: { conclusion: string | number }) => item.conclusion === '合格')) { + form.value.qualified = '合格' + } + else { + form.value.qualified = '不合格' + } } listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading @@ -1351,10 +1363,28 @@ // 处理详情数据 const solveGetDetailData = (responseList: any) => { console.log('处理详情数据', props.pageType) - const list = responseList.map((item: { editable: boolean }) => { + form.value.qualified = responseList[0].qualified === 1 ? '合格' : '不合格' + const list = responseList.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (`${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` + } return { ...item, editable: props.pageType !== 'detail', + checkPointDefineFront: tempCheckPoint, // 核查点 + conclusion: `${item.conclusion}` === '1' ? '合格' : '不合格', + testValueOne: item.checkType === '稳定性' ? item.testValueOne : Number(item.testValueOne), // 测量值1/测量值(上升时间) + testValueTwo: item.checkType === '稳定性' ? item.testValueTwo : Number(item.testValueTwo), // 测量值2(示值) + testValueThree: item.checkType === '稳定性' ? item.testValueThree : Number(item.testValueThree), // 测量值3(示值) + testValueFour: item.checkType === '稳定性' ? item.testValueFour : Number(item.testValueFour), // 测量值4(示值) + testValueFive: item.checkType === '稳定性' ? item.testValueFive : Number(item.testValueFive), // 测量值5(示值) + testValueSix: item.checkType === '稳定性' ? item.testValueSix : Number(item.testValueSix), // 测量值6(本次示值) + testValueSeven: item.checkType === '稳定性' ? item.testValueSeven : Number(item.testValueSeven), // 测量值7 + testValueEight: item.checkType === '稳定性' ? item.testValueEight : Number(item.testValueEight), // 测量值8 + testValueNine: item.checkType === '稳定性' ? item.testValueNine : Number(item.testValueNine), // 测量值9 + testValueTen: item.checkType === '稳定性' ? item.testValueTen : Number(item.testValueTen), // 测量值10 + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, // 技术指标 } }) @@ -1433,6 +1463,8 @@ listDirectVoltage1MΩRepeatabilityCheckDate.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatabilityCheckDate.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatabilityCheckDate.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatabilityCheckDate.value = useGroup(listVoltageFlatnessRepeatabilityCheckDate.value, 'typeValue') listRisetimeRepeatabilityCheckDate.value = templistRisetimeRepeatability listTimeMarkStabilityCheckDate.value = templistTimeMarkStability @@ -1442,6 +1474,8 @@ listDirectVoltage1MΩStabilityCheckDate.value = templistDirectVoltage1MΩStability listInputImpedanceStabilityCheckDate.value = templistInputImpedanceStability listVoltageFlatnessStabilityCheckDate.value = templistVoltageFlatnessStability + // 数据根据类型分组 + listVoltageFlatnessStabilityCheckDate.value = useGroup(listVoltageFlatnessStabilityCheckDate.value, 'typeValue') listRisetimeStabilityCheckDate.value = templistRisetimeStability } else { @@ -1452,6 +1486,8 @@ listDirectVoltage1MΩRepeatability.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatability.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatability.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') listRisetimeRepeatability.value = templistRisetimeRepeatability listTimeMarkStability.value = templistTimeMarkStability @@ -1461,6 +1497,7 @@ listDirectVoltage1MΩStability.value = templistDirectVoltage1MΩStability listInputImpedanceStability.value = templistInputImpedanceStability listVoltageFlatnessStability.value = templistVoltageFlatnessStability + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') listRisetimeStability.value = templistRisetimeStability } @@ -1485,24 +1522,18 @@ 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) + columns_stability_timeMark.value = handleDetailTableTableHead(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + columns_stability_squareWaveVoltage50Ω.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + columns_stability_squareWaveVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + columns_stability_directVoltage50Ω.value = handleDetailTableTableHead(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + columns_stability_directVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + columns_stability_inputImpedance.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + columns_stability_voltage_flatness.value = handleDetailTableTableHead(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) } }) if (props.pageType === 'edit') { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 } loading.close() }) @@ -1512,207 +1543,161 @@ * 获取稳定性示值 * @param date 查询日期 */ -function fetchHistoryIndication(type: string, date = '') { +function fetchHistoryIndication(date = '') { + if (!equipmentId.value || !props.selectStandardId) { return false } const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) checkDate: date || props.checkDate!, // 核查日期 checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) - conclusion: '是', // 结论 + conclusion: '合格', // 结论 equipmentId: equipmentId.value, // 被核查设备id - params: type, // 核查项目 + params: '', // 核查项目 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 - }) + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true } + getHistoryIndication(params).then((res) => { + if (date === '') { // 正常核查数据 + const num = props.pageType === 'edit' ? 5 : 4 + // '时标': + listTimeMarkStability.value = listTimeMarkStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark.value, num, 2, '13') + console.log('columnsData', columnsData[2]) + + columns_stability_timeMark.value = columnsData + return item = itemData + }) + listTimeMarkStability.value = handleSaveDateParams(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω.value, num, 2, '13') + columns_stability_directVoltage50Ω.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStability.value = handleSaveDateParams(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ.value, num, 2, '13') + columns_stability_directVoltage1MΩ.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStability.value = handleSaveDateParams(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + // '输入阻抗': + listInputImpedanceStability.value = listInputImpedanceStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance.value, num, 2, '13') + columns_stability_inputImpedance.value = columnsData + return item = itemData + }) + listInputImpedanceStability.value = handleSaveDateParams(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStability.value = listVoltageFlatnessStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness.value, num, 3, '13') + columns_stability_voltage_flatness.value = columnsData + return item = itemData + }) + listVoltageFlatnessStability.value = handleSaveDateParams(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) + } + else { + const num = 5 + // '时标': + listTimeMarkStabilityCheckDate.value = listTimeMarkStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark_checkDate.value, num, 2, '13') + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listTimeMarkStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listTimeMarkStabilityCheckDate.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityCheckDate.value = listSquareWaveVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω_checkDate.value, listSquareWaveVoltage50ΩStabilityCheckDate.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStabilityCheckDate.value = listSquareWaveVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ_checkDate.value, listSquareWaveVoltage1MΩStabilityCheckDate.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStabilityCheckDate.value = listDirectVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_directVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage50Ω_checkDate.value, listDirectVoltage50ΩStabilityCheckDate.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityCheckDate.value = listDirectVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_directVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage1MΩ_checkDate.value, listDirectVoltage1MΩStabilityCheckDate.value, 2) + // '输入阻抗': + listInputImpedanceStabilityCheckDate.value = listInputImpedanceStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance_checkDate.value, num, 2, '13') + columns_stability_inputImpedance_checkDate.value = columnsData + return item = itemData + }) + listInputImpedanceStabilityCheckDate.value = handleSaveDateParams(columns_stability_inputImpedance_checkDate.value, listInputImpedanceStabilityCheckDate.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityCheckDate.value = listVoltageFlatnessStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness_checkDate.value, num, 3, '13') + columns_stability_voltage_flatness_checkDate.value = columnsData + return item = itemData + }) + listVoltageFlatnessStabilityCheckDate.value = handleSaveDateParams(columns_stability_voltage_flatness_checkDate.value, listVoltageFlatnessStabilityCheckDate.value, 3) + } + + 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 + }) } /** @@ -1751,6 +1736,33 @@ return true } +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + + tempList = tempList.concat( + listTimeMarkRepeatability.value, // 时标-重复性 + listSquareWaveVoltage50ΩRepeatability.value, // 方波电压(50Ω)-重复性 + listSquareWaveVoltage1MΩRepeatability.value, // 方波电压(1MΩ)-重复性 + listDirectVoltage50ΩRepeatability.value, // 直流电压(50Ω)-重复性 + listDirectVoltage1MΩRepeatability.value, // 直流电压(1MΩ)-重复性 + listInputImpedanceRepeatability.value, // 输入阻抗-重复性 + listVoltageFlatnessRepeatability.value, // 稳幅正弦信号电压平坦度-重复性 + listRisetimeRepeatability.value, // 上升时间-重复性 + + listTimeMarkStability.value, // 时标-稳定性 + listSquareWaveVoltage50ΩStability.value, // 方波电压(50Ω)-稳定性 + listSquareWaveVoltage1MΩStability.value, // 方波电压(1MΩ)-稳定性 + listDirectVoltage50ΩStability.value, // 直流电压(50Ω)-稳定性 + listDirectVoltage1MΩStability.value, // 直流电压(1MΩ)-稳定性 + listInputImpedanceStability.value, // 输入阻抗-稳定性 + listVoltageFlatnessStability.value, // 稳幅正弦信号电压平坦度-稳定性 + listRisetimeStability.value, // 上升时间-稳定性 + ) + return tempList +} + // 点击表头日期查询历史稳定性数据 const handleClickHeader = (val: any, checkDateDetailId: string) => { dateArrStability.value = ['核查数据', val.label] @@ -1827,13 +1839,7 @@ watch(() => props.checkDate, (newValue) => { initColumns() nextTick(() => { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 }) }, { immediate: true }) @@ -1845,12 +1851,12 @@ fetchInfo() } }) -defineExpose({ fetchCheckItemDetail, checkList }) +defineExpose({ fetchCheckItemDetail, checkList, solveDataBeforeSave, form }) @@ -2274,6 +2285,32 @@ + + + + + + + + + + + + + + + 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 3d6d5ef..70c18fa 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts +++ b/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts @@ -10,6 +10,7 @@ unit?: string // 核查点单位/快沿单位(上升时间)(字典value) averageValue?: string // 平均值 standardDeviation?: string // 重复性Sn(x) + referencePoint?: number // 参考点 testValueOne?: string // 测量值1/测量值(上升时间) testValueTwo?: string // 测量值2(示值) diff --git a/src/views/equipement/standard/book/components/config/tenth/config.vue b/src/views/equipement/standard/book/components/config/tenth/config.vue index 5fc9d30..f662e17 100644 --- a/src/views/equipement/standard/book/components/config/tenth/config.vue +++ b/src/views/equipement/standard/book/components/config/tenth/config.vue @@ -9,6 +9,7 @@ import { config, getCheckItemDetail } from '@/api/equipment/standard/book' import { calc } from '@/utils/useCalc' import { getDictByCode } from '@/api/system/dict' +import { differenceArray } from '@/utils/Array' const textMap: { [key: string]: string } = { edit: '编辑', @@ -59,7 +60,7 @@ const checkoutPhaseList = ref([]) // 调相相偏多选 const checkoutFrequencySpectrumList = ref([]) // 谐波多选 -const frequency = ref(true) // 是否显示频率 +const frequency = ref(true) // 频率 const powerLevel = ref(true) // 功率 const relativeLevel = ref(true) // 相对电平 const AMDepth = ref(true) // 调幅度 @@ -122,7 +123,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true }, + { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true, width: '180' }, { text: '调频频偏单位', value: 'frequencyDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -141,7 +142,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true }, + { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true, width: '180' }, { text: '调相相偏单位', value: 'phaseDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -488,7 +489,13 @@ ElMessage.warning('谐波 不能为空') return false } - + let frequencyResult = true // 频率 + let powerLevelResult = true // 功率 + let relativeLevelResult = true // 相对电平 + let AMDepthResult = true // 调幅度 + let frequencyModulationDeviationResult = true // 调频频偏 + let phaseResult = true // 调相相偏 + let frequencySpectrumResult = true // 谐波 if (frequency.value) { frequencyResult = checkList(listFrequency.value, '频率') } @@ -595,12 +602,11 @@ // 点击保存 const save = () => { - if (!checkReferencePoint()) { return false } if (!checkListBeforeSave()) { return false } const list = solveDataBeforeSave() const params = { itemCategoryId: form.value.itemCategoryId, // 核查项分类id - checkItemDataOscilloscopeList: list, + checkItemDataSignalGeneratorList: list, equipmentId: equipmentId.value, } const loading = ElLoading.service({ @@ -762,7 +768,7 @@ 增加行 - + 删除行 @@ -780,7 +786,7 @@ 增加行 - + 删除行 @@ -798,7 +804,7 @@ 增加行 - + 删除行 @@ -816,7 +822,7 @@ 增加行 - + 删除行 @@ -834,7 +840,7 @@ 增加行 - + 删除行 @@ -852,7 +858,7 @@ 增加行 - + 删除行 @@ -870,7 +876,7 @@ 增加行 - + 删除行 diff --git a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue index 24703fb..727432c 100644 --- a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue +++ b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue @@ -38,22 +38,28 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 +const standardFrequencyUnitList = ref([]) // 频率单位公用 +const standardAmplitudeUnitList = ref([]) // 幅度单位公用 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 幅度单位公用 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -86,10 +92,6 @@ emit('change') } -// 多选选中结果 -function selectionChange(selection: []) { - emit('selectionChange', selection) -} // 点击行 function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) @@ -105,7 +107,7 @@ }) // 多选 const handleSelectionChange = (val: any) => { - emit('multiSelect', val) + emit('selectionChange', val) } // 清除多选选中 const clearMulti = () => { @@ -149,6 +151,110 @@ + diff --git a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue index 34d583a..478196e 100644 --- a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue @@ -786,7 +786,7 @@ const num = props.pageType === 'edit' ? 5 : 4 // 温度值 temperatureListStability.value = temperatureListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_temperature.value, num, 3) columns_stability_temperature.value = columnsData return item = itemData @@ -794,7 +794,7 @@ temperatureListStability.value = handleSaveDateParams(columns_stability_temperature.value, temperatureListStability.value, 3) // RTP值 RTPListStability.value = RTPListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_RTP.value, num, 3) columns_stability_RTP.value = columnsData return item = itemData diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue deleted file mode 100644 index 263ff3c..0000000 --- a/src/views/equipement/standard/checkData/components/thirteenth/11.vue +++ /dev/null @@ -1,79 +0,0 @@ - diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index f7f9a68..8fb2bb1 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -13,6 +13,8 @@ import multiTable from '@/components/MultiHeaderTable/index.vue' import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' +import { useGroup } from '@/commonMethods/useGroup' + const props = defineProps({ selectStandardId: { // 选择的标准装置id type: String, @@ -33,6 +35,7 @@ const itemCategoryName = ref('') // 核查项分类名称 const form = ref({ remark: '/', // 备注 + qualified: '', // 稳定性考核是否合格 }) const equipmentId = ref('') // 设备id const dateArrStability = ref([]) // 稳定性日期数组 @@ -210,7 +213,7 @@ { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false }, { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false }, { text: '探头规格型号', value: 'model', align: 'center', required: false }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180' }, + { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '220' }, ]) const columns_stability_timeMark = ref([ // 稳定性表头--时标 @@ -627,14 +630,7 @@ getCheckItemDetail(params).then((res) => { loading.close() handleData(res.data.checkItemDataOscilloscopeList) - // fetchHistoryIndication() // 获取稳定性 - fetchHistoryIndication('时标') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性 + fetchHistoryIndication() // 重新拉取稳定性 }) } @@ -679,6 +675,7 @@ dataId: e.dataId, // 核查数据管理基础信息表id id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 + dataType: '1', checkPoint: e.checkPoint, unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 @@ -732,6 +729,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '2', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -783,6 +781,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '3', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -834,6 +833,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '4', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -885,6 +885,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '5', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -936,6 +937,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '6', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -1004,9 +1006,11 @@ params: e.params, // 核查项目 checkPoint: e.checkPoint, // 核查点 unit: e.unit, // 单位(直接存字典value) - checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkPointDefineFront: e.checkPointDefineFront, // 核查点 referencePoint: e.referencePoint, // 是否为参考点 checkType: '稳定性', + dataType: '7', + typeValue: e.typeValue, // 类型 averageValue: '', // 平均值 stability: '', // 稳定性 maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 @@ -1015,6 +1019,9 @@ conclusion: '', // 结论 } }) + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') // 上升时间 listRisetimeRepeatability.value = list.filter((item: { params: string }) => item.params === '上升时间') @@ -1035,6 +1042,7 @@ equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: '', // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1051,10 +1059,12 @@ unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 快沿 checkType: '稳定性', + dataType: '8', manufactureNo: e.manufactureNo, // 探头出厂编号 equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: e.testValueOne, // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1137,7 +1147,12 @@ const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 - checkDataOscilloscopeList: checkDataOscilloscopeListParams, + checkDataOscilloscopeList: checkDataOscilloscopeListParams.map((item: { conclusion: string }) => { + return { + ...item, + conclusion: '', + } + }), itemCategoryId: itemCategoryId.value, // 核查项分类id itemCategoryName: itemCategoryName.value, // 核查项分类id } @@ -1151,14 +1166,14 @@ 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' + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true calculateHandle(params).then((res) => { const result = res.data.filter((item: { params: string }) => item.params === type).map((item: any) => { @@ -1168,9 +1183,9 @@ editable: props.pageType !== 'detail', } }) - switch (type) { - case '时标': - if (current.value === 'repeatability') { // 重复性 + if (current.value === 'repeatability') { // 重复性 + switch (type) { + case '时标': listTimeMarkRepeatability.value = result // 填充稳定性最后一列的日期和数值 listTimeMarkStability.value = listTimeMarkStability.value.map((item, index: number) => { @@ -1180,13 +1195,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listTimeMarkStability.value = result - } - break - case '方波电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(50Ω)': listSquareWaveVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item, index: number) => { @@ -1196,13 +1206,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage50ΩStability.value = result - } - break - case '方波电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(1MΩ)': listSquareWaveVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item, index: number) => { @@ -1212,13 +1217,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage1MΩStability.value = result - } - break - case '直流电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(50Ω)': listDirectVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item, index: number) => { @@ -1228,13 +1228,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage50ΩStability.value = result - } - break - case '直流电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(1MΩ)': listDirectVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item, index: number) => { @@ -1244,13 +1239,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage1MΩStability.value = result - } - break - case '输入阻抗': - if (current.value === 'repeatability') { // 重复性 + break + case '输入阻抗': listInputImpedanceRepeatability.value = result // 填充稳定性最后一列的日期和数值 listInputImpedanceStability.value = listInputImpedanceStability.value.map((item, index: number) => { @@ -1260,14 +1250,9 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listInputImpedanceStability.value = result - } - break - case '稳幅正弦信号电压平坦度': - if (current.value === 'repeatability') { // 重复性 - listVoltageFlatnessRepeatability.value = result.map((item) => { + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessRepeatability.value = result.map((item: any) => { let tempCheckPoint = item.checkPoint + item.unit if (`${item.referencePoint}` === '1') { tempCheckPoint = `${tempCheckPoint}(参考)` @@ -1283,15 +1268,13 @@ ...item, testValueSix: listVoltageFlatnessRepeatability.value[index].averageValue, // 测量差值 testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + testValueUnit: listVoltageFlatnessRepeatability.value[index].testValueUnit, // 测量值单位 + convertVoltageUnit: listVoltageFlatnessRepeatability.value[index].convertVoltageUnit, // 转换为电压值单位 } }) - } - else { // 稳定性 - listVoltageFlatnessStability.value = result - } - break - case '上升时间': - if (current.value === 'repeatability') { // 重复性 + + break + case '上升时间': listRisetimeRepeatability.value = result // 填充稳定性最后一列的日期和数值 listRisetimeStability.value = listRisetimeStability.value.map((item, index: number) => { @@ -1301,13 +1284,42 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) + break + default: + break + } + } + else if (current.value === 'stability') { // 稳定性 + const resultList = res.data.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (item.params === '稳幅正弦信号电压平坦度' && `${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` } - else { // 稳定性 - listRisetimeStability.value = result + return { + ...item, + conclusion: (`${item.conclusion}` === '1' || `${item.conclusion}` === '') ? '合格' : '不合格', + checkPointDefineFront: tempCheckPoint, // 核查点 + editable: props.pageType !== 'detail', + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, } - break - default: - break + }) + + listTimeMarkStability.value = resultList.filter((item: { params: string }) => item.params === '时标') + listSquareWaveVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(50Ω)') + listSquareWaveVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(1MΩ)') + listDirectVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(50Ω)') + listDirectVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(1MΩ)') + listInputImpedanceStability.value = resultList.filter((item: { params: string }) => item.params === '输入阻抗') + listVoltageFlatnessStability.value = resultList.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') + listRisetimeStability.value = resultList.filter((item: { params: string }) => item.params === '上升时间') + + // 计算稳定性考核是否合格 + if (resultList.every((item: { conclusion: string | number }) => item.conclusion === '合格')) { + form.value.qualified = '合格' + } + else { + form.value.qualified = '不合格' + } } listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading @@ -1351,10 +1363,28 @@ // 处理详情数据 const solveGetDetailData = (responseList: any) => { console.log('处理详情数据', props.pageType) - const list = responseList.map((item: { editable: boolean }) => { + form.value.qualified = responseList[0].qualified === 1 ? '合格' : '不合格' + const list = responseList.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (`${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` + } return { ...item, editable: props.pageType !== 'detail', + checkPointDefineFront: tempCheckPoint, // 核查点 + conclusion: `${item.conclusion}` === '1' ? '合格' : '不合格', + testValueOne: item.checkType === '稳定性' ? item.testValueOne : Number(item.testValueOne), // 测量值1/测量值(上升时间) + testValueTwo: item.checkType === '稳定性' ? item.testValueTwo : Number(item.testValueTwo), // 测量值2(示值) + testValueThree: item.checkType === '稳定性' ? item.testValueThree : Number(item.testValueThree), // 测量值3(示值) + testValueFour: item.checkType === '稳定性' ? item.testValueFour : Number(item.testValueFour), // 测量值4(示值) + testValueFive: item.checkType === '稳定性' ? item.testValueFive : Number(item.testValueFive), // 测量值5(示值) + testValueSix: item.checkType === '稳定性' ? item.testValueSix : Number(item.testValueSix), // 测量值6(本次示值) + testValueSeven: item.checkType === '稳定性' ? item.testValueSeven : Number(item.testValueSeven), // 测量值7 + testValueEight: item.checkType === '稳定性' ? item.testValueEight : Number(item.testValueEight), // 测量值8 + testValueNine: item.checkType === '稳定性' ? item.testValueNine : Number(item.testValueNine), // 测量值9 + testValueTen: item.checkType === '稳定性' ? item.testValueTen : Number(item.testValueTen), // 测量值10 + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, // 技术指标 } }) @@ -1433,6 +1463,8 @@ listDirectVoltage1MΩRepeatabilityCheckDate.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatabilityCheckDate.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatabilityCheckDate.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatabilityCheckDate.value = useGroup(listVoltageFlatnessRepeatabilityCheckDate.value, 'typeValue') listRisetimeRepeatabilityCheckDate.value = templistRisetimeRepeatability listTimeMarkStabilityCheckDate.value = templistTimeMarkStability @@ -1442,6 +1474,8 @@ listDirectVoltage1MΩStabilityCheckDate.value = templistDirectVoltage1MΩStability listInputImpedanceStabilityCheckDate.value = templistInputImpedanceStability listVoltageFlatnessStabilityCheckDate.value = templistVoltageFlatnessStability + // 数据根据类型分组 + listVoltageFlatnessStabilityCheckDate.value = useGroup(listVoltageFlatnessStabilityCheckDate.value, 'typeValue') listRisetimeStabilityCheckDate.value = templistRisetimeStability } else { @@ -1452,6 +1486,8 @@ listDirectVoltage1MΩRepeatability.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatability.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatability.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') listRisetimeRepeatability.value = templistRisetimeRepeatability listTimeMarkStability.value = templistTimeMarkStability @@ -1461,6 +1497,7 @@ listDirectVoltage1MΩStability.value = templistDirectVoltage1MΩStability listInputImpedanceStability.value = templistInputImpedanceStability listVoltageFlatnessStability.value = templistVoltageFlatnessStability + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') listRisetimeStability.value = templistRisetimeStability } @@ -1485,24 +1522,18 @@ 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) + columns_stability_timeMark.value = handleDetailTableTableHead(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + columns_stability_squareWaveVoltage50Ω.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + columns_stability_squareWaveVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + columns_stability_directVoltage50Ω.value = handleDetailTableTableHead(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + columns_stability_directVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + columns_stability_inputImpedance.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + columns_stability_voltage_flatness.value = handleDetailTableTableHead(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) } }) if (props.pageType === 'edit') { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 } loading.close() }) @@ -1512,207 +1543,161 @@ * 获取稳定性示值 * @param date 查询日期 */ -function fetchHistoryIndication(type: string, date = '') { +function fetchHistoryIndication(date = '') { + if (!equipmentId.value || !props.selectStandardId) { return false } const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) checkDate: date || props.checkDate!, // 核查日期 checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) - conclusion: '是', // 结论 + conclusion: '合格', // 结论 equipmentId: equipmentId.value, // 被核查设备id - params: type, // 核查项目 + params: '', // 核查项目 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 - }) + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true } + getHistoryIndication(params).then((res) => { + if (date === '') { // 正常核查数据 + const num = props.pageType === 'edit' ? 5 : 4 + // '时标': + listTimeMarkStability.value = listTimeMarkStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark.value, num, 2, '13') + console.log('columnsData', columnsData[2]) + + columns_stability_timeMark.value = columnsData + return item = itemData + }) + listTimeMarkStability.value = handleSaveDateParams(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω.value, num, 2, '13') + columns_stability_directVoltage50Ω.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStability.value = handleSaveDateParams(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ.value, num, 2, '13') + columns_stability_directVoltage1MΩ.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStability.value = handleSaveDateParams(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + // '输入阻抗': + listInputImpedanceStability.value = listInputImpedanceStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance.value, num, 2, '13') + columns_stability_inputImpedance.value = columnsData + return item = itemData + }) + listInputImpedanceStability.value = handleSaveDateParams(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStability.value = listVoltageFlatnessStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness.value, num, 3, '13') + columns_stability_voltage_flatness.value = columnsData + return item = itemData + }) + listVoltageFlatnessStability.value = handleSaveDateParams(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) + } + else { + const num = 5 + // '时标': + listTimeMarkStabilityCheckDate.value = listTimeMarkStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark_checkDate.value, num, 2, '13') + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listTimeMarkStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listTimeMarkStabilityCheckDate.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityCheckDate.value = listSquareWaveVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω_checkDate.value, listSquareWaveVoltage50ΩStabilityCheckDate.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStabilityCheckDate.value = listSquareWaveVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ_checkDate.value, listSquareWaveVoltage1MΩStabilityCheckDate.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStabilityCheckDate.value = listDirectVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_directVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage50Ω_checkDate.value, listDirectVoltage50ΩStabilityCheckDate.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityCheckDate.value = listDirectVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_directVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage1MΩ_checkDate.value, listDirectVoltage1MΩStabilityCheckDate.value, 2) + // '输入阻抗': + listInputImpedanceStabilityCheckDate.value = listInputImpedanceStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance_checkDate.value, num, 2, '13') + columns_stability_inputImpedance_checkDate.value = columnsData + return item = itemData + }) + listInputImpedanceStabilityCheckDate.value = handleSaveDateParams(columns_stability_inputImpedance_checkDate.value, listInputImpedanceStabilityCheckDate.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityCheckDate.value = listVoltageFlatnessStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness_checkDate.value, num, 3, '13') + columns_stability_voltage_flatness_checkDate.value = columnsData + return item = itemData + }) + listVoltageFlatnessStabilityCheckDate.value = handleSaveDateParams(columns_stability_voltage_flatness_checkDate.value, listVoltageFlatnessStabilityCheckDate.value, 3) + } + + 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 + }) } /** @@ -1751,6 +1736,33 @@ return true } +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + + tempList = tempList.concat( + listTimeMarkRepeatability.value, // 时标-重复性 + listSquareWaveVoltage50ΩRepeatability.value, // 方波电压(50Ω)-重复性 + listSquareWaveVoltage1MΩRepeatability.value, // 方波电压(1MΩ)-重复性 + listDirectVoltage50ΩRepeatability.value, // 直流电压(50Ω)-重复性 + listDirectVoltage1MΩRepeatability.value, // 直流电压(1MΩ)-重复性 + listInputImpedanceRepeatability.value, // 输入阻抗-重复性 + listVoltageFlatnessRepeatability.value, // 稳幅正弦信号电压平坦度-重复性 + listRisetimeRepeatability.value, // 上升时间-重复性 + + listTimeMarkStability.value, // 时标-稳定性 + listSquareWaveVoltage50ΩStability.value, // 方波电压(50Ω)-稳定性 + listSquareWaveVoltage1MΩStability.value, // 方波电压(1MΩ)-稳定性 + listDirectVoltage50ΩStability.value, // 直流电压(50Ω)-稳定性 + listDirectVoltage1MΩStability.value, // 直流电压(1MΩ)-稳定性 + listInputImpedanceStability.value, // 输入阻抗-稳定性 + listVoltageFlatnessStability.value, // 稳幅正弦信号电压平坦度-稳定性 + listRisetimeStability.value, // 上升时间-稳定性 + ) + return tempList +} + // 点击表头日期查询历史稳定性数据 const handleClickHeader = (val: any, checkDateDetailId: string) => { dateArrStability.value = ['核查数据', val.label] @@ -1827,13 +1839,7 @@ watch(() => props.checkDate, (newValue) => { initColumns() nextTick(() => { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 }) }, { immediate: true }) @@ -1845,12 +1851,12 @@ fetchInfo() } }) -defineExpose({ fetchCheckItemDetail, checkList }) +defineExpose({ fetchCheckItemDetail, checkList, solveDataBeforeSave, form }) @@ -2274,6 +2285,32 @@ + + + + + + + + + + + + + + + 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 3d6d5ef..70c18fa 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts +++ b/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts @@ -10,6 +10,7 @@ unit?: string // 核查点单位/快沿单位(上升时间)(字典value) averageValue?: string // 平均值 standardDeviation?: string // 重复性Sn(x) + referencePoint?: number // 参考点 testValueOne?: string // 测量值1/测量值(上升时间) testValueTwo?: string // 测量值2(示值) diff --git a/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts b/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts index 3850229..32e5caa 100644 --- a/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts +++ b/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts @@ -102,6 +102,7 @@ * @param stabilityColumns 稳定性表头 * @param num 控制表头日期从第几个开始填 ---查询历史日期从最后一个填,核查数据需要从倒数第二个填,因为最后一个要是本次核查日期 * @param columnsNum 示值的索引 + * @param 参与比较的属性 * @returns itemData 处理完的行数据 columnsData 表头 */ export function solveHistoryIndicationTableData( @@ -110,15 +111,21 @@ stabilityColumns: any, num = 4, columnsNum = 5, + belongStandardEquipment = '', ) { - console.log('llllll', value) - - // 先找出此行数据的所有日期 - const list = value.filter( - (i: { checkPoint: string; params: string }) => - i.params === item.params && i.checkPoint === item.checkPoint, - ) - console.log('0909090', list) + let list = [] + if (belongStandardEquipment === '13') { // 示波器 + // 先找出此行数据的所有日期 + list = value.filter( + (i: any) => i.params === item.params && i.checkPoint === item.checkPoint && i.unit === item.unit, + ) + } + else { + // 先找出此行数据的所有日期 + list = value.filter( + (i: any) => i.params === item.params && i.checkPoint === item.checkPoint, + ) + } // 按照时间倒序排序 list.sort((i: { testValueDate: string }, j: { testValueDate: string }) => { @@ -133,10 +140,8 @@ index: number, ) => { stabilityColumns[columnsNum].children![num - index].text = e.testValueDate // 填表头 - stabilityColumns[columnsNum].children![num - index].checkDateDetailId - = e.id // id用来查对应日期的详情 - item[stabilityColumns[columnsNum].children![num - index].value] - = e.testValue // 填表格数据 + stabilityColumns[columnsNum].children![num - index].checkDateDetailId = e.id // id用来查对应日期的详情 + item[stabilityColumns[columnsNum].children![num - index].value] = e.testValue // 填表格数据 }, ) diff --git a/src/views/equipement/standard/book/components/config/tenth/config.vue b/src/views/equipement/standard/book/components/config/tenth/config.vue index 5fc9d30..f662e17 100644 --- a/src/views/equipement/standard/book/components/config/tenth/config.vue +++ b/src/views/equipement/standard/book/components/config/tenth/config.vue @@ -9,6 +9,7 @@ import { config, getCheckItemDetail } from '@/api/equipment/standard/book' import { calc } from '@/utils/useCalc' import { getDictByCode } from '@/api/system/dict' +import { differenceArray } from '@/utils/Array' const textMap: { [key: string]: string } = { edit: '编辑', @@ -59,7 +60,7 @@ const checkoutPhaseList = ref([]) // 调相相偏多选 const checkoutFrequencySpectrumList = ref([]) // 谐波多选 -const frequency = ref(true) // 是否显示频率 +const frequency = ref(true) // 频率 const powerLevel = ref(true) // 功率 const relativeLevel = ref(true) // 相对电平 const AMDepth = ref(true) // 调幅度 @@ -122,7 +123,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true }, + { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true, width: '180' }, { text: '调频频偏单位', value: 'frequencyDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -141,7 +142,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true }, + { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true, width: '180' }, { text: '调相相偏单位', value: 'phaseDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -488,7 +489,13 @@ ElMessage.warning('谐波 不能为空') return false } - + let frequencyResult = true // 频率 + let powerLevelResult = true // 功率 + let relativeLevelResult = true // 相对电平 + let AMDepthResult = true // 调幅度 + let frequencyModulationDeviationResult = true // 调频频偏 + let phaseResult = true // 调相相偏 + let frequencySpectrumResult = true // 谐波 if (frequency.value) { frequencyResult = checkList(listFrequency.value, '频率') } @@ -595,12 +602,11 @@ // 点击保存 const save = () => { - if (!checkReferencePoint()) { return false } if (!checkListBeforeSave()) { return false } const list = solveDataBeforeSave() const params = { itemCategoryId: form.value.itemCategoryId, // 核查项分类id - checkItemDataOscilloscopeList: list, + checkItemDataSignalGeneratorList: list, equipmentId: equipmentId.value, } const loading = ElLoading.service({ @@ -762,7 +768,7 @@ 增加行 - + 删除行 @@ -780,7 +786,7 @@ 增加行 - + 删除行 @@ -798,7 +804,7 @@ 增加行 - + 删除行 @@ -816,7 +822,7 @@ 增加行 - + 删除行 @@ -834,7 +840,7 @@ 增加行 - + 删除行 @@ -852,7 +858,7 @@ 增加行 - + 删除行 @@ -870,7 +876,7 @@ 增加行 - + 删除行 diff --git a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue index 24703fb..727432c 100644 --- a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue +++ b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue @@ -38,22 +38,28 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 +const standardFrequencyUnitList = ref([]) // 频率单位公用 +const standardAmplitudeUnitList = ref([]) // 幅度单位公用 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 幅度单位公用 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -86,10 +92,6 @@ emit('change') } -// 多选选中结果 -function selectionChange(selection: []) { - emit('selectionChange', selection) -} // 点击行 function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) @@ -105,7 +107,7 @@ }) // 多选 const handleSelectionChange = (val: any) => { - emit('multiSelect', val) + emit('selectionChange', val) } // 清除多选选中 const clearMulti = () => { @@ -149,6 +151,110 @@ + diff --git a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue index 34d583a..478196e 100644 --- a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue @@ -786,7 +786,7 @@ const num = props.pageType === 'edit' ? 5 : 4 // 温度值 temperatureListStability.value = temperatureListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_temperature.value, num, 3) columns_stability_temperature.value = columnsData return item = itemData @@ -794,7 +794,7 @@ temperatureListStability.value = handleSaveDateParams(columns_stability_temperature.value, temperatureListStability.value, 3) // RTP值 RTPListStability.value = RTPListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_RTP.value, num, 3) columns_stability_RTP.value = columnsData return item = itemData diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue deleted file mode 100644 index 263ff3c..0000000 --- a/src/views/equipement/standard/checkData/components/thirteenth/11.vue +++ /dev/null @@ -1,79 +0,0 @@ - diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index f7f9a68..8fb2bb1 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -13,6 +13,8 @@ import multiTable from '@/components/MultiHeaderTable/index.vue' import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' +import { useGroup } from '@/commonMethods/useGroup' + const props = defineProps({ selectStandardId: { // 选择的标准装置id type: String, @@ -33,6 +35,7 @@ const itemCategoryName = ref('') // 核查项分类名称 const form = ref({ remark: '/', // 备注 + qualified: '', // 稳定性考核是否合格 }) const equipmentId = ref('') // 设备id const dateArrStability = ref([]) // 稳定性日期数组 @@ -210,7 +213,7 @@ { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false }, { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false }, { text: '探头规格型号', value: 'model', align: 'center', required: false }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180' }, + { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '220' }, ]) const columns_stability_timeMark = ref([ // 稳定性表头--时标 @@ -627,14 +630,7 @@ getCheckItemDetail(params).then((res) => { loading.close() handleData(res.data.checkItemDataOscilloscopeList) - // fetchHistoryIndication() // 获取稳定性 - fetchHistoryIndication('时标') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性 + fetchHistoryIndication() // 重新拉取稳定性 }) } @@ -679,6 +675,7 @@ dataId: e.dataId, // 核查数据管理基础信息表id id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 + dataType: '1', checkPoint: e.checkPoint, unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 @@ -732,6 +729,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '2', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -783,6 +781,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '3', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -834,6 +833,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '4', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -885,6 +885,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '5', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -936,6 +937,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '6', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -1004,9 +1006,11 @@ params: e.params, // 核查项目 checkPoint: e.checkPoint, // 核查点 unit: e.unit, // 单位(直接存字典value) - checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkPointDefineFront: e.checkPointDefineFront, // 核查点 referencePoint: e.referencePoint, // 是否为参考点 checkType: '稳定性', + dataType: '7', + typeValue: e.typeValue, // 类型 averageValue: '', // 平均值 stability: '', // 稳定性 maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 @@ -1015,6 +1019,9 @@ conclusion: '', // 结论 } }) + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') // 上升时间 listRisetimeRepeatability.value = list.filter((item: { params: string }) => item.params === '上升时间') @@ -1035,6 +1042,7 @@ equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: '', // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1051,10 +1059,12 @@ unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 快沿 checkType: '稳定性', + dataType: '8', manufactureNo: e.manufactureNo, // 探头出厂编号 equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: e.testValueOne, // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1137,7 +1147,12 @@ const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 - checkDataOscilloscopeList: checkDataOscilloscopeListParams, + checkDataOscilloscopeList: checkDataOscilloscopeListParams.map((item: { conclusion: string }) => { + return { + ...item, + conclusion: '', + } + }), itemCategoryId: itemCategoryId.value, // 核查项分类id itemCategoryName: itemCategoryName.value, // 核查项分类id } @@ -1151,14 +1166,14 @@ 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' + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true calculateHandle(params).then((res) => { const result = res.data.filter((item: { params: string }) => item.params === type).map((item: any) => { @@ -1168,9 +1183,9 @@ editable: props.pageType !== 'detail', } }) - switch (type) { - case '时标': - if (current.value === 'repeatability') { // 重复性 + if (current.value === 'repeatability') { // 重复性 + switch (type) { + case '时标': listTimeMarkRepeatability.value = result // 填充稳定性最后一列的日期和数值 listTimeMarkStability.value = listTimeMarkStability.value.map((item, index: number) => { @@ -1180,13 +1195,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listTimeMarkStability.value = result - } - break - case '方波电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(50Ω)': listSquareWaveVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item, index: number) => { @@ -1196,13 +1206,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage50ΩStability.value = result - } - break - case '方波电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(1MΩ)': listSquareWaveVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item, index: number) => { @@ -1212,13 +1217,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage1MΩStability.value = result - } - break - case '直流电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(50Ω)': listDirectVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item, index: number) => { @@ -1228,13 +1228,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage50ΩStability.value = result - } - break - case '直流电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(1MΩ)': listDirectVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item, index: number) => { @@ -1244,13 +1239,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage1MΩStability.value = result - } - break - case '输入阻抗': - if (current.value === 'repeatability') { // 重复性 + break + case '输入阻抗': listInputImpedanceRepeatability.value = result // 填充稳定性最后一列的日期和数值 listInputImpedanceStability.value = listInputImpedanceStability.value.map((item, index: number) => { @@ -1260,14 +1250,9 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listInputImpedanceStability.value = result - } - break - case '稳幅正弦信号电压平坦度': - if (current.value === 'repeatability') { // 重复性 - listVoltageFlatnessRepeatability.value = result.map((item) => { + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessRepeatability.value = result.map((item: any) => { let tempCheckPoint = item.checkPoint + item.unit if (`${item.referencePoint}` === '1') { tempCheckPoint = `${tempCheckPoint}(参考)` @@ -1283,15 +1268,13 @@ ...item, testValueSix: listVoltageFlatnessRepeatability.value[index].averageValue, // 测量差值 testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + testValueUnit: listVoltageFlatnessRepeatability.value[index].testValueUnit, // 测量值单位 + convertVoltageUnit: listVoltageFlatnessRepeatability.value[index].convertVoltageUnit, // 转换为电压值单位 } }) - } - else { // 稳定性 - listVoltageFlatnessStability.value = result - } - break - case '上升时间': - if (current.value === 'repeatability') { // 重复性 + + break + case '上升时间': listRisetimeRepeatability.value = result // 填充稳定性最后一列的日期和数值 listRisetimeStability.value = listRisetimeStability.value.map((item, index: number) => { @@ -1301,13 +1284,42 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) + break + default: + break + } + } + else if (current.value === 'stability') { // 稳定性 + const resultList = res.data.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (item.params === '稳幅正弦信号电压平坦度' && `${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` } - else { // 稳定性 - listRisetimeStability.value = result + return { + ...item, + conclusion: (`${item.conclusion}` === '1' || `${item.conclusion}` === '') ? '合格' : '不合格', + checkPointDefineFront: tempCheckPoint, // 核查点 + editable: props.pageType !== 'detail', + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, } - break - default: - break + }) + + listTimeMarkStability.value = resultList.filter((item: { params: string }) => item.params === '时标') + listSquareWaveVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(50Ω)') + listSquareWaveVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(1MΩ)') + listDirectVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(50Ω)') + listDirectVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(1MΩ)') + listInputImpedanceStability.value = resultList.filter((item: { params: string }) => item.params === '输入阻抗') + listVoltageFlatnessStability.value = resultList.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') + listRisetimeStability.value = resultList.filter((item: { params: string }) => item.params === '上升时间') + + // 计算稳定性考核是否合格 + if (resultList.every((item: { conclusion: string | number }) => item.conclusion === '合格')) { + form.value.qualified = '合格' + } + else { + form.value.qualified = '不合格' + } } listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading @@ -1351,10 +1363,28 @@ // 处理详情数据 const solveGetDetailData = (responseList: any) => { console.log('处理详情数据', props.pageType) - const list = responseList.map((item: { editable: boolean }) => { + form.value.qualified = responseList[0].qualified === 1 ? '合格' : '不合格' + const list = responseList.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (`${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` + } return { ...item, editable: props.pageType !== 'detail', + checkPointDefineFront: tempCheckPoint, // 核查点 + conclusion: `${item.conclusion}` === '1' ? '合格' : '不合格', + testValueOne: item.checkType === '稳定性' ? item.testValueOne : Number(item.testValueOne), // 测量值1/测量值(上升时间) + testValueTwo: item.checkType === '稳定性' ? item.testValueTwo : Number(item.testValueTwo), // 测量值2(示值) + testValueThree: item.checkType === '稳定性' ? item.testValueThree : Number(item.testValueThree), // 测量值3(示值) + testValueFour: item.checkType === '稳定性' ? item.testValueFour : Number(item.testValueFour), // 测量值4(示值) + testValueFive: item.checkType === '稳定性' ? item.testValueFive : Number(item.testValueFive), // 测量值5(示值) + testValueSix: item.checkType === '稳定性' ? item.testValueSix : Number(item.testValueSix), // 测量值6(本次示值) + testValueSeven: item.checkType === '稳定性' ? item.testValueSeven : Number(item.testValueSeven), // 测量值7 + testValueEight: item.checkType === '稳定性' ? item.testValueEight : Number(item.testValueEight), // 测量值8 + testValueNine: item.checkType === '稳定性' ? item.testValueNine : Number(item.testValueNine), // 测量值9 + testValueTen: item.checkType === '稳定性' ? item.testValueTen : Number(item.testValueTen), // 测量值10 + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, // 技术指标 } }) @@ -1433,6 +1463,8 @@ listDirectVoltage1MΩRepeatabilityCheckDate.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatabilityCheckDate.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatabilityCheckDate.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatabilityCheckDate.value = useGroup(listVoltageFlatnessRepeatabilityCheckDate.value, 'typeValue') listRisetimeRepeatabilityCheckDate.value = templistRisetimeRepeatability listTimeMarkStabilityCheckDate.value = templistTimeMarkStability @@ -1442,6 +1474,8 @@ listDirectVoltage1MΩStabilityCheckDate.value = templistDirectVoltage1MΩStability listInputImpedanceStabilityCheckDate.value = templistInputImpedanceStability listVoltageFlatnessStabilityCheckDate.value = templistVoltageFlatnessStability + // 数据根据类型分组 + listVoltageFlatnessStabilityCheckDate.value = useGroup(listVoltageFlatnessStabilityCheckDate.value, 'typeValue') listRisetimeStabilityCheckDate.value = templistRisetimeStability } else { @@ -1452,6 +1486,8 @@ listDirectVoltage1MΩRepeatability.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatability.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatability.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') listRisetimeRepeatability.value = templistRisetimeRepeatability listTimeMarkStability.value = templistTimeMarkStability @@ -1461,6 +1497,7 @@ listDirectVoltage1MΩStability.value = templistDirectVoltage1MΩStability listInputImpedanceStability.value = templistInputImpedanceStability listVoltageFlatnessStability.value = templistVoltageFlatnessStability + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') listRisetimeStability.value = templistRisetimeStability } @@ -1485,24 +1522,18 @@ 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) + columns_stability_timeMark.value = handleDetailTableTableHead(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + columns_stability_squareWaveVoltage50Ω.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + columns_stability_squareWaveVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + columns_stability_directVoltage50Ω.value = handleDetailTableTableHead(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + columns_stability_directVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + columns_stability_inputImpedance.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + columns_stability_voltage_flatness.value = handleDetailTableTableHead(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) } }) if (props.pageType === 'edit') { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 } loading.close() }) @@ -1512,207 +1543,161 @@ * 获取稳定性示值 * @param date 查询日期 */ -function fetchHistoryIndication(type: string, date = '') { +function fetchHistoryIndication(date = '') { + if (!equipmentId.value || !props.selectStandardId) { return false } const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) checkDate: date || props.checkDate!, // 核查日期 checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) - conclusion: '是', // 结论 + conclusion: '合格', // 结论 equipmentId: equipmentId.value, // 被核查设备id - params: type, // 核查项目 + params: '', // 核查项目 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 - }) + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true } + getHistoryIndication(params).then((res) => { + if (date === '') { // 正常核查数据 + const num = props.pageType === 'edit' ? 5 : 4 + // '时标': + listTimeMarkStability.value = listTimeMarkStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark.value, num, 2, '13') + console.log('columnsData', columnsData[2]) + + columns_stability_timeMark.value = columnsData + return item = itemData + }) + listTimeMarkStability.value = handleSaveDateParams(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω.value, num, 2, '13') + columns_stability_directVoltage50Ω.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStability.value = handleSaveDateParams(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ.value, num, 2, '13') + columns_stability_directVoltage1MΩ.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStability.value = handleSaveDateParams(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + // '输入阻抗': + listInputImpedanceStability.value = listInputImpedanceStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance.value, num, 2, '13') + columns_stability_inputImpedance.value = columnsData + return item = itemData + }) + listInputImpedanceStability.value = handleSaveDateParams(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStability.value = listVoltageFlatnessStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness.value, num, 3, '13') + columns_stability_voltage_flatness.value = columnsData + return item = itemData + }) + listVoltageFlatnessStability.value = handleSaveDateParams(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) + } + else { + const num = 5 + // '时标': + listTimeMarkStabilityCheckDate.value = listTimeMarkStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark_checkDate.value, num, 2, '13') + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listTimeMarkStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listTimeMarkStabilityCheckDate.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityCheckDate.value = listSquareWaveVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω_checkDate.value, listSquareWaveVoltage50ΩStabilityCheckDate.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStabilityCheckDate.value = listSquareWaveVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ_checkDate.value, listSquareWaveVoltage1MΩStabilityCheckDate.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStabilityCheckDate.value = listDirectVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_directVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage50Ω_checkDate.value, listDirectVoltage50ΩStabilityCheckDate.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityCheckDate.value = listDirectVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_directVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage1MΩ_checkDate.value, listDirectVoltage1MΩStabilityCheckDate.value, 2) + // '输入阻抗': + listInputImpedanceStabilityCheckDate.value = listInputImpedanceStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance_checkDate.value, num, 2, '13') + columns_stability_inputImpedance_checkDate.value = columnsData + return item = itemData + }) + listInputImpedanceStabilityCheckDate.value = handleSaveDateParams(columns_stability_inputImpedance_checkDate.value, listInputImpedanceStabilityCheckDate.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityCheckDate.value = listVoltageFlatnessStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness_checkDate.value, num, 3, '13') + columns_stability_voltage_flatness_checkDate.value = columnsData + return item = itemData + }) + listVoltageFlatnessStabilityCheckDate.value = handleSaveDateParams(columns_stability_voltage_flatness_checkDate.value, listVoltageFlatnessStabilityCheckDate.value, 3) + } + + 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 + }) } /** @@ -1751,6 +1736,33 @@ return true } +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + + tempList = tempList.concat( + listTimeMarkRepeatability.value, // 时标-重复性 + listSquareWaveVoltage50ΩRepeatability.value, // 方波电压(50Ω)-重复性 + listSquareWaveVoltage1MΩRepeatability.value, // 方波电压(1MΩ)-重复性 + listDirectVoltage50ΩRepeatability.value, // 直流电压(50Ω)-重复性 + listDirectVoltage1MΩRepeatability.value, // 直流电压(1MΩ)-重复性 + listInputImpedanceRepeatability.value, // 输入阻抗-重复性 + listVoltageFlatnessRepeatability.value, // 稳幅正弦信号电压平坦度-重复性 + listRisetimeRepeatability.value, // 上升时间-重复性 + + listTimeMarkStability.value, // 时标-稳定性 + listSquareWaveVoltage50ΩStability.value, // 方波电压(50Ω)-稳定性 + listSquareWaveVoltage1MΩStability.value, // 方波电压(1MΩ)-稳定性 + listDirectVoltage50ΩStability.value, // 直流电压(50Ω)-稳定性 + listDirectVoltage1MΩStability.value, // 直流电压(1MΩ)-稳定性 + listInputImpedanceStability.value, // 输入阻抗-稳定性 + listVoltageFlatnessStability.value, // 稳幅正弦信号电压平坦度-稳定性 + listRisetimeStability.value, // 上升时间-稳定性 + ) + return tempList +} + // 点击表头日期查询历史稳定性数据 const handleClickHeader = (val: any, checkDateDetailId: string) => { dateArrStability.value = ['核查数据', val.label] @@ -1827,13 +1839,7 @@ watch(() => props.checkDate, (newValue) => { initColumns() nextTick(() => { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 }) }, { immediate: true }) @@ -1845,12 +1851,12 @@ fetchInfo() } }) -defineExpose({ fetchCheckItemDetail, checkList }) +defineExpose({ fetchCheckItemDetail, checkList, solveDataBeforeSave, form }) @@ -2274,6 +2285,32 @@ + + + + + + + + + + + + + + + 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 3d6d5ef..70c18fa 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts +++ b/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts @@ -10,6 +10,7 @@ unit?: string // 核查点单位/快沿单位(上升时间)(字典value) averageValue?: string // 平均值 standardDeviation?: string // 重复性Sn(x) + referencePoint?: number // 参考点 testValueOne?: string // 测量值1/测量值(上升时间) testValueTwo?: string // 测量值2(示值) diff --git a/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts b/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts index 3850229..32e5caa 100644 --- a/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts +++ b/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts @@ -102,6 +102,7 @@ * @param stabilityColumns 稳定性表头 * @param num 控制表头日期从第几个开始填 ---查询历史日期从最后一个填,核查数据需要从倒数第二个填,因为最后一个要是本次核查日期 * @param columnsNum 示值的索引 + * @param 参与比较的属性 * @returns itemData 处理完的行数据 columnsData 表头 */ export function solveHistoryIndicationTableData( @@ -110,15 +111,21 @@ stabilityColumns: any, num = 4, columnsNum = 5, + belongStandardEquipment = '', ) { - console.log('llllll', value) - - // 先找出此行数据的所有日期 - const list = value.filter( - (i: { checkPoint: string; params: string }) => - i.params === item.params && i.checkPoint === item.checkPoint, - ) - console.log('0909090', list) + let list = [] + if (belongStandardEquipment === '13') { // 示波器 + // 先找出此行数据的所有日期 + list = value.filter( + (i: any) => i.params === item.params && i.checkPoint === item.checkPoint && i.unit === item.unit, + ) + } + else { + // 先找出此行数据的所有日期 + list = value.filter( + (i: any) => i.params === item.params && i.checkPoint === item.checkPoint, + ) + } // 按照时间倒序排序 list.sort((i: { testValueDate: string }, j: { testValueDate: string }) => { @@ -133,10 +140,8 @@ index: number, ) => { stabilityColumns[columnsNum].children![num - index].text = e.testValueDate // 填表头 - stabilityColumns[columnsNum].children![num - index].checkDateDetailId - = e.id // id用来查对应日期的详情 - item[stabilityColumns[columnsNum].children![num - index].value] - = e.testValue // 填表格数据 + stabilityColumns[columnsNum].children![num - index].checkDateDetailId = e.id // id用来查对应日期的详情 + item[stabilityColumns[columnsNum].children![num - index].value] = e.testValue // 填表格数据 }, ) diff --git a/src/views/equipement/standard/checkData/detail.vue b/src/views/equipement/standard/checkData/detail.vue index 8bbac85..6454fcb 100644 --- a/src/views/equipement/standard/checkData/detail.vue +++ b/src/views/equipement/standard/checkData/detail.vue @@ -454,20 +454,29 @@ } else if (belongStandardEquipment.value === '13') { // 示波器 if (!checkDataRef.value.checkList()) { params = '未通过校验'; return params } - // const list = checkDataRef.value.getList() - // params = { - // ...form.value, - // checkEquipmentIdList: equipmentList.value.map(item => item.id), // 核查标准设备 - // equipmentName: chekedEquipmentList.value[0].equipmentName, // 被核查标准设备名称 - // equipmentId: chekedEquipmentList.value[0].equipmentId, // 被核查标准设备id - // createUserId: user.id, // 核查员id - // createUserName: user.name, // 核查员 - // itemCategoryId: chekedEquipmentList.value[0].itemCategoryId, // 核查项分类id - // itemCategoryName: itemCategoryName.value, // 核查项分类name - // standardEquipmentId: selectStandardId.value, // 被核查标准装置id - // id: infoId.value, - // belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 - // } + const list = checkDataRef.value.solveDataBeforeSave() + params = { + ...form.value, + checkEquipmentIdList: equipmentList.value.map(item => item.id), // 核查标准设备 + equipmentName: chekedEquipmentList.value[0].equipmentName, // 被核查标准设备名称 + equipmentId: chekedEquipmentList.value[0].equipmentId, // 被核查标准设备id + createUserId: user.id, // 核查员id + createUserName: user.name, // 核查员 + itemCategoryId: chekedEquipmentList.value[0].itemCategoryId, // 核查项分类id + itemCategoryName: itemCategoryName.value, // 核查项分类name + standardEquipmentId: selectStandardId.value, // 被核查标准装置id + id: infoId.value, + belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 + checkDataOscilloscopeList: list.map((item: { id: string; conclusion: string }) => { + return { + ...item, + id: pageType.value === 'add' ? '' : item.id, + conclusion: item.conclusion === '合格' ? 1 : item.conclusion === '不合格' ? 0 : '', + } + }), // 核查数据 + conclusion: checkDataRef.value.form.qualified === '合格' ? '合格' : '不合格', // 结论,与稳定性考核相同,后端需要这个字段差稳定性历史数据 + remark: checkDataRef.value.form.remark, + } } else if (belongStandardEquipment.value === '14') { // 铯原子 // if (!checkDataRef.value.checkList()) { params = '未通过校验'; return params } @@ -852,7 +861,7 @@ - + diff --git a/src/views/equipement/standard/book/components/config/tenth/config.vue b/src/views/equipement/standard/book/components/config/tenth/config.vue index 5fc9d30..f662e17 100644 --- a/src/views/equipement/standard/book/components/config/tenth/config.vue +++ b/src/views/equipement/standard/book/components/config/tenth/config.vue @@ -9,6 +9,7 @@ import { config, getCheckItemDetail } from '@/api/equipment/standard/book' import { calc } from '@/utils/useCalc' import { getDictByCode } from '@/api/system/dict' +import { differenceArray } from '@/utils/Array' const textMap: { [key: string]: string } = { edit: '编辑', @@ -59,7 +60,7 @@ const checkoutPhaseList = ref([]) // 调相相偏多选 const checkoutFrequencySpectrumList = ref([]) // 谐波多选 -const frequency = ref(true) // 是否显示频率 +const frequency = ref(true) // 频率 const powerLevel = ref(true) // 功率 const relativeLevel = ref(true) // 相对电平 const AMDepth = ref(true) // 调幅度 @@ -122,7 +123,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true }, + { text: '调频频偏', value: 'frequencyDeviation', align: 'center', required: true, width: '180' }, { text: '调频频偏单位', value: 'frequencyDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -141,7 +142,7 @@ { text: '核查项目', value: 'params', align: 'center', required: true }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, width: '180' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, width: '100' }, - { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true }, + { text: '调相相偏', value: 'phaseDeviation', align: 'center', required: true, width: '180' }, { text: '调相相偏单位', value: 'phaseDeviationUnit', align: 'center', required: true }, { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, @@ -488,7 +489,13 @@ ElMessage.warning('谐波 不能为空') return false } - + let frequencyResult = true // 频率 + let powerLevelResult = true // 功率 + let relativeLevelResult = true // 相对电平 + let AMDepthResult = true // 调幅度 + let frequencyModulationDeviationResult = true // 调频频偏 + let phaseResult = true // 调相相偏 + let frequencySpectrumResult = true // 谐波 if (frequency.value) { frequencyResult = checkList(listFrequency.value, '频率') } @@ -595,12 +602,11 @@ // 点击保存 const save = () => { - if (!checkReferencePoint()) { return false } if (!checkListBeforeSave()) { return false } const list = solveDataBeforeSave() const params = { itemCategoryId: form.value.itemCategoryId, // 核查项分类id - checkItemDataOscilloscopeList: list, + checkItemDataSignalGeneratorList: list, equipmentId: equipmentId.value, } const loading = ElLoading.service({ @@ -762,7 +768,7 @@ 增加行 - + 删除行 @@ -780,7 +786,7 @@ 增加行 - + 删除行 @@ -798,7 +804,7 @@ 增加行 - + 删除行 @@ -816,7 +822,7 @@ 增加行 - + 删除行 @@ -834,7 +840,7 @@ 增加行 - + 删除行 @@ -852,7 +858,7 @@ 增加行 - + 删除行 @@ -870,7 +876,7 @@ 增加行 - + 删除行 diff --git a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue index 24703fb..727432c 100644 --- a/src/views/equipement/standard/book/components/config/tenth/templateTable.vue +++ b/src/views/equipement/standard/book/components/config/tenth/templateTable.vue @@ -38,22 +38,28 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 +const standardFrequencyUnitList = ref([]) // 频率单位公用 +const standardAmplitudeUnitList = ref([]) // 幅度单位公用 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 幅度单位公用 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -86,10 +92,6 @@ emit('change') } -// 多选选中结果 -function selectionChange(selection: []) { - emit('selectionChange', selection) -} // 点击行 function rowClick(row: object, column?: any, event?: any) { emit('rowClick', row) @@ -105,7 +107,7 @@ }) // 多选 const handleSelectionChange = (val: any) => { - emit('multiSelect', val) + emit('selectionChange', val) } // 清除多选选中 const clearMulti = () => { @@ -149,6 +151,110 @@ + diff --git a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue index 34d583a..478196e 100644 --- a/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/fifth/checkDataCom.vue @@ -786,7 +786,7 @@ const num = props.pageType === 'edit' ? 5 : 4 // 温度值 temperatureListStability.value = temperatureListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_temperature.value, num, 3) columns_stability_temperature.value = columnsData return item = itemData @@ -794,7 +794,7 @@ temperatureListStability.value = handleSaveDateParams(columns_stability_temperature.value, temperatureListStability.value, 3) // RTP值 RTPListStability.value = RTPListStability.value.map((item) => { - clearDateValue(item) + // clearDateValue(item) const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data, item, columns_stability_RTP.value, num, 3) columns_stability_RTP.value = columnsData return item = itemData diff --git a/src/views/equipement/standard/checkData/components/thirteenth/11.vue b/src/views/equipement/standard/checkData/components/thirteenth/11.vue deleted file mode 100644 index 263ff3c..0000000 --- a/src/views/equipement/standard/checkData/components/thirteenth/11.vue +++ /dev/null @@ -1,79 +0,0 @@ - diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index f7f9a68..8fb2bb1 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -13,6 +13,8 @@ import multiTable from '@/components/MultiHeaderTable/index.vue' import { addCheckData, calculateHandle, getHistoryIndication, getInfo, updateCheckData } from '@/api/equipment/standard/checkData' import { getCheckItemDetail, getJobInstructionList } from '@/api/equipment/standard/book' +import { useGroup } from '@/commonMethods/useGroup' + const props = defineProps({ selectStandardId: { // 选择的标准装置id type: String, @@ -33,6 +35,7 @@ const itemCategoryName = ref('') // 核查项分类名称 const form = ref({ remark: '/', // 备注 + qualified: '', // 稳定性考核是否合格 }) const equipmentId = ref('') // 设备id const dateArrStability = ref([]) // 稳定性日期数组 @@ -210,7 +213,7 @@ { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false }, { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false }, { text: '探头规格型号', value: 'model', align: 'center', required: false }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180' }, + { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '220' }, ]) const columns_stability_timeMark = ref([ // 稳定性表头--时标 @@ -627,14 +630,7 @@ getCheckItemDetail(params).then((res) => { loading.close() handleData(res.data.checkItemDataOscilloscopeList) - // fetchHistoryIndication() // 获取稳定性 - fetchHistoryIndication('时标') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性 + fetchHistoryIndication() // 重新拉取稳定性 }) } @@ -679,6 +675,7 @@ dataId: e.dataId, // 核查数据管理基础信息表id id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 + dataType: '1', checkPoint: e.checkPoint, unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 @@ -732,6 +729,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '2', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -783,6 +781,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '3', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -834,6 +833,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '4', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -885,6 +885,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '5', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -936,6 +937,7 @@ id: '', // id,更新/删除使用参数 params: e.params, // 核查项目 checkPoint: e.checkPoint, + dataType: '6', unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 checkType: '稳定性', @@ -1004,9 +1006,11 @@ params: e.params, // 核查项目 checkPoint: e.checkPoint, // 核查点 unit: e.unit, // 单位(直接存字典value) - checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkPointDefineFront: e.checkPointDefineFront, // 核查点 referencePoint: e.referencePoint, // 是否为参考点 checkType: '稳定性', + dataType: '7', + typeValue: e.typeValue, // 类型 averageValue: '', // 平均值 stability: '', // 稳定性 maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 @@ -1015,6 +1019,9 @@ conclusion: '', // 结论 } }) + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') // 上升时间 listRisetimeRepeatability.value = list.filter((item: { params: string }) => item.params === '上升时间') @@ -1035,6 +1042,7 @@ equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: '', // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1051,10 +1059,12 @@ unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 快沿 checkType: '稳定性', + dataType: '8', manufactureNo: e.manufactureNo, // 探头出厂编号 equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 testValueOne: e.testValueOne, // 测量值 + testValueUnit: e.unit, // 测量值单位 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 @@ -1137,7 +1147,12 @@ const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 - checkDataOscilloscopeList: checkDataOscilloscopeListParams, + checkDataOscilloscopeList: checkDataOscilloscopeListParams.map((item: { conclusion: string }) => { + return { + ...item, + conclusion: '', + } + }), itemCategoryId: itemCategoryId.value, // 核查项分类id itemCategoryName: itemCategoryName.value, // 核查项分类id } @@ -1151,14 +1166,14 @@ 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' + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true calculateHandle(params).then((res) => { const result = res.data.filter((item: { params: string }) => item.params === type).map((item: any) => { @@ -1168,9 +1183,9 @@ editable: props.pageType !== 'detail', } }) - switch (type) { - case '时标': - if (current.value === 'repeatability') { // 重复性 + if (current.value === 'repeatability') { // 重复性 + switch (type) { + case '时标': listTimeMarkRepeatability.value = result // 填充稳定性最后一列的日期和数值 listTimeMarkStability.value = listTimeMarkStability.value.map((item, index: number) => { @@ -1180,13 +1195,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listTimeMarkStability.value = result - } - break - case '方波电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(50Ω)': listSquareWaveVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item, index: number) => { @@ -1196,13 +1206,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage50ΩStability.value = result - } - break - case '方波电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '方波电压(1MΩ)': listSquareWaveVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item, index: number) => { @@ -1212,13 +1217,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listSquareWaveVoltage1MΩStability.value = result - } - break - case '直流电压(50Ω)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(50Ω)': listDirectVoltage50ΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item, index: number) => { @@ -1228,13 +1228,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage50ΩStability.value = result - } - break - case '直流电压(1MΩ)': - if (current.value === 'repeatability') { // 重复性 + break + case '直流电压(1MΩ)': listDirectVoltage1MΩRepeatability.value = result // 填充稳定性最后一列的日期和数值 listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item, index: number) => { @@ -1244,13 +1239,8 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listDirectVoltage1MΩStability.value = result - } - break - case '输入阻抗': - if (current.value === 'repeatability') { // 重复性 + break + case '输入阻抗': listInputImpedanceRepeatability.value = result // 填充稳定性最后一列的日期和数值 listInputImpedanceStability.value = listInputImpedanceStability.value.map((item, index: number) => { @@ -1260,14 +1250,9 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) - } - else { // 稳定性 - listInputImpedanceStability.value = result - } - break - case '稳幅正弦信号电压平坦度': - if (current.value === 'repeatability') { // 重复性 - listVoltageFlatnessRepeatability.value = result.map((item) => { + break + case '稳幅正弦信号电压平坦度': + listVoltageFlatnessRepeatability.value = result.map((item: any) => { let tempCheckPoint = item.checkPoint + item.unit if (`${item.referencePoint}` === '1') { tempCheckPoint = `${tempCheckPoint}(参考)` @@ -1283,15 +1268,13 @@ ...item, testValueSix: listVoltageFlatnessRepeatability.value[index].averageValue, // 测量差值 testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) + testValueUnit: listVoltageFlatnessRepeatability.value[index].testValueUnit, // 测量值单位 + convertVoltageUnit: listVoltageFlatnessRepeatability.value[index].convertVoltageUnit, // 转换为电压值单位 } }) - } - else { // 稳定性 - listVoltageFlatnessStability.value = result - } - break - case '上升时间': - if (current.value === 'repeatability') { // 重复性 + + break + case '上升时间': listRisetimeRepeatability.value = result // 填充稳定性最后一列的日期和数值 listRisetimeStability.value = listRisetimeStability.value.map((item, index: number) => { @@ -1301,13 +1284,42 @@ testValueSixDate: props.checkDate, // 核查读数6日期(本次核查日期) } }) + break + default: + break + } + } + else if (current.value === 'stability') { // 稳定性 + const resultList = res.data.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (item.params === '稳幅正弦信号电压平坦度' && `${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` } - else { // 稳定性 - listRisetimeStability.value = result + return { + ...item, + conclusion: (`${item.conclusion}` === '1' || `${item.conclusion}` === '') ? '合格' : '不合格', + checkPointDefineFront: tempCheckPoint, // 核查点 + editable: props.pageType !== 'detail', + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, } - break - default: - break + }) + + listTimeMarkStability.value = resultList.filter((item: { params: string }) => item.params === '时标') + listSquareWaveVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(50Ω)') + listSquareWaveVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '方波电压(1MΩ)') + listDirectVoltage50ΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(50Ω)') + listDirectVoltage1MΩStability.value = resultList.filter((item: { params: string }) => item.params === '直流电压(1MΩ)') + listInputImpedanceStability.value = resultList.filter((item: { params: string }) => item.params === '输入阻抗') + listVoltageFlatnessStability.value = resultList.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') + listRisetimeStability.value = resultList.filter((item: { params: string }) => item.params === '上升时间') + + // 计算稳定性考核是否合格 + if (resultList.every((item: { conclusion: string | number }) => item.conclusion === '合格')) { + form.value.qualified = '合格' + } + else { + form.value.qualified = '不合格' + } } listTimeMarkRepeatabilityLoading.value = false // 时标-重复性Loading @@ -1351,10 +1363,28 @@ // 处理详情数据 const solveGetDetailData = (responseList: any) => { console.log('处理详情数据', props.pageType) - const list = responseList.map((item: { editable: boolean }) => { + form.value.qualified = responseList[0].qualified === 1 ? '合格' : '不合格' + const list = responseList.map((item: any) => { + let tempCheckPoint = item.checkPoint + item.unit + if (`${item.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` + } return { ...item, editable: props.pageType !== 'detail', + checkPointDefineFront: tempCheckPoint, // 核查点 + conclusion: `${item.conclusion}` === '1' ? '合格' : '不合格', + testValueOne: item.checkType === '稳定性' ? item.testValueOne : Number(item.testValueOne), // 测量值1/测量值(上升时间) + testValueTwo: item.checkType === '稳定性' ? item.testValueTwo : Number(item.testValueTwo), // 测量值2(示值) + testValueThree: item.checkType === '稳定性' ? item.testValueThree : Number(item.testValueThree), // 测量值3(示值) + testValueFour: item.checkType === '稳定性' ? item.testValueFour : Number(item.testValueFour), // 测量值4(示值) + testValueFive: item.checkType === '稳定性' ? item.testValueFive : Number(item.testValueFive), // 测量值5(示值) + testValueSix: item.checkType === '稳定性' ? item.testValueSix : Number(item.testValueSix), // 测量值6(本次示值) + testValueSeven: item.checkType === '稳定性' ? item.testValueSeven : Number(item.testValueSeven), // 测量值7 + testValueEight: item.checkType === '稳定性' ? item.testValueEight : Number(item.testValueEight), // 测量值8 + testValueNine: item.checkType === '稳定性' ? item.testValueNine : Number(item.testValueNine), // 测量值9 + testValueTen: item.checkType === '稳定性' ? item.testValueTen : Number(item.testValueTen), // 测量值10 + technicalIndexDefineFront: item.technicalIndexSymbol + item.technicalIndex + item.technicalIndexUnit, // 技术指标 } }) @@ -1433,6 +1463,8 @@ listDirectVoltage1MΩRepeatabilityCheckDate.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatabilityCheckDate.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatabilityCheckDate.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatabilityCheckDate.value = useGroup(listVoltageFlatnessRepeatabilityCheckDate.value, 'typeValue') listRisetimeRepeatabilityCheckDate.value = templistRisetimeRepeatability listTimeMarkStabilityCheckDate.value = templistTimeMarkStability @@ -1442,6 +1474,8 @@ listDirectVoltage1MΩStabilityCheckDate.value = templistDirectVoltage1MΩStability listInputImpedanceStabilityCheckDate.value = templistInputImpedanceStability listVoltageFlatnessStabilityCheckDate.value = templistVoltageFlatnessStability + // 数据根据类型分组 + listVoltageFlatnessStabilityCheckDate.value = useGroup(listVoltageFlatnessStabilityCheckDate.value, 'typeValue') listRisetimeStabilityCheckDate.value = templistRisetimeStability } else { @@ -1452,6 +1486,8 @@ listDirectVoltage1MΩRepeatability.value = templistDirectVoltage1MΩRepeatability listInputImpedanceRepeatability.value = templistInputImpedanceRepeatability listVoltageFlatnessRepeatability.value = templistVoltageFlatnessRepeatability + // 数据根据类型分组 + listVoltageFlatnessRepeatability.value = useGroup(listVoltageFlatnessRepeatability.value, 'typeValue') listRisetimeRepeatability.value = templistRisetimeRepeatability listTimeMarkStability.value = templistTimeMarkStability @@ -1461,6 +1497,7 @@ listDirectVoltage1MΩStability.value = templistDirectVoltage1MΩStability listInputImpedanceStability.value = templistInputImpedanceStability listVoltageFlatnessStability.value = templistVoltageFlatnessStability + listVoltageFlatnessStability.value = useGroup(listVoltageFlatnessStability.value, 'typeValue') listRisetimeStability.value = templistRisetimeStability } @@ -1485,24 +1522,18 @@ 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) + columns_stability_timeMark.value = handleDetailTableTableHead(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + columns_stability_squareWaveVoltage50Ω.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + columns_stability_squareWaveVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + columns_stability_directVoltage50Ω.value = handleDetailTableTableHead(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + columns_stability_directVoltage1MΩ.value = handleDetailTableTableHead(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + columns_stability_inputImpedance.value = handleDetailTableTableHead(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + columns_stability_voltage_flatness.value = handleDetailTableTableHead(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) } }) if (props.pageType === 'edit') { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 } loading.close() }) @@ -1512,207 +1543,161 @@ * 获取稳定性示值 * @param date 查询日期 */ -function fetchHistoryIndication(type: string, date = '') { +function fetchHistoryIndication(date = '') { + if (!equipmentId.value || !props.selectStandardId) { return false } const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) checkDate: date || props.checkDate!, // 核查日期 checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) - conclusion: '是', // 结论 + conclusion: '合格', // 结论 equipmentId: equipmentId.value, // 被核查设备id - params: type, // 核查项目 + params: '', // 核查项目 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 - }) + listTimeMarkStabilityLoading.value = true + listSquareWaveVoltage50ΩStabilityLoading.value = true + listSquareWaveVoltage1MΩStabilityLoading.value = true + listDirectVoltage50ΩStabilityLoading.value = true + listDirectVoltage1MΩStabilityLoading.value = true + listInputImpedanceStabilityLoading.value = true + listVoltageFlatnessStabilityLoading.value = true + listRisetimeStabilityLoading.value = true } + getHistoryIndication(params).then((res) => { + if (date === '') { // 正常核查数据 + const num = props.pageType === 'edit' ? 5 : 4 + // '时标': + listTimeMarkStability.value = listTimeMarkStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark.value, num, 2, '13') + console.log('columnsData', columnsData[2]) + + columns_stability_timeMark.value = columnsData + return item = itemData + }) + listTimeMarkStability.value = handleSaveDateParams(columns_stability_timeMark.value, listTimeMarkStability.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStability.value = listSquareWaveVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω.value, listSquareWaveVoltage50ΩStability.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStability.value = listSquareWaveVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStability.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ.value, listSquareWaveVoltage1MΩStability.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStability.value = listDirectVoltage50ΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω.value, num, 2, '13') + columns_stability_directVoltage50Ω.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStability.value = handleSaveDateParams(columns_stability_directVoltage50Ω.value, listDirectVoltage50ΩStability.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStability.value = listDirectVoltage1MΩStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ.value, num, 2, '13') + columns_stability_directVoltage1MΩ.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStability.value = handleSaveDateParams(columns_stability_directVoltage1MΩ.value, listDirectVoltage1MΩStability.value, 2) + // '输入阻抗': + listInputImpedanceStability.value = listInputImpedanceStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance.value, num, 2, '13') + columns_stability_inputImpedance.value = columnsData + return item = itemData + }) + listInputImpedanceStability.value = handleSaveDateParams(columns_stability_inputImpedance.value, listInputImpedanceStability.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStability.value = listVoltageFlatnessStability.value.map((item) => { + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness.value, num, 3, '13') + columns_stability_voltage_flatness.value = columnsData + return item = itemData + }) + listVoltageFlatnessStability.value = handleSaveDateParams(columns_stability_voltage_flatness.value, listVoltageFlatnessStability.value, 3) + } + else { + const num = 5 + // '时标': + listTimeMarkStabilityCheckDate.value = listTimeMarkStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '时标'), item, columns_stability_timeMark_checkDate.value, num, 2, '13') + columns_stability_timeMark_checkDate.value = columnsData + return item = itemData + }) + listTimeMarkStabilityCheckDate.value = handleSaveDateParams(columns_stability_timeMark_checkDate.value, listTimeMarkStabilityCheckDate.value, 2) + // '方波电压(50Ω)': + listSquareWaveVoltage50ΩStabilityCheckDate.value = listSquareWaveVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(50Ω)'), item, columns_stability_squareWaveVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage50Ω_checkDate.value, listSquareWaveVoltage50ΩStabilityCheckDate.value, 2) + // '方波电压(1MΩ)': + listSquareWaveVoltage1MΩStabilityCheckDate.value = listSquareWaveVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '方波电压(1MΩ)'), item, columns_stability_squareWaveVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_squareWaveVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listSquareWaveVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_squareWaveVoltage1MΩ_checkDate.value, listSquareWaveVoltage1MΩStabilityCheckDate.value, 2) + // '直流电压(50Ω)': + listDirectVoltage50ΩStabilityCheckDate.value = listDirectVoltage50ΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(50Ω)'), item, columns_stability_directVoltage50Ω_checkDate.value, num, 2, '13') + columns_stability_directVoltage50Ω_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage50ΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage50Ω_checkDate.value, listDirectVoltage50ΩStabilityCheckDate.value, 2) + // '直流电压(1MΩ)': + listDirectVoltage1MΩStabilityCheckDate.value = listDirectVoltage1MΩStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '直流电压(1MΩ)'), item, columns_stability_directVoltage1MΩ_checkDate.value, num, 2, '13') + columns_stability_directVoltage1MΩ_checkDate.value = columnsData + return item = itemData + }) + listDirectVoltage1MΩStabilityCheckDate.value = handleSaveDateParams(columns_stability_directVoltage1MΩ_checkDate.value, listDirectVoltage1MΩStabilityCheckDate.value, 2) + // '输入阻抗': + listInputImpedanceStabilityCheckDate.value = listInputImpedanceStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '输入阻抗'), item, columns_stability_inputImpedance_checkDate.value, num, 2, '13') + columns_stability_inputImpedance_checkDate.value = columnsData + return item = itemData + }) + listInputImpedanceStabilityCheckDate.value = handleSaveDateParams(columns_stability_inputImpedance_checkDate.value, listInputImpedanceStabilityCheckDate.value, 2) + // '稳幅正弦信号电压平坦度': + listVoltageFlatnessStabilityCheckDate.value = listVoltageFlatnessStabilityCheckDate.value.map((item) => { + clearDateValue(item) + const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度'), item, columns_stability_voltage_flatness_checkDate.value, num, 3, '13') + columns_stability_voltage_flatness_checkDate.value = columnsData + return item = itemData + }) + listVoltageFlatnessStabilityCheckDate.value = handleSaveDateParams(columns_stability_voltage_flatness_checkDate.value, listVoltageFlatnessStabilityCheckDate.value, 3) + } + + 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 + }) } /** @@ -1751,6 +1736,33 @@ return true } +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + + tempList = tempList.concat( + listTimeMarkRepeatability.value, // 时标-重复性 + listSquareWaveVoltage50ΩRepeatability.value, // 方波电压(50Ω)-重复性 + listSquareWaveVoltage1MΩRepeatability.value, // 方波电压(1MΩ)-重复性 + listDirectVoltage50ΩRepeatability.value, // 直流电压(50Ω)-重复性 + listDirectVoltage1MΩRepeatability.value, // 直流电压(1MΩ)-重复性 + listInputImpedanceRepeatability.value, // 输入阻抗-重复性 + listVoltageFlatnessRepeatability.value, // 稳幅正弦信号电压平坦度-重复性 + listRisetimeRepeatability.value, // 上升时间-重复性 + + listTimeMarkStability.value, // 时标-稳定性 + listSquareWaveVoltage50ΩStability.value, // 方波电压(50Ω)-稳定性 + listSquareWaveVoltage1MΩStability.value, // 方波电压(1MΩ)-稳定性 + listDirectVoltage50ΩStability.value, // 直流电压(50Ω)-稳定性 + listDirectVoltage1MΩStability.value, // 直流电压(1MΩ)-稳定性 + listInputImpedanceStability.value, // 输入阻抗-稳定性 + listVoltageFlatnessStability.value, // 稳幅正弦信号电压平坦度-稳定性 + listRisetimeStability.value, // 上升时间-稳定性 + ) + return tempList +} + // 点击表头日期查询历史稳定性数据 const handleClickHeader = (val: any, checkDateDetailId: string) => { dateArrStability.value = ['核查数据', val.label] @@ -1827,13 +1839,7 @@ watch(() => props.checkDate, (newValue) => { initColumns() nextTick(() => { - fetchHistoryIndication('时标') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('方波电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(50Ω)') // 重新拉取稳定性日期 - fetchHistoryIndication('直流电压(1MΩ)') // 重新拉取稳定性日期 - fetchHistoryIndication('输入阻抗') // 重新拉取稳定性日期 - fetchHistoryIndication('稳幅正弦信号电压平坦度') // 重新拉取稳定性日期 + fetchHistoryIndication() // 重新拉取稳定性日期 }) }, { immediate: true }) @@ -1845,12 +1851,12 @@ fetchInfo() } }) -defineExpose({ fetchCheckItemDetail, checkList }) +defineExpose({ fetchCheckItemDetail, checkList, solveDataBeforeSave, form }) @@ -2274,6 +2285,32 @@ + + + + + + + + + + + + + + + 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 3d6d5ef..70c18fa 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts +++ b/src/views/equipement/standard/checkData/components/thirteenth/thirteenth-interface.ts @@ -10,6 +10,7 @@ unit?: string // 核查点单位/快沿单位(上升时间)(字典value) averageValue?: string // 平均值 standardDeviation?: string // 重复性Sn(x) + referencePoint?: number // 参考点 testValueOne?: string // 测量值1/测量值(上升时间) testValueTwo?: string // 测量值2(示值) diff --git a/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts b/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts index 3850229..32e5caa 100644 --- a/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts +++ b/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts @@ -102,6 +102,7 @@ * @param stabilityColumns 稳定性表头 * @param num 控制表头日期从第几个开始填 ---查询历史日期从最后一个填,核查数据需要从倒数第二个填,因为最后一个要是本次核查日期 * @param columnsNum 示值的索引 + * @param 参与比较的属性 * @returns itemData 处理完的行数据 columnsData 表头 */ export function solveHistoryIndicationTableData( @@ -110,15 +111,21 @@ stabilityColumns: any, num = 4, columnsNum = 5, + belongStandardEquipment = '', ) { - console.log('llllll', value) - - // 先找出此行数据的所有日期 - const list = value.filter( - (i: { checkPoint: string; params: string }) => - i.params === item.params && i.checkPoint === item.checkPoint, - ) - console.log('0909090', list) + let list = [] + if (belongStandardEquipment === '13') { // 示波器 + // 先找出此行数据的所有日期 + list = value.filter( + (i: any) => i.params === item.params && i.checkPoint === item.checkPoint && i.unit === item.unit, + ) + } + else { + // 先找出此行数据的所有日期 + list = value.filter( + (i: any) => i.params === item.params && i.checkPoint === item.checkPoint, + ) + } // 按照时间倒序排序 list.sort((i: { testValueDate: string }, j: { testValueDate: string }) => { @@ -133,10 +140,8 @@ index: number, ) => { stabilityColumns[columnsNum].children![num - index].text = e.testValueDate // 填表头 - stabilityColumns[columnsNum].children![num - index].checkDateDetailId - = e.id // id用来查对应日期的详情 - item[stabilityColumns[columnsNum].children![num - index].value] - = e.testValue // 填表格数据 + stabilityColumns[columnsNum].children![num - index].checkDateDetailId = e.id // id用来查对应日期的详情 + item[stabilityColumns[columnsNum].children![num - index].value] = e.testValue // 填表格数据 }, ) diff --git a/src/views/equipement/standard/checkData/detail.vue b/src/views/equipement/standard/checkData/detail.vue index 8bbac85..6454fcb 100644 --- a/src/views/equipement/standard/checkData/detail.vue +++ b/src/views/equipement/standard/checkData/detail.vue @@ -454,20 +454,29 @@ } else if (belongStandardEquipment.value === '13') { // 示波器 if (!checkDataRef.value.checkList()) { params = '未通过校验'; return params } - // const list = checkDataRef.value.getList() - // params = { - // ...form.value, - // checkEquipmentIdList: equipmentList.value.map(item => item.id), // 核查标准设备 - // equipmentName: chekedEquipmentList.value[0].equipmentName, // 被核查标准设备名称 - // equipmentId: chekedEquipmentList.value[0].equipmentId, // 被核查标准设备id - // createUserId: user.id, // 核查员id - // createUserName: user.name, // 核查员 - // itemCategoryId: chekedEquipmentList.value[0].itemCategoryId, // 核查项分类id - // itemCategoryName: itemCategoryName.value, // 核查项分类name - // standardEquipmentId: selectStandardId.value, // 被核查标准装置id - // id: infoId.value, - // belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 - // } + const list = checkDataRef.value.solveDataBeforeSave() + params = { + ...form.value, + checkEquipmentIdList: equipmentList.value.map(item => item.id), // 核查标准设备 + equipmentName: chekedEquipmentList.value[0].equipmentName, // 被核查标准设备名称 + equipmentId: chekedEquipmentList.value[0].equipmentId, // 被核查标准设备id + createUserId: user.id, // 核查员id + createUserName: user.name, // 核查员 + itemCategoryId: chekedEquipmentList.value[0].itemCategoryId, // 核查项分类id + itemCategoryName: itemCategoryName.value, // 核查项分类name + standardEquipmentId: selectStandardId.value, // 被核查标准装置id + id: infoId.value, + belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 + checkDataOscilloscopeList: list.map((item: { id: string; conclusion: string }) => { + return { + ...item, + id: pageType.value === 'add' ? '' : item.id, + conclusion: item.conclusion === '合格' ? 1 : item.conclusion === '不合格' ? 0 : '', + } + }), // 核查数据 + conclusion: checkDataRef.value.form.qualified === '合格' ? '合格' : '不合格', // 结论,与稳定性考核相同,后端需要这个字段差稳定性历史数据 + remark: checkDataRef.value.form.remark, + } } else if (belongStandardEquipment.value === '14') { // 铯原子 // if (!checkDataRef.value.checkList()) { params = '未通过校验'; return params } @@ -852,7 +861,7 @@ - + diff --git a/src/views/equipement/standard/checkData/dialog/selectStandardEquipmentDialog.vue b/src/views/equipement/standard/checkData/dialog/selectStandardEquipmentDialog.vue index e40b9da..ddef6de 100644 --- a/src/views/equipement/standard/checkData/dialog/selectStandardEquipmentDialog.vue +++ b/src/views/equipement/standard/checkData/dialog/selectStandardEquipmentDialog.vue @@ -263,11 +263,11 @@ - +
@@ -279,7 +279,7 @@ is-showmulti-select :list-loading="equipmentLoadingTable" :is-multi="props.isMulti" - :height="360" + :height="416" :pagination="false" :page-sizes="props.isMulti ? [5] : [20]" @change="changePage"