|
|
@ -446,20 +446,20 @@ namespace BBWY.Client.ViewModels |
|
|
|
}; |
|
|
|
if (IsNeedBarCode == Need.需要) |
|
|
|
{ |
|
|
|
if (BarCodeModel==null|| BarCodeModel.Id <= 0) |
|
|
|
if (BarCodeModel == null || BarCodeModel.Id <= 0) |
|
|
|
{ |
|
|
|
MessageBox.Show("条形码不能为空"); |
|
|
|
return; |
|
|
|
} |
|
|
|
request.BarcodeId = BarCodeModel.Id; |
|
|
|
} |
|
|
|
if (IsNeedCertificateModel == Need.需要) |
|
|
|
if(PurchaseSkuList != null && PurchaseSkuList.Count > 0&&purchaseSkuList.Any(p=> p.IsNeedCer)) //(IsNeedCertificateModel == Need.需要)
|
|
|
|
{ |
|
|
|
if (PurchaseSkuList == null && PurchaseSkuList.Count <= 0) |
|
|
|
{ |
|
|
|
MessageBox.Show("无可用的合格证打印!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
//if ()
|
|
|
|
//{
|
|
|
|
// MessageBox.Show("无可用的合格证打印!");
|
|
|
|
// return;
|
|
|
|
//}
|
|
|
|
if (PurchaseSkuList.Where(p => p.IsSetCertificate).Count() > 0) |
|
|
|
{ |
|
|
|
MessageBox.Show("存在未确认的合格证,请先完成确认!"); |
|
|
@ -507,7 +507,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (competeTime<DateTime.Now) |
|
|
|
if (competeTime < DateTime.Now) |
|
|
|
{ |
|
|
|
MessageBox.Show($"预计完成时间不能小于当前时间,请重新选择预计完成时间"); |
|
|
|
return; |
|
|
@ -517,7 +517,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
var now = DateTime.Now; |
|
|
|
if (now.Hour < 12) |
|
|
|
{ |
|
|
|
if (competeTime> now.AddDays(1).Date.AddHours(12)) |
|
|
|
if (competeTime > now.AddDays(1).Date.AddHours(12)) |
|
|
|
{ |
|
|
|
MessageBox.Show($"预计完成时间不能超过明天12点,请重新选择预计完成时间"); |
|
|
|
return; |
|
|
@ -553,40 +553,41 @@ namespace BBWY.Client.ViewModels |
|
|
|
request.PreCompeteTime = competeTime; |
|
|
|
|
|
|
|
|
|
|
|
try |
|
|
|
try |
|
|
|
{ |
|
|
|
var competeRes = packPurchaseTaskService.CompeteQualityTask(request); |
|
|
|
if (competeRes == null) |
|
|
|
{ |
|
|
|
var competeRes = packPurchaseTaskService.CompeteQualityTask(request); |
|
|
|
if (competeRes == null) |
|
|
|
{ |
|
|
|
MessageBox.Show("网络异常"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!competeRes.Success) |
|
|
|
{ |
|
|
|
MessageBox.Show(competeRes.Msg); |
|
|
|
return; |
|
|
|
} |
|
|
|
BatchPrintWindow batchPrint = new BatchPrintWindow(); |
|
|
|
|
|
|
|
batchPrint.SetData(GoodProductQuantity, |
|
|
|
PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray() |
|
|
|
, BarCodeModel); |
|
|
|
batchPrint.ShowDialog(); |
|
|
|
MessageBox.Show("网络异常"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!competeRes.Success) |
|
|
|
{ |
|
|
|
MessageBox.Show(competeRes.Msg); |
|
|
|
return; |
|
|
|
} |
|
|
|
BatchPrintWindow batchPrint = new BatchPrintWindow(); |
|
|
|
|
|
|
|
if (ReflashWindow != null) ReflashWindow(); |
|
|
|
var window = obj as BWindow; |
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => { |
|
|
|
batchPrint.SetData(GoodProductQuantity, |
|
|
|
PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray() |
|
|
|
, BarCodeModel); |
|
|
|
batchPrint.ShowDialog(); |
|
|
|
|
|
|
|
window.Close(); |
|
|
|
})); |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
if (ReflashWindow != null) ReflashWindow(); |
|
|
|
var window = obj as BWindow; |
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
|
|
|
|
System.Windows.MessageBox.Show(ex.Message); |
|
|
|
} |
|
|
|
|
|
|
|
window.Close(); |
|
|
|
})); |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
|
|
|
|
System.Windows.MessageBox.Show(ex.Message); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -717,6 +718,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
BasicPack = model.BasicPack; |
|
|
|
CertificatePosition = model.CertificatePosition; |
|
|
|
|
|
|
|
|
|
|
|
ArrivalQuantity = 0; |
|
|
|
GoodProductQuantity = 0; |
|
|
|
|
|
|
@ -744,16 +746,29 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
var packTaskRes = packPurchaseTaskService.GetQualityTask(model.TaskId); |
|
|
|
|
|
|
|
if (packTaskRes==null) |
|
|
|
{ |
|
|
|
MessageBox.Show("网络异常!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!packTaskRes.Success || packTaskRes.Data==null) |
|
|
|
{ |
|
|
|
MessageBox.Show(packTaskRes.Msg); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SkuPurchaseSchemeId = packTaskRes.Data.SkuPurchaseSchemeId; |
|
|
|
saveType = packTaskRes.Data.SaveType; |
|
|
|
if (saveType==null) |
|
|
|
if (saveType == null) |
|
|
|
{ |
|
|
|
saveType = OrderId.IsNullOrEmpty() ? SaveType.C端 : SaveType.B端; |
|
|
|
} |
|
|
|
if (packTaskRes == null || !packTaskRes.Success) return; |
|
|
|
BarCodeModel = packTaskRes.Data.BarCodeDTO; |
|
|
|
IsNeedBarCode = packTaskRes.Data.IsNeedBar ? Need.需要 : Need.不需要; |
|
|
|
IsSetBarCode = packTaskRes.Data.BarCodeDTO==null ? true:false; |
|
|
|
IsSetBarCode = packTaskRes.Data.BarCodeDTO == null ? true : false; |
|
|
|
IsNeedCertificateModel = packTaskRes.Data.IsNeedCer ? Need.需要 : Need.不需要; |
|
|
|
if (packTaskRes.Data.WareHourses != null) |
|
|
|
packTaskRes.Data.WareHourses.ToList().ForEach(w => |
|
|
@ -782,8 +797,8 @@ namespace BBWY.Client.ViewModels |
|
|
|
} |
|
|
|
PurchaseSkuItemBasicInfoResponse skuItem = null; |
|
|
|
if (list.Data != null) skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
PurchaseSkuList.Add(new PurchaseSku |
|
|
@ -832,7 +847,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hour<12) |
|
|
|
if (hour < 12) |
|
|
|
{ |
|
|
|
PreCompeteTimeDayList.Add("今天"); |
|
|
|
PreCompeteTimeDayList.Add("明天"); |
|
|
@ -841,7 +856,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
PreCompeteTimeHour = "12点前"; |
|
|
|
|
|
|
|
} |
|
|
|
else if (hour<18) |
|
|
|
else if (hour < 18) |
|
|
|
{ |
|
|
|
PreCompeteTimeDayList.Add("今天"); |
|
|
|
PreCompeteTimeDayList.Add("明天"); |
|
|
|