!22 fix(dq): 修复BPM审批界面新增反馈后列表不显示的问题
* fix(dq): 修复BPM审批界面新增反馈后列表不显示的问题 * docs(dq): 更新整改任务BPM节点权限配置文档 * feat(dq): BPM审批界面新增分管所领导字段 * feat(dq): 整改任务表单新增分管所领导字段 * refactor(dq): 是否办结/部门经办人改为写入Flowable流程变量
This commit is contained in:
@@ -73,6 +73,11 @@
|
||||
<j-select-dept v-model:value="mainForm.measureResDept" :disabled="mainDisabled" :multiple="true" checkStrictly allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="分管所领导" name="chargeLeaderId">
|
||||
<j-select-user v-model:value="mainForm.chargeLeaderId" :disabled="mainDisabled" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="整改交付成果" name="rectificationEvidence">
|
||||
<a-input v-model:value="mainForm.rectificationEvidence" :disabled="mainDisabled" allow-clear />
|
||||
@@ -234,7 +239,7 @@
|
||||
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import Icon from '/@/components/Icon/index';
|
||||
import { saveBpmForm, saveSubApprove, specificProblemOptions } from '../DqInspectTask.api';
|
||||
import { saveBpmForm, setProcessVariable, specificProblemOptions } from '../DqInspectTask.api';
|
||||
import { list as progressList, deleteOne as progressDelete } from '../../inspectProgress/DqInspectProgress.api';
|
||||
import { usePermission } from '/@/hooks/web/usePermission';
|
||||
import TaskHandleInnerContent from '/@/views/super/bpm/process/personalOffice/myHandleTask/content/TaskHandleInnerContent.vue';
|
||||
@@ -283,6 +288,7 @@
|
||||
targetNode: '',
|
||||
measureResLeader: '',
|
||||
measureResDept: '',
|
||||
chargeLeaderId: '',
|
||||
rectificationEvidence: '',
|
||||
evaluationCriterion: '',
|
||||
isNeedAppro: '',
|
||||
@@ -423,13 +429,6 @@
|
||||
Object.keys(mainForm).forEach((key) => {
|
||||
mainForm[key] = record[key] ?? '';
|
||||
});
|
||||
const approveInfo = record.approveInfo;
|
||||
const deptId = getCurrentUserDeptId();
|
||||
if (approveInfo && deptId && approveInfo[deptId]) {
|
||||
const detail = approveInfo[deptId];
|
||||
isEnd.value = detail.isEnd ?? 0;
|
||||
subApproveUser.value = detail.implWorker ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrentUserDeptId() {
|
||||
@@ -443,11 +442,6 @@
|
||||
return departs.length === 1 ? departs[0]?.id || '' : '';
|
||||
}
|
||||
|
||||
function getCurrentAssignee() {
|
||||
const userInfo = (userStore.getUserInfo || {}) as Record<string, any>;
|
||||
return userInfo.username || '';
|
||||
}
|
||||
|
||||
async function loadFeedbackList() {
|
||||
const bpmProcessId = processInfo.value.processInstanceId;
|
||||
if (!mainForm.id) {
|
||||
@@ -531,15 +525,11 @@
|
||||
|
||||
async function saveSubApproveUserVariable(options: { showSuccessMessage?: boolean } = {}) {
|
||||
const { showSuccessMessage = true } = options;
|
||||
const processInstanceId = processInfo.value.processInstanceId;
|
||||
const isEndValue = String(isEnd.value);
|
||||
const usernameValue = normalizeUsernameList(subApproveUser.value);
|
||||
const deptId = getCurrentUserDeptId();
|
||||
if (!mainForm.id) {
|
||||
createMessage.warning('主表ID不能为空');
|
||||
return false;
|
||||
}
|
||||
if (!deptId) {
|
||||
createMessage.warning('无法获取当前用户部门');
|
||||
if (!processInstanceId) {
|
||||
createMessage.warning('流程实例ID不能为空');
|
||||
return false;
|
||||
}
|
||||
if (isEndValue !== '1' && !usernameValue) {
|
||||
@@ -549,21 +539,19 @@
|
||||
|
||||
savingSubApproveUser.value = true;
|
||||
try {
|
||||
const params: Record<string, any> = {
|
||||
mainId: mainForm.id,
|
||||
deptId,
|
||||
isEnd: Number(isEndValue),
|
||||
};
|
||||
if (isEndValue === '1') {
|
||||
params.implWorker = getCurrentAssignee();
|
||||
} else {
|
||||
params.implUserNameList = usernameValue.split(',').filter(Boolean);
|
||||
}
|
||||
const res = await saveSubApprove(params);
|
||||
if (!res?.success) {
|
||||
createMessage.warning(res?.message || '保存失败');
|
||||
const isEndResult = await saveProcessVariable('is_end', isEndValue);
|
||||
if (!isEndResult?.success) {
|
||||
createMessage.warning(isEndResult.message || '保存失败');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isEndValue !== '1') {
|
||||
const subApproveUserResult = await saveProcessVariable('sub_approve_user', usernameValue);
|
||||
if (!subApproveUserResult?.success) {
|
||||
createMessage.warning(subApproveUserResult.message || '保存失败');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (showSuccessMessage) createMessage.success('保存成功');
|
||||
return true;
|
||||
} catch {
|
||||
@@ -574,6 +562,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
function saveProcessVariable(varField: string, varVal: any) {
|
||||
return setProcessVariable({
|
||||
processInstanceId: processInfo.value.processInstanceId,
|
||||
local: false,
|
||||
varField,
|
||||
varVal,
|
||||
});
|
||||
}
|
||||
|
||||
function normalizeUsernameList(value: string) {
|
||||
return String(value || '')
|
||||
.split(',')
|
||||
|
||||
Reference in New Issue
Block a user