|
|
@@ -20,32 +20,37 @@
|
|
|
>
|
|
|
<template #taskName="scope">
|
|
|
<div class="task-name--div">
|
|
|
- <el-tooltip :content="scope.row.taskName" placement="top" effect="light">
|
|
|
- <span>{{ scope.row.taskName }}</span>
|
|
|
+ <el-tooltip :content="scope.row.name" placement="top" effect="light">
|
|
|
+ <span>{{ scope.row.name }}</span>
|
|
|
</el-tooltip>
|
|
|
- <img :src="OverdueIcon" alt="overdue" v-if="scope.row.isOverdue === OVERDUE_STATUS.OVERDUE" />
|
|
|
+ <img :src="OverdueIcon" v-if="scope.row.overdue" />
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template #taskType="scope">
|
|
|
- <span>{{ TASK_TYPE_MAP[scope.row.taskType] }}</span>
|
|
|
+ <template #inspectType="scope">
|
|
|
+ <span>{{ INSPECT_TYPE_MAP[scope.row.inspectType] }}</span>
|
|
|
</template>
|
|
|
<template #taskStage="scope">
|
|
|
- <span>{{ TASK_STAGE_MAP[scope.row.taskStage] }}</span>
|
|
|
+ <span>{{ TASK_STAGE_MAP[scope.row.taskState] }}</span>
|
|
|
</template>
|
|
|
<!-- action button 不仅分任务情况 还要分 人物权限 -->
|
|
|
<template #action="scope">
|
|
|
<!-- 检查任务操作入口 -->
|
|
|
- <div class="action-container" v-if="scope.row.taskStage === TASK_STAGE.PENDING_CHECK">
|
|
|
+ <div class="action-container" v-if="scope.row.taskState === TASK_STAGE.PENDING_CHECK">
|
|
|
<ActionButton text="去检查" />
|
|
|
<!-- 仅检查责任人可以看到 -->
|
|
|
- <ActionButton text="添加检查人" @click="handleAddCheckUser(scope.row)" />
|
|
|
+ <ActionButton
|
|
|
+ text="添加检查人"
|
|
|
+ @click="handleAddCheckUser(scope.row)"
|
|
|
+ v-if="scope.row.userTypeList.includes(USER_TYPE.CHECK_RESPONSIBLE)"
|
|
|
+ />
|
|
|
</div>
|
|
|
<!-- 审批任务操作入口 -->
|
|
|
- <div class="action-container" v-else-if="scope.row.taskStage === TASK_STAGE.PENDING_APPROVAL">
|
|
|
+ <div class="action-container" v-else-if="scope.row.taskState === TASK_STAGE.PENDING_APPROVAL">
|
|
|
<!-- 审批人员可以看到 -->
|
|
|
- <ActionButton text="去审批" />
|
|
|
+ <ActionButton text="去审批" v-if="scope.row.userTypeList.includes(USER_TYPE.APPROVER)" />
|
|
|
<!-- 检查责任人、检查执行人员可以看到 -->
|
|
|
<ActionButton
|
|
|
+ v-else
|
|
|
text="撤回"
|
|
|
:popconfirm="{
|
|
|
title: '确定撤回吗?',
|
|
|
@@ -53,10 +58,11 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<!-- 完成任务操作入口 -->
|
|
|
- <div class="action-container" v-else-if="scope.row.taskStage === TASK_STAGE.COMPLETED">
|
|
|
+ <div class="action-container" v-else-if="scope.row.taskState === TASK_STAGE.COMPLETED">
|
|
|
<ActionButton text="查看" />
|
|
|
<!-- 仅审批人员可以看到 -->
|
|
|
<ActionButton
|
|
|
+ v-if="scope.row.userTypeList.includes(USER_TYPE.APPROVER)"
|
|
|
text="撤回"
|
|
|
:popconfirm="{
|
|
|
title: '确定撤回吗?',
|
|
|
@@ -67,16 +73,6 @@
|
|
|
</BasicTable>
|
|
|
</div>
|
|
|
</main>
|
|
|
- <el-dialog
|
|
|
- v-model="userInfo"
|
|
|
- title="添加人员"
|
|
|
- align-center
|
|
|
- :close-on-click-modal="false"
|
|
|
- :destroy-on-close="true"
|
|
|
- class="customDialog--pushObject"
|
|
|
- >
|
|
|
- <User :customUserList="currentRow?.checkUser || []" @cancel="userInfo = false" @submit="handleSubmit"/>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -86,27 +82,40 @@
|
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
|
import Search from '@/views/disaster/components/Search.vue';
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
- import { getTaskExecutionListData } from '@/api/disaster-precaution';
|
|
|
+ import { getTaskExecutionList, getTaskInspectorList } from '@/api/disaster-precaution';
|
|
|
import type { TaskExecutionListResponse } from '@/types/disaster-precaution';
|
|
|
import OverdueIcon from '@/assets/svg/overdue.svg';
|
|
|
import { TASK_STAGE } from './src/constants/task-execution';
|
|
|
- import { OVERDUE_STATUS, TASK_TYPE_MAP, TASK_STAGE_MAP } from './src/constants/task-execution';
|
|
|
+ import { INSPECT_TYPE_MAP, TASK_STAGE_MAP } from './src/constants/task-execution';
|
|
|
import { TABLE_OPTIONS_EXECUTION, TASK_EXECUTION_TABLE_COLUMNS, TASK_EXECUTION_SEARCH_CONFIG } from './src/config';
|
|
|
- import User from '@/views/disaster/components/User.vue';
|
|
|
+ import type { TaskExecutionListQuery } from '@/types/disaster-precaution';
|
|
|
+ import type { QueryPageRequest } from '@/types/disaster';
|
|
|
+ import { USER_TYPE } from './src/constants/task-execution';
|
|
|
import type { UserInfo } from '@/types/push-object';
|
|
|
|
|
|
const userInfo = ref(false);
|
|
|
const searchData = reactive({
|
|
|
- taskType: '',
|
|
|
- taskStage: '',
|
|
|
+ inspectType: '',
|
|
|
+ taskState: '',
|
|
|
});
|
|
|
- const handleSearch = (data: any) => {
|
|
|
- console.log(data);
|
|
|
- getTableData();
|
|
|
- };
|
|
|
|
|
|
const tableData = ref<TaskExecutionListResponse[]>([]);
|
|
|
const { tableConfig, pagination } = useTableConfig(TASK_EXECUTION_TABLE_COLUMNS, TABLE_OPTIONS_EXECUTION);
|
|
|
+ let taskManagementListQuery: QueryPageRequest<TaskExecutionListQuery> = {
|
|
|
+ pageNumber: pagination.pageNumber,
|
|
|
+ pageSize: pagination.pageSize,
|
|
|
+ queryParam: {},
|
|
|
+ };
|
|
|
+ const handleSearch = () => {
|
|
|
+ taskManagementListQuery.queryParam = {};
|
|
|
+ if (searchData.inspectType !== '') {
|
|
|
+ taskManagementListQuery.queryParam.inspectType = searchData.inspectType;
|
|
|
+ }
|
|
|
+ if (searchData.taskState !== '') {
|
|
|
+ taskManagementListQuery.queryParam.taskState = searchData.taskState;
|
|
|
+ }
|
|
|
+ getTableData();
|
|
|
+ };
|
|
|
const handleSizeChange = (value: number) => {
|
|
|
pagination.pageSize = value;
|
|
|
getTableData();
|
|
|
@@ -115,20 +124,24 @@
|
|
|
pagination.pageNumber = value;
|
|
|
getTableData();
|
|
|
};
|
|
|
- const currentRow = ref<TaskExecutionListResponse>();
|
|
|
- const handleAddCheckUser = (row: TaskExecutionListResponse) => {
|
|
|
- currentRow.value = row;
|
|
|
+ const currentTaskId = ref<number>();
|
|
|
+ const currentTaskInspectorList = ref<UserInfo[]>([]);
|
|
|
+ const handleAddCheckUser = async(row: TaskExecutionListResponse) => {
|
|
|
+ currentTaskId.value = row.id;
|
|
|
+ const res = await getTaskInspectorList(currentTaskId.value);
|
|
|
+ currentTaskInspectorList.value = res.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ isSelected: true,
|
|
|
+ };
|
|
|
+ });
|
|
|
userInfo.value = true;
|
|
|
};
|
|
|
- const handleSubmit = (userList: UserInfo[]) => {
|
|
|
- const currentIndex = tableData.value.findIndex((item) => item.id === currentRow.value?.id);
|
|
|
- tableData.value[currentIndex].checkUser = userList;
|
|
|
- };
|
|
|
const getTableData = async () => {
|
|
|
tableConfig.loading = true;
|
|
|
- const res = await getTaskExecutionListData();
|
|
|
- tableData.value = res;
|
|
|
- pagination.total = tableData.value.length;
|
|
|
+ const res = await getTaskExecutionList(taskManagementListQuery);
|
|
|
+ tableData.value = res.records;
|
|
|
+ pagination.total = res.totalRow;
|
|
|
tableConfig.loading = false;
|
|
|
};
|
|
|
onMounted(() => {
|