From 5a0349dbf8c67b58f4dd47861ff89dee883d98fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=BA=A2=E5=85=B5?= <374362909@qq.com> Date: Tue, 24 Feb 2026 15:43:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=87=87=E8=B4=AD=E7=94=B3?= =?UTF-8?q?=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchasingrequisition/implement.vue | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/views/finance/purchasingrequisition/implement.vue b/src/views/finance/purchasingrequisition/implement.vue index 8078ca0..5741ffc 100644 --- a/src/views/finance/purchasingrequisition/implement.vue +++ b/src/views/finance/purchasingrequisition/implement.vue @@ -78,6 +78,7 @@ import { useMessage } from '/@/hooks/message' import other from '/@/utils/other' import UploadFile from '/@/components/Upload/index.vue' import { Session } from '/@/utils/storage' +import * as orderVue from '/@/api/order/order-key-vue' /** 部门审核角色编码:仅该角色下显示采购代表相关页面和功能,流转至部门审核时需填写采购代表 */ const PURCHASE_DEPT_AUDIT_ROLE_CODE = 'PURCHASE_DEPT_AUDIT' @@ -95,6 +96,10 @@ const props = defineProps({ currJob: { type: Object, default: null }, currElTab: { type: Object, default: null } }) +const emit = defineEmits(['handleJob']) + +/** 是否被流程 handle 页面通过 dynamic-link 嵌入 */ +const isFlowEmbed = computed(() => !!props.currJob) const route = useRoute() const PURCHASE_FILE_TYPE = '130' @@ -249,6 +254,10 @@ const handleImplementSubmit = async () => { implementFileIds.value = [] await loadData() postMessage('purchasingimplement:saved') + // 流程嵌入场景:通知流程当前 Tab 已保存,避免审批时提示“未保存” + if (isFlowEmbed.value && props.currJob && props.currElTab?.id) { + orderVue.currElTabIsSave(props.currJob, props.currElTab.id, true, emit) + } } catch (err: any) { useMessage().error(err?.msg || '实施采购失败') } finally { @@ -289,6 +298,11 @@ const handleStartFileFlow = async () => { } } +/** 流程嵌入时供 handle.vue 调用的“保存”回调:与页面按钮保存逻辑保持一致 */ +async function flowSubmitForm() { + await handleImplementSubmit() +} + // 流程切换工单时重新加载数据(与 add 编辑页一致) watch( () => props.currJob?.orderId ?? props.currJob?.id, @@ -299,12 +313,17 @@ watch( } ) -onMounted(() => { - loadData() +onMounted(async () => { + await loadData() if (isInIframe()) { document.documentElement.classList.add('iframe-mode') document.body.classList.add('iframe-mode') } + // 流程嵌入:注册 tab 保存回调,供审批页调用(与采购申请编辑页保持一致) + if (isFlowEmbed.value && props.currJob && props.currElTab?.id) { + orderVue.currElTabIsExist(props.currJob, props.currElTab.id) + await orderVue.currElTabIsView({}, props.currJob, props.currElTab.id, flowSubmitForm) + } })