Browse Source

合并冲突

qianyi
连坤 林 2 years ago
parent
commit
378882cb2d
  1. 59
      BBWY.Client/APIServices/ConsumableService.cs
  2. 48
      BBWY.Client/APIServices/IncreateServiceService.cs
  3. 19
      BBWY.Client/APIServices/MdsApiService.cs
  4. 340
      BBWY.Client/APIServices/PackTaskService.cs
  5. 17
      BBWY.Client/APIServices/ProductService.cs
  6. 31
      BBWY.Client/APIServices/PurchaseOrderService.cs
  7. 56
      BBWY.Client/APIServices/WorkProcessService.cs
  8. 5
      BBWY.Client/App.xaml
  9. 30
      BBWY.Client/App.xaml.cs
  10. 38
      BBWY.Client/BBWY.Client.csproj
  11. 4
      BBWY.Client/BBWYAppSettings.json
  12. 52
      BBWY.Client/Converters/EnumToColorConverter.cs
  13. 30
      BBWY.Client/Converters/IntToStringConverter.cs
  14. 3
      BBWY.Client/Converters/ObjectConverter.cs
  15. 24
      BBWY.Client/Converters/StringToColorConvter.cs
  16. 2
      BBWY.Client/GlobalContext.cs
  17. 327
      BBWY.Client/Helpers/BartenderHelper.cs
  18. 122
      BBWY.Client/Helpers/HttpClientHelper.cs
  19. 51
      BBWY.Client/Models/APIModel/Request/BarCodeRequest.cs
  20. 64
      BBWY.Client/Models/APIModel/Request/CerRequest.cs
  21. 68
      BBWY.Client/Models/APIModel/Request/ConsumableRequest.cs
  22. 92
      BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs
  23. 16
      BBWY.Client/Models/APIModel/Request/PackUserRequest.cs
  24. 55
      BBWY.Client/Models/APIModel/Response/PackTask/FeesItemResponse.cs
  25. 47
      BBWY.Client/Models/APIModel/Response/PackTask/PackServiceResponse.cs
  26. 423
      BBWY.Client/Models/APIModel/Response/PackTask/PackTaskResultResponse.cs
  27. 18
      BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuCountsResponse.cs
  28. 60
      BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs
  29. 5
      BBWY.Client/Models/APIModel/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs
  30. 124
      BBWY.Client/Models/Enums.cs
  31. 14
      BBWY.Client/Models/Order/OrderDropShipping.cs
  32. 60
      BBWY.Client/Models/PackTask/BarCodeModel.cs
  33. 20
      BBWY.Client/Models/PackTask/BarLabelModel.cs
  34. 89
      BBWY.Client/Models/PackTask/CertificateModel.cs
  35. 128
      BBWY.Client/Models/PackTask/ConsumableModel.cs
  36. 29
      BBWY.Client/Models/PackTask/FeesDetailModel.cs
  37. 25
      BBWY.Client/Models/PackTask/FeesItemModel.cs
  38. 20
      BBWY.Client/Models/PackTask/IncreateModel.cs
  39. 14
      BBWY.Client/Models/PackTask/IncreateServiceModel.cs
  40. 69
      BBWY.Client/Models/PackTask/PackItemModel.cs
  41. 502
      BBWY.Client/Models/PackTask/PackTaskModel.cs
  42. 27
      BBWY.Client/Models/PackTask/PackUser.cs
  43. 48
      BBWY.Client/Models/PackTask/TaskPersonModel.cs
  44. 19
      BBWY.Client/Models/PackTask/UserDepartment.cs
  45. 30
      BBWY.Client/Models/PackTask/UserFeesModel.cs
  46. 19
      BBWY.Client/Models/PackTask/WorkProcessModel.cs
  47. 4
      BBWY.Client/Models/Product/Product.cs
  48. 2
      BBWY.Client/Models/Product/Purchaser.cs
  49. BIN
      BBWY.Client/Resources/Images/3c.png
  50. BIN
      BBWY.Client/Resources/Images/barcode.png
  51. BIN
      BBWY.Client/Resources/LabelNames/Cer3CDouble.btw
  52. BIN
      BBWY.Client/Resources/LabelNames/Cer3CSingle.btw
  53. BIN
      BBWY.Client/Resources/LabelNames/CerStanderDouble.btw
  54. BIN
      BBWY.Client/Resources/LabelNames/CerStanderSingle.btw
  55. BIN
      BBWY.Client/Resources/LabelNames/barsimplify.btw
  56. BIN
      BBWY.Client/Resources/LabelNames/barstander.btw
  57. 4
      BBWY.Client/Resources/Themes/Color.xaml
  58. 107
      BBWY.Client/ViewModels/MainViewModel.cs
  59. 22
      BBWY.Client/ViewModels/Order/ChoosePurchaseSchemeViewModel.cs
  60. 17
      BBWY.Client/ViewModels/Order/OrderListViewModel.cs
  61. 148
      BBWY.Client/ViewModels/PackTask/ConsumableViewModel.cs
  62. 587
      BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
  63. 26
      BBWY.Client/ViewModels/PackTask/SetBarCodeViewModel.cs
  64. 1485
      BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
  65. 18
      BBWY.Client/ViewModels/PackTask/TipsViewModel.cs
  66. 388
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  67. 63
      BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs
  68. 46
      BBWY.Client/ViewModels/Setting/ShopSettingViewModel.cs
  69. 124
      BBWY.Client/ViewModels/ViewModelLocator.cs
  70. 2
      BBWY.Client/Views/MainWindow.xaml
  71. 3
      BBWY.Client/Views/MainWindow.xaml.cs
  72. 2
      BBWY.Client/Views/Order/ChoosePurchaseScheme.xaml
  73. 1
      BBWY.Client/Views/Order/OrderList.xaml
  74. 1
      BBWY.Client/Views/Order/OrderListControl.xaml
  75. 22
      BBWY.Client/Views/Order/RelationPurchaseOrder.xaml.cs
  76. 196
      BBWY.Client/Views/PackTask/Consumable.xaml
  77. 164
      BBWY.Client/Views/PackTask/Consumable.xaml.cs
  78. 341
      BBWY.Client/Views/PackTask/CreatePackTask.xaml
  79. 53
      BBWY.Client/Views/PackTask/CreatePackTask.xaml.cs
  80. 59
      BBWY.Client/Views/PackTask/EditConsumable.xaml
  81. 30
      BBWY.Client/Views/PackTask/EditConsumable.xaml.cs
  82. 12
      BBWY.Client/Views/PackTask/FeesExcelControl.xaml
  83. 288
      BBWY.Client/Views/PackTask/FeesExcelControl.xaml.cs
  84. 84
      BBWY.Client/Views/PackTask/LookBarCodeWindow.xaml
  85. 40
      BBWY.Client/Views/PackTask/LookBarCodeWindow.xaml.cs
  86. 99
      BBWY.Client/Views/PackTask/LookCerWindow.xaml
  87. 77
      BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs
  88. 96
      BBWY.Client/Views/PackTask/PersonList.xaml
  89. 135
      BBWY.Client/Views/PackTask/PersonList.xaml.cs
  90. 151
      BBWY.Client/Views/PackTask/PrintWindow.xaml
  91. 180
      BBWY.Client/Views/PackTask/PrintWindow.xaml.cs
  92. 231
      BBWY.Client/Views/PackTask/ServiceWindow.xaml
  93. 54
      BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs
  94. 110
      BBWY.Client/Views/PackTask/SetBarCode.xaml
  95. 28
      BBWY.Client/Views/PackTask/SetBarCode.xaml.cs
  96. 106
      BBWY.Client/Views/PackTask/SetCerWindow.xaml
  97. 28
      BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs
  98. 40
      BBWY.Client/Views/PackTask/SetCountWindow.xaml
  99. 47
      BBWY.Client/Views/PackTask/SetCountWindow.xaml.cs
  100. 779
      BBWY.Client/Views/PackTask/TaskList.xaml

59
BBWY.Client/APIServices/ConsumableService.cs

@ -0,0 +1,59 @@
using BBWY.Client.Models.APIModel.Request;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Models.PackTask;
using BBWY.Client.Views.PackTask;
using BBWY.Common.Http;
using BBWY.Common.Models;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
namespace BBWY.Client.APIServices
{
public class ConsumableService : BaseApiService, IDenpendency
{
public ConsumableService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext)
{
}
public ApiResponse<ConsuableRequest[]> SearchAll()
{
return SendRequest<ConsuableRequest[]>(globalContext.QKApiHost, "api/Consumable/SearchAll",
null
, null, HttpMethod.Get);
}
public ApiResponse<object> Add(ConsuableRequest consumable)
{
return SendRequest<object>(globalContext.QKApiHost, "api/Consumable/Add",
consumable
, null, HttpMethod.Post);
}
public ApiResponse<object> Edit(ConsuableRequest consumable)
{
return SendRequest<object>(globalContext.QKApiHost, "api/Consumable/Edit",
consumable
, null, HttpMethod.Post);
}
public ApiResponse<object> Deleted(long id)
{
return SendRequest<object>(globalContext.QKApiHost, "api/Consumable/Deleted",
new
{
id = id
}
, null, HttpMethod.Get);
}
public ApiResponse<ConsumableResponse> Search(ConsumableSearchRequest consumable)
{
return SendRequest<ConsumableResponse>(globalContext.QKApiHost, "api/Consumable/Search",
consumable
, null, HttpMethod.Post);
}
}
}

48
BBWY.Client/APIServices/IncreateServiceService.cs

@ -0,0 +1,48 @@
using BBWY.Client.Models.PackTask;
using BBWY.Common.Http;
using BBWY.Common.Models;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
namespace BBWY.Client.APIServices
{
public class IncreateServiceService : BaseApiService, IDenpendency
{
public IncreateServiceService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext)
{
}
public ApiResponse<IncreateServiceModel[]> SearchAll()
{
return SendRequest<IncreateServiceModel[]>(globalContext.QKApiHost, "api/IncreateService/SearchAll",
null
, null, HttpMethod.Get);
}
public ApiResponse<object> Add(IncreateServiceModel consumable)
{
return SendRequest<object>(globalContext.QKApiHost, "api/IncreateService/Add",
consumable
, null, HttpMethod.Post);
}
public ApiResponse<object> Edit(IncreateServiceModel consumable)
{
return SendRequest<object>(globalContext.QKApiHost, "api/IncreateService/Edit",
consumable
, null, HttpMethod.Post);
}
public ApiResponse<object> Deleted(long id)
{
return SendRequest<object>(globalContext.QKApiHost, "api/IncreateService/Deleted",
new
{
id = id
}
, null, HttpMethod.Get);
}
}
}

19
BBWY.Client/APIServices/MdsApiService.cs

@ -4,6 +4,7 @@ using BBWY.Common.Models;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Net.Http; using System.Net.Http;
namespace BBWY.Client.APIServices namespace BBWY.Client.APIServices
@ -58,13 +59,19 @@ namespace BBWY.Client.APIServices
response.Data.Add(d); response.Data.Add(d);
foreach (var jShop in jayShops) foreach (var jShop in jayShops)
{ {
if (jShop.Value<long?>("ShopId") == null || string.IsNullOrEmpty(jShop.Value<string>("AppToken"))) var shopId = jShop.Value<long?>("ShopId");
if (shopId == null || string.IsNullOrEmpty(jShop.Value<string>("AppToken")))
continue; //排除未授权 continue; //排除未授权
try try
{ {
var jayAccounts = jShop.Value<JArray>("AccountList");
if ((jayAccounts == null || !jayAccounts.HasValues) && d.ShopList.Count(s => s.ShopId == shopId) > 0)
{
continue;
}
var shop = new Shop() var shop = new Shop()
{ {
ShopId = jShop.Value<long>("ShopId"), ShopId = shopId.Value,
AppKey = jShop.Value<string>("AppKey"), AppKey = jShop.Value<string>("AppKey"),
AppSecret = jShop.Value<string>("AppSecret"), AppSecret = jShop.Value<string>("AppSecret"),
AppToken = jShop.Value<string>("AppToken"), AppToken = jShop.Value<string>("AppToken"),
@ -76,9 +83,7 @@ namespace BBWY.Client.APIServices
TeamId = jShop.Value<string>("TeamId") TeamId = jShop.Value<string>("TeamId")
}; };
d.ShopList.Add(shop); d.ShopList.Add(shop);
var jayAccounts = jShop.Value<JArray>("AccountList");
if (jayAccounts == null || !jayAccounts.HasValues)
continue;
shop.PurchaseAccountList = new List<PurchaseAccount>(); shop.PurchaseAccountList = new List<PurchaseAccount>();
foreach (var jPurchaseAccount in jayAccounts) foreach (var jPurchaseAccount in jayAccounts)
{ {
@ -89,8 +94,8 @@ namespace BBWY.Client.APIServices
AppKey = jPurchaseAccount.Value<string>("AppKey"), AppKey = jPurchaseAccount.Value<string>("AppKey"),
AppSecret = jPurchaseAccount.Value<string>("AppSecret"), AppSecret = jPurchaseAccount.Value<string>("AppSecret"),
AppToken = jPurchaseAccount.Value<string>("AppToken"), AppToken = jPurchaseAccount.Value<string>("AppToken"),
ShopId = shop.ShopId ShopId = shop.ShopId,
//PurchasePlatformId = jPurchaseAccount.Value<long>() PurchasePlatformId = (Platform)jPurchaseAccount.Value<int>("AppPlatformId")
}); });
} }
} }

340
BBWY.Client/APIServices/PackTaskService.cs

@ -0,0 +1,340 @@
using BBWY.Client.Helpers;
using BBWY.Client.Models;
using BBWY.Client.Models.APIModel.Request;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Models.PackTask;
using BBWY.Common.Http;
using BBWY.Common.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Runtime.Serialization;
using System.Windows.Documents;
namespace BBWY.Client.APIServices
{
public class PackTaskService : BaseApiService, IDenpendency
{
public PackTaskService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext)
{
}
public ApiResponse<PackTaskResultResponse> GetOrderList( string skuId = null, string taskId = null,
DateTime? startTime = null,
DateTime? endTime = null,
TaskState? availability = null,
int? taskStatus = null,
int pageIndex = 1,
int pageSize = 10
)
{
return SendRequest<PackTaskResultResponse>(globalContext.QKApiHost, "api/PackTask/GetPackTaskList", new
{
SkuId = skuId,
TaskId = taskId,
StartTime = startTime,
EndTime = endTime,
Availability = availability,
TaskStatus = taskStatus,
PageIndex = pageIndex,
PageSize = pageSize,
ShopId = globalContext.User.Shop.ShopId.ToString()
}, null, HttpMethod.Post);
}
public ApiResponse<PackTaskResultResponse> GetWareHouseList(int? isWorry=null,string departmentName = null, string skuId = null, string taskId = null,
DateTime? startTime = null,
DateTime? endTime = null,
TaskState? availability = null,
int? taskStatus = null,
int pageIndex = 1,
int pageSize = 10
)
{
return SendRequest<PackTaskResultResponse>(globalContext.QKApiHost, "api/PackTask/GetPackTaskList", new
{
IsWorry=isWorry,
DepartmentName = departmentName,
SkuId = skuId,
TaskId = taskId,
StartTime = startTime,
EndTime = endTime,
Availability = availability,
TaskStatus = taskStatus,
PageIndex = pageIndex,
PageSize = pageSize
}, null, HttpMethod.Post);
}
public ApiResponse<ProductSkuCountsResponse> GetAllCount()
{
return SendRequest<ProductSkuCountsResponse>(globalContext.QKApiHost, "api/PackTask/GetProductSkuCount",
new { ShopId = globalContext.User.Shop.ShopId.ToString() }
, null, HttpMethod.Get);
}
public ApiResponse<ProductSkuCountsResponse> GetWareAllCount()
{
return SendRequest<ProductSkuCountsResponse>(globalContext.QKApiHost, "api/PackTask/GetProductSkuCount",
null
, null, HttpMethod.Get);
}
public ApiResponse<ProductSkuResponse> GetProductSku(string skuId)
{
HttpClientHelper helper = new HttpClientHelper(globalContext.QKApiHost);
string url = $"{globalContext.QKApiHost}/api/PackTask/SearchProduct?skuId={skuId}&ShopId={globalContext.User.Shop.ShopId.ToString()}";
var data = helper.Get(url);
return JsonConvert.DeserializeObject<ApiResponse<ProductSkuResponse>>(data);
}
public ApiResponse<object> CreateTask(CreateTaskRequest createTaskRequest)
{
return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/CreatePackTask",
createTaskRequest
, null, HttpMethod.Post);
}
public ApiResponse<object> UpdateTaskStatus(long id, int taskStatus)
{
return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/UpdatePackTaskStatus", new
{
id,
taskStatus
}
, null, HttpMethod.Post);
}
public ApiResponse<long> SaveBarCode(BarCodeRequest barCodeModel)
{
return SendRequest<long>(globalContext.QKApiHost, "api/PackTask/CommitBarCode", barCodeModel
, null, HttpMethod.Post);
}
public ApiResponse<long> SaveCer(CerRequest cerRequest)
{
return SendRequest<long>(globalContext.QKApiHost, "api/PackTask/CommitCer", cerRequest
, null, HttpMethod.Post);
}
public ApiResponse<PackUser[]> GetPackMembers()
{
return SendRequest<PackUser[]>(globalContext.QKApiHost, "api/PackTask/SearchPackMembers", null
, null, HttpMethod.Get);
}
/// <summary>
/// 获取任务的服务
/// </summary>
/// <returns></returns>
public ApiResponse<PackServiceResponse> GetTaskService(long taskId)
{
return SendRequest<PackServiceResponse>(globalContext.QKApiHost, "api/PackTask/GetTaskService", new { TaskId = taskId }
, null, HttpMethod.Get);
}
/// <summary>
/// 上传 更新任务的服务数据
/// </summary>
/// <returns></returns>
public ApiResponse<object> UploadService(UploadServiceRequest uploadService)
{
return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/UploadService", uploadService
, null, HttpMethod.Post);
}
//public ApiResponse<object> AddTaskPeople(long taskId, string packUserId, int FeesTypeId,
// int FeesItemId, decimal PackNumber)
//{
// return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/AddTaskPeople", new
// {
// taskId = taskId,
// packUserId = packUserId,
// FeesTypeId = FeesTypeId,
// FeesItemId = FeesItemId,
// PackNumber = PackNumber
// }
// , null, HttpMethod.Post);
//}
//public ApiResponse<object> AddTaskPeople(List<PackUserRequest> packUsers)
//{
// return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/AddTaskPeoples", packUsers
// , null, HttpMethod.Post);
//}
//public ApiResponse<object> AddConsumables(long taskId, long[] consumableIds)
//{
// return SendRequest<object>(globalContext.QKApiHost, "api/PackTask/AddConsumables", new AddConsumableRequest
// {
// TaskId= taskId,
// ConsumableIds = consumableIds
// }
// , null, HttpMethod.Post);
//}
}
public class AddConsumableRequest
{
public long TaskId { get; set; }
public long[] ConsumableIds { get; set; }
}
/// <summary>
/// 上传服务
/// </summary>
public class UploadServiceRequest
{
/// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 耗材ids
/// </summary>
public string ConsumableIds { get; set; }
/// <summary>
/// 耗材数量
/// </summary>
public string ConsumableNos { get; set; }
/// <summary>
/// 工序ids
/// </summary>
public string WorkProcessIds { get; set; }
/// <summary>
/// 工序数量
/// </summary>
public string WorkProcessNos { get; set; }
/// <summary>
/// 增值服务ids
/// </summary>
public string IncreateServiceIds { get; set; }
/// <summary>
/// 增值服务数量
/// </summary>
public string IncreateServiceNos { get; set; }
/// <summary>
/// 任务单件费用
/// </summary>
public decimal SingleFees { get; set; }
/// <summary>
/// 任务总费用
/// </summary>
public decimal AllFees { get; set; }
public PersonTaskModel[] PersonTaskModels { get; set; }
//public IncreateMemberModel[] IncreateMembers { get; set; }
//public ProcessMemberModel[] ProcessMembers { get; set; }
}
public class PersonTaskModel
{
/// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 打包人
/// </summary>
public string PackUserId { get; set; }
/// <summary>
/// 增值服务ids
/// </summary>
public string IncreateServiceIds { get; set; }
/// <summary>
/// 增值服务数量
/// </summary>
public string IncreateServiceNos { get; set; }
/// <summary>
/// 工序ids
/// </summary>
public string WorkProcessIds { get; set; }
/// <summary>
/// 工序数量
/// </summary>
public string WorkProcessNos { get; set; }
/// <summary>
/// 总费用
/// </summary>
public decimal AllFees { get; set; }
/// <summary>
/// 时间
/// </summary>
public DateTime CreateTime { get; set; } = DateTime.Now;
}
public class ConsumableTaskModel
{
public decimal Price { get; set; }
/// <summary>
/// 耗材服务id
/// </summary>
public long ConsumableId { get; set; }
/// <summary>
/// 耗材服务数量
/// </summary>
public int ConsumableCount { get; set; }
}
public class IncreateMemberModel
{
public decimal Price { get; set; }
public string UserId { get; set; }
/// <summary>
/// 增值服务Id
/// </summary>
public long IncreateId { get; set; }
/// <summary>
/// 数量
/// </summary>
public int IncreateCount { get; set; }
}
public class ProcessMemberModel
{
public decimal Price { get; set; }
public string UserId { get; set; }
/// <summary>
/// 工序服务Id
/// </summary>
public long ProcessId { get; set; }
/// <summary>
/// 工序服务数量
/// </summary>
public int ProcessCount { get; set; }
}
}

17
BBWY.Client/APIServices/ProductService.cs

@ -28,7 +28,22 @@ namespace BBWY.Client.APIServices
null, null,
HttpMethod.Post); HttpMethod.Post);
} }
public ApiResponse<IList<ProductSku>> GetProductSkuList(string spu, string sku,Platform platform,string appKey,string appSecret,string appToken)
{
return SendRequest<IList<ProductSku>>(globalContext.BBYWApiHost,
"api/product/GetProductSkuList",
new
{
Spu = spu,
Sku = sku,
Platform = platform,
AppKey = appKey,
AppSecret = appSecret,
AppToken = appToken
},
null,
HttpMethod.Post);
}
public ApiResponse<IList<ProductSku>> GetProductSkuList(string spu, string sku) public ApiResponse<IList<ProductSku>> GetProductSkuList(string spu, string sku)
{ {
return SendRequest<IList<ProductSku>>(globalContext.BBYWApiHost, return SendRequest<IList<ProductSku>>(globalContext.BBYWApiHost,

31
BBWY.Client/APIServices/PurchaseOrderService.cs

@ -96,21 +96,23 @@ namespace BBWY.Client.APIServices
/// <param name="sellerAccount"></param> /// <param name="sellerAccount"></param>
/// <param name="purchaserId"></param> /// <param name="purchaserId"></param>
/// <param name="platformCommissionRatio"></param> /// <param name="platformCommissionRatio"></param>
/// <param name="extensions"></param>
/// <returns></returns> /// <returns></returns>
public ApiResponse<object> FastCreateOrder(Consignee consignee, public ApiResponse<object> FastCreateOrder(Consignee consignee,
IList<PurchaseSchemeProductSku> purchaseSchemeProductSkuList, IList<PurchaseSchemeProductSku> purchaseSchemeProductSkuList,
Platform purchasePlatform, Platform purchasePlatform,
PurchaseAccount purchaseAccount, PurchaseAccount purchaseAccount,
PurchaseOrderMode purchaseOrderMode, PurchaseOrderMode purchaseOrderMode,
string tradeMode, string tradeMode,
string remark, string remark,
string orderId, string orderId,
long shopId, long shopId,
long purchaseAccountId, long purchaseAccountId,
string buyerAccount, string buyerAccount,
string sellerAccount, string sellerAccount,
string purchaserId, string purchaserId,
decimal platformCommissionRatio) decimal platformCommissionRatio,
string extensions)
{ {
return SendRequest<object>(globalContext.BBYWApiHost, "api/purchaseOrder/NewFastCreateOrder", new return SendRequest<object>(globalContext.BBYWApiHost, "api/purchaseOrder/NewFastCreateOrder", new
{ {
@ -137,7 +139,8 @@ namespace BBWY.Client.APIServices
buyerAccount, buyerAccount,
sellerAccount, sellerAccount,
purchaserId, purchaserId,
platformCommissionRatio platformCommissionRatio,
extensions
}, null, HttpMethod.Post); }, null, HttpMethod.Post);
} }

56
BBWY.Client/APIServices/WorkProcessService.cs

@ -0,0 +1,56 @@
using BBWY.Client.Models.APIModel.Request;
using BBWY.Client.Models.PackTask;
using BBWY.Common.Http;
using BBWY.Common.Models;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
namespace BBWY.Client.APIServices
{
public class WorkProcessService : BaseApiService, IDenpendency
{
public WorkProcessService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext)
{
}
public ApiResponse<WorkProcessModel[]> SearchAll()
{
return SendRequest<WorkProcessModel[]>(globalContext.QKApiHost, "api/WorkProcess/SearchAll",
null
, null, HttpMethod.Get);
}
public ApiResponse<object> Add(WorkProcessModel consumable)
{
return SendRequest<object>(globalContext.QKApiHost, "api/WorkProcess/Add",
consumable
, null, HttpMethod.Post);
}
public ApiResponse<object> Edit(WorkProcessModel consumable)
{
return SendRequest<object>(globalContext.QKApiHost, "api/WorkProcess/Edit",
consumable
, null, HttpMethod.Post);
}
public ApiResponse<object> Deleted(long id)
{
return SendRequest<object>(globalContext.QKApiHost, "api/WorkProcess/Deleted",
new
{
id = id
}
, null, HttpMethod.Get);
}
//public ApiResponse<ConsumableResponse> Search(ConsumableRequest consumable)
//{
// return SendRequest<ConsumableResponse>(globalContext.QKApiHost, "api/WorkProcess/Search",
// consumable
// , null, HttpMethod.Post);
//}
}
}

5
BBWY.Client/App.xaml

@ -5,7 +5,7 @@
xmlns:vm="clr-namespace:BBWY.Client.ViewModels" xmlns:vm="clr-namespace:BBWY.Client.ViewModels"
xmlns:ctr="clr-namespace:BBWY.Client.Converters" xmlns:ctr="clr-namespace:BBWY.Client.Converters"
StartupUri="/Views/MainWindow.xaml" StartupUri="/Views/MainWindow.xaml"
ShutdownMode="OnExplicitShutdown"> ShutdownMode="OnExplicitShutdown"><!--StartupUri="/Views/MainWindow.xaml"-->
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
@ -17,11 +17,14 @@
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<vm:ViewModelLocator x:Key="Locator"/> <vm:ViewModelLocator x:Key="Locator"/>
<ctr:ObjectConverter x:Key="objConverter"/> <ctr:ObjectConverter x:Key="objConverter"/>
<ctr:MultiObjectConverter x:Key="mobjConverter"/> <ctr:MultiObjectConverter x:Key="mobjConverter"/>
<ctr:WidthConveter x:Key="widthConverter"/> <ctr:WidthConveter x:Key="widthConverter"/>
<ctr:InputNumberConverter x:Key="inputNumberConverter"/> <ctr:InputNumberConverter x:Key="inputNumberConverter"/>
<ctr:EnumToBooleanConverter x:Key="enumToBooleanConverter"/> <ctr:EnumToBooleanConverter x:Key="enumToBooleanConverter"/>
<ctr:IntToStringConverter x:Key="intToStringConverter"/>
<ctr:EnumToColorConverter x:Key="enumToColorConverter"/>
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>

30
BBWY.Client/App.xaml.cs

@ -1,5 +1,6 @@
using BBWY.Client.Models; using BBWY.Client.Models;
using BBWY.Client.ViewModels; using BBWY.Client.ViewModels;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Common.Extensions; using BBWY.Common.Extensions;
using BBWY.Common.Http; using BBWY.Common.Http;
using BBWY.Common.Models; using BBWY.Common.Models;
@ -44,9 +45,22 @@ namespace BBWY.Client
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
var gl = new GlobalContext(); var gl = new GlobalContext();
string userToken = string.Empty; string userToken = string.Empty;
//var tokenResult = ReadMMF();
//if (tokenResult.isOk)
// userToken = tokenResult.content;
//else
//{
// MessageBox.Show($"读取内存数据失败\r\n{tokenResult.content}", "提示");
// Environment.Exit(0);
//}
#if DEBUG #if DEBUG
//仓库组测试
// userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNjM1OTMyMDAyMjcwMDU2NDQ4IiwidGVhbUlkIjoiMTU0MDg4NTU3MDYyNzA0NzQyNCIsInNvblRlYW1JZHMiOiIxNTQwODg1NTcwNjI3MDQ3NDI0IiwiZXhwIjoxNzEwNDk2NTQ1fQ.Sx2vGJcYGf98x99slQLU3vt7yWdjspptSpbUCcZgWek";
//齐越山鸡 //齐越山鸡
userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTM1MzMwMzI4ODkyMTQ5NzYwIiwidGVhbUlkIjoiMTUxNjk3NDI1MDU0MjUwMTg4OCIsInNvblRlYW1JZHMiOiIxNDM2Mjg4NTAwMjM1MjQzNTIwIiwiZXhwIjoxNjk0NjY5NjkxfQ.cSwro-7bGwOu92YejH9JhMenTai7Mvf99i2paQCmxIw"; userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTM1MzMwMzI4ODkyMTQ5NzYwIiwidGVhbUlkIjoiMTUxNjk3NDI1MDU0MjUwMTg4OCIsInNvblRlYW1JZHMiOiIxNDM2Mjg4NTAwMjM1MjQzNTIwIiwiZXhwIjoxNjk0NjY5NjkxfQ.cSwro-7bGwOu92YejH9JhMenTai7Mvf99i2paQCmxIw";
//刷单组测试 //刷单组测试
//userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTcxODUyODE0OTAzMTUyNjQwIiwidGVhbUlkIjoiMTU3MTg1MjQ1MDI5NjUwMDIyNCIsInNvblRlYW1JZHMiOiIiLCJleHAiOjE2OTUxNDc2ODh9.hVupdHnhgHHGo3QrMSDqhINqtq6Q5_RovWyXjiMkkEs"; //userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTcxODUyODE0OTAzMTUyNjQwIiwidGVhbUlkIjoiMTU3MTg1MjQ1MDI5NjUwMDIyNCIsInNvblRlYW1JZHMiOiIiLCJleHAiOjE2OTUxNDc2ODh9.hVupdHnhgHHGo3QrMSDqhINqtq6Q5_RovWyXjiMkkEs";
@ -82,9 +96,9 @@ namespace BBWY.Client
gl.UserToken = userToken; gl.UserToken = userToken;
#region 注册全局异常 #region 注册全局异常
this.DispatcherUnhandledException += App_DispatcherUnhandledException; ; this.DispatcherUnhandledException += App_DispatcherUnhandledException;
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; ; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; ; TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
#endregion #endregion
var applicationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var applicationPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
@ -94,14 +108,17 @@ namespace BBWY.Client
gl.MDSApiHost = Configuration.GetSection("MDSApiHost").Value; gl.MDSApiHost = Configuration.GetSection("MDSApiHost").Value;
gl.JOSApiHost = Configuration.GetSection("JOSApiHost").Value; gl.JOSApiHost = Configuration.GetSection("JOSApiHost").Value;
gl._1688ApiHost = Configuration.GetSection("1688ApiHost").Value; gl._1688ApiHost = Configuration.GetSection("1688ApiHost").Value;
gl.QKApiHost = Configuration.GetSection("QKApiHost").Value;
IServiceCollection serviceCollection = new ServiceCollection(); IServiceCollection serviceCollection = new ServiceCollection();
serviceCollection.AddHttpClient(); serviceCollection.AddHttpClient();
serviceCollection.AddTransient<CreatePackTaskViewModel>();
serviceCollection.AddHttpClient("gzip").ConfigurePrimaryHttpMessageHandler(handler => new HttpClientHandler() serviceCollection.AddHttpClient("gzip").ConfigurePrimaryHttpMessageHandler(handler => new HttpClientHandler()
{ {
AutomaticDecompression = System.Net.DecompressionMethods.GZip AutomaticDecompression = System.Net.DecompressionMethods.GZip
}); });
serviceCollection.AddMemoryCache(); serviceCollection.AddMemoryCache();
serviceCollection.AddSingleton<RestApiService>(); serviceCollection.AddSingleton<RestApiService>();
serviceCollection.AddSingleton(gl); serviceCollection.AddSingleton(gl);
@ -137,6 +154,11 @@ namespace BBWY.Client
} }
#endregion #endregion
//设置一个值,此值指示数据绑定 TextBox 是否应显示与源的 Text 属性值一致的字符串 为false
System.Windows.FrameworkCompatibilityPreferences.KeepTextBoxDisplaySynchronizedWithTextProperty = false;
base.OnStartup(e); base.OnStartup(e);
} }

