yxk-20260715
在流程详情弹窗中新增 增补审批意见 tab,仅从 我的待阅、我的已阅、我的已办 三类入口打开时显示。 用户提交后只写入 task_approval_opinion,不写 Flowable 原生历史/评论表,也不写旧流程日志表。 提交成功后刷新 审批历史,新增意见可在审批历史中看到。
This commit is contained in:
+87
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<div class="supplement-opinion-pane">
|
||||
<a-form layout="vertical">
|
||||
<a-form-item label="审批意见" required>
|
||||
<a-textarea
|
||||
v-model:value="opinion"
|
||||
:maxlength="1000"
|
||||
:rows="8"
|
||||
show-count
|
||||
placeholder="请输入增补审批意见"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary" :loading="submitLoading" @click="handleSubmit">提交</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { saveSupplementOpinion } from '/@/views/taskApprovalOpinion/TaskApprovalOpinion.api';
|
||||
|
||||
const props = defineProps<{
|
||||
formData: Recordable;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'success'): void;
|
||||
}>();
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const opinion = ref('');
|
||||
const submitLoading = ref(false);
|
||||
|
||||
function getProcessInstId() {
|
||||
return props.formData?.procInsId || props.formData?.procInstId || props.formData?.processInstanceId;
|
||||
}
|
||||
|
||||
function getVars() {
|
||||
return props.formData?.vars || {};
|
||||
}
|
||||
|
||||
function buildSubmitParams(opinionText: string) {
|
||||
const vars = getVars();
|
||||
return {
|
||||
processInstId: getProcessInstId(),
|
||||
flowTaskId: props.formData?.flowTaskId || props.formData?.taskId,
|
||||
taskDefKey: props.formData?.taskDefKey,
|
||||
taskTaskId: props.formData?.taskTaskId || props.formData?.dataId || props.formData?.processDataId,
|
||||
businessId: props.formData?.businessId || vars.businessId || vars.business_id,
|
||||
flowCode: props.formData?.flowCode || vars.flowCode || vars.flow_code,
|
||||
opinion: opinionText,
|
||||
};
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
const opinionText = opinion.value.trim();
|
||||
if (!getProcessInstId()) {
|
||||
createMessage.error('流程实例ID不能为空');
|
||||
return;
|
||||
}
|
||||
if (!opinionText) {
|
||||
createMessage.warning('请输入增补审批意见');
|
||||
return;
|
||||
}
|
||||
|
||||
submitLoading.value = true;
|
||||
try {
|
||||
await saveSupplementOpinion(buildSubmitParams(opinionText));
|
||||
opinion.value = '';
|
||||
emit('success');
|
||||
} finally {
|
||||
submitLoading.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.supplement-opinion-pane {
|
||||
height: 100%;
|
||||
padding: 16px 24px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user