|
@@ -0,0 +1,120 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="info-container">
|
|
|
|
|
+ <CollapseItem
|
|
|
|
|
+ v-for="reportTask in disasterLossDetailList?.reportTaskList"
|
|
|
|
|
+ :key="reportTask.reportDeptId"
|
|
|
|
|
+ :name="`上报单位:${reportTask.reportDeptName}`"
|
|
|
|
|
+ :isActive="activeId === reportTask.reportDeptId"
|
|
|
|
|
+ @toggle="handleCollapseToggle(reportTask.reportDeptId)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #view-operation>
|
|
|
|
|
+ <div class="rectification-info">
|
|
|
|
|
+ <span class="num">{{ reportTask.lossRecordCount }}</span>
|
|
|
|
|
+ <span>条,整改完成{{ reportTask.fixFinishCount }}条</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #right-header>
|
|
|
|
|
+ <span class="collapse-item__header--right">
|
|
|
|
|
+ {{ activeId === reportTask.reportDeptId ? '收起' : '展开' }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #main-table>
|
|
|
|
|
+ <div class="rectification-table">
|
|
|
|
|
+ <section class="damaged-list-container">
|
|
|
|
|
+ <DamagedList
|
|
|
|
|
+ :damagedList="reportTask.lossRecordList"
|
|
|
|
|
+ :active-id="activeTaskId || reportTask.lossRecordList[0].fixTaskId"
|
|
|
|
|
+ @update:activeId="handleActiveTask"
|
|
|
|
|
+ />
|
|
|
|
|
+ </section>
|
|
|
|
|
+ <section class="disaster-info-container">
|
|
|
|
|
+ <DisasterInfo :LossReportItemFormData="lossRecordListInfo" rectification v-if="lossRecordListInfo" />
|
|
|
|
|
+ <Rectification
|
|
|
|
|
+ v-if="lossRecordListInfo?.fixRecordList"
|
|
|
|
|
+ :rectification-list="lossRecordListInfo?.fixRecordList"
|
|
|
|
|
+ :rectification-dept-name="lossRecordListInfo?.responsibleDeptName"
|
|
|
|
|
+ :rectification-responsible-user-list="rectificationResponsibleUserList"
|
|
|
|
|
+ :rectification-priority="lossRecordListInfo?.priority"
|
|
|
|
|
+ />
|
|
|
|
|
+ </section>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </CollapseItem>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script setup lang="ts">
|
|
|
|
|
+ import { useRoute } from 'vue-router';
|
|
|
|
|
+ import { onMounted, ref } from 'vue';
|
|
|
|
|
+ import CollapseItem from './CollapseItem.vue';
|
|
|
|
|
+ import DamagedList from './DamagedList.vue';
|
|
|
|
|
+ import DisasterInfo from './DisasterInfo.vue';
|
|
|
|
|
+ import Rectification from './Rectification.vue';
|
|
|
|
|
+ import { useDisasterControlHook } from '../hook';
|
|
|
|
|
+ import type { PersonGroupItem } from '@/types/person-group/type';
|
|
|
|
|
+ import type { ReportTaskListDetail, LossRecordListDetail, OverviewLossRecordInfo } from '@/types/disaster-control';
|
|
|
|
|
+ import { queryUserInfoByIds } from '@/api/system/person-group';
|
|
|
|
|
+
|
|
|
|
|
+ const route = useRoute();
|
|
|
|
|
+ const handleTaskId = Number(route.query.id);
|
|
|
|
|
+ const { getDisasterLossDetailList, disasterLossDetailList } = useDisasterControlHook();
|
|
|
|
|
+ const activeId = ref<number | null>(null);
|
|
|
|
|
+ const activeTaskId = ref<number | null>(null);
|
|
|
|
|
+ const handleCollapseToggle = (itemId: number) => {
|
|
|
|
|
+ if (activeId.value === itemId) {
|
|
|
|
|
+ activeId.value = null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ activeId.value = itemId;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleActiveTask = (fixTaskId: number) => {
|
|
|
|
|
+ activeTaskId.value = fixTaskId;
|
|
|
|
|
+ if (!lossRecordList.value.length) return;
|
|
|
|
|
+ lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
|
|
|
|
|
+ getFixUserList(lossRecordListInfo.value?.fixPrincipals);
|
|
|
|
|
+ };
|
|
|
|
|
+ const reportTaskList = ref<ReportTaskListDetail[]>([]);
|
|
|
|
|
+ const lossRecordList = ref<LossRecordListDetail[]>([]);
|
|
|
|
|
+ const reportTaskListInfo = ref<ReportTaskListDetail>();
|
|
|
|
|
+ const lossRecordListInfo = ref<LossRecordListDetail>();
|
|
|
|
|
+ const rectificationResponsibleUserList = ref<PersonGroupItem[]>([]);
|
|
|
|
|
+ const getFixUserList = async (userIds: string | undefined) => {
|
|
|
|
|
+ if (!userIds) return;
|
|
|
|
|
+ const ids = JSON.parse(userIds);
|
|
|
|
|
+ const res = await queryUserInfoByIds(ids);
|
|
|
|
|
+ rectificationResponsibleUserList.value = res;
|
|
|
|
|
+ };
|
|
|
|
|
+ const overviewLossRecordInfo = () => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ needToReportDeptCount: disasterLossDetailList.value?.needToReportDeptCount,
|
|
|
|
|
+ reportedDeptCount: disasterLossDetailList.value?.reportedDeptCount,
|
|
|
|
|
+ waitToReportDeptCount: disasterLossDetailList.value?.waitToReportDeptCount,
|
|
|
|
|
+ overdueReportedDeptCount: disasterLossDetailList.value?.overdueReportedDeptCount,
|
|
|
|
|
+ lossRecordCount: disasterLossDetailList.value?.lossRecordCount,
|
|
|
|
|
+ fixedLossCount: disasterLossDetailList.value?.fixedLossCount,
|
|
|
|
|
+ fixingLossCount: disasterLossDetailList.value?.fixingLossCount,
|
|
|
|
|
+ waitToFixLossCount: disasterLossDetailList.value?.waitToFixLossCount,
|
|
|
|
|
+ };
|
|
|
|
|
+ };
|
|
|
|
|
+ const emit = defineEmits<{
|
|
|
|
|
+ (e: 'overviewLossRecordInfo', info: OverviewLossRecordInfo): void;
|
|
|
|
|
+ }>();
|
|
|
|
|
+ onMounted(async () => {
|
|
|
|
|
+ await getDisasterLossDetailList({ handleTaskId });
|
|
|
|
|
+ if (!disasterLossDetailList.value?.reportTaskList.length) return;
|
|
|
|
|
+ emit('overviewLossRecordInfo', overviewLossRecordInfo());
|
|
|
|
|
+ reportTaskList.value = disasterLossDetailList.value?.reportTaskList;
|
|
|
|
|
+ activeId.value = reportTaskList.value[0].reportDeptId;
|
|
|
|
|
+ reportTaskListInfo.value = reportTaskList.value.find((item) => item.reportDeptId === activeId.value);
|
|
|
|
|
+ if (!reportTaskListInfo.value) return;
|
|
|
|
|
+ lossRecordList.value = reportTaskListInfo.value?.lossRecordList;
|
|
|
|
|
+ activeTaskId.value = lossRecordList.value[0].fixTaskId;
|
|
|
|
|
+ lossRecordListInfo.value = lossRecordList.value.find((item) => item.fixTaskId === activeTaskId.value);
|
|
|
|
|
+ getFixUserList(lossRecordListInfo.value?.fixPrincipals);
|
|
|
|
|
+ });
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+ @use '@/views/disaster/style/info-container.scss' as *;
|
|
|
|
|
+ @use '../style/common.scss' as *;
|
|
|
|
|
+</style>
|