|
|
@@ -1,11 +1,19 @@
|
|
|
<template>
|
|
|
- <div class="info-container">
|
|
|
- <TemplateTableMerge
|
|
|
- :operation-type="'view'"
|
|
|
- :main-table="templateDetailList?.inspectTemplateDetailVOs || []"
|
|
|
- :opinion-data="templateDetailList?.deptOpinion || opinionData"
|
|
|
- :result-data="templateDetailList?.inspectResult || resultData"
|
|
|
- />
|
|
|
+ <div class="disaster-precaution">
|
|
|
+ <p class="title">
|
|
|
+ 任务名称:<span class="content">{{ taskName }}</span>
|
|
|
+ </p>
|
|
|
+ <p class="title">
|
|
|
+ 被检查自查单位:<span class="content">{{ deptName }}</span>
|
|
|
+ </p>
|
|
|
+ <div class="info-container">
|
|
|
+ <TemplateTableMerge
|
|
|
+ :operation-type="operateType"
|
|
|
+ :main-table="templateDetail"
|
|
|
+ :opinion-data="opinionData"
|
|
|
+ :result-data="resultData"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -13,20 +21,43 @@
|
|
|
import { useRoute } from 'vue-router';
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
import TemplateTableMerge from './TemplateTableMerge.vue';
|
|
|
- import { getTaskExecutionDetail } from '@/api/disaster-precaution';
|
|
|
- import type { TaskExecutionDetailResponse, TemplateDetailResponse, ContentItem } from '@/types/disaster-precaution';
|
|
|
+ import { TASK_STAGE } from '../constants/task-execution';
|
|
|
+ import { getTaskExecutionDetail, getTaskTemplateDetail } from '@/api/disaster-precaution';
|
|
|
+ import type { SpanTableData } from '@/views/disaster/disaster-precaution/src/type';
|
|
|
+ import type { TemplateDetailResponse, ContentItem } from '@/types/disaster-precaution';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const id = Number(route.query.id);
|
|
|
+ const taskName = String(route.query.name);
|
|
|
+ const deptName = String(route.query.deptName);
|
|
|
+ const taskState = Number(route.query.taskState);
|
|
|
+ const operateType = ref<'view' | 'template'>('view');
|
|
|
+ const inspectType = Number(route.query.inspectType);
|
|
|
const opinionData = ref<ContentItem>({} as ContentItem);
|
|
|
const resultData = ref<ContentItem>({} as ContentItem);
|
|
|
|
|
|
- const taskExecutionDetailList = ref<TaskExecutionDetailResponse>();
|
|
|
- const templateDetailList = ref<TemplateDetailResponse>();
|
|
|
- const getTaskExecutionDetailList = async () => {
|
|
|
+ const templateDetail = ref<SpanTableData[]>([]);
|
|
|
+ // 带审核和已完成调用后端查询任务执行详情接口
|
|
|
+ const getTaskExecutionDetailList_Task = async () => {
|
|
|
const res = await getTaskExecutionDetail(id);
|
|
|
- taskExecutionDetailList.value = res;
|
|
|
- templateDetailList.value = JSON.parse(res.detail) as TemplateDetailResponse;
|
|
|
+ const templateDetailList = JSON.parse(res.detail) as TemplateDetailResponse;
|
|
|
+ templateDetail.value = templateDetailList.inspectTemplateDetailVOs;
|
|
|
+ opinionData.value = templateDetailList.deptOpinion || ({} as ContentItem);
|
|
|
+ resultData.value = templateDetailList.inspectResult || ({} as ContentItem);
|
|
|
+ };
|
|
|
+ // 其他状态调用后端模板接口
|
|
|
+ const getTaskExecutionDetailList_Template = async () => {
|
|
|
+ const res = await getTaskTemplateDetail(inspectType);
|
|
|
+ templateDetail.value = res;
|
|
|
+ };
|
|
|
+ const getTaskExecutionDetailList = async () => {
|
|
|
+ if (taskState === TASK_STAGE.COMPLETED || taskState === TASK_STAGE.PENDING_APPROVAL) {
|
|
|
+ operateType.value = 'view';
|
|
|
+ getTaskExecutionDetailList_Task();
|
|
|
+ } else {
|
|
|
+ operateType.value = 'template';
|
|
|
+ getTaskExecutionDetailList_Template();
|
|
|
+ }
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
getTaskExecutionDetailList();
|
|
|
@@ -34,5 +65,16 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+ @use '@/views/disaster/style/disaster.scss' as *;
|
|
|
@use '@/views/disaster/style/info-container.scss' as *;
|
|
|
+ .title,
|
|
|
+ .content {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ .title {
|
|
|
+ color: rgba($text-color, 0.85);
|
|
|
+ }
|
|
|
+ .content {
|
|
|
+ color: rgba($text-color, 0.65);
|
|
|
+ }
|
|
|
</style>
|