Commit 3bcb559a51f11fd8ada92f4314933d58edc4e5a6

Authored by chenxt
1 parent 279956f8

commonSubBill弹窗保存如果接口返回2需要单独刷新

src/components/Common/CommonInstructSet.js
@@ -865,7 +865,7 @@ const handleSave = (props, instruct) => { @@ -865,7 +865,7 @@ const handleSave = (props, instruct) => {
865 const data = []; 865 const data = [];
866 Object.keys(allSlaveData).forEach(key => { 866 Object.keys(allSlaveData).forEach(key => {
867 const config = props[`${key}Config`]; 867 const config = props[`${key}Config`];
868 - const saveTmpData = key === "master" ? (Array.isArray(masterData) ? masterData: [masterData]) : props[`${key}Data`]; 868 + const saveTmpData = key === "master" ? (Array.isArray(masterData) ? masterData : [masterData]) : props[`${key}Data`];
869 const delTmpData = key === "master" ? null : props[`${key}DelData`] || null; 869 const delTmpData = key === "master" ? null : props[`${key}DelData`] || null;
870 data.push( 870 data.push(
871 commonBusiness.mergeData(key, config.sTbName, saveTmpData, delTmpData) 871 commonBusiness.mergeData(key, config.sTbName, saveTmpData, delTmpData)
@@ -2364,8 +2364,15 @@ const utils = { @@ -2364,8 +2364,15 @@ const utils = {
2364 token, 2364 token,
2365 value: params, 2365 value: params,
2366 sModelsId 2366 sModelsId
2367 - });  
2368 - 2367 + }, props);
  2368 + if (returnData.code === 2) {
  2369 + props.onSaveState({
  2370 + enabled: false,
  2371 + currentId: masterData.sId,
  2372 + loading: false,
  2373 + isRefresh: true,
  2374 + });
  2375 + }
2369 if (commonUtils.isEmptyObject(returnData)) { 2376 if (commonUtils.isEmptyObject(returnData)) {
2370 props.onSaveState({ 2377 props.onSaveState({
2371 loading: false 2378 loading: false
@@ -2400,6 +2407,7 @@ const utils = { @@ -2400,6 +2407,7 @@ const utils = {
2400 isRefresh: true 2407 isRefresh: true
2401 }); 2408 });
2402 } 2409 }
  2410 +
2403 props.onSendSocketMessage( 2411 props.onSendSocketMessage(
2404 "release", 2412 "release",
2405 "noAction", 2413 "noAction",
src/components/Common/commonBusiness.js
@@ -197,6 +197,7 @@ export async function saveData(param) { @@ -197,6 +197,7 @@ export async function saveData(param) {
197 ), 197 ),
198 onOk() {}, 198 onOk() {},
199 }); 199 });
  200 + return dataReturn;
200 } else if (dataReturn.code === -7) { /* 防呆校验 返回是-7 */ 201 } else if (dataReturn.code === -7) { /* 防呆校验 返回是-7 */
201 return dataReturn; 202 return dataReturn;
202 } else { /* 失败 */ 203 } else { /* 失败 */
src/mes/common/commonModelComponent/index.js
@@ -336,10 +336,10 @@ const useCommonModelEvent = props => { @@ -336,10 +336,10 @@ const useCommonModelEvent = props => {
336 ...handleMergeCustomColumn(addState, tableList), 336 ...handleMergeCustomColumn(addState, tableList),
337 isRefresh: false 337 isRefresh: false
338 }; 338 };
339 -  
340 props.onSaveState(addState); 339 props.onSaveState(addState);
341 } 340 }
342 } 341 }
  342 +
343 }, 343 },
344 [ 344 [
345 formData.length, 345 formData.length,
@@ -985,7 +985,7 @@ const useCommonModelEvent = props => { @@ -985,7 +985,7 @@ const useCommonModelEvent = props => {
985 } 985 }
986 986
987 } 987 }
988 - 988 + console.log('handleGetData addState', addState, copyToInitialized, props)
989 // 只有弹窗首次打开时才执行 copyTo 数据回填,防止后续刷新覆盖当前数据 989 // 只有弹窗首次打开时才执行 copyTo 数据回填,防止后续刷新覆盖当前数据
990 if (!copyToInitialized && !commonUtils.isEmptyObject(copyTo) && copyTo?.isTmpinfobysql) { 990 if (!copyToInitialized && !commonUtils.isEmptyObject(copyTo) && copyTo?.isTmpinfobysql) {
991 tableList.forEach((item, index) => { 991 tableList.forEach((item, index) => {
@@ -1018,7 +1018,7 @@ const useCommonModelEvent = props => { @@ -1018,7 +1018,7 @@ const useCommonModelEvent = props => {
1018 async () => { 1018 async () => {
1019 if (!refreshTableList.length) return; 1019 if (!refreshTableList.length) return;
1020 1020
1021 - if (refreshTableList.includes("*")) { 1021 + if (refreshTableList.includes("*") && !sModelType.includes('commonSubBill')) {
1022 props.onSaveState({ refreshTableList: [] }, () => { 1022 props.onSaveState({ refreshTableList: [] }, () => {
1023 handleRefresh(); 1023 handleRefresh();
1024 }); 1024 });