38
BBWY.Client/BBWY.Client.csproj

@ -18,13 +18,21 @@
<ItemGroup> <ItemGroup>
<None Remove="BBWYAppSettings.json" /> <None Remove="BBWYAppSettings.json" />
<None Remove="Resources\Images\3c.png" />
<None Remove="Resources\Images\barcode.png" />
<None Remove="Resources\Images\defaultItem.png" /> <None Remove="Resources\Images\defaultItem.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="BBWYAppSettings.json"> <Content Include="BBWYAppSettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Resource Include="Resources\Images\3c.png">
<CopyToOutputDirectory></CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Images\barcode.png">
<CopyToOutputDirectory></CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\Images\bbwylogo.ico" /> <Resource Include="Resources\Images\bbwylogo.ico" />
</ItemGroup> </ItemGroup>
@ -52,6 +60,12 @@
<ProjectReference Include="..\QuanTan.SDK\QuanTan.SDK.csproj" /> <ProjectReference Include="..\QuanTan.SDK\QuanTan.SDK.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="Interop.BarTender">
<HintPath>..\dll\Interop.BarTender.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\Images\defaultItem.png"> <Resource Include="Resources\Images\defaultItem.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
@ -71,10 +85,24 @@
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
</ItemGroup> <None Update="Resources\LabelNames\barsimplify.btw">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<ItemGroup> </None>
<Folder Include="Models\PackTask\" /> <None Update="Resources\LabelNames\barstander.btw">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Resources\LabelNames\Cer3CDouble.btw">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Resources\LabelNames\Cer3CSingle.btw">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Resources\LabelNames\CerStanderDouble.btw">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Resources\LabelNames\CerStanderSingle.btw">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
</Project> </Project>

4
BBWY.Client/BBWYAppSettings.json

@ -3,5 +3,7 @@
"BBWYApiHost": "http://bbwytest.qiyue666.com", "BBWYApiHost": "http://bbwytest.qiyue666.com",
"MDSApiHost": "http://mdsapi.qiyue666.com", "MDSApiHost": "http://mdsapi.qiyue666.com",
"JOSApiHost": "", "JOSApiHost": "",
"1688ApiHost": "" "1688ApiHost": "",
//"QKApiHost": "http://localhost:8080"
"QKApiHost": "http://qiku.qiyue666.com"
} }

52
BBWY.Client/Converters/EnumToColorConverter.cs

@ -0,0 +1,52 @@
using BBWY.Client.Models;
using EnumsNET;
using SixLabors.ImageSharp;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Data;
namespace BBWY.Client.Converters
{
internal class EnumToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
try
{
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())
{
return "#C1FFC1";
}
if (value.ToString() == "部分到货")
{
return "#FFDEAD";
}
if (value.ToString() == "未到货")
{
return "#FFDAB9";
}
return enumName;
}
catch (Exception e)
{
// Logger.Error(nameof(TemplateTypeConverter), e);
return string.Empty;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}
}

30
BBWY.Client/Converters/IntToStringConverter.cs

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows.Data;
namespace BBWY.Client.Converters
{
public class IntToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) {
return "4号箱子";
}
if (value.ToString()=="0")
{
return "自带";
}
return value.ToString()+ parameter.ToString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

3
BBWY.Client/Converters/ObjectConverter.cs

@ -7,9 +7,10 @@ namespace BBWY.Client.Converters
{ {
public class ObjectConverter : IValueConverter public class ObjectConverter : IValueConverter
{ {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {
string[] parray = parameter.ToString().ToLower().Split(':'); string[] parray = parameter.ToString().ToLower().Split(':');//参数拆分
string valueStr = value == null ? string.Empty : value.ToString().ToLower(); string valueStr = value == null ? string.Empty : value.ToString().ToLower();
string returnValue = string.Empty; string returnValue = string.Empty;
try try

24
BBWY.Client/Converters/StringToColorConvter.cs

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows.Data;
namespace BBWY.Client.Converters
{
public class StringToColorConvter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

2
BBWY.Client/GlobalContext.cs

@ -36,6 +36,8 @@ namespace BBWY.Client
public string JOSApiHost { get; set; } public string JOSApiHost { get; set; }
public string _1688ApiHost { get; set; } public string _1688ApiHost { get; set; }
public string QKApiHost { get; set; }
#endregion #endregion
} }
} }

327
BBWY.Client/Helpers/BartenderHelper.cs

@ -0,0 +1,327 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
namespace BBWY.Client.Helpers
{
public class BartenderHelper
{
#region BarTender打印方法
private static BarTender.Application btApp = new BarTender.Application();
private static BarTender.Format btFormat = new BarTender.Format();
public string TemplateFile { set; get; }
public string ErrorMsg { set; get; }
public bool Status { set; get; }
/// <summary>
/// 使用 BarTender进行打印,批量打印
/// </summary>
/// <param name="labelName"> BarTender模板标签</param>
/// <param name="labelParamsValuesList">打印数据</param>
/// <param name="msg">回调消息</param>
/// <param name="printQty">打印数量</param>
/// <returns>打印OK true</returns>
public bool BTPrint(string labelName, Dictionary<string, string> labelParamsValues, out string msg, int printQty = 1, string printer = "Deli DL-730C(NEW)")
{
try
{
bool checkLabelVar = true;
string tmpMsg = "";
this.TemplateFile = labelName;
if (!File.Exists(TemplateFile))
{
msg = "Error:Label File Not Exists" + TemplateFile;
this.ErrorMsg = msg;
return false;
}
if (!string.IsNullOrEmpty(printer))
{
bool printerFlag = false;
foreach (string sPrint in System.Drawing.Printing.PrinterSettings.InstalledPrinters)//获取所有打印机名称
{
if (sPrint.Equals(printer))
{
printerFlag = true;
}
}
if (!printerFlag)
{
msg = "Error:Printer Name Error";
return false;
}
}
//找到打印模板的标签页
btFormat = btApp.Formats.Open(labelName, false, "");
if (!string.IsNullOrEmpty(printer))
{
btFormat.Printer = printer;
}
if (btApp != null)
{
//btFormat.IdenticalCopiesOfLabel = printQty;
//btFormat.PrintOut(true, false);
//取模板所有的值
string strBT = btFormat.NamedSubStrings.GetAll("#", "$");
//将模板所有值进行拆分
strBT = strBT.Substring(0, strBT.Length - 1);
string[] strBTValue = strBT.Split(new char[] { '$' });
//循环将模板的值写入lbldicVar中
Dictionary<string, string> lbldicVar = new Dictionary<string, string>();
for (int i = 0; i < strBTValue.Length; i++)
{
string[] cc = strBTValue[i].Split(new char[] { '#' });
lbldicVar.Add(cc[0].ToString(), cc[1].ToString()); //0是模板的参数 1是参数值
}
if (labelParamsValues.Count > 0)
{
foreach (var item in lbldicVar)
{
if (labelParamsValues.Count(q => q.Key.ToUpper() == item.Key.ToUpper()) == 0)
{
tmpMsg = "数据源缺少参数: " + item.Key;
if (checkLabelVar)
{
this.ErrorMsg = tmpMsg;
checkLabelVar = false;
}
else
{
this.ErrorMsg = this.ErrorMsg + (char)10 + tmpMsg;
}
}
}
if (!checkLabelVar)
{
msg = this.ErrorMsg;
this.Status = false;
return false;
}
foreach (var param in labelParamsValues.Keys)
{
if (lbldicVar.Keys.Count(q => q.ToUpper() == param.ToUpper()) > 0)
{
var labvar = lbldicVar.Keys.First(q => q.ToUpper() == param.ToUpper());
if (string.IsNullOrEmpty(labelParamsValues[param]))
{
tmpMsg = "数据源参数值为空:" + labvar;
if (checkLabelVar)
{
this.ErrorMsg = tmpMsg;
checkLabelVar = false;
}
else
{
this.ErrorMsg = this.ErrorMsg + (char)10 + tmpMsg;
}
}
btFormat.SetNamedSubStringValue(param, labelParamsValues[param]);
}
}
if (!checkLabelVar)
{
msg = this.ErrorMsg;
this.Status = false;
return false;
}
btFormat.IdenticalCopiesOfLabel = printQty;
//第二个false设置打印时是否跳出打印属性
btFormat.PrintOut(true, false);
//退出是是否保存标签
btFormat.Close(BarTender.BtSaveOptions.btSaveChanges);
//lblDoc.FormFeed();
msg = "OK";
this.ErrorMsg = msg;
this.Status = true;
return true;
}
else
{
msg = "Print Data is null";
this.ErrorMsg = msg;
this.Status = false;
return false;
}
}
else
{
msg = "Error:CodeSoft Application can't boot up";
this.ErrorMsg = msg;
this.Status = false;
return false;
}
}
catch (Exception ex)
{
msg = ex.Message + ex.InnerException;
this.ErrorMsg = msg;
this.Status = false;
return false;
}
finally
{
if (btApp != null)
{
btApp.Quit(BarTender.BtSaveOptions.btSaveChanges);//界面退出时同步退出bartender进程
//lblApp.Documents.CloseAll(true);
//lblDoc = null;
}
GC.Collect();
}
}
#endregion
#region 数据库调用打印
/// <summary>
/// 打印从文本数据库中打
/// </summary>
/// <returns></returns>
public bool BTPrintByDataBase(string path, string filePath, string printer = "")
{
try
{
BarTender.Application btapp;
BarTender.Format btformat;
btapp = new BarTender.Application();
btformat = btapp.Formats.Open(path, false, "");
BarTender.Database database = btformat.Databases.GetDatabase(1);
if (!string.IsNullOrEmpty(printer))
{
btformat.Printer = printer;
}
database.TextFile.FileName = filePath;
//database.SQLStatement += $" where printID='{printId}' order by RIGHT(Var1,7)";//填写SQL语句附加条件
//database.Password = VSLoginInfo.SQLPassword;
//database.User = VSLoginInfo.SQLUser;
btformat.PrintOut(false, false); //第二个参数设置是否跳出打印属性;
btapp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);//退出时同步退出bartender进程(SQL条件会改变,不更新模板信息)
}
catch
{
return false;
}
return true;
}
/// <summary>
/// 打印从文本数据库中打
/// </summary>
/// <param name="templatepath">模板地址</param>
/// <param name="dataLine">数据行,一行一个标签,第一行为标题,多列逗号分割</param>
/// <returns></returns>
public bool BTPrintByDataBase(string templatepath, List<string> dataLine, string printer = "")
{
try
{
BarTender.Application btapp;
BarTender.Format btformat;
btapp = new BarTender.Application();
var filepath = WriteLog(dataLine, "", Guid.NewGuid().ToString());
btformat = btapp.Formats.Open(templatepath, false, "");
BarTender.Database database = btformat.Databases.GetDatabase(1);
if (!string.IsNullOrEmpty(printer))
{
btformat.Printer = printer;
}
database.TextFile.FileName = filepath;
//database.SQLStatement += $" where printID='{printId}' order by RIGHT(Var1,7)";//填写SQL语句附加条件
//database.Password = VSLoginInfo.SQLPassword;
//database.User = VSLoginInfo.SQLUser;
btformat.PrintOut(false, false); //第二个参数设置是否跳出打印属性;
btapp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);//退出时同步退出bartender进程(SQL条件会改变,不更新模板信息)
}
catch
{
return false;
}
return true;
}
/// <summary>
/// 写文本
/// </summary>
/// <param name="logStr"></param>
public static string WriteLog(List<string> lines, string fileDirectory = "", string guid = "")
{
try
{
string path1 = Environment.CurrentDirectory + Path.Combine("/printFile/") + fileDirectory;
if (!Directory.Exists(path1))
{
//创建索引目录
Directory.CreateDirectory(path1);
}
string path = path1 + "/" + DateTime.Now.ToString("yyyy-MM-dd") + guid + ".txt";
FileStream stream = null;
if (File.Exists(path))
{
File.Delete(path);
}
stream = new FileStream(path, FileMode.Create);
StreamWriter writer = new StreamWriter(stream);
for (var i = 0; i < lines.Count; i++)
{
writer.Write(lines[i] + Environment.NewLine);
}
writer.Flush();
writer.Close();
stream.Close();
return path;
}
catch
{
}
finally
{
}
return "";
}
#endregion
public static void ExportToFile(string btFileName, Dictionary<string, string> data)
{
//BarTender.Application btApp = new BarTender.Application();
//BarTender.Format btFormat;
btFormat = btApp.Formats.Open(btFileName);
foreach (var key in data.Keys)
{
btFormat.SetNamedSubStringValue(key, data[key]);
}
//btFormat.SaveAs(btFileName, true);
btFormat.ExportToFile(@"E:/temp.jpg", "jpg", BarTender.BtColors.btColors24Bit, BarTender.BtResolution.btResolutionPrinter, BarTender.BtSaveOptions.btSaveChanges);
btFormat.Close(BarTender.BtSaveOptions.btSaveChanges);
btApp.Quit(BarTender.BtSaveOptions.btSaveChanges);
}
}
}

122
BBWY.Client/Helpers/HttpClientHelper.cs

@ -0,0 +1,122 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Text;
namespace BBWY.Client.Helpers
{
public class HttpClientHelper
{
public HttpClientHelper(string baseAddr)
{
this.BaseAddr = baseAddr;
}
public string BaseAddr { get; set; }
public string Get(string Url)
{
HttpClient client = new HttpClient();
//设置 API的 基地址
client.BaseAddress = new Uri(BaseAddr);
//设置 默认请求头ACCEPT
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
//发送GET请求
HttpResponseMessage msg = client.GetAsync(Url).Result;
//判断结果是否成功
if (msg.IsSuccessStatusCode)
{
//返回响应结果
return msg.Content.ReadAsStringAsync().Result;
}
//返回空字符串,表示响应错误
return "";
}
public string Delete(string Url)
{
HttpClient client = new HttpClient();
//设置 API的 基地址
client.BaseAddress = new Uri(BaseAddr);
//设置 默认请求头ACCEPT
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
//发送GET请求
HttpResponseMessage msg = client.DeleteAsync(Url).Result;
//判断结果是否成功
if (msg.IsSuccessStatusCode)
{
//返回响应结果
return msg.Content.ReadAsStringAsync().Result;
}
//返回空字符串,表示响应错误
return "";
}
public string Post(string Url, string JsonData)
{
HttpClient client = new HttpClient();
//设置 API的 基地址
client.BaseAddress = new Uri(BaseAddr);
//设置 默认请求头ACCEPT
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
//设置消息体
HttpContent content = new StringContent(JsonData);
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
//发送Post请求
HttpResponseMessage msg = client.PostAsync(Url, content).Result;
//判断结果是否成功
if (msg.IsSuccessStatusCode)
{
//返回响应结果
return msg.Content.ReadAsStringAsync().Result;
}
//返回空字符串,表示响应错误
return "";
}
public string Put(string Url, string JsonData)
{
HttpClient client = new HttpClient();
//设置 API的 基地址
client.BaseAddress = new Uri(BaseAddr);
//设置 默认请求头ACCEPT
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
//设置消息体
HttpContent content = new StringContent(JsonData);
content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
//发送Post请求
HttpResponseMessage msg = client.PutAsync(Url, content).Result;
//判断结果是否成功
if (msg.IsSuccessStatusCode)
{
//返回响应结果
return msg.Content.ReadAsStringAsync().Result;
}
//返回空字符串,表示响应错误
return "";
}
public T Request<T>(string type, string url, object data = null)
{
string json = JsonConvert.SerializeObject(data);
string result = "";
switch (type)
{
case "Get":
result = Get(url);
break;
case "Post":
result = Post(url, json);
break;
case "Put":
result = Put(url, json);
break;
case "Delete":
result = Delete(url);
break;
}
return JsonConvert.DeserializeObject<T>(result);
}
}
}

51
BBWY.Client/Models/APIModel/Request/BarCodeRequest.cs

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel.Request
{
public class BarCodeRequest
{
///// <summary>
///// 条形码id
///// </summary>
//public long Id { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string Brand { get; set; }
/// <summary>
/// 品名
/// </summary>
public string BrandName { get; set; }
/// <summary>
/// 货号
/// </summary>
public string ProductNo { get; set; }
/// <summary>
/// sku名称
/// </summary>
public string SkuName { get; set; }
/// <summary>
/// skuId(条形码号=POP+SkuId)
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// 条形码模板
/// </summary>
public BarcodeLabelModel LabelModel { get; set; }
///// <summary>
///// 型号
///// </summary>
//public string ModelNo { get; set; }
}
}

64
BBWY.Client/Models/APIModel/Request/CerRequest.cs

@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel.Request
{
public class CerRequest
{
/// <summary>
/// skuid
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string Brand { get; set; }
/// <summary>
/// 品名
/// </summary>
public string BrandName { get; set; }
/// <summary>
/// 材质
/// </summary>
public string Shader { get; set; }
/// <summary>
/// 执行标准
/// </summary>
public string ExcuteStander { get; set; }
/// <summary>
/// 生产商
/// </summary>
public string ProductShop { get; set; }
/// <summary>
/// 地址
/// </summary>
public string ProductAdress { get; set; }
/// <summary>
/// 型号(货号)
/// </summary>
public string ProductNo { get; set; }
/// <summary>
/// 是否含3cLogo(0是 ,1否)
/// </summary>
public int IsLogo { get; set; }
/// <summary>
/// 工厂编号
/// </summary>
public string FactoryNumber { get; set; }
/// <summary>
/// 合格证模板
/// </summary>
public int LabelModel { get; set; }
}
}

68
BBWY.Client/Models/APIModel/Request/ConsumableRequest.cs

@ -0,0 +1,68 @@
using BBWY.Client.Models.PackTask;
using BBWY.Client.Views.PackTask;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel.Request
{
public class ConsumableResponse
{
public int OrderCount { get; set; }
public ConsumableModel[] Consumables { get; set; }
}
public class ConsumableSearchRequest
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 页面1
/// </summary>
public int? PageIndex { get; set; }
/// <summary>
/// 单页数量
/// </summary>
public int? PageSize { get; set; }
}
public class ConsuableRequest
{
/// <summary>
/// id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal Price { get; set; }
/// <summary>
/// 重量
/// </summary>
public double? Weigth { get; set; }
/// <summary>
/// 长度
/// </summary>
public double? Length { get; set; }
/// <summary>
/// 宽度
/// </summary>
public double? Width { get; set; }
/// <summary>
/// 高度
/// </summary>
public double? Heigth { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}

92
BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs

@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel.Request
{
public class CreateTaskRequest
{
/// <summary>
/// skuid
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// 品名
/// </summary>
public string BrandName { get; set; }
/// <summary>
/// sku数量
/// </summary>
public int SkuCount { get; set; }
/// <summary>
/// 到货情况(待收货=0,部分收货=1,已到货=2)
/// </summary>
public int Availability { get; set; }
/// <summary>
/// 落仓(本地仓=0,齐越仓=1,京东仓=2)
/// </summary>
public int PositionType { get; set; }
/// <summary>
/// 打包类型(单件=0,多件=1)
/// </summary>
public int PackType { get; set; }
/// <summary>
/// 配件数量
/// </summary>
public int GoodsNumber { get; set; }
/// <summary>
/// sku配件名称
/// </summary>
public string SkuGoodsTitle { get; set; }
/// <summary>
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
/// </summary>
public int BasicPack { get; set; }
/// <summary>
/// 增量耗材
/// </summary>
public string Increment1 { get; set; }
/// <summary>
/// 增量耗材
/// </summary>
public int Increment2 { get; set; }
//条形码 合格证数据
/// <summary>
/// 注意事项
/// </summary>
public string MarkMessage { get; set; }
/// <summary>
/// 店铺
/// </summary>
public string ShopId { get; set; }
/// <summary>
/// 需求方创建日期
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 对接人
/// </summary>
public string UserId { get; set; }
/// <summary>
///条形码Id
/// </summary>
public long? BarCodeId { get; set; }
/// <summary>
/// 合格证Id
/// </summary>
public long? CertificateId { get; set; }
/// <summary>
/// 合格证位置
/// </summary>
public int? CertificatePosition { get; set; }
public Worry IsWorry { get; set; }
}
}

16
BBWY.Client/Models/APIModel/Request/PackUserRequest.cs

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel.Request
{
public class PackUserRequest
{
public long TaskId { get; set; }
public string PackUserId { get; set; }
public int FeesItemId { get; set; }
public int FeesTypeId { get; set; }
public decimal PackNumber { get; set; }
}
}

55
BBWY.Client/Models/APIModel/Response/PackTask/FeesItemResponse.cs

@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
namespace BBWY.Client.Models.APIModel.Response.PackTask
{
/// <summary>
/// 服务数据展示
/// </summary>
public class FeesItemResponse : NotifyObject
{
private List<ServiceItemResponse> serviceList = new List<ServiceItemResponse>();
public List<ServiceItemResponse> ServiceList { get => serviceList; set { Set(ref serviceList, value); } }
public decimal AllFees { get=> allFees; set { Set(ref allFees, value); } }
private decimal allFees;
public decimal SingleFees { get => singleFees; set { Set(ref singleFees, value); } }
private decimal singleFees;
public decimal TaskId { get => taskId; set { Set(ref taskId, value); } }
private decimal taskId;
}
public enum ServiceType
{
= 0,
= 1,
= 2
}
public class ServiceItemResponse
{
/// <summary>
/// 0增值服务 1打包服务 2耗材服务
/// </summary>
public ServiceType ServiceType { get; set; }
/// <summary>
/// 服务项目
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal? ItemPrice { get; set; }
/// <summary>
/// 数量
/// </summary>
public int? ItemCount { get; set; }
}
}

47
BBWY.Client/Models/APIModel/Response/PackTask/PackServiceResponse.cs

@ -0,0 +1,47 @@
using BBWY.Client.Models.PackTask;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel.Response.PackTask
{
public class PackServiceResponse
{
/// <summary>
/// 增值服务数据
/// </summary>
public List<PackItemModelResponse> IncreateList { get; set; }
/// <summary>
///工序服务数据
/// </summary>
public List<PackItemModelResponse> PackList { get; set; }
/// <summary>
/// 耗材服务数据
/// </summary>
public List<PackItemModelResponse> ConsumableServiceList { get; set; }
}
public class PackItemModelResponse
{
public string ItemName { get; set; }
/// <summary>
/// Member.userId
/// </summary>
public string SelectUserId { get; set; }
/// <summary>
/// 选中的服务Id
/// </summary>
public long SelectId { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string MemberName { get; set; }
/// <summary>
/// 数量
/// </summary>
public int ItemCount { get; set; }
}
}

423
BBWY.Client/Models/APIModel/Response/PackTask/PackTaskResultResponse.cs

@ -0,0 +1,423 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Automation.Peers;
using WebSocketSharp;
namespace BBWY.Client.Models.APIModel.Response.PackTask
{
public class PackTaskResultResponse
{
/// <summary>
/// 查询总数据(判断总页数)
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// 页面返回的数据
/// </summary>
public GetPackTaskDTO[] Items { get; set; }
}
public class GetPackTaskDTO
{
/// <summary>
/// SKU标题
/// </summary>
public string SkuName { get; set; }
/// <summary>
/// 图片链接
/// </summary>
public string Logo { get; set; }
/// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 需求方创建日期
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 任务状态(未完成=0,已完成=1,)
/// </summary>
public int TaskStatus { get; set; }
/// <summary>
/// 需求方团队
/// </summary>
public string DepartmentName { get; set; }
/// <summary>
/// 需求方店铺
/// </summary>
public string ShopName { get; set; }
/// <summary>
/// 货号
/// </summary>
public string ProductItemNum { get; set; }
/// <summary>
/// 货号品名
/// </summary>
public string BrandName { get; set; }
/// <summary>
/// 对接人
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 打包人
/// </summary>
public string[] PackUserName { get; set; }
/// <summary>
/// skuid
/// </summary>
public string SkuId { get; set; }
/// <summary>
/// sku数量
/// </summary>
public int SkuCount { get; set; }
/// <summary>
/// 打包类型(单件=0,多件=1)
/// </summary>
public int PackType { get; set; }
/// <summary>
/// 落仓(本地仓=0,齐越仓=1,京东仓=2)
/// </summary>
public int PositionType { get; set; }
/// <summary>
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
/// </summary>
public int BasicPack { get; set; }
/// <summary>
/// 增量1()
/// </summary>
public string Increment1 { get; set; }
/// <summary>
/// 增量2()
/// </summary>
public int? Increment2 { get; set; }
/// <summary>
/// 工序道数
/// </summary>
public int? ProcessCount { get; set; }
/// <summary>
/// 到货情况(待收货=0,部分收货=1,已到货=2)
/// </summary>
public int Availability { get; set; }
//todo: 条形码数据 合格证数据
///// <summary>
///// 打包费用
///// </summary>
//public FeesItemTypeDTO FeesItemTypeDTO { get; set; }
/// <summary>
///
/// </summary>
public FeesItemResponse FeesItemResponse { get; set; }
/// <summary>
/// 合格证位置(外部包装=0,产品包装=1)
/// </summary>
public int? CertificatePosition { get; set; }
/// <summary>
/// 箱子耗材(自带=0,4-13号纸箱=1-10,)
/// </summary>
public int? BoxConsumables { get; set; }
/// <summary>
/// sku配件名称
/// </summary>
public string SkuGoodsTitle { get; set; }
/// <summary>
/// 配件数
/// </summary>
public int GoodsNumber { get; set; }
/// <summary>
/// 气泡纸耗材(长=0,宽=1)
/// </summary>
public int? AirConsumables { get; set; }
/// <summary>
/// 注意事项(对接备注)
/// </summary>
public string MarkMessage { get; set; }
public BarCodeModel BarCodeDTO { get; set; }
public CertificateModel certificate { get; set; }
}
//public class FeesItemTypeDTO :NotifyObject
//{
// private bool isPaperBox;
// public bool IsPaperBox { get => isPaperBox; set { Set(ref isPaperBox, value); } }
// private bool isBoxNumber;
// public bool IsBoxNumber { get => isBoxNumber; set { Set(ref isBoxNumber, value); } }
// private bool isAcceptGoods;
// public bool IsAcceptGoods { get=>isAcceptGoods; set { Set(ref isAcceptGoods, value); } }
// private bool isSendGoods;
// /// <summary>
// /// 装箱 送货
// /// </summary>
// public bool IsSendGoods { get=> isSendGoods; set { Set(ref isSendGoods, value); } }
// private bool isRuturnGoods;
// /// <summary>
// /// 退货质检
// /// </summary>
// public bool IsRuturnGoods { get => isRuturnGoods; set { Set(ref isRuturnGoods, value); } }
// private bool isUpdatePack;
// /// <summary>
// /// 更换包装
// /// </summary>
// public bool IsUpdatePack { get => isUpdatePack; set { Set(ref isUpdatePack, value); } }
// private bool isUnpacking;
// /// <summary>
// /// 拆套
// /// </summary>
// public bool IsUnpacking { get => isUnpacking; set { Set(ref isUnpacking, value); } }
// private bool isBasicPackFees;
// /// <summary>
// /// 基础包装费
// /// </summary>
// public bool IsBasicPackFees { get => isBasicPackFees; set { Set(ref isBasicPackFees, value); } }
// private bool isBoxPackFees;
// /// <summary>
// /// 箱子包装费
// /// </summary>
// public bool IsBoxPackFees { get => isBoxPackFees; set { Set(ref isBoxPackFees, value); } }
// private bool isExpressPackFees;
// /// <summary>
// /// 快递袋包装费
// /// </summary>
// public bool IsExpressPackFees { get => isExpressPackFees; set { Set(ref isExpressPackFees, value); } }
// private bool isExpressCloseSideFees;
// /// <summary>
// /// 快递袋封边
// /// </summary>
// public bool IsExpressCloseSideFees { get => isExpressCloseSideFees; set { Set(ref isExpressCloseSideFees, value); } }
// private bool isAirPaperPackFees;
// /// <summary>
// /// 气泡纸包装费
// /// </summary>
// public bool IsAirPaperPackFees { get => isAirPaperPackFees; set { Set(ref isAirPaperPackFees, value); } }
// private bool isAirBagPackFees;
// /// <summary>
// /// 气泡袋包装费
// /// </summary>
// public bool IsAirBagPackFees { get => isAirBagPackFees; set { Set(ref isAirBagPackFees, value); } }
// private bool isPOPBagPackFees;
// /// <summary>
// /// POP包装费
// /// </summary>
// public bool IsPOPBagPackFees { get => isPOPBagPackFees; set { Set(ref isPOPBagPackFees, value); } }
// private bool isTapePackFees;
// /// <summary>
// /// 胶带工序
// /// </summary>
// public bool IsTapePackFees { get => isTapePackFees; set { Set(ref isTapePackFees, value); } }
// private bool isIncreateGoods;
// /// <summary>
// ///增量配件
// /// </summary>
// public bool IsIncreateGoods { get => isIncreateGoods; set { Set(ref isIncreateGoods, value); } }
// private bool isAirPaper;
// /// <summary>
// /// 气泡纸
// /// </summary>
// public bool IsAirPaper { get => isAirPaper; set { Set(ref isAirPaper, value); } }
// private bool isTape;
// /// <summary>
// /// 胶带
// /// </summary>
// public bool IsTape { get => isTape; set { Set(ref isTape, value); } }
// public void SetAllVisitity()
// {
// IsPaperBox = SetVisitity( PaperBox);
// IsBoxNumber = SetVisitity(Convert.ToDecimal(BoxNumber) );
// IsAcceptGoods = SetVisitity(AcceptGoods);
// IsSendGoods = SetVisitity(SendGoods);
// IsRuturnGoods = SetVisitity(RuturnGoods);
// IsUpdatePack = SetVisitity(UpdatePack);
// IsUnpacking = SetVisitity(Unpacking);
// IsBasicPackFees = SetVisitity(BasicPackFees);
// IsBoxPackFees = SetVisitity(BoxPackFees );
// IsExpressPackFees = SetVisitity(ExpressPackFees);
// IsExpressCloseSideFees = SetVisitity(ExpressCloseSideFees );
// IsAirPaperPackFees = SetVisitity(AirPaperPackFees);
// IsAirBagPackFees = SetVisitity(AirBagPackFees);
// IsPOPBagPackFees = SetVisitity(POPBagPackFees);
// IsTapePackFees = SetVisitity(TapePackFees);
// IsIncreateGoods = SetVisitity(IncreateGoods);
// IsAirPaper = SetVisitity(AirPaper);
// IsTape = SetVisitity(Tape);
// }
// private bool SetVisitity( decimal? item )
// {
// if (item != null )
// {
// return false;
// }
// else
// {
// return true;// 无数据隐藏
// }
// }
// /// <summary>
// /// 箱子价格
// /// </summary>
// public decimal? PaperBox { get; set; }
// public decimal PaperBoxNo { get; set; }
// /// <summary>
// /// 第几号箱子
// /// </summary>
// public int BoxNumber { get; set; }
// /// <summary>
// /// 收货 卸货
// /// </summary>
// public decimal? AcceptGoods { get; set; }
// public decimal AcceptGoodsNo { get; set; }
// /// <summary>
// /// 装箱 送货
// /// </summary>
// public decimal? SendGoods { get; set; }
// public decimal SendGoodsNo { get; set; }
// /// <summary>
// /// 退货质检
// /// </summary>
// public decimal? RuturnGoods { get; set; }
// public decimal RuturnGoodsNo { get; set; }
// /// <summary>
// /// 更换包装
// /// </summary>
// public decimal? UpdatePack { get; set; }
// public decimal UpdatePackNo { get; set; }
// /// <summary>
// /// 拆套
// /// </summary>
// public decimal? Unpacking { get; set; }
// public decimal UnpackingNo { get; set; }
// /// <summary>
// /// 基础包装费
// /// </summary>
// public decimal? BasicPackFees { get; set; }
// public decimal BasicPackFeesNo { get; set; }
// /// <summary>
// /// 箱子包装费
// /// </summary>
// public decimal? BoxPackFees { get; set; }
// public decimal BoxPackFeesNo { get; set; }
// /// <summary>
// /// 快递袋包装费
// /// </summary>
// public decimal? ExpressPackFees { get; set; }
// public decimal ExpressPackFeesNo { get; set; }
// /// <summary>
// /// 快递袋封边
// /// </summary>
// public decimal? ExpressCloseSideFees { get; set; }
// public decimal ExpressCloseSideFeesNo { get; set; }
// /// <summary>
// /// 气泡纸包装费
// /// </summary>
// public decimal? AirPaperPackFees { get; set; }
// public decimal AirPaperPackFeesNo { get; set; }
// /// <summary>
// /// 气泡袋包装费
// /// </summary>
// public decimal? AirBagPackFees { get; set; }
// public decimal AirBagPackFeesNo { get; set; }
// /// <summary>
// /// POP包装费
// /// </summary>
// public decimal? POPBagPackFees { get; set; }
// public decimal POPBagPackFeesNo { get; set; }
// /// <summary>
// /// 胶带工序
// /// </summary>
// public decimal? TapePackFees { get; set; }
// public decimal TapePackFeesNo { get; set; }
// /// <summary>
// ///增量配件
// /// </summary>
// public decimal? IncreateGoods { get; set; }
// public decimal IncreateGoodsNo { get; set; }
// /// <summary>
// /// 气泡纸
// /// </summary>
// public decimal? AirPaper { get; set; }
// public decimal AirPaperNo { get; set; }
// /// <summary>
// /// 胶带
// /// </summary>
// public decimal? Tape { get; set; }
// public decimal TapeNo { get; set; }
// /// <summary>
// /// 打包消耗的总费用(总数量)
// /// </summary>
// public decimal AllPackFees { get; set; }
// /// <summary>
// /// 总费用(单价)
// /// </summary>
// public decimal TotalFees { get; set; }
//}
}

18
BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuCountsResponse.cs

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel.Response.PackTask
{
public class ProductSkuCountsResponse
{
public int ArrivedCount { get; set; }
public int NoArrivedCount { get; set; }
public int SomeArrivedCount { get; set; }
public int WorryCount { get; set; }
}
}

60
BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs

@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel.Response.PackTask
{
public class ProductSkuResponse
{
/// <summary>
/// skuId
/// </summary>
public string Id { get; set; }
/// <summary>
/// 图片链接
/// </summary>
public string Logo { get; set; }
/// <summary>
/// SKU标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 品名
/// </summary>
public string BrandName { get; set; }
/// <summary>
/// 商品id
/// </summary>
public long ShopId { get; set; }
/// <summary>
/// 货号
/// </summary>
public string ProductItemNum { get; set; }
/// <summary>
/// spuId
/// </summary>
public string ProductId { get; set; }
public BarCodeModel BarCodeModel { get; set; }
/// <summary>
/// 合格证信息
/// </summary>
public CertificateModel Certificate { get; set; }
}
}

5
BBWY.Client/Models/APIModel/Response/PurchaseOrder/OnlinePurchase/PreviewOrderResponse.cs

@ -21,5 +21,10 @@
/// 交易方式 /// 交易方式
/// </summary> /// </summary>
public OrderTradeTypeResponse OrderTradeType { get; set; } public OrderTradeTypeResponse OrderTradeType { get; set; }
/// <summary>
/// 扩展数据
/// </summary>
public string Extensions { get; set; }
} }
} }

