Browse Source

1. 对于本地模拟订单编辑,删除,下发操作添加二次确认对话框。

2. 添加手动取消订单功能。
master
ZhaoGang 1 year ago
parent
commit
8b7a380c4d
4 changed files with 79 additions and 21 deletions
  1. +22
    -0
      BPASmartClient.JXJFoodSmallStation/View/ManualFlowView.xaml
  2. +23
    -0
      BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs
  3. +29
    -20
      BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs
  4. +5
    -1
      BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs

+ 22
- 0
BPASmartClient.JXJFoodSmallStation/View/ManualFlowView.xaml View File

@@ -108,6 +108,28 @@
Content="PLC配方清零"
FontSize="20"
Style="{StaticResource ImageButtonStyle}" />
<WrapPanel Margin="400,0">
<TextBlock
Margin="10,0,5,0"
VerticalAlignment="Center"
FontSize="25"
Foreground="#FF2AB2E7"
Text="订单号:" />
<TextBox
Width="300"
Margin="5"
VerticalAlignment="Center"
FontSize="24"
Text="{Binding CancelRecipeCode}" />
<Button
Width="120"
Height="40"
Margin="5"
Command="{Binding CancelRecipeCommand}"
Content="取消订单"
FontSize="20"
Style="{StaticResource ImageButtonStyle}" />
</WrapPanel>
</StackPanel>




+ 23
- 0
BPASmartClient.JXJFoodSmallStation/ViewModel/ManualFlowViewModel.cs View File

