Browse Source

合并

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
5d988f26c4
  1. 11
      BBWY.Client/APIServices/BatchPurchaseService.cs
  2. 2
      BBWY.Client/BBWYAppSettings.json
  3. 10
      BBWY.Client/Converters/EnumToColorConverter.cs
  4. 50
      BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs
  5. 54
      BBWY.Client/Models/PackTask/PackTaskModel.cs
  6. 15
      BBWY.Client/ViewModels/BatchPurchase/BatchPurchaseOrderListViewModel.cs
  7. 208
      BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs
  8. 32
      BBWY.Client/ViewModels/PackTask/PackTaskTotalViewModel.cs
  9. 53
      BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
  10. 24
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  11. 7
      BBWY.Client/Views/BatchPurchase/BatchPublishTaskWindow.xaml
  12. 13
      BBWY.Client/Views/PackTask/PackTaskTotal.xaml
  13. 117
      BBWY.Client/Views/PackTask/PackTaskTotal.xaml.cs
  14. 2
      BBWY.Client/Views/PackTask/PrintWindow.xaml
  15. 2
      BBWY.Client/Views/PackTask/SetBarCode.xaml
  16. 29
      BBWY.Client/Views/PackTask/SetBarCode.xaml.cs
  17. 12
      BBWY.Client/Views/PackTask/SetCerControl.xaml.cs
  18. 96
      BBWY.Client/Views/PackTask/SetCerWindow.xaml
  19. 1
      BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs
  20. 91
      BBWY.Client/Views/PackTask/SetSpuCerWindow.xaml
  21. 2
      BBWY.Client/Views/PackTask/TaskListControl.xaml
  22. 2
      BBWY.Client/Views/PackTask/WareHouseList.xaml
  23. 51
      BBWY.Client/Views/PackTask/WareHouseList.xaml.cs
  24. 10
      BBWY.Server.Business/PlatformSDK/QuanTanBusiness.cs
  25. 2
      BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs
  26. 2
      BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/CancelPurchaseOrderRequest.cs
  27. 8
      BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/PayPurchaseOrderRequest.cs

11
BBWY.Client/APIServices/BatchPurchaseService.cs

@ -144,13 +144,10 @@ namespace BBWY.Client.APIServices
return SendRequest<PayPurchaseOrderResponse>(globalContext.BBYWApiHost, "api/BatchPurchase/PayPurchaseOrder", new
{
orderId,
PurchasePlatform,
purchaseAccount,
globalContext.User.Shop.ShopId,
globalContext.User.Shop.ShopName,
globalContext.User.Shop.AppKey,
globalContext.User.Shop.AppSecret,
globalContext.User.Shop.AppToken
Platform = purchaseAccount.PurchasePlatformId,
purchaseAccount.AppKey,
purchaseAccount.AppSecret,
purchaseAccount.AppToken,
}, null, HttpMethod.Post);
}

2
BBWY.Client/BBWYAppSettings.json

@ -1,5 +1,5 @@
{
//"BBWYApiHost": "http://localhost:5000",
// "BBWYApiHost": "http://localhost:5000",
"BBWYApiHost": "http://bbwytest.qiyue666.com",
"MDSApiHost": "http://mdsapi.qiyue666.com",
"JOSApiHost": "",

10
BBWY.Client/Converters/EnumToColorConverter.cs

@ -20,16 +20,20 @@ namespace BBWY.Client.Converters
if (value == null) return DependencyProperty.UnsetValue;
Assembly assem = Assembly.GetExecutingAssembly();
Type type = assem.GetType(parameter.ToString());
var enumName = Enum.Parse(type, value.ToString());
if (value.ToString() == TaskState..GetName())
if (enumName == null) return DependencyProperty.UnsetValue;
int enumIndex = (int)enumName;
if ((enumIndex == 0))
{
return "#C1FFC1";
}
if (value.ToString() == "部分到货")
if (enumIndex == 1)
{
return "#FFDEAD";
}
if (value.ToString() == "未到货")
if(enumIndex==2)
{
return "#FFDAB9";

50
BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs

@ -24,33 +24,41 @@ namespace BBWY.Client.Models
{
#region 属性
private bool isSelected;
public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } }
private ObservableCollection<ComboBoxItem> positionTypeList = new ObservableCollection<ComboBoxItem> {
new ComboBoxItem{IsSelected = false,Content = "本地仓"}, new ComboBoxItem{IsSelected = false,Content = "齐越仓"}, new ComboBoxItem{IsSelected = false,Content = "京东仓"}
};
public ObservableCollection<ComboBoxItem> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } }
private ObservableCollection<ComboBoxItem> packTypeList = new ObservableCollection<ComboBoxItem> {
new ComboBoxItem{ Content="单件",IsSelected=false }, new ComboBoxItem{ Content="多件",IsSelected=false }
private ObservableCollection<string> worryList = new ObservableCollection<string> {
"否","是"
};
public ObservableCollection<ComboBoxItem> PackTypeList { get => packTypeList; set { Set(ref packTypeList, value); } }
private ObservableCollection<ComboBoxItem> basicPackList = new ObservableCollection<ComboBoxItem> {
new ComboBoxItem{ Content="快递袋",IsSelected=false }, new ComboBoxItem{ Content="纸箱",IsSelected=false }, new ComboBoxItem{ Content="麻袋",IsSelected=false }
public ObservableCollection<string> WorryList { get => worryList; set { Set(ref worryList, value); } }
private ObservableCollection<string> positionTypeList = new ObservableCollection<string> {
"本地仓","齐越仓", "京东仓"};
public ObservableCollection<string> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } }
private ObservableCollection<string> packTypeList = new ObservableCollection<string> {
"单件","多件"
};
public ObservableCollection<ComboBoxItem> BasicPackList { get => basicPackList; set { Set(ref basicPackList, value); } }
private ObservableCollection<ComboBoxItem> isNeedBarCodeList = new ObservableCollection<ComboBoxItem> {
new ComboBoxItem{IsSelected = false,Content = "需要"}, new ComboBoxItem{IsSelected = false,Content = "不需要"}};
public ObservableCollection<ComboBoxItem> IsNeedBarCodeList { get => isNeedBarCodeList; set { Set(ref isNeedBarCodeList, value); } }
public ObservableCollection<string> PackTypeList { get => packTypeList; set { Set(ref packTypeList, value); } }
private ObservableCollection<ComboBoxItem> certificatePositionList = new ObservableCollection<ComboBoxItem> {
new ComboBoxItem{ Content="无",IsSelected=false }, new ComboBoxItem{ Content="外部包装",IsSelected=false }, new ComboBoxItem{ Content="产品包装",IsSelected=false }
private ObservableCollection<string> basicPackList = new ObservableCollection<string> {
"快递袋","纸箱","麻袋"
};
public ObservableCollection<string> BasicPackList { get => basicPackList; set { Set(ref basicPackList, value); } }
private ObservableCollection<string> isNeedBarCodeList = new ObservableCollection<string> {
"需要", "不需要" };
public ObservableCollection<string> IsNeedBarCodeList { get => isNeedBarCodeList; set { Set(ref isNeedBarCodeList, value); } }
private ObservableCollection<string> certificatePositionList = new ObservableCollection<string> {
"无","外部包装","产品包装"
};
public ObservableCollection<ComboBoxItem> CertificatePositionList { get => certificatePositionList; set { Set(ref certificatePositionList, value); } }
private ObservableCollection<ComboBoxItem> availabilityList = new ObservableCollection<ComboBoxItem> {
new ComboBoxItem{ Content="已到货",IsSelected=false }, new ComboBoxItem{ Content="部分到货",IsSelected=false }, new ComboBoxItem{ Content="未到货",IsSelected=false }
public ObservableCollection<string> CertificatePositionList { get => certificatePositionList; set { Set(ref certificatePositionList, value); } }
private ObservableCollection<string> availabilityList = new ObservableCollection<string> {
"已到货","部分到货","未到货"
};
public ObservableCollection<ComboBoxItem> AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } }
public ObservableCollection<string> AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } }
private int skuCount;
/// <summary>