124
BBWY.Client/Models/Enums.cs

@ -207,4 +207,128 @@
{ {
, , , ,
} }
/// <summary>
/// 快递到货情况
/// </summary>
public enum TaskState
{
= 0,
= 1,
= 2,
= 3,
= 4,
= 5
}
/// <summary>
/// 打包类型
/// </summary>
public enum PackType
{
= 0,
= 1
}
/// <summary>
/// 基础包装
/// </summary>
public enum BasicPack
{
= 0,
= 1,
= 2
}
/// <summary>
/// 落仓
/// </summary>
public enum PositionType
{
= 0,
= 1,
= 2
}
/// <summary>
/// 合格证包装位置
/// </summary>
public enum CertificatePosition
{
= 0,
= 1,
=2
}
public enum Increment
{
= 0,
= 1,
= 2,
POP袋 = 3,
}
/// <summary>
/// 条形码模板
/// </summary>
public enum BarcodeLabelModel
{
/// <summary>
/// 标准模板
/// </summary>
barstander = 0,
/// <summary>
/// 精简模板
/// </summary>
barsimplify = 1,
}
/// <summary>
/// 合格证模板
/// </summary>
public enum CertificateLabelModel
{
/// <summary>
/// 合格证-标准单行
/// </summary>
CerStanderSingle = 0,
/// <summary>
/// 合格证-标准双行
/// </summary>
CerStanderDouble = 1,
/// <summary>
/// 合格证 3C 单行
/// </summary>
Cer3CSingle = 2,
/// <summary>
/// 合格证 3C 双行
/// </summary>
Cer3CDouble = 3,
}
/// <summary>
/// 合格证是否3c
/// </summary>
public enum CerHave3C
{
No3C = 0,
Is3C = 1
}
/// <summary>
/// 加急
/// </summary>
public enum Worry
{
= 0,
= 1
}
/// <summary>
/// 任务状态
/// </summary>
public enum TaskStateType
{
= 0,
= 1
}
} }

14
BBWY.Client/Models/Order/OrderDropShipping.cs

@ -19,7 +19,17 @@ namespace BBWY.Client.Models
public decimal DeliveryFreight { get => deliveryFreight; set { Set(ref deliveryFreight, value); } } public decimal DeliveryFreight { get => deliveryFreight; set { Set(ref deliveryFreight, value); } }
public string PurchaseOrderId { get => purchaseOrderId; set { Set(ref purchaseOrderId, value); } } public string PurchaseOrderId { get => purchaseOrderId; set { Set(ref purchaseOrderId, value); } }
public string MerchantOrderId { get => merchantOrderId; set { Set(ref merchantOrderId, value); } } public string MerchantOrderId { get => merchantOrderId; set { Set(ref merchantOrderId, value); } }
public Platform PurchasePlatform { get => purchasePlatform; set { Set(ref purchasePlatform, value); } } public Platform PurchasePlatform
{
get => purchasePlatform;
set
{
if (Set(ref purchasePlatform, value))
{
OnPurchasePlatformChanged?.Invoke(this);
}
}
}
public decimal PurchaseAmount { get => purchaseAmount; set { Set(ref purchaseAmount, value); } } public decimal PurchaseAmount { get => purchaseAmount; set { Set(ref purchaseAmount, value); } }
public decimal SkuAmount public decimal SkuAmount
@ -71,6 +81,8 @@ namespace BBWY.Client.Models
[JsonIgnore] [JsonIgnore]
public Action OnPurchaseAmountChanged { get; set; } public Action OnPurchaseAmountChanged { get; set; }
[JsonIgnore]
public Action<OrderDropShipping> OnPurchasePlatformChanged { get; set; }
public object Clone() public object Clone()
{ {

60
BBWY.Client/Models/PackTask/BarCodeModel.cs

@ -0,0 +1,60 @@
namespace BBWY.Client.Models
{
/// <summary>
/// 条形码
/// </summary>
public class BarCodeModel:NotifyObject
{
/// <summary>
/// 条形码id
/// </summary>
public long Id { get; set; }
private string brand;
/// <summary>
/// 品牌
/// </summary>
public string Brand { get=>brand; set { Set(ref brand, value); } }
private string brandName;
/// <summary>
/// 品名
/// </summary>
public string BrandName { get => brandName; set { Set(ref brandName, value); } }
private string producNo;
/// <summary>
/// 货号
/// </summary>
public string ProductNo { get => producNo; set { Set(ref producNo, value); } }
private string skuName;
/// <summary>
/// sku名称
/// </summary>
public string SkuName { get => skuName; set { Set(ref skuName, value); } }
private string skuId;
/// <summary>
/// skuId(条形码号=POP+SkuId)
/// </summary>
public string SkuId { get => skuId; set { Set(ref skuId, value); } }
private string modelNo;
/// <summary>
/// 型号
/// </summary>
public string ModelNo { get => modelNo; set { Set(ref modelNo, value); } }
/// <summary>
/// 模板标签
/// </summary>
public BarcodeLabelModel LabelModel { get; set; }
}
}

20
BBWY.Client/Models/PackTask/BarLabelModel.cs

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.PackTask
{
public class BarLabelModel
{
/// <summary>
/// 选中的模板
/// </summary>
public BarcodeLabelModel BarcodeLabelModel { get; set; }
/// <summary>
/// 模板数据
/// </summary>
Dictionary<string,string> Data =new Dictionary<string,string>();
}
}

89
BBWY.Client/Models/PackTask/CertificateModel.cs

@ -0,0 +1,89 @@
using System;
namespace BBWY.Client.Models
{
/// <summary>
/// 合格证
/// </summary>
public class CertificateModel : NotifyObject
{
/// <summary>
/// 合格证id
/// </summary>
public long Id { get; set; }
/// <summary>
/// skuid
/// </summary>
public string SkuId { get; set; }
private string brand;
/// <summary>
/// 品牌
/// </summary>
public string Brand { get => brand; set { Set(ref brand, value); } }
private string brandName;
/// <summary>
/// 品名
/// </summary>
public string BrandName { get => brandName; set { Set(ref brandName, value); } }
private string shader;
/// <summary>
/// 材质
/// </summary>
public string Shader { get => shader; set { Set(ref shader, value); } }
private string excuteStander;
/// <summary>
/// 执行标准
/// </summary>
public string ExcuteStander { get => excuteStander; set { Set(ref excuteStander, value); } }
private string productShop;
/// <summary>
/// 生产商
/// </summary>
public string ProductShop { get => productShop; set { Set(ref productShop, value); } }
private string productAdress;
/// <summary>
/// 地址
/// </summary>
public string ProductAdress { get => productAdress; set { Set(ref productAdress, value); } }
private string productNo;
/// <summary>
/// 型号(货号)
/// </summary>
public string ProductNo { get => productNo; set { Set(ref productNo, value); } }
/// <summary>
/// 生产日期
/// </summary>
public DateTime ProductDate { get; set; }
/// <summary>
/// 经销商
/// </summary>
public string Reseller { get; set; }
private int isLogo;
/// <summary>
/// 是否含3cLogo(0没有 ,1有)
/// </summary>
public int IsLogo { get => isLogo; set { Set(ref isLogo, value); } }
private string factoryNumber;
/// <summary>
/// 工厂编号
/// </summary>
public string FactoryNumber { get => factoryNumber; set { Set(ref factoryNumber, value); } }
private CertificateLabelModel labelModel;
public CertificateLabelModel LabelModel { get => labelModel; set { Set(ref labelModel, value); } }
}
}

128
BBWY.Client/Models/PackTask/ConsumableModel.cs

@ -0,0 +1,128 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel.Request;
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;
using System.Resources;
using System.Text;
using System.Windows.Input;
using System.Windows.Media.TextFormatting;
namespace BBWY.Client.Models.PackTask
{
public class ConsumableModel : BaseVM, IDenpendency
{
public ConsumableService consumableService;
public ICommand EditConsumableCommand { get; set; }
public ICommand DeletedConsumableCommand { get; set; }
public ICommand SaveConsumableCommand { get; set; }
public Action ReflashDatas { get; set; }
public ConsumableModel(ConsumableService consumableService)
{
this.consumableService = consumableService;
EditConsumableCommand = new RelayCommand(EditConsumable);
DeletedConsumableCommand = new RelayCommand<ObservableCollection<ConsumableModel>>(DeletedConsumable);
SaveConsumableCommand = new RelayCommand<object>(SaveConsumable);
}
public void SaveConsumable(object obj)
{
if (string.IsNullOrEmpty(Name))
{
new TipsWindow("耗材品名不能为空!").Show();
return;
}
if (this.Price == null)
{
new TipsWindow("价格不能为空!").Show();
return;
}
ApiResponse<object> res = null;
if (Id > 0)
{
res = consumableService.Edit(new ConsuableRequest
{
Id = Id,
Heigth = Heigth,
Length = Length,
Name = Name,
Price = Price.Value,
Remark = Remark,
Weigth = Weigth,
Width = Width
});
}
else
{
res = consumableService.Add(new ConsuableRequest
{
Heigth = Heigth,
Length = Length,
Name = Name,
Price = Price.Value,
Remark = Remark,
Weigth = Weigth,
Width = Width
});
}
if (res != null && res.Success)
{
var win = obj as System.Windows.Window;
if (ReflashDatas != null) ReflashDatas();
win.Close();
}
else
{
new TipsWindow(res.Msg).Show();
}
}
public void DeletedConsumable(ObservableCollection<ConsumableModel> list)
{
var res = consumableService.Deleted(Id);
if (res.Success)
{
list.Remove(this);
}
}
public void EditConsumable()
{
EditConsumable add = new EditConsumable(this);
add.Show();
}
private long id;
public long Id { get => id; set { Set(ref id, value); } }
private string name;
public string Name { get => name; set { Set(ref name, value); } }
private decimal? price;
public decimal? Price { get => price; set { Set(ref price, value); } }
private double? weigth;
public double? Weigth { get => weigth; set { Set(ref weigth, value); } }
private double? length;
public double? Length { get => length; set { Set(ref length, value); } }
private double? width;
public double? Width { get => width; set { Set(ref width, value); } }
private double? heigth;
public double? Heigth { get => heigth; set { Set(ref heigth, value); } }
private string remark;
public string Remark { get => remark; set { Set(ref remark, value); } }
}
}

29
BBWY.Client/Models/PackTask/FeesDetailModel.cs

@ -0,0 +1,29 @@
namespace BBWY.Client.Models
{
/// <summary>
/// 收费明细表
/// </summary>
public class FeesDetailModel : NotifyObject
{
public long Id { get; set; }
/// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 收费分类id(格式 [1,2,2,1])
/// </summary>
public string FeesTypeId { get; set; }
/// <summary>
/// 收费项目id(格式 [1,2,2,1])
/// </summary>
public string FeesItemId { get; set; }
/// <summary>
/// 收费小计(格式 [1,2,2,1])
/// </summary>
public string SingleFees { get; set; }
}
}

25
BBWY.Client/Models/PackTask/FeesItemModel.cs

@ -0,0 +1,25 @@
namespace BBWY.Client.Models
{
/// <summary>
///收费项
/// </summary>
public class FeesItemModel : NotifyObject
{
public long Id { get; set; }
/// <summary>
/// 分类id
/// </summary>
public int TypeId { get; set; }
/// <summary>
/// 项目id
/// </summary>
public int ItemId { get; set; }
/// <summary>
/// 收费价格
/// </summary>
public decimal FeesPrice { get; set; }
}
}

20
BBWY.Client/Models/PackTask/IncreateModel.cs

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.PackTask
{
public class IncreateModel:NotifyObject
{
private string increateName;
public string IncreateName { get => increateName; set { Set(ref increateName, value); } }
private bool isSelected;
public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } }
public override string ToString()
{
return IncreateName;
}
}
}

14
BBWY.Client/Models/PackTask/IncreateServiceModel.cs

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.PackTask
{
public class IncreateServiceModel
{
public long Id { get; set; }
public string ServiceName { get; set; }
public decimal ServicePrice { get; set; }
}
}

69
BBWY.Client/Models/PackTask/PackItemModel.cs

@ -0,0 +1,69 @@
using BBWY.Client.APIServices;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace BBWY.Client.Models.PackTask
{
public class PackItemModel : NotifyObject
{
private string itemName;
public string ItemName { get => itemName; set { Set(ref itemName, value); } }
private string selectUserId;
/// <summary>
/// Member.userId
/// </summary>
public string SelectUserId { get => selectUserId; set { Set(ref selectUserId, value); } }
private long selectId;
/// <summary>
/// 选中的Id
/// </summary>
public long SelectId { get => selectId; set { Set(ref selectId, value); } }
private string memberName;
public string MemberName { get => memberName; set { Set(ref memberName, value); } }
private int itemCount;
public int ItemCount { get => itemCount; set { Set(ref itemCount, value); } }
public ObservableCollection<IncreateServiceModel> IncreateServiceList { get; set; }
public ObservableCollection<PackUser> MemberList { get; set; }
public ObservableCollection<ConsumableModel> ConsumableList { get; set; }
public ObservableCollection<WorkProcessModel> PackServiceList { get; set; }
/// <summary>
/// 设置列表的 是否编辑属性
/// </summary>
public bool IsEnable { get; set; }
public ICommand DeleteServiceCommand { get; set; }
public PackItemModel(ObservableCollection<IncreateServiceModel> IncreateServiceList=null,
ObservableCollection<PackUser> MemberList=null,
ObservableCollection<ConsumableModel> ConsumableList=null,
ObservableCollection<WorkProcessModel> PackServiceList=null
)
{
DeleteServiceCommand = new RelayCommand<ObservableCollection<PackItemModel>>(DeleteService);
this. IncreateServiceList = IncreateServiceList;
this.PackServiceList = PackServiceList;
this.MemberList = MemberList;
this.ConsumableList = ConsumableList;
}
private void DeleteService(ObservableCollection<PackItemModel> list)
{
list.Remove(this);
}
}
}

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

@ -0,0 +1,502 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.ViewModels;
using BBWY.Client.Views.PackTask;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Input;
namespace BBWY.Client.Models
{
/// <summary>
/// 打包任务 数据绑定
/// </summary>
public class PackTaskModel : BaseVM
{
private bool isShowFees;
public bool IsShowFees { get => isShowFees; set { Set(ref isShowFees, value); } }
private long id;
public long Id { get => id; set { Set(ref id, value); } }
private readonly PackTaskService packTaskService;
WorkProcessService workProcessService;
public ICommand SetTaskStatusCommand { get; set; }
public ICommand PrintBarcodeCommand { get; set; }
public ICommand PrintCerCommand { get; set; }
public ICommand LookCerCommand { get; set; }
public ICommand LookBarCommand { get; set; }
public ICommand SetServiceCommand { get; set; }
IncreateServiceService increateServiceService;
public ConsumableService consumableService;
public PackTaskModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService)
{
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);
this.packTaskService = packTaskService;
this.consumableService = consumableService;
this.workProcessService = workProcessService;
this.increateServiceService = increateServiceService;
}
private void SetService()
{
//加载数据
ServiceWindow service = new ServiceWindow(packTaskService, TaskId, SkuCount, consumableService, workProcessService, increateServiceService);//设置
service.model.SetAllFees = new Action<FeesItemResponse, List<string>>((feesItem, packUsers) =>
{
FeesItemResponse = feesItem;
PackUser = string.Join("\r\n", packUsers);
IsShowFees = feesItem.AllFees > 0 ? true : false;
});
service.Show();
}
/// <summary>
/// 查看合格证
/// </summary>
private void LookCer()
{
if (CertificateModel == null)
{
new TipsWindow("该任务无设置合格证信息,无法查看!").ShowDialog();
return;
}
LookCerWindow lookCerWindow = new LookCerWindow(CertificateModel);
lookCerWindow.Show();
}
/// <summary>
/// 查看条形码
/// </summary>
private void LookBar()
{
if (BarCodeModel == null)
{
new TipsWindow("该任务无设置条形码信息,无法查看!").ShowDialog();
return;
}
LookBarCodeWindow look = new LookBarCodeWindow(new BarCodeModel
{
Brand = BarCodeModel.Brand,
BrandName = BarCodeModel.BrandName,
LabelModel = BarCodeModel.LabelModel,
ProductNo = BarCodeModel.ProductNo,
SkuId = BarCodeModel.SkuId,
SkuName = BarCodeModel.SkuName
});
look.Show();
}
private void PrintCer()
{
if (CertificateModel == null)
{
new TipsWindow("该任务无设置合格证信息,无法打印!").ShowDialog();
return;
}
PrintWindow printWindow = new PrintWindow();
printWindow.LabelName = CertificateModel.LabelModel.ToString();//加载模板信息
printWindow.certificateModel = certificateModel;
printWindow.LoadData();
printWindow.Datas = LoadCerLabelModels();
printWindow.Show();
}
/// <summary>
/// 打印条形码
/// </summary>
private void PrintBarcode()
{
if (BarCodeModel == null)
{
new TipsWindow("该任务无设置条形码信息,无法打印!").ShowDialog();
return;
}
PrintWindow printWindow = new PrintWindow();
printWindow.LabelName = BarCodeModel.LabelModel.ToString();//加载模板信息
printWindow.barCodeModel = new BarCodeModel
{
Brand = BarCodeModel.Brand,
BrandName = BarCodeModel.BrandName,
LabelModel = BarCodeModel.LabelModel,
ProductNo = BarCodeModel.ProductNo,
SkuId = BarCodeModel.SkuId,
SkuName = BarCodeModel.SkuName
};
printWindow.LoadData();
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)
{
this.TaskStatus = TaskStateType.;
new TipsWindow("修改成功").Show();
}
}
public Dictionary<string, string> LoadBarLabelModels()
{
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("pinming", $"品名: {BarCodeModel.BrandName}");
data.Add("guige", $"规格: {BarCodeModel.SkuName}");
data.Add("pop", $"POP{BarCodeModel.SkuId}");
switch (BarCodeModel.LabelModel)
{
case BarcodeLabelModel.barstander:
data.Add("pinpai", $"品牌: {BarCodeModel.Brand}");
data.Add("xinghao", $"型号: {BarCodeModel.ProductNo}");
return data;
case BarcodeLabelModel.barsimplify:
return data;
default:
break;
}
return data;
}
public Dictionary<string, string> LoadCerLabelModels()
{
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("pinming", $"品名: {CertificateModel.BrandName}");
data.Add("pinpai", $"品牌: {CertificateModel.Brand}");
data.Add("xinghao", $"型号: {CertificateModel.ProductNo}");
data.Add("dizhi", $"地址: {CertificateModel.ProductAdress}");
data.Add("caizhi", $"材质: {CertificateModel.Shader}");
data.Add("changshang", $"生产商: {CertificateModel.ProductShop}");
switch (CertificateModel.IsLogo)
{
case 0://无图
data.Add("gongchangid", $"无");
break;
case 1://有图
data.Add("gongchangid", $"{CertificateModel.FactoryNumber}");
break;
default:
break;
}
string[] excutes = CertificateModel.ExcuteStander.Split(',', StringSplitOptions.RemoveEmptyEntries);
StringBuilder sb = new StringBuilder();
sb.Append("执行标准: ");
for (int i = 0; i < excutes.Count(); i++)
{
if (i % 2 == 0 && i > 0)//间隔两个换行
{
sb.Append("\r\n").Append(" ");
}
sb.Append(excutes[i]).Append(" ");
}
sb.Remove(sb.Length - 3, 3);
data.Add("biaozhun", sb.ToString());
return data;
}
private DateTime endTime;
/// <summary>
/// 提交时间
/// </summary>
public DateTime EndTime { get => endTime; set { Set(ref endTime, value); } }
private long taskId;
/// <summary>
/// 绑定数据
/// </summary>
public long TaskId { get => taskId; set { Set(ref taskId, value); } }
private string departmentName;
/// <summary>
/// 部门名称
/// </summary>
public string DepartmentName { get => departmentName; set { Set(ref departmentName, value); } }
private string acceptName;
/// <summary>
/// 对接人
/// </summary>
public string AcceptName { get => acceptName; set { Set(ref acceptName, value); } }
private int skuCount;
/// <summary>
/// sku数量
/// </summary>
public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } }
private TaskState availability;
/// <summary>
/// 到货情况(待收货=0,部分收货=1,已到货=2)
/// </summary>
public TaskState Availability { get => availability; set { Set(ref availability, value); } }
private TaskStateType taskStatus;
/// <summary>
/// 任务状态(未完成=0,已完成=1)
/// </summary>
public TaskStateType TaskStatus { get => taskStatus; set { Set(ref taskStatus, value); } }
private PackType packType;
/// <summary>
/// 打包类型(单件=0,多件=1)
/// </summary>
public PackType PackType { get => packType; set { Set(ref packType, value); } }
private int goodsNumber;
/// <summary>
/// 配件数
/// </summary>
public int GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } }
private string skuTitle;
/// <summary>
/// sku配件商品名称
/// </summary>
public string SkuTitle { get => skuTitle; set { Set(ref skuTitle, value); } }
private BasicPack basicPack;
/// <summary>
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
/// </summary>
public BasicPack BasicPack { get => basicPack; set { Set(ref basicPack, value); } }
private string increment1;
/// <summary>
/// 增量1()
/// </summary>
public string Increment1 { get => increment1; set { Set(ref increment1, value); } }
private Increment increment2;
/// <summary>
/// 增量2()
/// </summary>
public Increment Increment2 { get => increment2; set { Set(ref increment2, value); } }
private PositionType positionType;
/// <summary>
/// 落仓(本地仓=0,齐越仓=1,京东仓=2)
/// </summary>
public PositionType PositionType { get => positionType; set { Set(ref positionType, value); } }
#region 条形码数据
/// <summary>
/// 条形码id
/// </summary>
public long BarCodeId { get; set; }
/// <summary>
/// 标签模板
/// </summary>
public BarcodeLabelModel LabelModel { get; set; }
private string brand;
/// <summary>
/// 品牌
/// </summary>
public string Brand { get => brand; set { Set(ref brand, value); } }
private string brandName;
/// <summary>
/// 品名
/// </summary>
public string BrandName { get => brandName; set { Set(ref brandName, value); } }
private string producNo;
/// <summary>
/// 货号
/// </summary>
public string ProductNo { get => producNo; set { Set(ref producNo, value); } }
private string skuName;
/// <summary>
/// sku名称
/// </summary>
public string SkuName { get => skuName; set { Set(ref skuName, value); } }
private string skuId;
/// <summary>
/// skuId(条形码号=POP+SkuId)
/// </summary>
public string SkuId { get => skuId; set { Set(ref skuId, value); } }
private string modelNo;
/// <summary>
/// 型号
/// </summary>
public string ModelNo { get => modelNo; set { Set(ref modelNo, value); } }
#endregion
private BarCodeModel barCodeModel;
/// <summary>
/// 合格证
/// </summary>
public BarCodeModel BarCodeModel { get => barCodeModel; set { Set(ref barCodeModel, value); } }
private CertificateModel certificateModel;
/// <summary>
/// 合格证
/// </summary>
public CertificateModel CertificateModel { get => certificateModel; set { Set(ref certificateModel, value); } }
/// <summary>
/// 合格证位置(外部包装=0,产品包装=1)
/// </summary>
private CertificatePosition certificatePosition;
/// <summary>
/// 合格证位置(外部包装=0,产品包装=1)
/// </summary>
public CertificatePosition CertificatePosition { get => certificatePosition; set { Set(ref certificatePosition, value); } }
/// <summary>
/// 注意事项(对接备注)
/// </summary>
private string markMessage;
/// <summary>
/// 注意事项(对接备注)
/// </summary>
public string MarkMessage { get => markMessage; set { Set(ref markMessage, value); } }
/// <summary>
/// 服务收费 (单个任务id 消耗的总费用)
/// </summary>
private decimal feesMoney;
/// <summary>
/// 服务收费 (单个任务id 消耗的总费用)
/// </summary>
public decimal FeesMoney { get => feesMoney; set { Set(ref feesMoney, value); } }
/// <summary>
/// 打包员
/// </summary>
private string packUser;
/// <summary>
/// 打包员
/// </summary>
public string PackUser { get => packUser; set { Set(ref packUser, value); } }
//public FeesItemTypeDTO FeesItemTypeDTO { get; set; }
private FeesItemResponse feesItemResponse;
public FeesItemResponse FeesItemResponse { get => feesItemResponse; set { Set(ref feesItemResponse, value); } }
public IList<SkuMessage> ItemList { get; set; }
}
public class SkuMessage : NotifyObject
{
private long id;
public long Id { get => id; set { Set(ref id, value); } }
/// <summary>
/// 店铺Sku图链接
/// </summary>
private string logo;
/// <summary>
/// 店铺Sku图链接
/// </summary>
public string Logo { get => logo; set { Set(ref logo, value); } }
/// <summary>
/// 采购Sku名称
/// </summary>
private string skuName;
/// <summary>
/// 采购Sku名称
/// </summary>
public string SkuName { get => skuName; set { Set(ref skuName, value); } }
/// <summary>
/// 货号品名(手写上传)
/// </summary>
private string brandName;
/// <summary>
/// 货号品名(手写上传)
/// </summary>
public string BrandName { get => brandName; set { Set(ref brandName, value); } }
/// <summary>
/// 需求方店铺id
/// </summary>
private string shopName;
/// <summary>
/// 需求方店铺id
/// </summary>
public string ShopName { get => shopName; set { Set(ref shopName, value); } }
/// <summary>
/// 货号
/// </summary>
private string goodsNo;
/// <summary>
/// 货号
/// </summary>
public string GoodsNo { get => goodsNo; set { Set(ref goodsNo, value); } }
}
}

