Commit 3bcb559a51f11fd8ada92f4314933d58edc4e5a6

Authored by chenxt
1 parent 279956f8

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

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