|
|
@ -21,6 +21,7 @@ using System.Runtime.InteropServices.WindowsRuntime; |
|
|
|
using NPOI.Util; |
|
|
|
using BBWY.Controls; |
|
|
|
using WebSocketSharp; |
|
|
|
using BBWY.Client.APIServices.QiKu; |
|
|
|
|
|
|
|
namespace BBWY.Client.ViewModels |
|
|
|
{ |
|
|
@ -105,47 +106,6 @@ namespace BBWY.Client.ViewModels |
|
|
|
}; |
|
|
|
public ObservableCollection<int> FloorDragNumberList { get => floorDragNumberList; set { Set(ref floorDragNumberList, value); } } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//private ObservableCollection<string> preCompeteTimeDayList = new ObservableCollection<string>
|
|
|
|
//{
|
|
|
|
|
|
|
|
//};
|
|
|
|
//public ObservableCollection<string> PreCompeteTimeDayList
|
|
|
|
//{
|
|
|
|
// get => preCompeteTimeDayList; set
|
|
|
|
// {
|
|
|
|
|
|
|
|
// Set(ref preCompeteTimeDayList, value);
|
|
|
|
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//private ObservableCollection<string> preCompeteTimeHourList = new ObservableCollection<string> {
|
|
|
|
|
|
|
|
// };
|
|
|
|
//public ObservableCollection<string> PreCompeteTimeHourList { get => preCompeteTimeHourList; set { Set(ref preCompeteTimeHourList, value); } }
|
|
|
|
|
|
|
|
////
|
|
|
|
//public string preCompeteTimeDay;
|
|
|
|
//public string PreCompeteTimeDay
|
|
|
|
//{
|
|
|
|
// get => preCompeteTimeDay; set
|
|
|
|
// {
|
|
|
|
|
|
|
|
// Set(ref preCompeteTimeDay, value);
|
|
|
|
// PreCompeteTimeDayOnChanged();//
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//public string preCompeteTimeHour;
|
|
|
|
//public string PreCompeteTimeHour { get => preCompeteTimeHour; set { Set(ref preCompeteTimeHour, value); } }
|
|
|
|
|
|
|
|
|
|
|
|
private ObservableCollection<WareHourseDTO> wareHourseList = new ObservableCollection<WareHourseDTO> { }; |
|
|
|
public ObservableCollection<WareHourseDTO> WareHourseList { get => wareHourseList; set { Set(ref wareHourseList, value); } } |
|
|
|
|
|
|
@ -359,6 +319,15 @@ namespace BBWY.Client.ViewModels |
|
|
|
public string MarkMessage { get => markMessage; set { Set(ref markMessage, value); } } |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 注意事项(对接备注)
|
|
|
|
/// </summary>
|
|
|
|
private string showMarkMessage; |
|
|
|
/// <summary>
|
|
|
|
/// 注意事项(对接备注)
|
|
|
|
/// </summary>
|
|
|
|
public string ShowMarkMessage { get => showMarkMessage; set { Set(ref showMarkMessage, value); } } |
|
|
|
|
|
|
|
private ObservableCollection<IncreateModel> increateList; |
|
|
|
/// <summary>
|
|
|
|
/// 增量耗材查询关键字
|
|
|
@ -394,7 +363,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
public ICommand SearchSkuCommand { get; set; } |
|
|
|
#endregion
|
|
|
|
|
|
|
|
public QualityViewModel(ProductService productService, GlobalContext globalContext, PackPurchaseTaskService packPurchaseTaskService, PurchaseService purchaseService, PackTaskService packTaskService) |
|
|
|
public QualityViewModel(ProductService productService, GlobalContext globalContext, PackPurchaseTaskService packPurchaseTaskService, PurchaseService purchaseService, PackTaskService packTaskService, MarkMessageService markMessageService) |
|
|
|
{ |
|
|
|
this.packPurchaseTaskService = packPurchaseTaskService; |
|
|
|
this.productService = productService; |
|
|
@ -418,7 +387,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
this.purchaseService = purchaseService; |
|
|
|
this.packTaskService = packTaskService; |
|
|
|
|
|
|
|
this.markMessageService = markMessageService; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -498,80 +467,6 @@ namespace BBWY.Client.ViewModels |
|
|
|
request.CerId = string.Join(",", PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO.Id)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//int hour = Convert.ToInt32(PreCompeteTimeHour.Replace("点前", ""));
|
|
|
|
|
|
|
|
|
|
|
|
//DateTime date = DateTime.Now;
|
|
|
|
|
|
|
|
//switch (preCompeteTimeDay)
|
|
|
|
//{
|
|
|
|
// case "今天":
|
|
|
|
// date = DateTime.Now;
|
|
|
|
// break;
|
|
|
|
// case "明天":
|
|
|
|
// date = DateTime.Now.AddDays(1);
|
|
|
|
// break;
|
|
|
|
// case "后天":
|
|
|
|
// date = DateTime.Now.AddDays(2);
|
|
|
|
// break;
|
|
|
|
// default:
|
|
|
|
// break;
|
|
|
|
//}
|
|
|
|
|
|
|
|
////date = Convert.ToDateTime(PreCompeteTimeDay);
|
|
|
|
|
|
|
|
|
|
|
|
//var competeTime = date.Date.AddHours(hour);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (competeTime < DateTime.Now)
|
|
|
|
//{
|
|
|
|
// MessageBox.Show($"预计完成时间不能小于当前时间,请重新选择预计完成时间");
|
|
|
|
// return;
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//var now = DateTime.Now;
|
|
|
|
//if (now.Hour < 12)
|
|
|
|
//{
|
|
|
|
// if (competeTime > now.AddDays(1).Date.AddHours(12))
|
|
|
|
// {
|
|
|
|
// MessageBox.Show($"预计完成时间不能超过明天12点,请重新选择预计完成时间");
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
//else if (now.Hour < 18)
|
|
|
|
//{
|
|
|
|
// if (competeTime > now.AddDays(1).Date.AddHours(18))
|
|
|
|
// {
|
|
|
|
// MessageBox.Show($"预计完成时间不能超过明天18点,请重新选择预计完成时间");
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
//else if (now.Hour < 22)
|
|
|
|
//{
|
|
|
|
// if (competeTime > now.AddDays(1).Date.AddHours(22))
|
|
|
|
// {
|
|
|
|
// MessageBox.Show($"预计完成时间不能超过明天22点,请重新选择预计完成时间");
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
//else
|
|
|
|
//{
|
|
|
|
// if (competeTime > now.AddDays(2).Date.AddHours(12))
|
|
|
|
// {
|
|
|
|
// MessageBox.Show($"预计完成时间不能超过后天12点,请重新选择预计完成时间");
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
|
|
|
//request.PreCompeteTime = competeTime;
|
|
|
|
|
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
var competeRes = packPurchaseTaskService.CompeteQualityTask(request); |
|
|
@ -610,94 +505,6 @@ namespace BBWY.Client.ViewModels |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//// "12点前","18点前","22点前"
|
|
|
|
//private void PreCompeteTimeDayOnChanged()
|
|
|
|
//{
|
|
|
|
// var now = DateTime.Now;
|
|
|
|
// if (now.Hour < 12)
|
|
|
|
// {
|
|
|
|
// if (PreCompeteTimeDay=="今天")
|
|
|
|
// {
|
|
|
|
// PreCompeteTimeHourList.Clear();
|
|
|
|
// PreCompeteTimeHourList.Add("12点前");
|
|
|
|
// PreCompeteTimeHourList.Add("18点前");
|
|
|
|
// PreCompeteTimeHourList.Add("22点前");
|
|
|
|
// PreCompeteTimeHour = "12点前";
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// if (PreCompeteTimeDay == "明天")
|
|
|
|
// {
|
|
|
|
// PreCompeteTimeHourList.Clear();
|
|
|
|
// PreCompeteTimeHourList.Add("12点前");
|
|
|
|
// PreCompeteTimeHour = "12点前";
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
// else if (now.Hour < 18)
|
|
|
|
// {
|
|
|
|
// if (PreCompeteTimeDay == "今天")
|
|
|
|
// {
|
|
|
|
// PreCompeteTimeHourList.Clear();
|
|
|
|
// PreCompeteTimeHourList.Add("18点前");
|
|
|
|
// PreCompeteTimeHourList.Add("22点前");
|
|
|
|
|
|
|
|
// PreCompeteTimeHour = "18点前";
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// if (PreCompeteTimeDay == "明天")
|
|
|
|
// {
|
|
|
|
// PreCompeteTimeHourList.Clear();
|
|
|
|
// PreCompeteTimeHourList.Add("12点前");
|
|
|
|
// PreCompeteTimeHourList.Add("18点前");
|
|
|
|
// PreCompeteTimeHour = "12点前";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// else if (now.Hour < 22)
|
|
|
|
// {
|
|
|
|
// if (PreCompeteTimeDay == "今天")
|
|
|
|
// {
|
|
|
|
// PreCompeteTimeHourList.Clear();
|
|
|
|
// PreCompeteTimeHourList.Add("22点前");
|
|
|
|
// PreCompeteTimeHour = "22点前";
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// if (PreCompeteTimeDay == "明天")
|
|
|
|
// {
|
|
|
|
// PreCompeteTimeHourList.Clear();
|
|
|
|
// PreCompeteTimeHourList.Add("12点前");
|
|
|
|
// PreCompeteTimeHourList.Add("18点前");
|
|
|
|
// PreCompeteTimeHourList.Add("22点前");
|
|
|
|
// PreCompeteTimeHour = "12点前";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// if (PreCompeteTimeDay == "明天")
|
|
|
|
// {
|
|
|
|
// PreCompeteTimeHourList.Clear();
|
|
|
|
// PreCompeteTimeHourList.Add("12点前");
|
|
|
|
// PreCompeteTimeHourList.Add("18点前");
|
|
|
|
// PreCompeteTimeHourList.Add("22点前");
|
|
|
|
// PreCompeteTimeHour = "12点前";
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (PreCompeteTimeDay == "后天")
|
|
|
|
// {
|
|
|
|
// PreCompeteTimeHourList.Clear();
|
|
|
|
// PreCompeteTimeHourList.Add("12点前");
|
|
|
|
// PreCompeteTimeHour = "12点前";
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
private void SetBarCode() |
|
|
@ -709,7 +516,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
if (BarCodeModel == null) |
|
|
|
{ |
|
|
|
var resCode = packPurchaseTaskService.SearchBarCode(SkuId); |
|
|
|
if (resCode == null||!resCode.Success) |
|
|
|
if (resCode == null || !resCode.Success) |
|
|
|
{ |
|
|
|
BarCodeModel = new BarCodeModel(); |
|
|
|
BarCodeModel.ProductNo = ProductNo; |
|
|
@ -720,7 +527,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
BarCodeModel = resCode.Data; |
|
|
|
BarCodeModel = resCode.Data; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -801,7 +608,7 @@ namespace BBWY.Client.ViewModels |
|
|
|
look.Show(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MarkMessageService markMessageService; |
|
|
|
|
|
|
|
SaveType? saveType; |
|
|
|
/// <summary>
|
|
|
@ -810,7 +617,24 @@ namespace BBWY.Client.ViewModels |
|
|
|
public void SearchSku(PackTaskModel model) |
|
|
|
{ |
|
|
|
|
|
|
|
InitData(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FloorDragNumber = 0; |
|
|
|
PurchaseSkuList = new ObservableCollection<PurchaseSku>(); |
|
|
|
WareHourseList = new ObservableCollection<WareHourseDTO>(); |
|
|
|
|
|
|
|
FloorDragNumberList = new ObservableCollection<int>(); |
|
|
|
|
|
|
|
for (int i = 0; i < 30; i++) |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.Invoke((Action)(() => |
|
|
|
{ |
|
|
|
|
|
|
|
FloorDragNumberList.Add(i + 1); |
|
|
|
})); |
|
|
|
|
|
|
|
} |
|
|
|
TaskId = model.TaskId; |
|
|
|
OrderId = model.OrderId; |
|
|
|
SkuId = model.SkuId; |
|
|
@ -825,9 +649,6 @@ namespace BBWY.Client.ViewModels |
|
|
|
SkuTitle = model.SkuTitle; |
|
|
|
BasicPack = model.BasicPack; |
|
|
|
CertificatePosition = model.CertificatePosition; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ArrivalQuantity = 0; |
|
|
|
GoodProductQuantity = 0; |
|
|
|
|
|
|
@ -853,195 +674,145 @@ namespace BBWY.Client.ViewModels |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var packTaskRes = packPurchaseTaskService.GetQualityTask(model.TaskId); |
|
|
|
|
|
|
|
if (packTaskRes == null) |
|
|
|
Task.Factory.StartNew(() => |
|
|
|
{ |
|
|
|
MessageBox.Show("网络异常!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!packTaskRes.Success || packTaskRes.Data == null) |
|
|
|
{ |
|
|
|
MessageBox.Show(packTaskRes.Msg); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var resShow = markMessageService.ShowTaskMarkMessage(TaskId); |
|
|
|
if (resShow != null && resShow.Success && resShow.Data != null) |
|
|
|
{ |
|
|
|
ShowMarkMessage = string.Join("\r\n", resShow.Data.Select(d => d.ToString())); |
|
|
|
} |
|
|
|
|
|
|
|
var packTaskRes = packPurchaseTaskService.GetQualityTask(model.TaskId); |
|
|
|
|
|
|
|
SkuPurchaseSchemeId = packTaskRes.Data.SkuPurchaseSchemeId; |
|
|
|
saveType = packTaskRes.Data.SaveType; |
|
|
|
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; |
|
|
|
IsNeedCertificateModel = packTaskRes.Data.IsNeedCer ? Need.需要 : Need.不需要; |
|
|
|
if (packTaskRes.Data.WareHourses != null) |
|
|
|
packTaskRes.Data.WareHourses.ToList().ForEach(w => |
|
|
|
if (packTaskRes == null) |
|
|
|
{ |
|
|
|
WareHourseList.Add(w); |
|
|
|
}); |
|
|
|
WareHourseCount = WareHourseList.Count(); |
|
|
|
if (packTaskRes.Data.PurchaseSkus != null) |
|
|
|
{ |
|
|
|
|
|
|
|
int goodsIndex = 0; |
|
|
|
foreach (var item in packTaskRes.Data.PurchaseSkus) |
|
|
|
MessageBox.Show("网络异常!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!packTaskRes.Success || packTaskRes.Data == null) |
|
|
|
{ |
|
|
|
goodsIndex++; |
|
|
|
if (item.CerDTO != null) item.CerDTO.GoodsNumberIndex = goodsIndex; |
|
|
|
item.IsSetCertificate = true; |
|
|
|
if (string.IsNullOrEmpty(item.PurchaseProductId)) |
|
|
|
{ |
|
|
|
PurchaseSkuList.Add(item); continue; |
|
|
|
} |
|
|
|
MessageBox.Show(packTaskRes.Msg); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var list = purchaseService.GetPurchaseSkuBasicInfo(item.PurchaseProductId); |
|
|
|
if (list == null && !list.Success) |
|
|
|
{ |
|
|
|
PurchaseSkuList.Add(item); continue; |
|
|
|
} |
|
|
|
PurchaseSkuItemBasicInfoResponse skuItem = null; |
|
|
|
if (list.Data != null) skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId); |
|
|
|
|
|
|
|
|
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
SkuPurchaseSchemeId = packTaskRes.Data.SkuPurchaseSchemeId; |
|
|
|
saveType = packTaskRes.Data.SaveType; |
|
|
|
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; |
|
|
|
IsNeedCertificateModel = packTaskRes.Data.IsNeedCer ? Need.需要 : Need.不需要; |
|
|
|
if (packTaskRes.Data.WareHourses != null) |
|
|
|
packTaskRes.Data.WareHourses.ToList().ForEach(w => |
|
|
|
{ |
|
|
|
PurchaseSkuList.Add(new PurchaseSku |
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
Logo = skuItem?.Logo, |
|
|
|
Title = skuItem?.Title, |
|
|
|
IsNeedCer = item.IsNeedCer, |
|
|
|
PurchaseSkuId = item.PurchaseSkuId, |
|
|
|
CerDTO = item.CerDTO, |
|
|
|
IsSetCertificate = item.IsNeedCer, |
|
|
|
}); |
|
|
|
})); |
|
|
|
//PurchaseSkuList.Add(item);
|
|
|
|
} |
|
|
|
} |
|
|
|
WareHourseList.Add(w); |
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
if (BarCodeModel==null) |
|
|
|
{ |
|
|
|
//加载品牌品名数据
|
|
|
|
var shopList = globalContext.User.ShopList; |
|
|
|
var shop = shopList.FirstOrDefault(s => s.ShopName == model.ShopName); |
|
|
|
if (shop != null) |
|
|
|
}); |
|
|
|
WareHourseCount = WareHourseList.Count(); |
|
|
|
if (packTaskRes.Data.PurchaseSkus != null) |
|
|
|
{ |
|
|
|
|
|
|
|
var skuResponse = productService.GetProductSkuList(string.Empty, SkuId, shop.Platform, shop.AppKey, shop.AppSecret, shop.AppToken); |
|
|
|
if (skuResponse.Success) |
|
|
|
int goodsIndex = 0; |
|
|
|
foreach (var item in packTaskRes.Data.PurchaseSkus) |
|
|
|
{ |
|
|
|
if (skuResponse.Data.Count == 0) |
|
|
|
goodsIndex++; |
|
|
|
if (item.CerDTO != null) item.CerDTO.GoodsNumberIndex = goodsIndex; |
|
|
|
item.IsSetCertificate = true; |
|
|
|
if (string.IsNullOrEmpty(item.PurchaseProductId)) |
|
|
|
{ |
|
|
|
return; |
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
PurchaseSkuList.Add(item); |
|
|
|
})); |
|
|
|
continue; |
|
|
|
} |
|
|
|
Logo = skuResponse.Data[0].Logo.Replace("80x80", "200x200"); |
|
|
|
SkuName = skuResponse.Data[0].Title; |
|
|
|
SpuId = skuResponse.Data[0].ProductId; |
|
|
|
var productApiResponse = productService.GetProductList(skuResponse.Data[0].ProductId, string.Empty, string.Empty, 1, |
|
|
|
shop.Platform, shop.AppKey, shop.AppSecret, shop.AppToken); |
|
|
|
if (productApiResponse.Success) |
|
|
|
|
|
|
|
var list = purchaseService.GetPurchaseSkuBasicInfo(item.PurchaseProductId); |
|
|
|
if (list == null && !list.Success) |
|
|
|
{ |
|
|
|
if (productApiResponse.Data.Count == 0) |
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
ProductNo = productApiResponse.Data.Items[0].ProductItemNum; |
|
|
|
Brand = productApiResponse.Data.Items[0].BrandName; |
|
|
|
|
|
|
|
PurchaseSkuList.Add(item); |
|
|
|
})); |
|
|
|
continue; |
|
|
|
} |
|
|
|
PurchaseSkuItemBasicInfoResponse skuItem = null; |
|
|
|
if (list.Data != null) skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId); |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
App.Current.Dispatcher.Invoke(() => MessageBox.Show(skuResponse.Msg, "加载sku")); |
|
|
|
return; |
|
|
|
App.Current.Dispatcher.Invoke(new Action(() => |
|
|
|
{ |
|
|
|
PurchaseSkuList.Add(new PurchaseSku |
|
|
|
{ |
|
|
|
Logo = skuItem?.Logo, |
|
|
|
Title = skuItem?.Title, |
|
|
|
IsNeedCer = item.IsNeedCer, |
|
|
|
PurchaseSkuId = item.PurchaseSkuId, |
|
|
|
CerDTO = item.CerDTO, |
|
|
|
IsSetCertificate = item.IsNeedCer, |
|
|
|
}); |
|
|
|
})); |
|
|
|
//PurchaseSkuList.Add(item);
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
public Action ReflashWindow { get; set; } |
|
|
|
public void InitData() |
|
|
|
{ |
|
|
|
FloorDragNumber = 0; |
|
|
|
PurchaseSkuList = new ObservableCollection<PurchaseSku>(); |
|
|
|
WareHourseList = new ObservableCollection<WareHourseDTO>(); |
|
|
|
//PreCompeteTimeDayList = new ObservableCollection<string>();
|
|
|
|
FloorDragNumberList = new ObservableCollection<int>(); |
|
|
|
|
|
|
|
for (int i = 0; i < 30; i++) |
|
|
|
{ |
|
|
|
App.Current.Dispatcher.Invoke((Action)(() => |
|
|
|
if (BarCodeModel == null) |
|
|
|
{ |
|
|
|
//加载品牌品名数据
|
|
|
|
var shopList = globalContext.User.ShopList; |
|
|
|
var shop = shopList.FirstOrDefault(s => s.ShopName == model.ShopName); |
|
|
|
if (shop != null) |
|
|
|
{ |
|
|
|
|
|
|
|
FloorDragNumberList.Add(i + 1); |
|
|
|
})); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//var nowTime = DateTime.Now;
|
|
|
|
//var hour = nowTime.Hour;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (hour < 12)
|
|
|
|
//{
|
|
|
|
// PreCompeteTimeDayList.Add("今天");
|
|
|
|
// PreCompeteTimeDayList.Add("明天");
|
|
|
|
|
|
|
|
// PreCompeteTimeDay = "今天";
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
//else if (hour < 18)
|
|
|
|
//{
|
|
|
|
// PreCompeteTimeDayList.Add("今天");
|
|
|
|
// PreCompeteTimeDayList.Add("明天");
|
|
|
|
// PreCompeteTimeDay = "今天";
|
|
|
|
var skuResponse = productService.GetProductSkuList(string.Empty, SkuId, shop.Platform, shop.AppKey, shop.AppSecret, shop.AppToken); |
|
|
|
if (skuResponse.Success) |
|
|
|
{ |
|
|
|
if (skuResponse.Data.Count == 0) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
Logo = skuResponse.Data[0].Logo.Replace("80x80", "200x200"); |
|
|
|
SkuName = skuResponse.Data[0].Title; |
|
|
|
SpuId = skuResponse.Data[0].ProductId; |
|
|
|
var productApiResponse = productService.GetProductList(skuResponse.Data[0].ProductId, string.Empty, string.Empty, 1, |
|
|
|
shop.Platform, shop.AppKey, shop.AppSecret, shop.AppToken); |
|
|
|
if (productApiResponse.Success) |
|
|
|
{ |
|
|
|
if (productApiResponse.Data.Count == 0) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//}
|
|
|
|
//else if (hour < 22)
|
|
|
|
//{
|
|
|
|
// PreCompeteTimeDayList.Add("今天");
|
|
|
|
// PreCompeteTimeDayList.Add("明天");
|
|
|
|
// PreCompeteTimeDay = "今天";
|
|
|
|
ProductNo = productApiResponse.Data.Items[0].ProductItemNum; |
|
|
|
Brand = productApiResponse.Data.Items[0].BrandName; |
|
|
|
|
|
|
|
//}
|
|
|
|
//else
|
|
|
|
//{
|
|
|
|
// PreCompeteTimeDayList.Add("明天");
|
|
|
|
// PreCompeteTimeDayList.Add("后天");
|
|
|
|
// PreCompeteTimeDay = "明天";
|
|
|
|
//}
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
App.Current.Dispatcher.Invoke(() => MessageBox.Show(skuResponse.Msg, "加载sku")); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
IsSetBarCode = true; |
|
|
|
SkuTitle = ""; |
|
|
|
BrandName = ""; |
|
|
|
GoodsNumber = 0; |
|
|
|
PackType = PackType.单件; |
|
|
|
BasicPack = BasicPack.快递袋; |
|
|
|
CertificatePosition = CertificatePosition.无需合格证; |
|
|
|
IsNeedBarCode = Need.需要; |
|
|
|
IsNeedCertificateModel = Need.不需要; |
|
|
|
}); |
|
|
|
} |
|
|
|
public Action ReflashWindow { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
private void OpenSkuDetail(object param) |
|
|
|
{ |
|
|
|