54
BBWY.Client/Models/PackTask/PackTaskModel.cs

@ -27,10 +27,8 @@ namespace BBWY.Client.Models
private long id;
public long Id { get => id; set { Set(ref id, value); } }
private readonly PackTaskService packTaskService;
readonly WorkProcessService workProcessService;
readonly IncreateServiceService increateServiceService;
public ICommand SetTaskStatusCommand { get; set; }
public ICommand PrintBarcodeCommand { get; set; }
public ICommand PrintCerCommand { get; set; }
@ -38,31 +36,17 @@ namespace BBWY.Client.Models
public ICommand LookBarCommand { get; set; }
public ICommand SetServiceCommand { get; set; }
public ConsumableService consumableService;
/// <summary>
/// 修改任务
/// </summary>
public ICommand UpdateTaskCommand { get; set; }
/// <summary>
/// 删除任务
/// </summary>
public ICommand DeletedTaskCommand { get; set; }
public Action ReflashTask { get; set; }
private void DeletedTask()
{
MessageBoxResult result = MessageBox.Show("确定删除?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes) return;
packTaskService.DeletedTask(TaskId);
if (ReflashTask != null)
ReflashTask();//刷新界面
}
private void UpdateTask()
{
@ -83,21 +67,14 @@ namespace BBWY.Client.Models
public PackTaskModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService)
public PackTaskModel()
{
SetTaskStatusCommand = new RelayCommand<long>(SetTaskStatus);
PrintBarcodeCommand = new RelayCommand(PrintBarcode);
PrintCerCommand = new RelayCommand(PrintCer);
LookBarCommand = new RelayCommand(LookBar);
LookCerCommand = new RelayCommand(LookCer);
SetServiceCommand = new RelayCommand(SetService);
UpdateTaskCommand = new RelayCommand(UpdateTask);
DeletedTaskCommand = new RelayCommand(DeletedTask);
this.packTaskService = packTaskService;
this.consumableService = consumableService;
this.workProcessService = workProcessService;
this.increateServiceService = increateServiceService;
}
private void SetService()
@ -200,26 +177,7 @@ namespace BBWY.Client.Models
//printWindow.Datas = LoadBarLabelModels();
printWindow.Show();
}
public void SetTaskStatus(long taskId)
{
if (this.TaskStatus == TaskStateType.)
{
return;
}
///修改完成
var model = packTaskService.UpdateTaskStatus(taskId, 1,"");
if (model != null && model.Success)
{
//var res = batchPurchaseService.UpdatePurchaseOrderState(id, Models.PurchaseOrderState.已完成 );
this.TaskStatus = TaskStateType.;
new TipsWindow("修改成功").Show();
}
}
/*
public Dictionary<string, string> LoadBarLabelModels()
{

15
BBWY.Client/ViewModels/BatchPurchase/BatchPurchaseOrderListViewModel.cs

@ -139,7 +139,13 @@ namespace BBWY.Client.ViewModels
var res = batchPurchaseService.CancelOrder(parameters[1].ToString(), purchaseAccount, "");
if (res.Success)
{
Task.Factory.StartNew(() => QueryPurchaseOrder(PageIndex));
if (res.Data.Success)
{
Task.Factory.StartNew(() => QueryPurchaseOrder(PageIndex));
return;
}
MessageBox.Show(res.Data.Msg);
return;
}
if (res.Data != null)
@ -162,7 +168,12 @@ namespace BBWY.Client.ViewModels
var res = batchPurchaseService.PayOrder(parameters[1].ToString(), PurchasePlatform, purchaseAccount);
if (res.Success)
{
Task.Factory.StartNew(() => QueryPurchaseOrder(PageIndex));
if (res.Data.Success)
{
Task.Factory.StartNew(() => QueryPurchaseOrder(PageIndex));
return;
}
MessageBox.Show(res.Data.Msg);
return;
}
if (res.Data != null)

208
BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs

@ -24,6 +24,9 @@ namespace BBWY.Client.ViewModels.PackTask
public class CreatePackTaskViewModel : BaseVM, IDenpendency
{
#region 属性
private bool isSelected;
public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } }
private bool isLoading = false;
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } }
@ -82,12 +85,6 @@ namespace BBWY.Client.ViewModels.PackTask
public string SkuName { get => skuName; set { Set(ref skuName, value); } }
//private long barCodeId;
///// <summary>
///// 条形码id
///// </summary>
//public long BarCodeId { get => barCodeId; set { Set(ref barCodeId, value); } }
private string brand;
/// <summary>
/// 品牌
@ -131,12 +128,6 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public int GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } }
private DateTime endTime;
/// <summary>
/// 提交时间
/// </summary>
public DateTime EndTime { get => endTime; set { Set(ref endTime, value); } }
private long taskId;
/// <summary>
@ -173,14 +164,6 @@ namespace BBWY.Client.ViewModels.PackTask
public TaskState Availability { get => availability; set { Set(ref availability, value); } }
private int taskStatus;
/// <summary>
/// 任务状态(已完成=0,未完成=1)
/// </summary>
public int TaskStatus { get => taskStatus; set { Set(ref taskStatus, value); } }
private PackType packType;
/// <summary>
/// 打包类型(单件=0,多件=1)
@ -295,7 +278,7 @@ namespace BBWY.Client.ViewModels.PackTask
private string saveTask;
/// <summary>
/// 设置显示(合格证)
/// 发布按钮(发布/保存)
/// </summary>
public string SaveTask { get => saveTask; set { Set(ref saveTask, value); } }
@ -337,6 +320,8 @@ namespace BBWY.Client.ViewModels.PackTask
/// 注意事项(对接备注)
/// </summary>
public string MarkMessage { get => markMessage; set { Set(ref markMessage, value); } }
#endregion
@ -491,16 +476,16 @@ namespace BBWY.Client.ViewModels.PackTask
this.globalContext = globalContext;
SetBarCodeCommand = new RelayCommand(SetBarCode);
SetCertificateCommand = new RelayCommand(SetCertificate);
SaveBarCodeCommand = new RelayCommand(SaveBarCode);
//SaveBarCodeCommand = new RelayCommand(SaveBarCode);
SetSpuCerCommand = new RelayCommand(SetSpuCer);
SaveSpuCerCommand = new RelayCommand(SaveSpuCer);
InseartCerCommand = new RelayCommand(InseartCer);
//SetSpuCerCommand = new RelayCommand(SetSpuCer);
//SaveSpuCerCommand = new RelayCommand(SaveSpuCer);
//InseartCerCommand = new RelayCommand(InseartCer);
SaveCerCommand = new RelayCommand(SaveCer);
//SaveCerCommand = new RelayCommand(SaveCer);
BarLabelCheckCommand = new RelayCommand<BarcodeLabelModel>(BarLabelCheck);
CerLabelCheckCommand = new RelayCommand<CertificateLabelModel>(CerLabelCheck);
SpuCerLabelCheckCommand = new RelayCommand<CertificateLabelModel>(SpuCerLabelCheck);
//CerLabelCheckCommand = new RelayCommand<CertificateLabelModel>(CerLabelCheck);
//SpuCerLabelCheckCommand = new RelayCommand<CertificateLabelModel>(SpuCerLabelCheck);
LookBarCommand = new RelayCommand(LookBar);
@ -511,84 +496,84 @@ namespace BBWY.Client.ViewModels.PackTask
BarLabelCheck(BarcodeLabelModel.);//默认精简模式
}
private void InseartCer()
{
if (IsSetSpuCertificate)
{
new TipsWindow("无可用模板").Show();
return;
}
CertificateModel = new CertificateModel()
{
//SpuId = SpuCertificateModel.SpuId,
SkuId = SkuId,
Brand = SpuCertificateModel.Brand,
BrandName = SpuCertificateModel.BrandName,
ExcuteStander = SpuCertificateModel.ExcuteStander,
FactoryNumber = SpuCertificateModel.FactoryNumber,
IsLogo = SpuCertificateModel.IsLogo,
LabelModel = SpuCertificateModel.LabelModel,
ProductAdress = SpuCertificateModel.ProductAdress,
ProductNo = SpuCertificateModel.ProductNo,
Shader = SpuCertificateModel.Shader,
ProductShop = SpuCertificateModel.ProductShop,
ApplyAge = SpuCertificateModel.ApplyAge,
};
}
private void SetSpuCer()
{
if (SpuCertificateModel == null)
{
SpuCertificateModel = new CertificateModel();
SpuCertificateModel.ProductNo = ProductNo;
SpuCertificateModel.Brand = Brand;
SpuCertificateModel.SkuId = SkuId;
}
if (!string.IsNullOrEmpty(BrandName))
SpuCertificateModel.BrandName = BrandName;
setSpuCerWindow = new SetSpuCerWindow();
setSpuCerWindow.Show();
}
private void SaveSpuCer()
{
if (string.IsNullOrEmpty(SpuCertificateModel.ExcuteStander)
|| string.IsNullOrEmpty(SpuCertificateModel.BrandName)
|| string.IsNullOrEmpty(SpuCertificateModel.Brand) || string.IsNullOrEmpty(SpuCertificateModel.ProductShop)
|| string.IsNullOrEmpty(SpuCertificateModel.ProductAdress))
{
new TipsWindow("参数出错!请重新填写!").Show();
return;
}
var resData = packTaskService.SaveSpuCer(new CerRequest
{
Brand = SpuCertificateModel.Brand,
BrandName = SpuCertificateModel.BrandName,
ProductNo = SpuCertificateModel.ProductNo,
SpuId = SpuCertificateModel.SpuId,
ExcuteStander = SpuCertificateModel.ExcuteStander,
LabelModel = (int)SpuCertificateModel.LabelModel,
FactoryNumber = SpuCertificateModel.FactoryNumber,
IsLogo = SpuCertificateModel.IsLogo,
ProductAdress = SpuCertificateModel.ProductAdress,
ProductShop = SpuCertificateModel.ProductShop,
Shader = SpuCertificateModel.Shader,
SkuId = SpuCertificateModel.SkuId,
ApplyAge = SpuCertificateModel.ApplyAge,
});
if (resData == null || !resData.Success)
{
IsSetSpuCertificate = false;
return;
}
IsSetSpuCertificate = false;
setSpuCerWindow.Close();
}
//private void InseartCer()
//{
// if (IsSetSpuCertificate)
// {
// new TipsWindow("无可用模板").Show();
// return;
// }
// CertificateModel = new CertificateModel()
// {
// //SpuId = SpuCertificateModel.SpuId,
// SkuId = SkuId,
// Brand = SpuCertificateModel.Brand,
// BrandName = SpuCertificateModel.BrandName,
// ExcuteStander = SpuCertificateModel.ExcuteStander,
// FactoryNumber = SpuCertificateModel.FactoryNumber,
// IsLogo = SpuCertificateModel.IsLogo,
// LabelModel = SpuCertificateModel.LabelModel,
// ProductAdress = SpuCertificateModel.ProductAdress,
// ProductNo = SpuCertificateModel.ProductNo,
// Shader = SpuCertificateModel.Shader,
// ProductShop = SpuCertificateModel.ProductShop,
// ApplyAge = SpuCertificateModel.ApplyAge,
// };
//}
//private void SetSpuCer()
//{
// if (SpuCertificateModel == null)
// {
// SpuCertificateModel = new CertificateModel();
// SpuCertificateModel.ProductNo = ProductNo;
// SpuCertificateModel.Brand = Brand;
// SpuCertificateModel.SkuId = SkuId;
// }
// if (!string.IsNullOrEmpty(BrandName))
// SpuCertificateModel.BrandName = BrandName;
// setSpuCerWindow = new SetSpuCerWindow();
// setSpuCerWindow.Show();
//}
//private void SaveSpuCer()
//{
// if (string.IsNullOrEmpty(SpuCertificateModel.ExcuteStander)
// || string.IsNullOrEmpty(SpuCertificateModel.BrandName)
// || string.IsNullOrEmpty(SpuCertificateModel.Brand) || string.IsNullOrEmpty(SpuCertificateModel.ProductShop)
// || string.IsNullOrEmpty(SpuCertificateModel.ProductAdress))
// {
// new TipsWindow("参数出错!请重新填写!").Show();
// return;
// }
// var resData = packTaskService.SaveSpuCer(new CerRequest
// {
// Brand = SpuCertificateModel.Brand,
// BrandName = SpuCertificateModel.BrandName,
// ProductNo = SpuCertificateModel.ProductNo,
// SpuId = SpuCertificateModel.SpuId,
// ExcuteStander = SpuCertificateModel.ExcuteStander,
// LabelModel = (int)SpuCertificateModel.LabelModel,
// FactoryNumber = SpuCertificateModel.FactoryNumber,
// IsLogo = SpuCertificateModel.IsLogo,
// ProductAdress = SpuCertificateModel.ProductAdress,
// ProductShop = SpuCertificateModel.ProductShop,
// Shader = SpuCertificateModel.Shader,
// SkuId = SpuCertificateModel.SkuId,
// ApplyAge = SpuCertificateModel.ApplyAge,
// });
// if (resData == null || !resData.Success)
// {
// IsSetSpuCertificate = false;
// return;
// }
// IsSetSpuCertificate = false;
// setSpuCerWindow.Close();
//}
private void OnSearchIncreateKeyWordChanged(string key)
{
@ -649,16 +634,7 @@ namespace BBWY.Client.ViewModels.PackTask
});
look.Show();
}
private void SpuCerLabelCheck(CertificateLabelModel cer)
{
SpuCertificateModel.LabelModel = cer;
SpuCertificateModel.IsLogo = cer == CertificateLabelModel.3c ? 1 : 0;
}
private void CerLabelCheck(CertificateLabelModel cer)
{
CertificateModel.LabelModel = cer;
CertificateModel.IsLogo = cer == CertificateLabelModel.3c ? 1 : 0;
}
/// <summary>
///
/// </summary>

32
BBWY.Client/ViewModels/PackTask/PackTaskTotalViewModel.cs

@ -5,6 +5,7 @@ using BBWY.Client.Models;
using BBWY.Client.Models.PackTask;
using BBWY.Client.Views.Order;
using BBWY.Client.Views.PackTask;
using BBWY.Common.Extensions;
using BBWY.Common.Models;
using BBWY.Controls;
using GalaSoft.MvvmLight.Command;
@ -72,16 +73,19 @@ namespace BBWY.Client.ViewModels.PackTask
public ICommand BatchCheckedCommand { get; set; }
//public IList<Department> departmentList;
//ShopService shopService;
public PackTaskTotalViewModel(PackTaskService packTaskService)
{
this.packTaskService = packTaskService;
SearchTaskTotalCommand = new RelayCommand(SearchTaskTotal);
//this.shopService = shopService;
SearchTaskTotalCommand = new RelayCommand(() =>
{
SearchTask(1);
});
StartDate = DateTime.Now;
EndDate = DateTime.Now;
EndDate = DateTime.Now;
SetSearchDateCommand = new RelayCommand<int>(d =>
{
@ -102,6 +106,24 @@ namespace BBWY.Client.ViewModels.PackTask
ExportCommand = new RelayCommand(Export);
SearchTaskTotal();
//LoadShopList();
}
private void LoadShopList()
{
//departmentList=new List<Department>();
//var response = shopService.GetDepartmentList();
//if (!response.Success)
// throw new Exception(response.Msg);
//departmentList = response.Data.Map<IList<Department>>();
//var shopList = new List<Shop>();
//foreach (var d in departmentList)
// shopList.AddRange(d.ShopList);
}
private void Export()

53
BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs

@ -127,6 +127,11 @@ namespace BBWY.Client.ViewModels.PackTask
public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, ProductService productService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService)
{
this.globalContext = globalContext;
this.productService = productService;
this.consumableService = consumableService;
this.workProcessService = workProcessService;
this.increateServiceService = increateServiceService;
this.packTaskService = packTaskService;
//TaskState = BBWY.Client.Models. TaskState.全部;
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
@ -144,35 +149,28 @@ namespace BBWY.Client.ViewModels.PackTask
});
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail);
CopyTextCommand = new RelayCommand<object>(s =>
{
try
{
Clipboard.SetText(s.ToString());
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(ex);
Console.ResetColor();
}
});
DeletedTaskCommand = new RelayCommand<object>(DeletedTask);
StartTime = DateTime.Now.Date;
EndTime = DateTime.Now.Date;
IsLoading = false;
//加载数据
SetTaskState(Models.TaskState.);
this.globalContext = globalContext;
this.productService = productService;
this.consumableService = consumableService;
this.workProcessService = workProcessService;
this.increateServiceService = increateServiceService;
}
private void DeletedTask(object obj)
{
MessageBoxResult result = MessageBox.Show("确定删除?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
long taskId = (long)obj;
if (result != MessageBoxResult.Yes) return;
packTaskService.DeletedTask(taskId);
Task.Factory.StartNew(() => SearchTaskList());
}
private void IsLoadCount()
@ -227,11 +225,11 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public ICommand OpenSkuDetailCommand { get; set; }
/// <summary>
/// 复制
/// 删除任务
/// </summary>
public ICommand CopyTextCommand { get; set; }
public ICommand DeletedTaskCommand { get; set; }
public void SetTaskState(TaskState? taskState)
{
@ -293,7 +291,7 @@ namespace BBWY.Client.ViewModels.PackTask
foreach (var item in dataModel.Items)
{
var data = new PackTaskModel(packTaskService, consumableService, workProcessService, increateServiceService)
var data = new PackTaskModel()
{
Brand = item.Brand,
SkuId = item.SkuId,
@ -322,10 +320,7 @@ namespace BBWY.Client.ViewModels.PackTask
TaskId = item.TaskId,
TaskStatus = (TaskStateType)item.TaskStatus,
EndTime = item.CreateTime,
IsWorry = (Worry)item.IsWorry
IsWorry = (Worry)item.IsWorry,
};
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
{

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

@ -190,14 +190,6 @@ namespace BBWY.Client.ViewModels.PackTask
this.productService = productService;
this.batchPurchaseService = batchPurchaseService;
}
#region 事件绑定
public ICommand SetTaskStatusCommand { get; set; }
@ -241,7 +233,7 @@ namespace BBWY.Client.ViewModels.PackTask
string orderId=(string)objList[1];
///修改完成
var model = packTaskService.UpdateTaskStatus(taskId, 1,orderId);
if (model != null && model.Success&&!string.IsNullOrEmpty(orderId))
if (model != null && model.Success)
SearchTaskList();
}
@ -297,7 +289,7 @@ namespace BBWY.Client.ViewModels.PackTask
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.Items)
{
var data = new PackTaskModel(packTaskService, consumableService, workProcessService, increateServiceService)
var data = new PackTaskModel()
{
AcceptName = item.UserName,
Availability = (TaskState)item.Availability,
@ -326,9 +318,8 @@ namespace BBWY.Client.ViewModels.PackTask
EndTime = item.CreateTime,
OrderId= item.OrderId,
SkuId = item.SkuId,
SkuName = item.SkuName,
};
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
{
@ -420,14 +411,5 @@ namespace BBWY.Client.ViewModels.PackTask
#endregion
}
}

7
BBWY.Client/Views/BatchPurchase/BatchPublishTaskWindow.xaml

@ -128,9 +128,8 @@
</ComboBox>
<TextBlock Margin="30 0 0 0" Text="加急:" VerticalAlignment="Center"/>
<ComboBox VerticalContentAlignment="Center" Text="{Binding IsWorry}" >
<ComboBoxItem Content="否" IsSelected="True" />
<ComboBoxItem Content="是"/>
<ComboBox VerticalContentAlignment="Center" ItemsSource="{Binding WorryList}" Text="{Binding IsWorry}" >
</ComboBox>
</StackPanel>
@ -189,7 +188,7 @@
<Grid Grid.Row="1" Grid.Column="0" >
<ComboBox VerticalContentAlignment="Center" Margin="5" ItemsSource="{Binding PackTypeList}" Text="{Binding PackType}" >
<ComboBox VerticalContentAlignment="Center" Margin="5" ItemsSource="{Binding PackTypeList}" Text="{Binding PackType}" >
</ComboBox>
</Grid>

13
BBWY.Client/Views/PackTask/PackTaskTotal.xaml

@ -24,6 +24,12 @@
</Page.Resources>
<Grid>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<StackPanel Background="Black" Panel.ZIndex="100" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="572,13,0,0" Width="140">
<c:BTextBox x:Name="tbDepartment" Width="140" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></c:BTextBox>
<ListBox MaxHeight="300" x:Name="tipBoxDepartment" SelectionChanged="SelectionChangeCommand" Background="{StaticResource Border.Background}">
</ListBox>
</StackPanel>
<Grid Margin="5,0">
<Grid.RowDefinitions>
<RowDefinition Height="90"/>
@ -31,7 +37,6 @@
<RowDefinition/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Left" Height="75" Panel.ZIndex="999">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@ -52,11 +57,11 @@
<DatePicker SelectedDate="{Binding StartDate}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="5,0,0,0"/>
<DatePicker SelectedDate="{Binding EndDate}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="5,0,0,0"/>
<TextBlock Text="任务ID:" Width="40" VerticalAlignment="Center" Margin="5,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" Text="{Binding SearchTaskId}" WaterRemark="精确匹配"/>
<c:BTextBox Width="150" Margin="5,0,0,0" Text="{Binding SearchTaskId}" />
<TextBlock Text="部门:" VerticalAlignment="Center" Margin="5,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" WaterRemark="精确匹配" Text="{Binding SearchDepartment}"/>
<c:BTextBox Margin="5,0,0,0" Width="140" />
<TextBlock Text="店铺:" VerticalAlignment="Center" Margin="5,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" Text="{Binding SearchShopName}" WaterRemark="精确匹配"/>
<c:BTextBox Width="150" Margin="5,0,0,0" Text="{Binding SearchShopName}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0,0,0,5" Height="30">
<c:BButton Content="今天" Width="50" Height="25" Margin="5,0,0,0"

117
BBWY.Client/Views/PackTask/PackTaskTotal.xaml.cs

@ -1,5 +1,14 @@
using System;
using BBWY.Client.APIServices;
using BBWY.Client.Helpers;
using BBWY.Client.Models.PackTask;
using BBWY.Client.ViewModels;
using BBWY.Common.Models;
using HandyControl.Controls;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@ -21,6 +30,112 @@ namespace BBWY.Client.Views.PackTask
public PackTaskTotal()
{
InitializeComponent();
this.Loaded += Load;
}
public ShopService shopService;
private void Load(object sender, RoutedEventArgs e)
{
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var builder = new ConfigurationBuilder().SetBasePath(applicationPath).AddJsonFile("BBWYAppSettings.json", false, true);
var Configuration = builder.Build();
QKApiHost = Configuration.GetSection("QKApiHost").Value;
HttpClientHelper helper = new HttpClientHelper(QKApiHost);
string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
var data = helper.Get(url);
var res = JsonConvert.DeserializeObject<ApiResponse<UserDepartment[]>>(data);
//创建一个ListBoxIem
if (res.Success)
{
if (res.Data != null && res.Data.Length > 0)
{
foreach (var department in res.Data)
{
if (!departments.Contains(department.DePartmentName))
{
departments.Add(department.DePartmentName);
}
}
}
}
}
public string QKApiHost { get; set; }
public void SelectionChangeCommand(object sender, SelectionChangedEventArgs e)
{
try
{
var list = (ListBox)sender;
if (list.Items.Count <= 0)
{
return;
}
var value = (ListBoxItem)list.SelectedValue;
var content = (Label)value.Content;
tbDepartment.Text = content.Content.ToString();
tipBoxDepartment.Visibility = Visibility.Collapsed;
}
catch (Exception)
{
}
}
List<string> departments = new List<string>();
private void tb_TextChanged(object sender, TextChangedEventArgs e)
{
try
{
var textBoxt = (System.Windows.Controls.TextBox)sender;
//创建一个ListBox
if (tipBoxDepartment != null && tipBoxDepartment.Items.Count > 0)
{
tipBoxDepartment.Items.Clear();
}
if (departments.Count <= 0)
return;
if (string.IsNullOrEmpty(textBoxt.Text))
{
tipBoxDepartment.Visibility = Visibility.Collapsed;
return;
}
foreach (var department in departments)
{
if (department.Contains(textBoxt.Text))
{
ListBoxItem item = new ListBoxItem();
Label lb = new Label();
lb.Content = department;
item.Content = lb;
tipBoxDepartment.Items.Add(item);
}
}
tipBoxDepartment.Visibility = Visibility.Visible;
}
catch (Exception)
{
}
}
}
}

2
BBWY.Client/Views/PackTask/PrintWindow.xaml

@ -229,8 +229,6 @@
Height="44" Text="{Binding ProductAdress}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/>
</Grid>
</Border>
</Grid>
</Grid>

2
BBWY.Client/Views/PackTask/SetBarCode.xaml

@ -137,6 +137,6 @@
<Border Grid.Row="2" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Background}" BorderThickness="1"/>
<c:BButton Background="{StaticResource Button.Background}" Grid.Row="2" Content="保存" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch"
Command="{Binding SaveBarCodeCommand}" Click="BButton_Click" />
Click="BButton_Click" />
</Grid>
</c:BWindow>

29
BBWY.Client/Views/PackTask/SetBarCode.xaml.cs

@ -2,6 +2,7 @@
using BBWY.Client.Models;
using BBWY.Client.Models.APIModel.Request;
using BBWY.Controls;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Text;
@ -19,14 +20,14 @@ namespace BBWY.Client.Views.PackTask
/// <summary>
/// SetBarCode.xaml 的交互逻辑
/// </summary>
public partial class SetBarCodeWindow : BWindow
public partial class SetBarCodeWindow : BWindow
{
public SetBarCodeWindow()
{
InitializeComponent();
BarLabelCheckCommand = new RelayCommand<BarcodeLabelModel>(BarLabelCheck);
}
public void LoadData(BarCodeModel barCodeModel,PackTaskService PackTaskService)
public void LoadData(BarCodeModel barCodeModel, PackTaskService PackTaskService)
{
BarCodeModel = barCodeModel; packTaskService = PackTaskService;
this.DataContext = this;
@ -36,6 +37,9 @@ namespace BBWY.Client.Views.PackTask
public PackTaskService packTaskService { get; set; }
public Action<BarCodeModel> SaveResult { get; set; }
private void BButton_Click(object sender, RoutedEventArgs e)
{
if (BarCodeModel.LabelModel == BarcodeLabelModel.)//标准版 判断数据是否异常
@ -68,13 +72,26 @@ namespace BBWY.Client.Views.PackTask
BarCodeModel.Id = resData.Data;
if (SaveResult != null)
SaveResult(BarCodeModel);
// IsNeedBarCode = "需要";
//IsSetBarCode = false;
// setBarCodeWindow.Close();
// IsNeedBarCode = "需要";
//IsSetBarCode = false;
// setBarCodeWindow.Close();
this.Close();
}
public ICommand BarLabelCheckCommand { get; set; }
public void BarLabelCheck(BarcodeLabelModel labelModel)
{
if (labelModel == BarcodeLabelModel.)//标准版 判断数据是否异常
{
if (string.IsNullOrEmpty(BarCodeModel.ProductNo) || BarCodeModel.ProductNo == "待填写")
{
TipsWindow tips = new TipsWindow("该SKU无货号信息,将影响条形码打印\r\n请先设置好货号信息或调整打印模板类型");
tips.ShowDialog();
}
}
}
}
}

12
BBWY.Client/Views/PackTask/SetCerControl.xaml.cs

@ -28,8 +28,6 @@ namespace BBWY.Client.Views.PackTask
InitializeComponent();
}
//CertificateModel
public CertificateModel model
@ -62,22 +60,12 @@ namespace BBWY.Client.Views.PackTask
private static void ChangedProperty(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = d as SetCerControl;
var newValue = e.NewValue as CertificateModel;
if (control != null && newValue != null)
{
control.model = newValue;
//control.DataContext = newValue;
//control.OnPropertyChanged(e);
}
}
private void RadioButton_Checked(object sender, RoutedEventArgs e)

96
BBWY.Client/Views/PackTask/SetCerWindow.xaml

@ -35,103 +35,15 @@
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<c:BButton Name="SetSpuCer" Background="{StaticResource Button.Background}" Grid.Row="2" Content="{Binding SetSpuCerStatus}" HorizontalAlignment="Right" Width="100" Margin="20,0,20,0" VerticalAlignment="Stretch"
Command="{Binding SetSpuCerCommand}" Click="SetSpuCer_Click" />
<c:BButton Name="SetSpuCer" Background="{StaticResource Button.Background}" Grid.Row="2" HorizontalAlignment="Right" Width="100" Margin="20,0,20,0" VerticalAlignment="Stretch"
Click="SetSpuCer_Click" />
<c:BButton Name="InseartCer" Background="{StaticResource Button.Background}" Grid.Row="2" Content="导入spu模板" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch"
Command="{Binding InseartCerCommand}" Click="InseartCer_Click" />
Click="InseartCer_Click" />
</StackPanel>
<!--<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid >
IsChecked="{Binding IsLogo,Converter={StaticResource objConverter},ConverterParameter=0:true:false}"
<RadioButton GroupName="cer" IsChecked="{Binding CertificateModel.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.标准无3c}}" Command="{Binding CerLabelCheckCommand}" CommandParameter="{x:Static cmodel:CertificateLabelModel.标准无3c}" Content="标准" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="13,30,13,0" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid>
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Text="合格证" FontSize="18" Margin="157,12" />
<TextBlock Text="品牌:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,70" />
<c:BTextBox Height="25" Text="{Binding CertificateModel.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,65"/>
<TextBlock Text="型号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,70,0,0" />
<c:BTextBox Height="25" Text="{Binding CertificateModel.ProductNo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,65,0,0"/>
<TextBlock Text="品名:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,112,0,0" />
<c:BTextBox Height="25" Text="{Binding CertificateModel.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,107,0,0"/>
<TextBlock Text="材质:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,112,0,0" />
<c:BTextBox Height="25" Text="{Binding CertificateModel.Shader,Mode=TwoWay}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,107,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,166,0,0" />
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Height="25" Text="{Binding CertificateModel.ExcuteStander,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,161,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox Height="25" Text="{Binding CertificateModel.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,242,0,0" />
<TextBox TextWrapping ="Wrap" AcceptsReturn="True" Height="44" Text="{Binding CertificateModel.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/>
</Grid>
</Border>
</Grid>
<Grid Grid.Column="1">
IsChecked="{Binding IsLogo,Converter={StaticResource objConverter},ConverterParameter=1:true:false}"
<RadioButton GroupName="cer" IsChecked="{Binding CertificateModel.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.标准有3c}}" Command="{Binding CerLabelCheckCommand}" CommandParameter="{x:Static cmodel:CertificateLabelModel.标准有3c}" Content="带3c标" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="13,30,13,0" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid >
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Text="合格证" FontSize="18" Margin="157,12" />
<TextBlock Text="品牌:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,90" />
<c:BTextBox Text="{Binding CertificateModel.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,85"/>
<TextBlock Text="型号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,90,0,0" />
<c:BTextBox Text="{Binding CertificateModel.ProductNo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,85,0,0"/>
<TextBlock Text="品名:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,127,0,0" />
<c:BTextBox Text="{Binding CertificateModel.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,122,0,0"/>
<TextBlock Text="材质:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,127,0,0" />
<c:BTextBox Height="25" Text="{Binding CertificateModel.Shader,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,122,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,166,0,0" />
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Text="{Binding CertificateModel.ExcuteStander,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,161,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox Text="{Binding CertificateModel.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,242,0,0" />
<TextBox TextWrapping ="Wrap" AcceptsReturn="True" Text="{Binding CertificateModel.ProductAdress,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="44" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/>
<TextBlock Text="工厂编号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,60,0,0" />
<c:BTextBox Text="{Binding CertificateModel.FactoryNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="100" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="259,55,0,0"/>
<Image Source="pack://siteoforigin:,,,/Resources/Images/3c.png" Width="54" Height="42" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="282,6,0,0" />
</Grid>
</Border>
</Grid>
<Grid Grid.Row="1">
IsChecked="{Binding IsLogo,Converter={StaticResource objConverter},ConverterParameter=0:true:false}"
<RadioButton GroupName="cer" IsChecked="{Binding CertificateModel.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.无型号}}" Command="{Binding CerLabelCheckCommand}" CommandParameter="{x:Static cmodel:CertificateLabelModel.无型号}" Content="无型号" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="13,30,13,0" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid>
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Text="合格证" FontSize="18" Margin="157,12" />
<TextBlock Text="品牌:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,70" />
<c:BTextBox Height="25" Text="{Binding CertificateModel.Brand,Mode=TwoWay,NotifyOnTargetUpdated=True,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,65"/>
<TextBlock Text="品名:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,70,0,0" />
<c:BTextBox Height="25" Text="{Binding CertificateModel.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,65,0,0"/>
<TextBlock Text="材质:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,114,0,0" />
<c:BTextBox Height="26" Text="{Binding CertificateModel.Shader,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,108,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,166,0,0" />
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Height="25" Text="{Binding CertificateModel.ExcuteStander,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,161,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox Height="25" Text="{Binding CertificateModel.ProductShop,Mode=TwoWay,NotifyOnTargetUpdated=True,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,242,0,0" />
<TextBox TextWrapping ="Wrap" AcceptsReturn="True" Height="44" Text="{Binding CertificateModel.ProductAdress,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/>
</Grid>
</Border>
</Grid>
</Grid>-->
<local:SetCerControl Grid.Row="1" model="{Binding CertificateModel}"/>
</Grid>
<Border Grid.Row="2" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Background}" BorderThickness="1"/>
<c:BButton x:Name="save_btn" Background="{StaticResource Button.Background}" Grid.Row="2" Content="保存" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch"
Command="{Binding SaveCerCommand}" Click="save_btn_Click" />
Click="save_btn_Click" />
</Grid>
</c:BWindow>

1
BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs

@ -37,7 +37,6 @@ namespace BBWY.Client.Views.PackTask
this.IsSetSpuCertificate = IsSetSpuCertificate;
SetSpuCer.Content = IsSetSpuCertificate ? "设置spu模板" : "修改spu模板";
this.DataContext = this;
}
public bool IsSetSpuCertificate { get; set; }
public PackTaskService packTaskService { get; set; }

91
BBWY.Client/Views/PackTask/SetSpuCerWindow.xaml

@ -17,7 +17,7 @@
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!-- DataContext="{Binding CreateSetBarCodeView,Source={StaticResource Locator}}"-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
@ -30,94 +30,7 @@
</Border>
<local:SetCerControl Grid.Row="1" model="{Binding SpuCertificateModel}"/>
<!--<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid >
IsChecked="{Binding IsLogo,Converter={StaticResource objConverter},ConverterParameter=0:true:false}"
<RadioButton GroupName="cer" IsChecked="{Binding SpuCertificateModel.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.标准无3c}}" Command="{Binding SpuCerLabelCheckCommand}" CommandParameter="{x:Static cmodel:CertificateLabelModel.标准无3c}" Content="标准" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="13,30,13,0" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid>
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Text="合格证" FontSize="18" Margin="157,12" />
<TextBlock Text="品牌:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,70" />
<c:BTextBox Height="25" Text="{Binding SpuCertificateModel.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,65"/>
<TextBlock Text="型号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,70,0,0" />
<c:BTextBox Height="25" Text="{Binding SpuCertificateModel.ProductNo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,65,0,0"/>
<TextBlock Text="品名:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,112,0,0" />
<c:BTextBox Height="25" Text="{Binding SpuCertificateModel.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,107,0,0"/>
<TextBlock Text="材质:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,112,0,0" />
<c:BTextBox Height="25" Text="{Binding SpuCertificateModel.Shader,Mode=TwoWay}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,107,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,166,0,0" />
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Height="25" Text="{Binding SpuCertificateModel.ExcuteStander,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,161,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox Height="25" Text="{Binding SpuCertificateModel.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,242,0,0" />
<TextBox TextWrapping ="Wrap" AcceptsReturn="True" Height="44" Text="{Binding SpuCertificateModel.ProductAdress,Mode=TwoWay}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/>
</Grid>
</Border>
</Grid>
<Grid Grid.Column="1">
IsChecked="{Binding IsLogo,Converter={StaticResource objConverter},ConverterParameter=1:true:false}"
<RadioButton GroupName="cer" IsChecked="{Binding SpuCertificateModel.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.标准有3c}}" Command="{Binding SpuCerLabelCheckCommand}" CommandParameter="{x:Static cmodel:CertificateLabelModel.标准有3c}" Content="带3c标" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="13,30,13,0" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid >
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Text="合格证" FontSize="18" Margin="157,12" />
<TextBlock Text="品牌:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,90" />
<c:BTextBox Text="{Binding SpuCertificateModel.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,85"/>
<TextBlock Text="型号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,90,0,0" />
<c:BTextBox Text="{Binding SpuCertificateModel.ProductNo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,85,0,0"/>
<TextBlock Text="品名:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,127,0,0" />
<c:BTextBox Text="{Binding SpuCertificateModel.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,122,0,0"/>
<TextBlock Text="材质:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,127,0,0" />
<c:BTextBox Height="25" Text="{Binding SpuCertificateModel.Shader,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,122,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,166,0,0" />
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Text="{Binding SpuCertificateModel.ExcuteStander,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,161,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox Text="{Binding SpuCertificateModel.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,242,0,0" />
<TextBox TextWrapping ="Wrap" AcceptsReturn="True" Text="{Binding SpuCertificateModel.ProductAdress,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="44" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/>
<TextBlock Text="工厂编号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,60,0,0" />
<c:BTextBox Text="{Binding SpuCertificateModel.FactoryNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="100" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="259,55,0,0"/>
<Image Source="pack://siteoforigin:,,,/Resources/Images/3c.png" Width="54" Height="42" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="282,6,0,0" />
</Grid>
</Border>
</Grid>
<Grid Grid.Row="1">
IsChecked="{Binding IsLogo,Converter={StaticResource objConverter},ConverterParameter=0:true:false}"
<RadioButton GroupName="cer" IsChecked="{Binding SpuCertificateModel.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.无型号}}" Command="{Binding SpuCerLabelCheckCommand}" CommandParameter="{x:Static cmodel:CertificateLabelModel.无型号}" Content="无型号" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="13,30,13,0" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid>
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Text="合格证" FontSize="18" Margin="157,12" />
<TextBlock Text="品牌:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,70" />
<c:BTextBox Height="25" Text="{Binding SpuCertificateModel.Brand,Mode=TwoWay,NotifyOnTargetUpdated=True,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,65"/>
<TextBlock Text="品名:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,70,0,0" />
<c:BTextBox Height="25" Text="{Binding SpuCertificateModel.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,65,0,0"/>
<TextBlock Text="材质:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,114,0,0" />
<c:BTextBox Height="26" Text="{Binding SpuCertificateModel.Shader,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,108,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,166,0,0" />
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Height="25" Text="{Binding SpuCertificateModel.ExcuteStander,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,161,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox Height="25" Text="{Binding SpuCertificateModel.ProductShop,Mode=TwoWay,NotifyOnTargetUpdated=True,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,242,0,0" />
<TextBox TextWrapping ="Wrap" AcceptsReturn="True" Height="44" Text="{Binding SpuCertificateModel.ProductAdress,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/>
</Grid>
</Border>
</Grid>
</Grid>-->
<Border Grid.Row="2" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Background}" BorderThickness="1"/>
<c:BButton Name="save_spuCer" Background="{StaticResource Button.Background}" Grid.Row="2" Content="保存" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch"
Click="save_spuCer_Click" />

2
BBWY.Client/Views/PackTask/TaskListControl.xaml

@ -120,7 +120,7 @@
<StackPanel Grid.Column="11" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
<c:BButton Command="{Binding UpdateTaskCommand}"
Style="{StaticResource LinkButton}" Content="修改" />
<c:BButton Command="{Binding DeletedTaskCommand}"
<c:BButton Command="{Binding DataContext.DeletedTaskCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" CommandParameter="{Binding TaskId}"
Margin="5,0,0,0" Style="{StaticResource LinkButton}" Content="删除" />
</StackPanel>

2
BBWY.Client/Views/PackTask/WareHouseList.xaml

@ -59,8 +59,6 @@
<TextBlock Text="SKU:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" WaterRemark="" Text="{Binding SearchSkuId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Text="部门:" VerticalAlignment="Center" Margin="16,0,0,0"/>
</StackPanel>
<Grid Grid.Column="1" >

51
BBWY.Client/Views/PackTask/WareHouseList.xaml.cs

@ -32,14 +32,39 @@ namespace BBWY.Client.Views.PackTask
public WareHouseList()
{
InitializeComponent();
var applicationPath = System.IO. Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
this.Loaded += Load;
}
private void Load(object sender, RoutedEventArgs e)
{
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var builder = new ConfigurationBuilder().SetBasePath(applicationPath).AddJsonFile("BBWYAppSettings.json", false, true);
var Configuration = builder.Build();
var Configuration = builder.Build();
QKApiHost = Configuration.GetSection("QKApiHost").Value;
HttpClientHelper helper = new HttpClientHelper(QKApiHost);
string url = $"{QKApiHost}/api/PackTask/GetAllDepartment";//获取所有数据
var data = helper.Get(url);
var res = JsonConvert.DeserializeObject<ApiResponse<UserDepartment[]>>(data);
//创建一个ListBoxIem
if (res.Success)
{
if (res.Data != null && res.Data.Count() > 0)
{
foreach (var department in res.Data)
{
if (!departments.Contains(department.DePartmentName))
{
departments.Add(department.DePartmentName);
}
}
}
}
}
string QKApiHost = "";
public string QKApiHost {get;set;}
public void SelectionChangeCommand(object sender, SelectionChangedEventArgs e)
{
try
@ -57,12 +82,12 @@ namespace BBWY.Client.Views.PackTask
catch (Exception)
{
}
}
List<string> departments = new List<string>();
private void tb_TextChanged(object sender, TextChangedEventArgs e)
@ -78,7 +103,7 @@ namespace BBWY.Client.Views.PackTask
}
if (departments.Count<=0)
if (departments.Count <= 0)
{
HttpClientHelper helper = new HttpClientHelper(QKApiHost);
@ -98,8 +123,6 @@ namespace BBWY.Client.Views.PackTask
departments.Add(department.DePartmentName);
}
}
}
}
@ -120,7 +143,7 @@ namespace BBWY.Client.Views.PackTask
item.Content = lb;
tipBox.Items.Add(item);
}
}
tipBox.Visibility = Visibility.Visible;
@ -128,9 +151,9 @@ namespace BBWY.Client.Views.PackTask
catch (Exception)
{
}
}
}
}

10
BBWY.Server.Business/PlatformSDK/QuanTanBusiness.cs

@ -23,12 +23,12 @@ namespace BBWY.Server.Business
public override PayPurchaseOrderResponse PayPurchaseOrder(PayPurchaseOrderRequest payPurchaseOrderRequest)
{
var data = payPurchaseOrderRequest.PurchaseAccount;
var qtResponse = quanTanOrderClient.PayOrder(new QuanTanPayOrderRequest
{
orderId = payPurchaseOrderRequest.OrderId,
userAccount = data.AccountName
}, payPurchaseOrderRequest.PurchaseAccount.AppKey, payPurchaseOrderRequest.PurchaseAccount.AppSecret);
userAccount = payPurchaseOrderRequest.AppToken
}, payPurchaseOrderRequest.AppKey, payPurchaseOrderRequest.AppSecret);
if (qtResponse.Status == 200) return new PayPurchaseOrderResponse { Success = true, PurchaseOrderState= PurchaseOrderState. };
if (qtResponse.Message != null && qtResponse.Message.Contains("已支付"))
@ -36,8 +36,8 @@ namespace BBWY.Server.Business
var res = quanTanOrderClient.GetOrderDetail(new QuanTanGetOrderDetailRequest
{
orderId = payPurchaseOrderRequest.OrderId,
userAccount = data.AccountName
}, payPurchaseOrderRequest.PurchaseAccount.AppKey, payPurchaseOrderRequest.PurchaseAccount.AppSecret);
userAccount = payPurchaseOrderRequest.AppToken
}, payPurchaseOrderRequest.AppKey, payPurchaseOrderRequest.AppSecret);
if (res.Status == 200)
{
PurchaseOrderState purchaseOrder= PurchaseOrderState.;

2
BBWY.Server.Business/PurchaseOrderV2/BatchPurchase/BatchPurchaseBusiness.cs

@ -441,7 +441,7 @@ namespace BBWY.Server.Business
public PayPurchaseOrderResponse PayPurchaseOrder(PayPurchaseOrderRequest request)
{
var platformSDKBusiness = platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.PurchasePlatform);
var platformSDKBusiness = platformSDKBusinessList.FirstOrDefault(p => p.Platform == request.Platform);
var payOrderResponse = platformSDKBusiness.PayPurchaseOrder(request);
if (payOrderResponse.Success)

2
BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/CancelPurchaseOrderRequest.cs

@ -3,8 +3,6 @@
public class CancelPurchaseOrderRequest: PlatformRequest
{
public string OrderId { get; set; }
public string Remark { get; set; }
}
}

8
BBWY.Server.Model/Dto/Request/PurchaseOrderV2/BatchPurchase/PayPurchaseOrderRequest.cs

@ -8,13 +8,5 @@ namespace BBWY.Server.Model.Dto
public class PayPurchaseOrderRequest : PlatformRequest
{
public string OrderId { get; set; }
public PurchaseAccount PurchaseAccount { get; set; }
/// <summary>
/// 采购平台
/// </summary>
public Enums.Platform PurchasePlatform { get; set; }
}
}

Loading…
Cancel
Save