Browse Source

1

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
e652aec88f
  1. 36
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  2. 15
      BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml.cs

36
BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs

@ -903,26 +903,28 @@ namespace BBWY.Client.ViewModels.PackTask
return; return;
} }
StorePickProductWindow sorePickProductWindow = new StorePickProductWindow(data.Data); StorePickProductWindow sorePickProductWindow = new StorePickProductWindow(data.Data, (count, UserName) => {
var res = packTaskService.StoreGetBySelfV2(taskId,count,UserName);
if (res == null)
{
return false;
}
if (!res.Success)
{
System.Windows.MessageBox.Show(res.Msg, "错误信息");
return false;
}
Task.Factory.StartNew(() => SearchTaskList());
return true;
});
sorePickProductWindow.ShowDialog(); sorePickProductWindow.ShowDialog();
if (sorePickProductWindow.DialogResult == null || !sorePickProductWindow.DialogResult.Value)
{
return;
}
var res = packTaskService.StoreGetBySelfV2(taskId, sorePickProductWindow.Count, sorePickProductWindow.UserName);
if (res == null)
{
return;
}
if (!res.Success)
{
System.Windows.MessageBox.Show(res.Msg, "错误信息");
return;
}
sorePickProductWindow.Close();
Task.Factory.StartNew(() => SearchTaskList());
} }
private void DeletedTask(object obj) private void DeletedTask(object obj)

15
BBWY.Client/Views/StorePickSelf/StorePickProductWindow.xaml.cs

@ -3,6 +3,7 @@ using BBWY.Client.Models.PackTask;
using BBWY.Controls; using BBWY.Controls;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO.Packaging;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
@ -21,9 +22,10 @@ namespace BBWY.Client.Views.StorePickSelf
/// </summary> /// </summary>
public partial class StorePickProductWindow : BWindow public partial class StorePickProductWindow : BWindow
{ {
public StorePickProductWindow(StoreGetSelfResponse model) public StorePickProductWindow(StoreGetSelfResponse model, Func<int, string, bool> SaveData)
{ {
StoreGetSelfResponse=model; this. SaveData=SaveData;
StoreGetSelfResponse =model;
InitializeComponent(); InitializeComponent();
this.DataContext = this; this.DataContext = this;
} }
@ -42,10 +44,13 @@ namespace BBWY.Client.Views.StorePickSelf
public StoreGetSelfResponse StoreGetSelfResponse { get=> storeGetSelfResponse; set {Set(ref storeGetSelfResponse,value); } } public StoreGetSelfResponse StoreGetSelfResponse { get=> storeGetSelfResponse; set {Set(ref storeGetSelfResponse,value); } }
private void BButton_Click(object sender, RoutedEventArgs e) private void BButton_Click(object sender, RoutedEventArgs e)
{ {
this.DialogResult = true; if (SaveData != null&& SaveData(Count, UserName))
{
this.Close();
}
} }
private Func<int, string,bool> SaveData { get; set; }
private void BButton_Click_1(object sender, RoutedEventArgs e) private void BButton_Click_1(object sender, RoutedEventArgs e)
{ {
Count = StoreGetSelfResponse.PickMaxCount; Count = StoreGetSelfResponse.PickMaxCount;

Loading…
Cancel
Save