diff --git a/src/views/equipement/standard/checkData/components/seventeenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/seventeenth/checkDataCom.vue index 0195da6..26afd5a 100644 --- a/src/views/equipement/standard/checkData/components/seventeenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/seventeenth/checkDataCom.vue @@ -803,8 +803,7 @@ columns_stability_phase.value = handleDetailTableTableHead(columns_stability_phase.value, listPhaseStability.value, 4) } }) - - if (props.pageType === 'edit') { + if (props.pageType === 'edit' || props.pageType === 'detail') { fetchHistoryIndication() // 重新拉取稳定性日期 } loading.close() @@ -820,7 +819,7 @@ const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) checkDate: date || props.checkDate!, // 核查日期 - checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) + checkParam: '', // 核查参数 conclusion: '合格', // 结论 equipmentId: equipmentId.value, // 被核查设备id params: '', // 核查项目 @@ -835,7 +834,7 @@ } getHistoryIndication(params).then((res) => { if (date === '') { // 正常核查数据 - const num = props.pageType === 'edit' ? 5 : 4 + const num = (props.pageType === 'edit' || props.pageType === 'detail') ? 5 : 4 // '失配测量': listMismatchStability.value = listMismatchStability.value.map((item) => { const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '失配测量'), item, columns_stability_mismatch.value, num, 4, '17') @@ -860,6 +859,7 @@ } else { const num = 5 + initColumnsCheckDate() // '失配测量': listMismatchStabilityCheckDate.value = listMismatchStabilityCheckDate.value.map((item) => { clearDateValue(item) @@ -996,6 +996,32 @@ columns_stability_attenuation.value[4].children![5].text = props.checkDate! // 最后一列的表头日期 columns_stability_phase.value[4].children![5].text = props.checkDate! } + +/** + * 初始化CheckDate表头 + * @param soveLastColumnDate 是否处理最后一列 + */ +function initColumnsCheckDate() { + const tempColumn_mismatch = [ + { width: '220', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ] as any + const tempColumn = [ + { width: '220', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + ] as any + columns_stability_mismatch_checkDate.value[4].children = [...tempColumn_mismatch] + columns_stability_attenuation_checkDate.value[4].children = [...tempColumn] + columns_stability_phase_checkDate.value[4].children = [...tempColumn] +} // 监听核查日期变化 watch(() => props.checkDate, (newValue) => { initColumns() @@ -1009,6 +1035,8 @@ itemCategoryId.value = $route.query.itemCategoryId as string // 核查项分类id itemCategoryName.value = $route.query.itemCategoryName as string // 核查项分类名称 if (props.pageType !== 'add') { + console.log('0000000', '获取详情') + fetchInfo() } }) diff --git a/src/views/equipement/standard/checkData/components/seventeenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/seventeenth/checkDataCom.vue index 0195da6..26afd5a 100644 --- a/src/views/equipement/standard/checkData/components/seventeenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/seventeenth/checkDataCom.vue @@ -803,8 +803,7 @@ columns_stability_phase.value = handleDetailTableTableHead(columns_stability_phase.value, listPhaseStability.value, 4) } }) - - if (props.pageType === 'edit') { + if (props.pageType === 'edit' || props.pageType === 'detail') { fetchHistoryIndication() // 重新拉取稳定性日期 } loading.close() @@ -820,7 +819,7 @@ const params = { belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置(字典code) checkDate: date || props.checkDate!, // 核查日期 - checkParam: '', // 核查参数((直流稳压电源-直接电流(间接测量)) + checkParam: '', // 核查参数 conclusion: '合格', // 结论 equipmentId: equipmentId.value, // 被核查设备id params: '', // 核查项目 @@ -835,7 +834,7 @@ } getHistoryIndication(params).then((res) => { if (date === '') { // 正常核查数据 - const num = props.pageType === 'edit' ? 5 : 4 + const num = (props.pageType === 'edit' || props.pageType === 'detail') ? 5 : 4 // '失配测量': listMismatchStability.value = listMismatchStability.value.map((item) => { const { itemData, columnsData } = solveHistoryIndicationTableData(res.data.data.filter((item: { params: string }) => item.params === '失配测量'), item, columns_stability_mismatch.value, num, 4, '17') @@ -860,6 +859,7 @@ } else { const num = 5 + initColumnsCheckDate() // '失配测量': listMismatchStabilityCheckDate.value = listMismatchStabilityCheckDate.value.map((item) => { clearDateValue(item) @@ -996,6 +996,32 @@ columns_stability_attenuation.value[4].children![5].text = props.checkDate! // 最后一列的表头日期 columns_stability_phase.value[4].children![5].text = props.checkDate! } + +/** + * 初始化CheckDate表头 + * @param soveLastColumnDate 是否处理最后一列 + */ +function initColumnsCheckDate() { + const tempColumn_mismatch = [ + { width: '220', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true }, + { width: '220', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true }, + ] as any + const tempColumn = [ + { width: '220', text: '-', value: 'testValueOne', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueTwo', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueThree', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueFour', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueFive', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + { width: '220', text: '-', value: 'testValueSix', align: 'center', required: false, type: 'text', customHeader: true, precision: 3, showUnit: true }, + ] as any + columns_stability_mismatch_checkDate.value[4].children = [...tempColumn_mismatch] + columns_stability_attenuation_checkDate.value[4].children = [...tempColumn] + columns_stability_phase_checkDate.value[4].children = [...tempColumn] +} // 监听核查日期变化 watch(() => props.checkDate, (newValue) => { initColumns() @@ -1009,6 +1035,8 @@ itemCategoryId.value = $route.query.itemCategoryId as string // 核查项分类id itemCategoryName.value = $route.query.itemCategoryName as string // 核查项分类名称 if (props.pageType !== 'add') { + console.log('0000000', '获取详情') + fetchInfo() } }) diff --git a/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts b/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts index e1cf281..563924a 100644 --- a/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts +++ b/src/views/equipement/standard/checkData/components/useStabilityCaculate.ts @@ -4,6 +4,7 @@ * @param item 清空的数据,Object */ export function clearDateValue(item: any) { + // 清除表中数据 item.testValueOne = '' item.testValueTwo = '' item.testValueThree = ''