Browse Source

合并

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
b7831a0862
  1. 35
      BBWY.Client/APIServices/QiKu/ConsumableService.cs
  2. 27
      BBWY.Client/APIServices/QiKu/PackDetailService.cs
  3. 19
      BBWY.Client/APIServices/QiKu/PackTaskService.cs
  4. 37
      BBWY.Client/APIServices/QiKu/ProcessService.cs
  5. 2
      BBWY.Client/App.xaml.cs
  6. 8
      BBWY.Client/Models/APIModel/Request/ConsumableRequest.cs
  7. 121
      BBWY.Client/Models/APIModel/Request/SetPackDetailRequest.cs
  8. 54
      BBWY.Client/Models/APIModel/Response/PackTask/FeesItemResponse.cs
  9. 19
      BBWY.Client/Models/APIModel/Response/PackTask/GetConsumableTypeResponse.cs
  10. 48
      BBWY.Client/Models/APIModel/Response/PackTask/GetPackDetailResponse.cs
  11. 14
      BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs
  12. 21
      BBWY.Client/Models/APIModel/Response/Process/DiscountFactoryResponse.cs
  13. 87
      BBWY.Client/Models/APIModel/Response/Process/GetProcessTypeResponse.cs
  14. 17
      BBWY.Client/Models/Enums.cs
  15. 93
      BBWY.Client/Models/PackTask/ConsumableModel.cs
  16. 121
      BBWY.Client/Models/PackTask/PackItemModel.cs
  17. 61
      BBWY.Client/Models/PackTask/PackTaskModel.cs
  18. 47
      BBWY.Client/Models/PackTask/PackUser.cs
  19. 19
      BBWY.Client/Models/PackTask/ProcessComboModel.cs
  20. 43
      BBWY.Client/ViewModels/PackTask/ConsumableViewModel.cs
  21. 207
      BBWY.Client/ViewModels/PackTask/EditConsumableViewModel.cs
  22. 1044
      BBWY.Client/ViewModels/PackTask/PackDetailViewModel.cs
  23. 52
      BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs
  24. 89
      BBWY.Client/ViewModels/PackTask/UpdatePurchaseTaskViewModel.cs
  25. 51
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  26. 8
      BBWY.Client/ViewModels/ViewModelLocator.cs
  27. 8
      BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs
  28. 2
      BBWY.Client/Views/Order/OrderList.xaml
  29. 33
      BBWY.Client/Views/PackTask/Consumable.xaml
  30. 11
      BBWY.Client/Views/PackTask/EditConsumable.xaml
  31. 2
      BBWY.Client/Views/PackTask/EditConsumable.xaml.cs
  32. 38
      BBWY.Client/Views/PackTask/FeesExcelControl.xaml.cs
  33. 138
      BBWY.Client/Views/PackTask/FeesExcelV2Control.xaml
  34. 355
      BBWY.Client/Views/PackTask/FeesExcelV2Control.xaml.cs
  35. 111
      BBWY.Client/Views/PackTask/MinFeesExcelControl.xaml.cs
  36. 10
      BBWY.Client/Views/PackTask/MinFeesExcelV2Control.xaml
  37. 347
      BBWY.Client/Views/PackTask/MinFeesExcelV2Control.xaml.cs
  38. 856
      BBWY.Client/Views/PackTask/PackDetailWindow.xaml
  39. 107
      BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs
  40. 69
      BBWY.Client/Views/PackTask/PrintPackTaskDetail.xaml
  41. 81
      BBWY.Client/Views/PackTask/PrintPackTaskDetail.xaml.cs
  42. 2
      BBWY.Client/Views/PackTask/ServiceWindow.xaml
  43. 8
      BBWY.Client/Views/PackTask/UpdatePurchaseTaskWindow.xaml
  44. 30
      BBWY.Client/Views/PackTask/WaitPackageControl.xaml
  45. 33
      BBWY.Client/Views/PackTask/WaitPackageControl.xaml.cs
  46. 20
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml
  47. 34
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml.cs
  48. 188
      BBWY.Client/Views/QualityTask/WaitQualityControl.xaml
  49. 34
      BBWY.Client/Views/QualityTask/WaitQualityControl.xaml.cs

35
BBWY.Client/APIServices/QiKu/ConsumableService.cs

@ -6,6 +6,7 @@ using BBWY.Common.Http;
using BBWY.Common.Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net.Http;
using System.Text;
@ -40,20 +41,40 @@ namespace BBWY.Client.APIServices
public ApiResponse<object> Deleted(long id)
{
return SendRequest<object>(globalContext.QKApiHost, "api/Consumable/Deleted",
new
{
id = id
}
, null, HttpMethod.Get);
return SendRequest<object>(globalContext.QKApiHost, $"api/Consumable/Deleted?id={id}",
null, null, HttpMethod.Get);
}
public ApiResponse<ConsumableResponse> Search(ConsumableSearchRequest consumable)
{
return SendRequest<ConsumableResponse>(globalContext.QKApiHost, "api/Consumable/Search",
return SendRequest<ConsumableResponse>(globalContext.QKApiHost, "api/Consumable/SearchConsumableList",
consumable
, null, HttpMethod.Post);
}
public ApiResponse<object> AddConsumableType(string ConsumableTypeName)
{
return SendRequest<object>(globalContext.QKApiHost, "api/Consumable/AddConsumableType",
new { ConsumableTypeName }
, null, HttpMethod.Post);
}
public ApiResponse<ObservableCollection<GetConsumableTypeResponse>> GetConsumableTypeList()
{
return SendRequest<ObservableCollection<GetConsumableTypeResponse>>(globalContext.QKApiHost, "api/Consumable/GetConsumableTypeList",
null
, null, HttpMethod.Get);
}
public ApiResponse<object> DeletedConsumableType(long consumableTypeId)
{
return SendRequest<object>(globalContext.QKApiHost, $"api/Consumable/DeletedConsumableType?consumableTypeId={consumableTypeId}",
null
, null, HttpMethod.Post);
}
}
}

27
BBWY.Client/APIServices/QiKu/PackDetailService.cs

@ -1,4 +1,5 @@
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Models;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Common.Http;
using BBWY.Common.Models;
using System;
@ -28,5 +29,29 @@ namespace BBWY.Client.APIServices
, null, HttpMethod.Post);
}
/// <summary>
/// 设置打包费用
/// </summary>
/// <param name="consumable"></param>
/// <returns></returns>
public ApiResponse<object> SetPackDetail(SetPackDetailRequest consumable)
{
return SendRequest<object>(globalContext.QKApiHost, "api/PackDetail/SetPackDetail",
consumable
, null, HttpMethod.Post);
}
/// <summary>
/// 获取打包费用明细
/// </summary>
/// <param name="taskId"></param>
/// <returns></returns>
public ApiResponse<GetPackDetailResponse> GetPackDetail(long taskId)
{
return SendRequest<GetPackDetailResponse>(globalContext.QKApiHost, $"api/PackDetail/GetPackDetail?taskId={taskId}",
null
, null, HttpMethod.Get);
}
}
}

19
BBWY.Client/APIServices/QiKu/PackTaskService.cs

@ -321,9 +321,9 @@ namespace BBWY.Client.APIServices
}, null, HttpMethod.Post);
}
public ApiResponse<bool> SubmitOverTimeMarkMsg(OverTimeTaskType OverTimeTaskType, long Id, string MarkMsg)
public ApiResponse<object> SubmitOverTimeMarkMsg(OverTimeTaskType OverTimeTaskType, long Id, string MarkMsg)
{
return SendRequest<bool>(globalContext.QKApiHost, $"api/PackTask/SubmitOverTimeMarkMsg", new
return SendRequest<object>(globalContext.QKApiHost, $"api/PackTask/SubmitOverTimeMarkMsg", new
{
OverTimeTaskType,
Id,
@ -331,7 +331,20 @@ namespace BBWY.Client.APIServices
}, null, HttpMethod.Post);
}
//public ApiResponse<object> QikuPublishOrderSkuPackConfigState(string orderId, string skuId, PackConfigState packConfigState)
//{
// return SendRequest<object>("http://bbwyb.qiyue666.com", $"Api/Order/QikuPublishOrderSkuPackConfigState", new
// {
// orderId,
// skuId,
// packConfigState,
// }, null, HttpMethod.Post);
//}
public ApiResponse<object> SendToSetSkuConfigure(long taskId)
{
return SendRequest<object>(globalContext.QKApiHost, $"api/PackTask/SendToSetSkuConfigure?taskid={taskId}",null, null, HttpMethod.Post);
}
}

37
BBWY.Client/APIServices/QiKu/ProcessService.cs

@ -0,0 +1,37 @@
using BBWY.Client.Models;
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.QiKu
{
public class ProcessService : BaseApiService, IDenpendency
{
public ProcessService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext)
{
}
public ApiResponse<GetProcessTypeResponse> GetProcessTypeList()
{
return SendRequest<GetProcessTypeResponse>(globalContext.QKApiHost, "api/Process/GetProcessTypeList",
null
, null, HttpMethod.Get);
}
public ApiResponse<DiscountFactoryResponse> GetDiscountFactory(string ProcessTypeName, int TaskCount,long? ProcessComboId=null)
{
return SendRequest<DiscountFactoryResponse>(globalContext.QKApiHost, "api/Process/GetDiscountFactory",
new
{
ProcessTypeName,
TaskCount,
ProcessComboId
}
, null, HttpMethod.Post);
}
}
}

2
BBWY.Client/App.xaml.cs

@ -127,7 +127,7 @@ namespace BBWY.Client
serviceCollection.AddTransient<PublishTaskViewModel>();
serviceCollection.AddTransient<QualityViewModel>();
serviceCollection.AddTransient<PackServiceViewModel>();
serviceCollection.AddTransient<PackDetailViewModel>();
serviceCollection.AddTransient<UpdatePurchaseTaskViewModel>();
#region 注册拳探SDK相关类
serviceCollection.AddSingleton<QuanTanProductClient>();

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

@ -9,12 +9,14 @@ namespace BBWY.Client.Models.APIModel.Request
public class ConsumableResponse
{
public int OrderCount { get; set; }
public ConsumableModel[] Consumables { get; set; }
public int TotalCount { get; set; }
public ConsumableModel[] SearchConsumableList { get; set; }
}
public class ConsumableSearchRequest
{
public long? ConsumableTypeId { get; set; }
/// <summary>
/// 名称
/// </summary>
@ -67,6 +69,6 @@ namespace BBWY.Client.Models.APIModel.Request
/// <summary>
/// 耗材归属
/// </summary>
public ConsumableType? ConsumableType { get; set; }
public long? ConsumableTypeId { get; set; }
}
}

121
BBWY.Client/Models/APIModel/Request/SetPackDetailRequest.cs

@ -0,0 +1,121 @@
using BBWY.Client.Models.APIModel.Request;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models
{
public class SetPackDetailRequest
{
/// <summary>
/// 任务Id
/// </summary>
public long TaskId { get; set; }
#region 工序收费
public string ProductResistantName { get; set; }
/// <summary>
/// 打包工序类型(0=推荐工序,1=自定义工序)
/// </summary>
public PackProcessType PackProcessType { get; set; }
/// <summary>
/// 套餐id
/// </summary>
public long ProcessComboId { get; set; }
/// <summary>
/// 套餐任务量
/// </summary>
public long ProcessComboCount { get; set; }
/// <summary>
/// 折扣系数
/// </summary>
public decimal DiscountFactory { get; set; }
/// <summary>
/// 打包原价
/// </summary>
public decimal PackPrice { get; set; }
/// <summary>
/// 打包折扣价
/// </summary>
public decimal PackDiscountPrice { get; set; }
/// <summary>
/// 定向单价
/// </summary>
public decimal? DirectionalSingleFees { get; set; }
/// <summary>
/// 计费模式
/// </summary>
public FeesMode FeesMode { get; set; }
#endregion
/// <summary>
/// 打包人员列表
/// </summary>
public List<PackUserModelRequest> PackUserList { get; set; }
/// <summary>
/// 耗材列表
/// </summary>
public List<ConsumableRequest> ConsumableList { get; set; }
/// <summary>
/// 耗材费用(总)
/// </summary>
public decimal ConsumableFees { get; set; }
/// <summary>
/// 任务总费用
/// </summary>
public decimal AllFees { get; set; }
public string ProcessTypeName { get; set; }
}
public class ConsumableRequest
{
/// <summary>
/// 耗材id
/// </summary>
public long ConsumableId { get; set; }
/// <summary>
/// 任务量
/// </summary>
public int TaskCount { get; set; }
/// <summary>
/// 耗材价格
/// </summary>
public decimal ConsumablePrice { get; set; }
/// <summary>
/// 耗材类型
/// </summary>
public string ConsumableTypeName { get; set; }
}
public class PackUserModelRequest
{
/// <summary>
/// 打包人
/// </summary>
public string UserId { get; set; }
/// <summary>
/// 打包任务量
/// </summary>
public int TaskCount { get; set; }
}
public class TaskConsumableRequest
{
/// <summary>
/// 耗材id
/// </summary>
public long ConsumableId { get; set; }
/// <summary>
/// 耗材任务量
/// </summary>
public int TaskCount { get; set; }
}
}

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

@ -10,22 +10,25 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
/// </summary>
public class FeesItemResponse : NotifyObject
{
private List<ServiceItemResponse> serviceList = new List<ServiceItemResponse>();
private List<ServiceItemResponse> serviceList = new List<ServiceItemResponse>();
public List<ServiceItemResponse> ServiceList { get => serviceList; set { Set(ref serviceList, value); } }
public decimal disCount;
public decimal DisCount { get => disCount; set { Set(ref disCount, value); } }
public decimal AllFees { get=> allFees; set { Set(ref allFees, value);
} }
public decimal AllFees { get => allFees; set { Set(ref allFees, value); } }
private decimal allFees;
private decimal discountAllFees;
public decimal DiscountAllFees { get => discountAllFees; set { Set(ref discountAllFees, value); } }
public decimal SingleFees { get => singleFees; set { Set(ref singleFees, value);
} }
public decimal SingleFees
{
get => singleFees; set
{
Set(ref singleFees, value);
}
}
private decimal singleFees;
public decimal DiscountSingleFees { get => discountSingleFees; set { Set(ref discountSingleFees, value); } }
@ -36,8 +39,6 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
private decimal taskId;
/// <summary>
/// 耗材费用价格
/// </summary>
@ -62,14 +63,14 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
public decimal PackFees { get; set; }
/// <summary>
/// 增值费用小计
/// 增值费用小计(待移除)
/// </summary>
public decimal IncreateFees { get; set; }
/// <summary>
/// 增值服务数据
/// 增值服务数据(待移除)
/// </summary>
public List<ServiceItemResponse> IncreateList { get; set; }
public List<ServiceItemResponse> IncreateList { get; set; }
/// <summary>
/// 耗材服务数据
@ -78,38 +79,55 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
/// <summary>
/// 打包服务
/// 打包服务(待移除)
/// </summary>
public List<PackItemResponse> PackItemList { get; set; }
/// <summary>
/// 增量配件数
/// 增量配件数(待移除)
/// </summary>
public int? IncrementPartCount { get; set; }
/// <summary>
/// 增量配件任务数
/// 增量配件任务数(待移除)
/// </summary>
public int? IncrementPartTaskCount { get; set; }
/// <summary>
/// 增量配件单价
/// 增量配件单价(待移除)
/// </summary>
public decimal? IncrementPartPrice { get; set; }
/// <summary>
/// 基础包装费
/// 基础包装费(待移除)
/// </summary>
public decimal? BasicProcessPrice { get; set; }
/// <summary>
/// 基础包装数
/// 基础包装数(待移除)
/// </summary>
public int? BasicProcessCount { get; set; }
/// <summary>
/// 工序类型名称
/// </summary>
public string ProcessTypeName { get; set; }
/// <summary>
/// 工序套餐名称
/// </summary>
public string ProcessComboName { get; set; }
/// <summary>
/// 工序套餐单价
/// </summary>
public decimal ProcessComboPrice { get; set; }
/// <summary>
/// 工序套餐任务量
/// </summary>
public int ProcessComboTaskCount { get; set; }
}
public class PackItemResponse

19
BBWY.Client/Models/APIModel/Response/PackTask/GetConsumableTypeResponse.cs

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel.Response.PackTask
{
public class GetConsumableTypeResponse:NotifyObject
{
private string consumableTypeName;
public string ConsumableTypeName { get => consumableTypeName; set { Set(ref consumableTypeName, value); } }
private long? consumableTypeId;
public long? ConsumableTypeId { get => consumableTypeId; set { Set(ref consumableTypeId, value); } }
}
}

48
BBWY.Client/Models/APIModel/Response/PackTask/GetPackDetailResponse.cs

@ -0,0 +1,48 @@
using BBWY.Client.Models.APIModel.Request;
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models
{
public class GetPackDetailResponse
{
public string ProcessTypeName { get; set; }
public string ProcessComboName { get; set; }
public long ProcessComboId { get; set; }
public int ProcessTaskCount { get; set; }
public decimal? DirectionalSingleFees { get; set; }
public List<PackUserResponse> PackUserList { get; set; }
public List<TaskConsumableResponse> ConsumableList { get; set; }
public decimal? ConsumableFees { get; set; }
public FeesMode? FeesMode { get; set; }
public decimal? DiscountFactor { get; set; }
public string SuggestPackUserName { get; set; }
public string ProductResistantName { get; set; }
/// <summary>
/// 打包工序类型(0=推荐工序,1=自定义工序)
/// </summary>
public PackProcessType PackProcessType { get; set; }
}
public class PackUserResponse : PackUserModelRequest
{
}
public class TaskConsumableResponse : ConsumableRequest
{
}
}

