Commit edd37f0b261c27c5c1fe752d891bab63957a9c34
1 parent
cf48ba43
放大镜弹窗选择后强制赋值sParentId
Showing
4 changed files
with
301 additions
and
9 deletions
src/components/Common/CommonHooks/useCommonBase.js
| ... | ... | @@ -116,6 +116,7 @@ const useCommonBase = props => { |
| 116 | 116 | * @param {Function} callback - 回调函数 |
| 117 | 117 | */ |
| 118 | 118 | const handleSaveState = (values, callback) => { |
| 119 | + console.log("🚀 ~ handleSaveState ~ values:", values) | |
| 119 | 120 | if (commonUtils.isNotEmptyObject(values.masterConfig) && values.masterConfig.bMerged) { |
| 120 | 121 | delete values.masterConfig; |
| 121 | 122 | } |
| ... | ... | @@ -1950,8 +1951,115 @@ const useCommonBase = props => { |
| 1950 | 1951 | ); |
| 1951 | 1952 | } |
| 1952 | 1953 | }; |
| 1954 | + // const handleMaterialsChange = async (tableDataRow, sModelsId, masterData, changeValue, sFieldName, app, token, models) => { | |
| 1955 | + // const { sComputeId, sConversionComputeId, sReConversionComputeId } = tableDataRow; | |
| 1956 | + // const sFormulaIdType = tableDataRow.bInverse ? 'sReComputeId' : 'sComputeId'; /* 正算、反算类型 */ | |
| 1957 | + // if (sFieldName === 'sMaterialsNo' || sFieldName === 'sMaterialsName' || sFieldName === 'dAuxiliaryQty' || sFieldName === 'dReelAuxiliaryQty' || sFieldName === 'dConversionQty' || sFieldName === 'sMaterialsStyle' || sFieldName === 'dProductQty') { | |
| 1958 | + // if (sFieldName === 'dReelAuxiliaryQty') { | |
| 1959 | + // if (tableDataRow.sMaterialsUnit === '吨' && tableDataRow.bReel && tableDataRow.dGramWeight > 0) { | |
| 1960 | + // tableDataRow = commonBusiness.getMaterialsQty(app, { ...tableDataRow, sMaterialsStyle: tableDataRow.sReelMaterialsStyle }, 'dReelAuxiliaryQty', 'dMaterialsQty'); | |
| 1961 | + // tableDataRow.dAuxiliaryQty = tableDataRow.dMaterialsQty; | |
| 1962 | + // tableDataRow.sMaterialsStyle = tableDataRow.sMaterialsStyle !== undefined && tableDataRow.sMaterialsStyle.split('*').length > 1 ? tableDataRow.sMaterialsStyle.split('*')[0] : tableDataRow.sMaterialsStyle; | |
| 1963 | + // tableDataRow.sAuxiliaryUnit = tableDataRow.sMaterialsUnit; | |
| 1964 | + // } else if (tableDataRow.sMaterialsUnit.toUpper() === 'M2' && tableDataRow.bReel) { | |
| 1965 | + // tableDataRow = commonBusiness.getMaterialsQty(app, tableDataRow, 'dReelAuxiliaryQty', 'dMaterialsQty'); | |
| 1966 | + // tableDataRow.dAuxiliaryQty = tableDataRow.dReelAuxiliaryQty; | |
| 1967 | + // } else { | |
| 1968 | + // tableDataRow.dAuxiliaryQty = tableDataRow.dReelAuxiliaryQty; | |
| 1969 | + // } | |
| 1970 | + // } | |
| 1971 | + // if (commonUtils.isEmpty(sComputeId) && sFieldName !== 'dConversionQty') { | |
| 1972 | + // if (sFieldName === 'dProductQty') { | |
| 1973 | + // tableDataRow = commonBusiness.getMaterialsQty(app, tableDataRow, 'dProductQty', 'dMaterialsQty'); | |
| 1974 | + // } else if (app.currentPane.sModelsType && app.currentPane.sModelsType.includes('outside/')) { | |
| 1975 | + // tableDataRow = commonBusiness.getMaterialsQty(app, tableDataRow, 'dAuxiliaryQty', 'dMaterialsQty'); | |
| 1976 | + // } else { | |
| 1977 | + // tableDataRow.dMaterialsQty = await commonBusiness.getFormulaValue({ | |
| 1978 | + // token, sModelsId, masterData, tableDataRow, sComputeId, sFormulaIdType, | |
| 1979 | + // }); | |
| 1980 | + // } | |
| 1981 | + // } else if (!commonUtils.isEmpty(sComputeId)) { | |
| 1982 | + // tableDataRow.dMaterialsQty = await commonBusiness.getFormulaValue({ | |
| 1983 | + // token, sModelsId, masterData, tableDataRow, sComputeId, | |
| 1984 | + // }); | |
| 1985 | + // } | |
| 1986 | + // if (sFieldName !== 'dConversionQty' && !commonUtils.isEmpty(sConversionComputeId)) { | |
| 1987 | + // tableDataRow.dConversionQty = await commonBusiness.getFormulaValue({ | |
| 1988 | + // token, sModelsId, masterData, tableDataRow, sComputeId: sConversionComputeId, | |
| 1989 | + // }); | |
| 1990 | + // } | |
| 1991 | + // } else if (sFieldName === 'dMaterialsQty') { | |
| 1992 | + // const { sReComputeId } = tableDataRow; | |
| 1993 | + // if (commonUtils.isEmpty(sReComputeId) && tableDataRow.bInverse) { | |
| 1994 | + // if (app.currentPane.sModelsType && app.currentPane.sModelsType.includes('outside/')) { | |
| 1995 | + // tableDataRow = commonBusiness.getAuxiliaryQty(app, tableDataRow, sFieldName, 'dAuxiliaryQty'); | |
| 1996 | + // } else { | |
| 1997 | + // tableDataRow.dAuxiliaryQty = await commonBusiness.getFormulaValue({ | |
| 1998 | + // token, sModelsId, masterData, tableDataRow, sReComputeId, sFormulaIdType, | |
| 1999 | + // }); | |
| 2000 | + // } | |
| 2001 | + // } else if (tableDataRow.bInverse) { | |
| 2002 | + // tableDataRow.dAuxiliaryQty = await commonBusiness.getFormulaValue({ | |
| 2003 | + // token, sModelsId, masterData, tableDataRow, sComputeId: sReComputeId, | |
| 2004 | + // }); | |
| 2005 | + // if (commonUtils.isNotEmptyArr(tableDataRow.dAuxiliaryQty) && tableDataRow.dAuxiliaryQty !== 0) { | |
| 2006 | + // tableDataRow.dProductQty = tableDataRow.dAuxiliaryQty; | |
| 2007 | + // } | |
| 2008 | + // } | |
| 2009 | + // if (!commonUtils.isEmpty(sReConversionComputeId)) { | |
| 2010 | + // tableDataRow.dConversionQty = await commonBusiness.getFormulaValue({ | |
| 2011 | + // token, sModelsId, masterData, tableDataRow, sComputeId: sReConversionComputeId, | |
| 2012 | + // }); | |
| 2013 | + // } | |
| 2014 | + // } else if (sFieldName === 'dAuxiliaryLossQty') { | |
| 2015 | + // const tableDataRowNew = { ...tableDataRow, dAuxiliaryQty: tableDataRow.dAuxiliaryLossQty }; | |
| 2016 | + // if (commonUtils.isEmpty(sComputeId)) { | |
| 2017 | + // // tableDataRow = commonBusiness.getMaterialsQty(app, tableDataRow, sFieldName, 'dLossQty'); | |
| 2018 | + // tableDataRow.dLossQty = await commonBusiness.getFormulaValue({ | |
| 2019 | + // token, sModelsId, masterData, tableDataRow: tableDataRowNew, sComputeId, sFormulaIdType, | |
| 2020 | + // }); | |
| 2021 | + // } else { | |
| 2022 | + // tableDataRow.dLossQty = await commonBusiness.getFormulaValue({ | |
| 2023 | + // token, sModelsId, masterData, tableDataRow: tableDataRowNew, sComputeId, | |
| 2024 | + // }); | |
| 2025 | + // } | |
| 2026 | + // if (!commonUtils.isEmpty(tableDataRow.dSrcSurplusAuxiliaryQty)) { | |
| 2027 | + // tableDataRow.dAuxiliaryQty = tableDataRow.dSrcSurplusAuxiliaryQty - tableDataRow.dAuxiliaryLossQty; | |
| 2028 | + // tableDataRow.dMaterialsQty = commonUtils.convertFixNum(tableDataRow.dSrcSurplusQty - tableDataRow.dLossQty, 6); | |
| 2029 | + // } | |
| 2030 | + // } else if (sFieldName === 'dLossQty') { | |
| 2031 | + // const { sReComputeId } = tableDataRow; | |
| 2032 | + // const tableDataRowNew = { ...tableDataRow, dMaterialsQty: tableDataRow.dLossQty }; | |
| 2033 | + // if (commonUtils.isEmpty(sReComputeId) && tableDataRow.bInverse) { | |
| 2034 | + // // tableDataRow = commonBusiness.getAuxiliaryQty(app, tableDataRow, sFieldName, 'dAuxiliaryLossQty'); | |
| 2035 | + // tableDataRow.dAuxiliaryLossQty = await commonBusiness.getFormulaValue({ | |
| 2036 | + // token, sModelsId, masterData, tableDataRow: tableDataRowNew, sReComputeId, sFormulaIdType, | |
| 2037 | + // }); | |
| 2038 | + // } else { | |
| 2039 | + // tableDataRow.dAuxiliaryLossQty = await commonBusiness.getFormulaValue({ | |
| 2040 | + // token, sModelsId, masterData, tableDataRow: tableDataRowNew, sComputeId: sReComputeId, | |
| 2041 | + // }); | |
| 2042 | + // } | |
| 2043 | + // if (!commonUtils.isEmpty(tableDataRow.dSrcSurplusAuxiliaryQty)) { | |
| 2044 | + // tableDataRow.dAuxiliaryQty = tableDataRow.dSrcSurplusAuxiliaryQty - tableDataRow.dAuxiliaryLossQty; | |
| 2045 | + // tableDataRow.dMaterialsQty = tableDataRow.dSrcSurplusQty - tableDataRow.dLossQty; | |
| 2046 | + // } | |
| 2047 | + // } else if (sFieldName === 'sProcessId' || sFieldName === 'sProcessNo' || sFieldName === 'sProcessName') { | |
| 2048 | + // const sProcessId = changeValue.sProcessId; | |
| 2049 | + // const url = `${commonConfig.server_host}process/outsideprocess?sModelsId=${sModelsId}&sProcessId=${sProcessId}`; | |
| 2050 | + // const dataReturn = (await commonServices.getService(token, url)).data; | |
| 2051 | + // if (dataReturn.code === 1) { | |
| 2052 | + // if (commonUtils.isNotEmptyArr(dataReturn.dataset.rows)) { | |
| 2053 | + // tableDataRow.dMaterialsPrice = dataReturn.dataset.rows[0].dMaterialsPrice; | |
| 2054 | + // } | |
| 2055 | + // tableDataRow = commonBusiness.getCalculateAllMoney(app, models, 'dMaterialsPrice', masterData, tableDataRow); | |
| 2056 | + // } | |
| 2057 | + // } | |
| 2058 | + // return tableDataRow; | |
| 2059 | + // } | |
| 1953 | 2060 | const handleMaterialsChange = async (tableDataRow, sModelsId, masterData, changeValue, sFieldName, app, token, models) => { |
| 1954 | 2061 | const { sComputeId, sConversionComputeId, sReConversionComputeId } = tableDataRow; |
| 2062 | + // dAuxiliaryQty | |
| 1955 | 2063 | const sFormulaIdType = tableDataRow.bInverse ? 'sReComputeId' : 'sComputeId'; /* 正算、反算类型 */ |
| 1956 | 2064 | if (sFieldName === 'sMaterialsNo' || sFieldName === 'sMaterialsName' || sFieldName === 'dAuxiliaryQty' || sFieldName === 'dReelAuxiliaryQty' || sFieldName === 'dConversionQty' || sFieldName === 'sMaterialsStyle' || sFieldName === 'dProductQty') { |
| 1957 | 2065 | if (sFieldName === 'dReelAuxiliaryQty') { |
| ... | ... | @@ -3298,6 +3406,7 @@ const useCommonBase = props => { |
| 3298 | 3406 | const newCopyTo = {}; |
| 3299 | 3407 | newCopyTo.master = masterData; |
| 3300 | 3408 | const sName = selectConfig.sKeyUpFilter; /* 将后台配置筛选字段作为 列字段 */ |
| 3409 | + console.log("🚀 ~ handleSelectCommonPopupNew ~ sName:", sName) | |
| 3301 | 3410 | let sValue = ''; |
| 3302 | 3411 | if (iIndex > -1) { |
| 3303 | 3412 | newCopyTo.slave = tableData[iIndex]; |
| ... | ... | @@ -3364,6 +3473,10 @@ const useCommonBase = props => { |
| 3364 | 3473 | if (tbName === 'master') { |
| 3365 | 3474 | const result = handleMasterChange(tbName, selectConfig.sName, {}, null, null, true, tableData); |
| 3366 | 3475 | tableData = result.masterData; |
| 3476 | + } else if (tbName.includes('slave')){ | |
| 3477 | + tableData.forEach(item=>{ | |
| 3478 | + item.sParentId = state?.masterData?.sId | |
| 3479 | + }) | |
| 3367 | 3480 | } |
| 3368 | 3481 | |
| 3369 | 3482 | const addState = { [`${tbName}Data`]: tableData, [`${tbName}Pagination`]: pagination }; |
| ... | ... | @@ -3452,6 +3565,7 @@ const useCommonBase = props => { |
| 3452 | 3565 | }; |
| 3453 | 3566 | /** toolbar审核(消审) */ |
| 3454 | 3567 | const handleAudit = async (flag) => { |
| 3568 | + console.log("🚀 ~ handleAudit ~ flag:", flag) | |
| 3455 | 3569 | /* 待用数据声明 */ |
| 3456 | 3570 | let bResult = true; |
| 3457 | 3571 | const { masterData, gdsformconst } = props; | ... | ... |
src/components/Common/CommonTable/index.js
| ... | ... | @@ -4864,8 +4864,6 @@ class CommonTableRc extends React.Component { |
| 4864 | 4864 | const { selectedRowKeys = [] } = props; |
| 4865 | 4865 | if (sControlName.includes('BtnTableCopyTo.ActProduceReport')) { |
| 4866 | 4866 | const copyToConfig = props?.config?.gdsconfigformslave.filter(x=>x.sControlName.includes('BtnTableCopyTo.ActProduceReport')) |
| 4867 | - console.log(props, 'record'); | |
| 4868 | - | |
| 4869 | 4867 | props.onCopyTo(props.name, config.sActiveId, config, copyToConfig, record) |
| 4870 | 4868 | return |
| 4871 | 4869 | } |
| ... | ... | @@ -6984,7 +6982,7 @@ class CommonTableRc extends React.Component { |
| 6984 | 6982 | this.props.onSelectCommonPopup(name, selectConfig, selectData, tb?.name, tb?.config, { index: this.rowClickRef.current }); |
| 6985 | 6983 | return; |
| 6986 | 6984 | } |
| 6987 | - | |
| 6985 | + | |
| 6988 | 6986 | this.props.onSelectCommonPopup(name, selectConfig, selectData, tb?.name, commonPopupShowConfig); |
| 6989 | 6987 | } |
| 6990 | 6988 | }; |
| ... | ... | @@ -8243,8 +8241,6 @@ class CommonTableRc extends React.Component { |
| 8243 | 8241 | controlConfig[0].sDropDownType === "popup" |
| 8244 | 8242 | ) { |
| 8245 | 8243 | btnPupopConfig = controlConfig[0]; |
| 8246 | - console.log(btnPupopConfig, 'btnPupopConfig'); | |
| 8247 | - | |
| 8248 | 8244 | this.setState({ |
| 8249 | 8245 | commonPopupVisible: true, |
| 8250 | 8246 | commonPopupTbName: name, | ... | ... |
src/mes/common/commonModelComponent/index.js
| ... | ... | @@ -1079,7 +1079,186 @@ const useCommonModelEvent = props => { |
| 1079 | 1079 | |
| 1080 | 1080 | [props[`${name}Data`], props[`${name}SelectedRowKeys`]] |
| 1081 | 1081 | ); |
| 1082 | - | |
| 1082 | + // 审核 | |
| 1083 | + /** toolbar审核(消审) */ | |
| 1084 | + const handleAudit = async (flag) => { | |
| 1085 | + console.log("🚀 ~ handleAudit ~ flag:", flag) | |
| 1086 | + /* 待用数据声明 */ | |
| 1087 | + let bResult = true; | |
| 1088 | + const { masterData, gdsformconst } = props; | |
| 1089 | + if (!commonUtils.isEmpty(masterData)) { | |
| 1090 | + /* 作废订单不能审核 */ | |
| 1091 | + if (masterData.bInvalid) { | |
| 1092 | + message.warning(commonFunc.showMessage(app.commonConst, 'sToVoid')); | |
| 1093 | + handleSaveState({ | |
| 1094 | + loading: false, | |
| 1095 | + }); | |
| 1096 | + return ''; | |
| 1097 | + } | |
| 1098 | + /** 数据审核 */ | |
| 1099 | + bResult = await dataAudit(flag); | |
| 1100 | + } else { | |
| 1101 | + handleSaveState({ | |
| 1102 | + loading: false, | |
| 1103 | + }); | |
| 1104 | + } | |
| 1105 | + return bResult; | |
| 1106 | + }; | |
| 1107 | + /** 数据审核 */ | |
| 1108 | + const dataAudit = async (flag, tmpCheck, isWait) => { | |
| 1109 | + message.destroy(); | |
| 1110 | + /* 待用数据声明 */ | |
| 1111 | + const { | |
| 1112 | + sModelsId, masterData, app, masterConfig, slaveConfig, checkConfig, token, sModelsType = '', controlConfig, materialsConfig, processConfig, colorConfig, packConfig, slaveData, orderDetailConfig, | |
| 1113 | + } = props; | |
| 1114 | + | |
| 1115 | + const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); | |
| 1116 | + const sSlaveIdArray = []; | |
| 1117 | + if (commonUtils.isNotEmptyArr(slaveData)) { | |
| 1118 | + slaveData.forEach((item) => { | |
| 1119 | + sSlaveIdArray.push(commonUtils.isNotEmptyObject(item.sId) ? item.sId : item.sSlaveId); | |
| 1120 | + }); | |
| 1121 | + } | |
| 1122 | + const slaveId = sSlaveIdArray.toString(); | |
| 1123 | + /* 数据参数 */ | |
| 1124 | + const value = { | |
| 1125 | + sClientType: '1', | |
| 1126 | + paramsMap: { | |
| 1127 | + iFlag: flag, | |
| 1128 | + iTmpCheck: commonUtils.isEmptyNumber(tmpCheck) ? 0 : tmpCheck, | |
| 1129 | + sFormGuid: sModelsId, | |
| 1130 | + sGuid: masterData.sId, | |
| 1131 | + sSlaveId: slaveId, | |
| 1132 | + sBillNo: commonUtils.isNotEmptyObject(masterData.sBillNo) ? masterData.sBillNo : '', | |
| 1133 | + }, | |
| 1134 | + }; | |
| 1135 | + let clearFlag = false; | |
| 1136 | + if (sModelsType.includes('sales/salesOrder') || sModelsType.includes('manufacture/workOrder')) { | |
| 1137 | + if (commonUtils.isNotEmptyArr(slaveData)) { | |
| 1138 | + for (const item of slaveData) { | |
| 1139 | + if (commonUtils.isNotEmptyStr(item.sProductInfo)) { | |
| 1140 | + clearFlag = true; | |
| 1141 | + break; | |
| 1142 | + } | |
| 1143 | + } | |
| 1144 | + } else { | |
| 1145 | + handleSaveState({ | |
| 1146 | + loading: false, | |
| 1147 | + }); | |
| 1148 | + return; | |
| 1149 | + } | |
| 1150 | + } | |
| 1151 | + /* 数据审核 */ | |
| 1152 | + const url = `${commonConfig.server_host}business/doExamine?sModelsId=${sModelsId}`; | |
| 1153 | + const returnData = (await commonServices.postValueService(app.token, value, url)).data; | |
| 1154 | + if (isWait) { | |
| 1155 | + return returnData; | |
| 1156 | + } else { | |
| 1157 | + /* 接收返回值 */ | |
| 1158 | + const check = commonFunc.showMessage(app.commonConst, 'BtnExamine');/* 审核 */ | |
| 1159 | + const BtnCancelExamine = commonFunc.showMessage(app.commonConst, 'BtnCancelExamine');/* 销审 */ | |
| 1160 | + if (returnData.code === 1) { /* 成功 */ | |
| 1161 | + handleSaveState({ | |
| 1162 | + loading: false, | |
| 1163 | + }); | |
| 1164 | + if (flag === 1) { | |
| 1165 | + /* 审核 */ | |
| 1166 | + if (clearFlag && (sModelsType.includes('sales/salesOrder') || sModelsType.includes('manufacture/workOrder'))) { | |
| 1167 | + commonUtils.setStoreDropDownData(sModelsId, 'master', 'sProductId', []); | |
| 1168 | + commonUtils.setStoreDropDownData(sModelsId, 'master', 'sProductNo', []); | |
| 1169 | + commonUtils.setStoreDropDownData(sModelsId, 'master', 'sProductName', []); | |
| 1170 | + } | |
| 1171 | + let outData; | |
| 1172 | + if (commonUtils.isNotEmptyObject(returnData.dataset)) { | |
| 1173 | + outData = returnData.dataset.rows[0].dataSet.outData; | |
| 1174 | + } | |
| 1175 | + if (false && commonUtils.isNotEmptyStr(outData[0].sReturn)) { | |
| 1176 | + const sReturnArray = outData[0].sReturn.split('|'); | |
| 1177 | + if (outData[0].sReturn.split('-').length < 2) { | |
| 1178 | + // 正常业务提示,非审核模板 | |
| 1179 | + // if (this.props.app.currentPane.refresh !== undefined) { | |
| 1180 | + // this.props.app.currentPane.refresh(); | |
| 1181 | + // } | |
| 1182 | + message.error(check + outData[0].sReturn); | |
| 1183 | + return; | |
| 1184 | + } | |
| 1185 | + const checkConditions = []; | |
| 1186 | + let checkPersonData = {}; | |
| 1187 | + sReturnArray.forEach((item) => { | |
| 1188 | + const checkCondition = item.split('-')[2]; | |
| 1189 | + const iIndex = checkConditions.findIndex(itemCondition => itemCondition.condition === checkCondition); | |
| 1190 | + if (iIndex <= -1) { | |
| 1191 | + checkConditions.push({ | |
| 1192 | + key: commonUtils.createSid(), | |
| 1193 | + condition: checkCondition, | |
| 1194 | + }); | |
| 1195 | + } | |
| 1196 | + }); | |
| 1197 | + const sCheckModelId = sReturnArray[0].split('-')[1]; | |
| 1198 | + if (commonUtils.isNotEmptyStr(sCheckModelId)) { | |
| 1199 | + const urlCheck = `${commonConfig.server_host}checkModel/getUserListByModelId/${sCheckModelId}?sModelsId=${sModelsId}`; | |
| 1200 | + const dataReturn = (await commonServices.getService(token, urlCheck)).data; | |
| 1201 | + if (dataReturn.code === 1) { | |
| 1202 | + checkPersonData = dataReturn.dataset.rows; | |
| 1203 | + checkPersonData.forEach((item) => { | |
| 1204 | + item.key = commonUtils.createSid(); | |
| 1205 | + }); | |
| 1206 | + this.props.onSaveState({ | |
| 1207 | + checkConditions, checkPersonData, sCheckModelId, visible: true, | |
| 1208 | + }); | |
| 1209 | + return true; | |
| 1210 | + } else { /* 失败 */ | |
| 1211 | + this.props.getServiceError({ msg: check + dataReturn }); | |
| 1212 | + } | |
| 1213 | + } | |
| 1214 | + } else { | |
| 1215 | + message.success(check + returnData.msg); | |
| 1216 | + } | |
| 1217 | + } else { | |
| 1218 | + /* 消审 */ | |
| 1219 | + const { outData } = returnData.dataset.rows[0].dataSet; | |
| 1220 | + if (commonUtils.isNotEmptyStr(outData[0].sReturn)) { | |
| 1221 | + message.error(outData[0].sReturn); | |
| 1222 | + } else { | |
| 1223 | + // if (this.props.app.currentPane.refresh !== undefined) { | |
| 1224 | + // this.props.app.currentPane.refresh(); | |
| 1225 | + // } | |
| 1226 | + message.success(BtnCancelExamine + returnData.msg); | |
| 1227 | + } | |
| 1228 | + } | |
| 1229 | + await handleGetData(masterConfig, slaveConfig, checkConfig); | |
| 1230 | + if ((sModelsType.includes('sales/salesOrder') || sModelsType.includes('manufacture/workOrder')) && !commonUtils.isEmpty(controlConfig)) { | |
| 1231 | + await handleGetMemoData(controlConfig, materialsConfig, processConfig, colorConfig, packConfig); | |
| 1232 | + } else if (commonUtils.isNotEmptyObject(orderDetailConfig)) { | |
| 1233 | + await handleGetOneMemoData('orderDetail', orderDetailConfig); | |
| 1234 | + } | |
| 1235 | + // if (props.app.currentPane.refresh !== undefined) { | |
| 1236 | + // this.props.app.currentPane.refresh(); | |
| 1237 | + // } | |
| 1238 | + } else if (returnData.code === -8) { | |
| 1239 | + Modal.info({ | |
| 1240 | + title: FriendlyReminder, | |
| 1241 | + content: ( | |
| 1242 | + <div> | |
| 1243 | + {handleGetMsg(returnData.msg)} | |
| 1244 | + </div> | |
| 1245 | + ), | |
| 1246 | + onOk() { }, | |
| 1247 | + }); | |
| 1248 | + handleSaveState({ | |
| 1249 | + loading: false, | |
| 1250 | + }); | |
| 1251 | + return false; | |
| 1252 | + } else { /* 失败 */ | |
| 1253 | + props.getServiceError(returnData); | |
| 1254 | + handleSaveState({ | |
| 1255 | + loading: false, | |
| 1256 | + }); | |
| 1257 | + return false; | |
| 1258 | + } | |
| 1259 | + return true; | |
| 1260 | + } | |
| 1261 | + }; | |
| 1083 | 1262 | return { |
| 1084 | 1263 | ...props, |
| 1085 | 1264 | onGetColumnData: handleGetColumnData, |
| ... | ... | @@ -1087,7 +1266,8 @@ const useCommonModelEvent = props => { |
| 1087 | 1266 | onTableBtnClick: handleTableBtnClick, // 表格按钮事件 |
| 1088 | 1267 | handleUpdateProductionplan, |
| 1089 | 1268 | handleStartWork, |
| 1090 | - onViewChoose: handleViewChoose | |
| 1269 | + onViewChoose: handleViewChoose, | |
| 1270 | + onBtnExamine: handleAudit, | |
| 1091 | 1271 | }; |
| 1092 | 1272 | }; |
| 1093 | 1273 | ... | ... |
src/mes/common/commonOperationBarComponent/MesToolbar.js
| ... | ... | @@ -17,6 +17,8 @@ const ToolbarFun = async (props) => { |
| 17 | 17 | |
| 18 | 18 | // const { sControlName } = btnConfig; |
| 19 | 19 | // const btnName = sControlName.replace('BtnLeft.', '').replace('BtnRight.', '').toLowerCase(); |
| 20 | + console.log(btnName, 'btnName'); | |
| 21 | + | |
| 20 | 22 | if (btnName === 'btnadd') { |
| 21 | 23 | handleAdd(props); |
| 22 | 24 | } else if (btnName === 'btnsave') { |
| ... | ... | @@ -73,8 +75,8 @@ const ToolbarFun = async (props) => { |
| 73 | 75 | } |
| 74 | 76 | } |
| 75 | 77 | } else { |
| 76 | - console.log(props, 'masterData'); | |
| 77 | - // props.onBtnExamine(); | |
| 78 | + // console.log(props, 'masterData'); | |
| 79 | + props.onBtnExamine(); | |
| 78 | 80 | } |
| 79 | 81 | } |
| 80 | 82 | ... | ... |