add 添加任务驳回
This commit is contained in:
parent
68d029f47a
commit
5d1027cc3a
@ -102,4 +102,28 @@ export const returnTask = (taskId: string) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务驳回
|
||||||
|
* @param taskId
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
export const backProcess = (data: object) => {
|
||||||
|
return request({
|
||||||
|
url: '/workflow/task/backProcess',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取流程状态
|
||||||
|
* @param taskId
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export const getBusinessStatus = (taskId: string) => {
|
||||||
|
return request({
|
||||||
|
url: '/workflow/task/getBusinessStatus/' + taskId,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="dialog.visible = false">取消</el-button>
|
<el-button @click="dialog.visible = false">取消</el-button>
|
||||||
<el-button type="primary" @click="handleCompleteTask"> 提交 </el-button>
|
<el-button type="primary" @click="handleCompleteTask"> 提交 </el-button>
|
||||||
|
<el-button type="danger" @click="handleBackProcess" v-if="businessStatus === 'waiting'"> 退回 </el-button>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -25,7 +26,7 @@
|
|||||||
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 } from '@/api/workflow/task';
|
import { completeTask, backProcess, getBusinessStatus } from '@/api/workflow/task';
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
taskId: {
|
taskId: {
|
||||||
@ -35,8 +36,10 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 遮罩层
|
//遮罩层
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
//流程状态
|
||||||
|
const businessStatus = ref('');
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
const dialog = reactive<DialogOption>({
|
||||||
visible: false,
|
visible: false,
|
||||||
@ -51,7 +54,13 @@ const form = ref<Record<string, any>>({
|
|||||||
});
|
});
|
||||||
//打开弹窗
|
//打开弹窗
|
||||||
const openDialog = (visible?: any) => {
|
const openDialog = (visible?: any) => {
|
||||||
|
form.value.message = undefined;
|
||||||
dialog.visible = visible;
|
dialog.visible = visible;
|
||||||
|
nextTick(() => {
|
||||||
|
getBusinessStatus(props.taskId).then((response) => {
|
||||||
|
businessStatus.value = response.data;
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
@ -66,6 +75,17 @@ const handleCompleteTask = async () => {
|
|||||||
emits('submitCallback');
|
emits('submitCallback');
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 驳回流程 */
|
||||||
|
const handleBackProcess = async () => {
|
||||||
|
form.value.taskId = props.taskId;
|
||||||
|
await proxy?.$modal.confirm('是否确认驳回到申请人?');
|
||||||
|
await backProcess(form.value).finally(() => (loading.value = false));
|
||||||
|
dialog.visible = false;
|
||||||
|
emits('submitCallback');
|
||||||
|
proxy?.$modal.msgSuccess('操作成功');
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对外暴露子组建方法
|
* 对外暴露子组建方法
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user