|
@@ -47,7 +47,7 @@
|
|
|
v-for="item in collapseList"
|
|
v-for="item in collapseList"
|
|
|
:key="item.id"
|
|
:key="item.id"
|
|
|
:name="item.taskName"
|
|
:name="item.taskName"
|
|
|
- :defaultOpen="item.id === collapseList[0].id"
|
|
|
|
|
|
|
+ :defaultOpen="item.id === defaultOpenId"
|
|
|
>
|
|
>
|
|
|
<template #viewOperation>
|
|
<template #viewOperation>
|
|
|
<el-tooltip
|
|
<el-tooltip
|
|
@@ -107,8 +107,8 @@
|
|
|
<span>{{ getTaskStage(scope.row.taskStage) }}</span>
|
|
<span>{{ getTaskStage(scope.row.taskStage) }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<template #reportPrincipals="scope">
|
|
<template #reportPrincipals="scope">
|
|
|
- <p v-for="user in scope.row.reportPrincipalInfoList" :key="user.id">
|
|
|
|
|
- {{ user.realname }}({{ user.username }})
|
|
|
|
|
|
|
+ <p v-for="user in scope.row.reportPrincipalInfoList" :key="user.reportPrincipalId">
|
|
|
|
|
+ {{ user.reportPrincipalName }}({{ user.reportPrincipalStaffNo }})
|
|
|
</p>
|
|
</p>
|
|
|
</template>
|
|
</template>
|
|
|
<template #action="scope">
|
|
<template #action="scope">
|
|
@@ -174,7 +174,11 @@
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
|
import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
|
|
import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
|
|
|
import type { DeptTreeItem } from '@/types/dept/type';
|
|
import type { DeptTreeItem } from '@/types/dept/type';
|
|
|
- import { getDisasterControlCollapseData, getDisasterControlTableData } from '@/api/disaster-control';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ getDisasterControlCollapseData,
|
|
|
|
|
+ getDisasterControlTableData,
|
|
|
|
|
+ deleteDisasterHandleTask,
|
|
|
|
|
+ } from '@/api/disaster-control';
|
|
|
import type { disasterReportTaskInfoListResponse } from '@/types/disaster-control';
|
|
import type { disasterReportTaskInfoListResponse } from '@/types/disaster-control';
|
|
|
import { DEFAULT_PAGE_SIZE, DISASTER_CONTROL_PAGE_SIZE_CONFIG, TASK_STAGE } from './src/constant';
|
|
import { DEFAULT_PAGE_SIZE, DISASTER_CONTROL_PAGE_SIZE_CONFIG, TASK_STAGE } from './src/constant';
|
|
|
import type {
|
|
import type {
|
|
@@ -200,7 +204,7 @@
|
|
|
import ViewDocument from './src/svg/view-document.svg';
|
|
import ViewDocument from './src/svg/view-document.svg';
|
|
|
import { FORM_OPERATE_TYPE } from './src/constant';
|
|
import { FORM_OPERATE_TYPE } from './src/constant';
|
|
|
import { useUserInfoHook } from '@/views/disaster/hooks/userInfo';
|
|
import { useUserInfoHook } from '@/views/disaster/hooks/userInfo';
|
|
|
-
|
|
|
|
|
|
|
+ import { ElMessage } from 'element-plus';
|
|
|
const { permissions } = useUserInfoHook();
|
|
const { permissions } = useUserInfoHook();
|
|
|
|
|
|
|
|
const firstLevelDepts = ref<DeptTreeItem[]>([]);
|
|
const firstLevelDepts = ref<DeptTreeItem[]>([]);
|
|
@@ -210,6 +214,7 @@
|
|
|
taskStage: '',
|
|
taskStage: '',
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const defaultOpenId = ref<number>();
|
|
|
const currentPage = ref(1);
|
|
const currentPage = ref(1);
|
|
|
const pageSize = ref(DEFAULT_PAGE_SIZE);
|
|
const pageSize = ref(DEFAULT_PAGE_SIZE);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
@@ -276,6 +281,9 @@
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
}));
|
|
}));
|
|
|
|
|
+ console.log(collapseList.value);
|
|
|
|
|
+ defaultOpenId.value = collapseList.value[0].id;
|
|
|
|
|
+ console.log('默认打开的ID' + defaultOpenId.value);
|
|
|
taskIds.value = collapseList.value.map((item) => item.id);
|
|
taskIds.value = collapseList.value.map((item) => item.id);
|
|
|
total.value = res.totalRow;
|
|
total.value = res.totalRow;
|
|
|
collapseLoading.value = false;
|
|
collapseLoading.value = false;
|
|
@@ -283,15 +291,15 @@
|
|
|
|
|
|
|
|
const getDisposalTableData = async () => {
|
|
const getDisposalTableData = async () => {
|
|
|
tableConfig.loading = true;
|
|
tableConfig.loading = true;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const { reportDeptIds, ...otherSearchData } = searchData;
|
|
const { reportDeptIds, ...otherSearchData } = searchData;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const params = {
|
|
const params = {
|
|
|
handleTaskIds: taskIds.value,
|
|
handleTaskIds: taskIds.value,
|
|
|
...otherSearchData,
|
|
...otherSearchData,
|
|
|
- ...(reportDeptIds.length > 0 ? { reportDeptIds } : {})
|
|
|
|
|
|
|
+ ...(reportDeptIds.length > 0 ? { reportDeptIds } : {}),
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const res = await getDisasterControlTableData(params);
|
|
const res = await getDisasterControlTableData(params);
|
|
|
collapseList.value.forEach((item) => {
|
|
collapseList.value.forEach((item) => {
|
|
|
item.tableData = res.filter((tableItem) => tableItem.handleTaskId === item.id);
|
|
item.tableData = res.filter((tableItem) => tableItem.handleTaskId === item.id);
|
|
@@ -322,19 +330,22 @@
|
|
|
const handleBatchRelease = (disasterReportTaskInfoList: disasterReportTaskInfoListResponse[]) => {
|
|
const handleBatchRelease = (disasterReportTaskInfoList: disasterReportTaskInfoListResponse[]) => {
|
|
|
const batchReleaseIds = disasterReportTaskInfoList
|
|
const batchReleaseIds = disasterReportTaskInfoList
|
|
|
.filter((item) => item.taskStage === TASK_STAGE.TO_BE_RELEASED)
|
|
.filter((item) => item.taskStage === TASK_STAGE.TO_BE_RELEASED)
|
|
|
- .map((item) => item.id);
|
|
|
|
|
|
|
+ .map((item) => item.reportTaskId);
|
|
|
console.log(batchReleaseIds);
|
|
console.log(batchReleaseIds);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleBatchWithdraw = (disasterReportTaskInfoList: disasterReportTaskInfoListResponse[]) => {
|
|
const handleBatchWithdraw = (disasterReportTaskInfoList: disasterReportTaskInfoListResponse[]) => {
|
|
|
const batchWithdrawIds = disasterReportTaskInfoList
|
|
const batchWithdrawIds = disasterReportTaskInfoList
|
|
|
.filter((item) => item.taskStage === TASK_STAGE.TO_BE_REPORTED || item.taskStage === TASK_STAGE.OVERDUE)
|
|
.filter((item) => item.taskStage === TASK_STAGE.TO_BE_REPORTED || item.taskStage === TASK_STAGE.OVERDUE)
|
|
|
- .map((item) => item.id);
|
|
|
|
|
|
|
+ .map((item) => item.reportTaskId);
|
|
|
console.log(batchWithdrawIds);
|
|
console.log(batchWithdrawIds);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleBatchDelete = (id: number) => {
|
|
|
|
|
- console.log('当前任务ID' + id);
|
|
|
|
|
|
|
+ const handleBatchDelete = async (id: number) => {
|
|
|
|
|
+ await deleteDisasterHandleTask(id);
|
|
|
|
|
+ ElMessage.success('删除成功');
|
|
|
|
|
+ await getDisposalData();
|
|
|
|
|
+ await getDisposalTableData();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|