Files
admin-sjzx/src/views/pqs/supervise/harmonicSurvey/test/detail.vue

235 lines
8.6 KiB
Vue
Raw Normal View History

2024-05-31 08:44:45 +08:00
<template>
2024-06-14 10:26:35 +08:00
<div class="default-main">
<el-descriptions :column="2" border>
<el-descriptions-item label="技术监督计划名称">
{{ detailData?.planName }}
</el-descriptions-item>
<el-descriptions-item label="计划负责单位">
{{ detailData?.deptName }}
</el-descriptions-item>
<el-descriptions-item label="监督类型">
{{
supvTypeList.find(item => {
return item.id == detailData?.supvType
})?.name
}}
</el-descriptions-item>
<el-descriptions-item label="监督对象名称">
{{ detailData?.supvObjectName }}
</el-descriptions-item>
<el-descriptions-item label="计划开始时间">
{{ detailData?.planStartTime }}
</el-descriptions-item>
<el-descriptions-item label="计划结束时间">
{{ detailData?.planEndTime }}
</el-descriptions-item>
<el-descriptions-item label="变电站">
{{ detailData?.substationName }}
</el-descriptions-item>
<el-descriptions-item label="变电站电压等级">
{{ detailData?.voltageLevel }}
</el-descriptions-item>
<el-descriptions-item label="变电站来源">
{{ detailData?.voltageLevel == '/' ? '自定义变电站' : '系统内台账变电站' }}
</el-descriptions-item>
<el-descriptions-item label="实际完成时间">
{{ detailData?.completeTime }}
</el-descriptions-item>
<el-descriptions-item label="负责人">
{{ detailData?.completeBy }}
</el-descriptions-item>
<el-descriptions-item label="是否有问题">
<el-tag :type="getProblemFlag(detailData?.problemFlag)">
{{ getProblemFlagDetail(detailData?.problemFlag) }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item v-if="detailData?.problemFlag == 1" :span="2" label="问题描述">
{{ detailData?.problemDetail }}
</el-descriptions-item>
2024-10-31 15:47:02 +08:00
<el-descriptions-item :span="2" label="整改意见" v-if="props.flag">
{{ detailData.reformAdvice }}
</el-descriptions-item>
<el-descriptions-item :span="2" label="采取的措施" v-if="props.flag">
{{ detailData.takeStep }}
</el-descriptions-item>
2024-06-04 10:51:54 +08:00
<el-descriptions-item :span="2" label="技术监督报告">
2025-12-19 13:12:38 +08:00
<el-icon class="elView" v-if="detailData?.supervisionReportName && VITE_FLAG">
<View @click="openFile(detailData?.supervisionReportName)" />
</el-icon>
2025-12-19 11:58:26 +08:00
<span class="aLoad" @click="download(detailData.keyName)" target="_blank">{{ detailData.supervisionReportName }}</span >
</el-descriptions-item>
2024-06-14 10:26:35 +08:00
<el-descriptions-item :span="2" label="测试报告">
2025-12-19 13:12:38 +08:00
<el-icon class="elView" v-if="detailData?.testReportName && VITE_FLAG">
2024-06-14 10:26:35 +08:00
<View @click="openFile(detailData?.testReportName)" />
</el-icon>
2025-12-19 11:58:26 +08:00
<span class="aLoad" @click="download(detailData.keyName)" target="_blank">{{ detailData.testReportName }}</span >
2024-06-14 10:26:35 +08:00
</el-descriptions-item>
2024-08-20 16:22:46 +08:00
<el-descriptions-item :span="2" label="其他报告">
2024-08-21 16:05:06 +08:00
<div v-for="item in detailData.otherReports">
2025-12-19 13:12:38 +08:00
<el-icon class="elView" v-if="item.fileName && VITE_FLAG">
2024-08-21 16:05:06 +08:00
<View @click="openFile(item.fileName)" />
</el-icon>
2025-12-19 11:58:26 +08:00
<span class="aLoad" @click="download(item.keyName)" target="_blank">{{ item.fileName }}</span >
2024-08-21 16:05:06 +08:00
</div>
2024-08-20 16:22:46 +08:00
</el-descriptions-item>
2024-10-31 15:47:02 +08:00
<el-descriptions-item :span="2" label="处理成效报告" v-if="props.flag">
2025-12-19 13:12:38 +08:00
<el-icon class="elView " v-if="detailData?.reportName && VITE_FLAG">
2024-10-31 15:47:02 +08:00
<View @click="openFile(detailData?.reportName)" />
</el-icon>
2025-12-19 11:58:26 +08:00
<span class="aLoad" @click="download(detailData.keyName)" target="_blank">{{ detailData.reportName }}</span >
2024-10-31 15:47:02 +08:00
</el-descriptions-item>
2024-07-23 15:03:48 +08:00
<!-- <el-descriptions-item label="流程状态" >
2024-06-14 10:26:35 +08:00
<el-tag :type="getDeviceStatusType(detailData?.status)">
{{ getDeviceStatus(detailData?.status) }}
</el-tag>
2024-07-23 15:03:48 +08:00
</el-descriptions-item> -->
2024-06-14 10:26:35 +08:00
</el-descriptions>
</div>
2024-05-31 08:44:45 +08:00
</template>
2024-06-14 10:26:35 +08:00
<script setup lang="ts">
2024-05-31 08:44:45 +08:00
import { onMounted, ref } from 'vue'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const supvTypeList = dictData.getBasicData('supv_type')
2024-05-31 08:44:45 +08:00
defineOptions({ name: 'QuitRunningDeviceDetail' })
import { propTypes } from '@/utils/propTypes'
import { defaultAttribute } from '@/components/table/defaultAttribute'
2024-06-04 10:51:54 +08:00
import { getTestById } from '@/api/supervision-boot/survey/test'
import { getFileNameAndFilePath } from '@/api/system-boot/file'
2024-07-23 15:03:48 +08:00
import { Link, View } from '@element-plus/icons-vue'
import {download} from '@/utils/fileDownLoad'
2024-06-14 10:26:35 +08:00
const openFile = (name: any) => {
2024-08-07 11:13:46 +08:00
window.open(window.location.origin + '/#/previewFile?/supervision/' + name)
2024-06-06 22:14:20 +08:00
}
2025-12-19 13:12:38 +08:00
const VITE_FLAG = import.meta.env.VITE_NAME == 'jibei'
2024-06-04 10:51:54 +08:00
const { query } = useRoute() // 查询参数
2024-05-31 08:44:45 +08:00
const props = defineProps({
2024-10-31 15:47:02 +08:00
id: propTypes.string.def(undefined),
flag: propTypes.bool.def(false)
2024-05-31 08:44:45 +08:00
})
const detailLoading = ref(false) // 表单的加载中
const detailData: any = ref({}) // 详情数据
const queryId = query.id // 从 URL 传递过来的 id 编号
/** 获得数据 */
const getInfo = async () => {
2024-06-14 10:26:35 +08:00
detailLoading.value = true
try {
await getTestById(props.id || queryId).then(res => {
detailData.value = res.data
getFileData()
})
} finally {
detailLoading.value = false
}
2024-05-31 08:44:45 +08:00
}
2024-06-04 10:51:54 +08:00
const getFileData = async () => {
2024-08-21 16:05:06 +08:00
detailData.value.otherReports = []
2024-06-14 10:26:35 +08:00
await getFileNameAndFilePath({ filePath: detailData.value.testReport }).then(res => {
detailData.value.keyName = res.data.name
2024-06-14 10:26:35 +08:00
detailData.value.testReport = res.data.url
detailData.value.testReportName = res.data.fileName
})
2024-08-21 16:05:06 +08:00
if (detailData.value.otherReport != null) {
for (let i = 0; i < detailData.value.otherReport.split(',').length - 1; i++) {
await getFileNameAndFilePath({
filePath: '/supervision/' + detailData.value.otherReport.split(',')[i]
}).then(res => {
res.data.keyName = res.data.name
2024-08-21 16:05:06 +08:00
detailData.value.otherReports.push(res.data)
})
}
}
await getFileNameAndFilePath({ filePath: detailData.value.supervisionReport }).then(res => {
detailData.value.keyName = res.data.name
detailData.value.supervisionReport = res.data.url
detailData.value.supervisionReportName = res.data.fileName
})
2024-10-31 15:47:02 +08:00
if (props.flag) {
getFileNameAndFilePath({ filePath: detailData.value.reportPath }).then(res => {
detailData.value.keyName = res.data.name
2024-10-31 15:47:02 +08:00
detailData.value.reportPath = res.data.url
detailData.value.reportName = res.data.fileName
})
}
2024-06-04 10:51:54 +08:00
}
const getProblemFlagDetail = (status: number) => {
2024-06-14 10:26:35 +08:00
if (status === 1) {
return '存在问题'
}
return '合格'
2024-05-31 08:44:45 +08:00
}
2024-06-04 10:51:54 +08:00
const getProblemFlag = (status: number) => {
2024-06-14 10:26:35 +08:00
if (status === 1) {
return 'danger'
}
return 'success'
2024-06-04 10:51:54 +08:00
}
2024-05-31 08:44:45 +08:00
const getDeviceStatus = (status: number) => {
2024-06-14 10:26:35 +08:00
if (status === 1) {
return '审批中'
}
if (status === 2) {
return '审批通过'
}
if (status === 3) {
return '审批不通过'
}
if (status === 4) {
return '已取消'
}
2024-05-31 08:44:45 +08:00
return '审批通过'
}
const getDeviceStatusType = (status: number) => {
2024-06-14 10:26:35 +08:00
if (status === 1) {
return 'primary'
}
if (status === 2) {
return 'success'
}
if (status === 3) {
return 'danger'
}
if (status === 4) {
return 'warning'
}
2024-05-31 08:44:45 +08:00
return 'success'
}
2024-06-04 10:51:54 +08:00
const formatterSource = (row: any) => {
2024-06-14 10:26:35 +08:00
if (row.column.field == 'dataSource') {
if (row.cellValue == 0) {
return '系统内台账变电站'
} else {
return '自定义变电站'
}
2024-05-31 08:44:45 +08:00
} else {
2024-06-14 10:26:35 +08:00
return row.cellValue
2024-05-31 08:44:45 +08:00
}
}
2024-06-04 10:51:54 +08:00
2024-05-31 08:44:45 +08:00
defineExpose({ open: getInfo }) // 提供 open 方法,用于打开弹窗
/** 初始化 **/
onMounted(() => {
2024-06-14 10:26:35 +08:00
getInfo()
2024-05-31 08:44:45 +08:00
})
</script>
2024-06-14 10:26:35 +08:00
<style lang="scss" scoped>
.elView {
cursor: pointer;
2024-06-18 09:03:53 +08:00
margin-right: 10px;
2024-06-14 10:26:35 +08:00
}
2024-07-23 15:03:48 +08:00
</style>