diff --git a/BBWY.Client/APIServices/BatchPurchaseService.cs b/BBWY.Client/APIServices/BatchPurchaseService.cs
index b9c0b993..372d4584 100644
--- a/BBWY.Client/APIServices/BatchPurchaseService.cs
+++ b/BBWY.Client/APIServices/BatchPurchaseService.cs
@@ -171,6 +171,21 @@ namespace BBWY.Client.APIServices
}, null, HttpMethod.Post);
}
+ ///
+ /// 修改打包状态
+ ///
+ ///
+ ///
+ ///
+ public ApiResponse UpdatePackState(string orderId, PackState PackState)
+ {
+ return SendRequest(globalContext.BBYWApiHost, "api/BatchPurchase/UpdatePackState", new
+ {
+ orderId,
+ PackState
+ }, null, HttpMethod.Post);
+ }
+
}
diff --git a/BBWY.Client/BBWYAppSettings.json b/BBWY.Client/BBWYAppSettings.json
index 9622efaf..7af1eac7 100644
--- a/BBWY.Client/BBWYAppSettings.json
+++ b/BBWY.Client/BBWYAppSettings.json
@@ -1,9 +1,9 @@
{
- //"BBWYApiHost": "http://localhost:5000",
- "BBWYApiHost": "http://bbwytest.qiyue666.com",
+ "BBWYApiHost": "http://localhost:5000",
+ //"BBWYApiHost": "http://bbwytest.qiyue666.com",
"MDSApiHost": "http://mdsapi.qiyue666.com",
"JOSApiHost": "",
"1688ApiHost": "",
- //"QKApiHost": "http://localhost:8080"
- "QKApiHost": "http://qiku.qiyue666.com"
+ "QKApiHost": "http://localhost:8080"
+ // "QKApiHost": "http://qiku.qiyue666.com"
}
\ No newline at end of file
diff --git a/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs b/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs
index 8a9b8902..f588225f 100644
--- a/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs
+++ b/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs
@@ -102,5 +102,6 @@ namespace BBWY.Client.Models.APIModel.Request
public int? CertificatePosition { get; set; }
public Worry IsWorry { get; set; }
+ public string OrderId { get; set; }
}
}
diff --git a/BBWY.Client/Models/APIModel/Response/BatchPurchase/PurchaseOrderV2Response.cs b/BBWY.Client/Models/APIModel/Response/BatchPurchase/PurchaseOrderV2Response.cs
index 328ff1fa..187ec220 100644
--- a/BBWY.Client/Models/APIModel/Response/BatchPurchase/PurchaseOrderV2Response.cs
+++ b/BBWY.Client/Models/APIModel/Response/BatchPurchase/PurchaseOrderV2Response.cs
@@ -171,7 +171,13 @@ namespace BBWY.Client.Models
///
public PurchaseOrderMode PurchaseOrderMode { get; set; }
+ ///
+ /// 打包状态(待发布 = 0, 打包中 = 1, 已完成 = 2)
+ ///
+ public PackState PackState { get; set; }
+
public IList ItemList { get; set; }
}
+
}
diff --git a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs
index bc1787db..f40488af 100644
--- a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs
+++ b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs
@@ -1,6 +1,9 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.PackTask;
+using BBWY.Client.ViewModels;
+using BBWY.Client.Views.PackTask;
using BBWY.Common.Models;
+using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@@ -8,6 +11,8 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Input;
namespace BBWY.Client.Models
{
@@ -129,7 +134,8 @@ namespace BBWY.Client.Models
///
public bool IsSetBarCode
{
- get => isSetBarCode; set
+ get => isSetBarCode;
+ set
{
Set(ref isSetBarCode, value);
@@ -228,8 +234,106 @@ namespace BBWY.Client.Models
public ProductService productService;
public BatchPublishTask()
{
+ IncreateList = new ObservableCollection();
+ foreach (var item in increates)
+ {
+ IncreateList.Add(new IncreateModel
+ {
+ IncreateName = item,
+ IsSelected = false
+ });
+ }
+ SetBarCodeCommand = new RelayCommand(SetBarCode);
+ SetCertificateCommand = new RelayCommand(SetCertificate);
+ LookBarCommand = new RelayCommand(LookBar);
+ LookCerCommand = new RelayCommand(LookCer);
}
#region 方法
+ public ICommand SetBarCodeCommand { get; set; }
+ public ICommand SetCertificateCommand { get; set; }
+ public ICommand LookBarCommand { get; set; }
+ public ICommand LookCerCommand { get; set; }
+
+
+ private void SetBarCode()
+ {
+ if (string.IsNullOrEmpty(SkuId))
+ {
+ return;
+ }
+ if (BarCodeModel == null)
+ {
+ BarCodeModel = new BarCodeModel();
+ BarCodeModel.ProductNo = ProductNo;
+ BarCodeModel.Brand = Brand;
+ BarCodeModel.SkuId = SkuId;
+ BarCodeModel.SkuName = SkuName;
+ }
+ if (!string.IsNullOrEmpty(BrandName))
+ BarCodeModel.BrandName = BrandName;
+
+
+ SetBarCodeWindow setBarCodeWindow = new SetBarCodeWindow();
+ setBarCodeWindow.LoadData(BarCodeModel, packTaskService);
+ setBarCodeWindow.SaveResult = b =>
+ {
+ BarCodeModel = b;
+ IsSetBarCode = false;
+ IsNeedBarCode = Need.需要;
+ };
+ setBarCodeWindow.Show();
+ }
+
+ ///
+ /// 设置合格证
+ ///
+ private void SetCertificate()
+ {
+ if (string.IsNullOrEmpty(SkuId))
+ return;
+
+ SearSpuCer();
+
+ if (CertificateModel == null)
+ {
+ CertificateModel = new CertificateModel();
+ CertificateModel.ProductNo = ProductNo;
+ CertificateModel.Brand = Brand;
+ CertificateModel.SkuId = SkuId;
+
+ }
+ if (!string.IsNullOrEmpty(BrandName))
+ CertificateModel.BrandName = BrandName;
+ SetCerWindow setCerWindow = new SetCerWindow();
+ setCerWindow.LoadData(certificateModel, packTaskService, spuCertificateModel, IsSetSpuCertificate);
+ setCerWindow.SaveResult = s =>
+ {
+ CertificateModel = s;
+ IsSetCertificate = false;
+ IsNeedCertificateModel = Need.需要;
+ };
+ setCerWindow.Show();
+ }
+
+
+ ///
+ /// 查看合格证
+ ///
+ private void LookCer()
+ {
+ LookCerWindow lookCerWindow = new LookCerWindow(CertificateModel);
+ lookCerWindow.Show();
+ }
+ ///
+ /// 查看条形码
+ ///
+ private void LookBar()
+ {
+ LookBarCodeWindow look = new LookBarCodeWindow();
+ look.SetData(BarCodeModel);
+ look.Show();
+ }
+
///
/// 搜索 skuId
///
@@ -248,7 +352,7 @@ namespace BBWY.Client.Models
}
Logo = skuResponse.Data[0].Logo;
SkuName = skuResponse.Data[0].Title;
-
+
SpuId = skuResponse.Data[0].ProductId;
@@ -318,7 +422,8 @@ namespace BBWY.Client.Models
}
CertificateModel.Brand = Brand;
- CertificateModel.BrandName = BrandName;
+ if (!string.IsNullOrEmpty(BrandName))
+ CertificateModel.BrandName = BrandName;
CertificateModel.ProductNo = ProductNo;
CertificateModel.SkuId = skuid;
BarCodeModel = productSku.Data.BarCodeModel;
@@ -329,7 +434,8 @@ namespace BBWY.Client.Models
IsSetBarCode = true;
}
BarCodeModel.Brand = Brand;
- BarCodeModel.BrandName = BrandName;
+ if (!string.IsNullOrEmpty(BrandName))
+ BarCodeModel.BrandName = BrandName;
BarCodeModel.ProductNo = ProductNo;
BarCodeModel.SkuId = skuid;
BarCodeModel.SkuName = SkuName;
@@ -343,6 +449,39 @@ namespace BBWY.Client.Models
//查看有木有存在
}
+ public void SearSpuCer()
+ {
+ if (string.IsNullOrEmpty(SpuId))
+ {
+ SearchSku(SkuId);
+ return;
+ }
+ SpuId = SpuId.Trim();//去掉空格 避免数据异常
+
+
+ var productSku = packTaskService.GetSpuCer(SpuId);
+ if (productSku == null || !productSku.Success)
+ {
+ IsSetSpuCertificate = true;
+
+ return;
+ }
+ SpuCertificateModel = productSku.Data;
+ IsSetSpuCertificate = false;
+ if (SpuCertificateModel == null)
+ {
+ SpuCertificateModel = new CertificateModel();
+ IsSetSpuCertificate = true;
+ SpuCertificateModel.Brand = Brand;
+ SpuCertificateModel.BrandName = BrandName;
+ SpuCertificateModel.ProductNo = ProductNo;
+ SpuCertificateModel.SpuId = SpuId;
+
+ }
+
+
+ }
+
public void InitData()
{
diff --git a/BBWY.Client/Models/Enums.cs b/BBWY.Client/Models/Enums.cs
index 15c93476..21bb87b7 100644
--- a/BBWY.Client/Models/Enums.cs
+++ b/BBWY.Client/Models/Enums.cs
@@ -390,4 +390,8 @@
不需要=0,
需要=1
}
+ public enum PackState
+ {
+ 待发布 = 0, 打包中 = 1, 已完成 = 2
+ }
}
diff --git a/BBWY.Client/ViewModels/BatchPurchase/BatchPublishTaskViewModel.cs b/BBWY.Client/ViewModels/BatchPurchase/BatchPublishTaskViewModel.cs
index 030c2229..d97a7b91 100644
--- a/BBWY.Client/ViewModels/BatchPurchase/BatchPublishTaskViewModel.cs
+++ b/BBWY.Client/ViewModels/BatchPurchase/BatchPublishTaskViewModel.cs
@@ -1,12 +1,16 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models;
+using BBWY.Client.Views.PackTask;
using BBWY.Common.Models;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.Net.Mail;
using System.Text;
+using System.Threading.Tasks;
using System.Windows.Input;
+using System.Linq;
namespace BBWY.Client.ViewModels
{
@@ -23,19 +27,84 @@ namespace BBWY.Client.ViewModels
public ICommand CreateTaskCommand { get; set; }
- public BatchPublishTaskViewModel(PackTaskService packTaskService, ProductService productService)
+ public BatchPublishTaskViewModel(PackTaskService packTaskService, ProductService productService, GlobalContext globalContext)
{
BatchPublishTasks = new ObservableCollection();
this.packTaskService = packTaskService;
this.productService = productService;
- CreateTaskCommand = new RelayCommand(CreateTask);
+ CreateTaskCommand = new RelayCommand