!1266 拆单增加校验柜体尺寸是否超过限定值

pull/1266/MERGE
cf-erp 4 years ago committed by ChenX
parent 53caade94a
commit b1e1f399b2

@ -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 };
}

@ -38,18 +38,22 @@ export class ExceedMind extends React.Component<ExceedMindProp, {}> {
onClick={() => this.props.store.OnOk(ModalState.Cancel)}
/>
</div>
<div className={Classes.DIALOG_BODY}>
<div style={{
marginLeft: 10,
marginRight: 10
}} className={Classes.DIALOG_BODY}>
<H6>{this.props.mindInfo}</H6>
<div style={{
height: 220,
maxHeight: 220,
overflow: 'auto'
}}>
{blocksDiv}
</div>
</div>
<div className={Classes.DIALOG_FOOTER}>
<div className={Classes.DIALOG_FOOTER} >
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
<Button
style={{ marginLeft: 0 }}
className={Classes.INTENT_SUCCESS}
text="确定"
onClick={() => this.props.store.OnOk(ModalState.Cancel)}
@ -58,6 +62,7 @@ export class ExceedMind extends React.Component<ExceedMindProp, {}> {
</div>
</div>
</div>
</div>
);
}
}

Loading…
Cancel
Save