-
+
-
-
-
+
+
-
-
+
-
-
+
-
-
+
@@ -117,40 +92,51 @@
-
+
-
-
-
+
+
-
+
-
+
-
+
- 提 交
-
+
+ {{ buttonText }}
+
+
流程进度
@@ -164,8 +150,7 @@
-
-
+
@@ -173,9 +158,9 @@
-
+
-
+
@@ -185,20 +170,24 @@ import { useRoute, useRouter } from 'vue-router';
import type { FormInstance, FormRules } from 'element-plus'; // 引入 FormInstance 和 FormRules 类型
import {
listDmsBillsLubeInstanceActivity,
- addDmsBillsLubeInstanceActivity
+ addDmsBillsLubeInstanceActivity,
+ updateDmsBillsLubeInstanceActivity
} from '@/api/dms/dmsBillsLubeInstanceActivity';
import {
DmsBillsLubeInstanceActivityVO,
DmsBillsLubeInstanceActivityForm
} from '@/api/dms/dmsBillsLubeInstanceActivity/types';
import { getDmsBillsLubeInstance } from '@/api/dms/dmsBillsLubeInstance';
-import { getDmsPlanLubeDetail } from '@/api/dms/dmsPlanLubeDetail';
+import { getDmsPlanLubeDetailList} from '@/api/dms/dmsPlanLubeDetail';
import {DmsPlanLubeDetailVO} from "@/api/dms/dmsPlanLubeDetail/types";
// 引入工作流相关组件和API
-import { startWorkFlow } from '@/api/workflow/task';
+import { startWorkFlow, pageByTaskWait } from '@/api/workflow/task';
+import { pageByCurrent } from '@/api/workflow/instance';
import SubmitVerify from '@/components/Process/submitVerify.vue';
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
+import { FlowInstanceQuery, FlowInstanceVO } from '@/api/workflow/instance/types';
+import { TaskQuery, FlowTaskVO } from '@/api/workflow/task/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { lube_level, process_handle_status } = toRefs
(proxy?.useDict('lube_level', 'process_handle_status'));
@@ -229,6 +218,14 @@ const planLubeId = ref(''); // 润滑计划ID,从工单信息中获取
const lubeInstanceId = route.params.lubeInstanceId as string; // 类型断言
const buttonLoading = ref(false);
+// 新增状态
+const currentTaskId = ref(null);
+const isCreatingWorkflow = ref(false); // true 表示在走创建流程的第一步(startWorkFlow)
+const buttonText = ref('创建工单并提交');
+
+// 暂存业务数据,等待工作流提交成功后再保存
+const pendingActivityData = ref(null);
+
// 计算下一步序号
const nextStepOrder = computed(() => {
return dmsBillsLubeInstanceActivityList.value.length + 1;
@@ -267,19 +264,19 @@ const nextStepFormRules = reactive({
lubeLevel: [{ required: true, message: "润滑级别不能为空", trigger: "change" }],
lubeGroup: [{ required: true, message: "润滑组别不能为空", trigger: "blur" }],
lubeSupervisor: [{ required: true, message: "润滑负责人不能为空", trigger: "blur" }],
- // 处理意见仅在第二步及以后验证
- processHandleResolution: [{ required: nextStepOrder.value > 1, message: "处理意见不能为空", trigger: "blur" }],
+ // 处理意见的校验会由 updateButtonAndFormState 动态设置
+ processHandleResolution: [{ required: false, message: "处理意见不能为空", trigger: "blur" }],
});
// 查询参数
const queryParams = reactive({
pageNum: 1,
- pageSize: 50,
+ pageSize: 150,
lubeInstanceId: lubeInstanceId,
});
// 初始化数据
-onMounted(() => {
+onMounted(async () => {
// 判断当前页面是查看还是编辑
if(route.name === 'childDmsBillsLubeInstanceActivity') {
isUpdate.value = true;
@@ -287,23 +284,235 @@ onMounted(() => {
isUpdate.value = false;
}
- // 加载工单实例数据
- dmsBillsLubeInstance();
- // 加载工单实例节点数据
- getList();
+ if (isUpdate.value) { // 仅在编辑模式下加载数据和设置状态
+ await loadData();
+ } else {
+ // 查看模式也需要加载工单信息和已处理节点
+ await dmsBillsLubeInstance();
+ await getList();
+ loading.value = false;
+ }
});
+async function loadData() {
+ loading.value = true;
+ try {
+ // 先清除表单验证状态,避免在数据加载过程中触发不必要的表单验证错误
+ if (nextStepFormRef.value) {
+ nextStepFormRef.value.clearValidate();
+ }
+
+ await dmsBillsLubeInstance();
+ await getList(); // 获取已处理节点会影响 nextStepOrder 和 nextStepForm 的初始化
+
+ if (dmsBillsLubeInstanceActivityList.value.length === 0) {
+ currentTaskId.value = null;
+ isCreatingWorkflow.value = true;
+ } else {
+ isCreatingWorkflow.value = false;
+ currentTaskId.value = null; // 重置当前任务ID,准备从流程引擎获取
+ const completedSteps = dmsBillsLubeInstanceActivityList.value.length;
+
+ // 如果流程业务步骤少于3步(工单创建、工单处理、工单完成),则尝试获取当前活动任务
+ if (completedSteps < 3) {
+ proxy?.$modal.loading("正在获取最新流程任务...");
+ let expectedNodeName = '';
+ if (completedSteps === 1) expectedNodeName = '工单处理';
+ else if (completedSteps === 2) expectedNodeName = '工单完成';
+
+ console.log(`[loadData] Attempting to find current task. Completed steps: ${completedSteps}, Expected next node: '${expectedNodeName}' for businessId: ${lubeInstanceId}`);
+
+ try {
+ let tasks: FlowTaskVO[] = [];
+ // 尝试使用期望的节点名称进行精确查找
+ if (expectedNodeName) {
+ const taskRes = await pageByTaskWait({
+ pageNum: 1,
+ pageSize: 10, // 通常特定业务ID和节点名称的任务不会很多
+ flowCode: 'Lube01', // 从 submitFormData 获取或确认此编码正确
+ nodeName: expectedNodeName
+ });
+ if (taskRes.rows) {
+ tasks = taskRes.rows.filter(task => task.businessId === lubeInstanceId);
+ if (tasks.length > 0) {
+ console.log(`[loadData] Found ${tasks.length} task(s) using specific nodeName '${expectedNodeName}' and businessId '${lubeInstanceId}'.`);
+ } else {
+ console.log(`[loadData] No tasks found using specific nodeName '${expectedNodeName}' for businessId '${lubeInstanceId}'. Will try broader search.`);
+ }
+ }
+ }
+
+ let foundTask: FlowTaskVO | undefined = tasks.length > 0 ? tasks[0] : undefined; // 如果有多个,暂时取第一个
+ if (tasks.length > 1) {
+ console.warn(`[loadData] Multiple tasks (${tasks.length}) found with specific nodeName '${expectedNodeName}' and businessId '${lubeInstanceId}'. Using the first one found: ${foundTask?.id}.`);
+ }
+
+ // 如果未通过特定节点名称找到,则尝试仅通过flowCode查找,然后匹配businessId
+ if (!foundTask) {
+ console.log(`[loadData] Task not found with specific nodeName. Fetching all waiting tasks for flowCode 'Lube01' to filter by businessId '${lubeInstanceId}'.`);
+ const taskResAll = await pageByTaskWait({
+ pageNum: 1,
+ pageSize: 50, // 获取更多任务以便筛选
+ flowCode: 'Lube01'
+ });
+
+ if (taskResAll.rows && taskResAll.rows.length > 0) {
+ const businessTasks = taskResAll.rows.filter(task => task.businessId === lubeInstanceId);
+ if (businessTasks.length === 1) {
+ foundTask = businessTasks[0];
+ console.log(`[loadData] Found single task by businessId from all waiting tasks: ${foundTask.id}, Node: ${foundTask.nodeName}`);
+ } else if (businessTasks.length > 1) {
+ console.warn(`[loadData] Multiple tasks (${businessTasks.length}) found for businessId '${lubeInstanceId}' from all waiting tasks. Attempting to match with expectedNodeName '${expectedNodeName}'.`);
+ if (expectedNodeName) {
+ foundTask = businessTasks.find(task => task.nodeName === expectedNodeName);
+ }
+ if (foundTask) {
+ console.log(`[loadData] Matched task by expectedNodeName from multiple: ${foundTask.id}`);
+ } else {
+ // Fallback: 如果仍有多个或无法通过expectedNodeName匹配,则取第一个(或记录更严重的警告)
+ foundTask = businessTasks[0];
+ console.warn(`[loadData] Could not specifically match by nodeName among multiple tasks for businessId '${lubeInstanceId}'. Using the first one found: ${foundTask?.id}, Node: ${foundTask?.nodeName}. Review workflow design if this is not correct.`);
+ }
+ } else {
+ console.log(`[loadData] No tasks found for businessId '${lubeInstanceId}' even after broader search by flowCode 'Lube01'.`);
+ }
+ }
+ }
+
+ if (foundTask) {
+ currentTaskId.value = foundTask.id;
+ console.log(`[loadData] Successfully set currentTaskId via pageByTaskWait to: ${currentTaskId.value} (Node: ${foundTask.nodeName}, BusinessID: ${foundTask.businessId})`);
+ } else {
+ console.warn(`[loadData] No suitable waiting task found for businessId ${lubeInstanceId} with flowCode Lube01. Button may show '暂无操作'.`);
+ }
+ } catch (error) {
+ console.error("[loadData] Error fetching current task via pageByTaskWait:", error);
+ proxy?.$modal.msgError("获取最新流程任务失败");
+ } finally {
+ proxy?.$modal.closeLoading();
+ }
+ } else {
+ console.log("[loadData] All expected business steps completed (>=3) or initial creation. No active task to fetch from workflow via pageByTaskWait for middle steps.");
+ }
+ }
+
+ updateButtonAndFormState();
+
+ // 数据加载后再次清除表单验证状态,确保UI渲染正确
+ setTimeout(() => {
+ if (nextStepFormRef.value) {
+ nextStepFormRef.value.clearValidate();
+ }
+ }, 100);
+ } catch (error) {
+ console.error("Failed to load initial data", error);
+ proxy?.$modal.msgError("加载数据失败");
+ // 出错时,尝试恢复到一个相对安全的状态
+ currentTaskId.value = null;
+ isCreatingWorkflow.value = dmsBillsLubeInstanceActivityList.value.length === 0;
+ updateButtonAndFormState();
+ } finally {
+ loading.value = false;
+ }
+}
+
+function updateButtonAndFormState() {
+ const activitiesCount = dmsBillsLubeInstanceActivityList.value.length;
+
+ // 第一步:创建工单(工单创建)
+ if (activitiesCount === 0 && isCreatingWorkflow.value) {
+ buttonText.value = '创建工单并提交';
+ nextStepFormRules.processHandleResolution = [{ required: false, message: "处理意见不能为空", trigger: "blur" }];
+ // 清理 nextStepForm
+ Object.assign(nextStepForm, {
+ instanceActivityId: undefined, // 重置ID
+ lubeInstanceId: lubeInstanceId, // 确保lubeInstanceId正确
+ lubeGroup: undefined,
+ lubeSupervisor: undefined,
+ lubeLevel: undefined,
+ processHandleResolution: undefined,
+ processHandleStatus: undefined,
+ processStepOrder: undefined,
+ startTime: undefined,
+ endTime: undefined,
+ handleUserId: undefined,
+ handleBy: undefined,
+ handleTime: undefined,
+ transferUserId: undefined,
+ attr1: undefined,
+ remark: undefined,
+ });
+ }
+ // 有待办任务ID,且非创建模式
+ else if (currentTaskId.value && !isCreatingWorkflow.value) {
+ const currentStepBasedOnActivities = activitiesCount + 1; // 下一步是第几步
+
+ if (currentStepBasedOnActivities === 2) {
+ // 第二步:工单处理
+ buttonText.value = '工单处理';
+ nextStepFormRules.processHandleResolution = [{ required: true, message: "处理意见不能为空", trigger: "blur" }];
+ } else if (currentStepBasedOnActivities === 3) {
+ // 第三步:工单完成
+ buttonText.value = '工单完成';
+ nextStepFormRules.processHandleResolution = [{ required: true, message: "处理意见不能为空", trigger: "blur" }];
+ } else {
+ buttonText.value = '提交处理';
+ nextStepFormRules.processHandleResolution = [{ required: true, message: "处理意见不能为空", trigger: "blur" }];
+ }
+
+ if (activitiesCount > 0) {
+ if (currentStepBasedOnActivities === 3) {
+ // 第三步应复制第一步的数据
+ const firstActivity = dmsBillsLubeInstanceActivityList.value[0];
+ Object.assign(nextStepForm, {
+ instanceActivityId: undefined, // 新节点ID为空
+ lubeInstanceId: lubeInstanceId,
+ lubeGroup: firstActivity.lubeGroup, // 复制第一步的数据
+ lubeSupervisor: firstActivity.lubeSupervisor, // 复制第一步的数据
+ lubeLevel: firstActivity.lubeLevel, // 复制第一步的数据
+ processHandleResolution: '', // 清空处理意见
+ remark: '', // 清空备注
+ processHandleStatus: undefined,
+ processStepOrder: undefined,
+ });
+ } else {
+ // 其他步骤使用最后一个节点的数据
+ const lastActivity = dmsBillsLubeInstanceActivityList.value[activitiesCount - 1];
+ Object.assign(nextStepForm, {
+ instanceActivityId: undefined, // 新节点ID为空
+ lubeInstanceId: lubeInstanceId,
+ lubeGroup: lastActivity.lubeGroup,
+ lubeSupervisor: lastActivity.lubeSupervisor,
+ lubeLevel: lastActivity.lubeLevel,
+ processHandleResolution: '', // 清空处理意见
+ remark: '', // 清空备注
+ processHandleStatus: undefined,
+ processStepOrder: undefined,
+ });
+ }
+ } else { // 有 currentTaskId 但没有历史活动,这通常不应该发生,但为了健壮性处理
+ Object.assign(nextStepForm, {
+ instanceActivityId: undefined,
+ lubeInstanceId: lubeInstanceId,
+ processHandleResolution: '',
+ remark: '',
+ });
+ }
+ } else { // 没有待办任务(可能已结束、非处理人打开、或查看模式)或状态不明确
+ buttonText.value = '暂无操作';
+ if (isUpdate.value) { // 如果是编辑模式但无操作,则禁用提交相关的校验
+ nextStepFormRules.processHandleResolution = [{ required: false }];
+ }
+ }
+}
+
// 获取工单实例数据
const dmsBillsLubeInstance = async () => {
-
- // const res = await listDmsBillsLubeInstance(queryParams);
- //billsInfo.value = res.rows[0];
const _lubeInstanceId = lubeInstanceId;
const res = await getDmsBillsLubeInstance(_lubeInstanceId);
billsInfo.value = res.data;
// 确保 planLubeId 是字符串类型
- // const lubeIdFromServer = res.rows[0].planLubeId;
const lubeIdFromServer = res.data.planLubeId;
planLubeId.value = typeof lubeIdFromServer === 'number' ? String(lubeIdFromServer) : lubeIdFromServer;
@@ -325,13 +534,8 @@ const dmsBillsLubeInstance = async () => {
const getPlanLubeDetailData = async () => {
if (!planLubeId.value) return;
loading.value = true;
- try {
- const res = await getDmsPlanLubeDetail(planLubeId.value);
- planLubeDetail.value = res && res.rows ? [res.rows] : [];
- } catch (error) {
- console.error('获取润滑计划详情失败', error);
- proxy?.$modal.msgError("获取润滑计划详情失败");
- }
+ const res = await getDmsPlanLubeDetailList({planLubeId: planLubeId.value});
+ planLubeDetail.value = res.data;
};
// 获取工单实例节点数据
@@ -360,8 +564,18 @@ const getList = async () => {
processHandleResolution: null, // 第二步需要填写处理意见
remark: ''
});
- } else if (nextStepOrder.value > 2) {
- // 第三步及以后,使用最后一个节点的数据
+ } else if (nextStepOrder.value === 3) {
+ // 第三步,复制第一步的润滑组别和润滑负责人
+ const firstActivity = res.rows[0];
+ Object.assign(nextStepForm, {
+ lubeGroup: firstActivity.lubeGroup, // 复制第一步数据
+ lubeSupervisor: firstActivity.lubeSupervisor, // 复制第一步数据
+ lubeLevel: firstActivity.lubeLevel, // 复制第一步数据
+ processHandleResolution: null, // 清空处理意见
+ remark: ''
+ });
+ } else if (nextStepOrder.value > 3) {
+ // 第四步及以后,使用最后一个节点的数据(正常不会有这种情况)
const lastActivity = res.rows[res.rows.length - 1];
Object.assign(nextStepForm, {
lubeGroup: lastActivity.lubeGroup,
@@ -400,52 +614,98 @@ const getList = async () => {
// 提交表单
const submitForm = async () => {
if (!nextStepFormRef.value) return;
- await nextStepFormRef.value.validate(async (valid) => {
+
+ try {
+ // 清空之前的错误状态
+ buttonLoading.value = false;
+ pendingActivityData.value = null;
+
+ // 触发一次校验更新,确保最新的rules生效
+ nextStepFormRef.value.clearValidate();
+
+ const valid = await nextStepFormRef.value.validate().catch(errors => {
+ console.error("表单验证错误:", errors);
+ return false;
+ });
+
if (valid) {
+ buttonLoading.value = true;
+
try {
- buttonLoading.value = true;
- // 设置流程步骤顺序
- nextStepForm.processStepOrder = nextStepOrder.value;
+ nextStepForm.processStepOrder = dmsBillsLubeInstanceActivityList.value.length + 1;
nextStepForm.lubeInstanceId = lubeInstanceId;
- // 在第一步时不需要处理意见
- if (nextStepOrder.value === 1) {
- nextStepForm.processHandleResolution = null;
+ // 确保处理意见有值,避免数据库NOT NULL约束异常
+ if (nextStepForm.processHandleResolution === undefined || nextStepForm.processHandleResolution === null) {
+ nextStepForm.processHandleResolution = '';
}
- // 提交
- const res = await addDmsBillsLubeInstanceActivity(nextStepForm);
+ // 复制一份表单数据用于后续保存
+ pendingActivityData.value = JSON.parse(JSON.stringify(nextStepForm));
- // 启动工作流
- await handleStartWorkFlow(res.data);
+ // 将当前表单的数据放入流程变量 - 仅传递简单必要字段而不是整个对象
+ taskVariables.value = {
+ entity: {
+ lubeInstanceId: pendingActivityData.value.lubeInstanceId,
+ lubeGroup: pendingActivityData.value.lubeGroup,
+ lubeSupervisor: pendingActivityData.value.lubeSupervisor,
+ lubeLevel: pendingActivityData.value.lubeLevel,
+ processHandleResolution: pendingActivityData.value.processHandleResolution,
+ processStepOrder: pendingActivityData.value.processStepOrder
+ }
+ };
- } catch (error) {
- console.error('提交失败', error);
- proxy?.$modal.msgError("提交失败,请检查数据或联系管理员");
+ if (isCreatingWorkflow.value && dmsBillsLubeInstanceActivityList.value.length === 0) {
+ // 步骤一: 创建工单,启动工作流
+ submitFormData.value.businessId = lubeInstanceId;
+ submitFormData.value.variables = taskVariables.value;
+
+ console.log("[submitForm] 开始启动工作流, businessId:", lubeInstanceId);
+ const workflowRes = await startWorkFlow(submitFormData.value);
+
+ if (!workflowRes || !workflowRes.data || !workflowRes.data.taskId) {
+ buttonLoading.value = false;
+ throw new Error("工作流启动失败,未能获取有效的任务ID");
+ }
+
+ console.log("[submitForm] 工作流启动成功, taskId:", workflowRes.data.taskId);
+
+ if (submitVerifyRef.value) {
+ buttonLoading.value = false; // openDialog 前重置loading
+ submitVerifyRef.value.openDialog(String(workflowRes.data.taskId));
+ } else {
+ buttonLoading.value = false;
+ throw new Error("提交流程组件不可用");
+ }
+ } else if (currentTaskId.value && !isCreatingWorkflow.value) {
+ // 第二步或第三步:处理工作流节点
+ console.log("[submitForm] 处理工作流节点, taskId:", currentTaskId.value);
+
+ if (submitVerifyRef.value) {
+ buttonLoading.value = false;
+ submitVerifyRef.value.openDialog(String(currentTaskId.value));
+ } else {
+ buttonLoading.value = false;
+ throw new Error("提交流程组件不可用");
+ }
+ } else {
+ buttonLoading.value = false;
+ throw new Error("未知的提交流程状态或没有待办任务ID");
+ }
+ } catch (error: any) {
buttonLoading.value = false;
+ pendingActivityData.value = null; // 出错时清空待处理数据
+ console.error('[submitForm] 提交失败:', error);
+ proxy?.$modal.msgError(error.message || "提交失败,请检查数据或联系管理员");
}
} else {
+ buttonLoading.value = false;
proxy?.$modal.msgError("表单校验失败,请检查输入项");
}
- });
-};
-
-// 启动工作流
-const handleStartWorkFlow = async (data: any) => {
- try {
- submitFormData.value.businessId = lubeInstanceId;
- //流程变量
- taskVariables.value = {
- entity: data
- };
- submitFormData.value.variables = taskVariables.value;
- const resp = await startWorkFlow(submitFormData.value);
- if (submitVerifyRef.value) {
- buttonLoading.value = false;
- submitVerifyRef.value.openDialog(resp.data.taskId);
- }
- } finally {
+ } catch (error) {
buttonLoading.value = false;
+ console.error('[submitForm] 意外错误:', error);
+ proxy?.$modal.msgError("表单提交过程中发生错误");
}
};
@@ -455,9 +715,73 @@ const handleApprovalRecord = () => {
};
// 提交回调
-const submitCallback = async () => {
- await getList(); // 刷新列表获取最新节点
- proxy?.$modal.msgSuccess("操作成功");
+const submitCallback = async (/* success?: boolean, nextTaskId?: string | number | null */) => {
+ // success 和 nextTaskId 参数在此被注释掉或忽略,
+ // 因为 submitVerify.vue 组件的 submitCallback 事件没有传递这些参数,
+ // 导致它们在父组件中始终是 undefined。
+ console.log('[submitCallback] Invoked.');
+
+ try {
+ if (pendingActivityData.value) {
+ // 当 submitCallback 被调用,我们假定 submitVerify.vue 中的工作流步骤已被尝试。
+ // 现在,我们尝试保存业务数据。
+ const activityRes = await addDmsBillsLubeInstanceActivity(pendingActivityData.value);
+ console.log("[submitCallback] Business data saved successfully:", activityRes.data);
+
+ // 根据已暂存的待处理活动数据的步骤顺序来判断当前完成的是哪个步骤
+ const stepOrderOfSavedData = pendingActivityData.value.processStepOrder;
+
+ if (stepOrderOfSavedData === 1) {
+ proxy?.$modal.msgSuccess("工单创建数据已保存,流程已流转。");
+ } else if (stepOrderOfSavedData === 2) {
+ proxy?.$modal.msgSuccess("工单处理数据已保存,流程已流转。");
+ } else if (stepOrderOfSavedData === 3) {
+ proxy?.$modal.msgSuccess("工单完成数据已保存,工作流已结束。");
+ // 流程结束后,currentTaskId 应该在 loadData 后变为 null
+ } else {
+ // 这是一个通用回退,理论上不应发生,因为步骤是明确的1, 2, 或 3
+ proxy?.$modal.msgSuccess("业务数据已保存,操作已继续。");
+ }
+ // 注意:实际的下一个任务ID (currentTaskId) 将由后续的 loadData() 调用来确定和更新。
+ } else {
+ // 如果 pendingActivityData.value 为 null,
+ // 这可能意味着 submitForm 未能正确设置它,或者是一个取消操作。
+ // submitVerify.vue 的内部 "操作成功" 消息可能已经显示。
+ // 此处我们不应再显示一个全局的错误,除非我们能确定这是一个未预期的状态。
+ console.warn("[submitCallback] pendingActivityData was null upon callback. This might be normal if a cancel operation occurred or submitForm failed before calling workflow.");
+ }
+ } catch (error) {
+ console.error('[submitCallback] Error saving business data:', error);
+ // 这是一个严重问题:工作流可能已推进,但业务数据未能保存。
+ proxy?.$modal.msgError("关键错误:业务数据保存失败!工作流可能已推进,请紧急核查数据一致性。");
+ } finally {
+ // 重置加载和工作流创建状态
+ buttonLoading.value = false;
+ // 一旦提交尝试发生(无论成功与否),就不再是"正在创建工作流"的初始状态了。
+ // isCreatingWorkflow 的状态将在 loadData 完成后,根据实际的活动列表长度被重新评估。
+ // isCreatingWorkflow.value = false; // 暂时注释掉,让loadData来决定
+
+ pendingActivityData.value = null; // 清空暂存的业务数据
+
+ // 重新加载数据以反映工作流的最新状态和更新UI
+ if (isUpdate.value) {
+ try {
+ console.log("[submitCallback] Reloading data to reflect current workflow state...");
+ await loadData(); // loadData 会更新 currentTaskId, dmsBillsLubeInstanceActivityList, 和按钮状态等。
+ console.log("[submitCallback] Data reloaded. Current Task ID is now:", currentTaskId.value);
+ } catch (loadError) {
+ console.error('[submitCallback] Failed to reload data post-submission attempt:', loadError);
+ proxy?.$modal.msgError("数据刷新失败,请手动刷新页面以查看最新状态。");
+ }
+ }
+ }
+};
+
+// 取消回调
+const cancelCallback = () => {
+ console.log('[cancelCallback] 用户取消了操作');
+ pendingActivityData.value = null; // 清空待保存数据
+ buttonLoading.value = false;
};
diff --git a/src/views/dms/dmsBillsLubeInstanceActivity/trae.vue b/src/views/dms/dmsBillsLubeInstanceActivity/trae.vue
deleted file mode 100644
index 96eb7a6..0000000
--- a/src/views/dms/dmsBillsLubeInstanceActivity/trae.vue
+++ /dev/null
@@ -1,563 +0,0 @@
-
-
-
-
-
-
- 暂存
-
- 提交
-
-
- 审批
-
-
- 流程进度
-
-
-
- 返回
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 提 交
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file