add 添加已办列表
This commit is contained in:
parent
1273fcd17d
commit
7cb0864be3
@ -1,11 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<center>
|
||||||
|
<el-radio-group v-model="tab" @change="changeTab(tab)">
|
||||||
|
<el-radio-button label="waiting">待办任务</el-radio-button>
|
||||||
|
<el-radio-button label="finish">已办任务</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</center>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
<div class="mb-[10px]" v-show="showSearch">
|
<div class="mb-[10px]" v-show="showSearch">
|
||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<el-form :model="queryParams" ref="queryFormRef" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryFormRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="任务名称" prop="name">
|
<el-form-item label="任务名称" prop="name">
|
||||||
<el-input v-model="queryParams.name" placeholder="请输入模型名称" clearable @keyup.enter="handleQuery" />
|
<el-input v-model="queryParams.name" placeholder="请输入任务名称" clearable @keyup.enter="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
@ -18,7 +30,7 @@
|
|||||||
<el-card shadow="hover">
|
<el-card shadow="hover">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="handleQuery"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -27,11 +39,16 @@
|
|||||||
<el-table-column fixed align="center" type="index" label="序号" width="50"></el-table-column>
|
<el-table-column fixed align="center" type="index" label="序号" width="50"></el-table-column>
|
||||||
<el-table-column fixed align="center" prop="name" label="任务名称"></el-table-column>
|
<el-table-column fixed align="center" prop="name" label="任务名称"></el-table-column>
|
||||||
<el-table-column fixed align="center" prop="assignee" label="办理人"></el-table-column>
|
<el-table-column fixed align="center" prop="assignee" label="办理人"></el-table-column>
|
||||||
<el-table-column align="center" prop="businessStatusName" label="流程状态" min-width="70">
|
<el-table-column align="center" v-if="tab === 'waiting'" prop="businessStatusName" label="流程状态" min-width="70">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag type="success">{{scope.row.businessStatusName}}</el-tag>
|
<el-tag type="success">{{scope.row.businessStatusName}}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column align="center" v-else prop="endTime" label="流程状态" min-width="70">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-tag type="success" v-if="scope.row.endTime">已完成</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="createTime" label="创建时间" width="160"></el-table-column>
|
<el-table-column align="center" prop="createTime" label="创建时间" width="160"></el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
@ -39,14 +56,20 @@
|
|||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="text" size="small" icon="el-icon-thumb" @click="handleApprovalRecord(scope.row)">审批记录</el-button>
|
<el-button type="text" size="small" icon="el-icon-thumb" @click="handleApprovalRecord(scope.row)">审批记录</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5" v-if="tab === 'waiting'">
|
||||||
<el-button type="text" size="small" icon="el-icon-thumb" @click="handleCompleteTask(scope.row.id)">办理</el-button>
|
<el-button type="text" size="small" icon="el-icon-thumb" @click="handleCompleteTask(scope.row.id)">办理</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getWaitingList"
|
||||||
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 审批记录 -->
|
<!-- 审批记录 -->
|
||||||
<approvalRecord ref="approvalRecordRef" />
|
<approvalRecord ref="approvalRecordRef" />
|
||||||
@ -54,7 +77,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getTaskWaitByPage, completeTask } from '@/api/workflow/task';
|
import { getTaskWaitByPage, getTaskFinishByPage, completeTask } from '@/api/workflow/task';
|
||||||
import { ComponentInternalInstance } from 'vue';
|
import { ComponentInternalInstance } from 'vue';
|
||||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||||
//审批记录组件
|
//审批记录组件
|
||||||
@ -80,9 +103,9 @@ const queryParams = ref<Record<string, any>>({
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
name: undefined
|
name: undefined
|
||||||
});
|
});
|
||||||
|
const tab = ref('waiting');
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getWaitingList();
|
||||||
});
|
});
|
||||||
//审批记录
|
//审批记录
|
||||||
const handleApprovalRecord = (row: any) => {
|
const handleApprovalRecord = (row: any) => {
|
||||||
@ -93,7 +116,11 @@ const handleApprovalRecord = (row: any) => {
|
|||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
if ('waiting' === tab.value) {
|
||||||
|
getWaitingList();
|
||||||
|
} else {
|
||||||
|
getFinishList();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
@ -108,8 +135,15 @@ const handleSelectionChange = (selection: any) => {
|
|||||||
single.value = selection.length !== 1;
|
single.value = selection.length !== 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
};
|
};
|
||||||
|
const changeTab = async (data: string) => {
|
||||||
|
if ('waiting' === data) {
|
||||||
|
getWaitingList();
|
||||||
|
} else {
|
||||||
|
getFinishList();
|
||||||
|
}
|
||||||
|
};
|
||||||
//分页
|
//分页
|
||||||
const getList = () => {
|
const getWaitingList = () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
getTaskWaitByPage(queryParams.value).then((resp) => {
|
getTaskWaitByPage(queryParams.value).then((resp) => {
|
||||||
taskList.value = resp.rows;
|
taskList.value = resp.rows;
|
||||||
@ -117,6 +151,15 @@ const getList = () => {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const getFinishList = () => {
|
||||||
|
loading.value = true;
|
||||||
|
getTaskFinishByPage(queryParams.value).then((resp) => {
|
||||||
|
taskList.value = resp.rows;
|
||||||
|
total.value = resp.total;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/** 办理流程 */
|
/** 办理流程 */
|
||||||
const handleCompleteTask = async (taskId: string) => {
|
const handleCompleteTask = async (taskId: string) => {
|
||||||
await proxy?.$modal.confirm('是否确认办理流程?');
|
await proxy?.$modal.confirm('是否确认办理流程?');
|
||||||
@ -124,7 +167,7 @@ const handleCompleteTask = async (taskId: string) => {
|
|||||||
taskId: taskId
|
taskId: taskId
|
||||||
};
|
};
|
||||||
await completeTask(param).finally(() => (loading.value = false));
|
await completeTask(param).finally(() => (loading.value = false));
|
||||||
getList();
|
getWaitingList();
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user