27
BBWY.Client/Models/PackTask/PackUser.cs

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.PackTask
{
public class PackUser
{
/// <summary>
/// 用户Id
/// </summary>
public string Id { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 团队Id
/// </summary>
public string DepartmentId { get; set; }
/// <summary>
/// 用户名(花名)
/// </summary>
public string UserNick { get; set; }
}
}

48
BBWY.Client/Models/PackTask/TaskPersonModel.cs

@ -0,0 +1,48 @@
namespace BBWY.Client.Models
{
/// <summary>
/// 个人任务打包情况
/// </summary>
public class TaskPersonModel : NotifyObject
{
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 打包人
/// </summary>
public string UserId { get; set; }
/// <summary>
/// 打包数量(格式 1,2,2,1 )
/// </summary>
public string PackNumber { get; set; }
/// <summary>
/// 收费分类id(格式 [1,2,2,1])
/// </summary>
public string FeesTypeId { get; set; }
/// <summary>
/// 收费项目id(格式 [1,2,2,1] )
/// </summary>
public string FeesItemId { get; set; }
/// <summary>
/// 单项小计 (格式 [5,2,2,2])
/// </summary>
public string SingleFees { get; set; }
/// <summary>
/// 总费用
/// </summary>
public decimal AllFees { get; set; }
}
}

19
BBWY.Client/Models/PackTask/UserDepartment.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.PackTask
{
/// <summary>
/// 团队名
/// </summary>
/// <param name="Id">团队id</param>
/// <param name="DePartmentName">团队名称</param>
public class UserDepartment
{
public string Id { get; set; }
public string DePartmentName { get; set; }
}
}

30
BBWY.Client/Models/PackTask/UserFeesModel.cs

@ -0,0 +1,30 @@
using System;
namespace BBWY.Client.Models
{
/// <summary>
/// 个人收入情况
/// </summary>
public class UserFeesModel : NotifyObject
{
/// <summary>
/// 主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 成员id
/// </summary>
public string UserId { get; set; }
/// <summary>
/// 收费
/// </summary>
public decimal Fees { get; set; }
/// <summary>
/// 日期
/// </summary>
public DateTime DateTime { get; set; }
}
}

19
BBWY.Client/Models/PackTask/WorkProcessModel.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.PackTask
{
public class WorkProcessModel
{
public long Id { get; set; }
/// <summary>
/// 工序名称
/// </summary>
public string ProcessName { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal ProcessPrice { get; set; }
}
}

4
BBWY.Client/Models/Product/Product.cs

@ -10,6 +10,10 @@ namespace BBWY.Client.Models
PurchaserList = new ObservableCollection<Purchaser>(); PurchaserList = new ObservableCollection<Purchaser>();
PurchasePlatformList = new List<Platform>(); PurchasePlatformList = new List<Platform>();
} }
/// <summary>
/// 品牌
/// </summary>
public string BrandName { get; set; }
private Platform selectedPurchasePlatformModel; private Platform selectedPurchasePlatformModel;

2
BBWY.Client/Models/Product/Purchaser.cs

@ -20,6 +20,6 @@
public string Location { get; set; } public string Location { get; set; }
//public Platform Platform { get; set; } public Platform Platform { get; set; }
} }
} }

BIN
BBWY.Client/Resources/Images/3c.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
BBWY.Client/Resources/Images/barcode.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
BBWY.Client/Resources/LabelNames/Cer3CDouble.btw

Binary file not shown.

BIN
BBWY.Client/Resources/LabelNames/Cer3CSingle.btw

Binary file not shown.

BIN
BBWY.Client/Resources/LabelNames/CerStanderDouble.btw

Binary file not shown.

BIN
BBWY.Client/Resources/LabelNames/CerStanderSingle.btw

Binary file not shown.

BIN
BBWY.Client/Resources/LabelNames/barsimplify.btw

Binary file not shown.

BIN
BBWY.Client/Resources/LabelNames/barstander.btw

Binary file not shown.

4
BBWY.Client/Resources/Themes/Color.xaml

@ -22,6 +22,8 @@
<SolidColorBrush x:Key="Border.Background" Color="#F2F2F2"/> <SolidColorBrush x:Key="Border.Background" Color="#F2F2F2"/>
<SolidColorBrush x:Key="Button.Background" Color="#7666f9"/>
<SolidColorBrush x:Key="Button.Selected.Background" Color="#8080FF"/> <SolidColorBrush x:Key="Button.Selected.Background" Color="#8080FF"/>
<SolidColorBrush x:Key="Button.Normal.Background" Color="#F2F2F2"/> <SolidColorBrush x:Key="Button.Normal.Background" Color="#F2F2F2"/>
@ -31,4 +33,6 @@
<SolidColorBrush x:Key="Text.Pink" Color="#EC808D"/> <SolidColorBrush x:Key="Text.Pink" Color="#EC808D"/>
<SolidColorBrush x:Key="Text.Gray" Color="#333333"/>
</ResourceDictionary> </ResourceDictionary>

107
BBWY.Client/ViewModels/MainViewModel.cs

@ -114,64 +114,105 @@ namespace BBWY.Client.ViewModels
dongdongHelper.StartInJection(); dongdongHelper.StartInJection();
} }
/// <summary>
/// 动态创建菜单
/// </summary>
private void CreateMenu() private void CreateMenu()
{ {
if (GlobalContext.User.TeamName == "刷单组") if (GlobalContext.User.TeamName == "打包组" || GlobalContext.User.TeamName == "发货组" || GlobalContext.User.TeamName == "仓储部")
{ {
App.Current.Dispatcher.Invoke(() => MenuList.Add(new MenuModel()
App.Current.Dispatcher.Invoke(() => {
MenuList.Add(new MenuModel()
{
Name = "齐库",
ChildList = new List<MenuModel>()
{
new MenuModel(){ Name="打包任务",Url="/Views/PackTask/WareHouseList.xaml" },
new MenuModel(){ Name="耗材管理",Url="/Views/PackTask/Consumable.xaml" }
}
});
});
}
else
{
if (GlobalContext.User.TeamName == "刷单组")
{ {
Name = "订单管理", App.Current.Dispatcher.Invoke(() => MenuList.Add(new MenuModel()
ChildList = new List<MenuModel>() {
Name = "订单管理",
ChildList = new List<MenuModel>()
{ {
new MenuModel(){ Name="刷单组",Url="/Views/Order/SDGroup.xaml" } new MenuModel(){ Name="刷单组",Url="/Views/Order/SDGroup.xaml" }
} }
})); }));
return; return;
} }
App.Current.Dispatcher.Invoke(() => App.Current.Dispatcher.Invoke(() =>
{
MenuList.Add(new MenuModel()
{ {
Name = "订单管理", MenuList.Add(new MenuModel()
ChildList = new List<MenuModel>() {
Name = "订单管理",
ChildList = new List<MenuModel>()
{ {
new MenuModel(){ Name="最近订单",Url="/Views/Order/OrderList.xaml" } new MenuModel(){ Name="最近订单",Url="/Views/Order/OrderList.xaml" }
} }
}); });
MenuList.Add(new MenuModel()
{
Name = "商品管理",
ChildList = new List<MenuModel>()
MenuList.Add(new MenuModel()
{ {
Name = "商品管理",
ChildList = new List<MenuModel>()
{
new MenuModel(){ Name="货源管理",Url="/Views/Ware/WareManager.xaml" }, new MenuModel(){ Name="货源管理",Url="/Views/Ware/WareManager.xaml" },
new MenuModel(){ Name="产品库存",Url="/Views/Ware/WareStock.xaml" } new MenuModel(){ Name="产品库存",Url="/Views/Ware/WareStock.xaml" }
}
});
MenuList.Add(new MenuModel()
{
Name = "齐库",
ChildList = new List<MenuModel>()
{
new MenuModel(){ Name="发布任务",Url="/Views/PackTask/TaskList.xaml" },
} }
}); });
MenuList.Add(new MenuModel() MenuList.Add(new MenuModel()
{ {
Name = "设置", Name = "设置",
ChildList = new List<MenuModel>() ChildList = new List<MenuModel>()
{ {
new MenuModel(){ Name="店铺设置",Url="/Views/Setting/ShopSetting.xaml" }, new MenuModel(){ Name="店铺设置",Url="/Views/Setting/ShopSetting.xaml" },
new MenuModel(){ Name="团队配置",Url="/Views/Setting/TeamSetting.xaml" } new MenuModel(){ Name="团队配置",Url="/Views/Setting/TeamSetting.xaml" }
} }
});
}); });
});
if (managerDepartment.Contains(GlobalContext.User.TeamName) || managerDepartment.Any(m => GlobalContext.User.SonDepartmentNames.Contains(m))) if (managerDepartment.Contains(GlobalContext.User.TeamName) || managerDepartment.Any(m => GlobalContext.User.SonDepartmentNames.Contains(m)))
{
App.Current.Dispatcher.Invoke(() => MenuList.Add(new MenuModel()
{ {
Name = "财务端", App.Current.Dispatcher.Invoke(() => MenuList.Add(new MenuModel()
ChildList = new List<MenuModel>() {
Name = "财务端",
ChildList = new List<MenuModel>()
{ {
new MenuModel(){ Name="采购审计",Url="/Views/FinancialTerminal/ProcurementAudit.xaml" }, new MenuModel(){ Name="采购审计",Url="/Views/FinancialTerminal/ProcurementAudit.xaml" },
new MenuModel(){ Name="费用矫正",Url="/Views/BillCorrection/BillCorrectionView.xaml" } new MenuModel(){ Name="费用矫正",Url="/Views/BillCorrection/BillCorrectionView.xaml" }
} }
})); }));
}
} }
} }
private void Exit(System.ComponentModel.CancelEventArgs e) private void Exit(System.ComponentModel.CancelEventArgs e)
@ -200,6 +241,12 @@ namespace BBWY.Client.ViewModels
//if (GlobalContext.User.TeamName == "刷单组") //if (GlobalContext.User.TeamName == "刷单组")
// return; // return;
if (GlobalContext.User.TeamName == "打包组" || GlobalContext.User.TeamName == "发货组" || GlobalContext.User.TeamName == "仓储部")
{
return;
}
IList<Department> departmentList = null; IList<Department> departmentList = null;
if (GlobalContext.User.TeamName == "刷单组" || if (GlobalContext.User.TeamName == "刷单组" ||
managerDepartment.Contains(GlobalContext.User.TeamName) || managerDepartment.Contains(GlobalContext.User.TeamName) ||

22
BBWY.Client/ViewModels/Order/ChoosePurchaseSchemeViewModel.cs

@ -103,23 +103,17 @@ namespace BBWY.Client.ViewModels
public void PreviewPurchase(Purchaser purchaser) public void PreviewPurchase(Purchaser purchaser)
{ {
var count = globalContext.User.Shop.PurchaseAccountList == null ? 0 : globalContext.User.Shop.PurchaseAccountList.Count(); var purchaseAccount = globalContext.User.Shop.PurchaseAccountList.FirstOrDefault(pa => pa.PurchasePlatformId == purchaser.Platform);
if (count > 1) if (purchaseAccount == null)
{ {
//选择采购账号 MessageBox.Show($"缺少{purchaser.Platform}的采购账号", "提示");
//验证采购账号的所属平台
}
else if (count == 1)
{
var p = new _1688Purchase(order, purchaser, globalContext.User.Shop.PurchaseAccountList[0]);
p.ShowDialog();
GalaSoft.MvvmLight.Messaging.Messenger.Default.Send<object>(null, "ChoosePurchaseScheme_Close");
}
else
{
MessageBox.Show("缺少采购账号", "提示");
return; return;
} }
var p = new _1688Purchase(order, purchaser, purchaseAccount);
p.ShowDialog();
GalaSoft.MvvmLight.Messaging.Messenger.Default.Send<object>(null, "ChoosePurchaseScheme_Close");
} }
} }
} }

17
BBWY.Client/ViewModels/Order/OrderListViewModel.cs

@ -235,7 +235,10 @@ namespace BBWY.Client.ViewModels
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail); OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail);
SearchOrderCommand.Execute(null); SearchOrderCommand.Execute(null);
} }
/// <summary>
/// 初始化查询参数
/// </summary>
/// <param name="isInitDate"></param>
private void InitSearchParam(bool isInitDate = false) private void InitSearchParam(bool isInitDate = false)
{ {
this.OrderState = null; this.OrderState = null;
@ -278,9 +281,14 @@ namespace BBWY.Client.ViewModels
OrderCount = 0; OrderCount = 0;
} }
/// <summary>
/// 通过订单状态 筛选订单数据
/// </summary>
/// <param name="orderState">订单状态</param>
public void SetOrderState(OrderState? orderState) public void SetOrderState(OrderState? orderState)
{ {
InitSearchParam(orderState == null);
InitSearchParam(orderState == null); //初始化查询参数 orderState == null 全部
this.OrderState = orderState; this.OrderState = orderState;
Task.Factory.StartNew(() => LoadOrder(1)); //选择状态查询订单 Task.Factory.StartNew(() => LoadOrder(1)); //选择状态查询订单
} }
@ -375,6 +383,10 @@ namespace BBWY.Client.ViewModels
} }
/// <summary>
///加载页面数据
/// </summary>
/// <param name="pageIndex"></param>
private void LoadOrder(int pageIndex) private void LoadOrder(int pageIndex)
{ {
if (IncludeAfterOrder == true) if (IncludeAfterOrder == true)
@ -425,6 +437,7 @@ namespace BBWY.Client.ViewModels
var orderList = response.Data.Items.Map<IList<Order>>(); var orderList = response.Data.Items.Map<IList<Order>>();
App.Current.Dispatcher.Invoke(() => App.Current.Dispatcher.Invoke(() =>
{ {
OrderList.Clear(); OrderList.Clear();
foreach (var order in orderList) foreach (var order in orderList)
{ {

148
BBWY.Client/ViewModels/PackTask/ConsumableViewModel.cs

@ -0,0 +1,148 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.PackTask;
using BBWY.Client.Views.PackTask;
using BBWY.Common.Models;
using BBWY.Controls;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Messaging;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Input;
namespace BBWY.Client.ViewModels.PackTask
{
public class ConsumableViewModel : BaseVM, IDenpendency
{
private bool isOpenAdd = true;
public bool IsOpenAdd { get => isOpenAdd; set { Set(ref isOpenAdd, value); } }
private int pageIndex = 1;
public int PageIndex { get => pageIndex; set { Set(ref pageIndex, value); } }
private int pageSize = 10;
public int PageSize { get => pageSize; set { Set(ref pageSize, value); } }
private int orderCount;//总数量
public int OrderCount { get => orderCount; set { Set(ref orderCount, value); } }
private bool isLoading;
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } }
private string searchName;
public string SearchName { get => searchName; set { Set(ref searchName, value); } }
public ConsumableModel ConsumableModel { get => consumableModel; set { Set(ref consumableModel, value); } }
private ConsumableModel consumableModel;
private ObservableCollection<ConsumableModel> consumableList;
public ObservableCollection<ConsumableModel> ConsumableList { get => consumableList; set { Set(ref consumableList, value); } }
public ICommand TaskPageIndexChangedCommand { get; set; }
public ICommand AddConsumableCommand { get; set; }
public ICommand SearchConsumableCommand { get; set; }
private readonly ConsumableService consumableService;
// public Action ReflashDatas { get; set; }
public ConsumableViewModel(ConsumableService consumableService)
{
this.consumableService = consumableService;
ConsumableModel = new ConsumableModel(consumableService);
// ConsumableModel.ReflashDatas = ReflashDatas;
ConsumableList = new ObservableCollection<ConsumableModel>();
AddConsumableCommand = new RelayCommand(AddConsumable);
SearchConsumableCommand = new RelayCommand(SearchConsumable);
TaskPageIndexChangedCommand = new RelayCommand<PageArgs>(p =>
{
LoadIndex(p.PageIndex);
});
}
private void LoadIndex(int pageIndex)
{
PageIndex = pageIndex;//
SearchConsumable();
}
private void SearchConsumable()
{
Task.Factory.StartNew(() =>
{
isLoading = true;
var res = consumableService.Search(new Models.APIModel.Request.ConsumableSearchRequest
{
Name = searchName,
PageIndex = PageIndex,
PageSize = PageSize,
});
if (res.Success)
{
ConsumableList = new ObservableCollection<ConsumableModel>();
if (res.Data != null && res.Data.Consumables != null && res.Data.Consumables.Count() > 0)
{
OrderCount = res.Data.OrderCount;
foreach (var item in res.Data.Consumables)
{
App.Current.Dispatcher.Invoke(() =>
{
ConsumableList.Add(new ConsumableModel(consumableService)
{
Heigth = item.Heigth,
Id = item.Id,
Name = item.Name,
Length = item.Length,
Price = item.Price,
Remark = item.Remark,
Weigth = item.Weigth,
Width = item.Width
});
});
}
}
}
isLoading = false;
});
}
private void AddConsumable()
{
//ConsumableModel = new ConsumableModel(consumableService);
//IsOpenAdd = true;
var model = new ConsumableModel(consumableService)
{ //ReflashDatas = ReflashDatas
};
model.ReflashDatas = new Action(() =>
{
SearchConsumable();
Messenger.Default.Send(true);
});
EditConsumable add = new EditConsumable(model);
add.ShowDialog();
}
}
}

587
BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs

@ -0,0 +1,587 @@
using AutoMapper;
using AutoMapper.Internal;
using BBWY.Client.APIServices;
using BBWY.Client.Models;
using BBWY.Client.Models.APIModel.Request;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Models.PackTask;
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.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
namespace BBWY.Client.ViewModels.PackTask
{
public class PackServiceViewModel : BaseVM, IDenpendency
{
public ICommand AddPackServiceCommand { get; set; }
public ICommand AddIncreateServiceCommand { get; set; }
public ICommand AddConsumableCommand { get; set; }
public ICommand UpLoadPackCommand { get; set; }
public ICommand SetAllCountCommand { get; set; }
PackTaskService packTaskService;
ConsumableService consumableService;
public ObservableCollection<PackItemModel> IncreateList { get; set; } = new ObservableCollection<PackItemModel>();
public ObservableCollection<PackItemModel> PackList { get; set; } = new ObservableCollection<PackItemModel>();
public ObservableCollection<PackItemModel> ConsumableServiceList { get; set; } = new ObservableCollection<PackItemModel>();
//private ObservableCollection<IncreateServiceModel> increateServiceList = new ObservableCollection<IncreateServiceModel>();
public ObservableCollection<IncreateServiceModel> IncreateServiceList { get; set; } = new ObservableCollection<IncreateServiceModel>();
public ObservableCollection<PackUser> MemberList { get; set; } = new ObservableCollection<PackUser>();
public ObservableCollection<ConsumableModel> ConsumableList { get; set; } = new ObservableCollection<ConsumableModel>();
public ObservableCollection<WorkProcessModel> PackServiceList { get; set; } = new ObservableCollection<WorkProcessModel>();
IncreateServiceService increateService;
public PackServiceViewModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateService, long taskId)
{
TaskId = taskId;
this.consumableService = consumableService;
this.packTaskService = packTaskService;
this.workProcessService = workProcessService;
this.increateService = increateService;
var increateRes = increateService.SearchAll();
if (increateRes.Success)
{
if (increateRes.Data != null && increateRes.Data.Count() > 0)
{
foreach (var workProcess in increateRes.Data)
{
App.Current.Dispatcher.Invoke(() =>
{
IncreateServiceList.Add(workProcess);//加载增值服务列表
});
}
}
}
var result = workProcessService.SearchAll();
if (result.Success)
{
if (result.Data != null && result.Data.Count() > 0)
{
foreach (var workProcess in result.Data)
{
App.Current.Dispatcher.Invoke(() =>
{
PackServiceList.Add(workProcess);//加载工序服务列表
});
}
}
}
var res = packTaskService.GetPackMembers();
if (res.Success)
{
foreach (var item in res.Data)
{
App.Current.Dispatcher.Invoke(() =>
{
MemberList.Add(item);
});
}
}
var conRes = this.consumableService.SearchAll();
if (conRes.Success)
{
foreach (var item in conRes.Data)
{
App.Current.Dispatcher.Invoke(() =>
{
ConsumableList.Add(new ConsumableModel(consumableService)
{
Width = item.Width,
Weigth = item.Weigth,
Remark = item.Remark,
Price = item.Price,
Name = item.Name,
Length = item.Length,
Heigth = item.Heigth,
Id = item.Id
});
});
}
}
AddIncreateServiceCommand = new RelayCommand(AddIncreateService);
AddPackServiceCommand = new RelayCommand(AddPackService);
AddConsumableCommand = new RelayCommand(AddConsumable);
UpLoadPackCommand = new RelayCommand<object>(UpLoadPack);
SetAllCountCommand = new RelayCommand<object>(SetAllCount);
//加载数据
Task.Factory.StartNew(() =>
{
var res = packTaskService.GetTaskService(TaskId);
if (res.Success)
{
if (res.Data.IncreateList != null)
{
foreach (var item in res.Data.IncreateList)
{
App.Current.Dispatcher.Invoke(() =>
{
IncreateList.Add(new PackItemModel(IncreateServiceList, MemberList)
{
ItemCount = item.ItemCount,
ItemName = item.ItemName,
SelectId = item.SelectId,
SelectUserId = item.SelectUserId,
MemberName = item.MemberName
});
});
}
}
if (res.Data.PackList != null)
{
foreach (var item in res.Data.PackList)
{
App.Current.Dispatcher.Invoke(() =>
{
PackList.Add(new PackItemModel(null, MemberList, null, PackServiceList)
{
ItemCount = item.ItemCount,
ItemName = item.ItemName,
SelectId = item.SelectId,
SelectUserId = item.SelectUserId,
MemberName = item.MemberName
});
});
}
}
if (res.Data.ConsumableServiceList != null)
{
foreach (var item in res.Data.ConsumableServiceList)
{
App.Current.Dispatcher.Invoke(() =>
{
ConsumableServiceList.Add(new PackItemModel(null, MemberList, ConsumableList)
{
ItemCount = item.ItemCount,
ItemName = item.ItemName,
SelectId = item.SelectId,
// SelectUserId = item.SelectUserId,
//MemberName = item.MemberName
});
});
}
}
}
});
}
/// <summary>
/// 批量设置耗材数据
/// </summary>
/// <param name="obj"></param>
private void SetAllCount(object obj)
{
SetCountWindow set = new SetCountWindow();
set.SetCount = new Action<int>((s) =>
{
var lbox = obj as ListBox;
var serviceList = lbox.ItemsSource as ObservableCollection<PackItemModel>;
foreach (var item in serviceList)
{
if (item.ItemName == null)
{
item.ItemName = ConsumableList.SingleOrDefault(c => c.Id == item.SelectId).Name;
}
item.ItemCount = s;
}
lbox.ItemsSource = serviceList;
});
set.Show();
}
private long taskId;
public long TaskId { get => taskId; set { Set(ref taskId, value); } } //
private int taskCount;
public int TaskCount { get => taskCount; set { Set(ref taskCount, value); } } //
private string selectBox;
/// <summary>
/// 箱子类型
/// </summary>
public string SelectBox { get => selectBox; set { Set(ref selectBox, value); } }
private int boxCount;
/// <summary>
/// 箱子数
/// </summary>
public int BoxCount { get => boxCount; set { Set(ref boxCount, value); } }
private int airPaperWidth;
/// <summary>
/// 气泡宽
/// </summary>
public int AirPaperWidth { get => airPaperWidth; set { Set(ref airPaperWidth, value); } }
private decimal airPaperHeigth;
/// <summary>
/// 气泡长
/// </summary>
public decimal AirPaperHeigth { get => airPaperHeigth; set { Set(ref airPaperHeigth, value); } }
private string selectMemberId;
public string SelectMemberId { get => selectMemberId; set { Set(ref selectMemberId, value); } }
private decimal jiaoDai;
public decimal JiaoDai { get => jiaoDai; set { Set(ref jiaoDai, value); } }
/// <summary>
/// 上传数据 (判断是否超量) 统一上传
/// </summary>
private void UpLoadPack(object obj)
{
UploadServiceRequest uploadService = new UploadServiceRequest();
uploadService.TaskId = TaskId;
List<IncreateMemberModel> increateMembers = new List<IncreateMemberModel>();
List<ProcessMemberModel> processMembers = new List<ProcessMemberModel>();
// List<ConsumableTaskModel> consumableTasks = new List<ConsumableTaskModel>();
List<PersonTaskModel> PersonTaskModels = new List<PersonTaskModel>();
List<IncreateMemberModel> allIncreateMembers = new List<IncreateMemberModel>();//所有数据数量不能超过总数据
List<ProcessMemberModel> allProcessMembers = new List<ProcessMemberModel>();
List<ConsumableTaskModel> allConsumableTasks = new List<ConsumableTaskModel>();
FeesItemResponse feesItem = new FeesItemResponse(); ;
//获取打包人员
List<string> packUsers = new List<string>();
decimal singleFees = 0;
decimal AllFees = 0;
decimal price = 0;
foreach (var item in IncreateList)//增值服务上传
{
if (item.SelectId <= 0 || string.IsNullOrEmpty(item.SelectUserId) || item.ItemCount <= 0)
{
new TipsWindow($"数据输入有误").Show();
return;
}
var member = MemberList.SingleOrDefault(m => m.Id == item.SelectUserId);
if (member != null && !packUsers.Contains(member.UserName))
{
packUsers.Add(member.UserName);
}
if (item.ItemCount > TaskCount)
{
new TipsWindow($"{item.ItemName}:{item.ItemCount}超出任务量{TaskCount}").Show();
return;
}
price = IncreateServiceList.First(i => i.Id == item.SelectId).ServicePrice;
singleFees += price;
AllFees += item.ItemCount * price;
if (allIncreateMembers.Select(a => a.IncreateId).Contains(item.SelectId))//相同服务 存在累加
{
var inMembers = increateMembers.SingleOrDefault(a => a.UserId == item.SelectUserId && a.IncreateId == item.SelectId);
if (inMembers != null)
inMembers.IncreateCount += item.ItemCount;
var data = allIncreateMembers.SingleOrDefault(a => a.IncreateId == item.SelectId);
var feeItem = feesItem.ServiceList.SingleOrDefault(f => f.ItemName == item.ItemName);
if (data != null) data.IncreateCount += item.ItemCount;
if (feeItem != null) feeItem.ItemCount += item.ItemCount;
if (data.IncreateCount > TaskCount)//累积超出任务量
{
new TipsWindow($"{item.ItemName}:{data.IncreateCount}超出任务量{TaskCount}").Show();
return;
}
continue;
}
increateMembers.Add(new IncreateMemberModel
{
UserId = item.SelectUserId,
IncreateCount = item.ItemCount,
IncreateId = item.SelectId,
Price = price
});
feesItem.ServiceList.Add(new ServiceItemResponse
{
ServiceType = ServiceType.,
ItemCount = item.ItemCount,
ItemName = item.ItemName,
ItemPrice = price
});
allIncreateMembers.Add(new IncreateMemberModel
{
UserId = item.SelectUserId,
IncreateCount = item.ItemCount,
IncreateId = item.SelectId
});
}
foreach (var item in PackList)//打包服务
{
if (item.SelectId <= 0 || string.IsNullOrEmpty(item.SelectUserId) || item.ItemCount <= 0)
{
new TipsWindow($"数据输入有误").Show();
return;
}
if (item.ItemCount > TaskCount)
{
new TipsWindow($"{item.ItemName}:{item.ItemCount}超出任务量{TaskCount}").Show();
return;
}
var member = MemberList.SingleOrDefault(m => m.Id == item.SelectUserId);
if (member != null && !packUsers.Contains(member.UserName))
{
packUsers.Add(member.UserName);
}
price = PackServiceList.First(i => i.Id == item.SelectId).ProcessPrice;
singleFees += price;
AllFees += item.ItemCount * price;
if (allProcessMembers.Select(a => a.ProcessId).Contains(item.SelectId))//存在累加
{
var inMembers = processMembers.SingleOrDefault(a => a.UserId == item.SelectUserId && a.ProcessId == item.SelectId);
if (inMembers != null)
inMembers.ProcessCount += item.ItemCount;
var data = allProcessMembers.SingleOrDefault(a => a.ProcessId == item.SelectId);
var feeItem = feesItem.ServiceList.SingleOrDefault(f => f.ItemName == item.ItemName);
feeItem.ItemCount += item.ItemCount;
data.ProcessCount += item.ItemCount;
if (data.ProcessCount > TaskCount)//累积超出任务量
{
new TipsWindow($"{item.ItemName}:{data.ProcessCount}超出任务量{TaskCount}").Show();
return;
}
continue;
}
processMembers.Add(new ProcessMemberModel
{
UserId = item.SelectUserId,
ProcessCount = item.ItemCount,
ProcessId = item.SelectId,
Price = price
});
feesItem.ServiceList.Add(new ServiceItemResponse
{
ServiceType = ServiceType.,
ItemCount = item.ItemCount,
ItemName = item.ItemName,
ItemPrice = price
});
allProcessMembers.Add(new ProcessMemberModel
{
UserId = item.SelectUserId,
ProcessCount = item.ItemCount,
ProcessId = item.SelectId
});
}
foreach (var item in ConsumableServiceList)
{
if (item.SelectId <= 0 || item.ItemCount <= 0)
{
new TipsWindow($"数据输入有误").Show();
return;
}
if (item.ItemCount > TaskCount)
{
new TipsWindow($"{item.ItemName}:{item.ItemCount}超出任务量{TaskCount}").Show();
return;
}
price = ConsumableList.First(i => i.Id == item.SelectId).Price.Value;
singleFees += price;
AllFees += item.ItemCount * price;
if (allConsumableTasks.Select(a => a.ConsumableId).Contains(item.SelectId))//存在累加
{
var data = allConsumableTasks.SingleOrDefault(a => a.ConsumableId == item.SelectId);
var feeItem = feesItem.ServiceList.SingleOrDefault(f => f.ItemName == item.ItemName);
feeItem.ItemCount += item.ItemCount;
data.ConsumableCount += item.ItemCount;
if (data.ConsumableCount > TaskCount)//累积超出任务量
{
new TipsWindow($"{item.ItemName}:{data.ConsumableCount}超出任务量{TaskCount}").Show();
return;
}
continue;
}
feesItem.ServiceList.Add(new ServiceItemResponse
{
ServiceType = ServiceType.,
ItemCount = item.ItemCount,
ItemName = item.ItemName,
ItemPrice = price
});
allConsumableTasks.Add(new ConsumableTaskModel
{
ConsumableCount = item.ItemCount,
ConsumableId = item.SelectId
});
}
uploadService.ConsumableIds = string.Join(",", allConsumableTasks.Select(a => a.ConsumableId));
uploadService.ConsumableNos = string.Join(",", allConsumableTasks.Select(a => a.ConsumableCount));
uploadService.WorkProcessIds = string.Join(",", allProcessMembers.Select(a => a.ProcessId));
uploadService.WorkProcessNos = string.Join(",", allProcessMembers.Select(a => a.ProcessCount));
uploadService.IncreateServiceIds = string.Join(",", allIncreateMembers.Select(a => a.IncreateId));
uploadService.IncreateServiceNos = string.Join(",", allIncreateMembers.Select(a => a.IncreateCount));
//List<IncreateMemberModel> increateMembers = new List<IncreateMemberModel>();
//List<ProcessMemberModel> processMembers = new List<ProcessMemberModel>();
foreach (var item in increateMembers)
{
var allFees = item.Price * item.IncreateCount;
var person = PersonTaskModels.SingleOrDefault(p => p.PackUserId == item.UserId);
if (person != null)
{
person.AllFees += allFees;
person.IncreateServiceIds += $",{item.IncreateId}";
person.IncreateServiceNos += $",{item.IncreateCount}";
continue;
}
var inMember = new PersonTaskModel();
inMember.IncreateServiceIds = item.IncreateId.ToString();
inMember.IncreateServiceNos = item.IncreateCount.ToString();
inMember.AllFees += allFees;
inMember.TaskId = TaskId; inMember.PackUserId = item.UserId;
PersonTaskModels.Add(inMember);
}
foreach (var item in processMembers)
{
var allFees = item.Price * item.ProcessCount;
var person = PersonTaskModels.SingleOrDefault(p => p.PackUserId == item.UserId);
if (person != null)
{
person.AllFees += allFees;
if (string.IsNullOrEmpty(person.WorkProcessIds))
{
person.WorkProcessIds += $"{item.ProcessId}";
person.WorkProcessNos += $"{item.ProcessCount}";
continue;
}
person.WorkProcessIds += $",{item.ProcessId}";
person.WorkProcessNos += $",{item.ProcessCount}";
continue;
}
var inMember = new PersonTaskModel();
inMember.WorkProcessNos = item.ProcessCount.ToString();
inMember.WorkProcessIds = item.ProcessId.ToString();
inMember.AllFees += allFees;
inMember.TaskId = TaskId; inMember.PackUserId = item.UserId;
PersonTaskModels.Add(inMember);
}
uploadService.PersonTaskModels = PersonTaskModels.ToArray();
uploadService.AllFees = AllFees;
uploadService.SingleFees = singleFees;
var res = packTaskService.UploadService(uploadService);
if (res != null && res.Success)
{
new TipsWindow("上传成功!").Show();
var win = obj as System.Windows.Window;
feesItem.AllFees = AllFees;
feesItem.SingleFees = singleFees;
feesItem.TaskId = TaskId;
SetAllFees(feesItem, packUsers);
win.Close();
}
}
/// <summary>
/// 更新 打包员 和费用数据
/// </summary>
public Action<FeesItemResponse, List<string>> SetAllFees { get; set; }
private void AddPackService()
{
PackList.Add(new PackItemModel(null, MemberList, null, PackServiceList));
}
WorkProcessService workProcessService;
private void AddIncreateService()
{
IncreateList.Add(new PackItemModel(IncreateServiceList, MemberList));
}
private void AddConsumable()
{
ConsumableServiceList.Add(new PackItemModel(null, null, ConsumableList));
}
}
}

26
BBWY.Client/ViewModels/PackTask/SetBarCodeViewModel.cs

@ -0,0 +1,26 @@
using BBWY.Client.Models;
using BBWY.Common.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.ViewModels.PackTask
{
public class SetBarCodeViewModel : BaseVM, IDenpendency
{
public SetBarCodeViewModel(BarCodeModel model)
{
BarCodeModel = model;
}
private BarCodeModel barCodeModel;
/// <summary>
/// 绑定数据
/// </summary>
public BarCodeModel BarCodeModel { get => barCodeModel; set { Set(ref barCodeModel, value); } }
}
}

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

File diff suppressed because it is too large

18
BBWY.Client/ViewModels/PackTask/TipsViewModel.cs

@ -0,0 +1,18 @@
using BBWY.Common.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.ViewModels.PackTask
{
public class TipsViewModel : BaseVM, IDenpendency
{
}
}

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

@ -0,0 +1,388 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Models;
using BBWY.Client.Views.PackTask;
using BBWY.Common.Models;
using BBWY.Controls;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using System.Linq;
using System.Windows.Controls;
using System.ComponentModel;
using HandyControl.Controls;
using System.Windows;
using System.Collections;
namespace BBWY.Client.ViewModels.PackTask
{
public partial class WareHouseListViewModel : BaseVM, IDenpendency//注入服务
{
#region 属性绑定
/// <summary>
/// 查询时间段
/// </summary>
private DateTime startTime;
public DateTime StartTime { get => startTime; set { Set(ref startTime, value); } }
private DateTime endTime;
public DateTime EndTime { get => endTime; set { Set(ref endTime, value); } }
/// <summary>
/// 查询任务id
/// </summary>
private string searchTaskId;
public string SearchTaskId
{
get => searchTaskId; set
{
Set(ref searchTaskId, value);
}
}
/// <summary>
/// 查询Sku
/// </summary>
private string searchSkuId;
public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } }
public TaskState? taskState;
/// <summary>
/// 任务状态
/// </summary>
public TaskState? TaskState
{
get => taskState; private set
{
Set(ref taskState, value);
}
}
private int pageIndex = 1;
private int pageSize = 10;
private int orderCount;//总数量
private Visibility tipVisitity;
/// <summary>
///
/// </summary>
public Visibility TipVisitity { get => tipVisitity; set { Set(ref tipVisitity, value); } }
/// <summary>
/// 未到货数量
/// </summary>
public int NoArrivedCount { get => noArrivedCount; set { Set(ref noArrivedCount, value); } }
private int noArrivedCount;
private int someArrivedCount;
/// <summary>
/// 部分到货数量
/// </summary>
public int SomeArrivedCount { get => someArrivedCount; set { Set(ref someArrivedCount, value); } }
private int worryCount;
/// <summary>
/// 加急数
/// </summary>
public int WorryCount { get => worryCount; set { Set(ref worryCount, value); } }
private int arrivedCount;
/// <summary>
/// 已到货数量
/// </summary>
public int ArrivedCount { get => arrivedCount; set { Set(ref arrivedCount, value); } }
//private int totalCount;
///// <summary>
///// 全部数量
///// </summary>
//public int TotalCount { get => totalCount; set { Set(ref totalCount, value); } }
public int PageIndex { get => pageIndex; set { Set(ref pageIndex, value); } }
public int PageSize { get => pageSize; set { Set(ref pageSize, value); } }
public int OrderCount { get => orderCount; set { Set(ref orderCount, value); } }
private bool isLoading;
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } }
WorkProcessService workProcessService;
private readonly PackTaskService packTaskService;
private int? IsWorry { get; set; }
public int? taskStatus { get; set; }
private ObservableCollection<PackTaskModel> packTaskList;
/// <summary>
/// 动态数据表
/// </summary>
public ObservableCollection<PackTaskModel> PackTaskList { get => packTaskList; set { Set(ref packTaskList, value); } }
//private ObservableCollection<FeesItemTypeDTO> feesItems;
///// <summary>
///// 动态数据表
///// </summary>
//public ObservableCollection<FeesItemTypeDTO> FeesItems { get => feesItems; set { Set(ref feesItems, value); } }
public string searchDepartment;
public string SearchDepartment
{
get => searchDepartment; set
{
Set(ref searchDepartment, value);
}
}
ConsumableService consumableService;
#endregion
public WareHouseListViewModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService)
{
this.packTaskService = packTaskService;
this.consumableService = consumableService;
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
SetTaskStateCommand = new RelayCommand<TaskState?>(SetTaskState);
SearchTaskCommand = new RelayCommand(() =>
{
PageIndex = 1;
Task.Factory.StartNew(() => SearchTaskList()); //手动点击查询订单
});
TaskPageIndexChangedCommand = new RelayCommand<PageArgs>(p =>
{
LoadIndex(p.PageIndex);
});
StartTime = DateTime.Now.Date;
EndTime = DateTime.Now.Date;
IsLoading = false;
//加载数据
SetTaskState(Models.TaskState.);
this.workProcessService = workProcessService;
this.increateServiceService = increateServiceService;
}
private void IsLoadCount()
{
var packTaskResult = packTaskService.GetWareAllCount();
if (packTaskResult != null && packTaskResult.Success)
{
App.Current.Dispatcher.Invoke(() =>
{
ArrivedCount = packTaskResult.Data.ArrivedCount;
NoArrivedCount = packTaskResult.Data.NoArrivedCount;
SomeArrivedCount = packTaskResult.Data.SomeArrivedCount;
WorryCount = packTaskResult.Data.WorryCount;
});
}
}
private void LoadIndex(int pageIndex)
{
PageIndex = pageIndex;//
SearchTaskList();
}
#region 事件绑定
/// <summary>
/// 筛选数据
/// </summary>
public ICommand SetTaskStateCommand { get; set; }
/// <summary>
/// 搜索数据
/// </summary>
public ICommand SearchTaskCommand { get; set; }
/// <summary>
/// 创建任务
/// </summary>
public ICommand CreateTaskCommand { get; set; }
/// <summary>
/// 页面改变事件
/// </summary>
public ICommand TaskPageIndexChangedCommand { get; set; }
public void SetTaskState(TaskState? taskState)
{
IsWorry = null;
TaskState = null;
taskStatus = null;
switch (taskState)
{
case null:
break;
case Models.TaskState.:
case Models.TaskState.: //未完成的数据
case Models.TaskState.:
TaskState = taskState;
taskStatus = 0;
break;
case Models.TaskState.: //所有数据
break;
case Models.TaskState.:
taskStatus = 1;
break;
case Models.TaskState.:
IsWorry = 1;
break;
default:
break;
}
SearchTaskList();
}
private IncreateServiceService increateServiceService;
/// <summary>
/// 搜索任务列表
/// </summary>
public void SearchTaskList()
{
IsLoading = true;
Task.Factory.StartNew(() =>
{
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
var datas = packTaskService.GetWareHouseList(IsWorry, SearchDepartment, SearchSkuId, SearchTaskId, StartTime, EndTime, (this.TaskState), taskStatus,
PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
var dataModel = datas.Data;
OrderCount = dataModel.TotalCount;
foreach (var item in dataModel.Items)
{
var data = new PackTaskModel(packTaskService,consumableService,workProcessService, increateServiceService)
{
AcceptName = item.UserName,
Availability = (TaskState)item.Availability,
BasicPack = (BasicPack)item.BasicPack,
DepartmentName = item.DepartmentName,
CertificatePosition = (CertificatePosition)item.CertificatePosition,
GoodsNumber = item.GoodsNumber,
Increment1 = item.Increment1,
Increment2 = (Increment)item.Increment2,
ItemList = new List<SkuMessage>() { new SkuMessage
{ BrandName = item.BrandName,
GoodsNo = item.ProductItemNum, Logo= item.Logo,
ShopName = item.ShopName, SkuName = item.SkuName
} },
MarkMessage = item.MarkMessage,
PackType = (PackType)item.PackType,
PositionType = (PositionType)item.PositionType,
SkuCount = item.SkuCount,
SkuTitle = item.SkuGoodsTitle,
TaskId = item.TaskId,
TaskStatus = (TaskStateType)item.TaskStatus,
EndTime = item.CreateTime
};
if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
{
data.BarCodeModel = item.BarCodeDTO;
}
if (item.certificate != null)
{
data.CertificateModel = item.certificate;
}
if (item.FeesItemResponse!=null)
{
data.FeesItemResponse = item.FeesItemResponse;
data.FeesMoney = item.FeesItemResponse.SingleFees;
data.IsShowFees = data.FeesMoney > 0 ? true : false;
}
else
{
data.IsShowFees = false;
}
if (item.PackUserName != null && item.PackUserName.Count() > 0)
{
data.PackUser = string.Join("\r\n", item.PackUserName);
}
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
PackTaskList.Add(data);
}));
}
}
else
{
App.Current.Dispatcher.BeginInvoke(new Action(() =>
{
new TipsWindow("查不到数据").Show();
}));
}
IsLoadCount();
IsLoading = false;
});
}
#endregion
}
}

