ADD: 1、报告生成选择界面流程。

This commit is contained in:
贾同学
2025-09-12 16:34:27 +08:00
parent c735e7a5bb
commit b27615baaf
4 changed files with 269 additions and 24 deletions

View File

@@ -77,13 +77,20 @@
<el-button type="primary" icon="Search" @click="handleSearch">查询</el-button>
<el-button icon="Delete" @click="handleRefresh">重置</el-button>
<!-- 比对模式下的通道配对功能 -->
<el-button type="primary" icon="Clock" @click="handleTest2" v-if="modeStore.currentMode == '比对式'">手动检测</el-button>
<el-button
type="primary"
icon="Clock"
@click="handleTest2"
v-if="modeStore.currentMode == '比对式'"
>
手动检测
</el-button>
<!-- 设备检测模式下的操作按钮 -->
<el-button
type="primary"
icon="Clock"
@click="handleTest('手动检测')"
v-if="form.activeTabs === 0 &&modeStore.currentMode == '模拟式'"
v-if="form.activeTabs === 0 && modeStore.currentMode == '模拟式'"
>
手动检测
</el-button>
@@ -175,7 +182,7 @@
<!-- 检测过程显示弹窗 -->
<TestPopup ref="testPopup" @quitClicked="handleQuitClicked"></TestPopup>
<!-- 检测数据查询弹窗 -->
<dataCheckPopup ref="dataCheckPopupRef" :append-to-body="true"/>
<dataCheckPopup ref="dataCheckPopupRef" :append-to-body="true" />
<!-- 手动检测检测项选择弹窗 -->
<SelectTestItemPopup ref="selectTestItemPopupRef" @openTestDialog="openTestDialog"></SelectTestItemPopup>
<!-- 省平台模式下的温度湿度填写弹窗 -->
@@ -187,12 +194,14 @@
ref="dataCheckSingleChannelSingleTestPopupRef"
:append-to-body="true"
/>
<!-- 报告生成弹框 -->
<ReportResultPopup ref="reportPopup"></ReportResultPopup>
</div>
</template>
<script setup lang="tsx" name="useProTable">
import { onBeforeMount, onMounted, type PropType, reactive, ref, watch } from 'vue'
import { ElMessage, ElMessageBox, type Action } from 'element-plus'
import { type Action, ElMessage, ElMessageBox } from 'element-plus'
import TestPopup from './testPopup.vue'
import dataCheckPopup from './dataCheckSingleChannelSingleTestPopup.vue'
import CompareDataCheckSingleChannelSingleTestPopup from '@/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue'
@@ -201,13 +210,12 @@ import SelectTestItemPopup from '@/views/home/components/selectTestItemPopup.vue
import WriteTHPopup from '@/views/home/components/writeTHPopup.vue'
import DeviceConnectionPopup from '@/views/home/components/deviceConnectionPopup.vue'
import { type Device } from '@/api/device/interface/device'
import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface'
import { type ColumnProps, type ProTableInstance } from '@/components/ProTable/interface'
import { type Plan } from '@/api/plan/interface'
import { type StandardDevice } from '@/api/device/interface/standardDevice'
import { generateDevReport, getBoundPqDevList } from '@/api/plan/plan'
import { downloadDevData } from '@/api/plan/plan'
import { downloadDevData, generateDevReport, getBoundPqDevList } from '@/api/plan/plan'
import { getPqDev } from '@/api/device/device'
import { useModeStore, useAppSceneStore } from '@/stores/modules/mode' // 引入模式 store
import { useAppSceneStore, useModeStore } from '@/stores/modules/mode' // 引入模式 store
import { useCheckStore } from '@/stores/modules/check'
import { CheckData } from '@/api/check/interface'
import { useAuthStore } from '@/stores/modules/auth'
@@ -215,8 +223,7 @@ import { useDownload } from '@/hooks/useDownload'
import { documentedPqDev } from '@/api/device/report'
import { ResultEnum } from '@/enums/httpEnum'
import { getPqMonList } from '@/api/device/monitor/index.ts'
import ReportResultPopup from '@/views/home/components/reportResultPopup.vue'
const checkStore = useCheckStore()
let devNum = 0 //当前选取的被检设备数量
@@ -254,6 +261,7 @@ const checkStateShow = ref(true)
const factorCheckShow = ref(true)
const selectionShow = ref(true)
const testPopup = ref()
const reportPopup = ref()
const weiJianTab = ref(0) // 当前Tab索引用于控制选项显示逻辑
const channelsSelection = ref<Device.ResPqDev[]>([])
const props = defineProps({
@@ -464,7 +472,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
label: '检测次数',
minWidth: 100,
sortable: true,
isShow: modeStore.currentMode != '比对式',
isShow: modeStore.currentMode != '比对式'
},
{
prop: 'checkState',
@@ -647,9 +655,9 @@ function tableHeaderInit(val: number) {
selectionShow.value = true // 显示选择框
break
case 5: // 数据查询模式
if(modeStore.currentMode === '比对式'){
checkStateTable.value = [1,2, 3] // 显示检测中,检测完成和归档状态
}else{
if (modeStore.currentMode === '比对式') {
checkStateTable.value = [1, 2, 3] // 显示检测中,检测完成和归档状态
} else {
checkStateTable.value = [2, 3] // 显示检测完成和归档状态
}
columns[columns.length - 1].minWidth = 290
@@ -785,7 +793,7 @@ const handleTest2 = async () => {
const deviceNames = inconsistentPointDevices.map(d => d.name).join(', ')
ElMessage.warning(`以下设备存在通道未绑定监测点: ${deviceNames}`)
}
// 只传递有监测点的设备
deviceConnectionPopupRef.value?.open(filteredChannelsSelection, pqStandardDevList.value, props.id)
}
@@ -874,7 +882,7 @@ const handleTest = async (val: string) => {
if (action === 'cancel') {
ElMessage.success('全部复检')
checkStore.setReCheckType(1)
if (appSceneStore.currentScene === '0'&& modeStore.currentMode != '比对式') {
if (appSceneStore.currentScene === '0' && modeStore.currentMode != '比对式') {
writeTHPopupRef.value?.open()
} else {
selectTestItemPopupRef.value?.open()
@@ -902,7 +910,7 @@ const handleTest = async (val: string) => {
.then(() => {
ElMessage.success('不合格项复检')
checkStore.setReCheckType(0)
if (appSceneStore.currentScene === '0'&& modeStore.currentMode != '比对式') {
if (appSceneStore.currentScene === '0' && modeStore.currentMode != '比对式') {
writeTHPopupRef.value?.open()
} else {
openTestDialog(true)
@@ -912,7 +920,7 @@ const handleTest = async (val: string) => {
if (action === 'cancel') {
ElMessage.success('全部复检')
checkStore.setReCheckType(1)
if (appSceneStore.currentScene === '0'&& modeStore.currentMode != '比对式') {
if (appSceneStore.currentScene === '0' && modeStore.currentMode != '比对式') {
writeTHPopupRef.value?.open()
} else {
openTestDialog(true)
@@ -957,7 +965,7 @@ const handleTest = async (val: string) => {
}
const openTestDialog = (testData: any) => {
if (appSceneStore.currentScene === '0'&& modeStore.currentMode != '比对式') {
if (appSceneStore.currentScene === '0' && modeStore.currentMode != '比对式') {
if (testData) {
writeTHPopupRef.value?.open()
} else {
@@ -982,7 +990,8 @@ const openTestDialog2 = () => {
const openDrawer = async (title: string, row: any) => {
// 单个设备报告生成
if (title === '报告生成') {
await generateDevReport({
reportPopup.value?.open(row)
/*await generateDevReport({
planId: checkStore.plan.id,
devIdList: [row.id],
scriptId: checkStore.plan.scriptId,
@@ -991,7 +1000,7 @@ const openDrawer = async (title: string, row: any) => {
pageSize: 999
})
emit('batchGenerateClicked') // 触发事件
ElMessage.success({ message: `报告生成成功!` })
ElMessage.success({ message: `报告生成成功!` })*/
}
if (title === '报告下载') {
@@ -1018,12 +1027,11 @@ const openDrawer = async (title: string, row: any) => {
}
if (title === '误差体系更换') {
checkStore.setShowDetailType(1)
if (modeStore.currentMode == '模拟式') {
dataCheckPopupRef.value?.open(row.id, '-1', null)
if (modeStore.currentMode == '模拟式') {
dataCheckPopupRef.value?.open(row.id, '-1', null)
} else if (modeStore.currentMode == '比对式') {
dataCheckSingleChannelSingleTestPopupRef.value?.open(row, null, row.id, 2)
}
}
if (title === '归档') {