14
BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs

@ -205,6 +205,20 @@ namespace BBWY.Client.Models.APIModel
/// 排单超时时间
/// </summary>
public DateTime? ScheduleOverTime { get; set; }
/// <summary>
/// 打包工序类型(0=推荐工序,1=自定义工序) NULL 金额不为0则为旧版本结算
/// </summary>
public PackProcessType? PackProcessType { get; set; }
/// <summary>
///
/// </summary>
public string ShopId { get; set; }
/// <summary>
/// 发送信息不全时间
/// </summary>
public DateTime? SendToSetSkuConfigureTime { get; set; }
}
public class ExpressOrderResponse
{

21
BBWY.Client/Models/APIModel/Response/Process/DiscountFactoryResponse.cs

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models
{
public class DiscountFactoryResponse
{
/// <summary>
/// 折扣系数
/// </summary>
public decimal DiscountFactory { get; set; }
/// <summary>
/// 计费类型
/// </summary>
public Models.FeesMode FeesMode { get; set; }
}
}

87
BBWY.Client/Models/APIModel/Response/Process/GetProcessTypeResponse.cs

@ -0,0 +1,87 @@
using BBWY.Client.Models.PackTask;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
namespace BBWY.Client.Models
{
public class GetProcessTypeResponse
{
public List<ProcessTypeResponse> ProcessTypeList { get; set; }
/// <summary>
/// 所有的耗材类型
/// </summary>
public List<ConsumableTypeResponse> ConsumableTypeList { get; set; }
public List<ProductResistantResponse> ProductResistantList { get; set; }
}
public class ProductResistantResponse : NotifyObject
{
private string productResistantName;
/// <summary>
/// 名称
/// </summary>
public string ProductResistantName { get => productResistantName; set { Set(ref productResistantName, value); } } //
/// <summary>
/// 套餐列表
/// </summary>
public ObservableCollection<ProcessComboResponse> ProcessComboList { get; set; }
}
public class ProcessTypeResponse : NotifyObject
{
/// <summary>
/// 工序单价
/// </summary>
public decimal ProcessTypePrice { get; set; }
/// <summary>
/// 工序类型
/// </summary>
public string ProcessTypeName { get; set; }
/// <summary>
/// 套餐列表
/// </summary>
public ObservableCollection<ProcessComboResponse> ProcessComboList { get; set; }
}
public class ProcessComboResponse : NotifyObject
{
private decimal processComboNamePrice;
/// <summary>
/// 套餐费用
/// </summary>
public decimal ProcessComboNamePrice { get => processComboNamePrice; set { Set(ref processComboNamePrice, value); } } //
/// <summary>
/// 套餐id
/// </summary>
public long ProcessComboId { get; set; }
/// <summary>
/// 套餐名称
/// </summary>
public string ProcessComboName { get; set; }
/// <summary>
/// 绑定的耗材类型
/// </summary>
public ObservableCollection<ConsumableTypeResponse> ConsumableTypeList { get; set; }
}
public class ConsumableTypeResponse : NotifyObject
{
/// <summary>
/// 耗材类型名称
/// </summary>
public string ConsumableTypeName { get; set; }
/// <summary>
/// 耗材列表
/// </summary>
public ObservableCollection<ConsumableItemModel> ConsumableList { get; set; }
}
}

17
BBWY.Client/Models/Enums.cs

@ -537,4 +537,21 @@
ID=1
}
/// <summary>
/// 推荐工序=0,自定义工序=1
/// </summary>
public enum PackProcessType
{
= 0, = 1
}
/// <summary>
/// 打包配置状态( 待配置 = 0,已配置 = 1, 需修改=2)
/// </summary>
public enum PackConfigState
{
= 0,
= 1,
= 2
}
}

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

@ -1,5 +1,6 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel.Request;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.ViewModels;
using BBWY.Client.Views.PackTask;
using BBWY.Common.Models;
@ -9,6 +10,7 @@ using NPOI.Util;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Resources;
using System.Text;
using System.Windows;
@ -19,15 +21,20 @@ namespace BBWY.Client.Models.PackTask
{
public class ConsumableModel : BaseVM, IDenpendency
{
public ObservableCollection<string> consumableTypeList = new ObservableCollection<string>()
public ObservableCollection<GetConsumableTypeResponse> consumableTypeList = new ObservableCollection<GetConsumableTypeResponse>()
{
"箱子", "气泡纸", "胶带", "其他"
};
public ObservableCollection<string> ConsumableTypeList { get => consumableTypeList; set { Set(ref consumableTypeList, value); } }
public ObservableCollection<GetConsumableTypeResponse> ConsumableTypeList { get => consumableTypeList; set { Set(ref consumableTypeList, value); } }
private string consumableTypeName;
public string ConsumableTypeName
{ get => consumableTypeName; set { Set(ref consumableTypeName, value); } }
private ConsumableType? consumableType;
public ConsumableType? ConsumableType
{ get => consumableType; set { Set(ref consumableType, value); } }
private string addConsumableTypeName;
public string AddConsumableTypeName
{ get => addConsumableTypeName; set { Set(ref addConsumableTypeName, value); } }
@ -35,6 +42,9 @@ namespace BBWY.Client.Models.PackTask
public ICommand EditConsumableCommand { get; set; }
public ICommand DeletedConsumableCommand { get; set; }
public ICommand SaveConsumableCommand { get; set; }
public ICommand AddConsumableTypeCommand { get; set; }
public ICommand DeletedConsumableTypeCommand { get; set; }
public Action ReflashDatas { get; set; }
public ConsumableModel(ConsumableService consumableService)
@ -44,8 +54,51 @@ namespace BBWY.Client.Models.PackTask
DeletedConsumableCommand = new RelayCommand<ObservableCollection<ConsumableModel>>(DeletedConsumable);
SaveConsumableCommand = new RelayCommand<object>(SaveConsumable);
if (consumableService != null)
{
GetConsumableTypeList();
}
AddConsumableTypeCommand = new RelayCommand(AddConsumableType);
DeletedConsumableTypeCommand = new RelayCommand(DeletedConsumableType);
}
private void DeletedConsumableType()
{
MessageBoxResult result = System.Windows.MessageBox.Show($"是否移除耗材类别:{ConsumableTypeName}?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes) return;
var res = consumableService.DeletedConsumableType(ConsumableTypeId.Value);
if (!res.Success)
{
System.Windows.MessageBox.Show(res.Msg);
return;
}
if (res.Success)
{
GetConsumableTypeList();
}
}
private void AddConsumableType()
{
var res = consumableService.AddConsumableType(AddConsumableTypeName);
if (!res.Success)
{
System.Windows.MessageBox.Show(res.Msg);
return;
}
if (res.Success)
{
GetConsumableTypeList();
}
}
private long? consumableTypeId;
public long? ConsumableTypeId
{ get => consumableTypeId; set { Set(ref consumableTypeId, value); } }
public void SaveConsumable(object obj)
{
@ -73,7 +126,8 @@ namespace BBWY.Client.Models.PackTask
Remark = Remark,
Weigth = Weigth,
Width = Width,
ConsumableType= ConsumableType,
ConsumableTypeId = ConsumableTypeId,
});
}
@ -89,7 +143,7 @@ namespace BBWY.Client.Models.PackTask
Remark = Remark,
Weigth = Weigth,
Width = Width,
ConsumableType = ConsumableType,
ConsumableTypeId = ConsumableTypeId,
});
}
@ -106,8 +160,8 @@ namespace BBWY.Client.Models.PackTask
}
else
{
if(res!=null)
new TipsWindow(res.Msg).Show();
if (res != null)
new TipsWindow(res.Msg).Show();
}
}
@ -130,8 +184,20 @@ namespace BBWY.Client.Models.PackTask
void GetConsumableTypeList()
{
var res = consumableService.GetConsumableTypeList();
if (res.Success && res.Data != null)
{
ConsumableTypeList = res.Data;
}
}
public void EditConsumable()
{
//GetConsumableTypeList();
EditConsumable add = new EditConsumable(new ConsumableModel(consumableService)
{
Heigth = this.Heigth,
@ -142,11 +208,14 @@ namespace BBWY.Client.Models.PackTask
Remark = this.Remark,
Width = this.Width,
Price = this.Price,
ConsumableType = this.ConsumableType,
ConsumableTypeList = this.ConsumableTypeList,
ConsumableTypeName = this.ConsumableTypeName,
ConsumableTypeId = this.ConsumableTypeId,
});
add.Show();
add.ShowDialog();
}
private long id;

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

@ -7,7 +7,9 @@ using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using WebSocketSharp;
namespace BBWY.Client.Models.PackTask
{
@ -80,5 +82,124 @@ namespace BBWY.Client.Models.PackTask
ObservableCollection<PackItemModel> list = obj as ObservableCollection<PackItemModel>;
list.Remove(this);
}
/// <summary>
/// 耗材类型
/// </summary>
private ObservableCollection<string> consumableTypeList;
public ObservableCollection<string> ConsumableTypeList { get => consumableTypeList; set { Set(ref consumableTypeList, value); } }
/// <summary>
/// 所有的耗材类型
/// </summary>
public List<ConsumableTypeResponse> AllConsumableTypeList { get; set; }
private string consumableType;
/// <summary>
/// 耗材类型
/// </summary>
public string ConsumableType
{
get => consumableType; set
{
Set(ref consumableType, value);
OnConsumableTypeChanged(ConsumableType);
}
}
void OnConsumableTypeChanged(string ConsumableType)
{
if (AllConsumableTypeList == null || AllConsumableTypeList.Count <= 0 || ConsumableType .IsNullOrEmpty())
{
return;//ConsumableList
}
ConsumableItemList = AllConsumableTypeList.SingleOrDefault(a => a.ConsumableTypeName == ConsumableType)?.ConsumableList;
if (ConsumableItemList == null || ConsumableItemList.Count <= 0 )
{
return;
}
ConsumableItem = ConsumableItemList.FirstOrDefault()?.ConsumableName;
}
private string consumableItem;
/// <summary>
/// 耗材型号
/// </summary>
public string ConsumableItem
{
get => consumableItem; set
{
Set(ref consumableItem, value);
OnConsumableItemChanged(ConsumableItem);
}
}
/// <summary>
/// 统计耗材收费
/// </summary>
public Action TotalConsumableFees { get; set; }
void OnConsumableItemChanged(string consumableItem)
{
if (ConsumableItemList == null || ConsumableItemList.Count <= 0 || consumableItem .IsNullOrEmpty())
{
return;
}
ConsumablePrice = ConsumableItemList.SingleOrDefault(c => c.ConsumableName == consumableItem).ConsumablePrice;
if (TotalConsumableFees != null) TotalConsumableFees();
}
/// <summary>
/// 耗材型号
/// </summary>
private ObservableCollection<ConsumableItemModel> consumableItemList;
public ObservableCollection<ConsumableItemModel> ConsumableItemList { get => consumableItemList; set { Set(ref consumableItemList, value); } }
private decimal consumablePrice;
/// <summary>
/// 耗材单价
/// </summary>
public decimal ConsumablePrice { get => consumablePrice; set { Set(ref consumablePrice, value); } }
private int taskCount;
/// <summary>
/// 耗材任务数
/// </summary>
public int TaskCount { get => taskCount; set { Set(ref taskCount, value); OnConsumableItemChanged(ConsumableItem); } }
}
public class ConsumableItemModel : NotifyObject
{
/// <summary>
/// 耗材id
/// </summary>
public long ConsumableId { get; set; }
/// <summary>
/// 耗材名称
/// </summary>
public string ConsumableName { get; set; }
/// <summary>
/// 耗材价格
/// </summary>
public decimal ConsumablePrice { get; set; }
}
}

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

@ -44,23 +44,33 @@ namespace BBWY.Client.Models
private void UpdateTask()
{
if (!this.SkuPurchaseSchemeId.IsNullOrEmpty())//B端有采购方案
try
{
UpdatePurchaseTaskWindow updatePurchaseWindow = new UpdatePurchaseTaskWindow(this,ReflashTask);
updatePurchaseWindow.ShowDialog();
return;
}
if (!this.SkuPurchaseSchemeId.IsNullOrEmpty())//B端有采购方案
{
UpdatePurchaseTaskWindow updatePurchaseWindow = new UpdatePurchaseTaskWindow(this, ReflashTask);
updatePurchaseWindow.ShowDialog();
return;
}
if (!OrderId.IsNullOrEmpty()&& SkuPurchaseSchemeId.IsNullOrEmpty())//B端无采购方案 ,手动添加合格证
{
PublishTaskWindow publishB = new PublishTaskWindow(ReflashTask, this,SaveType.B端);
publishB.ShowDialog();
return;
if (!OrderId.IsNullOrEmpty() && SkuPurchaseSchemeId.IsNullOrEmpty())//B端无采购方案 ,手动添加合格证
{
PublishTaskWindow publishB = new PublishTaskWindow(ReflashTask, this, SaveType.B端);
publishB.ShowDialog();
return;
}
PublishTaskWindow publish = new PublishTaskWindow(ReflashTask, this, SaveType.C端);
publish.ShowDialog();
}
catch (Exception)
{
PublishTaskWindow publish = new PublishTaskWindow(ReflashTask, this, SaveType.C端);
publish.ShowDialog();
}
}
@ -85,10 +95,16 @@ namespace BBWY.Client.Models
private void SetService()
{
ServiceWindow service = new ServiceWindow(this, ReflashTask);
service.Show();
if (this.PackProcessType==null&&this.FeesMoney>0)
{
ServiceWindow window = new ServiceWindow(this, ReflashTask);
window.ShowDialog();
return;//旧版本
}
PackDetailWindow service = new PackDetailWindow(this, ReflashTask);
service.ShowDialog();
}
/// <summary>
@ -459,6 +475,19 @@ namespace BBWY.Client.Models
/// </summary>
public DateTime? ScheduleOverTime { get; set; }
private PackProcessType? packProcessType;
/// <summary>
/// 打包工序类型(0=推荐工序,1=自定义工序) NULL 金额不为0则为旧版本结算
/// </summary>
public PackProcessType? PackProcessType { get => packProcessType; set { Set(ref packProcessType, value); } }
public string ShopId { get; set; }
/// <summary>
/// 发送信息不全时间
/// </summary>
public DateTime? SendToSetSkuConfigureTime { get; set; }
}
public class SkuMessage : NotifyObject

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

@ -1,6 +1,10 @@
using System;
using BBWY.Client.Models.APIModel.Response.PackTask;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Windows.Input;
namespace BBWY.Client.Models.PackTask
{
@ -24,4 +28,45 @@ namespace BBWY.Client.Models.PackTask
/// </summary>
public string UserNick { get; set; }
}
public class PackUserModel:NotifyObject
{
private string selectUserId;
/// <summary>
/// Member.userId
/// </summary>
public string SelectUserId { get => selectUserId; set { Set(ref selectUserId, value); } }
private string memberName;
public string MemberName { get => memberName; set { Set(ref memberName, value); } }
private int taskCount;
/// <summary>
/// 任务量
/// </summary>
public int TaskCount { get => taskCount; set { Set(ref taskCount, value); } }
private ObservableCollection<PackUser> memberList;
public ObservableCollection<PackUser> MemberList
{
get => memberList; set
{
Set(ref memberList, value);
}
}
public ICommand DeleteServiceCommand { get; set; }
public PackUserModel()
{
DeleteServiceCommand = new RelayCommand<object>(DeleteService);
}
private void DeleteService(object obj)
{
ObservableCollection<PackUserModel> list = obj as ObservableCollection<PackUserModel>;
list.Remove(this);
}
}
}

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

@ -0,0 +1,19 @@
using BBWY.Client.Models;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Windows.Input;
namespace BBWY.Client
{
public class ProcessComboModel : NotifyObject
{
public long ProcessComboId { get; set; }
public string ProcessComboName { get; set; }
}
}

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

@ -1,4 +1,5 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.Models.PackTask;
using BBWY.Client.Views.PackTask;
using BBWY.Common.Models;
@ -18,8 +19,18 @@ namespace BBWY.Client.ViewModels.PackTask
{
public class ConsumableViewModel : BaseVM, IDenpendency
{
private string consumableTypeName;
public string ConsumableTypeName
{ get => consumableTypeName; set { Set(ref consumableTypeName, value); } }
private long? consumableTypeId;
public long? ConsumableTypeId
{ get => consumableTypeId; set { Set(ref consumableTypeId, value); } }
public ObservableCollection<GetConsumableTypeResponse> consumableTypeList = new ObservableCollection<GetConsumableTypeResponse>()
{
};
public ObservableCollection<GetConsumableTypeResponse> ConsumableTypeList { get => consumableTypeList; set { Set(ref consumableTypeList, value); } }
private bool isOpenAdd = true;
public bool IsOpenAdd { get => isOpenAdd; set { Set(ref isOpenAdd, value); } }
@ -52,6 +63,7 @@ namespace BBWY.Client.ViewModels.PackTask
public ICommand TaskPageIndexChangedCommand { get; set; }
public ICommand AddConsumableCommand { get; set; }
public ICommand SearchConsumableCommand { get; set; }
private readonly ConsumableService consumableService;
public ConsumableViewModel(ConsumableService consumableService)
@ -68,7 +80,24 @@ namespace BBWY.Client.ViewModels.PackTask
LoadIndex(p.PageIndex);
});
SearchConsumable();
GetConsumableTypeList();
}
void GetConsumableTypeList()
{
ConsumableTypeList = new ObservableCollection<GetConsumableTypeResponse>();
var res = consumableService.GetConsumableTypeList();
if (res.Success && res.Data != null)
{
ConsumableTypeList.Add(new GetConsumableTypeResponse { ConsumableTypeId = null, ConsumableTypeName = "全部" });
foreach (var item in res.Data)
{
ConsumableTypeList.Add(item);
}
}
}
private void LoadIndex(int pageIndex)
{
PageIndex = pageIndex;//
@ -86,14 +115,16 @@ namespace BBWY.Client.ViewModels.PackTask
Name = searchName,
PageIndex = PageIndex,
PageSize = PageSize,
ConsumableTypeId = ConsumableTypeId,
});
if (res.Success)
{
ConsumableList = new ObservableCollection<ConsumableModel>();
if (res.Data != null && res.Data.Consumables != null && res.Data.Consumables.Count() > 0)
if (res.Data != null && res.Data.SearchConsumableList != null && res.Data.SearchConsumableList.Count() > 0)
{
OrderCount = res.Data.OrderCount;
foreach (var item in res.Data.Consumables)
OrderCount = res.Data.TotalCount;
foreach (var item in res.Data.SearchConsumableList)
{
App.Current.Dispatcher.Invoke(() =>
{
@ -107,8 +138,8 @@ namespace BBWY.Client.ViewModels.PackTask
Remark = item.Remark,
Weigth = item.Weigth,
Width = item.Width,
ConsumableType = item.ConsumableType,
ConsumableTypeName =item.ConsumableTypeName,
ConsumableTypeId = item.ConsumableTypeId,
});
});
}

