!2574 优化:填写拆单尺寸不完整(未完整填写高宽厚三项)给告警信息

pull/2576/MERGE
钱若寒 6 months ago committed by ChenX
parent 6c6d9887fd
commit 1f3c7e186a

@ -1,6 +1,7 @@
import { Intent } from "@blueprintjs/core";
import { runInAction } from "mobx";
import { app } from "../../ApplicationServices/Application";
import { HostApplicationServices } from "../../ApplicationServices/HostApplicationServices";
import { CheckInterfereTool } from "../../Common/InterfereUtil";
import { Sleep } from "../../Common/Sleep";
import { DuplicateRecordCloning } from "../../Common/Status";
@ -149,6 +150,7 @@ async function ExecChaiDan(chaiDanRoute: ErpRoutes)
let intSelfBoards = new Set<Board>();
let minBoardCount = 0;
let chaidanCount = 0;
const boardList = GetSelectionBoards(selction.selectEntityList, selction.selectRelativeHardware);
const interference = await InterferenceCheck(boardList);
@ -168,6 +170,12 @@ async function ExecChaiDan(chaiDanRoute: ErpRoutes)
for (let br of boardList)
{
let b = br.__OriginalEnt__ ?? br;
const [L, W, H] = [br.BoardProcessOption.spliteHeight, br.BoardProcessOption.spliteWidth, br.BoardProcessOption.spliteThickness];
const chaidanOptions = !(!L && !W && !H) && !(L && W && H);
if (!HostApplicationServices.chaidanOption.partialSplitValueCanTakesEffect && chaidanOptions)
{
chaidanCount++;
}
if (!intSelfBoards.has(b))
{
if (BoardIsShort(b))
@ -184,6 +192,18 @@ async function ExecChaiDan(chaiDanRoute: ErpRoutes)
}
}
}
if (chaidanCount)
{
let res = await AppConfirm.show({
intent: Intent.WARNING,
message: `${chaidanCount}个板件拆单尺寸填写不完整`,
ignore: true,
});
if (res)
{
return;
}
}
if (minBoardCount)
{

@ -6,6 +6,7 @@ import { ArcBoardOptions } from '../../../Add-on/ArcBoard/ArcBoardFeeding';
import { FaceDirection } from '../../../Add-on/DrawDrilling/DrillType';
import { IBoardRectHoleType, ParseBoardRectHoleType, SetBrHighHoleTypeFromRectHoleType } from '../../../Add-on/DrawDrilling/HoleUtils';
import { app } from '../../../ApplicationServices/Application';
import { HostApplicationServices } from '../../../ApplicationServices/HostApplicationServices';
import { CheckObjectType, CheckoutValid } from '../../../Common/CheckoutVaildValue';
import { DataAdapter } from '../../../Common/DataAdapter';
import { safeEval } from '../../../Common/eval';
@ -228,9 +229,10 @@ export function AddCommonBoardProps(Com: React.ComponentType<ICommonOptionProps>
}
const [L, W, H] = [this._ConfigOption.height, this._ConfigOption.width, this._ConfigOption.thickness];
if (safeEval(this._ProcessOption.spliteHeight, { L, W, H }, 'L') <= 1 ||
safeEval(this._ProcessOption.spliteWidth, { L, W, H }, "W") <= 1 ||
safeEval(this._ProcessOption.spliteThickness, { L, W, H }, "H") <= 1)
const safeEvalL = safeEval(this._ProcessOption.spliteHeight, { L, W, H }, 'L');
const safeEvalW = safeEval(this._ProcessOption.spliteWidth, { L, W, H }, 'W');
const safeEvalH = safeEval(this._ProcessOption.spliteThickness, { L, W, H }, 'H');
if (safeEvalL <= 1 || safeEvalW <= 1 || safeEvalH <= 1)
{
AppToaster.show({
message: "拆单尺寸错误!值不能小等于1",
@ -240,6 +242,16 @@ export function AddCommonBoardProps(Com: React.ComponentType<ICommonOptionProps>
return;
}
const chaidanOptions = !(!safeEvalL && !safeEvalW && !safeEvalH) && !(safeEvalL && safeEvalW && safeEvalH);
if (!HostApplicationServices.chaidanOption.partialSplitValueCanTakesEffect && chaidanOptions)
{
AppToaster.show({
message: "拆单尺寸填写不完整",
timeout: 3000,
intent: Intent.WARNING,
}, "拆单尺寸填写错误");
return;
}
CommandWrap(() =>
{
let board = this.CurrentBoard;

@ -32,6 +32,7 @@ class Confirm
hasCancel?: boolean;
confirmButtonText?: string;
intent?: Intent;
ignore?: boolean;
}): Promise<boolean>
{
return new Promise((res: (ok: boolean) => void) =>
@ -39,6 +40,7 @@ class Confirm
ReactDOM.render
(<CommonConfirm
hasCancel={option.hasCancel ?? true}
ignore={option.ignore}
message={option.message}
res={res}
close={() => this.close()}
@ -60,9 +62,9 @@ interface ICommonConfirmProps
res: Function;
close: Function;
hasCancel: boolean;
confirmButtonText?: string;
intent?: Intent;
ignore?: boolean;
}
/**
@ -100,7 +102,7 @@ export class CommonConfirm extends React.Component<ICommonConfirmProps>
isOpen={true}
confirmButtonText={this.props.confirmButtonText ?? "确认"}
canEscapeKeyCancel={true}
cancelButtonText={this.props.hasCancel ? "取消" : ""}
cancelButtonText={this.props.hasCancel ? (this.props.ignore ? "忽略" : "取消") : ""}
intent={this.props.intent ?? Intent.SUCCESS}
onConfirm={this.confirm}
onCancel={this.cancel}

Loading…
Cancel
Save