From 0b204f09f082d1090de3f858ac865f5d6f078eef Mon Sep 17 00:00:00 2001 From: liuwf Date: Sat, 31 Aug 2024 16:58:05 +0800 Subject: [PATCH] . --- src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs | 34 ++++++++++++------- .../TaskForm/SelectOutRawForm.xaml.cs | 1 - 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs b/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs index 339ef8d..c6d60b7 100644 --- a/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs +++ b/src/Khd.Core.Wpf/Form/FormBoardT.xaml.cs @@ -529,7 +529,7 @@ namespace Khd.Core.Wpf.Form // 托盘携带可用信息,用分号分隔 PalletDetails = string.Join("\n", palletMaterialSummary .Where(pallet => pallet.MaterialId == order.materialId) - .Select(pallet => $"托盘{pallet.PalletInfoCode}数量{pallet.canUseAmount}") + .Select(pallet => $"托盘{pallet.PalletInfoCode}数量{string.Format("{0:0.00}", pallet.canUseAmount)}") ) }).ToList(); @@ -545,8 +545,8 @@ namespace Khd.Core.Wpf.Form materiaName = m.MaterialName, materialSpec = m.MaterialSpec, saleOrderId = r.SaleOrderId, - outstockAmount = r.RequestedAmount, - realOutstockAmount = r.RealOutstockAmount, + outstockAmount = string.Format("{0:0.00}", r.RequestedAmount), + realOutstockAmount = string.Format("{0:0.00}", r.RealOutstockAmount), isSendOver = r.RequestedAmount <= r.RealOutstockAmount ? "已出完" : "未出完", thisOutAmount = r.PalletDetails }; @@ -4310,17 +4310,25 @@ namespace Khd.Core.Wpf.Form { using var scope = _host.Services.CreateScope(); using var dbContext = scope.ServiceProvider.GetRequiredService(); - List wcsTasks = dbContext.WcsTask.Where(t => t.taskType == 30).ToList(); - if (wcsTasks != null && wcsTasks.Count > 0) - { - HandyControl.Controls.MessageBox.Show("已经有出库任务请等待出库完成后,再进行继续出库!"); - return; - } BaseEquip baseEquip = dbContext.BaseEquip.Where(t => t.objid == 10).First(); - baseEquip.IsOut = 1; - dbContext.Update(baseEquip); - dbContext.SaveChanges(); - HandyControl.Controls.MessageBox.Show("继续出库成功!"); + if (!string.IsNullOrEmpty(baseEquip.endStationCode)) + { + List wcsTasks = dbContext.WcsTask.Where(t => t.taskType == 30).ToList(); + if (wcsTasks != null && wcsTasks.Count > 0) + { + scanOutMsg.Text = "已经有出库任务请等待出库完成后,再进行继续出库!"; + return; + } + + baseEquip.IsOut = 1; + dbContext.Update(baseEquip); + dbContext.SaveChanges(); + scanOutMsg.Text = "继续出库成功!"; + } + else + { + scanOutMsg.Text = "当前无正在出库单"; + } } catch { diff --git a/src/Khd.Core.Wpf/TaskForm/SelectOutRawForm.xaml.cs b/src/Khd.Core.Wpf/TaskForm/SelectOutRawForm.xaml.cs index 18f5452..0aa5e7d 100644 --- a/src/Khd.Core.Wpf/TaskForm/SelectOutRawForm.xaml.cs +++ b/src/Khd.Core.Wpf/TaskForm/SelectOutRawForm.xaml.cs @@ -44,7 +44,6 @@ namespace Khd.Core.Wpf.TaskForm baseEquip.IsOut = _isOut; dbContext.BaseEquip.Update(baseEquip); dbContext.SaveChanges(); - MessageBox.Show("保存成功!"); this.Close(); } }