63
BBWY.Client/ViewModels/Purchase/1688PreviewPurchaseViewModel.cs

@ -71,6 +71,10 @@ namespace BBWY.Client.ViewModels
private string prucahseRemark; private string prucahseRemark;
private PurchaseOrderMode purchaseOrderMode = PurchaseOrderMode.; private PurchaseOrderMode purchaseOrderMode = PurchaseOrderMode.;
private string tradeMode; private string tradeMode;
/// <summary>
/// 扩展数据,暂用于拳探
/// </summary>
private string extensions;
public _1688PreviewPurchaseViewModel(OneBoundAPIService oneBoundAPIService, public _1688PreviewPurchaseViewModel(OneBoundAPIService oneBoundAPIService,
PurchaseService purchaseService, PurchaseService purchaseService,
@ -159,9 +163,9 @@ namespace BBWY.Client.ViewModels
purchaseSchemeList.Clear(); purchaseSchemeList.Clear();
PurchaseSchemeProductSkuList.Clear(); PurchaseSchemeProductSkuList.Clear();
tradeMode = string.Empty; tradeMode = string.Empty;
extensions = string.Empty;
ProductAmount = FreightAmount = TotalAmount = 0; ProductAmount = FreightAmount = TotalAmount = 0;
ContactName = Address = Mobile = Province = City = County = Town = PrucahseRemark = string.Empty; ContactName = Address = Mobile = Province = City = County = Town = PrucahseRemark = string.Empty;
} }
private void LoadPurchaseProduct(Platform platform, PurchaseSchemeProduct purchaseSchemeProduct, OrderSku orderSku, ManualResetEvent ewh) private void LoadPurchaseProduct(Platform platform, PurchaseSchemeProduct purchaseSchemeProduct, OrderSku orderSku, ManualResetEvent ewh)
@ -192,55 +196,6 @@ namespace BBWY.Client.ViewModels
ewh.Dispose(); ewh.Dispose();
} }
//private IList<PurchaseSchemeProductSku> LoadPurchaseProductCore(PurchaseSchemeProduct purchaseSchemeProduct, out string errorMsg)
//{
// errorMsg = string.Empty;
// //1688商品详情接口
// var response = oneBoundAPIService.GetProductInfo("1688", purchaseSchemeProduct.PurchaseProductId);
// if (!response.Success)
// {
// //记录日志
// errorMsg = response.Msg;
// Console.WriteLine(errorMsg);
// return null;
// }
// var jobject = response.Data;
// var skuJArray = (JArray)jobject["item"]["skus"]["sku"];
// if (skuJArray.Count == 0)
// {
// errorMsg = $"商品{purchaseSchemeProduct.PurchaseProductId}缺少sku信息";
// return null;
// }
// return skuJArray.Select(j => new PurchaseSchemeProductSku()
// {
// ProductId = purchaseSchemeProduct.ProductId,
// SkuId = purchaseSchemeProduct.SkuId,
// PurchaseProductId = purchaseSchemeProduct.PurchaseProductId,
// Price = j.Value<decimal>("price"),
// PurchaseSkuId = j.Value<string>("sku_id"),
// PurchaseSkuSpecId = j.Value<string>("spec_id"),
// Title = j.Value<string>("properties_name"),
// Logo = GetSkuLogo(j, (JArray)jobject["item"]["prop_imgs"]["prop_img"])
// }).ToList();
//}
private string GetSkuLogo(JToken skuJToken, JArray prop_img)
{
if (!prop_img.HasValues)
return "pack://application:,,,/Resources/Images/defaultItem.png";
var properties = skuJToken.Value<string>("properties").Split(';', StringSplitOptions.RemoveEmptyEntries);
foreach (var p in properties)
{
var imgJToken = prop_img.FirstOrDefault(g => g.Value<string>("properties") == p);
if (imgJToken != null)
return imgJToken.Value<string>("url");
}
return "pack://application:,,,/Resources/Images/defaultItem.png";
}
private void OnItemTotalChanged(int itemTotal) private void OnItemTotalChanged(int itemTotal)
{ {
@ -279,7 +234,7 @@ namespace BBWY.Client.ViewModels
Province = Province, Province = Province,
TelePhone = Mobile, TelePhone = Mobile,
Town = Town Town = Town
}, PurchaseSchemeProductSkuList, Platform., purchaseAccount, PurchaseOrderMode)) }, PurchaseSchemeProductSkuList, purchaseAccount.PurchasePlatformId, purchaseAccount, PurchaseOrderMode))
.ContinueWith(t => .ContinueWith(t =>
{ {
IsLoading = false; IsLoading = false;
@ -295,6 +250,7 @@ namespace BBWY.Client.ViewModels
FreightAmount = r.Data.FreightAmount; FreightAmount = r.Data.FreightAmount;
TotalAmount = r.Data.TotalAmount; TotalAmount = r.Data.TotalAmount;
tradeMode = r.Data.OrderTradeType?.Code; tradeMode = r.Data.OrderTradeType?.Code;
extensions = r.Data.Extensions;
}); });
} }
@ -331,7 +287,7 @@ namespace BBWY.Client.ViewModels
TelePhone = Mobile, TelePhone = Mobile,
Town = Town Town = Town
}, PurchaseSchemeProductSkuList, }, PurchaseSchemeProductSkuList,
Platform., purchaseAccount.PurchasePlatformId,
purchaseAccount, purchaseAccount,
PurchaseOrderMode, PurchaseOrderMode,
tradeMode, tradeMode,
@ -342,7 +298,8 @@ namespace BBWY.Client.ViewModels
purchaseAccount.AccountName, purchaseAccount.AccountName,
purchaseSchemeList[0].PurchaserName, purchaseSchemeList[0].PurchaserName,
purchaser.Id, purchaser.Id,
globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M)).ContinueWith(t => globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M,
extensions)).ContinueWith(t =>
{ {
IsLoading = false; IsLoading = false;
var r = t.Result; var r = t.Result;

46
BBWY.Client/ViewModels/Setting/ShopSettingViewModel.cs

@ -29,8 +29,11 @@ namespace BBWY.Client.ViewModels
private string siNanDingDingKey; private string siNanDingDingKey;
private SiNanPolicyLevel selectedSiNanPolicyLevel; private SiNanPolicyLevel selectedSiNanPolicyLevel;
private Platform purchasePlatform;
public ICommand SaveCommand { get; set; } public ICommand SaveCommand { get; set; }
public ICommand SetPanelIndexCommand { get; set; } public ICommand SetPanelIndexCommand { get; set; }
public PurchaseAccount PurchaseAccount { get => purchaseAccount; set { Set(ref purchaseAccount, value); } } public PurchaseAccount PurchaseAccount { get => purchaseAccount; set { Set(ref purchaseAccount, value); } }
@ -52,6 +55,19 @@ namespace BBWY.Client.ViewModels
public string SiNanDingDingKey { get => siNanDingDingKey; set { Set(ref siNanDingDingKey, value); } } public string SiNanDingDingKey { get => siNanDingDingKey; set { Set(ref siNanDingDingKey, value); } }
public SiNanPolicyLevel SelectedSiNanPolicyLevel { get => selectedSiNanPolicyLevel; set { Set(ref selectedSiNanPolicyLevel, value); } } public SiNanPolicyLevel SelectedSiNanPolicyLevel { get => selectedSiNanPolicyLevel; set { Set(ref selectedSiNanPolicyLevel, value); } }
/// <summary>
/// 采购平台
/// </summary>
public Platform PurchasePlatform
{
get => purchasePlatform;
set
{
if (Set(ref purchasePlatform, value))
OnPurchasePlatformChanged();
}
}
public ShopSettingViewModel(GlobalContext globalContext, ShopService shopService) public ShopSettingViewModel(GlobalContext globalContext, ShopService shopService)
{ {
PanelIndex = 0; PanelIndex = 0;
@ -89,6 +105,9 @@ namespace BBWY.Client.ViewModels
protected override void Load() protected override void Load()
{ {
if (globalContext.User.Shop.PurchaseAccountList == null)
globalContext.User.Shop.PurchaseAccountList = new List<PurchaseAccount>();
IsLoading = false; IsLoading = false;
if (!string.IsNullOrEmpty(globalContext.User.Shop.ManagePwd)) if (!string.IsNullOrEmpty(globalContext.User.Shop.ManagePwd))
{ {
@ -99,9 +118,7 @@ namespace BBWY.Client.ViewModels
isValidated = true; isValidated = true;
this.ManagePwd = globalContext.User.Shop.ManagePwd; this.ManagePwd = globalContext.User.Shop.ManagePwd;
this.PlatformCommissionRatio = (globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M) * 100; this.PlatformCommissionRatio = (globalContext.User.Shop.PlatformCommissionRatio ?? 0.05M) * 100;
this.PurchaseAccount = globalContext.User.Shop.PurchaseAccountList == null || globalContext.User.Shop.PurchaseAccountList.Count() == 0 ?
new PurchaseAccount() :
globalContext.User.Shop.PurchaseAccountList[0].Clone() as PurchaseAccount;
DingDingKey = globalContext.User.Shop.DingDingKey; DingDingKey = globalContext.User.Shop.DingDingKey;
DingDingWebHook = globalContext.User.Shop.DingDingWebHook; DingDingWebHook = globalContext.User.Shop.DingDingWebHook;
SelectedSkuSafeTurnoverDay = SafeDayList.FirstOrDefault(s => s.Value == globalContext.User.Shop.SkuSafeTurnoverDays.ToString()); SelectedSkuSafeTurnoverDay = SafeDayList.FirstOrDefault(s => s.Value == globalContext.User.Shop.SkuSafeTurnoverDays.ToString());
@ -109,11 +126,13 @@ namespace BBWY.Client.ViewModels
SelectedSiNanPolicyLevel = (SiNanPolicyLevel)globalContext.User.Shop.SiNanPolicyLevel; SelectedSiNanPolicyLevel = (SiNanPolicyLevel)globalContext.User.Shop.SiNanPolicyLevel;
SiNanDingDingKey = globalContext.User.Shop.SiNanDingDingKey; SiNanDingDingKey = globalContext.User.Shop.SiNanDingDingKey;
SiNanDingDingWebHook = globalContext.User.Shop.SiNanDingDingWebHook; SiNanDingDingWebHook = globalContext.User.Shop.SiNanDingDingWebHook;
PurchasePlatform = Platform.;
} }
protected override void Unload() protected override void Unload()
{ {
this.PurchaseAccount = null; //this.PurchaseAccount = null;
this.PlatformCommissionRatio = 0M; this.PlatformCommissionRatio = 0M;
this.ManagePwd = string.Empty; this.ManagePwd = string.Empty;
this.isValidated = false; this.isValidated = false;
@ -163,11 +182,7 @@ namespace BBWY.Client.ViewModels
return; return;
} }
if (globalContext.User.Shop.PurchaseAccountList == null)
globalContext.User.Shop.PurchaseAccountList = new List<PurchaseAccount>();
globalContext.User.Shop.PurchaseAccountList.Clear();
PurchaseAccount.Id = response.Data; PurchaseAccount.Id = response.Data;
globalContext.User.Shop.PurchaseAccountList.Add(PurchaseAccount);
globalContext.User.Shop.PlatformCommissionRatio = p; globalContext.User.Shop.PlatformCommissionRatio = p;
globalContext.User.Shop.ManagePwd = this.ManagePwd; globalContext.User.Shop.ManagePwd = this.ManagePwd;
globalContext.User.Shop.DingDingKey = this.DingDingKey; globalContext.User.Shop.DingDingKey = this.DingDingKey;
@ -179,5 +194,20 @@ namespace BBWY.Client.ViewModels
globalContext.User.Shop.SiNanPolicyLevel = (int)this.SelectedSiNanPolicyLevel; globalContext.User.Shop.SiNanPolicyLevel = (int)this.SelectedSiNanPolicyLevel;
}); });
} }
private void OnPurchasePlatformChanged()
{
var pa = globalContext.User.Shop.PurchaseAccountList.FirstOrDefault(pa => pa.PurchasePlatformId == PurchasePlatform);
if (pa == null)
{
pa = new PurchaseAccount()
{
PurchasePlatformId = PurchasePlatform,
};
globalContext.User.Shop.PurchaseAccountList.Add(pa);
}
this.PurchaseAccount = pa;
}
} }
} }

124
BBWY.Client/ViewModels/ViewModelLocator.cs

@ -1,6 +1,9 @@
using BBWY.Client.ViewModels.PackTask; using BBWY.Client.ViewModels.PackTask;
using GalaSoft.MvvmLight.Ioc;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using System; using System;
using System.Windows.Navigation;
using static System.Formats.Asn1.AsnWriter;
namespace BBWY.Client.ViewModels namespace BBWY.Client.ViewModels
{ {
@ -16,11 +19,41 @@ namespace BBWY.Client.ViewModels
public ViewModelLocator() public ViewModelLocator()
{ {
sp = (App.Current as App).ServiceProvider; sp = (App.Current as App).ServiceProvider;
} }
//public static PackServiceViewModel PackServiceViewModel => SimpleIoc.Default.GetInstance<PackServiceViewModel>();
//public static PackServiceViewModel CreateNewPackServiceViewModel()
//{
// SimpleIoc.Default.Unregister<PackServiceViewModel>();
// SimpleIoc.Default.Register<PackServiceViewModel>();
// return PackServiceViewModel;
//}
public MainViewModel Main public MainViewModel Main
{ {
get get
@ -78,7 +111,17 @@ namespace BBWY.Client.ViewModels
} }
} }
} }
public ConsumableViewModel Consumable
{
get
{
//IsCreateOrderList = true;
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<ConsumableViewModel>();
}
}
}
public TaskListViewModel TaskList public TaskListViewModel TaskList
{ {
get get
@ -90,8 +133,87 @@ namespace BBWY.Client.ViewModels
} }
} }
} }
public WareHouseListViewModel WareHouseList
{
get
{
//IsCreateOrderList = true;
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<WareHouseListViewModel>();
}
}
}
public PackServiceViewModel PackServiceList
{
get
{
//IsCreateOrderList = true;
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<PackServiceViewModel>();
}
}
}
public TipsViewModel TipsView
{
get
{
//IsCreateOrderList = true;
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<TipsViewModel>();
}
}
}
public SetBarCodeViewModel CreateSetBarCodeView
{
get
{
using (var s = sp.CreateScope())
{
return s.ServiceProvider.GetRequiredService<SetBarCodeViewModel>();
}
}
}
//CreatePackTaskViewModel viewModel = null;
public CreatePackTaskViewModel CreateTaskView
{
get
{
// return sp.GetRequiredService<CreatePackTaskViewModel>();
using (var s = sp.CreateScope())
{
//if (viewModel == null)
// viewModel = s.ServiceProvider.GetRequiredService<CreatePackTaskViewModel>();
var viewModel = s.ServiceProvider.GetRequiredService<CreatePackTaskViewModel>();
//bool areSame = object.ReferenceEquals(viewModel, sp.GetRequiredService<CreatePackTaskViewModel>());
return viewModel;
}
}
}
public ChoosePurchaseSchemeViewModel ChoosePurchaseScheme public ChoosePurchaseSchemeViewModel ChoosePurchaseScheme
{ {

2
BBWY.Client/Views/MainWindow.xaml

@ -26,7 +26,7 @@
<!--<TextBlock Text="{Binding GlobalContext.User.TeamName}" Margin="5,0,0,0"/> <!--<TextBlock Text="{Binding GlobalContext.User.TeamName}" Margin="5,0,0,0"/>
<TextBlock Text="{Binding GlobalContext.User.Shop.Platform}" Margin="5,0,0,0"/>--> <TextBlock Text="{Binding GlobalContext.User.Shop.Platform}" Margin="5,0,0,0"/>-->
<TextBlock Text="{Binding GlobalContext.User.Shop.ShopName}" Margin="5,0,0,0"/> <TextBlock Text="{Binding GlobalContext.User.Shop.ShopName}" Margin="5,0,0,0"/>
<TextBlock Text="v10080" Margin="5,0,0,0"/> <TextBlock Text="v10084" Margin="5,0,0,0"/>
</StackPanel> </StackPanel>
</Border> </Border>
<Grid Grid.Row="1"> <Grid Grid.Row="1">

3
BBWY.Client/Views/MainWindow.xaml.cs

@ -1,4 +1,5 @@
using BBWY.Controls; using BBWY.Client.Models;
using BBWY.Controls;
using System; using System;
using System.Windows; using System.Windows;

2
BBWY.Client/Views/Order/ChoosePurchaseScheme.xaml

@ -32,6 +32,8 @@
<DataGrid Grid.Row="1" <DataGrid Grid.Row="1"
ItemsSource="{Binding PurchaserList}"> ItemsSource="{Binding PurchaserList}">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Platform}" Header="采购平台" Width="80" HeaderStyle="{StaticResource ColumnHeaderStyle_Center}"
ElementStyle="{StaticResource middleTextBlock}"/>
<DataGridTextColumn Binding="{Binding Name}" Header="采购商" Width="1*" <DataGridTextColumn Binding="{Binding Name}" Header="采购商" Width="1*"
HeaderStyle="{StaticResource ColumnHeaderStyle_Center}" HeaderStyle="{StaticResource ColumnHeaderStyle_Center}"
ElementStyle="{StaticResource middleTextBlock}"/> ElementStyle="{StaticResource middleTextBlock}"/>

1
BBWY.Client/Views/Order/OrderList.xaml

@ -134,6 +134,7 @@
</Grid> </Grid>
<StackPanel Grid.Row="2" HorizontalAlignment="Left" Orientation="Horizontal"> <StackPanel Grid.Row="2" HorizontalAlignment="Left" Orientation="Horizontal">
<c:BButton Content="全部订单" Width="100" <c:BButton Content="全部订单" Width="100"
Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Null}" Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Null}"
Visibility="{Binding IsSDGroup,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}"> Visibility="{Binding IsSDGroup,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}">

1
BBWY.Client/Views/Order/OrderListControl.xaml

@ -319,7 +319,6 @@
<Border x:Name="bd_costbg" Background="#FCECEE" Grid.Column="3" <Border x:Name="bd_costbg" Background="#FCECEE" Grid.Column="3"
Visibility="{Binding IsCostException,ConverterParameter=true:Visible:Collapsed,Converter={StaticResource objConverter}}" Margin="0,0,1,0"/> Visibility="{Binding IsCostException,ConverterParameter=true:Visible:Collapsed,Converter={StaticResource objConverter}}" Margin="0,0,1,0"/>
<StackPanel Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,10"> <StackPanel Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,10">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock> <TextBlock>
<Run Text="实收金额"/> <Run Text="实收金额"/>

22
BBWY.Client/Views/Order/RelationPurchaseOrder.xaml.cs

