From 5333bf8537dca5f9105258862b98bf31e3c9d121 Mon Sep 17 00:00:00 2001 From: chenxt <10125295+chen-xintao97@user.noreply.gitee.com> Date: Wed, 24 Dec 2025 15:37:23 +0800 Subject: [PATCH] 保存后刷新数据 --- src/components/Common/CommonHooks/useCommonBase.js | 2 +- src/components/Common/CommonInstructSet.js | 5 +++-- src/components/Common/commonBusiness.js | 1 - src/mes/common/commonModelComponent/index.js | 7 +++++-- src/mes/common/commonOperationBarComponent/MesToolbar.js | 2 +- src/mes/common/commonOperationBarComponent/index.js | 15 +++++++++++++-- src/utils/config.js | 2 +- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/components/Common/CommonHooks/useCommonBase.js b/src/components/Common/CommonHooks/useCommonBase.js index a1bf31a..044807e 100644 --- a/src/components/Common/CommonHooks/useCommonBase.js +++ b/src/components/Common/CommonHooks/useCommonBase.js @@ -245,7 +245,7 @@ const useCommonBase = props => { } else { getServiceError(configReturn); } - const configReturnModelData = configReturnModel.dataset.rows[0] + const configReturnModelData = configReturnModel?.dataset?.rows?.[0] if (configReturnModelData) { formData.forEach(item => { item.sModelType = configReturnModelData?.sModelType diff --git a/src/components/Common/CommonInstructSet.js b/src/components/Common/CommonInstructSet.js index 48d2a8f..fe32045 100644 --- a/src/components/Common/CommonInstructSet.js +++ b/src/components/Common/CommonInstructSet.js @@ -2395,9 +2395,10 @@ const utils = { } if (returnData.code === 1) { props.onSaveState({ - enabled: false, + enabled: true, currentId: masterData.sId, - loading: false + loading: false, + isRefresh: true }); } props.onSendSocketMessage( diff --git a/src/components/Common/commonBusiness.js b/src/components/Common/commonBusiness.js index d0e4a24..39fdbf9 100644 --- a/src/components/Common/commonBusiness.js +++ b/src/components/Common/commonBusiness.js @@ -906,7 +906,6 @@ export function getKeyUpEvent(name, sFieldName, tableConfig, masterData, tableDa newCopyTo.master = masterData; // eslint-disable-next-line prefer-destructuring const sAssignField = tableConfig.gdsconfigformslave[iConfigIndex].sOnChangeAssignField; - console.log('sAssignField:', sAssignField); /* keyUp联动其他表 */ if (commonUtils.isNotEmptyObject(sAssignField) && sAssignField.includes('_')) { const addState = {}; diff --git a/src/mes/common/commonModelComponent/index.js b/src/mes/common/commonModelComponent/index.js index 6cd6b5f..02f6c66 100644 --- a/src/mes/common/commonModelComponent/index.js +++ b/src/mes/common/commonModelComponent/index.js @@ -32,6 +32,7 @@ const useCommonModelEvent = props => { sFilterConditions, // 父页面过滤条件 noGetData, // 不要加载数据,根据另一张表选中行加载时用 currentId, + isRefresh } = props; let formData = props.parentProps?.btnConfig?.sActiveId === "12710101117087374661080" @@ -327,7 +328,8 @@ const useCommonModelEvent = props => { // 如果有自定义列,合并自定义列 addState = { ...addState, - ...handleMergeCustomColumn(addState, tableList) + ...handleMergeCustomColumn(addState, tableList), + isRefresh: false }; props.onSaveState(addState); @@ -336,7 +338,7 @@ const useCommonModelEvent = props => { }, [ formData.length, - ['production/productionReport', 'commonBill'].includes(sModelType) ? enabled : refreshCount, + ['production/productionReport', 'commonBill'].includes(sModelType) ? isRefresh : refreshCount, noGetData, JSON.stringify(sFilterConditions) ] @@ -1160,6 +1162,7 @@ const useCommonModelEvent = props => { props.onSaveState({ loading: false, }); + handleRefresh() if (flag === 1) { /* 审核 */ if (clearFlag && (sModelsType.includes('sales/salesOrder') || sModelsType.includes('manufacture/workOrder'))) { diff --git a/src/mes/common/commonOperationBarComponent/MesToolbar.js b/src/mes/common/commonOperationBarComponent/MesToolbar.js index efd2bc6..3beaaed 100644 --- a/src/mes/common/commonOperationBarComponent/MesToolbar.js +++ b/src/mes/common/commonOperationBarComponent/MesToolbar.js @@ -1019,7 +1019,7 @@ const handleSave = (props) => { }, inscallback: () => { props.onSaveState({ - currentId: props.masterData.sId, + currentId: props.masterData.sId,enabled:true }); } }); diff --git a/src/mes/common/commonOperationBarComponent/index.js b/src/mes/common/commonOperationBarComponent/index.js index 9317f87..e3a46bd 100644 --- a/src/mes/common/commonOperationBarComponent/index.js +++ b/src/mes/common/commonOperationBarComponent/index.js @@ -624,7 +624,7 @@ const useCommonOperationBarComponentEvent = props => { const delayedOvertime = commonFunc.showLocalMessage(props, 'delayedOvertime', '延迟加班'); const cancelDelayedOvertime = commonFunc.showLocalMessage(props, 'cancelDelayedOvertime', '取消延迟加班'); const { masterData = {} } = props - let { bCheck , bSubmit} = masterData + let { bCheck, bSubmit } = masterData // 根据sDefault配置控制按钮是否可以操作 if (sDefault && sDefault.includes("${")) { // 当前页面全部数据 @@ -739,9 +739,11 @@ const useCommonOperationBarComponentEvent = props => { } else if (props.bMesBill) { const btnName = sControlName.replace('BtnLeft.', '').replace('BtnRight.', '').toLowerCase(); if (props.enabled) { - if (["btnupd", 'btnevent', 'btnsubmit', 'btnsubmitcancel'].includes(btnName)) { + if (["btnupd", 'btnevent', 'btnsubmit', 'btnsubmitcancel', 'btnexamine', 'btncancelexamine'].includes(btnName)) { defaultProps.disabled = true; } + console.log(btnName, 'btnName'); + } else { if (["btnsave", "btnscanface"].includes(btnName)) { defaultProps.disabled = true; @@ -755,6 +757,15 @@ const useCommonOperationBarComponentEvent = props => { defaultProps.disabled = true; } } + if (!bCheck) { + if (["btncancelexamine"].includes(btnName)) { + defaultProps.disabled = true; + } + } else { + if (["btnexamine"].includes(btnName)) { + defaultProps.disabled = true; + } + } } } diff --git a/src/utils/config.js b/src/utils/config.js index d0dfeb8..72efcee 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -6,7 +6,7 @@ export const webSite = { // faceAddress: isDev ? '//192.168.11.22:8080/xlyFace' : '//' + location.host + '/xlyFace', fileAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyReport/' : '//' + location.host + '/xlyReport/', // 接口地址 faceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyFace' : '//' + location.host + '/xlyFace', - ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:43920/xlyEntry/' : '//' + location.host + '/xlyEntry/', + ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:47400/xlyEntry/' : '//' + location.host + '/xlyEntry/', interfaceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 // ipAddress: isDev ? '//ebc.jinjia.com:8091/xlyEntry/' : '//' + location.host + '/xlyEntry/', // interfaceAddress: isDev ? '//ebc.jinjia.com:8091/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 -- libgit2 0.22.2