| | |
| | | var action = new ApiAction<SubmitOutput>(new SubmitOutput()); |
| | | try |
| | | { |
| | | if (input.Qty.ToInt32() <= 0) |
| | | { |
| | | action.Data.ShortMsg = new("请输入包装数量", ShortMessage.Types.Error); |
| | | action.Data.OperInfo = new(); |
| | | action.Data.Data = "QtyError"; |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = new($"包装数量[{input.Qty}]不正确,请重新输入数量后继续包装操作"); |
| | | //action.LocaleMsg = new("MES.Transaction.PackingNode.Submit.QtyError", input.Qty); |
| | | return action; |
| | | } |
| | | //PkgSubmit:手动结束包装,手动保存暂存的包装数据 |
| | | if (NodeCmd == "PkgSubmit") |
| | | { |
| | |
| | | { |
| | | TempPkgAction = new PackingAction(); |
| | | TempPkgAction.Init(this); |
| | | |
| | | var CurPkg = Context["CurPackage"] as WipPkg; |
| | | int shipQty = input.Data.ToInt32(); |
| | | int curQty = CurPkg.Item.TotalQty; |
| | | int ruleQty = TempPkgAction.PkgRule.GetTotalQty(); |
| | | //有填出货数量则验证当前包装数量必须等于(出货数量/包装规则数量)的余数 |
| | | if (shipQty > 0 && curQty != shipQty % ruleQty) |
| | | { |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = new($"出货数量设定为[{0}],目前包装了[{1}],包装尾数的数量必需是[{2}],请装够数量后再结束包装"); |
| | | action.LocaleMsg = new("MES.Transaction.PackingNode.NotMatchShipQty", shipQty, curQty, shipQty % ruleQty); |
| | | return action; |
| | | } |
| | | |
| | | NodeCmd = "PkgSubmit"; |
| | | action = TempPkgAction.Submit(null); |