@ -87,6 +87,7 @@ namespace BBWY.Client.Views.Order
OrderDropShippingList.Add(ods1); OrderDropShippingList.Add(ods1);
ods1.OnPurchaseAmountChanged = OnPurchaseAmountChanged; ods1.OnPurchaseAmountChanged = OnPurchaseAmountChanged;
ods1.OnPurchasePlatformChanged = OnPurchasePlatformChanged;
} }
} }
@ -99,12 +100,18 @@ namespace BBWY.Client.Views.Order
OnPurchaseAmountChanged(); OnPurchaseAmountChanged();
AddOrderDropShippingCommand = new RelayCommand(() => OrderDropShippingList.Add(new OrderDropShipping() AddOrderDropShippingCommand = new RelayCommand(() =>
{ {
OrderId = this.OrderId, var ods = new OrderDropShipping()
BuyerAccount = PurchaseAccountList.FirstOrDefault()?.AccountName, {
OnPurchaseAmountChanged = OnPurchaseAmountChanged OrderId = this.OrderId,
})); //BuyerAccount = PurchaseAccountList.FirstOrDefault()?.AccountName,
OnPurchaseAmountChanged = OnPurchaseAmountChanged,
OnPurchasePlatformChanged = OnPurchasePlatformChanged
};
ods.PurchasePlatform = Platform.;
OrderDropShippingList.Add(ods);
});
AddRelationPurchaseOrderSkuCommand = new RelayCommand<OrderDropShipping>(AddRelationPurchaseOrderSku); AddRelationPurchaseOrderSkuCommand = new RelayCommand<OrderDropShipping>(AddRelationPurchaseOrderSku);
CloseShowChooseSkuPanelCommand = new RelayCommand(() => IsShowChooseSkuPanel = false); CloseShowChooseSkuPanelCommand = new RelayCommand(() => IsShowChooseSkuPanel = false);
RePurchaseCommand = new RelayCommand(() => RePurchaseCommand = new RelayCommand(() =>
@ -197,5 +204,10 @@ namespace BBWY.Client.Views.Order
foreach (var noChooseSku in noChooseList) foreach (var noChooseSku in noChooseList)
ChooseRelationPurchaseOrderSkuList.Add(noChooseSku); ChooseRelationPurchaseOrderSkuList.Add(noChooseSku);
} }
private void OnPurchasePlatformChanged(OrderDropShipping orderDropShipping)
{
orderDropShipping.BuyerAccount = PurchaseAccountList.FirstOrDefault(pa => pa.PurchasePlatformId == orderDropShipping.PurchasePlatform)?.AccountName;
}
} }
} }

196
BBWY.Client/Views/PackTask/Consumable.xaml

@ -0,0 +1,196 @@
<Page x:Class="BBWY.Client.Views.PackTask.Consumable"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
DataContext="{Binding Consumable,Source={StaticResource Locator}}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="1300"
Title="Consumable">
<!--DataContext="{Binding Consumable,Source={StaticResource Locator}}"-->
<Page.Resources>
<sys:Int32 x:Key="d0">0</sys:Int32>
<sys:Int32 x:Key="d1">1</sys:Int32>
<sys:Int32 x:Key="d3">2</sys:Int32>
<sys:Int32 x:Key="d7">6</sys:Int32>
<sys:Int32 x:Key="d15">14</sys:Int32>
<sys:Int32 x:Key="d30">29</sys:Int32>
</Page.Resources>
<Grid>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Panel.ZIndex="100" Margin="220 25 0 0" >
<c:BTextBox x:Name="consumableName" Width="150" Height="30" TextChanged="consumableName_TextChanged" Text="{Binding SearchName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></c:BTextBox>
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="ListBox_SelectionChanged" Background="{StaticResource Border.Background}">
</ListBox>
</StackPanel>
<Grid Margin="0 10 0 0">
<Grid.RowDefinitions>
<RowDefinition Height="54"/>
<RowDefinition Height="*"/>
<RowDefinition Height="30"/>
<!---->
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Stretch" Panel.ZIndex="10" Margin="10,5,0,0" >
<StackPanel Orientation="Horizontal" Height="35">
<!-- Command="{Binding AddConsumableCommand}"-->
<c:BButton Content="添加耗材" Width="118" VerticalAlignment="Stretch" Margin="15,0,0,0"
Command="{Binding AddConsumableCommand}"
Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White">
</c:BButton>
<TextBlock Text="耗材品名:" VerticalAlignment="Center" Margin="16,0,0,0"/>
</StackPanel>
<Button Content="搜索" Height="35" Width="66" VerticalAlignment="Stretch" Margin="5,0,10,0"
Command="{Binding SearchConsumableCommand}" HorizontalAlignment="Right"
Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</Grid>
<Grid Grid.Row="1" Margin="0,29,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" Margin="10 0 5 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition/>
<ColumnDefinition Width="170"/>
</Grid.ColumnDefinitions>
<TextBlock Text="耗材品名" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="金额" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="重量" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="尺寸(cm)" Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="备注" Grid.Column="4" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="操作" Grid.Column="5" Style="{StaticResource middleTextBlock}"/>
<Border Height="1" BorderBrush="{StaticResource Border.Brush}" Grid.Row="1" VerticalAlignment="Top" Grid.ColumnSpan="6" BorderThickness="1"/>
<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
</Grid>
<!--ItemsSource="{Binding OrderList}"-->
<ListBox x:Name="listbox_order" Margin="10 0 5 0"
Grid.Row="1"
ItemsSource="{Binding ConsumableList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0,1,0,0"
Foreground="{StaticResource Text.Color}"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_order,Converter={StaticResource widthConverter},ConverterParameter=-0}"
MinHeight="60">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="170"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<TextBlock
Text="{Binding Name}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
</Grid>
<Grid Grid.Column="1">
<TextBlock
Text="{Binding Price}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
</Grid>
<Grid Grid.Column="2">
<TextBlock
Text="{Binding Weigth}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
</Grid>
<Grid Grid.Column="3">
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
TextWrapping="Wrap"
>
<Run Text="{Binding Length}"/>
<Run Text="*" />
<Run Text="{Binding Width}"/>
<Run Text="*" />
<Run Text="{Binding Heigth}"/>
</TextBlock>
</Grid>
<Grid Grid.Column="4" HorizontalAlignment="Center" VerticalAlignment="Center" >
<TextBlock TextAlignment="Center"
Text="{Binding Remark}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
</Grid>
<Grid Grid.Column="5">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<c:BButton Background="Transparent" Foreground="Blue" Content="编辑" Command="{Binding EditConsumableCommand}" Margin="0 0 10 0"/>
<c:BButton Background="Transparent" Foreground="Blue" Content="删除" Command="{Binding DeletedConsumableCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}, Path=ItemsSource}"
/>
</StackPanel>
</Grid>
<Border Width="1" HorizontalAlignment="Left" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Height="1" VerticalAlignment="Bottom" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="6"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<c:PageControl PageIndex="{Binding PageIndex}"
PageSize="{Binding PageSize}"
RecordCount="{Binding OrderCount}"
Grid.Row="3"
HorizontalAlignment="Left" Width="450">
<b:Interaction.Triggers>
<b:EventTrigger EventName="OnPageIndexChanged">
<b:InvokeCommandAction Command="{Binding TaskPageIndexChangedCommand}" PassEventArgsToCommand="True"/>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:PageControl>
</Grid>
</Grid>
</Page>

164
BBWY.Client/Views/PackTask/Consumable.xaml.cs

@ -0,0 +1,164 @@
using BBWY.Client.APIServices;
using BBWY.Client.Helpers;
using BBWY.Client.Models.PackTask;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Common.Models;
using BBWY.Controls;
using GalaSoft.MvvmLight.Messaging;
using HandyControl.Controls;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// Consumable.xaml 的交互逻辑
/// </summary>
public partial class Consumable : Page
{
public ConsumableViewModel model;
// public ConsumableService consumableService;
public Consumable()
{
//this.consumableService = consumableService;
InitializeComponent();
// model = new ConsumableViewModel(consumableService);
//model.ReflashDatas = GetList;
//this.DataContext = model;
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;
Messenger.Default.Register<bool>(this, message =>
{
GetList();
});
}
string QKApiHost = "";
List<string> consumables = new List<string>();
private void ListBox_SelectionChanged(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;
consumableName.Text = content.Content.ToString();
tipBox.Visibility = Visibility.Collapsed;
}
catch (Exception)
{
}
}
private void consumableName_TextChanged(object sender, TextChangedEventArgs e)
{
try
{
var textBoxt = (BTextBox)sender;
//创建一个ListBox
if (tipBox != null && tipBox.Items.Count > 0)
{
tipBox.Items.Clear();
}
if (consumables.Count <= 0)
{
GetList();
}
if (string.IsNullOrEmpty(textBoxt.Text))
{
tipBox.Visibility = Visibility.Collapsed;
return;
}
foreach (var department in consumables)
{
if (department.Contains(textBoxt.Text))
{
ListBoxItem item = new ListBoxItem();
Label lb = new Label();
lb.Content = department;
item.Content = lb;
tipBox.Items.Add(item);
}
}
tipBox.Visibility = Visibility.Visible;
}
catch (Exception)
{
}
}
/// <summary>
/// 刷新数据
/// </summary>
private void GetList()
{
HttpClientHelper helper = new HttpClientHelper(QKApiHost);
string url = $"{QKApiHost}/api/Consumable/SearchAll";//获取所有数据
var data = helper.Get(url);
var res = JsonConvert.DeserializeObject<ApiResponse<ConsumableModel[]>>(data);
//创建一个ListBoxIem
if (res.Success)
{
if (res.Data != null && res.Data.Count() > 0)
{
consumables = new List<string>();
foreach (var department in res.Data)
{
if (!consumables.Contains(department.Name))
{
consumables.Add(department.Name);
}
}
}
}
}
}
}

341
BBWY.Client/Views/PackTask/CreatePackTask.xaml

@ -0,0 +1,341 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.CreatePackTask"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
DataContext="{Binding CreateTaskView,Source={StaticResource Locator}}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0"
Title="CreatePackTask" Height="350" Width="1500">
<!-- DataContext="{Binding CreateTaskView,Source={StaticResource Locator}}" -->
<Window.Resources>
<ResourceDictionary>
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="cmodel:StorageType"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ctr:OrderStorageTypeOptionConverter x:Key="ostConverter"/>
<ctr:ProfitRatioConverter x:Key="profitRatioConverter"/>
<ctr:WaybillNoConverter x:Key="waybillConverter"/>
<ctr:MultiParameterTransferConverter x:Key="mptConverter"/>
<ctr:SaleGrossProfitConverter x:Key="sgpcConverter"/>
</ResourceDictionary>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="150"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<Grid Background="{StaticResource Border.Background}">
<TextBlock Text="发布任务" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="350"/>
<ColumnDefinition Width="350"/>
<ColumnDefinition Width="350"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<c:BTextBox Width="200" Margin="10,0,5,0" Height="35" Text="{Binding SearchSkuId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="请输入SkuId"/>
<Button Content="查询" Width="118" Height="35" VerticalAlignment="Stretch" Command="{Binding SearchSkuCommand}"
Background="{StaticResource Button.Background}" BorderThickness="0" Foreground="White"/>
</StackPanel>
<Grid Grid.Row="1" Margin="10,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="80" DecodePixelWidth="80"
VerticalAlignment="Top" Margin="0,5,0,0"
Cursor="Hand">
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction >
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<!--<Binding Path="DataContext.Id" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1}"/>
<Binding Path="Id"/>-->
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BAsyncImage>
<!--<Image Height="80" Width="80" Source="{Binding Logo}" Grid.Column="0"/>-->
<Grid Grid.Column="2" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock VerticalAlignment="Center" Margin="10,0">
<Run Text="SKU名称: "/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
<TextBlock Grid.Row="1" VerticalAlignment="Center" Margin="10,0">
<Run Text="货号: "/>
<Run Text="{Binding ProductNo}"/>
</TextBlock>
<Grid Grid.Row="2" VerticalAlignment="Center" Margin="10,0">
<TextBlock Text="品名:" VerticalAlignment="Center"/>
<c:BTextBox Width="200" Margin="10,0,0,0" Text="{Binding BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="请输入品名"/>
</Grid>
</Grid>
</Grid>
</Grid>
<Grid Margin="10" Grid.Column="1" Background="{StaticResource Border.Background}">
<Button Content="设置条形码" Width="100" Height="30" VerticalAlignment="Center" Command="{Binding SetBarCodeCommand}"
Visibility="{Binding IsSetBarCode, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }"
Background="{StaticResource Button.Background}" BorderThickness="0" Foreground="White"/>
<StackPanel Visibility="{Binding IsSetBarCode, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }" Orientation="Horizontal" HorizontalAlignment="Center" >
<Button Content="预览" Width="100" Height="30" VerticalAlignment="Center" Command="{Binding LookBarCommand}"
Background="#2879ff" BorderThickness="0" Foreground="White"/>
<Button Content="修改" Width="100" Height="30" VerticalAlignment="Center" Command="{Binding SetBarCodeCommand}"
Background="{StaticResource Button.Background}" BorderThickness="0" Foreground="White"/>
</StackPanel >
</Grid>
<Grid Margin="10" Grid.Column="2" Background="{StaticResource Border.Background}">
<Button Content="设置合格证" Width="100" Height="30" VerticalAlignment="Center"
Command="{Binding SetCertificateCommand}"
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }"
Background="{StaticResource Button.Background}" BorderThickness="0" Foreground="White"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }">
<Button Content="预览" Width="100" Height="30" VerticalAlignment="Center" Command="{Binding LookCerCommand}"
Background="#2879ff" BorderThickness="0" Foreground="White"/>
<Button Content="修改" Width="100" Height="30" VerticalAlignment="Center" Command="{Binding SetCertificateCommand}"
Background="{StaticResource Button.Background}" BorderThickness="0" Foreground="White"/>
</StackPanel >
</Grid>
</Grid>
<Grid Margin="10" Grid.Row="2">
<Grid >
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontFamily" Value="微软雅黑"/>
</Style>
<Style TargetType="Border" >
<Setter Property="BorderBrush" Value="{StaticResource Border.Brush}"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Grid.Column="0" />
<Border Grid.Row="0" Grid.Column="1" />
<Border Grid.Row="0" Grid.Column="2" />
<Border Grid.Row="0" Grid.Column="3"/>
<Border Grid.Row="0" Grid.Column="4" />
<Border Grid.Row="0" Grid.Column="5" />
<Border Grid.Row="0" Grid.Column="6" />
<Border Grid.Row="0" Grid.Column="7" />
<Border Grid.Row="0" Grid.Column="8" />
<Border Grid.Row="0" Grid.Column="9"/>
<Border Grid.Row="0" Grid.Column="10" />
<Border Grid.Row="0" Grid.Column="11" />
<Border Grid.Row="0" Grid.Column="12" />
<Border Grid.Row="0" Grid.Column="13" />
<Border Grid.Row="1" Grid.Column="0" />
<Border Grid.Row="1" Grid.Column="1" />
<Border Grid.Row="1" Grid.Column="2" />
<Border Grid.Row="1" Grid.Column="3"/>
<Border Grid.Row="1" Grid.Column="4" />
<Border Grid.Row="1" Grid.Column="5" />
<Border Grid.Row="1" Grid.Column="6" />
<Border Grid.Row="1" Grid.Column="7" />
<Border Grid.Row="1" Grid.Column="8" />
<Border Grid.Row="1" Grid.Column="9"/>
<Border Grid.Row="1" Grid.Column="10" />
<Border Grid.Row="1" Grid.Column="11" />
<Border Grid.Row="1" Grid.Column="12" />
<Border Grid.Row="1" Grid.Column="13" />
<TextBlock Grid.Row="0" Grid.Column="0" Text="SKU数量"/>
<TextBlock Grid.Row="0" Grid.Column="1" Text="到货情况"/>
<TextBlock Grid.Row="0" Grid.Column="2" Text="加急"/>
<TextBlock Grid.Row="0" Grid.Column="3" Text="落仓"/>
<TextBlock Grid.Row="0" Grid.Column="4" Text="组合类型"/>
<TextBlock Grid.Row="0" Grid.Column="5" Text="配件数量"/>
<TextBlock Grid.Row="0" Grid.Column="6" Text="SKU配件商品"/>
<TextBlock Grid.Row="0" Grid.Column="7" Text="基础包装"/>
<TextBlock Grid.Row="0" Grid.Column="8" Text="增量耗材"/>
<TextBlock Grid.Row="0" Grid.Column="9" Text="增量耗材"/>
<TextBlock Grid.Row="0" Grid.Column="10" Text="条码标签"/>
<TextBlock Grid.Row="0" Grid.Column="11" Text="合格证"/>
<TextBlock Grid.Row="0" Grid.Column="12" Text="合格证位置"/>
<TextBlock Grid.Row="0" Grid.Column="13" Text="注意事项/对接备注"/>
<c:BTextBox BorderBrush="Transparent" Grid.Row="1" Grid.Column="0" Height="30" Text="{Binding SkuCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<c:BTextBox BorderBrush="Transparent" Grid.Row="1" Grid.Column="5" Height="30" Margin="5" Text="{Binding GoodsNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<c:BTextBox BorderBrush="Transparent" Grid.Row="1" Grid.Column="6" Height="30" Margin="5" Text="{Binding SkuTitle,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<c:BTextBox BorderBrush="Transparent" Grid.Row="1" Grid.Column="13" Margin="5" Height="30" Text="{Binding MarkMessage,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<Grid Grid.Row="1" Grid.Column="1" >
<ComboBox VerticalContentAlignment="Center" Margin="5" Text="{Binding Availability}" >
<ComboBoxItem Content="已到货" IsSelected="True" />
<ComboBoxItem Content="部分到货"/>
<ComboBoxItem Content="未到货"/>
</ComboBox>
</Grid>
<Grid Grid.Row="1" Grid.Column="2" >
<ComboBox VerticalContentAlignment="Center" Text="{Binding IsWorry}" Margin="5" >
<ComboBoxItem Content="否" IsSelected="True" />
<ComboBoxItem Content="是"/>
</ComboBox>
</Grid>
<Grid Grid.Row="1" Grid.Column="3" >
<ComboBox VerticalContentAlignment="Center" Text="{Binding PositionType}" Margin="5" >
<ComboBoxItem Content="本地仓" IsSelected="True" />
<ComboBoxItem Content="齐越仓"/>
<ComboBoxItem Content="京东仓"/>
</ComboBox>
</Grid>
<Grid Grid.Row="1" Grid.Column="4" >
<ComboBox VerticalContentAlignment="Center" Margin="5" Text="{Binding PackType}" >
<ComboBoxItem Content="单件" IsSelected="True" />
<ComboBoxItem Content="多件"/>
</ComboBox>
</Grid>
<Grid Grid.Row="1" Grid.Column="7" >
<ComboBox BorderBrush="Transparent" VerticalContentAlignment="Center" Margin="5" Text="{Binding BasicPack}" >
<ComboBoxItem Content="快递袋" IsSelected="True" />
<ComboBoxItem Content="纸箱"/>
<ComboBoxItem Content="麻袋"/>
</ComboBox>
</Grid>
<Grid Grid.Row="1" Grid.Column="8">
<c:BTextBox WaterRemark="增量耗材关键字" HorizontalAlignment="Stretch" BorderBrush="Transparent"
Text="{Binding SearchIncrementKeyWord,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="9">
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Grid.Resources>
<hc:CheckComboBox IsTextSearchEnabled="True" ItemsSource="{Binding IncreateList}"
ShowClearButton="True"
MinWidth="90"
Height="25"
Margin="5,0,5,0">
<hc:CheckComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="5,2.5">
<CheckBox Content="{Binding IncreateName}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
</DataTemplate>
</hc:CheckComboBox.ItemTemplate>
<hc:CheckComboBox.ItemContainerStyle>
<Style TargetType="{x:Type hc:CheckComboBoxItem}" BasedOn="{StaticResource NoBgListBoxItemStyle}">
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Style>
</hc:CheckComboBox.ItemContainerStyle>
</hc:CheckComboBox>
</Grid>
<Grid Grid.Row="1" Grid.Column="10" >
<ComboBox VerticalContentAlignment="Center" Margin="5" Text="{Binding IsNeedBarCode}">
<ComboBoxItem Content="需要" />
<ComboBoxItem Content="不需要" IsSelected="True"/>
</ComboBox>
</Grid>
<Grid Grid.Row="1" Grid.Column="11" >
<ComboBox VerticalContentAlignment="Center" Margin="5" Text="{Binding IsNeedCertificateModel}">
<ComboBoxItem Content="需要" />
<ComboBoxItem Content="不需要" IsSelected="True"/>
</ComboBox>
</Grid>
<Grid Grid.Row="1" Grid.Column="12" >
<ComboBox VerticalContentAlignment="Center" Margin="5" Text="{Binding CertificatePosition}">
<ComboBoxItem Content="外部包装" />
<ComboBoxItem Content="产品包装"/>
<ComboBoxItem Content="无" IsSelected="True"/>
</ComboBox>
</Grid>
</Grid>
</Grid>
<Grid Grid.Row="3">
<Button Content="发布" Width="100" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="0,2,5,2"
Command="{Binding CreateTaskCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
Background="{StaticResource Button.Background}" BorderThickness="0" Foreground="White"/>
</Grid>
</Grid>
</c:BWindow>

53
BBWY.Client/Views/PackTask/CreatePackTask.xaml.cs

@ -0,0 +1,53 @@
using BBWY.Client.APIServices;
using BBWY.Client.ViewModels;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Common.Models;
using BBWY.Controls;
using GalaSoft.MvvmLight.Messaging;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// CreatePackTask.xaml 的交互逻辑
/// </summary>
public partial class CreatePackTask : BWindow,IDenpendency
{
//CreatePackTaskViewModel model = null;//PackTaskService packTaskService,GlobalContext globalContext,ProductService productService
public CreatePackTask()
{
InitializeComponent();
// ViewModelLocator vm = new ViewModelLocator();
//this.DataContext = vm.CreateTaskView;
// vm.CreateTaskView.Refresh();
//model = new CreatePackTaskViewModel(packTaskService, globalContext, productService);
//DataContext = model;
}
public void SendData()
{
Messenger.Default.Send(true,"InitData");
}
}
}

59
BBWY.Client/Views/PackTask/EditConsumable.xaml

@ -0,0 +1,59 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.EditConsumable"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
Title="TipsWindow" Height="350" Width="640"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
CloseButtonVisibility="Visible"
WindowStartupLocation="CenterScreen"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0"
>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="添加耗材" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1">
<TextBlock Text="{Binding Id,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Visibility="Hidden"/>
<TextBlock Text="耗材品名:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="33,33,0,0"/>
<c:BTextBox Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="25" Width="180" VerticalAlignment="Top" Margin="93,30,0,0"/>
<TextBlock Text="金额:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="321,33,0,0"/>
<c:BTextBox Text="{Binding Price ,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="25" Width="228" VerticalAlignment="Top" Margin="353,30,0,0"/>
<TextBlock Text="重量:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="57,73,0,0"/>
<c:BTextBox Text="{Binding Weigth,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="25" Width="180" VerticalAlignment="Top" Margin="93,70,0,0"/>
<TextBlock Text="尺寸:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="321,73,0,0"/>
<c:BTextBox WaterRemark="长" Text="{Binding Length,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="25" Width="64" VerticalAlignment="Top" Margin="353,70,0,0"/>
<c:BTextBox WaterRemark="宽" Text="{Binding Width,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="25" Width="64" VerticalAlignment="Top" Margin="417,70,0,0"/>
<c:BTextBox WaterRemark="高" Text="{Binding Heigth,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" Height="25" Width="64" VerticalAlignment="Top" Margin="481,70,0,0"/>
<Label Content="cm" Width="38" Height="25" Background="{StaticResource Border.Background}" HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="545,70,0,0"/>
<TextBlock Text="备注:" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="57,113,0,0"/>
<TextBox Text="{Binding Remark,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Left" VerticalAlignment="Top" AcceptsReturn="True" TextWrapping="Wrap" Height="115" Width="487" Margin="93,110,0,0"/>
</Grid>
<Border BorderThickness="0 1 0 0" Grid.Row="2" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Brush}"/>
<c:BButton Grid.Row="2" Content="保存" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch"
Command="{Binding SaveConsumableCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
/>
</Grid>
</c:BWindow>

30
BBWY.Client/Views/PackTask/EditConsumable.xaml.cs

@ -0,0 +1,30 @@
using BBWY.Client.Models.PackTask;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// EditConsumable.xaml 的交互逻辑
/// </summary>
public partial class EditConsumable : BWindow
{
public EditConsumable(ConsumableModel model)
{
InitializeComponent();
this.DataContext = model;
}
}
}

12
BBWY.Client/Views/PackTask/FeesExcelControl.xaml

@ -0,0 +1,12 @@
<UserControl x:Class="BBWY.Client.Views.PackTask.FeesExcelControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="1800">
<Grid x:Name ="gd"/>
</UserControl>

288
BBWY.Client/Views/PackTask/FeesExcelControl.xaml.cs

