diff --git a/frontend/src/api/check/interface/index.ts b/frontend/src/api/check/interface/index.ts index 4932b23..28733a0 100644 --- a/frontend/src/api/check/interface/index.ts +++ b/frontend/src/api/check/interface/index.ts @@ -7,6 +7,7 @@ export namespace CheckData { chnNum: string deviceId: string num?: string | number + reportTemplateName: string } export interface PhaseCheckResult { diff --git a/frontend/src/api/device/interface/device.ts b/frontend/src/api/device/interface/device.ts index fb8687b..8ae1b46 100644 --- a/frontend/src/api/device/interface/device.ts +++ b/frontend/src/api/device/interface/device.ts @@ -23,6 +23,7 @@ export namespace Device { scriptId?: string // 脚本id planCode?: string devIdList?: string[] // 装置id列表 + reportTemplateName?: string } /** diff --git a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue index 0f078d4..51a9459 100644 --- a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue @@ -61,8 +61,23 @@ /> - - 报告生成 + + + + + + 报告生成 重新计算 @@ -172,6 +187,7 @@ import { getTreeData, reCalculate } from '@/api/check/test' +import { getPqReportAllName } from '@/api/device/report' import { generateDevReport, getPqErrSysList } from '@/api/plan/plan' import { useDownload } from '@/hooks/useDownload' import { Histogram, Postcard } from '@element-plus/icons-vue' @@ -197,6 +213,7 @@ const visible = ref(false) const treeRef = ref() const searchValue = ref('') const pqErrorList = reactive<{ id: string; name: string }[]>([]) +const reportTemplateList = ref<{ name: string }[]>([]) watch(searchValue, val => { treeRef.value!.filter(val) }) @@ -212,7 +229,8 @@ const formContent = reactive({ errorSysId: '', dataRule: '', deviceName: '', - chnNum: '' + chnNum: '', + reportTemplateName: '' }) // 原始误差体系id let originErrorSysId: string = '' @@ -485,7 +503,7 @@ const open = async (_deviceId: string, chnNum: string, _scriptType: string | nul originScriptType = _scriptType scriptType = _scriptType - // 发起后端请求,查询详细信息 当chnNum为-1时,查询所有通道号 + //发起后端请求,查询详细信息 当chnNum为-1时,查询所有通道号 const { data: resFormContent }: { data: any } = await getFormData({ planId: checkStore.plan.id, deviceId, @@ -507,19 +525,23 @@ const open = async (_deviceId: string, chnNum: string, _scriptType: string | nul pqErrorList.length = 0 let { data: resPqErrorList } = await getPqErrSysList() + let { data: resReportTemplateList }=await getPqReportAllName() Object.assign(pqErrorList, resPqErrorList) + reportTemplateList.value = resReportTemplateList.map((item: any) => ({ name: item })) + visible.value = true } const handleGenerateReport = async () => { - await generateDevReport({ - planId: checkStore.plan.id, - devIdList: [deviceId], - scriptId: checkStore.plan.scriptId, - planCode: checkStore.plan.code + (formContent.errorSysId!=checkStore.plan.errorSysId || formContent.dataRule!=checkStore.plan.dataRule? '_temp':'') - }) - ElMessage.success({ message: `报告生成成功!` }) + await generateDevReport({ + planId: checkStore.plan.id, + devIdList: [deviceId], + scriptId: checkStore.plan.scriptId, + planCode: checkStore.plan.code + (formContent.errorSysId != checkStore.plan.errorSysId || formContent.dataRule != checkStore.plan.dataRule ? '_temp' : ''), + reportTemplateName: formContent.reportTemplateName + }) + ElMessage.success({message: `报告生成成功!`}) } const handleReCalculate = async () => { @@ -548,7 +570,8 @@ const close = async () => { errorSysName: '', dataRule: '', deviceName: '', - chnNum: '' + chnNum: '', + reportTemplateName: '' }) treeDataAll.length = 0 // harmNumList.length = 0 @@ -825,7 +848,22 @@ defineExpose({