yxk-20260506-"部门负责人接受任务并分配"节点可以选择子流程经办人,并存入局部流程变量,供后续使用。
This commit is contained in:
@@ -148,6 +148,23 @@
|
||||
<template v-if="showProcessHandle">
|
||||
<a-divider />
|
||||
<div class="section-title">流程办理</div>
|
||||
<a-form class="process-variable-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="子流程经办人" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
|
||||
<a-space class="sub-approve-user-row">
|
||||
<a-input
|
||||
v-model:value="subApproveUser"
|
||||
placeholder="输入username,多个用英文逗号分隔"
|
||||
allow-clear
|
||||
:disabled="savingSubApproveUser"
|
||||
/>
|
||||
<a-button type="primary" :loading="savingSubApproveUser" @click="saveSubApproveUserVariable">保存经办人</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<TaskHandleInnerContent
|
||||
:form-data="formData"
|
||||
:claim="claim"
|
||||
@@ -164,7 +181,7 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
|
||||
import { bgPartymatterFeedbackList, bgPartymatterFeedbackSaveOrUpdate, saveBpmForm } from '../BgPartymatter.api';
|
||||
import { bgPartymatterFeedbackList, bgPartymatterFeedbackSaveOrUpdate, saveBpmForm, setProcessVariable } from '../BgPartymatter.api';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue';
|
||||
const { isDisabledAuth, hasPermission, initBpmFormData} = usePermission();
|
||||
@@ -192,8 +209,10 @@
|
||||
const loading = ref(false);
|
||||
const savingMain = ref(false);
|
||||
const savingFeedback = ref(false);
|
||||
const savingSubApproveUser = ref(false);
|
||||
const showFeedbackForm = ref(false);
|
||||
const feedbackList = ref<any[]>([]);
|
||||
const subApproveUser = ref('');
|
||||
|
||||
const mainForm = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
@@ -356,6 +375,45 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function saveSubApproveUserVariable() {
|
||||
const processInstanceId = processInfo.value.processInstanceId;
|
||||
const usernameValue = normalizeUsernameList(subApproveUser.value);
|
||||
if (!processInstanceId) {
|
||||
createMessage.warning('流程实例ID不能为空');
|
||||
return;
|
||||
}
|
||||
if (!usernameValue) {
|
||||
createMessage.warning('请输入子流程经办人username');
|
||||
return;
|
||||
}
|
||||
|
||||
savingSubApproveUser.value = true;
|
||||
try {
|
||||
const res = await setProcessVariable({
|
||||
processInstanceId,
|
||||
taskId: processInfo.value.taskId,
|
||||
local: true,
|
||||
varField: 'subApproveUser',
|
||||
varVal: usernameValue,
|
||||
});
|
||||
if (res.success) {
|
||||
createMessage.success(res.message || '保存成功');
|
||||
} else {
|
||||
createMessage.warning(res.message || '保存失败');
|
||||
}
|
||||
} finally {
|
||||
savingSubApproveUser.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeUsernameList(value: string) {
|
||||
return String(value || '')
|
||||
.split(',')
|
||||
.map((item) => item.trim())
|
||||
.filter(Boolean)
|
||||
.join(',');
|
||||
}
|
||||
|
||||
function handleProcessSuccess() {
|
||||
emit('success');
|
||||
}
|
||||
@@ -404,6 +462,20 @@
|
||||
border-top: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.process-variable-form {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.sub-approve-user-row {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
|
||||
:deep(.ant-input-affix-wrapper),
|
||||
:deep(.ant-input) {
|
||||
min-width: 280px;
|
||||
}
|
||||
}
|
||||
|
||||
.main-actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
Reference in New Issue
Block a user