yxk-20260509-党委会流程改造
1、部门负责人分配任务节点:领导可以直接反馈结果并办结任务
This commit is contained in:
@@ -125,22 +125,28 @@
|
||||
</div>
|
||||
<a-form v-if="showSubApproveUser" class="process-variable-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="是否办结" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
|
||||
<a-radio-group v-model:value="isEnd" :disabled="savingSubApproveUser">
|
||||
<a-radio :value="0">否(分配部门经办人)</a-radio>
|
||||
<a-radio :value="1">是(办结)</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-if="showSubApproveUserSelector" :span="12">
|
||||
<a-form-item label="部门经办人" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
|
||||
<a-space class="sub-approve-user-row">
|
||||
|
||||
<j-select-user
|
||||
v-model:value="subApproveUser"
|
||||
:disabled="savingSubApproveUser"
|
||||
allow-clear
|
||||
/>
|
||||
<!-- <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-col :span="24">
|
||||
<a-form-item :wrapperCol="wideActionWrapperCol">
|
||||
<a-button type="primary" :loading="savingSubApproveUser" @click="saveSubApproveUserVariable">保存</a-button>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -190,6 +196,7 @@
|
||||
const wrapperCol = { xs: { span: 24 }, sm: { span: 17 } };
|
||||
const wideLabelCol = { xs: { span: 24 }, sm: { span: 3 } };
|
||||
const wideWrapperCol = { xs: { span: 24 }, sm: { span: 21 } };
|
||||
const wideActionWrapperCol = { xs: { span: 24 }, sm: { span: 21, offset: 3 } };
|
||||
|
||||
const feedbackModalRef = ref();
|
||||
const loading = ref(false);
|
||||
@@ -198,6 +205,7 @@
|
||||
const showBaseInfoDetail = ref(false);
|
||||
const feedbackList = ref<any[]>([]);
|
||||
const subApproveUser = ref('');
|
||||
const isEnd = ref(0);
|
||||
|
||||
const mainForm = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
@@ -242,6 +250,7 @@
|
||||
const showProcessHandle = computed(() => props.formBpm && !!props.formData?.taskId);
|
||||
const showAddFeedback = computed(() => String(props.formData?.extendUrlParams?.addfeedback ?? '') === '1');
|
||||
const showSubApproveUser = computed(() => String(props.formData?.extendUrlParams?.selectuser ?? '') === '1');
|
||||
const showSubApproveUserSelector = computed(() => showSubApproveUser.value && String(isEnd.value) !== '1');
|
||||
|
||||
const processInfo = computed(() => ({
|
||||
taskId: props.formData?.taskId,
|
||||
@@ -267,6 +276,14 @@
|
||||
() => initFormData()
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.formData?.vars?.isEnd,
|
||||
(value) => {
|
||||
isEnd.value = String(value ?? '0') === '1' ? 1 : 0;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
async function initFormData() {
|
||||
const dataId = props.formData?.dataId;
|
||||
if (!dataId) {
|
||||
@@ -335,35 +352,48 @@
|
||||
|
||||
async function saveSubApproveUserVariable() {
|
||||
const processInstanceId = processInfo.value.processInstanceId;
|
||||
const isEndValue = String(isEnd.value);
|
||||
const usernameValue = normalizeUsernameList(subApproveUser.value);
|
||||
if (!processInstanceId) {
|
||||
createMessage.warning('流程实例ID不能为空');
|
||||
return;
|
||||
}
|
||||
if (!usernameValue) {
|
||||
if (isEndValue !== '1' && !usernameValue) {
|
||||
createMessage.warning('请选择部门经办人');
|
||||
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 || '保存失败');
|
||||
const isEndResult = await saveProcessVariable('isEnd', isEndValue);
|
||||
if (!isEndResult?.success) {
|
||||
createMessage.warning(isEndResult.message || '保存失败');
|
||||
return;
|
||||
}
|
||||
|
||||
if (isEndValue !== '1') {
|
||||
const subApproveUserResult = await saveProcessVariable('subApproveUser', usernameValue);
|
||||
if (!subApproveUserResult?.success) {
|
||||
createMessage.warning(subApproveUserResult.message || '保存失败');
|
||||
return;
|
||||
}
|
||||
}
|
||||
createMessage.success('保存成功');
|
||||
} finally {
|
||||
savingSubApproveUser.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function saveProcessVariable(varField: string, varVal: any) {
|
||||
return setProcessVariable({
|
||||
processInstanceId: processInfo.value.processInstanceId,
|
||||
taskId: processInfo.value.taskId,
|
||||
local: true,
|
||||
varField,
|
||||
varVal,
|
||||
});
|
||||
}
|
||||
|
||||
function normalizeUsernameList(value: string) {
|
||||
return String(value || '')
|
||||
.split(',')
|
||||
|
||||
Reference in New Issue
Block a user