add 添加转办
This commit is contained in:
parent
cc293536e2
commit
803d44cac0
@ -179,3 +179,17 @@ export const updateAssignee = (taskIds: Array<string>,userId: string) => {
|
||||
method: 'put'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 转办任务
|
||||
* @param taskIds
|
||||
* @param userId
|
||||
* @returns
|
||||
*/
|
||||
export const transferTask = (data: object) => {
|
||||
return request({
|
||||
url: `/workflow/task/transferTask`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
@ -75,7 +75,7 @@
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" v-loading="loading" @click="submitFileForm">确 定</el-button>
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -24,15 +24,19 @@
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button v-loading="buttonLoading" type="primary" @click="handleCompleteTask"> 提交 </el-button>
|
||||
<el-button v-if="task.businessStatus === 'waiting' && task.multiInstance" v-loading="buttonLoading" type="primary" @click="openTransferTask"> 转办 </el-button>
|
||||
<el-button v-if="task.businessStatus === 'waiting' && task.multiInstance" v-loading="buttonLoading" type="primary" @click="addMultiInstanceUser"> 加签 </el-button>
|
||||
<el-button v-if="task.businessStatus === 'waiting' && task.multiInstance" v-loading="buttonLoading" type="primary" @click="deleteMultiInstanceUser"> 减签 </el-button>
|
||||
<el-button v-if="task.businessStatus === 'waiting'" v-loading="buttonLoading" type="danger" @click="handleBackProcess"> 退回 </el-button>
|
||||
<el-button v-loading="buttonLoading" @click="cancel">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
<UserSelect ref="userSelectCopyRef" :data="selectCopyUserIds" @confirm-call-back="userSelectCopyCallBack"></UserSelect>
|
||||
<!-- 抄送 -->
|
||||
<UserSelect ref="userSelectCopyRef" :multiple="userMultiple" :data="selectCopyUserIds" @confirm-call-back="userSelectCopyCallBack"></UserSelect>
|
||||
<!-- 转办 -->
|
||||
<UserSelect ref="transferTaskRef" :multiple="userMultiple" @confirm-call-back="handleTransferTask"></UserSelect>
|
||||
<!-- 加签组件 -->
|
||||
<multiInstanceUser ref="multiInstanceUserRef" :title="title" @submit-callback="handleQuery" />
|
||||
<multiInstanceUser ref="multiInstanceUserRef" :title="title" @submit-callback='closeDialog' />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
@ -40,13 +44,14 @@
|
||||
import { ref } from 'vue';
|
||||
import { ComponentInternalInstance } from 'vue';
|
||||
import { ElForm } from 'element-plus';
|
||||
import { completeTask, backProcess, getTaskById } from '@/api/workflow/task';
|
||||
import { completeTask, backProcess, getTaskById,transferTask } from '@/api/workflow/task';
|
||||
import UserSelect from '@/components/UserSelect';
|
||||
import MultiInstanceUser from '@/components/Process/multiInstanceUser.vue';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { UserVO } from '@/api/system/user/types';
|
||||
import { TaskVO } from '@/api/workflow/task/types';
|
||||
const userSelectCopyRef = ref<InstanceType<typeof UserSelect>>();
|
||||
const transferTaskRef = ref<InstanceType<typeof UserSelect>>();
|
||||
//加签组件
|
||||
const multiInstanceUserRef = ref<InstanceType<typeof MultiInstanceUser>>();
|
||||
|
||||
@ -66,6 +71,9 @@ const taskId = ref<string>('');
|
||||
const selectCopyUserList = ref<UserVO[]>([]);
|
||||
//抄送人id
|
||||
const selectCopyUserIds = ref<string>(undefined);
|
||||
//是否多选人员
|
||||
const userMultiple = ref(false);
|
||||
|
||||
//任务
|
||||
const task = ref<TaskVO>({
|
||||
id: undefined,
|
||||
@ -107,6 +115,9 @@ const form = ref<Record<string, any>>({
|
||||
messageType: ['1'],
|
||||
wfCopyList: []
|
||||
});
|
||||
const closeDialog = () => {
|
||||
dialog.visible = false
|
||||
}
|
||||
//打开弹窗
|
||||
const openDialog = (id?: string) => {
|
||||
selectCopyUserIds.value = undefined
|
||||
@ -172,6 +183,7 @@ const cancel = async () => {
|
||||
};
|
||||
//打开抄送人员
|
||||
const openUserSelectCopy = () => {
|
||||
userMultiple.value = true
|
||||
userSelectCopyRef.value.open();
|
||||
};
|
||||
//确认抄送人员
|
||||
@ -203,6 +215,31 @@ const deleteMultiInstanceUser = () => {
|
||||
multiInstanceUserRef.value.getDeleteMultiInstanceList(taskId.value);
|
||||
}
|
||||
};
|
||||
//打开转办
|
||||
const openTransferTask = () => {
|
||||
userMultiple.value = false
|
||||
transferTaskRef.value.open();
|
||||
};
|
||||
//转办
|
||||
const handleTransferTask = async (data) => {
|
||||
if(data && data.length > 0){
|
||||
let params = {
|
||||
taskId: taskId.value,
|
||||
userId: data[0].userId,
|
||||
comment: form.value.message
|
||||
}
|
||||
await proxy?.$modal.confirm('是否确认提交?');
|
||||
loading.value = true;
|
||||
buttonLoading.value = true;
|
||||
await transferTask(params).finally(() => (loading.value = false));
|
||||
dialog.visible = false;
|
||||
emits('submitCallback');
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
}else{
|
||||
proxy?.$modal.msgWarning('请选择用户!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对外暴露子组件方法
|
||||
*/
|
||||
|
@ -138,6 +138,7 @@ const deptTreeRef = ref<ElTreeInstance>();
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const tableRef = ref<VxeTableInstance<UserVO>>();
|
||||
|
||||
|
||||
const userDialog = useDialog({
|
||||
title: '用户选择'
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user