diff --git a/src/Add-on/Erp/ErpCommands.ts b/src/Add-on/Erp/ErpCommands.ts index fbe25a7f7..d6ef2ba06 100644 --- a/src/Add-on/Erp/ErpCommands.ts +++ b/src/Add-on/Erp/ErpCommands.ts @@ -141,6 +141,16 @@ async function ExecChaiDan(chaiDanRoute: ErpRoutes) }); return; } + let checkBox = checkBoxSize(parseData.blockList); + if (checkBox.result == false) + { + AppToaster.show({ + message: checkBox.warnMsg, + intent: Intent.DANGER, + timeout: 3000, + }); + return; + } if (isNewErp === false) { let check = checkBlock(parseData.blockList); @@ -234,3 +244,30 @@ function checkBlock(blockList: OrderDataBlock[]): { result: boolean, warnBlocks: } return { result: true, warnBlocks: resultBlocks, warnMsg: msg }; } +function checkBoxSize(blockList: OrderDataBlock[]): { result: boolean, warnMsg: string; } +{ + let boxMax = 1E5 - 1; + let msg = ''; + for (const block of blockList) + { + //判断柜体宽,高,深 + let boxName = block.BoxName; + if (block.BoxWidth > boxMax) + { + msg = `柜体:[${boxName}] 柜体宽度:${block.BoxWidth} 超过限定长度:${boxMax}`; + return { result: false, warnMsg: msg }; + } + if (block.BoxHeight > boxMax) + { + msg = `柜体:[${boxName}] 柜体高度:${block.BoxHeight} 超过限定长度:${boxMax}`; + return { result: false, warnMsg: msg }; + } + if (block.BoxDepth > boxMax) + { + msg = `柜体:[${boxName}] 柜体深度:${block.BoxDepth} 超过限定长度:${boxMax}`; + return { result: false, warnMsg: msg }; + } + + }; + return { result: true, warnMsg: msg }; +} diff --git a/src/Add-on/Erp/ExceedBlocksMind.tsx b/src/Add-on/Erp/ExceedBlocksMind.tsx index 989dc5990..554744270 100644 --- a/src/Add-on/Erp/ExceedBlocksMind.tsx +++ b/src/Add-on/Erp/ExceedBlocksMind.tsx @@ -38,22 +38,27 @@ export class ExceedMind extends React.Component { onClick={() => this.props.store.OnOk(ModalState.Cancel)} /> -
+
{this.props.mindInfo}
{blocksDiv}
-
-
-
-