update 调整委托,转办
This commit is contained in:
parent
44117ba831
commit
466d52b9f5
@ -1,13 +1,13 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { TaskQuery, TaskVO } from '@/api/workflow/task/types';
|
import { TaskQuery, FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询待办列表
|
* 查询待办列表
|
||||||
* @param query
|
* @param query
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const getPageByTaskWait = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
|
export const getPageByTaskWait = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/workflow/task/getPageByTaskWait',
|
url: '/workflow/task/getPageByTaskWait',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -20,7 +20,7 @@ export const getPageByTaskWait = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
|
|||||||
* @param query
|
* @param query
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const getPageByTaskFinish = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
|
export const getPageByTaskFinish = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/workflow/task/getPageByTaskFinish',
|
url: '/workflow/task/getPageByTaskFinish',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -33,7 +33,7 @@ export const getPageByTaskFinish = (query: TaskQuery): AxiosPromise<TaskVO[]> =>
|
|||||||
* @param query
|
* @param query
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const getPageByTaskCopy = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
|
export const getPageByTaskCopy = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/workflow/task/getPageByTaskCopy',
|
url: '/workflow/task/getPageByTaskCopy',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -46,7 +46,7 @@ export const getPageByTaskCopy = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
|
|||||||
* @param query
|
* @param query
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const getPageByAllTaskWait = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
|
export const getPageByAllTaskWait = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/workflow/task/getPageByAllTaskWait',
|
url: '/workflow/task/getPageByAllTaskWait',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -59,7 +59,7 @@ export const getPageByAllTaskWait = (query: TaskQuery): AxiosPromise<TaskVO[]> =
|
|||||||
* @param query
|
* @param query
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const getPageByAllTaskFinish = (query: TaskQuery): AxiosPromise<TaskVO[]> => {
|
export const getPageByAllTaskFinish = (query: TaskQuery): AxiosPromise<FlowTaskVO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/workflow/task/getPageByAllTaskFinish',
|
url: '/workflow/task/getPageByAllTaskFinish',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -263,3 +263,15 @@ export const getListByDeleteMultiInstance = (taskId: string) => {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务操作 操作类型,委派 delegateTask、转办 transferTask、加签 addSignature、减签 reductionSignature
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const taskOperation = (data: TaskOperationBo, operation: string) => {
|
||||||
|
return request({
|
||||||
|
url: `/workflow/task/taskOperation/${operation}`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -34,3 +34,14 @@ export interface VariableVo {
|
|||||||
key: string;
|
key: string;
|
||||||
value: string;
|
value: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TaskOperationBo {
|
||||||
|
//委派/转办人的用户ID(必填,准对委派/转办人操作)
|
||||||
|
userId?: string;
|
||||||
|
//加签/减签人的用户ID列表(必填,针对加签/减签操作)
|
||||||
|
userIds?: string[];
|
||||||
|
//任务ID(必填)
|
||||||
|
taskId: string;
|
||||||
|
//意见或备注信息(可选)
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
@ -85,12 +85,12 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { ComponentInternalInstance } from 'vue';
|
import { ComponentInternalInstance } from 'vue';
|
||||||
import { ElForm } from 'element-plus';
|
import { ElForm } from 'element-plus';
|
||||||
import { completeTask, backProcess, getTaskById, transferTask, terminationTask, getBackTaskNode, delegateTask } from '@/api/workflow/task';
|
import { completeTask, backProcess, getTaskById, taskOperation, terminationTask, getBackTaskNode } from '@/api/workflow/task';
|
||||||
import UserSelect from '@/components/UserSelect';
|
import UserSelect from '@/components/UserSelect';
|
||||||
import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue';
|
import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
import { UserVO } from '@/api/system/user/types';
|
import { UserVO } from '@/api/system/user/types';
|
||||||
import { FlowTaskVO } from '@/api/workflow/task/types';
|
import { FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
|
||||||
const userSelectCopyRef = ref<InstanceType<typeof UserSelect>>();
|
const userSelectCopyRef = ref<InstanceType<typeof UserSelect>>();
|
||||||
const transferTaskRef = ref<InstanceType<typeof UserSelect>>();
|
const transferTaskRef = ref<InstanceType<typeof UserSelect>>();
|
||||||
const delegateTaskRef = ref<InstanceType<typeof UserSelect>>();
|
const delegateTaskRef = ref<InstanceType<typeof UserSelect>>();
|
||||||
@ -234,8 +234,8 @@ const handleBackProcess = async () => {
|
|||||||
backLoading.value = true;
|
backLoading.value = true;
|
||||||
backButtonDisabled.value = true;
|
backButtonDisabled.value = true;
|
||||||
await backProcess(backForm.value).finally(() => {
|
await backProcess(backForm.value).finally(() => {
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
buttonDisabled.value = false
|
buttonDisabled.value = false;
|
||||||
});
|
});
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
backLoading.value = false;
|
backLoading.value = false;
|
||||||
@ -289,17 +289,17 @@ const openTransferTask = () => {
|
|||||||
//转办
|
//转办
|
||||||
const handleTransferTask = async (data) => {
|
const handleTransferTask = async (data) => {
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
let params = {
|
const taskOperationBo = reactive<TaskOperationBo>({
|
||||||
taskId: taskId.value,
|
|
||||||
userId: data[0].userId,
|
userId: data[0].userId,
|
||||||
comment: form.value.message
|
taskId: taskId.value,
|
||||||
};
|
message: form.value.message
|
||||||
|
});
|
||||||
await proxy?.$modal.confirm('是否确认提交?');
|
await proxy?.$modal.confirm('是否确认提交?');
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
buttonDisabled.value = true;
|
buttonDisabled.value = true;
|
||||||
await transferTask(params).finally(() => {
|
await taskOperation(taskOperationBo, 'transferTask').finally(() => {
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
buttonDisabled.value = false
|
buttonDisabled.value = false;
|
||||||
});
|
});
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
emits('submitCallback');
|
emits('submitCallback');
|
||||||
@ -316,17 +316,17 @@ const openDelegateTask = () => {
|
|||||||
//委托
|
//委托
|
||||||
const handleDelegateTask = async (data) => {
|
const handleDelegateTask = async (data) => {
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
let params = {
|
const taskOperationBo = reactive<TaskOperationBo>({
|
||||||
taskId: taskId.value,
|
|
||||||
userId: data[0].userId,
|
userId: data[0].userId,
|
||||||
nickName: data[0].nickName
|
taskId: taskId.value,
|
||||||
};
|
message: form.value.message
|
||||||
|
});
|
||||||
await proxy?.$modal.confirm('是否确认提交?');
|
await proxy?.$modal.confirm('是否确认提交?');
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
buttonDisabled.value = true;
|
buttonDisabled.value = true;
|
||||||
await delegateTask(params).finally(() => {
|
await taskOperation(taskOperationBo, 'delegateTask').finally(() => {
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
buttonDisabled.value = false
|
buttonDisabled.value = false;
|
||||||
});
|
});
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
emits('submitCallback');
|
emits('submitCallback');
|
||||||
@ -345,8 +345,8 @@ const handleTerminationTask = async (data) => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
buttonDisabled.value = true;
|
buttonDisabled.value = true;
|
||||||
await terminationTask(params).finally(() => {
|
await terminationTask(params).finally(() => {
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
buttonDisabled.value = false
|
buttonDisabled.value = false;
|
||||||
});
|
});
|
||||||
dialog.visible = false;
|
dialog.visible = false;
|
||||||
emits('submitCallback');
|
emits('submitCallback');
|
||||||
|
@ -60,17 +60,14 @@
|
|||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||||
<el-button
|
<el-button v-hasPermi="['workflow:leave:edit']" size="small" type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['workflow:leave:edit']"
|
>修改</el-button
|
||||||
size="small"
|
>
|
||||||
type="primary"
|
|
||||||
icon="Edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
<el-col :span="1.5" v-if="scope.row.status === 'draft' || scope.row.status === 'cancel' || scope.row.status === 'back'">
|
||||||
<el-button v-hasPermi="['workflow:leave:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
<el-button v-hasPermi="['workflow:leave:remove']" size="small" type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
@ -78,12 +75,7 @@
|
|||||||
<el-button type="primary" size="small" icon="View" @click="handleView(scope.row)">查看</el-button>
|
<el-button type="primary" size="small" icon="View" @click="handleView(scope.row)">查看</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5" v-if="scope.row.status === 'waiting'">
|
<el-col :span="1.5" v-if="scope.row.status === 'waiting'">
|
||||||
<el-button
|
<el-button size="small" type="primary" icon="Notification" @click="handleCancelProcessApply(scope.row.id)">撤销</el-button>
|
||||||
size="small"
|
|
||||||
type="primary"
|
|
||||||
icon="Notification"
|
|
||||||
@click="handleCancelProcessApply(scope.row.id)"
|
|
||||||
>撤销</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
@ -233,7 +225,7 @@ const handleCancelProcessApply = async (id: string) => {
|
|||||||
let data = {
|
let data = {
|
||||||
businessId: id,
|
businessId: id,
|
||||||
message: '撤销流程!'
|
message: '撤销流程!'
|
||||||
}
|
};
|
||||||
await cancelProcessApply(data).finally(() => (loading.value = false));
|
await cancelProcessApply(data).finally(() => (loading.value = false));
|
||||||
await getList();
|
await getList();
|
||||||
proxy?.$modal.msgSuccess('撤销成功');
|
proxy?.$modal.msgSuccess('撤销成功');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user