@@ -147,6 +147,24 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
//MessageNotify.GetInstance.ShowUserLog($"手动点击按钮,清除所有手动配料完成信号");
//NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"清除所有手动配料完成信号");
});
CancelRecipeCommand = new RelayCommand(() => {
string cancelRecipeCode = CancelRecipeCode.Trim();
if (!String.IsNullOrEmpty(cancelRecipeCode) &&MessageNotify.GetInstance.ShowDialog($"请确认,是否进行删除订单【{cancelRecipeCode}】操作?")) {
if (Json<RemoteRecipeDataColl>.Data.Recipes != null) {
int index = Array.FindIndex(Json<RemoteRecipeDataColl>.Data.Recipes.ToArray(), p => p.RecipeCode == cancelRecipeCode);
if (index >= 0) {
GVL_SmallStation.GetInstance.Order_Cancel = true;
GVL_SmallStation.GetInstance.Order_CancelRecipeCode = cancelRecipeCode;
MessageNotify.GetInstance.ShowUserLog($"手动删除订单【{cancelRecipeCode}】。");
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"删除订单【{cancelRecipeCode}】成功!");
return;
}
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "提示", $"删除订单【{cancelRecipeCode}】失败,未找到该订单。");

}
}
});
ThreadManage.GetInstance().StartLong(new Action(() =>
{
RecipeDosingCompleNum = GVL_SmallStation.GetInstance.RecipeDosingCompleNum;
@@ -323,6 +341,7 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel

public RelayCommand StockbinDosingComple { get; set; }
public RelayCommand StockbinDosingCompleClear { get; set; }
public RelayCommand CancelRecipeCommand { get; set; }
private static int _StockbinDosingCompleNum { get; set; }
public static int StockbinDosingCompleNum { get { return _StockbinDosingCompleNum; } set { _StockbinDosingCompleNum = value; OnStaticPropertyChanged(); } }

@@ -335,6 +354,10 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
public static Visibility VisibilityBtn2 { get { return _VisibilityBtn2; } set { _VisibilityBtn2 = value; OnStaticPropertyChanged(); } }
private static Visibility _VisibilityBtn2 = Visibility.Hidden;
public static Visibility VisibilityBtn3 { get { return _VisibilityBtn3; } set { _VisibilityBtn3 = value; OnStaticPropertyChanged(); } }

public string CancelRecipeCode { get { return _CancelRecipeCode; } set { _CancelRecipeCode = value; OnPropertyChanged(); } }
public string _CancelRecipeCode { get; set; }

private static Visibility _VisibilityBtn3 = Visibility.Hidden;
}
}

+ 29
- 20
BPASmartClient.JXJFoodSmallStation/ViewModel/RecipeReceiveViewModel.cs View File

@@ -41,11 +41,14 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
if (o != null && o is string cnt)
{
var res = Json<LocalRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt);
if (res != null)
if (MessageNotify.GetInstance.ShowDialog($"请确认,是否删除订单【{cnt}】?"))
{
Json<LocalRecipeDataColl>.Data.Recipes.Remove(res);
MessageNotify.GetInstance.ShowUserLog($"删除配方——{res.RecipeName}");
var res = Json<LocalRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt);
if (res != null)
{
Json<LocalRecipeDataColl>.Data.Recipes.Remove(res);
MessageNotify.GetInstance.ShowUserLog($"删除配方——{res.RecipeName}");
}
}
}
});
@@ -53,14 +56,17 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
if (o != null && o is string cnt)
{
//ActionManage.GetInstance.Send("CloseNewRemoteRecipeView");
NewLocalRecipeView nrv = new NewLocalRecipeView();
var res = Json<LocalRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt);
if (res != null)
if (MessageNotify.GetInstance.ShowDialog($"请确认,是否进行编辑订单【{cnt}】操作?"))
{
ActionManage.GetInstance.Send("LocalRecipeEdit", res);
nrv.ShowDialog();
MessageNotify.GetInstance.ShowUserLog($"编辑配方——{res.RecipeName}");
//ActionManage.GetInstance.Send("CloseNewRemoteRecipeView");
NewLocalRecipeView nrv = new NewLocalRecipeView();
var res = Json<LocalRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt);
if (res != null)
{
ActionManage.GetInstance.Send("LocalRecipeEdit", res);
nrv.ShowDialog();
MessageNotify.GetInstance.ShowUserLog($"编辑配方——{res.RecipeName}");
}
}
}
});
@@ -77,16 +83,19 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
{
var res = Json<LocalRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt);
var res1 = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt);
if (res1 != null)
{
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "错误", $"远程已经存在该配方!");
return;
}
if (res != null && res1 == null)
if (MessageNotify.GetInstance.ShowDialog($"请确认,是否进行下发订单【{cnt}】操作?"))
{
ActionManage.GetInstance.Send("LocalSimulationRecipeIssue", res);
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{res.RecipeName}配方下发成功!");
MessageNotify.GetInstance.ShowUserLog($"下发本地模拟配方——{res.RecipeName}");
if (res1 != null)
{
NoticeDemoViewModel.OpenMsg(EnumPromptType.Error, App.MainWindow, "错误", $"远程已经存在该配方!");
return;
}
if (res != null && res1 == null)
{
ActionManage.GetInstance.Send("LocalSimulationRecipeIssue", res);
NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "提示", $"{res.RecipeName}配方下发成功!");
MessageNotify.GetInstance.ShowUserLog($"下发本地模拟配方——{res.RecipeName}");
}
}
}
}


+ 5
- 1
BPASmartClient.JXJFoodSmallStation/ViewModel/SiemensRecipeReceiveViewModel.cs View File

@@ -46,7 +46,11 @@ namespace BPASmartClient.JXJFoodSmallStation.ViewModel
});
ClearAllRecipe = new RelayCommand(() =>
{
Json<RemoteRecipeDataColl>.Data.Recipes.Clear();
if (MessageNotify.GetInstance.ShowDialog($"请确认,是否删除所有配方订单?"))
{
Json<RemoteRecipeDataColl>.Data.Recipes.Clear();
MessageNotify.GetInstance.ShowUserLog($"手动清除所有配方。");
}
});
}
public RelayCommand<object> DetailsCommand { get; set; }


Loading…
Cancel
Save