207
BBWY.Client/ViewModels/PackTask/EditConsumableViewModel.cs

@ -0,0 +1,207 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel.Request;
using BBWY.Client.Models;
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.Text;
using System.Windows;
using System.Windows.Input;
using BBWY.Client.Models.APIModel.Response.PackTask;
namespace BBWY.Client.ViewModels.PackTask
{
public class EditConsumableViewModel:BaseVM,IDenpendency
{
public ObservableCollection<GetConsumableTypeResponse> consumableTypeList = new ObservableCollection<GetConsumableTypeResponse>()
{
};
public ObservableCollection<GetConsumableTypeResponse> ConsumableTypeList { get => consumableTypeList; set { Set(ref consumableTypeList, value); } }
private string consumableTypeName;
public string ConsumableTypeName
{ get => consumableTypeName; set { Set(ref consumableTypeName, value); } }
private string addConsumableTypeName;
public string AddConsumableTypeName
{ get => addConsumableTypeName; set { Set(ref addConsumableTypeName, value); } }
public ConsumableService consumableService;
public ICommand EditConsumableCommand { get; set; }
public ICommand DeletedConsumableCommand { get; set; }
public ICommand SaveConsumableCommand { get; set; }
public ICommand AddConsumableTypeCommand { get; set; }
public Action ReflashDatas { get; set; }
public EditConsumableViewModel(ConsumableService consumableService)
{
this.consumableService = consumableService;
EditConsumableCommand = new RelayCommand(EditConsumable);
DeletedConsumableCommand = new RelayCommand<ObservableCollection<ConsumableModel>>(DeletedConsumable);
SaveConsumableCommand = new RelayCommand<object>(SaveConsumable);
if (consumableService != null)
{
GetConsumableTypeList();
}
AddConsumableTypeCommand = new RelayCommand(AddConsumableType);
}
private void AddConsumableType()
{
var res = consumableService.AddConsumableType(AddConsumableTypeName);
if (res.Success)
{
GetConsumableTypeList();
}
}
private long consumableTypeId;
public long ConsumableTypeId
{ get => consumableTypeId; set { Set(ref consumableTypeId, value); } }
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,
ConsumableTypeId = ConsumableTypeId,
});
}
else
{
res = consumableService.Add(new ConsuableRequest
{
Heigth = Heigth,
Length = Length,
Name = Name,
Price = Price.Value,
Remark = Remark,
Weigth = Weigth,
Width = Width,
ConsumableTypeId = ConsumableTypeId,
});
}
if (res != null && res.Success)
{
var win = obj as System.Windows.Window;
ViewModelLocator viewModel = new ViewModelLocator();
var con = viewModel.Consumable;
con.SearchConsumable();
//if (ReflashDatas != null) ReflashDatas();
win.Close();
}
else
{
if (res != null)
new TipsWindow(res.Msg).Show();
}
}
public ConsumableModel model;
public void DeletedConsumable(ObservableCollection<ConsumableModel> list)
{
MessageBoxResult result = System.Windows.MessageBox.Show("是否删除?", "提示",
MessageBoxButton.YesNo,
MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes) return;
var res = consumableService.Deleted(Id);
if (res.Success)
{
ViewModelLocator viewModel = new ViewModelLocator();
var con = viewModel.Consumable;
con.SearchConsumable();
list.Remove(model);
}
}
void GetConsumableTypeList()
{
var res = consumableService.GetConsumableTypeList();
if (res.Success && res.Data != null)
{
ConsumableTypeList = res.Data;
}
}
public void EditConsumable()
{
GetConsumableTypeList();
EditConsumable add = new EditConsumable(new ConsumableModel(consumableService)
{
Heigth = this.Heigth,
Length = this.Length,
Id = this.Id,
Name = this.Name,
Weigth = this.Weigth,
Remark = this.Remark,
Width = this.Width,
Price = this.Price,
ConsumableTypeId = this.ConsumableTypeId,
ConsumableTypeList = this.ConsumableTypeList,
ConsumableTypeName = this.ConsumableTypeName,
});
add.ShowDialog();
}
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); } }
}
}

1044
BBWY.Client/ViewModels/PackTask/PackDetailViewModel.cs

File diff suppressed because it is too large

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