@ -0,0 +1,288 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel.Response.PackTask;
using NPOI.POIFS.Crypt.Dsig;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// FeesExcelControl.xaml 的交互逻辑
/// </summary>
public partial class FeesExcelControl : UserControl
{
/// <summary>
/// 是否仓库端
/// </summary>
public bool IsWareHouse
{
get { return (bool)GetValue(IsWareHouseProperty); }
set
{
SetValue(IsWareHouseProperty, value);
}
}
public static readonly DependencyProperty IsWareHouseProperty =
DependencyProperty.Register("IsWareHouse", typeof(bool), typeof(FeesExcelControl), new PropertyMetadata(true, ChangedProperty1));
/// <summary>
/// 价格
/// </summary>
//public decimal FeesPrice
//{
// get { return (decimal)GetValue(FeesPriceProperty); }
// set
// {
// SetValue(FeesPriceProperty, value);
// }
//}
//public static readonly DependencyProperty FeesPriceProperty =
// DependencyProperty.Register("FeesPrice", typeof(decimal), typeof(FeesExcelControl), new PropertyMetadata(ChangedProperty2));
public FeesItemResponse FeesItem
{
get
{
return (FeesItemResponse)GetValue(FeesItemProperty);
}
set
{
SetValue(FeesItemProperty, value);
}
}
public static readonly DependencyProperty FeesItemProperty =
DependencyProperty.Register("FeesItem", typeof(FeesItemResponse), typeof(FeesExcelControl), new PropertyMetadata(ChangedProperty));
private static void ChangedProperty1(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = d as FeesExcelControl;
var newValue = e.NewValue as FeesItemResponse;
}
private static void ChangedProperty(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = d as FeesExcelControl;
// control.Str
var newValue = e.NewValue as FeesItemResponse;
control.FeesItem = newValue;
if (control.IsWareHouse)
{
control.LoadData(false);
}
else
{
control.LoadData(true);
}
}
string xaml = @" <Grid xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
<Grid.ColumnDefinitions >
[:Columns:]
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
</Grid.RowDefinitions>
<Border Background=""#F2F2F2"" Grid.RowSpan=""2"" Grid.ColumnSpan=""[:ColumnCount:]""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Column=""0"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Column=""1"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Right"" BorderBrush=""#D7D7D7"" Grid.Column=""[:1+IncreateCount+ProcessCount:+ConsumableCount]"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""0,0,1,0""/>
<Border Height=""1"" VerticalAlignment=""Top"" BorderBrush=""#D7D7D7"" Grid.Column=""0"" Grid.Row=""0"" Grid.ColumnSpan=""[:ColumnCount:]"" BorderThickness=""0,1,0,0""/>
<Border Height=""1"" VerticalAlignment=""Top"" BorderBrush=""#D7D7D7"" Grid.Column=""1"" Grid.Row=""1"" Grid.ColumnSpan=""[:ColumnCount-2:]"" BorderThickness=""0,1,0,0""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Column=""0"" Grid.Row=""1"" Grid.ColumnSpan=""[:ColumnCount:]"" BorderThickness=""0,1,0,0""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Column=""0"" Grid.Row=""2"" Grid.ColumnSpan=""[:ColumnCount:]"" BorderThickness=""0,1,0,0""/>
<TextBlock MinWidth=""84"" Text=""ID"" TextAlignment=""Center"" Grid.Column=""0"" Grid.RowSpan=""2"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
[:Header:]
<TextBlock MinWidth=""101"" TextAlignment=""Center"" Text="""" Grid.Column=""[:1+IncreateCount+ProcessCount:+ConsumableCount]"" Grid.RowSpan=""2"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:TaskId:]"" Grid.Row=""2"" Grid.Column=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:AllFees:]"" Grid.Row=""2"" Grid.Column=""[:1+IncreateCount+ProcessCount:+ConsumableCount]"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
[:ListData:]
</Grid>";
/// <summary>
/// index 从1开始 0+1
/// </summary>
string columnData = @"
<Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""2"" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text=""[:ServiceName:]"" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string columnStr = "<ColumnDefinition />";
string increateService = @"<TextBlock Text=""增值服务"" Grid.Column=""1"" Grid.ColumnSpan=""[:IncreateCount:]"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Column=""[:1+IncreateCount:]"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>";
string workProcess = "<TextBlock Text=\"打包服务\" Grid.Column=\"[:1+IncreateCount:]\" Grid.ColumnSpan=\"[:ProcessCount:]\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"/>\r\n <Border Width=\"1\" HorizontalAlignment=\"Left\" BorderBrush=\"#D7D7D7\" Grid.Column=\"[:1+IncreateCount+ProcessCount:]\" Grid.Row=\"0\" Grid.RowSpan=\"3\" BorderThickness=\"1,0,0,0\"/>\r\n ";
string consumableService = "<TextBlock Text=\"打包耗材\" Grid.Column=\"[:1+IncreateCount+ProcessCount:]\" Grid.ColumnSpan=\"[:ConsumableCount:]\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"/>\r\n <Border Width=\"1\" HorizontalAlignment=\"Left\" BorderBrush=\"#D7D7D7\" Grid.Column=\"[:1+IncreateCount+ProcessCount:+ConsumableCount]\" Grid.Row=\"0\" Grid.RowSpan=\"3\" BorderThickness=\"1,0,0,0\"/>\r\n ";
public FeesExcelControl()
{
InitializeComponent();
}
private void LoadData(bool isPrice)
{
if (FeesItem == null || FeesItem.ServiceList.Count <= 0)
{
return;
}
try
{
App.Current.Dispatcher.Invoke(() =>
{
gd.Children.Clear();
});
var increateList = FeesItem.ServiceList.Where(s => s.ServiceType == ServiceType.).ToList();
var processList = FeesItem.ServiceList.Where(s => s.ServiceType == ServiceType.).ToList();
var consumableList = FeesItem.ServiceList.Where(s => s.ServiceType == ServiceType.).ToList();
var increateCount = increateList.Count();
var processCount = processList.Count();
var consumableCount = consumableList.Count();
List<ServiceItemResponse> all = new List<ServiceItemResponse>();
all.AddRange(increateList);
all.AddRange(processList);
all.AddRange(consumableList);
var columnCount = 2 + all.Count;
StringBuilder columns = new StringBuilder();
for (int i = 0; i < columnCount; i++)
{
columns.AppendLine(columnStr);
}
StringBuilder serviceData = new StringBuilder();
if (isPrice)
{
for (int i = 0; i < all.Count; i++)
{
serviceData.AppendLine(columnData.Replace("[:index:]", $"{i + 1}")
.Replace("[:ServiceName:]", $"{all[i].ItemName}")
.Replace("[:ServiceCount:]", $"{all[i].ItemPrice}"));
}
}
else
{
for (int i = 0; i < all.Count; i++)
{
serviceData.AppendLine(columnData.Replace("[:index:]", $"{i + 1}")
.Replace("[:ServiceName:]", $"{all[i].ItemName}")
.Replace("[:ServiceCount:]", $"{all[i].ItemCount}"));
}
}
StringBuilder header = new StringBuilder();
if (increateCount > 0)
{
header.AppendLine(increateService);
}
if (processCount > 0)
{
header.AppendLine(workProcess);
}
if (consumableCount > 0)
{
header.AppendLine(consumableService);
}
var newGrid = xaml.Replace("[:Header:]", header.ToString())
.Replace("[:Columns:]", columns.ToString())
.Replace("[:ColumnCount:]", $"{columnCount}")
.Replace("[:ColumnCount-2:]", $"{columnCount - 2}")
.Replace("[:1+IncreateCount:]", $"{increateCount + 1}")
.Replace("[:1+IncreateCount+ProcessCount:]", $"{1 + increateCount + processCount}")
.Replace("[:1+IncreateCount+ProcessCount:+ConsumableCount]", $"{1 + increateCount + processCount + consumableCount}")
.Replace("[:IncreateCount:]", $"{increateCount}")
.Replace("[:ProcessCount:]", $"{processCount}")
.Replace("[:ConsumableCount:]", $"{consumableCount}")
.Replace("[:TaskId:]", $"{FeesItem.TaskId}")
.Replace("[:ListData:]", serviceData.ToString())
;
if (isPrice)
{
newGrid = newGrid.Replace("[:AllFees:]", $"{FeesItem.SingleFees}");
}
else
{
newGrid = newGrid.Replace("[:AllFees:]", $"{FeesItem.AllFees}");
}
var grid = XamlReader.Parse(newGrid) as Grid;
App.Current.Dispatcher.Invoke(() =>
{
gd.Children.Add(grid);
});
}
catch
{
}
}
}
}

84
BBWY.Client/Views/PackTask/LookBarCodeWindow.xaml

@ -0,0 +1,84 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.LookBarCodeWindow"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
Style="{StaticResource bwstyle}"
Height="259" Width="320"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!-- DataContext="{Binding CreateSetBarCodeView,Source={StaticResource Locator}}"-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1">
<Border Name="jingjian" Visibility="Visible" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Height="220" Margin="1">
<StackPanel Orientation="Vertical" >
<TextBlock Margin="10,25,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品名:"/>
<Run Text="{Binding BrandName}"/>
</TextBlock>
<TextBlock Margin="10,25,10,0" FontSize="15" FontWeight="Black" >
<Run Text="规格:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
<Image Source="/resources/images/barcode.png" Margin="10,25,10,0"/>
<TextBlock Text="POP" HorizontalAlignment="Center" Margin="10,0,10,0" FontSize="15" FontWeight="Black" >
<Run Text="{Binding SkuId}"/>
</TextBlock>
</StackPanel>
</Border>
<Border Name="biaozhun" Visibility="Collapsed" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Height="220" Margin="5">
<StackPanel Orientation="Vertical" >
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品牌:"/>
<Run Text="{Binding Brand}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品名:"/>
<Run Text="{Binding BrandName}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="型号:"/>
<Run Text="{Binding ProductNo}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="规格:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
<Image Source="/resources/images/barcode.png" Margin="10,10,10,0"/>
<TextBlock Text="POP" HorizontalAlignment="Center" Margin="10,0,10,0" FontSize="15" FontWeight="Black" >
<Run Text="{Binding SkuId}"/>
</TextBlock>
</StackPanel>
</Border>
</Grid>
</Grid>
</c:BWindow>

40
BBWY.Client/Views/PackTask/LookBarCodeWindow.xaml.cs

@ -0,0 +1,40 @@
using BBWY.Client.Models;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// LookBarCodeWindow.xaml 的交互逻辑
/// </summary>
public partial class LookBarCodeWindow : BWindow
{
public LookBarCodeWindow(BarCodeModel BarCodeModel)
{
InitializeComponent();
this.DataContext = BarCodeModel;
if (BarCodeModel.LabelModel==BarcodeLabelModel.barsimplify)
{//精简版
jingjian.Visibility = Visibility.Visible;
biaozhun.Visibility = Visibility.Collapsed;
}
else
{
jingjian.Visibility = Visibility.Collapsed;
biaozhun.Visibility = Visibility.Visible;
}
}
}
}

99
BBWY.Client/Views/PackTask/LookCerWindow.xaml

@ -0,0 +1,99 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.LookCerWindow"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
Style="{StaticResource bwstyle}"
Height="357" Width="386"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!-- DataContext="{Binding CreateSetBarCodeView,Source={StaticResource Locator}}"-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="查看合格证" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1">
<Border Name="no3c" BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="1" VerticalAlignment="Top" HorizontalAlignment="Left">
<Grid>
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Text="合格证" FontSize="18" Margin="157,12,0,0" />
<TextBlock Text="品牌:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,70,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding Brand}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,65,0,0"/>
<TextBlock Text="型号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,70,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding ProductNo}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,65,0,0"/>
<TextBlock Text="品名:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,112,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding BrandName}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,107,0,0"/>
<TextBlock Text="材质:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,112,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding Shader}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,107,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,150,0,0" />
<TextBox IsReadOnly="True" BorderBrush="Transparent"
TextWrapping ="Wrap" AcceptsReturn="True"
Height="50" Text="{Binding ExcuteStander}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,148,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding ProductShop}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,246,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True"
Height="44" Text="{Binding ProductAdress}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/>
</Grid>
</Border>
<Border Name="is3c" Visibility="Collapsed" BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="1" 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 IsReadOnly="True" BorderBrush="Transparent" Text="{Binding Brand}" Height="25" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,85,0,0"/>
<TextBlock Text="型号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,90,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Text="{Binding ProductNo}" 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 IsReadOnly="True" BorderBrush="Transparent" Text="{Binding BrandName}" 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 IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding Shader}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,122,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,154,0,0" />
<TextBox IsReadOnly="True" BorderBrush="Transparent"
Text="{Binding ExcuteStander}" Height="40" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,153,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Text="{Binding ProductShop}" Height="25" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,246,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Text="{Binding ProductAdress}" 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 IsReadOnly="True" BorderBrush="Transparent" Text="{Binding FactoryNumber}" Height="25" Width="100" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="259,55,0,0"/>
<Image Source="/Resources/Images/3c.png" Width="54" Height="42" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="282,6,0,0" />
</Grid>
</Border>
</Grid>
</Grid>
</c:BWindow>

77
BBWY.Client/Views/PackTask/LookCerWindow.xaml.cs

@ -0,0 +1,77 @@
using BBWY.Client.Models;
using BBWY.Controls;
using Org.BouncyCastle.Crypto.Tls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// LookCerWindow.xaml 的交互逻辑
/// </summary>
public partial class LookCerWindow : BWindow
{
public LookCerWindow(CertificateModel certificate)
{
InitializeComponent();
CertificateModel data = new CertificateModel
{
Brand = certificate.Brand,
BrandName = certificate.BrandName,
ExcuteStander = certificate.ExcuteStander,
FactoryNumber = certificate.FactoryNumber,
IsLogo = certificate.IsLogo,
LabelModel = certificate.LabelModel,
ProductAdress = certificate.ProductAdress,
Id = certificate.Id,
ProductDate = certificate.ProductDate,
ProductNo = certificate.ProductNo,
ProductShop = certificate.ProductShop,
Shader = certificate.Shader,
SkuId = certificate.SkuId,
Reseller = certificate.Reseller
};
StringBuilder sb = new StringBuilder();
if (data.ExcuteStander.Contains(","))//有逗号就拆分
{
var excutes = data.ExcuteStander.Split(',', StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < excutes.Count(); i++)
{
if (i % 2 == 0 && i > 0)//间隔两个换行
{
sb.Append("\r\n");
}
sb.Append(excutes[i]).Append(" ");
}
sb.Remove(sb.Length - 4, 4);
data.ExcuteStander = sb.ToString();
}
this.DataContext = data;
if (data.IsLogo == 0)
{
is3c.Visibility = Visibility.Collapsed;
no3c.Visibility = Visibility.Visible;
}
else
{
is3c.Visibility = Visibility.Visible;
no3c.Visibility = Visibility.Collapsed;
}
}
}
}

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

@ -0,0 +1,96 @@
<Page x:Class="BBWY.Client.Views.PackTask.PersonList"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
DataContext="{Binding WareHouseList,Source={StaticResource Locator}}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="2048"
Title="TaskList">
<Page.Resources>
<sys:Int32 x:Key="d0">0</sys:Int32>
<sys:Int32 x:Key="d1">1</sys:Int32>
<sys:Int32 x:Key="d3">2</sys:Int32>
<sys:Int32 x:Key="d7">6</sys:Int32>
<sys:Int32 x:Key="d15">14</sys:Int32>
<sys:Int32 x:Key="d30">29</sys:Int32>
</Page.Resources>
<Grid>
<StackPanel Panel.ZIndex="10" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="810,15,0,0">
<c:BTextBox x:Name="tb" Width="150" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></c:BTextBox>
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="SelectionChangeCommand" Background="{StaticResource Border.Background}">
</ListBox>
</StackPanel>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<Grid Margin="5,0">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
<RowDefinition Height="30"/>
<!---->
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Left" Panel.ZIndex="999" Margin="0,5,0,0" Width="1100">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0" Height="30">
<StackPanel.Resources>
<Style TargetType="DatePickerTextBox">
<Setter Property="IsReadOnly" Value="True"/>
</Style>
</StackPanel.Resources>
<TextBlock Text="提交时间:" VerticalAlignment="Center" Margin="11,0,0,0"/>
<DatePicker SelectedDate="{Binding StartTime}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="10,0,0,0"/>
<DatePicker SelectedDate="{Binding EndTime}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="10,0,0,0"/>
<TextBlock Text="花名:" 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="任务ID:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" Text="{Binding SearchTaskId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark=""/>
<TextBlock Text="部门:" VerticalAlignment="Center" Margin="16,0,0,0"/>
</StackPanel>
<Grid Grid.Column="1" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Content="搜索" Width="80" VerticalAlignment="Stretch" Margin="5,0,0,0"
Command="{Binding SearchTaskCommand}"
Grid.RowSpan="2" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</Grid>
</Grid>
<Border Grid.Row="2" Margin="0,5,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,0,0"/>
<c:PageControl PageIndex="{Binding PageIndex}"
PageSize="{Binding PageSize}"
RecordCount="{Binding OrderCount}"
Grid.Row="3"
HorizontalAlignment="Left" Width="450">
<b:Interaction.Triggers>
<b:EventTrigger EventName="OnPageIndexChanged">
<b:InvokeCommandAction Command="{Binding TaskPageIndexChangedCommand}" PassEventArgsToCommand="True"/>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:PageControl>
</Grid>
</Grid>
</Page>

135
BBWY.Client/Views/PackTask/PersonList.xaml.cs

@ -0,0 +1,135 @@
using BBWY.Client.Helpers;
using BBWY.Client.Models.PackTask;
using BBWY.Common.Models;
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;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Linq;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// PersonList.xaml 的交互逻辑
/// </summary>
public partial class PersonList : Page
{
public PersonList()
{
InitializeComponent();
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;
}
/// <summary>
/// 主机域名
/// </summary>
string QKApiHost = "";
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;
tb.Text = content.Content.ToString();
tipBox.Visibility = Visibility.Collapsed;
}
catch (Exception)
{
}
}
List<string> departments = new List<string>();
private void tb_TextChanged(object sender, TextChangedEventArgs e)
{
try
{
var textBoxt = (TextBox)sender;
//创建一个ListBox
if (tipBox != null && tipBox.Items.Count > 0)
{
tipBox.Items.Clear();
}
if (departments.Count <= 0)
{
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);
}
}
}
}
}
if (string.IsNullOrEmpty(textBoxt.Text))
{
tipBox.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;
tipBox.Items.Add(item);
}
}
tipBox.Visibility = Visibility.Visible;
}
catch (Exception)
{
}
}
}
}

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

@ -0,0 +1,151 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.PrintWindow"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
Style="{StaticResource bwstyle}"
Height="510" Width="448"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!-- DataContext="{Binding CreateSetBarCodeView,Source={StaticResource Locator}}"-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="39"/>
<RowDefinition/>
<RowDefinition Height="36"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="打印设置" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1">
<TextBlock Margin="33,28" VerticalAlignment="Top" HorizontalAlignment="Left" Height="15" Width="43" Text="打印机:"/>
<ComboBox x:Name="cbPrints" Margin="81,23,0,0" Width="197" Height="25" VerticalAlignment="Top" HorizontalAlignment="Left" />
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Left" Margin="41,70,0,0" Width="30" Height="15" Text="数量:"/>
<c:BTextBox x:Name="tbCount" Width="197" Margin="81,65,0,0" Height="25" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<Grid Name="bar" Visibility="Collapsed" Grid.Row="1" >
<Border Name="jingjian" Visibility="Visible" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Width="371" Margin="38,113,38,29">
<StackPanel Orientation="Vertical" >
<TextBlock Margin="10,25,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品名:"/>
<Run Text="{Binding BrandName}"/>
</TextBlock>
<TextBlock Margin="10,25,10,0" FontSize="15" FontWeight="Black" >
<Run Text="规格:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
<Image Source="/resources/images/barcode.png" Margin="10,25,10,0"/>
<TextBlock Text="POP" HorizontalAlignment="Center" Margin="10,0,10,0" FontSize="15" FontWeight="Black" >
<Run Text="{Binding SkuId}"/>
</TextBlock>
</StackPanel>
</Border>
<Border Name="biaozhun" Visibility="Collapsed" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Width="371" Height="240" Margin="5">
<StackPanel Orientation="Vertical" >
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品牌:"/>
<Run Text="{Binding Brand}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品名:"/>
<Run Text="{Binding BrandName}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="型号:"/>
<Run Text="{Binding ProductNo}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="规格:"/>
<Run Text="{Binding SkuName}"/>
</TextBlock>
<Image Source="/resources/images/barcode.png" Margin="10,10,10,0"/>
<TextBlock Text="POP" HorizontalAlignment="Center" Margin="10,0,10,0" FontSize="15" FontWeight="Black" >
<Run Text="{Binding SkuId}"/>
</TextBlock>
</StackPanel>
</Border>
</Grid>
<Grid x:Name="cer" Grid.Row="1">
<Border Name="no3c" Visibility="Collapsed" BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="33,110,0,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 IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding Brand}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,65"/>
<TextBlock Text="型号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,70,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding ProductNo}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,65,0,0"/>
<TextBlock Text="品名:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,112,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding BrandName}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,107,0,0"/>
<TextBlock Text="材质:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,112,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding Shader}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,107,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,150,0,0" />
<TextBox IsReadOnly="True" BorderBrush="Transparent"
TextWrapping ="Wrap" AcceptsReturn="True"
Height="50" Text="{Binding ExcuteStander}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,148,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding ProductShop}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,246,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True"
Height="44" Text="{Binding ProductAdress}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/>
</Grid>
</Border>
<Border Name="is3c" BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="33,110,0,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 IsReadOnly="True" BorderBrush="Transparent" Text="{Binding Brand}" Height="25" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,85"/>
<TextBlock Text="型号:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="203,90,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Text="{Binding ProductNo}" 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 IsReadOnly="True" BorderBrush="Transparent" Text="{Binding BrandName}" 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 IsReadOnly="True" BorderBrush="Transparent" Height="25" Text="{Binding Shader}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="233,122,0,0"/>
<TextBlock Text="执行标准:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="9,166,0,0" />
<TextBox IsReadOnly="True" BorderBrush="Transparent"
Text="{Binding ExcuteStander}" Height="40" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,161,0,0"/>
<TextBlock Text="生产商:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="19,206,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" Text="{Binding ProductShop}" Height="25" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,201,0,0"/>
<TextBlock Text="地址:" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="33,246,0,0" />
<c:BTextBox IsReadOnly="True" BorderBrush="Transparent" TextWrapping ="Wrap" AcceptsReturn="True" Text="{Binding ProductAdress}" 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 IsReadOnly="True" BorderBrush="Transparent" Text="{Binding FactoryNumber}" Height="25" Width="100" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="259,55,0,0"/>
<Image Source="/Resources/Images/3c.png" Width="54" Height="42" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="282,6,0,0" />
</Grid>
</Border>
</Grid>
</Grid>
<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="Top" Click="BButton_Click" Height="30" Margin="1"
/>
</Grid>
</c:BWindow>

180
BBWY.Client/Views/PackTask/PrintWindow.xaml.cs

@ -0,0 +1,180 @@
using BBWY.Client.Helpers;
using BBWY.Client.Models;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// PrintWindow.xaml 的交互逻辑
/// </summary>
public partial class PrintWindow : BWindow
{
public PrintWindow()
{
InitializeComponent();
var printingNames = System.Drawing.Printing.PrinterSettings.InstalledPrinters;//获取本机的打印机数据
int index = -1;
int selectIndex = 0;
foreach (string name in printingNames)
{
if (name== "Microsoft XPS Document Writer"||name== "Microsoft Print to PDF"||name== "Fax")
{
continue;
}
index++;
if (name.Contains("Deli"))
{
selectIndex = index;
}
cbPrints.Items.Add(name);
}
if (cbPrints.Items.Count>selectIndex)
{
cbPrints.SelectedIndex = selectIndex;
}
}
/// <summary>
/// 加载预览打印数据
/// </summary>
public void LoadData()
{
if (certificateModel==null)
{
cer.Visibility = Visibility.Collapsed;
}
else
{
cer.Visibility = Visibility.Visible;
bar.Visibility = Visibility.Collapsed;
CertificateModel data = new CertificateModel
{
Brand = certificateModel.Brand,
BrandName = certificateModel.BrandName,
ExcuteStander = certificateModel.ExcuteStander,
FactoryNumber = certificateModel.FactoryNumber,
IsLogo = certificateModel.IsLogo,
LabelModel = certificateModel.LabelModel,
ProductAdress = certificateModel.ProductAdress,
Id = certificateModel.Id,
ProductDate = certificateModel.ProductDate,
ProductNo = certificateModel.ProductNo,
ProductShop = certificateModel.ProductShop,
Shader = certificateModel.Shader,
SkuId = certificateModel.SkuId,
Reseller = certificateModel.Reseller
};
StringBuilder sb = new StringBuilder();
if (data.ExcuteStander.Contains(","))//有逗号就拆分
{
var excutes = data.ExcuteStander.Split(',', StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < excutes.Count(); i++)
{
if (i % 2 == 0 && i > 0)//间隔两个换行
{
sb.Append("\r\n");
}
sb.Append(excutes[i]).Append(" ");
}
sb.Remove(sb.Length - 4, 4);
data.ExcuteStander = sb.ToString();
}
this.DataContext = data;
if (data.IsLogo == 0)
{
is3c.Visibility = Visibility.Collapsed;
no3c.Visibility = Visibility.Visible;
}
else
{
is3c.Visibility = Visibility.Visible;
no3c.Visibility = Visibility.Collapsed;
}
}
if (barCodeModel == null)
{
bar.Visibility = Visibility.Collapsed;
}
else
{
bar.Visibility = Visibility.Visible;
cer.Visibility = Visibility.Collapsed;
this.DataContext = barCodeModel;
if (barCodeModel.LabelModel == BarcodeLabelModel.barsimplify)
{//精简版
jingjian.Visibility = Visibility.Visible;
biaozhun.Visibility = Visibility.Collapsed;
}
else
{
jingjian.Visibility = Visibility.Collapsed;
biaozhun.Visibility = Visibility.Visible;
}
}
}
public CertificateModel certificateModel { get; set; }
public BarCodeModel barCodeModel { get; set; }
public string LabelName { get; set; }
public Dictionary<string, string> Datas { get; set; }
private void BButton_Click(object sender, RoutedEventArgs e)
{
try
{
string path = Directory.GetCurrentDirectory()+ $"/Resources/LabelNames/{LabelName}.btw";
int printCount = Convert.ToInt32(tbCount.Text);
string printName =cbPrints.Text;
PrintBarCode(path,printCount,printName);
}
catch (Exception ex)
{
new TipsWindow("打印失败").ShowDialog();
}
}
/// <summary>
/// 打印条形码
/// </summary>
private void PrintBarCode(string labelPath,int printNums,string PrintName)
{
BartenderHelper helper = new BartenderHelper();
string msg = "";
helper.BTPrint(labelPath, Datas, out msg, printNums, PrintName);
if (msg == "OK")
{
return;
}
new TipsWindow(msg).ShowDialog();//打印失败提示
}
}
}

231
BBWY.Client/Views/PackTask/ServiceWindow.xaml

@ -0,0 +1,231 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.ServiceWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
Title="TipsWindow" Height="769" Width="350"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
CloseButtonVisibility="Visible"
WindowStartupLocation="CenterScreen"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!--DataContext="{Binding PackServiceList,Source={StaticResource Locator}}"-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="服务、 耗材、 参与人" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition Height="250"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="87"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<TextBlock Text="增值服务" Margin="19,33,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" />
<Border Background="Black" HorizontalAlignment="Left" VerticalAlignment="Top" Width="217" Margin="77,40,0,0" Height="1"/>
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="322" Margin="19,56,0,0" Height="1"/>
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="322" Margin="19,86,0,0" Height="1"/>
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="19,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="135,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="219,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="300,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="340,56,0,0" Height="30" />
<Label Content="增值服务项目" Width="116" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="19,56,0,0" />
<Label Content="成员" Width="84" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="135,56,0,0" />
<Label Content="数量" Width="80" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="219,56,0,0" />
<Label Content="操作" Width="40" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="303,56,0,0" />
<StackPanel Grid.Row="1" Orientation="Vertical" MaxHeight="140" Width="322" Margin="19,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent">
<ListBox ItemsSource="{Binding IncreateList}" ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0" MaxHeight="100"
Foreground="{StaticResource Text.Color}"
ScrollViewer.VerticalScrollBarVisibility="Auto" >
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="116"/>
<ColumnDefinition Width="84"/>
<ColumnDefinition Width="84"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<ComboBox VerticalContentAlignment="Center" Grid.Column="0" ItemsSource="{Binding IncreateServiceList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="ServiceName" SelectedValuePath="Id" SelectedValue="{Binding SelectId}" Text="{Binding ItemName}" Width="116" Height="30"/>
<ComboBox VerticalContentAlignment="Center" Grid.Column="1" ItemsSource="{Binding MemberList}" DisplayMemberPath="UserName" SelectedValuePath="Id" SelectedValue="{Binding SelectUserId}" Width="84" Height="30"/>
<TextBox VerticalContentAlignment="Center" Grid.Column="2" Height="30" Text="{Binding ItemCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="84"/>
<c:BButton Foreground="Blue" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Command="{Binding DeleteServiceCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}, Path=ItemsSource}" Content="删除" Grid.Column="3"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<c:BButton Content="添加" Foreground="Blue" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Command="{Binding AddIncreateServiceCommand}"
>
<Button.Triggers>
</Button.Triggers>
</c:BButton>
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="87"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<TextBlock Text="打包服务" Margin="19,33,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" />
<Border Background="Black" HorizontalAlignment="Left" VerticalAlignment="Top" Width="217" Margin="77,40,0,0" Height="1"/>
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="322" Margin="19,56,0,0" Height="1"/>
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="322" Margin="19,86,0,0" Height="1"/>
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="19,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="135,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="219,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="300,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="340,56,0,0" Height="30" />
<Label Content="打包服务项目" Width="116" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="19,56,0,0" />
<Label Content="成员" Width="84" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="135,56,0,0" />
<Label Content="数量" Width="80" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="219,56,0,0" />
<Label Content="操作" Width="40" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="303,56,0,0" />
<StackPanel Grid.Row="1" Orientation="Vertical" MaxHeight="140" Width="322" Margin="19,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent">
<ListBox
ItemsSource="{Binding PackList}" MaxHeight="100"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
>
<ListBox.ItemTemplate >
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="116"/>
<ColumnDefinition Width="84"/>
<ColumnDefinition Width="84"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<ComboBox VerticalContentAlignment="Center" Grid.Column="0" DisplayMemberPath="ProcessName" ItemsSource="{Binding PackServiceList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" SelectedValuePath="Id" SelectedValue="{Binding SelectId}" Text="{Binding ItemName}" Width="116" Height="30"/>
<ComboBox VerticalContentAlignment="Center" Grid.Column="1" ItemsSource="{Binding MemberList}" DisplayMemberPath="UserName" SelectedValuePath="Id" SelectedValue="{Binding SelectUserId}" Width="84" Height="30"/>
<TextBox VerticalContentAlignment="Center" Grid.Column="2" Height="30" Text="{Binding ItemCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="84"/>
<c:BButton Foreground="Blue" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Command="{Binding DeleteServiceCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}, Path=ItemsSource}" Content="删除" Grid.Column="3"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<c:BButton Content="添加" Foreground="Blue" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Command="{Binding AddPackServiceCommand}"
/>
</StackPanel>
</Grid>
<Grid Grid.Row="2">
<Grid.RowDefinitions>
<RowDefinition Height="87"/>
<RowDefinition MaxHeight="200"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<TextBlock Text="耗材项目" Margin="19,20,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" />
<Border Background="Black" HorizontalAlignment="Left" VerticalAlignment="Top" Width="217" Margin="77,27,0,0" Height="1"/>
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="240" Margin="19,56,0,0" Height="1"/>
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="240" Margin="19,86,0,0" Height="1"/>
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="19,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="135,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="239,56,0,0" Height="30" />
<Border Background="{StaticResource Border.Brush}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="1" Margin="279,56,0,0" Height="30" />
<Label Content="任务耗材" Width="116" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="19,56,0,0" />
<StackPanel Orientation="Horizontal" Width="104" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="135,56,0,0">
<Label Content="数量" Width="44" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />
<c:BButton Content="批量设置" Width="60" Background="Transparent" Foreground="Blue"
Command="{Binding SetAllCountCommand}"
CommandParameter="{Binding ElementName=consumable_listBox}"
/>
</StackPanel>
<Label Content="操作" Width="40" Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="239,56,0,0" />
<StackPanel Grid.Row="1" Orientation="Vertical" MaxHeight="160" Width="260" Margin="19,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Background="Transparent">
<ListBox MaxHeight="120" Name="consumable_listBox"
ItemsSource="{Binding ConsumableServiceList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="116"/>
<ColumnDefinition Width="104"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<ComboBox VerticalContentAlignment="Center" Text="{Binding ItemName}" Grid.Column="0" ItemsSource="{Binding ConsumableList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="Name" SelectedValue="{Binding SelectId}" SelectedValuePath="Id" Width="116" Height="30"/>
<TextBox VerticalContentAlignment="Center" Grid.Column="1" Height="30" Text="{Binding ItemCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="104"/>
<c:BButton Foreground="Blue" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Command="{Binding DeleteServiceCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}, Path=ItemsSource}" Content="删除" Grid.Column="2"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<c:BButton Content="添加" Foreground="Blue" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Command="{Binding AddConsumableCommand}"
/>
</StackPanel>
</Grid>
</Grid>
<c:BButton Grid.Row="2" Content="确定" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch"
Command="{Binding UpLoadPackCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
/>
</Grid>
</c:BWindow>

54
BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs

@ -0,0 +1,54 @@
using BBWY.Client.APIServices;
using BBWY.Client.ViewModels;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Controls;
using Org.BouncyCastle.Asn1.Ocsp;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// ServiceWindow.xaml 的交互逻辑
/// </summary>
public partial class ServiceWindow : BWindow
{
public PackServiceViewModel model { get; set; }
public PackTaskService packTaskService;
public ConsumableService consumableService;
public WorkProcessService workProcessService;
public IncreateServiceService increateService;
public ServiceWindow(PackTaskService packTaskService, long taskId, int taskCount, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateService)
{
InitializeComponent();
this.consumableService = consumableService;
this.workProcessService = workProcessService;
this.packTaskService = packTaskService;
this.increateService = increateService;
model = new PackServiceViewModel(packTaskService, consumableService, workProcessService, increateService, taskId);
model.TaskId = taskId;
model.TaskCount = taskCount;
this.DataContext = model;
}
//public PackServiceViewModel model { get; set; }
//public ServiceWindow()
//{
// InitializeComponent();
// model = ViewModelLocator.CreateNewPackServiceViewModel();
// this.DataContext = model;
//}
}
}

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

@ -0,0 +1,110 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.SetBarCodeWindow"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
Style="{StaticResource bwstyle}"
Height="400" Width="600"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
DataContext="{Binding CreateTaskView,Source={StaticResource Locator}}"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!-- DataContext="{Binding CreateSetBarCodeView,Source={StaticResource Locator}}"-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="设置条形码" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" >
<RadioButton GroupName="bar" IsChecked="True" Command="{Binding BarLabelCheckCommand}" CommandParameter="{x:Static cmodel:BarcodeLabelModel.barsimplify}" Content="精简" Margin="10,20,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Height="220" Margin="5">
<StackPanel Orientation="Vertical" >
<TextBlock Margin="10,25,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品名:"/>
<Run Text="{Binding BarCodeModel.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</TextBlock>
<TextBlock Margin="10,25,10,0" FontSize="15" FontWeight="Black" >
<Run Text="规格:"/>
<Run Text="{Binding BarCodeModel.SkuName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</TextBlock>
<Image Source="/resources/images/barcode.png" Margin="10,25,10,0"/>
<TextBlock Text="POP" HorizontalAlignment="Center" Margin="10,0,10,0" FontSize="15" FontWeight="Black" >
<Run Text="{Binding BarCodeModel.SkuId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</TextBlock>
</StackPanel>
</Border>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Vertical" >
<RadioButton GroupName="bar" Content="标准" Command="{Binding BarLabelCheckCommand}" CommandParameter="{x:Static cmodel:BarcodeLabelModel.barstander}" Margin="10,20,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Height="220" Margin="5">
<StackPanel Orientation="Vertical" >
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品牌:"/>
<Run Text="{Binding BarCodeModel.Brand}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品名:"/>
<Run Text="{Binding BarCodeModel.BrandName}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="型号:"/>
<Run Text="{Binding BarCodeModel.ProductNo}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="规格:"/>
<Run Text="{Binding BarCodeModel.SkuName}"/>
</TextBlock>
<Image Source="/resources/images/barcode.png" Margin="10,10,10,0"/>
<TextBlock Text="POP" HorizontalAlignment="Center" Margin="10,0,10,0" FontSize="15" FontWeight="Black" >
<Run Text="{Binding BarCodeModel.SkuId}"/>
</TextBlock>
</StackPanel>
</Border>
</StackPanel>
</Grid>
<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}" />
</Grid>
</c:BWindow>

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

@ -0,0 +1,28 @@
using BBWY.Client.Models;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// SetBarCode.xaml 的交互逻辑
/// </summary>
public partial class SetBarCodeWindow : BWindow
{
public SetBarCodeWindow( )
{
InitializeComponent();
}
}
}

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

@ -0,0 +1,106 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.SetCerWindow"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
Style="{StaticResource bwstyle}"
Height="500" Width="960"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
DataContext="{Binding CreateTaskView,Source={StaticResource Locator}}"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!-- DataContext="{Binding CreateSetBarCodeView,Source={StaticResource Locator}}"-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="设置合格证" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid >
<!--CommandParameter="{x:Static cmodel:CerHave3C.No3C}"-->
<RadioButton GroupName="cer" IsChecked="True" Command="{Binding CerLabelCheckCommand}" CommandParameter="{x:Static cmodel:CerHave3C.No3C}" Content="标准" Margin="10,20,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="13,50" 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,UpdateSourceTrigger=PropertyChanged}" 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,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,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 Grid.Column="1" >
<RadioButton GroupName="cer" Command="{Binding CerLabelCheckCommand}" CommandParameter="{x:Static cmodel:CerHave3C.Is3C}" Content="带3c标" Margin="10,20,0,0" Height="30" VerticalAlignment="Top"/>
<Border BorderBrush="Black" BorderThickness="1" Width="380" Height="297" Margin="13,50" 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="/Resources/Images/3c.png" Width="54" Height="42" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="282,6,0,0" />
</Grid>
</Border>
</Grid>
</Grid>
<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 SaveCerCommand}" />
</Grid>
</c:BWindow>

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

@ -0,0 +1,28 @@
using BBWY.Client.Models;
using BBWY.Controls;
using Org.BouncyCastle.Ocsp;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// SetCerWindow.xaml 的交互逻辑
/// </summary>
public partial class SetCerWindow : BWindow
{
public SetCerWindow()
{
InitializeComponent();
}
}
}

40
BBWY.Client/Views/PackTask/SetCountWindow.xaml

@ -0,0 +1,40 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.SetCountWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
Title="TipsWindow" Height="180" Width="220"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
CloseButtonVisibility="Visible"
WindowStartupLocation="CenterScreen"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="批量设置" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="数量:" VerticalAlignment="Center" ></TextBlock>
<c:BTextBox x:Name="tbCount" Width="100"/>
</StackPanel>
<c:BButton Grid.Row="2" Content="确定" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch" Click="BButton_Click" />
</Grid>
</c:BWindow>

47
BBWY.Client/Views/PackTask/SetCountWindow.xaml.cs

@ -0,0 +1,47 @@
using BBWY.Controls;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// SetCountWindow.xaml 的交互逻辑
/// </summary>
public partial class SetCountWindow : BWindow
{
public SetCountWindow()
{
InitializeComponent();
this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
}
/// <summary>
/// 委托设置数量
/// </summary>
public Action<int> SetCount { get; set; }
private void BButton_Click(object sender, RoutedEventArgs e)
{
try
{
var count = Convert.ToInt32(tbCount.Text);
SetCount(count);
this.Close();
}
catch
{
MessageBox.Show("请输入数字!");
}
}
}
}

779
BBWY.Client/Views/PackTask/TaskList.xaml

@ -27,618 +27,251 @@
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/> <c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<Grid Margin="5,0"> <Grid Margin="5,0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto"/> <RowDefinition Height="50"/>
<RowDefinition Height="5"/> <RowDefinition Height="40"/>
<RowDefinition Height="30"/> <RowDefinition Height="*"/>
<RowDefinition Height="5"/>
<RowDefinition Height="30"/>
<RowDefinition/>
<RowDefinition Height="30"/> <RowDefinition Height="30"/>
<!---->
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Left" Panel.ZIndex="999" Margin="0,5,0,0" Width="1000">
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Left" Panel.ZIndex="999" Width="784">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition />
<ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="0,5,0,0" Height="30"> <StackPanel Orientation="Horizontal" Margin="0,5,0,0" Height="30">
<StackPanel.Resources> <StackPanel.Resources>
<Style TargetType="DatePickerTextBox"> <Style TargetType="DatePickerTextBox">
<Setter Property="IsReadOnly" Value="True"/> <Setter Property="IsReadOnly" Value="True"/>
</Style> </Style>
</StackPanel.Resources> </StackPanel.Resources>
<TextBlock Text="提交时间:" VerticalAlignment="Center" Margin="5,0,0,0"/> <TextBlock Text="提交时间:" VerticalAlignment="Center" Margin="11,0,0,0"/>
<DatePicker SelectedDate="{Binding StartDate}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="5,0,0,0"/> <DatePicker SelectedDate="{Binding StartTime}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="10,0,0,0"/>
<DatePicker SelectedDate="{Binding EndDate}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="5,0,0,0"/> <DatePicker SelectedDate="{Binding EndTime}" Width="133.5" Height="30" VerticalContentAlignment="Center" FocusVisualStyle="{x:Null}" Margin="10,0,0,0"/>
<TextBlock Text="任务ID:" VerticalAlignment="Center" Margin="10,0,0,0"/> <TextBlock Text="任务ID:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" Text="{Binding SearchOrderId}" WaterRemark="精确匹配"/> <c:BTextBox Width="150" Margin="5,0,0,0" Text="{Binding SearchTaskId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark=""/>
<TextBlock Text="SKU:" VerticalAlignment="Center" Margin="10,0,0,0"/> <TextBlock Text="SKU:" VerticalAlignment="Center" Margin="16,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" WaterRemark="精确匹配" Text="{Binding SearchProductId}"/> <c:BTextBox Width="150" Margin="5,0,0,0" WaterRemark="" Text="{Binding SearchSkuId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<!--<TextBlock Text="下单账号" VerticalAlignment="Center" Margin="5,0,0,0"/>
<c:BTextBox Width="150" Margin="5,0,0,0" WaterRemark="暂不支持" IsEnabled="False"
DisableBgColor="{StaticResource TextBox.Disable.BgColor}"/>-->
</StackPanel> </StackPanel>
<Grid Grid.Column="1" Grid.RowSpan="3"> <Grid Grid.Column="1" >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Button Content="搜索" Width="80" VerticalAlignment="Stretch" Margin="5,0,0,0"
<RowDefinition/> Command="{Binding SearchTaskCommand}"
<RowDefinition/>
</Grid.RowDefinitions>
<Button Content="搜索" Width="50" VerticalAlignment="Stretch" Margin="5,0,0,0" Command="{Binding SearchOrderCommand}"
Grid.RowSpan="2" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/> Grid.RowSpan="2" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</Grid> </Grid>
</Grid> </Grid>
<StackPanel Grid.Row="2" HorizontalAlignment="Left" Orientation="Horizontal" Width="500"> <StackPanel Grid.Row="1" Grid.RowSpan="1" HorizontalAlignment="Left" Orientation="Horizontal">
<c:BButton Content="全部" Width="100" <RadioButton Height="35" Width="126" VerticalAlignment="Center" x:Name="qb" IsChecked="True" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.全部}" >
Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Null}" <RadioButton.Style >
Visibility="{Binding IsSDGroup,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}"> <Style TargetType="RadioButton">
<c:BButton.Background> <Setter Property="IsChecked" Value="False" />
<MultiBinding Converter="{StaticResource mobjConverter}" <Setter Property="Background" Value="#8080FF" />
ConverterParameter=";;false:&amp;:#8080FF:#F2F2F2:6"> <Setter Property="Foreground" Value="Black" />
<Binding Path="OrderState"/> <Setter Property="Template">
<Binding Path="IncludeAfterOrder"/> <Setter.Value>
<Binding Path="IncludeExceptionOrder"/> <ControlTemplate TargetType="RadioButton">
</MultiBinding> <Grid Background="#F2F2F2" >
</c:BButton.Background> <Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
<c:BButton.Foreground> <Rectangle.RenderTransform>
<MultiBinding Converter="{StaticResource mobjConverter}" <TransformGroup>
ConverterParameter=";;false:&amp;:White:#4A4A4A:6"> <ScaleTransform ScaleY="-1"/>
<Binding Path="OrderState"/> <SkewTransform/>
<Binding Path="IncludeAfterOrder"/> <RotateTransform/>
<Binding Path="IncludeExceptionOrder"/> <TranslateTransform/>
</MultiBinding> </TransformGroup>
</c:BButton.Foreground> </Rectangle.RenderTransform>
</c:BButton> </Rectangle>
<c:BButton Width="100" <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
Background="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=等待采购:#8080FF:#F2F2F2}" <Run Text="全部"/>
Foreground="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=等待采购:White:#4A4A4A}" </TextBlock>
Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Static cmodel:OrderState.等待采购}" </Grid>
Visibility="{Binding IsSDGroup,ConverterParameter=true:Collapsed:Visible,Converter={StaticResource objConverter}}"> <ControlTemplate.Triggers>
<c:BButton.Content> <Trigger Property="IsChecked" Value="true">
<TextBlock> <Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RadioButton.Style>
</RadioButton>
<RadioButton VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已到货}" >
<RadioButton.Style >
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="已到货"/> <Run Text="已到货"/>
<Run Text="{Binding WaitPurchaseOrderCount,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}" <Run Text="{Binding ArrivedCount ,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
Foreground="{StaticResource Text.Pink}"/> Foreground="{StaticResource Text.Pink}" />
</TextBlock>
</c:BButton.Content>
</c:BButton>
<c:BButton Width="100"
Background="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=部分到货:#8080FF:#F2F2F2}"
Foreground="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=部分到货:White:#4A4A4A}"
Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Static cmodel:OrderState.待出库}">
<c:BButton.Content>
<TextBlock>
<Run Text="部分到货"/>
<Run Text="{Binding WaitOutStoreCount,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
Foreground="{StaticResource Text.Pink}"/>
</TextBlock>
</c:BButton.Content>
</c:BButton>
<c:BButton Content="未到货" Width="100"
Background="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=未到货:#8080FF:#F2F2F2}"
Foreground="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=未到货:White:#4A4A4A}"
Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Static cmodel:OrderState.待付款}"/>
<c:BButton Content="已完成" Width="100"
Background="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=已完成:#8080FF:#F2F2F2}"
Foreground="{Binding OrderState,Converter={StaticResource objConverter},ConverterParameter=已完成:White:#4A4A4A}"
Command="{Binding SetOrderStateCommand}" CommandParameter="{x:Static cmodel:OrderState.已完成}"/>
</StackPanel>
<Border x:Name="bd_statistics" Grid.RowSpan="3" HorizontalAlignment="Left" Padding="15,0" TextBlock.Foreground="{StaticResource Text.Color}" Margin="1814,0,0,0" Width="224">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.4*"/>
<ColumnDefinition Width="0.4*"/>
<ColumnDefinition Width="0.2*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Grid Grid.ColumnSpan="3" Grid.RowSpan="2" Margin="-10,0">
<Grid.Effect>
<DropShadowEffect BlurRadius="10" ShadowDepth="0" Direction="0" Color="#DCDCDC"/>
</Grid.Effect>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition Height="0.5*"/>
</Grid.RowDefinitions>
<Border Background="{StaticResource Button.Selected.Background}">
</Border>
<Border Background="white" Grid.Row="1">
</Border>
</Grid>
<TextBlock VerticalAlignment="Center" Foreground="White">
<Run Text="成交额"/>
<LineBreak/>
<Run Text="{Binding ToDayOrderAchievement.SaleAmount}" FontSize="24"/>
</TextBlock>
<TextBlock Grid.Column="1" VerticalAlignment="Center" Foreground="White" Margin="10,0">
<Run Text="利润至"/>
<Run Text="{Binding ToDayOrderAchievement.PularizeEndDate,StringFormat=yyyy-MM-dd}"/>
<LineBreak/>
<Run Text="{Binding ToDayOrderAchievement.Profit}" FontSize="24"/>
<Run Text="{Binding ToDayOrderAchievement.ProfitRaito,StringFormat=({0}%)}"/>
</TextBlock>
<TextBlock Grid.Column="2" VerticalAlignment="Center" Foreground="White">
<Run Text="总单量"/>
<LineBreak/>
<Run Text="{Binding ToDayOrderAchievement.OrderCount}" FontSize="24"/>
</TextBlock>
<StackPanel Grid.Row="1" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<TextBlock>
<Run Text="货物成本"/>
<Run Text="{Binding ToDayOrderAchievement.PurchaseAmount}"/>
</TextBlock>
</StackPanel>
<TextBlock>
<Run Text="平台扣点"/>
<Run Text="{Binding ToDayOrderAchievement.PlatformCommissionAmount}"/>
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Margin="10,0">
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<TextBlock>
<Run Text="推广成本"/>
<Run Text="{Binding ToDayOrderAchievement.AdvCost}"/>
</TextBlock>
<Path Style="{StaticResource path_question}" Fill="{StaticResource Text.Pink}" Width="14" Margin="5,0,0,0"
ToolTipService.InitialShowDelay="0"
ToolTipService.ShowDuration="20000">
<Path.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<StackPanel>
<ListBox ItemsSource="{Binding ToDayOrderAchievement.ShoppopularizeList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
Style="{StaticResource NoScrollViewListBoxStyle}"
Foreground="{StaticResource Text.Color}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock>
<Run Text="{Binding ItemName}"/>
<Run Text="{Binding Cost}"/>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock>
<Run Text="SD成本"/>
<Run Text="{Binding ToDayOrderAchievement.SdCost}"/>
</TextBlock> </TextBlock>
</StackPanel> </Grid>
</ToolTip> <ControlTemplate.Triggers>
</Path.ToolTip> <Trigger Property="IsChecked" Value="true">
</Path> <Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
</StackPanel> <Setter Property="Foreground" Value="white"/>
<TextBlock> </Trigger>
<Run Text="人工成本"/> </ControlTemplate.Triggers>
<Run Text="{Binding ToDayOrderAchievement.EmployereCost}"/> </ControlTemplate>
</TextBlock> </Setter.Value>
</StackPanel> </Setter>
</Style>
<StackPanel Grid.Row="1" Grid.Column="2" VerticalAlignment="Center"> </RadioButton.Style>
<TextBlock Margin="0,0,0,5"> </RadioButton>
<Run Text="销售运费"/> <RadioButton VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.部分到货}" >>
<Run Text="{Binding ToDayOrderAchievement.DeliveryExpressFreight}"/> <RadioButton.Style >
</TextBlock> <Style TargetType="RadioButton">
<TextBlock> <Setter Property="IsChecked" Value="False" />
<Run Text="税务成本"/> <Setter Property="Background" Value="#8080FF" />
<Run Text="{Binding ToDayOrderAchievement.TaxCost}"/> <Setter Property="Foreground" Value="Black" />
</TextBlock> <Setter Property="Template">
</StackPanel> <Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
</Grid> <Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
</Border> <Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
<local:TaskListControl x:Name="listbox_order" Grid.Row="5" Grid.RowSpan="3" </TransformGroup>
Visibility="{Binding IncludeAfterOrder,Converter={StaticResource objConverter},ConverterParameter=true:Collapsed:Visible}" Margin="0,5,0,0"/> </Rectangle.RenderTransform>
<Border Grid.Row="3" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1,1,1,0" </Rectangle>
Background="#F2F2F2" <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
Visibility="{Binding Visibility,ElementName=listbox_afterSaleOrder}" Margin="0,5,0,0" Grid.RowSpan="2"> <Run Text="部分到货"/>
<Grid> <Run Text="{Binding SomeArrivedCount ,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
<Grid.ColumnDefinitions> Foreground="{StaticResource Text.Pink}" />
<ColumnDefinition Width="351"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition Width="180"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="商品信息" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="SKU数量" Grid.Column="1" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="到货情况" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="组合类型" Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="SKU配件商品" Grid.Column="4" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="物流信息" Grid.Column="5" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="打包需求" Grid.Column="6" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="落仓" Grid.Column="7" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="合格证.条形码" Grid.Column="8" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="合格证位置" Grid.Column="9" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="注意事项/对接备注" Grid.Column="10" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="服务 耗材费用" Grid.Column="11" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="打包员" Grid.Column="12" Style="{StaticResource middleTextBlock}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="1"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="2"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="3"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="4"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="5"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="6"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="8"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="9"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="10"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="11"/>
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="12"/>
</Grid>
</Border>
<ListBox x:Name="listbox_afterSaleOrder"
Grid.Row="6"
ItemsSource="{Binding AfterSaleOrderList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,0"
Foreground="{StaticResource Text.Color}"
Visibility="{Binding IncludeAfterOrder,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}" Margin="0,30,0,0" Grid.RowSpan="2">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=listbox_afterSaleOrder,Converter={StaticResource widthConverter},ConverterParameter=-0}">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition />
</Grid.RowDefinitions>
<Grid Background="#F2F2F2">
<StackPanel Orientation="Horizontal">
<Border BorderBrush="{StaticResource Text.Pink}" BorderThickness="1"
Background="White"
Padding="5,0"
Height="25"
Margin="5,0,0,0">
<TextBlock Text="{Binding ServiceResult,Converter={StaticResource objConverter},ConverterParameter=#null:服务单未结束:#source}"
Foreground="{StaticResource Text.Pink}"
VerticalAlignment="Center"/>
</Border>
<TextBlock Text="{Binding ApplyTime,StringFormat=yyyy-MM-dd HH:mm:ss}" VerticalAlignment="Center" Margin="5,0,0,0"/>
<Border Width="1" Margin="5,5,0,5" Background="{StaticResource Border.Brush}"/>
<TextBlock VerticalAlignment="Center" Text="服务单号:" Margin="5,0,0,0" />
<c:BButton Content="{Binding ServiceId}" Style="{StaticResource LinkButton}"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding ServiceId}" Margin="5,0,0,0"/>
<Border Width="1" Margin="5,5,0,5" Background="{StaticResource Border.Brush}"/>
<TextBlock VerticalAlignment="Center" Text="订单号:" Margin="5,0,0,0" />
<c:BButton Content="{Binding OrderId}" Style="{StaticResource LinkButton}"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding OrderId}" Margin="5,0,0,0"/>
<Border Width="1" Margin="5,5,0,5" Background="{StaticResource Border.Brush}"/>
<StackPanel x:Name="txt_consignee" Margin="5,0,0,0" Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="收货人:"/>
<TextBox Text="{Binding ContactName}" Foreground="{StaticResource Text.Color}"
IsReadOnly="True" Background="Transparent" BorderThickness="0"/>
<TextBlock Text="联系电话:" Margin="5,0,0,0"/>
<TextBox Text="{Binding Mobile}" Foreground="{StaticResource Text.Color}"
IsReadOnly="True" Background="Transparent" BorderThickness="0"/>
</StackPanel>
</StackPanel>
<Border VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="360"/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<c:BAsyncImage UrlSource="{Binding Logo}"
Width="80" DecodePixelWidth="80"
VerticalAlignment="Top" Margin="0,5"/>
<StackPanel Grid.Column="1" Orientation="Vertical" Margin="0,5,0,5">
<TextBlock TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding Title}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="SKU名称:"/>
<Run Text="{Binding Title}"/>
</TextBlock>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal">
<TextBlock Text="SPU:"/>
<c:BButton Content="{Binding ProductId}" Style="{StaticResource LinkButton}"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding ProductId}"
Margin=" 5,0,0,0"/>
<TextBlock Text="SKU:" Margin="5,0,0,0"/>
<c:BButton Content="{Binding SkuId}" Style="{StaticResource LinkButton}"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding ProductId}"
Margin=" 5,0,0,0"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock TextWrapping="Wrap">
<Run Text="单价:"/>
<Run Text="{Binding Price}"/>
</TextBlock> </TextBlock>
<TextBlock TextWrapping="Wrap" Margin="5,0,0,0"> </Grid>
<Run Text="数量:"/> <ControlTemplate.Triggers>
<Run Text="{Binding ItemTotal}"/> <Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Setter Property="Foreground" Value="white"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RadioButton.Style>
</RadioButton>
<RadioButton VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.未到货}" >
<RadioButton.Style >
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="未到货"/>
<Run Text="{Binding NoArrivedCount ,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
Foreground="{StaticResource Text.Pink}" />
</TextBlock> </TextBlock>
</StackPanel> </Grid>
<ControlTemplate.Triggers>
</StackPanel> <Trigger Property="IsChecked" Value="true">
</Grid> <Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right"/> <Setter Property="Foreground" Value="white"/>
</Trigger>
<TextBlock Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"> </ControlTemplate.Triggers>
<Run Text="退款金额"/> </ControlTemplate>
<Run Text="{Binding RefundAmount}"/> </Setter.Value>
</TextBlock> </Setter>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="1" HorizontalAlignment="Right"/> </Style>
</RadioButton.Style>
<StackPanel Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal"> </RadioButton>
<TextBlock> <RadioButton VerticalAlignment="Center" Command="{Binding SetTaskStateCommand}" CommandParameter="{x:Static cmodel:TaskState.已完成}" >
<Run Text="售后成本"/> <RadioButton.Style >
<Run Text="{Binding AfterTotalCost}"/> <Style TargetType="RadioButton">
</TextBlock> <Setter Property="IsChecked" Value="False" />
<Path Style="{StaticResource path_question}" Width="14" Margin="5,0,0,0" Fill="{StaticResource Text.Pink}"> <Setter Property="Background" Value="#8080FF" />
<Path.ToolTip> <Setter Property="Foreground" Value="Black" />
<ToolTip Style="{StaticResource OrderCouponToolipStyle}"> <Setter Property="Template">
<Grid Width="770" Height="120"> <Setter.Value>
<Grid.RowDefinitions> <ControlTemplate TargetType="RadioButton">
<RowDefinition/> <Grid Background="#F2F2F2" >
<RowDefinition Height="Auto"/> <Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="126" RenderTransformOrigin="0.5,0.5">
</Grid.RowDefinitions> <Rectangle.RenderTransform>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1"> <TransformGroup>
<Border.Resources> <ScaleTransform ScaleY="-1"/>
<Style TargetType="TextBlock"> <SkewTransform/>
<Setter Property="HorizontalAlignment" Value="Center"/> <RotateTransform/>
<Setter Property="VerticalAlignment" Value="Center"/> <TranslateTransform/>
</Style> </TransformGroup>
</Border.Resources> </Rectangle.RenderTransform>
<Grid> </Rectangle>
<Grid.ColumnDefinitions> <TextBlock Text="已完成" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<ColumnDefinition/> </Grid>
<ColumnDefinition/> <ControlTemplate.Triggers>
<ColumnDefinition/> <Trigger Property="IsChecked" Value="true">
<ColumnDefinition/> <Setter TargetName="_Rect" Property="Fill" Value="#8080FF" />
<ColumnDefinition/> <Setter Property="Foreground" Value="white"/>
<ColumnDefinition/> </Trigger>
<ColumnDefinition/> </ControlTemplate.Triggers>
<ColumnDefinition/> </ControlTemplate>
<ColumnDefinition/> </Setter.Value>
<ColumnDefinition/> </Setter>
<ColumnDefinition/> </Style>
<ColumnDefinition Width="100"/> </RadioButton.Style>
</Grid.ColumnDefinitions> </RadioButton>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--Row 1-->
<Grid Grid.ColumnSpan="2" Background="{StaticResource Border.Background}">
<TextBlock Text="商品成本"/>
</Grid>
<Grid Grid.Column="2" Grid.ColumnSpan="6" Background="{StaticResource Border.Background}">
<TextBlock Text="期间成本"/>
</Grid>
<Grid Grid.Column="8" Grid.ColumnSpan="3" Background="{StaticResource Border.Background}">
<TextBlock Text="售后损耗"/>
</Grid>
<Grid Grid.Column="10" Grid.Row="1" Background="{StaticResource Border.Background}">
<TextBlock Text="SD退货"/>
</Grid>
<Grid Grid.Column="11" Grid.RowSpan="2" Background="{StaticResource Border.Background}">
<TextBlock Text="退款采购成本"/>
</Grid>
<!--Row 2-->
<Grid Grid.Row="1" Background="{StaticResource Border.Background}">
<TextBlock Text="商品成本"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="1" Background="{StaticResource Border.Background}">
<TextBlock Text="采购运费"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="2" Background="{StaticResource Border.Background}">
<TextBlock Text="头程费"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="3" Background="{StaticResource Border.Background}">
<TextBlock Text="打包耗材"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="4" Background="{StaticResource Border.Background}">
<TextBlock Text="快递费"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="5" Background="{StaticResource Border.Background}">
<TextBlock Text="入库操作"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="6" Background="{StaticResource Border.Background}">
<TextBlock Text="出库操作"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="7" Background="{StaticResource Border.Background}">
<TextBlock Text="仓储费"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="8" Background="{StaticResource Border.Background}">
<TextBlock Text="退货入库"/>
</Grid>
<Grid Grid.Row="1" Grid.Column="9" Background="{StaticResource Border.Background}">
<TextBlock Text="售后补偿"/>
</Grid>
<!--Row 3-->
<TextBlock Grid.Row="2" Text="{Binding ReissueProductAmount}"
Visibility="{Binding ReissueProductAmount,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding ReissueFreight}"
Visibility="{Binding ReissueFreight,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="2" Text="{Binding FirstFreight}"
Visibility="{Binding FirstFreight,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="3" Text="{Binding ConsumableAmount}"
Visibility="{Binding ConsumableAmount,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="4" Text="{Binding DeliveryExpressFreight}"
Visibility="{Binding DeliveryExpressFreight,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="5" Text="{Binding InStorageAmount}"
Visibility="{Binding InStorageAmount,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="6" Text="{Binding OutStorageAmount}"
Visibility="{Binding OutStorageAmount,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="7" Text="{Binding StorageAmount}"
Visibility="{Binding StorageAmount,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="8" Text="{Binding RefundInStorageAmount}"
Visibility="{Binding RefundInStorageAmount,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="9" Text="{Binding ReissueAfterSaleAmount}"
Visibility="{Binding ReissueAfterSaleAmount,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="10"
Text="{Binding SDRefundFreight}"
Visibility="{Binding SDRefundFreight,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<TextBlock Grid.Row="2" Grid.Column="11" Text="{Binding RefundPurchaseAmount}"
Visibility="{Binding RefundPurchaseAmount,ConverterParameter=0|0.0|0.00:Collapsed:Visible,Converter={StaticResource objConverter}}"/>
<!--Line-->
<Border Width="1" Grid.Column="1" Grid.RowSpan="3" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="7" Grid.RowSpan="3" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="9" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="10" Grid.RowSpan="3" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="3" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="4" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="5" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="6" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="8" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Width="1" Grid.Column="9" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}"/>
<Border Height="1" VerticalAlignment="Bottom" Grid.ColumnSpan="11" Background="{StaticResource Border.Brush}"/>
<Border Height="1" VerticalAlignment="Bottom" Grid.Row="1" Grid.ColumnSpan="12" Background="{StaticResource Border.Brush}"/>
</Grid>
</Border>
<TextBlock Grid.Row="1" VerticalAlignment="Center" Margin="0,5">
<Run Text="*售后成本不含退采购退款成本" />
<LineBreak/>
<Run Text="*由于退款采购成本存在一定延迟性,在未得到退款采购金额之前,订单利润计算可能不准确" Foreground="Red"/>
</TextBlock>
</Grid>
</ToolTip>
</Path.ToolTip>
</Path>
</StackPanel>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Column="2" VerticalAlignment="Bottom" Margin="0,0,0,25"/>
<c:BButton Content="修改" VerticalAlignment="Bottom"
HorizontalAlignment="Stretch"
Background="Transparent"
Foreground="{StaticResource Text.Color}"
Grid.Column="2"
Command="{Binding DataContext.EditAfterSaleOrderCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding }"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="2" HorizontalAlignment="Right"/>
<TextBlock Text="{Binding ProductResult}" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="3" HorizontalAlignment="Right"/>
<TextBlock Text="{Binding ProductHealth}" Grid.Column="4" HorizontalAlignment="Center" VerticalAlignment="Center"/> <Button Content="发布任务" Width="118" Height="35" VerticalAlignment="Stretch" Margin="50,0,0,0" Command="{Binding CreateTaskCommand}"
<Border Width="1" Background="{StaticResource Border.Brush}" Grid.Column="4" HorizontalAlignment="Right"/> Grid.Row="2" HorizontalAlignment="Left" Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</StackPanel>
<Border Grid.Row="2" Margin="0,5,0,0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="0,1,0,0"/>
<StackPanel x:Name="sp_refundPurchaseAmount" Grid.Column="5" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,20" <local:TaskListControl x:Name="listbox_task" Grid.Row="2" Margin="0,5,0,0"/>
Visibility="{Binding ProductHealth,ConverterParameter=厂家退货退款:Visible:Collapsed,Converter={StaticResource objConverter}}">
<TextBlock>
<Run Text="{Binding PurchasePlatform}"/>
<Run Text="{Binding PurchaseMethod}"/>
</TextBlock>
<TextBlock>
<Run Text="采购单号"/>
<Run Text="{Binding PurchaseOrderId}"/>
</TextBlock>
<TextBlock>
<Run Text="退款到账金额"/>
<Run Text="{Binding RefundPurchaseAmount}"/>
</TextBlock>
</StackPanel>
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Column="5" VerticalAlignment="Bottom" Margin="0,0,0,25"
Visibility="{Binding Visibility,ElementName=sp_refundPurchaseAmount}"/>
<c:BButton Content="退款" VerticalAlignment="Bottom"
HorizontalAlignment="Stretch"
Background="Transparent"
Foreground="{StaticResource Text.Color}"
Grid.Column="5"
Command="{Binding DataContext.EditAfterSaleOrderRefundPurchaseAmountCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBox}}}"
CommandParameter="{Binding }"
Visibility="{Binding Visibility,ElementName=sp_refundPurchaseAmount}"/>
</Grid>
<Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<c:PageControl PageIndex="{Binding PageIndex}" <c:PageControl PageIndex="{Binding PageIndex}"
PageSize="{Binding PageSize}" PageSize="{Binding PageSize}"
RecordCount="{Binding OrderCount}" RecordCount="{Binding OrderCount}"
Grid.Row="8" Grid.Row="3"
HorizontalAlignment="Left" Width="399"> HorizontalAlignment="Left" Width="450">
<b:Interaction.Triggers> <b:Interaction.Triggers>
<b:EventTrigger EventName="OnPageIndexChanged"> <b:EventTrigger EventName="OnPageIndexChanged">
<b:InvokeCommandAction Command="{Binding OrderPageIndexChangedCommand}" PassEventArgsToCommand="True"/> <b:InvokeCommandAction Command="{Binding TaskPageIndexChangedCommand}" PassEventArgsToCommand="True"/>
</b:EventTrigger> </b:EventTrigger>
</b:Interaction.Triggers> </b:Interaction.Triggers>
</c:PageControl> </c:PageControl>
<!--<TextBlock Grid.Row="8"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,5,0"
Visibility="{Binding Visibility,ElementName=listbox_order}">
<Run Text="当前条件利润汇总"/>
<Run Text="{Binding CurrentConditionsTotalProfit,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</TextBlock>-->
</Grid> </Grid>
</Grid> </Grid>
</Page> </Page>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save