yxk-20260710

党委会、所务会、把把脉:部门负责人审批节点,增加判断是否完成,若完成则进入督办部门审批;若未完成则回到经办人继续反馈完成情况,直到最终完成任务。
This commit is contained in:
ye1023
2026-07-10 14:17:27 +08:00
parent d2b941d5c6
commit e4dd7d85ab
4 changed files with 134 additions and 10 deletions
@@ -18,6 +18,7 @@ enum Api {
exportXlsHeaders = '/bgpartymatter/bgPartymatter/exportXlsHeaders', exportXlsHeaders = '/bgpartymatter/bgPartymatter/exportXlsHeaders',
saveBpmForm = '/bgpartymatter/bgPartymatter/saveBpmForm', saveBpmForm = '/bgpartymatter/bgPartymatter/saveBpmForm',
setProcessVariable = '/act/process/setProcessVariable', setProcessVariable = '/act/process/setProcessVariable',
setBpmVariableLocal = '/act/process/setBpmVariableLocal',
bgPartymatterFeedbackList = '/bgpartymatter/bgPartymatter/listBgPartymatterFeedbackByMainId', bgPartymatterFeedbackList = '/bgpartymatter/bgPartymatter/listBgPartymatterFeedbackByMainId',
bgPartymatterFeedbackSave= '/bgpartymatter/bgPartymatter/addBgPartymatterFeedback', bgPartymatterFeedbackSave= '/bgpartymatter/bgPartymatter/addBgPartymatterFeedback',
bgPartymatterFeedbackEdit= '/bgpartymatter/bgPartymatter/editBgPartymatterFeedback', bgPartymatterFeedbackEdit= '/bgpartymatter/bgPartymatter/editBgPartymatterFeedback',
@@ -111,6 +112,10 @@ export const setProcessVariable = (params) => {
return defHttp.post({ url: Api.setProcessVariable, params }, { isTransformResponse: false }); return defHttp.post({ url: Api.setProcessVariable, params }, { isTransformResponse: false });
} }
export const setBpmVariableLocal = (params) => {
return defHttp.post({ url: Api.setBpmVariableLocal, params }, { isTransformResponse: false });
}
/** /**
* 列表接口 * 列表接口
* @param params * @param params
@@ -220,6 +220,18 @@
<!-- </a-col>--> <!-- </a-col>-->
</a-row> </a-row>
</a-form> </a-form>
<a-form v-if="showFinishSelector" class="process-variable-form" labelAlign="left" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="是否已完成" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
<a-radio-group v-model:value="isFinish" :disabled="savingFinish">
<a-radio value="0">未完成</a-radio>
<a-radio value="1">已完成</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
</a-form>
<TaskHandleInnerContent <TaskHandleInnerContent
:form-data="formData" :form-data="formData"
:claim="claim" :claim="claim"
@@ -240,7 +252,7 @@
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue'; import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import Icon from '/@/components/Icon/index'; import Icon from '/@/components/Icon/index';
import { bgPartymatterFeedbackDelete, bgPartymatterFeedbackList, saveBpmForm, setProcessVariable } from '../BgPartymatter.api'; import { bgPartymatterFeedbackDelete, bgPartymatterFeedbackList, saveBpmForm, setBpmVariableLocal } from '../BgPartymatter.api';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue'; import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue';
import JDictSelectTag from "../../../../components/Form/src/jeecg/components/JDictSelectTag.vue"; import JDictSelectTag from "../../../../components/Form/src/jeecg/components/JDictSelectTag.vue";
@@ -281,6 +293,7 @@
const loading = ref(false); const loading = ref(false);
const savingMain = ref(false); const savingMain = ref(false);
const savingSubApproveUser = ref(false); const savingSubApproveUser = ref(false);
const savingFinish = ref(false);
const showBaseInfoDetail = ref(false); const showBaseInfoDetail = ref(false);
const showFeedbackDetail = ref(true); const showFeedbackDetail = ref(true);
const feedbackList = ref<any[]>([]); const feedbackList = ref<any[]>([]);
@@ -298,6 +311,7 @@
const subApproveUserNameText = ref(''); const subApproveUserNameText = ref('');
const userResolveVersion = ref(0); const userResolveVersion = ref(0);
const isEnd = ref(0); const isEnd = ref(0);
const isFinish = ref('0');
const lastGeneratedNumber = ref(''); const lastGeneratedNumber = ref('');
const mainForm = reactive<Record<string, any>>({ const mainForm = reactive<Record<string, any>>({
@@ -366,6 +380,7 @@
const canManageFeedback = computed(() => props.formBpm && props.formData?.PROCESS_TAB_TYPE === 'run' && !!props.formData?.taskId); const canManageFeedback = computed(() => props.formBpm && props.formData?.PROCESS_TAB_TYPE === 'run' && !!props.formData?.taskId);
const showAddFeedback = computed(() => String(props.formData?.extendUrlParams?.addfeedback ?? '') === '1'); const showAddFeedback = computed(() => String(props.formData?.extendUrlParams?.addfeedback ?? '') === '1');
const showSubApproveUser = computed(() => String(props.formData?.extendUrlParams?.selectuser ?? '') === '1'); const showSubApproveUser = computed(() => String(props.formData?.extendUrlParams?.selectuser ?? '') === '1');
const showFinishSelector = computed(() => String(props.formData?.extendUrlParams?.selectfinish ?? '') === '1');
const showSubApproveUserSelector = computed(() => showSubApproveUser.value && String(isEnd.value) !== '1'); const showSubApproveUserSelector = computed(() => showSubApproveUser.value && String(isEnd.value) !== '1');
const processInfo = computed(() => ({ const processInfo = computed(() => ({
@@ -412,6 +427,14 @@
{ immediate: true } { immediate: true }
); );
watch(
() => props.formData?.vars?.isFinish,
(value) => {
isFinish.value = String(value ?? '0') === '1' ? '1' : '0';
},
{ immediate: true }
);
watch( watch(
subApproveUser, subApproveUser,
(value) => { (value) => {
@@ -547,7 +570,7 @@
} }
function buildDeptLeaderApproveReason() { function buildDeptLeaderApproveReason() {
return '已审批,请督办部门确认。'; return String(isFinish.value) === '1' ? '已审批,请督办部门确认。' : '请反馈完成情况。';
} }
function buildSuperviseHandlerConfirmReason() { function buildSuperviseHandlerConfirmReason() {
@@ -739,7 +762,13 @@
} }
} }
if (showSubApproveUser.value) { if (showSubApproveUser.value) {
return saveSubApproveUserVariable({ showSuccessMessage: false }); const subApproveUserSaved = await saveSubApproveUserVariable({ showSuccessMessage: false });
if (!subApproveUserSaved) {
return false;
}
}
if (showFinishSelector.value) {
return saveFinishVariable({ showSuccessMessage: false });
} }
return true; return true;
} }
@@ -828,11 +857,39 @@
} }
} }
async function saveFinishVariable(options: { showSuccessMessage?: boolean } = {}) {
const { showSuccessMessage = true } = options;
const processInstanceId = processInfo.value.processInstanceId;
if (!processInstanceId) {
createMessage.warning('流程实例ID不能为空');
return false;
}
savingFinish.value = true;
try {
// Gateway_isfinish 读取当前执行分支的局部变量,需在办理动作前写入。
const result = await saveProcessVariable('isFinish', String(isFinish.value));
if (!result?.success) {
createMessage.warning(result.message || '保存失败');
return false;
}
if (showSuccessMessage) {
createMessage.success('保存成功');
}
return true;
} catch (error) {
createMessage.warning('保存失败');
return false;
} finally {
savingFinish.value = false;
}
}
function saveProcessVariable(varField: string, varVal: any) { function saveProcessVariable(varField: string, varVal: any) {
return setProcessVariable({ return setBpmVariableLocal({
processInstanceId: processInfo.value.processInstanceId, processInstanceId: processInfo.value.processInstanceId,
taskId: processInfo.value.taskId, taskId: processInfo.value.taskId,
local: true, parentLevel: 2,
varField, varField,
varVal, varVal,
}); });
@@ -19,6 +19,7 @@ enum Api {
bgTakepulseFeedbackList = '/bqtakepulse/bgTakepulse/queryBgTakepulseFeedbackByMainId', bgTakepulseFeedbackList = '/bqtakepulse/bgTakepulse/queryBgTakepulseFeedbackByMainId',
saveBpmForm = '/bqtakepulse/bgTakepulse/saveBpmForm', saveBpmForm = '/bqtakepulse/bgTakepulse/saveBpmForm',
setProcessVariable = '/act/process/setProcessVariable', setProcessVariable = '/act/process/setProcessVariable',
setBpmVariableLocal = '/act/process/setBpmVariableLocal',
bgTakepulseBpmFeedbackList = '/bqtakepulse/bgTakepulse/listBgTakepulseFeedbackByMainId', bgTakepulseBpmFeedbackList = '/bqtakepulse/bgTakepulse/listBgTakepulseFeedbackByMainId',
bgTakepulseFeedbackSave = '/bqtakepulse/bgTakepulse/addBgTakepulseFeedback', bgTakepulseFeedbackSave = '/bqtakepulse/bgTakepulse/addBgTakepulseFeedback',
bgTakepulseFeedbackEdit = '/bqtakepulse/bgTakepulse/editBgTakepulseFeedback', bgTakepulseFeedbackEdit = '/bqtakepulse/bgTakepulse/editBgTakepulseFeedback',
@@ -101,6 +102,10 @@ export const setProcessVariable = (params) => {
return defHttp.post({ url: Api.setProcessVariable, params }, { isTransformResponse: false }); return defHttp.post({ url: Api.setProcessVariable, params }, { isTransformResponse: false });
} }
export const setBpmVariableLocal = (params) => {
return defHttp.post({ url: Api.setBpmVariableLocal, params }, { isTransformResponse: false });
}
/** /**
* BPM办理页按主表和流程实例查询反馈,避免不同督办轮次的反馈混在一起。 * BPM办理页按主表和流程实例查询反馈,避免不同督办轮次的反馈混在一起。
*/ */
@@ -245,6 +245,18 @@
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
<a-form v-if="showFinishSelector" class="process-variable-form" labelAlign="left" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="是否已完成" :labelCol="wideLabelCol" :wrapperCol="wideWrapperCol">
<a-radio-group v-model:value="isFinish" :disabled="savingFinish">
<a-radio value="0">未完成</a-radio>
<a-radio value="1">已完成</a-radio>
</a-radio-group>
</a-form-item>
</a-col>
</a-row>
</a-form>
<TaskHandleInnerContent <TaskHandleInnerContent
:form-data="formData" :form-data="formData"
:claim="claim" :claim="claim"
@@ -268,7 +280,7 @@
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue'; import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
import Icon from '/@/components/Icon/index'; import Icon from '/@/components/Icon/index';
import { bgTakepulseFeedbackDelete, bgTakepulseFeedbackList, saveBpmForm, setProcessVariable } from '../BgTakepulse.api'; import { bgTakepulseFeedbackDelete, bgTakepulseFeedbackList, saveBpmForm, setBpmVariableLocal } from '../BgTakepulse.api';
import { usePermission } from '/@/hooks/web/usePermission'; import { usePermission } from '/@/hooks/web/usePermission';
import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue'; import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue';
import BgTakepulseBPMFeedbackModal from './BgTakepulseBPMFeedbackModal.vue'; import BgTakepulseBPMFeedbackModal from './BgTakepulseBPMFeedbackModal.vue';
@@ -306,6 +318,7 @@
const loading = ref(false); const loading = ref(false);
const savingMain = ref(false); const savingMain = ref(false);
const savingSubApproveUser = ref(false); const savingSubApproveUser = ref(false);
const savingFinish = ref(false);
const showBaseInfoDetail = ref(false); const showBaseInfoDetail = ref(false);
const showFeedbackDetail = ref(true); const showFeedbackDetail = ref(true);
const feedbackList = ref<any[]>([]); const feedbackList = ref<any[]>([]);
@@ -323,6 +336,7 @@
const subApproveUserNameText = ref(''); const subApproveUserNameText = ref('');
const userResolveVersion = ref(0); const userResolveVersion = ref(0);
const isEnd = ref(0); const isEnd = ref(0);
const isFinish = ref('0');
const mainForm = reactive<Record<string, any>>({ const mainForm = reactive<Record<string, any>>({
id: '', id: '',
@@ -392,6 +406,7 @@
const canManageFeedback = computed(() => props.formBpm && props.formData?.PROCESS_TAB_TYPE === 'run' && !!props.formData?.taskId); const canManageFeedback = computed(() => props.formBpm && props.formData?.PROCESS_TAB_TYPE === 'run' && !!props.formData?.taskId);
const showAddFeedback = computed(() => String(props.formData?.extendUrlParams?.addfeedback ?? '') === '1'); const showAddFeedback = computed(() => String(props.formData?.extendUrlParams?.addfeedback ?? '') === '1');
const showSubApproveUser = computed(() => String(props.formData?.extendUrlParams?.selectuser ?? '') === '1'); const showSubApproveUser = computed(() => String(props.formData?.extendUrlParams?.selectuser ?? '') === '1');
const showFinishSelector = computed(() => String(props.formData?.extendUrlParams?.selectfinish ?? '') === '1');
const showSubApproveUserSelector = computed(() => showSubApproveUser.value && String(isEnd.value) !== '1'); const showSubApproveUserSelector = computed(() => showSubApproveUser.value && String(isEnd.value) !== '1');
const processInfo = computed(() => ({ const processInfo = computed(() => ({
@@ -435,6 +450,14 @@
{ immediate: true } { immediate: true }
); );
watch(
() => props.formData?.vars?.isFinish,
(value) => {
isFinish.value = String(value ?? '0') === '1' ? '1' : '0';
},
{ immediate: true }
);
watch( watch(
subApproveUser, subApproveUser,
(value) => { (value) => {
@@ -561,7 +584,7 @@
} }
function buildDeptLeaderApproveReason() { function buildDeptLeaderApproveReason() {
return '已审批,请督办部门确认。'; return String(isFinish.value) === '1' ? '已审批,请督办部门确认。' : '请反馈完成情况。';
} }
function buildSuperviseHandlerConfirmReason() { function buildSuperviseHandlerConfirmReason() {
@@ -710,7 +733,13 @@
} }
} }
if (showSubApproveUser.value) { if (showSubApproveUser.value) {
return saveSubApproveUserVariable({ showSuccessMessage: false }); const subApproveUserSaved = await saveSubApproveUserVariable({ showSuccessMessage: false });
if (!subApproveUserSaved) {
return false;
}
}
if (showFinishSelector.value) {
return saveFinishVariable({ showSuccessMessage: false });
} }
return true; return true;
} }
@@ -799,11 +828,39 @@
} }
} }
async function saveFinishVariable(options: { showSuccessMessage?: boolean } = {}) {
const { showSuccessMessage = true } = options;
const processInstanceId = processInfo.value.processInstanceId;
if (!processInstanceId) {
createMessage.warning('流程实例ID不能为空');
return false;
}
savingFinish.value = true;
try {
// Gateway_isfinish 读取当前分支局部变量,需在办理动作前写入外层分支 execution。
const result = await saveProcessVariable('isFinish', String(isFinish.value));
if (!result?.success) {
createMessage.warning(result.message || '保存失败');
return false;
}
if (showSuccessMessage) {
createMessage.success('保存成功');
}
return true;
} catch (error) {
createMessage.warning('保存失败');
return false;
} finally {
savingFinish.value = false;
}
}
function saveProcessVariable(varField: string, varVal: any) { function saveProcessVariable(varField: string, varVal: any) {
return setProcessVariable({ return setBpmVariableLocal({
processInstanceId: processInfo.value.processInstanceId, processInstanceId: processInfo.value.processInstanceId,
taskId: processInfo.value.taskId, taskId: processInfo.value.taskId,
local: true, parentLevel: 2,
varField, varField,
varVal, varVal,
}); });