From 3bcb559a51f11fd8ada92f4314933d58edc4e5a6 Mon Sep 17 00:00:00 2001 From: chenxt <10125295+chen-xintao97@user.noreply.gitee.com> Date: Mon, 6 Jul 2026 17:16:29 +0800 Subject: [PATCH] commonSubBill弹窗保存如果接口返回2需要单独刷新 --- src/components/Common/CommonInstructSet.js | 14 +++++++++++--- src/components/Common/commonBusiness.js | 1 + src/mes/common/commonModelComponent/index.js | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/Common/CommonInstructSet.js b/src/components/Common/CommonInstructSet.js index dc0643a..2430182 100644 --- a/src/components/Common/CommonInstructSet.js +++ b/src/components/Common/CommonInstructSet.js @@ -865,7 +865,7 @@ const handleSave = (props, instruct) => { const data = []; Object.keys(allSlaveData).forEach(key => { const config = props[`${key}Config`]; - const saveTmpData = key === "master" ? (Array.isArray(masterData) ? masterData: [masterData]) : props[`${key}Data`]; + const saveTmpData = key === "master" ? (Array.isArray(masterData) ? masterData : [masterData]) : props[`${key}Data`]; const delTmpData = key === "master" ? null : props[`${key}DelData`] || null; data.push( commonBusiness.mergeData(key, config.sTbName, saveTmpData, delTmpData) @@ -2364,8 +2364,15 @@ const utils = { token, value: params, sModelsId - }); - + }, props); + if (returnData.code === 2) { + props.onSaveState({ + enabled: false, + currentId: masterData.sId, + loading: false, + isRefresh: true, + }); + } if (commonUtils.isEmptyObject(returnData)) { props.onSaveState({ loading: false @@ -2400,6 +2407,7 @@ const utils = { isRefresh: true }); } + props.onSendSocketMessage( "release", "noAction", diff --git a/src/components/Common/commonBusiness.js b/src/components/Common/commonBusiness.js index 39fdbf9..972fd0d 100644 --- a/src/components/Common/commonBusiness.js +++ b/src/components/Common/commonBusiness.js @@ -197,6 +197,7 @@ export async function saveData(param) { ), onOk() {}, }); + return dataReturn; } else if (dataReturn.code === -7) { /* 防呆校验 返回是-7 */ return dataReturn; } else { /* 失败 */ diff --git a/src/mes/common/commonModelComponent/index.js b/src/mes/common/commonModelComponent/index.js index 5873815..f3fc802 100644 --- a/src/mes/common/commonModelComponent/index.js +++ b/src/mes/common/commonModelComponent/index.js @@ -336,10 +336,10 @@ const useCommonModelEvent = props => { ...handleMergeCustomColumn(addState, tableList), isRefresh: false }; - props.onSaveState(addState); } } + }, [ formData.length, @@ -985,7 +985,7 @@ const useCommonModelEvent = props => { } } - + console.log('handleGetData addState', addState, copyToInitialized, props) // 只有弹窗首次打开时才执行 copyTo 数据回填,防止后续刷新覆盖当前数据 if (!copyToInitialized && !commonUtils.isEmptyObject(copyTo) && copyTo?.isTmpinfobysql) { tableList.forEach((item, index) => { @@ -1018,7 +1018,7 @@ const useCommonModelEvent = props => { async () => { if (!refreshTableList.length) return; - if (refreshTableList.includes("*")) { + if (refreshTableList.includes("*") && !sModelType.includes('commonSubBill')) { props.onSaveState({ refreshTableList: [] }, () => { handleRefresh(); }); -- libgit2 0.22.2