@ -239,7 +239,7 @@ namespace BBWY.Client.ViewModels.PackTask
public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService)
public TaskListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService)
{
this.globalContext = globalContext;
@ -289,7 +289,7 @@ namespace BBWY.Client.ViewModels.PackTask
var paramList = (object[])param;
var id = (long)paramList[0];
var markMsg = paramList[1].ToString();
SubmitOverTimeMarkMsgWindow submitOverTimeMarkMsgWindow = new SubmitOverTimeMarkMsgWindow(OverTimeTaskType., id, markMsg, packTaskService, ReflashTask) ;
SubmitOverTimeMarkMsgWindow submitOverTimeMarkMsgWindow = new SubmitOverTimeMarkMsgWindow(OverTimeTaskType., id, markMsg, packTaskService, ReflashTask);
submitOverTimeMarkMsgWindow.ShowDialog();
}
@ -307,15 +307,15 @@ namespace BBWY.Client.ViewModels.PackTask
ProductTitle = fallware.ProductTitle,
PurchaseOrder = fallware.PurchaseOrder,
WaybillNo = fallware.WaybillNo
};
//if (fallware.WareType== WareType.京仓)
//{
//SetJDWareBoxWindow window = new SetJDWareBoxWindow(model,sealBoxService,fallware.WareType.Value,ReflashTask);
//window.Show();
var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType.Value, ReflashTask,fallware.TransportOverTime);
w.ShowDialog();
//SetJDWareBoxWindow window = new SetJDWareBoxWindow(model,sealBoxService,fallware.WareType.Value,ReflashTask);
//window.Show();
var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType.Value, ReflashTask, fallware.TransportOverTime);
w.ShowDialog();
//}
//if (fallware.WareType == WareType.云仓)
//{
@ -522,7 +522,7 @@ namespace BBWY.Client.ViewModels.PackTask
try
{
if (SearchTaskId != null && !string.IsNullOrEmpty(SearchTaskId.Trim()))
taskId= Convert.ToInt64(SearchTaskId);
taskId = Convert.ToInt64(SearchTaskId);
}
catch
{
@ -540,7 +540,7 @@ namespace BBWY.Client.ViewModels.PackTask
try
{
PackTaskList = new ObservableCollection<PackTaskModel>();//初始化数据
var datas = packTaskService.SearchTaskList(SearchSkuId, SearchTaskId,SearchSpuId,SearchOrderSn, this.TaskState,
var datas = packTaskService.SearchTaskList(SearchSkuId, SearchTaskId, SearchSpuId, SearchOrderSn, this.TaskState,
PageIndex, PageSize);
if (datas != null && datas.Data != null && datas.Success)
{
@ -563,7 +563,7 @@ namespace BBWY.Client.ViewModels.PackTask
GoodsNo = item.ProductItemNum, Logo= item.Logo,
SkuName = item.SkuName,
SkuId = item.SkuId,
} },
ShowMarkMessage = item.ShowMarkMessage,
@ -583,7 +583,9 @@ namespace BBWY.Client.ViewModels.PackTask
ShopName = item.ShopName,
SkuPurchaseSchemeId = item.SkuPurchaseSchemeId,
ScheduleOverTimeMarkMsg = item.ScheduleOverTimeMarkMsg,
ScheduleOverTime = item.ScheduleOverTime
ScheduleOverTime = item.ScheduleOverTime,
PackProcessType = item.PackProcessType,
SendToSetSkuConfigureTime = item.SendToSetSkuConfigureTime,
};
if (!item.OrderId.IsNullOrEmpty() && !item.SkuId.IsNullOrEmpty())//加载物流信息
@ -591,7 +593,8 @@ namespace BBWY.Client.ViewModels.PackTask
var expressData = packTaskService.GetPurchaseExpressOrderList(item.OrderId, item.SkuId);
if (expressData != null && expressData.Success && expressData.Data != null)
{
expressData.Data.ForEach(e => {
expressData.Data.ForEach(e =>
{
e.ExpressState = ExpressOrderHelper.GetExpressStateName(e.ExpressState);
});
data.ExpressOrderList = expressData.Data;
@ -656,19 +659,18 @@ namespace BBWY.Client.ViewModels.PackTask
{
foreach (var item in packtasks)
{
var datetime = item.QualityCompletionOverTime.Value.Subtract(DateTime.Now);
TimeSpan datetime;
if (item.SendToSetSkuConfigureTime != null)
datetime = item.QualityCompletionOverTime.Value.Subtract(item.SendToSetSkuConfigureTime.Value);
else
datetime = item.QualityCompletionOverTime.Value.Subtract(DateTime.Now);
item.QualityRemainTime = OverTimeHelper.GetTimeString(datetime);
if (datetime.TotalMilliseconds > 0)
{
item.IsQualityOverTime = false;
//item.QualityRemainTime = $"{datetime.Days}天{datetime.Hours}小时{datetime.Minutes}分{datetime.Seconds}秒";
item.QualityRemainTime = $"{datetime.Days}天{datetime.Hours}小时{datetime.Minutes}分";
}
else
{
item.IsQualityOverTime = true;
//item.QualityRemainTime = $"{-datetime.Days}天{-datetime.Hours}小时{-datetime.Minutes}分{-datetime.Seconds}秒";
item.QualityRemainTime = $"{-datetime.Days}天{-datetime.Hours}小时{-datetime.Minutes}分";
}
}
}));
@ -798,7 +800,7 @@ namespace BBWY.Client.ViewModels.PackTask
if (SealBoxConfigureType == SealBoxConfigureType.)
{
SealBoxWaitConfigureList = new ObservableCollection<SealBoxWaitConfigureModel>();
ApiResponse<SealBoxWaitConfigureResponse> sealBoxWaitRes = sealBoxService.GetSealBoxWaitConfigureList(SearchSkuId, SearchTaskId, PageSize, PageIndex,SearchSpuId);
ApiResponse<SealBoxWaitConfigureResponse> sealBoxWaitRes = sealBoxService.GetSealBoxWaitConfigureList(SearchSkuId, SearchTaskId, PageSize, PageIndex, SearchSpuId);
if (sealBoxWaitRes == null)
{
@ -934,9 +936,9 @@ namespace BBWY.Client.ViewModels.PackTask
}));
}
var fallWareTasks = FallWareWaitConfigureList.Where(p => p.SetPurchaseOrderOverTime != null).ToList();
if (fallWareTasks.Count() > 0 && TaskState == Models.TaskState.&& SealBoxConfigureType == SealBoxConfigureType.)
if (fallWareTasks.Count() > 0 && TaskState == Models.TaskState. && SealBoxConfigureType == SealBoxConfigureType.)
{
//if (packOverTimeThread!=null)
//{
@ -1099,7 +1101,7 @@ namespace BBWY.Client.ViewModels.PackTask
public void ShowCertificateWindow()
{
}
#endregion
private void OpenSkuDetail(object param)
{

89
BBWY.Client/ViewModels/PackTask/UpdatePurchaseTaskViewModel.cs

@ -66,14 +66,14 @@ namespace BBWY.Client.ViewModels.PackTask
private ObservableCollection<string> certificatePositionList = new ObservableCollection<string> {
"无","外部包装","产品包装"
"无需合格证","外部包装","产品包装"
};
public ObservableCollection<string> CertificatePositionList { get => certificatePositionList; set { Set(ref certificatePositionList, value); } }
private ObservableCollection<string> availabilityList = new ObservableCollection<string> {
"已到货","部分到货","未到货"
};
public ObservableCollection<string> AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } }
//private ObservableCollection<string> availabilityList = new ObservableCollection<string> {
// "已到货","部分到货","未到货"
// };
//public ObservableCollection<string> AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } }
private int skuCount;
/// <summary>
@ -631,39 +631,6 @@ namespace BBWY.Client.ViewModels.PackTask
//加载配置文件
}
//public void SearSpuCer()
//{
// if (string.IsNullOrEmpty(SpuId))
// {
// SearchSku(SkuId);
// return;
// }
// SpuId = SpuId.Trim();//去掉空格 避免数据异常
// var productSku = packPurchaseTaskService.GetSpuCer(SpuId);
// if (productSku == null || !productSku.Success)
// {
// IsSetSpuCertificate = true;
// return;
// }
// SpuCertificateModel = productSku.Data;
// IsSetSpuCertificate = false;
// if (SpuCertificateModel == null)
// {
// SpuCertificateModel = new CertificateModel();
// IsSetSpuCertificate = true;
// SpuCertificateModel.Brand = Brand;
// SpuCertificateModel.BrandName = BrandName;
// SpuCertificateModel.ProductNo = ProductNo;
// SpuCertificateModel.SpuId = SpuId;
// }
//}
public Action ReflashWindow { get; set; }
public void InitData()
{
@ -679,15 +646,11 @@ namespace BBWY.Client.ViewModels.PackTask
BarCodeModel = null;
OriginShopName = "";
// Availability = (TaskState.)config.Availability;
MarkMessage = "";
CertificatePosition = CertificatePosition.;
// Increment1 = config.Increment1;
IsNeedBarCode = Need.;
IsNeedCertificateModel = Need.;
bool isSelected;
IncreateList = new ObservableCollection<IncreateModel>();
foreach (var item in increates)
@ -738,57 +701,57 @@ namespace BBWY.Client.ViewModels.PackTask
SkuName = SkuName,
OrderId = OrderId,
BrandName = BrandName,
Availability = (int)Availability,
BasicPack = (int)BasicPack,
SkuId = SkuId,
Increment1 = increateStr,
CertificatePosition = (int)CertificatePosition,
PackType = (int)PackType,
MarkMessage = MarkMessage,
PositionType = (int)PositionType,
GoodsNumber = GoodsNumber,
SkuGoodsTitle = SkuTitle,
SkuCount = SkuCount,
NeedBar = IsNeedBarCode == Need.,
NeedCer = IsNeedCertificateModel == Need.,
SkuPurchaseSchemeId = SkuPurchaseSchemeId,
Brand = Brand,
PurchaseSkuSpecs = PurchaseSkuList.Select(p => new PurchaseSkuSpec
{
IsNeedCer = p.IsNeedCer,
PurchaseSkuId = p.PurchaseSkuId,
}).ToArray()
//IsWorry = IsWorry
}).ToArray(),
};
if (IsNeedBarCode == Need.)
{
if (BarCodeModel == null || IsSetBarCode || BarCodeModel.Id <= 0)
{
MessageBox.Show("请设置条形码模板");
//new TipsWindow("请设置条形码模板").Show();
return;
}
createTaskModel.BarCodeId = BarCodeModel.Id;
}
if (IsNeedCertificateModel == Need.)
{
if (purchaseSkuList.Any(p => p.IsNeedCer && p.CerDTO == null))
{
MessageBox.Show("有未设置的合格证,请设置完所有的合格证再保存");
return;
}
var cerList = purchaseSkuList.Where(p => p.IsNeedCer).Select(p => p.CerDTO).Select(c => c.Id).Where(c => c > 0).ToList();
if (purchaseSkuList.Count() <= 0 || cerList.Count <= 0)
if (CertificatePosition!= CertificatePosition.)//需要合格证
{
if (PurchaseSkuList != null && PurchaseSkuList.Count > 0 && purchaseSkuList.Any(p => p.IsNeedCer))
{
MessageBox.Show("请设置合格证模板");
return;
if (purchaseSkuList.Any(p => p.IsNeedCer && p.CerDTO == null))
{
MessageBox.Show("有未设置的合格证,请设置完所有的合格证再保存");
return;
}
var cerList = purchaseSkuList.Where(p => p.IsNeedCer).Select(p => p.CerDTO).Select(c => c.Id).Where(c => c > 0).ToList();
if (purchaseSkuList.Count() <= 0 || cerList.Count <= 0)
{
MessageBox.Show("请设置合格证模板");
return;
}
createTaskModel.CerId = string.Join(",", cerList);//
}
createTaskModel.CerId = string.Join(",", cerList);//
}
ApiResponse<long> res = null;
res = packPurchaseTaskService.UpdatePurchaseTask(createTaskModel);

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

@ -119,14 +119,14 @@ namespace BBWY.Client.ViewModels.PackTask
{
SearchWayBillNo = null;
}
}
/// <summary>
/// 查询物流
/// </summary>
private string selectTaskId= "任务ID";
private string selectTaskId = "任务ID";
public string SelectTaskId
{
get => selectTaskId;
@ -175,7 +175,7 @@ namespace BBWY.Client.ViewModels.PackTask
{
SearchSkuId = null;
}
}
@ -406,7 +406,7 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public string ArrivedCount { get => arrivedCount; set { Set(ref arrivedCount, value); } }
@ -570,11 +570,31 @@ namespace BBWY.Client.ViewModels.PackTask
LookLSOrderConfigureCommand = new RelayCommand<object>(LookLSOrderConfigure);
SubmitOverTimeMarkMsgCommand = new RelayCommand<object>(SubmitOverTimeMarkMsg);
SendToSetSkuConfigureCommand = new RelayCommand<PackTaskModel>(SendToSetSkuConfigure);
SelectSku = "SKU";
SelectExpress = "物流单号";
}
private void SendToSetSkuConfigure(PackTaskModel model)
{
if (model.SendToSetSkuConfigureTime!=null)
{
System.Windows.MessageBox.Show($"已提醒配置,提醒时间:{model.SendToSetSkuConfigureTime},请耐心等待");
return;
}
var res = packTaskService.SendToSetSkuConfigure(model.TaskId);
if (!res.Success)
{
System.Windows.MessageBox.Show(res.Msg);
}
if (res.Success)
{
SearchTaskList();
}
}
private void SubmitOverTimeMarkMsg(object param)
{
@ -919,6 +939,10 @@ namespace BBWY.Client.ViewModels.PackTask
#region 事件绑定
/// <summary>
/// 推送sku配置状态
/// </summary>
public ICommand SendToSetSkuConfigureCommand { get; set; }
/// <summary>
/// 提交超时原因
/// </summary>
@ -1340,7 +1364,7 @@ namespace BBWY.Client.ViewModels.PackTask
else if (TaskState == Models.TaskState.)
Task.Factory.StartNew(() =>
{
if (SealBoxConfigureType == SealBoxConfigureType.)
{
@ -1511,7 +1535,10 @@ namespace BBWY.Client.ViewModels.PackTask
ShowMarkMessage = item.ShowMarkMessage,
SkuPurchaseSchemeId = item.SkuPurchaseSchemeId,
ScheduleOverTimeMarkMsg = item.ScheduleOverTimeMarkMsg,
ScheduleOverTime = item.ScheduleOverTime
ScheduleOverTime = item.ScheduleOverTime,
PackProcessType = item.PackProcessType,
ShopId = item.ShopId,
SendToSetSkuConfigureTime= item.SendToSetSkuConfigureTime,
};
@ -1552,7 +1579,7 @@ namespace BBWY.Client.ViewModels.PackTask
if (item.FeesItemResponse != null)
{
data.FeesItemResponse = item.FeesItemResponse;
data.FeesMoney = item.FeesItemResponse.SingleFees;
data.FeesMoney = item.FeesItemResponse.AllFees;
data.FeesItemResponse.DiscountAllFees = item.FeesItemResponse.AllFees *
item.FeesItemResponse.disCount;
@ -1592,7 +1619,11 @@ namespace BBWY.Client.ViewModels.PackTask
{
foreach (var item in packtasks)
{
var datetime = item.QualityCompletionOverTime.Value.Subtract(DateTime.Now);
TimeSpan datetime;
if (item.SendToSetSkuConfigureTime != null)
datetime = item.QualityCompletionOverTime.Value.Subtract(item.SendToSetSkuConfigureTime.Value);
else
datetime = item.QualityCompletionOverTime.Value.Subtract(DateTime.Now);
item.QualityRemainTime = OverTimeHelper.GetTimeString(datetime);
if (datetime.TotalMilliseconds > 0)
{
@ -1627,7 +1658,7 @@ namespace BBWY.Client.ViewModels.PackTask
var packCompletedTasks = PackTaskList.Where(p => p.TaskState == Models.TaskState. && p.PackCompletionOverTime != null).ToList();
if (packCompletedTasks.Count() > 0)
{
packOverTimeThread = new Thread(() =>
{
IsStartThread = true;

8
BBWY.Client/ViewModels/ViewModelLocator.cs

@ -347,6 +347,14 @@ namespace BBWY.Client.ViewModels
}
}
public PackDetailViewModel PackDetailVM
{
get
{
using var s = sp.CreateScope();
return s.ServiceProvider.GetRequiredService<PackDetailViewModel>();
}
}
//public ShopSealBoxListViewModel ShopSealBoxListVM
//{

8
BBWY.Client/Views/FallWare/SetJDWareBoxWindow.xaml.cs

@ -32,9 +32,10 @@ namespace BBWY.Client.Views.FallWare
{
public SetJDWareBoxWindow(JDWareBoxModel model)
{
JDWareBoxModel = model;
InitializeComponent();
PurchaseOrderImage= MyPrintHelper.GetBarcodeImageV2(model.PurchaseOrder, 420, 50);
JDWareBoxModel = model;
PurchaseOrderImage = MyPrintHelper.GetBarcodeImageV2(model.PurchaseOrder, 420, 50);
PrewOrderImage = MyPrintHelper.GetBarcodeImageV2(model.PrewOrder, 350, 50);
this.DataContext =this;
this.Dispatcher.Invoke(() => {
@ -86,8 +87,9 @@ namespace BBWY.Client.Views.FallWare
printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight);
this.Height = pageHeight + 39;//833
this.Width = pageWidth;//1123
this.FontSize = 30;
this.FontSize = 30;
box_margin.Margin = new Thickness(50, 50, 50, 50);
//box_margin.Margin = new Thickness(10);
this.jd_box.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight)));
for (int i = 1; i <= JDWareBoxModel.BoxCount; i++)
{

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

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

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

@ -41,7 +41,7 @@
<RowDefinition Height="30"/>
<!---->
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Stretch" Panel.ZIndex="10" Margin="10,5,0,0" >
<Grid Background="{StaticResource Border.Background}" HorizontalAlignment="Stretch" Panel.ZIndex="10" Margin="10,5,10,0" >
<StackPanel Orientation="Horizontal" Height="35">
<!-- Command="{Binding AddConsumableCommand}"-->
@ -50,11 +50,27 @@
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"
<c:BTextBox Visibility="Hidden" Width="150" Height="30" />
<TextBlock Text="耗材类型:" VerticalAlignment="Center" Margin="16,0,0,0" />
<Border CornerRadius="0" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}">
<Border.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>
</Border.Resources>
<ComboBox BorderThickness="0" Width="140" VerticalContentAlignment="Center" ItemsSource="{Binding ConsumableTypeList}"
DisplayMemberPath="ConsumableTypeName"
SelectedValuePath="ConsumableTypeId" SelectedValue="{Binding ConsumableTypeId}" Text="{Binding ConsumableTypeName}"
/>
</Border>
<Button Content="搜索" Height="35" Width="66" VerticalAlignment="Stretch" Margin="60,0,10,0"
Command="{Binding SearchConsumableCommand}" HorizontalAlignment="Left"
Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/>
</StackPanel>
</Grid>
@ -63,7 +79,7 @@
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Grid Background="{StaticResource Border.Background}" Margin="10 0 5 0">
<Grid Background="{StaticResource Border.Background}" Margin="10 0 10 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="250"/>
@ -94,7 +110,7 @@
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
</Grid>
<!--ItemsSource="{Binding OrderList}"-->
<ListBox x:Name="listbox_order" Margin="10 0 5 0"
<ListBox x:Name="listbox_order" Margin="10 0 10 0"
Grid.Row="1"
ItemsSource="{Binding ConsumableList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
@ -118,7 +134,7 @@
<Grid Grid.Column="0">
<TextBlock
Text="{Binding ConsumableType}"
Text="{Binding ConsumableTypeName}"
TextWrapping="Wrap"
VerticalAlignment="Center" HorizontalAlignment="Center"
/>
@ -185,7 +201,6 @@
<Border Width="1" HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Grid.Column="7"/>
<Border Height="1" VerticalAlignment="Bottom" Background="{StaticResource Border.Brush}" Grid.ColumnSpan="7"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

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

@ -44,10 +44,15 @@
<TextBlock Text="所属分类:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30 0 5 0" />
<Border CornerRadius="0" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}">
<ComboBox BorderThickness="0" Width="88" VerticalContentAlignment="Center" ItemsSource="{Binding ConsumableTypeList}" Text="{Binding ConsumableType}" >
</ComboBox>
<ComboBox BorderThickness="0" Width="88" VerticalContentAlignment="Center" ItemsSource="{Binding ConsumableTypeList}"
DisplayMemberPath="ConsumableTypeName"
SelectedValuePath="ConsumableTypeId" SelectedValue="{Binding ConsumableTypeId}" Text="{Binding ConsumableTypeName}"
/>
</Border>
<c:BButton Content="移除选中分类" Width="80" Height="35" Command="{Binding DeletedConsumableTypeCommand}"/>
<c:BTextBox Margin="30 0 5 0" Width="100" Height="35" Text="{Binding AddConsumableTypeName}"/>
<c:BButton Content="添加分类" Width="80" Height="35" Command="{Binding AddConsumableTypeCommand}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 10 0 10">

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

@ -21,7 +21,7 @@ namespace BBWY.Client.Views.PackTask
{
public EditConsumable(ConsumableModel model)
public EditConsumable( ConsumableModel model)
{
InitializeComponent();
this.DataContext = model;

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

@ -43,23 +43,6 @@ namespace BBWY.Client.Views.PackTask
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 bool IsMin
{
get
@ -237,7 +220,7 @@ namespace BBWY.Client.Views.PackTask
<TextBlock Text=""[:Price:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string basicPackStr = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
string basicPackStr = @" <Grid Grid.Column=""[:index:]"" MinWidth=""[:BasicPackWidth:]"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
@ -359,7 +342,7 @@ namespace BBWY.Client.Views.PackTask
private void LoadData(bool isPrice)
{
isPrice = false;
if (FeesItem == null || FeesItem.ServiceList.Count <= 0)
if (FeesItem == null || FeesItem.ServiceList.Count <= 0 || FeesItem.ProcessComboTaskCount > 0)
{
return;
}
@ -468,11 +451,18 @@ namespace BBWY.Client.Views.PackTask
basiccolumns.AppendLine(columnStr);
}
serviceData.AppendLine(basicPackStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:Columns:]", $"{basiccolumns}")
.Replace("[:ServiceCount:]", $"{FeesItem.BasicProcessPrice}*{FeesItem.BasicProcessCount}")
.Replace("[:BasicProcessData:]", basicSB.ToString()));
if (basicProcessList.Count == 1)
serviceData.AppendLine(basicPackStr.Replace("[:BasicPackWidth:]", $"{84}")
.Replace("[:index:]", $"{rowIndex}")
.Replace("[:Columns:]", $"{basiccolumns}")
.Replace("[:ServiceCount:]", $"{FeesItem.BasicProcessPrice}*{FeesItem.BasicProcessCount}")
.Replace("[:BasicProcessData:]", basicSB.ToString()));
if (basicProcessList.Count > 1)
serviceData.AppendLine(basicPackStr.Replace("[:BasicPackWidth:]", $"{168}")
.Replace("[:index:]", $"{rowIndex}")
.Replace("[:Columns:]", $"{basiccolumns}")
.Replace("[:ServiceCount:]", $"{FeesItem.BasicProcessPrice}*{FeesItem.BasicProcessCount}")
.Replace("[:BasicProcessData:]", basicSB.ToString()));

138
BBWY.Client/Views/PackTask/FeesExcelV2Control.xaml

@ -0,0 +1,138 @@
<UserControl x:Class="BBWY.Client.Views.PackTask.FeesExcelV2Control"
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" Background="White"
d:DesignHeight="120" d:DesignWidth="1800">
<Grid x:Name ="gd"/>
<!--<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Grid.ColumnDefinitions >
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Border Background="#F2F2F2" Grid.RowSpan="3" Grid.ColumnSpan="13"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="0" Grid.Row="0" Grid.RowSpan="4" BorderThickness="1,0,0,0"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="1" Grid.Row="0" Grid.RowSpan="4" BorderThickness="1,0,0,0"/>
<Border Width="1" HorizontalAlignment="Right" BorderBrush="#D7D7D7" Grid.Column="12" Grid.Row="0" Grid.RowSpan="4" BorderThickness="0,0,1,0"/>
<Border Height="1" VerticalAlignment="Top" BorderBrush="#D7D7D7" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="13" BorderThickness="0,1,0,0"/>
<Border Height="1" VerticalAlignment="Top" BorderBrush="#D7D7D7" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="7" BorderThickness="0,1,0,0"/>
<Border Height="1" VerticalAlignment="Bottom" BorderBrush="#D7D7D7" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="13" BorderThickness="0,1,0,0"/>
<Border Height="1" VerticalAlignment="Bottom" BorderBrush="#D7D7D7" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="13" BorderThickness="0,1,0,0"/>
<TextBlock Text="任务ID" TextAlignment="Center" Grid.Column="0" Grid.RowSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="包装服务" Grid.Column="1" Grid.ColumnSpan="4" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="4" Grid.Row="0" Grid.RowSpan="4" BorderThickness="1,0,0,0"/>
<TextBlock Text="打包耗材" Grid.Column="5" Grid.ColumnSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="12" Grid.Row="0" Grid.RowSpan="4" BorderThickness="1,0,0,0"/>
<TextBlock MinWidth="101" TextAlignment="Center" Text="结算金额" Grid.Column="8" Grid.RowSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="13739" Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="149.82" Grid.Row="3" Grid.Column="8" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Grid Grid.Column="1" Grid.Row="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="工序类型" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="简工序" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Height="1" VerticalAlignment="Bottom" BorderBrush="#D7D7D7" Grid.Row="0" Grid.ColumnSpan="2" BorderThickness="0,1,0,0"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Row="0" Grid.RowSpan="3" BorderThickness="1,0,0,0"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" BorderThickness="1,0,0,0"/>
</Grid>
<Grid Grid.Column="2" Grid.Row="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="工序套餐" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="紧贴标" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Height="1" VerticalAlignment="Bottom" BorderBrush="#D7D7D7" Grid.Row="0" Grid.ColumnSpan="2" BorderThickness="0,1,0,0"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Row="0" Grid.RowSpan="2" BorderThickness="1,0,0,0"/>
</Grid>
<TextBlock Text="0.42*33" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Grid Grid.Column="3" Grid.Row="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="折扣系数" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="0.74" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="4" Grid.Row="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="小计" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="30.00" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="5" Grid.Row="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="8号箱子" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="0.49*33" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="6" Grid.Row="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="气泡纸" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="0.49*33" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="7" Grid.Row="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="小计" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="16.17" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
</Grid>-->
</UserControl>

355
BBWY.Client/Views/PackTask/FeesExcelV2Control.xaml.cs

@ -0,0 +1,355 @@
using BBWY.Client.Models.APIModel.Response.PackTask;
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.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// FeesExcelV2Control.xaml 的交互逻辑
/// </summary>
public partial class FeesExcelV2Control : UserControl
{
public FeesExcelV2Control()
{
InitializeComponent();
}
public FeesItemResponse FeesItem
{
get
{
return (FeesItemResponse)GetValue(FeesItemProperty);
}
set
{
SetValue(FeesItemProperty, value);
}
}
public static readonly DependencyProperty FeesItemProperty =
DependencyProperty.Register("FeesItem", typeof(FeesItemResponse), typeof(FeesExcelV2Control), new PropertyMetadata(ChangedProperty));
private static void ChangedProperty(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = d as FeesExcelV2Control;
var newValue = e.NewValue as FeesItemResponse;
control.FeesItem = newValue;
control.LoadData();
}
string xaml = @" <Grid xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
<Grid.ColumnDefinitions >
<ColumnDefinition />
[:Columns:]
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
</Grid.RowDefinitions>
<Border Background=""#F2F2F2"" Grid.RowSpan=""3"" Grid.ColumnSpan=""[:ColumnCount:]""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Column=""0"" Grid.Row=""0"" Grid.RowSpan=""4"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Column=""1"" Grid.Row=""0"" Grid.RowSpan=""4"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Right"" BorderBrush=""#D7D7D7"" Grid.Column=""[:1+ProcessCount:+ConsumableCount]"" Grid.Row=""0"" Grid.RowSpan=""4"" 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=""2"" Grid.ColumnSpan=""[:ColumnCount:]"" BorderThickness=""0,1,0,0""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Column=""0"" Grid.Row=""3"" Grid.ColumnSpan=""[:ColumnCount:]"" BorderThickness=""0,1,0,0""/>
<TextBlock MinWidth=""84"" Text=""ID"" TextAlignment=""Center"" Grid.Column=""0"" Grid.RowSpan=""3"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
[:Header:]
<TextBlock MinWidth=""101"" TextAlignment=""Center"" Text="""" Grid.Column=""[:1+ProcessCount:+ConsumableCount]"" Grid.RowSpan=""3"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:TaskId:]"" Grid.Row=""3"" Grid.Column=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:AllFees:]"" Grid.Row=""3"" Grid.Column=""[:1+ProcessCount:+ConsumableCount]"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
[:ListData:]
</Grid>";
string processComboStr1 = @"<Grid Grid.Column=""1"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessTypeName:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.ColumnSpan=""2"" BorderThickness=""0,1,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.Column=""1"" Grid.RowSpan=""2"" BorderThickness=""1,0,0,0""/>
</Grid>
<Grid Grid.Column=""2"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" Grid.Column=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessComboName:]"" Grid.Row=""1"" Grid.Column=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.ColumnSpan=""2"" BorderThickness=""0,1,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""2"" BorderThickness=""1,0,0,0""/>
</Grid>
<TextBlock Text=""[:ProcessComboPrice:]"" Grid.Row=""3"" Grid.Column=""1"" Grid.ColumnSpan=""2"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>";
string processComboStr = @" <Grid Grid.Column=""1"" MinWidth=""168"" Grid.Row=""1"" Grid.RowSpan=""3"" Grid.ColumnSpan=""2"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="" "" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessTypeName:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text="" "" Grid.Row=""0"" Grid.Column=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessComboName:]"" Grid.Row=""1"" Grid.Column=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessComboPrice:]"" Grid.Row=""3"" Grid.ColumnSpan=""2"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.ColumnSpan=""2"" BorderThickness=""0,1,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.Column=""1"" Grid.RowSpan=""2"" BorderThickness=""1,0,0,0""/>
</Grid>";
string discountFactorStr = @" <Grid Grid.Column=""3"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
<RowDefinition Height=""*""/>
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:DiscountFactor:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string processFeesStr = @"
<Grid Grid.Column=""4"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
<RowDefinition Height=""*""/>
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:PackFees:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string columnStr = "<ColumnDefinition Width=\"[:Width:]\"/>";
string workProcess = "<TextBlock Text=\"包装服务\" Grid.Column=\"1\" Grid.ColumnSpan=\"[:ProcessCount:]\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"/>\r\n <Border Width=\"1\" HorizontalAlignment=\"Left\" BorderBrush=\"#D7D7D7\" Grid.Column=\"[:1+ProcessCount:]\" Grid.Row=\"0\" Grid.RowSpan=\"4\" BorderThickness=\"1,0,0,0\"/>\r\n ";
string consumableService = "<TextBlock Text=\"包装耗材\" Grid.Column=\"[:1+ProcessCount:]\" Grid.ColumnSpan=\"[:ConsumableCount:]\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"/>\r\n <Border Width=\"1\" HorizontalAlignment=\"Left\" BorderBrush=\"#D7D7D7\" Grid.Column=\"[:1+ProcessCount:+ConsumableCount]\" Grid.Row=\"0\" Grid.RowSpan=\"4\" BorderThickness=\"1,0,0,0\"/>\r\n ";
string incrementConsumableStr = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
<RowDefinition Height=""*""/>
</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 totalIncrementConsumableStr = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
<RowDefinition Height=""*""/>
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:Price:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
private void LoadData()
{
if (FeesItem == null || FeesItem.ProcessComboTaskCount <= 0)
{
return;
}
try
{
App.Current.Dispatcher.Invoke(() =>
{
gd.Children.Clear();
});
var consumableList = FeesItem.ConsumableList;
var processCount = 4;
var consumableCount = consumableList.Count();
if (consumableCount > 0)
{
consumableCount++;
}
columnStr = columnStr.Replace("[:Width:]", "*");
var columnCount = consumableCount + processCount + 2;
StringBuilder columns = new StringBuilder();
for (int i = 1; i < columnCount; i++)
{
columns.AppendLine(columnStr);
}
StringBuilder serviceData = new StringBuilder();
int allCount = consumableCount + processCount;
serviceData.AppendLine(processComboStr.Replace("[:ProcessTypeName:]",$" {FeesItem.ProcessTypeName} " )
.Replace("[:ProcessComboName:]",$" {FeesItem.ProcessComboName} " )
.Replace("[:ProcessComboPrice:]", $"{FeesItem.ProcessComboPrice}*{FeesItem.ProcessComboTaskCount}")
);
serviceData.AppendLine(discountFactorStr.Replace("[:DiscountFactor:]", FeesItem.DiscountFoctor?.ToString()));
serviceData.AppendLine(processFeesStr.Replace("[:PackFees:]", FeesItem.PackFees.ToString("0.00")));
int rowIndex = 4;
if (consumableList.Count > 0)
{
foreach (var item in consumableList)
{
rowIndex++;
serviceData.AppendLine(incrementConsumableStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:ServiceName:]", $"{item.ItemName}")
.Replace("[:ServiceCount:]", $"{item.ItemPrice}*{item.ItemCount}"));
}
rowIndex++;
serviceData.AppendLine(totalIncrementConsumableStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:Price:]", $"{FeesItem.ConsumableFees}")
);
}
StringBuilder header = new StringBuilder();
if (processCount > 0)
{
header.AppendLine(workProcess);
}
if (consumableCount > 0)
{
header.AppendLine(consumableService);
}
decimal allFees = 0;
decimal discount = 0;
decimal discountFees = 0;
discount = FeesItem.disCount;
allFees = FeesItem.AllFees;
discountFees = allFees * discount;
string discountStr = "原价";
if (discount > 1)
discountStr = $"{discount.ToString("0.0")}倍";
if (discount < 1)
discountStr = $"{(discount * 10).ToString("0.0")}折";
var newGrid = xaml.Replace("[:Header:]", header.ToString())
.Replace("[:Columns:]", columns.ToString())
.Replace("[:ColumnCount:]", $"{columnCount}")
.Replace("[:ColumnCount-2:]", $"{columnCount - 2}")
.Replace("[:1+ProcessCount:]", $"{1 + processCount}")
.Replace("[:1+ProcessCount:+ConsumableCount]", $"{1 + processCount + consumableCount}")
.Replace("[:2+ProcessCount:+ConsumableCount]", $"{2 + processCount + consumableCount}")
.Replace("[:3+ProcessCount:+ConsumableCount]", $"{3 + processCount + consumableCount}")
.Replace("[:ProcessCount:]", $"{processCount}")
.Replace("[:ConsumableCount:]", $"{consumableCount}")
.Replace("[:TaskId:]", $"{FeesItem.TaskId}")
.Replace("[:ListData:]", serviceData.ToString())
.Replace("[:AllFees:]", $"{FeesItem.AllFees.ToString("0.00")}");
//.Replace("[:Discount:]", $"{FeesItem.DiscountFoctor}")
//.Replace("[:DiscountFees:]", $"{discountFees.ToString(" 0.00")}");
//
newGrid = newGrid.Replace(@"[:Visity:]", "");
var grid = XamlReader.Parse(newGrid) as Grid;
App.Current.Dispatcher.Invoke(() =>
{
gd.Children.Add(grid);
});
}
catch
{
}
}
}
}

111
BBWY.Client/Views/PackTask/MinFeesExcelControl.xaml.cs

@ -26,39 +26,6 @@ namespace BBWY.Client.Views.PackTask
InitializeComponent();
}
/// <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(MinFeesExcelControl), 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 bool IsMin
{
@ -109,18 +76,11 @@ namespace BBWY.Client.Views.PackTask
// control.Str
var newValue = e.NewValue as FeesItemResponse;
control.FeesItem = newValue;
if (control.IsWareHouse)
{
control.LoadData(false);
}
else
{
control.LoadData(true);
}
control.LoadData();
}
string xaml = @" <Grid xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
<Grid.ColumnDefinitions >
[:Columns:]
@ -153,10 +113,6 @@ namespace BBWY.Client.Views.PackTask
[:ListData:]
</Grid>";
/// <summary>
/// index 从1开始 0+1 增值服务 和打包耗材
/// </summary>
@ -171,9 +127,6 @@ namespace BBWY.Client.Views.PackTask
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string incrementConsumableStr = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
@ -184,16 +137,6 @@ namespace BBWY.Client.Views.PackTask
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
//string totalIncrementConsumableStr = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
// <Grid.RowDefinitions>
// <RowDefinition Height=""2*""/>
// <RowDefinition Height=""*""/>
// </Grid.RowDefinitions>
// <Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
// <TextBlock Text=""小计"" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
// <TextBlock Text=""[:Price:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
//</Grid>";
string basicPackStr = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition />
@ -261,8 +204,6 @@ namespace BBWY.Client.Views.PackTask
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""3"" BorderThickness=""0,0,1,0""/>
</Grid>";
string FeesModeStr = @"<Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
@ -282,40 +223,16 @@ namespace BBWY.Client.Views.PackTask
<TextBlock Text="" "" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:DiscountFactor:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
//string processFeesStr = @"
//<Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
// <Grid.RowDefinitions>
// <RowDefinition Height=""2*""/>
// <RowDefinition Height=""*""/>
// </Grid.RowDefinitions>
// <Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
// <TextBlock Text=""小计"" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
// <TextBlock Text=""[:PackFees:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
//</Grid>";
string columnStr = "<ColumnDefinition Width=\"auto\"/>";
//string increateService = @" <TextBlock Text=""增值服务"" Grid.Column=""1"" Grid.ColumnSpan=""2"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
// <Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Column=""[:1+IncreateCount:]"" Grid.Row=""0"" Grid.RowSpan=""4"" 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=\"4\" 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=\"4\" BorderThickness=\"1,0,0,0\"/>\r\n ";
private void LoadData(bool isPrice)
private void LoadData()
{
isPrice = false;
if (FeesItem == null || FeesItem.ServiceList.Count <= 0)
{
return;
@ -346,22 +263,9 @@ namespace BBWY.Client.Views.PackTask
var consumableList = FeesItem.ConsumableList;
if (packserviceCount > 0) packserviceCount += 2;
var processCount = packserviceCount;
var consumableCount = consumableList.Count();
var columnCount = consumableCount + processCount + 1;
StringBuilder columns = new StringBuilder();
for (int i = 0; i < columnCount; i++)
@ -492,8 +396,9 @@ namespace BBWY.Client.Views.PackTask
.Replace("[:TaskId:]", $"{FeesItem.TaskId}")
.Replace("[:ListData:]", serviceData.ToString())
.Replace("[:AllFees:]", $"{FeesItem.PackFees}");
//.Replace("[:Discount:]", $"{FeesItem.DiscountFoctor}")
//.Replace("[:DiscountFees:]", $"{discountFees.ToString(" 0.00")}");
if (IsMin)
{
newGrid = newGrid.Replace(@"MinWidth=""84""", "").Replace(@"[:Visity:]", "Width=\"0\"");

10
BBWY.Client/Views/PackTask/MinFeesExcelV2Control.xaml

@ -0,0 +1,10 @@
<UserControl x:Class="BBWY.Client.Views.PackTask.MinFeesExcelV2Control"
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="450" d:DesignWidth="800">
<Grid x:Name ="gd"/>
</UserControl>

347
BBWY.Client/Views/PackTask/MinFeesExcelV2Control.xaml.cs

@ -0,0 +1,347 @@
using BBWY.Client.Models.APIModel.Response.PackTask;
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.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// MinFeesExcelV2Control.xaml 的交互逻辑
/// </summary>
public partial class MinFeesExcelV2Control : UserControl
{
public MinFeesExcelV2Control()
{
InitializeComponent();
}
public FeesItemResponse FeesItem
{
get
{
return (FeesItemResponse)GetValue(FeesItemProperty);
}
set
{
SetValue(FeesItemProperty, value);
}
}
public static readonly DependencyProperty FeesItemProperty =
DependencyProperty.Register("FeesItem", typeof(FeesItemResponse), typeof(MinFeesExcelV2Control), new PropertyMetadata(ChangedProperty));
private static void ChangedProperty(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = d as MinFeesExcelV2Control;
var newValue = e.NewValue as FeesItemResponse;
control.FeesItem = newValue;
control.LoadData();
}
string xaml = @" <Grid xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
<Grid.ColumnDefinitions >
<ColumnDefinition Width=""0"" />
[:Columns:]
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
</Grid.RowDefinitions>
<Border Background=""#F2F2F2"" Grid.RowSpan=""3"" Grid.ColumnSpan=""[:ColumnCount:]""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Column=""0"" Grid.Row=""0"" Grid.RowSpan=""4"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Column=""1"" Grid.Row=""0"" Grid.RowSpan=""4"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Right"" BorderBrush=""#D7D7D7"" Grid.Column=""[:1+ProcessCount:+ConsumableCount]"" Grid.Row=""0"" Grid.RowSpan=""4"" 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=""2"" Grid.ColumnSpan=""[:ColumnCount:]"" BorderThickness=""0,1,0,0""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Column=""0"" Grid.Row=""3"" Grid.ColumnSpan=""[:ColumnCount:]"" BorderThickness=""0,1,0,0""/>
[:Header:]
<TextBlock MinWidth=""101"" TextAlignment=""Center"" Text="""" Grid.Column=""[:1+ProcessCount:+ConsumableCount]"" Grid.RowSpan=""3"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:TaskId:]"" Grid.Row=""3"" Grid.Column=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:AllFees:]"" Grid.Row=""3"" Grid.Column=""[:1+ProcessCount:+ConsumableCount]"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
[:ListData:]
</Grid>";
string processComboStr1 = @"<Grid Grid.Column=""1"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessTypeName:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.ColumnSpan=""2"" BorderThickness=""0,1,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.Column=""1"" Grid.RowSpan=""2"" BorderThickness=""1,0,0,0""/>
</Grid>
<Grid Grid.Column=""2"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" Grid.Column=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessComboName:]"" Grid.Row=""1"" Grid.Column=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.ColumnSpan=""2"" BorderThickness=""0,1,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""2"" BorderThickness=""1,0,0,0""/>
</Grid>
<TextBlock Text=""[:ProcessComboPrice:]"" Grid.Row=""3"" Grid.Column=""1"" Grid.ColumnSpan=""2"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>";
string processComboStr = @" <Grid Grid.Column=""1"" MinWidth=""168"" Grid.Row=""1"" Grid.RowSpan=""3"" Grid.ColumnSpan=""2"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="" "" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessTypeName:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text="" "" Grid.Row=""0"" Grid.Column=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessComboName:]"" Grid.Row=""1"" Grid.Column=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ProcessComboPrice:]"" Grid.Row=""3"" Grid.ColumnSpan=""2"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Height=""1"" VerticalAlignment=""Bottom"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.ColumnSpan=""2"" BorderThickness=""0,1,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.Column=""1"" Grid.RowSpan=""2"" BorderThickness=""1,0,0,0""/>
</Grid>";
string discountFactorStr = @" <Grid Grid.Column=""3"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
<RowDefinition Height=""*""/>
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:DiscountFactor:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string processFeesStr = @"
<Grid Grid.Column=""4"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
<RowDefinition Height=""*""/>
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:PackFees:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string columnStr = "<ColumnDefinition Width=\"[:Width:]\"/>";
string workProcess = "<TextBlock Text=\"包装服务\" Grid.Column=\"1\" Grid.ColumnSpan=\"[:ProcessCount:]\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"/>\r\n <Border Width=\"1\" HorizontalAlignment=\"Left\" BorderBrush=\"#D7D7D7\" Grid.Column=\"[:1+ProcessCount:]\" Grid.Row=\"0\" Grid.RowSpan=\"4\" BorderThickness=\"1,0,0,0\"/>\r\n ";
string consumableService = "<TextBlock Text=\"包装耗材\" Grid.Column=\"[:1+ProcessCount:]\" Grid.ColumnSpan=\"[:ConsumableCount:]\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"/>\r\n <Border Width=\"1\" HorizontalAlignment=\"Left\" BorderBrush=\"#D7D7D7\" Grid.Column=\"[:1+ProcessCount:+ConsumableCount]\" Grid.Row=\"0\" Grid.RowSpan=\"4\" BorderThickness=\"1,0,0,0\"/>\r\n ";
string incrementConsumableStr = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
<RowDefinition Height=""*""/>
</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 totalIncrementConsumableStr = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""2*""/>
<RowDefinition Height=""*""/>
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:Price:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
private void LoadData()
{
if (FeesItem == null || FeesItem.ProcessComboTaskCount <= 0)
{
return;
}
try
{
App.Current.Dispatcher.Invoke(() =>
{
gd.Children.Clear();
});
var consumableList = FeesItem.ConsumableList;
var processCount = 3;
var consumableCount = consumableList.Count();
columnStr = columnStr.Replace("[:Width:]", "auto");
var columnCount = consumableCount + processCount + 2;
StringBuilder columns = new StringBuilder();
for (int i = 1; i < columnCount; i++)
{
columns.AppendLine(columnStr);
}
StringBuilder serviceData = new StringBuilder();
int allCount = consumableCount + processCount;
serviceData.AppendLine(processComboStr.Replace("[:ProcessTypeName:]", $" {FeesItem.ProcessTypeName} ")
.Replace("[:ProcessComboName:]", $" {FeesItem.ProcessComboName} ")
.Replace("[:ProcessComboPrice:]", $"{FeesItem.ProcessComboPrice}*{FeesItem.ProcessComboTaskCount}")
);
serviceData.AppendLine(discountFactorStr.Replace("[:DiscountFactor:]", FeesItem.DiscountFoctor?.ToString()));
//serviceData.AppendLine(processFeesStr.Replace("[:PackFees:]", FeesItem.PackFees.ToString("0.00")));
int rowIndex = 3;
if (consumableList.Count > 0)
{
foreach (var item in consumableList)
{
rowIndex++;
serviceData.AppendLine(incrementConsumableStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:ServiceName:]", $"{item.ItemName}")
).Replace("[:ServiceCount:]", $"");//
}
rowIndex++;
//serviceData.AppendLine(totalIncrementConsumableStr.Replace("[:index:]", $"{rowIndex}")
// .Replace("[:Price:]", $"{FeesItem.ConsumableFees}")
// );
}
StringBuilder header = new StringBuilder();
if (processCount > 0)
{
header.AppendLine(workProcess);
}
if (consumableCount > 0)
{
header.AppendLine(consumableService);
}
decimal allFees = 0;
decimal discount = 0;
decimal discountFees = 0;
discount = FeesItem.disCount;
allFees = FeesItem.AllFees;
discountFees = allFees * discount;
string discountStr = "原价";
if (discount > 1)
discountStr = $"{discount.ToString("0.0")}倍";
if (discount < 1)
discountStr = $"{(discount * 10).ToString("0.0")}折";
var newGrid = xaml.Replace("[:Header:]", header.ToString())
.Replace("[:Columns:]", columns.ToString())
.Replace("[:ColumnCount:]", $"{columnCount}")
.Replace("[:ColumnCount-2:]", $"{columnCount - 2}")
.Replace("[:1+ProcessCount:]", $"{1 + processCount}")
.Replace("[:1+ProcessCount:+ConsumableCount]", $"{1 + processCount + consumableCount}")
.Replace("[:2+ProcessCount:+ConsumableCount]", $"{2 + processCount + consumableCount}")
.Replace("[:3+ProcessCount:+ConsumableCount]", $"{3 + processCount + consumableCount}")
.Replace("[:ProcessCount:]", $"{processCount}")
.Replace("[:ConsumableCount:]", $"{consumableCount}")
.Replace("[:TaskId:]", $"")
.Replace("[:ListData:]", serviceData.ToString())
.Replace("[:AllFees:]", $"{FeesItem.PackFees.ToString("0.00")}");//打包费用
newGrid = newGrid.Replace(@"[:Visity:]", "");
var grid = XamlReader.Parse(newGrid) as Grid;
App.Current.Dispatcher.Invoke(() =>
{
gd.Children.Add(grid);
});
}
catch
{
}
}
}
}

856
BBWY.Client/Views/PackTask/PackDetailWindow.xaml

@ -0,0 +1,856 @@
<c:BWindow x:Class="BBWY.Client.Views.PackTask.PackDetailWindow"
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="PackDetailWindow" Height="844" Width="500"
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"
xmlns:hc="https://handyorg.github.io/handycontrol"
CloseButtonVisibility="Visible"
WindowStartupLocation="CenterScreen"
CloseButtonColor="{StaticResource WindowButtonColor}"
DataContext="{Binding PackDetailVM,Source={StaticResource Locator}}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!--ResizeMode="NoResize"-->
<Window.Resources>
<DrawingBrush x:Key="DashBorderBrush">
<DrawingBrush.Drawing>
<GeometryDrawing Brush="Transparent">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,100,100"/>
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Thickness="2" Brush="Black"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<!--<Setter Property="Content" Value="{Binding ElementName=txt,Path=Text}"/>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="35" VerticalAlignment="Center" Width="{TemplateBinding Width}" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="35">
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Content}" />
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Tag}" Foreground="{StaticResource Text.Pink}" Margin="5 0 0 0" />
</StackPanel>
</Grid>
<ControlTemplate.Triggers>
<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>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="500"/>
<ColumnDefinition />
</Grid.ColumnDefinitions>
<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.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>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<ScrollViewer x:Name="scrolls" Grid.Row="0" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" Height="740">
<ScrollViewer.Content>
<StackPanel Orientation="Vertical" Grid.Row="1">
<StackPanel Orientation="Horizontal" Background="{StaticResource Border.Background}" Height="32">
<StackPanel.Resources>
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />
<!--<Setter Property="Content" Value="{Binding ElementName=txt,Path=Text}"/>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="#F2F2F2" >
<Rectangle x:Name="_Rect" Fill="#F2F2F2" HorizontalAlignment="Center" Height="32" VerticalAlignment="Center" Width="{TemplateBinding Width}" RenderTransformOrigin="0.5,0.5">
<Rectangle.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1"/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Rectangle.RenderTransform>
</Rectangle>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="35">
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Content}" />
<TextBlock VerticalAlignment="Center" Text="{TemplateBinding Tag}" Foreground="{StaticResource Text.Pink}" Margin="5 0 0 0" />
</StackPanel>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="_Rect" Property="Fill" Value="white" />
<Setter Property="Foreground" Value="#8080FF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</StackPanel.Resources>
<RadioButton Height="35" Width="110" VerticalAlignment="Center" Content="推荐工序" Command="{Binding SetTaskStateCommand}"
IsChecked="{Binding PackProcessType,Mode=TwoWay,Converter={StaticResource taskStateToBoolean},ConverterParameter=推荐工序:True:False}"
/>
<RadioButton Height="35" Width="110" VerticalAlignment="Center" Content="自定义工序" Command="{Binding SetTaskStateCommand}"
IsChecked="{Binding PackProcessType,Mode=TwoWay,Converter={StaticResource taskStateToBoolean},ConverterParameter=自定义工序:True:False}"
/>
</StackPanel>
<Grid Margin="20 10 20 10" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="包装工序" Margin="0 0 5 0" Style="{StaticResource middleTextBlock}" />
<Border Background="Black" Grid.Column="1" VerticalAlignment="Center" Height="1"/>
</Grid>
<!--推荐工序-->
<StackPanel Height="170" Visibility="{Binding PackProcessType,Mode=TwoWay,Converter={StaticResource taskStateToBoolean},ConverterParameter=推荐工序:Visible:Collapsed}">
<Grid Margin="20 5 20 0">
<Grid Height="100" >
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="56"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<TextBlock Text="耐摔等级:" Style="{StaticResource middleTextBlock}"/>
<Grid Margin="5" Grid.Column="1" Grid.ColumnSpan="3">
<Rectangle Stroke="{StaticResource Border.Brush}" StrokeThickness="1"/>
<ComboBox Margin="1" BorderThickness="0" Grid.Row="1" ItemsSource="{Binding ProductResistantList}" DisplayMemberPath="ProductResistantName" Text="{Binding SelectProductResistant}" />
</Grid>
<TextBlock Grid.Row="1" Text="套餐类型:" Style="{StaticResource middleTextBlock}"/>
<Grid Grid.Column="1" Grid.Row="1" Margin="5">
<Rectangle Stroke="{StaticResource Border.Brush}" StrokeThickness="1"/>
<ComboBox Margin="1" BorderThickness="0" Grid.Row="1" Grid.Column="1" ItemsSource="{Binding ProcessComboListV2}" DisplayMemberPath="ProcessComboName"
SelectedValuePath="ProcessComboId" SelectedValue="{Binding SelectProcessComboIdV2}"
Text="{Binding SelectProcessCombo}"/>
</Grid>
<!--<Border Margin="5" Grid.Column="1" Grid.Row="1" Background="{StaticResource Border.Brush}" >
<ComboBox Margin="1" BorderThickness="0" Grid.Row="1" Grid.Column="1" ItemsSource="{Binding ProcessComboList}" DisplayMemberPath="ProcessComboName"
SelectedValuePath="ProcessComboId" SelectedValue="{Binding SelectProcessComboId}"
Text="{Binding SelectProcessCombo}"/>
</Border>-->
<TextBlock Grid.Row="1" Text="任务量:" Grid.Column="2" Style="{StaticResource middleTextBlock}"/>
<c:BTextBox Margin="5 5 5 5" Grid.Column="3" Grid.Row="1" Text="{Binding ProcessTaskCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</Grid>
<Grid Margin="20,10,20,10">
<Rectangle Height="40" StrokeDashArray="8,4" StrokeThickness="1" Stroke="{StaticResource Border.Brush}" >
</Rectangle>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource middleTextBlock}" Margin="10 0 0 0">
<Run Text="工序单价:"/>
<Run Text="{Binding ProcessPrice}"/>
</TextBlock>
<TextBlock Style="{StaticResource middleTextBlock}" Margin="30 0 0 0">
<Run Text="原价:"/>
<Run Text="{Binding PackFees}"/>
</TextBlock>
<TextBlock Style="{StaticResource middleTextBlock}" Margin="30 0 0 0">
<Run Text="折扣系数:"/>
<Run Text="{Binding DiscountFactory}"/>
</TextBlock>
<TextBlock Style="{StaticResource middleTextBlock}" Margin="30 0 0 0">
<Run Text="折后价:"/>
<Run Text="{Binding PackDiscountFees}"/>
</TextBlock>
</StackPanel>
</Grid>
<!--<Border BorderThickness="1" Height="40" Margin="20,10,20,10" BorderBrush="{StaticResource Border.Brush}">
</Border>-->
</StackPanel>
<!--自定义工序-->
<StackPanel Height="170" Visibility="{Binding PackProcessType,Mode=TwoWay,Converter={StaticResource taskStateToBoolean},ConverterParameter=自定义工序:Visible:Collapsed}">
<Grid Margin="20 5 20 0">
<Grid Height="60" >
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition MinWidth="84"/>
<ColumnDefinition Width="66"/>
<ColumnDefinition Width="66"/>
</Grid.ColumnDefinitions>
<TextBlock Background="{StaticResource Border.Background}" Grid.ColumnSpan="4"/>
<TextBlock Text="工序类型" Style="{StaticResource middleTextBlock}" />
<TextBlock Text="套餐类型" Style="{StaticResource middleTextBlock}" Grid.Column="1" />
<TextBlock Text="工序单价" Style="{StaticResource middleTextBlock}" Grid.Column="2" />
<TextBlock Text="任务量" Style="{StaticResource middleTextBlock}" Grid.Column="3"/>
<Border VerticalAlignment="Top" Grid.ColumnSpan="4" Height="1" Background="{StaticResource Border.Brush}" Grid.Row="0" />
<Border VerticalAlignment="Bottom" Grid.ColumnSpan="4" Height="1" Background="{StaticResource Border.Brush}" />
<Border VerticalAlignment="Bottom" Grid.ColumnSpan="4" Height="1" Background="{StaticResource Border.Brush}" Grid.Row="1"/>
<Border HorizontalAlignment="Left" Grid.Column="0" Width="1" Background="{StaticResource Border.Brush}" Grid.RowSpan="2"/>
<Border HorizontalAlignment="Left" Grid.Column="1" Width="1" Background="{StaticResource Border.Brush}" Grid.RowSpan="2"/>
<Border HorizontalAlignment="Left" Grid.Column="2" Width="1" Background="{StaticResource Border.Brush}" Grid.RowSpan="2"/>
<Border HorizontalAlignment="Left" Grid.Column="3" Width="1" Background="{StaticResource Border.Brush}" Grid.RowSpan="2"/>
<Border HorizontalAlignment="Right" Grid.Column="3" Width="1" Background="{StaticResource Border.Brush}" Grid.RowSpan="2"/>
<ComboBox Margin="1" BorderThickness="0" Grid.Row="1" ItemsSource="{Binding ProcessTypeList}" DisplayMemberPath="ProcessTypeName" Text="{Binding SelectProcessType}" />
<ComboBox Margin="1" BorderThickness="0" Grid.Row="1" Grid.Column="1" ItemsSource="{Binding ProcessComboList}" DisplayMemberPath="ProcessComboName"
SelectedValuePath="ProcessComboId" SelectedValue="{Binding SelectProcessComboId}"
Text="{Binding SelectProcessCombo}"/>
<Grid Grid.Row="1" Grid.Column="2" Margin="1 0 1 1" Background="{StaticResource Border.Background}" >
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding ProcessPrice}" />
</Grid>
<TextBox BorderBrush="Transparent" BorderThickness="0" Margin="1" Grid.Row="1" Grid.Column="3" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding ProcessTaskCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</Grid>
</Grid>
<Grid Margin="20,10,20,10">
<Rectangle Height="40" StrokeDashArray="8,4" StrokeThickness="1" Stroke="{StaticResource Border.Brush}" >
</Rectangle>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource middleTextBlock}" Margin="30 0 0 0">
<Run Text="原价:"/>
<Run Text="{Binding PackFees}"/>
</TextBlock>
<TextBlock Style="{StaticResource middleTextBlock}" Margin="30 0 0 0">
<Run Text="折扣系数:"/>
<Run Text="{Binding DiscountFactory}"/>
</TextBlock>
<TextBlock Style="{StaticResource middleTextBlock}" Margin="30 0 0 0">
<Run Text="折后价:"/>
<Run Text="{Binding PackDiscountFees}"/>
</TextBlock>
</StackPanel>
</Grid>
<StackPanel Orientation="Horizontal" Margin="20 0 0 10">
<TextBlock Style="{StaticResource middleTextBlock}" Text="定制工序单价:"/>
<Border BorderThickness="1" CornerRadius="0" BorderBrush="{StaticResource Border.Brush}">
<TextBox BorderThickness="0" Width="100" Text="{Binding DirectionalSingleFees,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Border>
<c:BButton Content="确定" Width="60" Command="{Binding SetCustomProcessPriceCommand}"/>
</StackPanel>
</StackPanel>
<Grid Margin="20 10 20 0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="包装员" Margin="0 0 5 0" Style="{StaticResource middleTextBlock}" />
<Border Background="Black" Grid.Column="1" VerticalAlignment="Center" Height="1"/>
</Grid>
<TextBlock Margin="20 10 20 10">
<Run Text="推荐打包人:"/>
<Run Text="{Binding SuggestPackUserName}" Foreground="Red"/>
</TextBlock>
<Grid Margin="20 10 20 0">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Height="30" Background="{StaticResource Border.Background}" >
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<Border VerticalAlignment="Top" Grid.ColumnSpan="4" Height="1" Background="{StaticResource Border.Brush}" Grid.Row="0" />
<Border VerticalAlignment="Bottom" Grid.ColumnSpan="4" Height="1" Background="{StaticResource Border.Brush}" />
<Border HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="0" />
<Border HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="1" />
<Border HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="2"/>
<Border HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="3"/>
<Border HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="3"/>
<TextBlock Grid.Column="0" Text="打包人" Style="{StaticResource middleTextBlock}"/>
<TextBlock Grid.Column="1" Text="任务量" Style="{StaticResource middleTextBlock}"/>
<TextBlock Grid.Column="2" Text="操作" Style="{StaticResource middleTextBlock}"/>
</Grid>
<StackPanel Grid.Row="1" Orientation="Vertical" Background="Transparent">
<ListBox Name="basic_Listbox"
ItemsSource="{Binding PackUserModelList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="1,1,1,1"
Foreground="{StaticResource Text.Color}"
ScrollViewer.VerticalScrollBarVisibility="Auto"
>
<ListBox.ItemTemplate >
<DataTemplate>
<Grid Width="{Binding ActualWidth,ElementName=basic_Listbox,Converter={StaticResource widthConverter},ConverterParameter=-0}"
>
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="80"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="80"/>
</Grid.ColumnDefinitions>
<ComboBox BorderThickness="0" VerticalContentAlignment="Center" Grid.Column="0" ItemsSource="{Binding MemberList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" DisplayMemberPath="UserName" SelectedValuePath="Id" SelectedValue="{Binding SelectUserId}" Height="30"/>
<TextBox BorderThickness="0" VerticalContentAlignment="Center" Grid.Column="1" Height="30" Text="{Binding TaskCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<c:BButton Foreground="Blue" 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"/>
<Border HorizontalAlignment="Left" Margin="-1 0 0 0" Grid.Column="1" Width="1" Background="{StaticResource Border.Brush}"/>
<Border HorizontalAlignment="Left" Margin="-1 0 0 0" Grid.Column="2" Width="1" Background="{StaticResource Border.Brush}"/>
<Border HorizontalAlignment="Left" Margin="-1 0 0 0" Grid.Column="3" Width="1" Background="{StaticResource Border.Brush}"/>
<Border VerticalAlignment="Bottom" Grid.ColumnSpan="4" Height="1" Background="{StaticResource Border.Brush}" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<c:BButton Content="添加" Foreground="Blue" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Command="{Binding AddPackUserCommand}"
/>
</StackPanel>
</Grid>
<Grid Margin="20 10 20 0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="耗材项目" Margin="0 0 5 0" Style="{StaticResource middleTextBlock}" />
<Border Background="Black" Grid.Column="1" VerticalAlignment="Center" Height="1"/>
</Grid>
<Grid Margin=" 20 10 20 0">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Height="30" Background="{StaticResource Border.Background}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition/>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<Border VerticalAlignment="Top" Grid.ColumnSpan="5" Height="1" Background="{StaticResource Border.Brush}" Grid.Row="0" />
<Border VerticalAlignment="Bottom" Grid.ColumnSpan="5" Height="1" Background="{StaticResource Border.Brush}" />
<Border HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="0" />
<Border HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="1" />
<Border HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="2"/>
<Border HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="3"/>
<Border HorizontalAlignment="Left" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="4"/>
<Border HorizontalAlignment="Right" Background="{StaticResource Border.Brush}" Width="1" Grid.Column="4"/>
<TextBlock Grid.Column="0" Text="耗材类型" Style="{StaticResource middleTextBlock}"/>
<TextBlock Grid.Column="1" Text="耗材型号" Style="{StaticResource middleTextBlock}"/>
<TextBlock Grid.Column="2" Text="单价" Style="{StaticResource middleTextBlock}"/>
<StackPanel Orientation="Horizontal" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="数量" Style="{StaticResource middleTextBlock}" />
<Button BorderThickness="0" Content="批量" Margin="5 0 0 0" VerticalAlignment="Center" Background="Transparent" Foreground="Blue"
Command="{Binding SetAllCountCommand}"
CommandParameter="{Binding ElementName=consumable_listBox}"
/>
</StackPanel>
<TextBlock Grid.Column="4" Text="操作" Style="{StaticResource middleTextBlock}"/>
</Grid>
<StackPanel Grid.Row="1" Grid.ColumnSpan="3" Orientation="Vertical" >
<ListBox 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 Width="{Binding ActualWidth,ElementName=consumable_listBox,Converter={StaticResource widthConverter},ConverterParameter=-0}"
>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition/>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<ComboBox Margin="1" Grid.Column="0" BorderThickness="0" VerticalContentAlignment="Center" ItemsSource="{Binding ConsumableTypeList}" Text="{Binding ConsumableType}" Height="30"/>
<ComboBox Margin="1" Grid.Column="1" BorderThickness="0" VerticalContentAlignment="Center"
ItemsSource="{Binding ConsumableItemList}" Text="{Binding ConsumableItem}" DisplayMemberPath="ConsumableName"
SelectedValue="{Binding SelectId}" SelectedValuePath="ConsumableId" Height="30"/>
<Grid Grid.Column="2" Background="{StaticResource Border.Background}">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding ConsumablePrice}"/>
</Grid>
<TextBox Margin="1" BorderThickness="0" VerticalContentAlignment="Center" Grid.Column="3" Height="30" Text="{Binding TaskCount,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<c:BButton Foreground="Blue" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Command="{Binding DeleteServiceCommand}"
Visibility="{Binding DataContext.IsConsumableTypeListEnable,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type c:BWindow}},Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}, Path=ItemsSource}" Content="删除" Grid.Column="4"/>
<Border HorizontalAlignment="Left" Margin="-1 0 0 0" Grid.Column="1" Width="1" Background="{StaticResource Border.Brush}"/>
<Border HorizontalAlignment="Left" Margin="-1 0 0 0" Grid.Column="2" Width="1" Background="{StaticResource Border.Brush}"/>
<Border HorizontalAlignment="Left" Margin="-1 0 0 0" Grid.Column="3" Width="1" Background="{StaticResource Border.Brush}"/>
<Border HorizontalAlignment="Left" Margin="-1 0 0 0" Grid.Column="4" Width="1" Background="{StaticResource Border.Brush}"/>
<Border Visibility="Visible" VerticalAlignment="Bottom" Grid.ColumnSpan="5" Height="1" Background="{StaticResource Border.Brush}" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<c:BButton Content="添加" Foreground="Blue" BorderThickness="1" BorderBrush="{StaticResource Border.Brush}" Background="Transparent" HorizontalAlignment="Stretch"
Visibility="{Binding IsConsumableTypeListEnable,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}" Command="{Binding AddConsumableCommand}"
/>
</StackPanel>
</Grid>
<Grid Margin="20,10,20,10">
<Rectangle Height="40" StrokeDashArray="8,4" StrokeThickness="1" Stroke="{StaticResource Border.Brush}" >
</Rectangle>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource middleTextBlock}" Margin="10 0 0 0">
<Run Text="耗材收费:"/>
<Run Text="{Binding ConsumableFees}"/>
</TextBlock>
</StackPanel>
</Grid>
<!--<Border BorderThickness="1" Height="40" Margin="20,10,20,10" BorderBrush="{StaticResource Border.Brush}">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource middleTextBlock}" Margin="10 0 0 0">
<Run Text="耗材收费:"/>
<Run Text="{Binding ConsumableFees}"/>
</TextBlock>
</StackPanel>
</Border>-->
<Grid Margin="20 10 20 0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="其他设置" Margin="0 0 5 0" Style="{StaticResource middleTextBlock}" />
<Border Background="Black" Grid.Column="1" VerticalAlignment="Center" Height="1"/>
</Grid>
<Grid Grid.Row="1" HorizontalAlignment="Stretch" Margin="20 10 20 10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="45"/>
<ColumnDefinition/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Text="打印机: " VerticalAlignment="Center" HorizontalAlignment="Right"/>
<Border BorderThickness="1" CornerRadius="0" Grid.Column="1" BorderBrush="{StaticResource Border.Brush}" Height="30" >
<ComboBox Name="cbPrintName" BorderThickness="0" Height="30" HorizontalAlignment="Stretch" ItemsSource="{Binding PrintList}" Text="{Binding PrintName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</Border>
<c:BButton Grid.Column="2" Content="打印" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch"
Click="BButton_Click"
/>
</Grid>
</StackPanel>
</ScrollViewer.Content>
</ScrollViewer>
</Grid>
<Grid Grid.Row="1" Grid.Column="1" Visibility="Visible">
<StackPanel Orientation="Vertical" Name="printArea" Width="1065" Height="800">
<StackPanel Orientation="Horizontal">
<Grid Margin="20 5 0 0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="200">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Image Height="60" Width="200" Source="{Binding TaskImage}"/>
<TextBlock Grid.Row="1" FontSize="18" Style="{StaticResource middleTextBlock}" Text="{Binding TaskId}"/>
</Grid>
<TextBlock Text="摆放地托编号:" FontSize="24" FontWeight="Bold" Style="{StaticResource middleTextBlock}" Margin="20 0 0 0"/>
<TextBlock Text="{Binding FloorDragNumber}" FontSize="24" FontWeight="Bold" Style="{StaticResource middleTextBlock}" Margin="20 0 0 0"/>
<TextBlock Text="包装员:" FontSize="24" FontWeight="Bold" Style="{StaticResource middleTextBlock}" Margin="20 0 0 0"/>
<TextBlock Text="{Binding PackUserName}" FontSize="24" FontWeight="Bold" Style="{StaticResource middleTextBlock}" Margin="20 0 0 0"/>
<TextBlock Text="截止时间:" FontSize="24" FontWeight="Bold" Style="{StaticResource middleTextBlock}" Margin="20 0 0 0"/>
<TextBlock Text="{Binding PackTaskModel.PackCompletionOverTime,StringFormat=yyyy-MM-dd HH:mm}" FontSize="24" FontWeight="Bold" Style="{StaticResource middleTextBlock}" Margin="20 0 0 0"/>
</StackPanel>
<Grid Margin="20 5 20 5">
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition />
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="280"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="90"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="60"/>
<ColumnDefinition MinWidth="100"/>
</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="SKU配件商品" Grid.Column="3" Style="{StaticResource middleTextBlock}"/>
<TextBlock Text="打包需求" 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}"/>
<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 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"/>
<Border Height="1" VerticalAlignment="Top " Background="{StaticResource Border.Brush}" Grid.ColumnSpan="9"/>
</Grid>
<!--ItemsSource="{Binding OrderList}"-->
<ListBox x:Name="listbox_order"
Grid.Row="7"
ItemsSource="{Binding PackTaskList}"
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="100">
<Grid.RowDefinitions>
<RowDefinition MinHeight="90"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="280"/>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="90"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="80"/>
<ColumnDefinition Width="60"/>
<ColumnDefinition MinWidth="100"/>
</Grid.ColumnDefinitions>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--{Binding Logo}-->
<c:BAsyncImage UrlSource="{Binding ItemList[0].Logo}"
Width="80" DecodePixelWidth="80"
VerticalAlignment="Top" Margin="11,9,0,10"
Cursor="Hand">
</c:BAsyncImage>
<StackPanel Grid.Column="1" Orientation="Vertical" Margin="8,9,0,10">
<TextBlock Foreground="{StaticResource Text.Gray}" TextWrapping="Wrap">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding ItemList[0].SkuName}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="SKU名称:"/>
<Run Text="{Binding ItemList[0].SkuName}"/>
</TextBlock>
<TextBlock Foreground="{StaticResource Text.Gray}" TextWrapping="Wrap" Margin="0,11">
<Run Text="品名:"/>
<Run Text="{Binding ItemList[0].BrandName}"/>
</TextBlock>
<StackPanel Orientation="Horizontal">
<TextBlock Text="店铺:"/>
<c:BButton Content="{Binding ShopName}" Style="{StaticResource LinkButton}" HorizontalAlignment="Left" VerticalAlignment="Center"
Command="{Binding DataContext.CopyTextCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Page}}}"
CommandParameter="{Binding ShopName}"
Margin=" 5,0,7,0"/>
</StackPanel>
</StackPanel>
</Grid>
<Grid Grid.Column="1" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock x:Name="txt_storeName"
Text="{Binding SkuCount}"
TextWrapping="Wrap"
HorizontalAlignment="Center"
/>
</StackPanel>
</Grid>
<Grid Grid.Column="2" >
<StackPanel VerticalAlignment="Center" >
<StackPanel Margin="5" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock Text="组合类型:"/>
<TextBlock Text="{Binding PackType}"/>
</StackPanel>
<StackPanel Margin="5" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock Text="配件数量:"/>
<TextBlock Text="{Binding GoodsNumber}"/>
</StackPanel>
</StackPanel>
</Grid>
<Grid Grid.Column="3" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock
Text="{Binding SkuTitle}"
TextWrapping="Wrap"
HorizontalAlignment="Center"
/>
</StackPanel>
</Grid>
<Grid Grid.Column="4" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left">
<StackPanel Margin="5" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock Text="基础打包:"/>
<TextBlock Text="{Binding BasicPack}"/>
</StackPanel>
<Grid Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock TextWrapping="Wrap">
<Run Text="增量耗材:"/>
<Run Text="{Binding Increment1}"/>
</TextBlock>
</Grid>
</StackPanel>
</Grid>
<Grid Grid.Column="5" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock
Text="{Binding PositionType}"
TextWrapping="Wrap"
HorizontalAlignment="Center"
/>
</StackPanel>
</Grid>
<Grid Grid.Column="6" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock
Text="{Binding CertificatePosition}"
TextWrapping="Wrap"
HorizontalAlignment="Center"
/>
</StackPanel>
</Grid>
<Grid Grid.Column="7" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5 0 5 0">
<TextBlock
Text="{Binding ShowMarkMessage}"
TextWrapping="Wrap"
HorizontalAlignment="Center"
/>
</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 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" />
</Grid>
<Border Grid.Row="1" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<local:MinFeesExcelV2Control Margin="20 0 20 0"
Visibility="{Binding PackTaskModel.IsShowFees,Converter={StaticResource objConverter},ConverterParameter=false:Collapsed:Visible}"
FeesItem="{Binding PackTaskModel.FeesItemResponse,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
/>
<StackPanel Orientation="Horizontal" Margin="20 0 0 0" Visibility="{Binding PackTaskModel.CertificateModel,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}">
<ListBox ItemsSource="{Binding PackTaskModel.CertificateModel,Mode=TwoWay}"
Style="{StaticResource NoScrollViewListBoxStyle}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<local:MinCerControl model="{Binding }"
Visibility="{Binding Id ,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=0:Collapsed:Visible}"
/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
<local:MinBarcodeControl Grid.Row="1" BarcodeImage="{Binding BarcodeImage,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" model="{Binding PackTaskModel.BarCodeModel, Mode=TwoWay}" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20 0 0 0" Width="250" Height="190"
Visibility="{Binding PackTaskModel.BarCodeModel,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
/>
</StackPanel>
</Grid>
<Border Height="1" Background="{StaticResource Border.Brush}" VerticalAlignment="Top" Grid.Row="2"/>
<Grid Grid.Row="2" >
<StackPanel HorizontalAlignment="Left" Margin="20 0 0 0" VerticalAlignment="Center" >
<TextBlock Style="{StaticResource middleTextBlock}">
<Run Text="总收费:"/>
<Run Text="{Binding AllFees}"/>
</TextBlock>
</StackPanel>
<c:BButton Grid.Row="2" Content="确定" Margin="0 0 20 0" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch"
Command="{Binding UpLoadPackCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
/>
</Grid>
</Grid>
</c:BWindow>

107
BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs

@ -0,0 +1,107 @@
using BBWY.Client.Helpers;
using BBWY.Client.Models;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.IO;
using System.Printing;
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.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// PackDetailWindow.xaml 的交互逻辑
/// </summary>
public partial class PackDetailWindow : BWindow
{
public PackDetailWindow(PackTaskModel model, Action reflashWindow)
{
InitializeComponent();
var serviceViewModel = this.DataContext as PackDetailViewModel;
//加载数据
if (model.BarCodeModel != null)
{
model.BarCodeModel.ShopName = model.ShopName;
}
serviceViewModel.PackTaskModel = model;
serviceViewModel.PackTaskList = new System.Collections.ObjectModel.ObservableCollection<PackTaskModel> { model};
serviceViewModel.FloorDragNumber = model.FloorDragNumber;
serviceViewModel.TaskCount = model.SkuCount;
serviceViewModel.TaskId = model.TaskId;
serviceViewModel.OrderId = model.OrderId;
serviceViewModel.SkuId = model.SkuId;
serviceViewModel.PackUserName = model.PackUser?.Replace("\r\n", ",")?.Replace("\n", ",")?.Replace("\r", ",");
serviceViewModel.LoadPackDatas();
if (reflashWindow != null)
serviceViewModel.ReflashWindow = reflashWindow;
}
private void BButton_Click(object sender, RoutedEventArgs e)
{
//return;//禁用打印
var localPrintServer = new LocalPrintServer();
string printName = cbPrintName.Text.Trim();
if (string.IsNullOrEmpty(printName))
{
System.Windows.MessageBox.Show("选择打印机");
return;
}
var printQueue = localPrintServer.GetPrintQueue(printName);
if (printQueue.IsInError)
{
System.Windows.MessageBox.Show("打印机处于错误状态");
return;
}
MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机
System.Windows.Controls.PrintDialog printDialog = new PrintDialog();
printDialog.PrintTicket.PageOrientation = PageOrientation.Landscape;//设置为横向打印 PageOrientation.Landscape Portrait为纵向
//设置纸张大小
var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth);
var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight);
printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight);
//printArea.Height = pageHeight;//833
//printArea.Width = pageWidth;//1123
this.printArea.Arrange(new Rect(new Point(0, 0), new Size(printArea.ActualWidth, printArea.ActualHeight)));
printDialog.PrintVisual(this.printArea, "打印任务");
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string printNames = System.IO.Path.Combine(applicationPath, "printName.init");
try
{
if (File.Exists(printNames))
{
File.Delete(printNames);
}
}
catch
{
}
File.WriteAllText(printNames, cbPrintName.Text);
}
}
}

69
BBWY.Client/Views/PackTask/PrintPackTaskDetail.xaml

@ -0,0 +1,69 @@
<Window x:Class="BBWY.Client.Views.PackTask.PrintPackTaskDetail"
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="PrintPackTaskDetail" Height="492" Width="272">
<Grid x:Name="print_box">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="110"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Width="110" Stretch="Fill" Source="{Binding PurchaseOrderImage}"/>
<StackPanel VerticalAlignment="Top" Grid.Column="1">
<TextBlock Text="云仓" HorizontalAlignment="Center" FontWeight="Bold" FontSize="30"/>
<Image Height="40" Stretch="Fill" />
<TextBlock Style="{StaticResource middleTextBlock}" Text="10001"/>
</StackPanel>
</Grid>
<StackPanel Orientation="Vertical" Grid.Row="1">
<TextBlock Margin="0 5 0 5">
<Run Text="SKU名称:"/>
<Run Text="{Binding PackTaskModel.ItemList[0].SkuName}"/>
</TextBlock>
<TextBlock>
<Run Text="品名:"/>
<Run Text="{Binding PackTaskModel.ItemList[0].BrandName}"/>
</TextBlock>
<TextBlock Margin="0 5 0 5">
<Run Text="SKU数量:"/>
<Run Text="1234567"/>
</TextBlock>
<TextBlock>
<Run Text="SKU名称:"/>
<Run Text="1234567"/>
</TextBlock>
<TextBlock Margin="0 5 0 5">
<Run Text="SKU名称:"/>
<Run Text="1234567"/>
</TextBlock>
<Image Margin="10 10 10 0" Stretch="Fill" Source="/resources/images/barcode.png"/>
<TextBlock Margin="0 0 0 5" Style="{StaticResource middleTextBlock}" >
<Run Text="POP"/>
<Run Text="123456789789"/>
</TextBlock>
<Border Height="2" BorderThickness="1" BorderBrush="Black"/>
<TextBlock Margin="0 5 0 5">
<Run Text="SKU名称:"/>
<Run Text="1234567"/>
</TextBlock>
<TextBlock>
<Run Text="SKU名称:"/>
<Run Text="1234567"/>
</TextBlock>
<TextBlock Margin="0 5 0 5">
<Run Text="SKU名称:"/>
<Run Text="1234567"/>
</TextBlock>
</StackPanel>
</Grid>
</Grid>
</Window>

81
BBWY.Client/Views/PackTask/PrintPackTaskDetail.xaml.cs

@ -0,0 +1,81 @@
using BBWY.Client.Helpers;
using BBWY.Client.Models;
using BBWY.Client.Models.FallWare;
using System;
using System.Collections.Generic;
using System.Printing;
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.Shapes;
namespace BBWY.Client.Views.PackTask
{
/// <summary>
/// PrintPackTaskDetail.xaml 的交互逻辑
/// </summary>
public partial class PrintPackTaskDetail : Window
{
public PrintPackTaskDetail(PackTaskModel model)
{
InitializeComponent();
PackTaskModel = model;
this.DataContext = this;
this.UpdateLayout();//刷新UI
}
public PackTaskModel PackTaskModel { get; set; }
public void PrintBox(string printName)
{
var localPrintServer = new LocalPrintServer();
if (string.IsNullOrEmpty(printName))
{
return;
}
var printQueue = localPrintServer.GetPrintQueue(printName);
if (printQueue.IsInError)
{
System.Windows.MessageBox.Show("打印机处于错误状态");
return;
}
MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机
PrintDialog printDialog = new PrintDialog();
printDialog.PrintTicket.PageOrientation = PageOrientation.Landscape;//设置为横向打印 PageOrientation.Landscape Portrait为纵向
//设置纸张大小
var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth);
var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight);
printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight);
this.Height = pageHeight + 39;//833
this.Width = pageWidth;//1123
this.FontSize = 30;
// box_margin.Margin = new Thickness(50, 50, 50, 50);
//box_margin.Margin = new Thickness(10);
//this.jd_box.Arrange(new Rect(new Point(0, 0), new Size(pageWidth, pageHeight)));
this.UpdateLayout(); //刷新界面
printDialog.PrintVisual(this.print_box, "打印任务");
//var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
//string printNames = System.IO.Path.Combine(applicationPath, "printName.init");
//if (File.Exists(printNames))
//{
// File.Delete(printNames);
//}
//System.IO.File.WriteAllText(printNames, printName);
this.Close();
}
}
}

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

@ -421,7 +421,7 @@
<Grid Grid.Row="1" Grid.Column="1" Visibility="Hidden">
<Grid Grid.Row="1" Grid.Column="1" Visibility="Visible">
<StackPanel Orientation="Vertical" Name="printArea" Width="1065" Height="800">
<StackPanel Orientation="Horizontal">

8
BBWY.Client/Views/PackTask/UpdatePurchaseTaskWindow.xaml

@ -260,7 +260,7 @@
<ColumnDefinition Width="90"/>
<ColumnDefinition Width="140"/>
<ColumnDefinition Width="86"/>
<ColumnDefinition Width="86"/>
<ColumnDefinition Width="0"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
@ -287,7 +287,7 @@
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="3" Text="基础包装"/>
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="4" Text="增量耗材"/>
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="5" Text="条码标签"/>
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="6" Text="合格证"/>
<!--<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="6" Text="合格证"/>-->
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="7" Text="合格证位置"/>
@ -334,11 +334,11 @@
</ComboBox>
</Grid>
<Grid Grid.Row="1" Grid.Column="6" >
<!--<Grid Grid.Row="1" Grid.Column="6" >
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding IsNeedCerList}" Text="{Binding IsNeedCertificateModel,Mode=TwoWay}">
</ComboBox>
</Grid>
</Grid>-->
<Grid Grid.Row="1" Grid.Column="7" >
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding CertificatePositionList}" Text="{Binding CertificatePosition}">

30
BBWY.Client/Views/PackTask/WaitPackageControl.xaml

@ -30,18 +30,22 @@
<StackPanel Panel.ZIndex="100" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="590,15,0,0"
Visibility="{Binding SelectShop,Mode=OneWay,Converter={StaticResource objConverter},ConverterParameter=部门:Visible:Collapsed}"
>
<c:BTextBox x:Name="tb" Width="150" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="部门名称"></c:BTextBox>
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="SelectionChangeCommand" Background="{StaticResource Border.Background}">
<c:BTextBox x:Name="tb" Width="150" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="部门名称"
/>
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="SelectionChangeCommand" Background="{StaticResource Border.Background}"/>
</ListBox>
</StackPanel>
<StackPanel Panel.ZIndex="100" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="590,15,0,0"
Visibility="{Binding SelectShop,Mode=OneWay,Converter={StaticResource objConverter},ConverterParameter=店铺:Visible:Collapsed}"
>
<c:BTextBox x:Name="tbShop" Width="150" Height="30" TextChanged="tbShop_TextChanged" Text="{Binding SearchShopName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="店铺名称"></c:BTextBox>
<ListBox MaxHeight="300" x:Name="tipBoxShop" SelectionChanged="tipBoxShop_SelectionChanged" Background="{StaticResource Border.Background}">
<c:BTextBox x:Name="tbShop" Width="150" Height="30" TextChanged="tbShop_TextChanged" Text="{Binding SearchShopName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="店铺名称"
/>
<ListBox MaxHeight="300" x:Name="tipBoxShop" SelectionChanged="tipBoxShop_SelectionChanged" Background="{StaticResource Border.Background}"/>
</ListBox>
</StackPanel>
<Grid>
<Grid.RowDefinitions>
@ -518,8 +522,14 @@
>
<Path.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<local:FeesExcelControl IsWareHouse="True" FeesItem="{Binding FeesItemResponse,Mode=TwoWay,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"
/>
<Grid>
<local:FeesExcelControl FeesItem="{Binding FeesItemResponse,Mode=TwoWay,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding PackProcessType,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
/>
<local:FeesExcelV2Control FeesItem="{Binding FeesItemResponse,Mode=TwoWay,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding PackProcessType,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
/>
</Grid>
</ToolTip>
</Path.ToolTip>
</Path>
@ -618,7 +628,7 @@
<c:BButton HorizontalAlignment="Center" Height="20" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Grid.Row="1"
Content="{Binding FeesItemResponse,Converter={StaticResource objConverter},ConverterParameter=#null:打包设置:修改设置 }"
Command="{Binding SetServiceCommand}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待打包|待排单:Visible:Collapsed}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=已取消|未到货|部分到货|待验收|:Collapsed:Visible}"
/>
<c:BButton HorizontalAlignment="Center" Style="{StaticResource LinkButton}" Height="20" Margin="0 5 0 5 " VerticalAlignment="Center" Grid.Row="1" Content="验收"
@ -654,7 +664,7 @@
Command="{Binding DataContext.StoreGetBySelfCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待排单|待打包:Visible:Collapsed}"
/>
<hc:SplitButton Content="更多操作" Foreground="{StaticResource Button.Background}" BorderThickness="0" HitMode="Hover" HorizontalAlignment="Stretch">
<hc:SplitButton Content="更多操作" Foreground="{StaticResource Button.Background}" BorderThickness="0" HorizontalAlignment="Stretch">
<hc:SplitButton.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

33
BBWY.Client/Views/PackTask/WaitPackageControl.xaml.cs

@ -213,6 +213,39 @@ namespace BBWY.Client.Views.PackTask
{
}
}
private void tb_LostFocus(object sender, RoutedEventArgs e)
{
try
{
if (tipBox != null && tipBox.Items.Count > 0)
{
tipBox.Items.Clear();
}
}
catch (Exception)
{
}
}
private void tbShop_LostFocus(object sender, RoutedEventArgs e)
{
try
{
if (tipBoxShop != null && tipBoxShop.Items.Count > 0)
{
tipBoxShop.Items.Clear();
}
}
catch (Exception)
{
}
}
}

20
BBWY.Client/Views/PackTask/WareHouseListControl.xaml

@ -33,7 +33,9 @@
<StackPanel Panel.ZIndex="100" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="590,15,0,0"
Visibility="{Binding SelectShop,Mode=OneWay,Converter={StaticResource objConverter},ConverterParameter=部门:Visible:Collapsed}"
>
<c:BTextBox x:Name="tb" Width="150" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="部门名称"></c:BTextBox>
<c:BTextBox x:Name="tb" Width="150" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="部门名称"
/>
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="SelectionChangeCommand" Background="{StaticResource Border.Background}">
</ListBox>
@ -41,7 +43,9 @@
<StackPanel Panel.ZIndex="100" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="590,15,0,0"
Visibility="{Binding SelectShop,Mode=OneWay,Converter={StaticResource objConverter},ConverterParameter=店铺:Visible:Collapsed}"
>
<c:BTextBox x:Name="tbShop" Width="150" Height="30" TextChanged="tbShop_TextChanged" Text="{Binding SearchShopName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="店铺名称"></c:BTextBox>
<c:BTextBox x:Name="tbShop" Width="150" Height="30" TextChanged="tbShop_TextChanged" Text="{Binding SearchShopName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="店铺名称"
/>
<ListBox MaxHeight="300" x:Name="tipBoxShop" SelectionChanged="tipBoxShop_SelectionChanged" Background="{StaticResource Border.Background}">
</ListBox>
@ -488,8 +492,16 @@
<Path.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<local:FeesExcelControl IsWareHouse="True" FeesItem="{Binding FeesItemResponse,Mode=TwoWay,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"
/>
<Grid>
<local:FeesExcelControl FeesItem="{Binding FeesItemResponse,Mode=TwoWay,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding PackProcessType,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
/>
<local:FeesExcelV2Control FeesItem="{Binding FeesItemResponse,Mode=TwoWay,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding PackProcessType,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
/>
</Grid>
</ToolTip>
</Path.ToolTip>
</Path>

34
BBWY.Client/Views/PackTask/WareHouseListControl.xaml.cs

@ -215,6 +215,40 @@ namespace BBWY.Client.Views.PackTask
{
}
}
private void tb_LostFocus(object sender, RoutedEventArgs e)
{
try
{
if (tipBox != null && tipBox.Items.Count > 0)
{
tipBox.Items.Clear();
}
}
catch (Exception)
{
}
}
private void tbShop_LostFocus(object sender, RoutedEventArgs e)
{
try
{
if (tipBoxShop != null && tipBoxShop.Items.Count > 0)
{
tipBoxShop.Items.Clear();
}
}
catch (Exception)
{
}
}
}

188
BBWY.Client/Views/QualityTask/WaitQualityControl.xaml

@ -29,15 +29,19 @@
<StackPanel Panel.ZIndex="100" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="590,15,0,0"
Visibility="{Binding SelectShop,Mode=OneWay,Converter={StaticResource objConverter},ConverterParameter=部门:Visible:Collapsed}"
>
<c:BTextBox x:Name="tb" Width="150" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="部门名称"></c:BTextBox>
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="SelectionChangeCommand" Background="{StaticResource Border.Background}">
<c:BTextBox x:Name="tb" Width="150" Height="30" TextChanged="tb_TextChanged" Text="{Binding SearchDepartment,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="部门名称"
/>
<ListBox MaxHeight="300" x:Name="tipBox" SelectionChanged="SelectionChangeCommand" Background="{StaticResource Border.Background}"/>
</ListBox>
</StackPanel>
<StackPanel Panel.ZIndex="100" HorizontalAlignment="Left" VerticalAlignment="Top" Orientation="Vertical" Margin="590,15,0,0"
Visibility="{Binding SelectShop,Mode=OneWay,Converter={StaticResource objConverter},ConverterParameter=店铺:Visible:Collapsed}"
>
<c:BTextBox x:Name="tbShop" Width="150" Height="30" TextChanged="tbShop_TextChanged" Text="{Binding SearchShopName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="店铺名称"></c:BTextBox>
<c:BTextBox x:Name="tbShop" Width="150" Height="30" TextChanged="tbShop_TextChanged" Text="{Binding SearchShopName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" WaterRemark="店铺名称"
/>
<ListBox MaxHeight="300" x:Name="tipBoxShop" SelectionChanged="tipBoxShop_SelectionChanged" Background="{StaticResource Border.Background}">
</ListBox>
@ -169,7 +173,7 @@
<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}"/>
@ -249,21 +253,8 @@
</StackPanel>
<!--<StackPanel Orientation="Horizontal" Visibility="{Binding QualityRemainTime, Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}">
<TextBlock Foreground="Red" VerticalAlignment="Center" Text="{Binding QualityRemainTime}" Margin="20,0,0,0" />
</StackPanel>-->
</StackPanel>
<!--<StackPanel Grid.Column="12" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
<c:BButton Command="{Binding DataContext.DeletedTaskCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" CommandParameter="{Binding}"
Style="{StaticResource LinkButton}" Content="取消任务" Margin="0 5 0 5 "
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货|待验收:Visible:Collapsed}"
/>
</StackPanel>-->
<StackPanel Grid.Column="12" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货|待验收:Visible:Collapsed}"
>
@ -452,9 +443,9 @@
</Grid>
<Grid Grid.Column="5" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock
<TextBlock
Text="{Binding PositionType}"
TextWrapping="Wrap"
HorizontalAlignment="Center"
@ -462,43 +453,55 @@
</StackPanel>
</Grid>
</StackPanel>
</Grid>
<Grid Grid.Column="6" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="{Binding SendToSetSkuConfigureTime,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="{Binding QualityRemainTime,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
>
<StackPanel Margin="10,5" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"
<StackPanel Margin="10,5" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="{Binding IsQualityOverTime,Converter={StaticResource objConverter},ConverterParameter=false:Visible:Collapsed}"
>
<TextBlock Text="剩余: " />
<TextBlock Text="{Binding QualityRemainTime}"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="10,5" VerticalAlignment="Center" HorizontalAlignment="Center"
<TextBlock Text="剩余: " />
<TextBlock Text="{Binding QualityRemainTime}"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="10,5" VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="{Binding IsQualityOverTime,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed}">
<StackPanel Orientation="Horizontal"
<StackPanel Orientation="Horizontal"
>
<TextBlock Foreground="Red" Text="超时: "/>
<TextBlock Foreground="Red" Text="{Binding QualityRemainTime}"/>
</StackPanel>
<c:BButton Margin="0 10 0 0" Content="{Binding QualityOverTimeMarkMsg ,Converter={StaticResource objConverter},ConverterParameter=#null:提交备注:修改备注}" Style="{StaticResource LinkButton}"
<TextBlock Foreground="Red" Text="超时: "/>
<TextBlock Foreground="Red" Text="{Binding QualityRemainTime}"/>
</StackPanel>
<c:BButton Margin="0 10 0 0" Content="{Binding QualityOverTimeMarkMsg ,Converter={StaticResource objConverter},ConverterParameter=#null:提交备注:修改备注}" Style="{StaticResource LinkButton}"
>
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.SubmitOverTimeMarkMsgCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="TaskId"/>
<Binding Path="QualityOverTimeMarkMsg"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BButton>
<b:Interaction.Triggers>
<b:EventTrigger EventName="PreviewMouseLeftButtonDown">
<b:InvokeCommandAction Command="{Binding DataContext.SubmitOverTimeMarkMsgCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}">
<b:InvokeCommandAction.CommandParameter>
<MultiBinding Converter="{StaticResource mptConverter}">
<Binding Path="TaskId"/>
<Binding Path="QualityOverTimeMarkMsg"/>
</MultiBinding>
</b:InvokeCommandAction.CommandParameter>
</b:InvokeCommandAction>
</b:EventTrigger>
</b:Interaction.Triggers>
</c:BButton>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"
Visibility="{Binding SendToSetSkuConfigureTime,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}">
<TextBlock Style="{StaticResource middleTextBlock}" Text="待合格证信息补全"/>
</StackPanel>
</Grid>
<!--<Grid Grid.Column="6" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
@ -558,72 +561,39 @@
</StackPanel>
</StackPanel>
</Grid>
<!--<Grid Grid.Column="10">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<StackPanel Margin="20,0,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock Text="收费:"/>
<TextBlock
Text="{Binding FeesItemResponse.AllFees, StringFormat={}{0:F2}}"
TextWrapping="Wrap"
HorizontalAlignment="Center"
/>
<Path x:Name="path_fees_name"
Style="{StaticResource path_question}"
Width="14" Margin="0,0,0,0" Fill="{StaticResource Text.Pink}"
ToolTipService.InitialShowDelay="0" ToolTipService.ShowDuration="20000"
Visibility="{Binding FeesItemResponse,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible }"
>
<Path.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<local:FeesExcelControl IsWareHouse="True" FeesItem="{Binding FeesItemResponse,Mode=TwoWay,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"
/>
</ToolTip>
</Path.ToolTip>
</Path>
</StackPanel>
<Grid Grid.Row="1" Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货|待验收|已取消|商家自取:Collapsed:Visible}">
<Border Grid.Row="0" VerticalAlignment="Top" Height="1" Background="{StaticResource Border.Brush}"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
>
<c:BButton HorizontalAlignment="Center" Height="20" Style="{StaticResource LinkButton}" VerticalAlignment="Center" Grid.Row="1" Content="设置"
Command="{Binding SetServiceCommand}"
Visibility="Visible" />
</StackPanel>
</Grid>
</Grid>
</Grid>-->
<!--<Grid Grid.Column="8" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock
Text="{Binding PackUser}"
TextWrapping="Wrap"
HorizontalAlignment="Center"
/>
</StackPanel>
</Grid>-->
<Grid Grid.Column="12" >
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<c:BButton HorizontalAlignment="Center" Style="{StaticResource LinkButton}" Height="20" Margin="0 5 0 5 " VerticalAlignment="Center" Grid.Row="1" Content="验收"
Command="{Binding QualityTaskCommand}"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收:Visible:Collapsed}"
/>
<!--Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=待验收:Visible:Collapsed}" -->
<StackPanel >
<StackPanel.Visibility>
<MultiBinding Converter="{StaticResource mobjConverter}"
ConverterParameter="9;待验收:&amp;:Visible:Collapsed:1">
<Binding Path="ShopId"/>
<Binding Path="TaskState"/>
</MultiBinding>
</StackPanel.Visibility>
<c:BButton HorizontalAlignment="Center" Style="{StaticResource LinkButton}" Height="20" Margin="0 5 0 5 " VerticalAlignment="Center" Grid.Row="1" Content="信息不全"
CommandParameter="{Binding }"
Command="{Binding DataContext.SendToSetSkuConfigureCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
>
<c:BButton.Visibility>
<MultiBinding Converter="{StaticResource mobjConverter}"
ConverterParameter=";:amp;:Visible:Collapsed:1">
<Binding Path="BarCodeModel"/>
<Binding Path="CertificateModel"/>
</MultiBinding>
</c:BButton.Visibility>
</c:BButton>
</StackPanel>
<c:BButton HorizontalAlignment="Center" Style="{StaticResource LinkButton}" Height="20" Margin="0 5 0 5 " VerticalAlignment="Center" Grid.Row="1" Content="商家自取"
CommandParameter="{Binding TaskId}"
@ -679,8 +649,8 @@
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Grid>
</Grid>
</UserControl>

34
BBWY.Client/Views/QualityTask/WaitQualityControl.xaml.cs

@ -213,6 +213,40 @@ namespace BBWY.Client.Views.QualityTask
{
}
}
private void tb_LostFocus(object sender, RoutedEventArgs e)
{
try
{
if (tipBox != null && tipBox.Items.Count > 0)
{
tipBox.Items.Clear();
}
}
catch (Exception)
{
}
}
private void tbShop_LostFocus(object sender, RoutedEventArgs e)
{
try
{
if (tipBoxShop != null && tipBoxShop.Items.Count > 0)
{
tipBoxShop.Items.Clear();
}
}
catch (Exception)
{
}
}
}

Loading…
Cancel
Save