Browse Source

1

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
f8a3571641
  1. 8
      BBWY.Client/APIServices/PackDetailService.cs
  2. 51
      BBWY.Client/APIServices/PackTaskService.cs
  3. 3
      BBWY.Client/App.xaml
  4. 2
      BBWY.Client/App.xaml.cs
  5. 99
      BBWY.Client/Models/APIModel/Response/PackTask/FeesItemResponse.cs
  6. 49
      BBWY.Client/Models/APIModel/Response/PackTask/PackServiceResponse.cs
  7. 9
      BBWY.Client/Models/Enums.cs
  8. 4
      BBWY.Client/Models/PackTask/PackItemModel.cs
  9. 9
      BBWY.Client/Models/PackTask/PackTaskModel.cs
  10. 918
      BBWY.Client/ViewModels/PackTask/PackServiceViewModel.cs
  11. 7
      BBWY.Client/ViewModels/ViewModelLocator.cs
  12. 222
      BBWY.Client/Views/PackTask/FeesExcelControl.xaml
  13. 402
      BBWY.Client/Views/PackTask/FeesExcelControl.xaml.cs
  14. 11
      BBWY.Client/Views/PackTask/MinFeesExcelControl.xaml
  15. 526
      BBWY.Client/Views/PackTask/MinFeesExcelControl.xaml.cs
  16. 2
      BBWY.Client/Views/PackTask/PublishTaskWindow.xaml
  17. 921
      BBWY.Client/Views/PackTask/ServiceWindow.xaml
  18. 9
      BBWY.Client/Views/PackTask/ServiceWindow.xaml.cs
  19. 11
      BBWY.Client/Views/PackTask/SetBarCode.xaml.cs
  20. 20
      BBWY.Client/Views/PackTask/SetCerWindow.xaml.cs
  21. 1
      BBWY.Client/Views/PackTask/WareHouseList.xaml
  22. 4
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml

8
BBWY.Client/APIServices/PackDetailService.cs

@ -14,16 +14,16 @@ namespace BBWY.Client.APIServices
{
}
public ApiResponse<PackServiceResponse> GetTaskService(long TaskId)
public ApiResponse<PackServiceResponse> GetPackTaskDetail(long TaskId)
{
return SendRequest<PackServiceResponse>(globalContext.QKApiHost, $"api/PackDetail/GetTaskService?taskId={TaskId}",
return SendRequest<PackServiceResponse>(globalContext.QKApiHost, $"api/PackDetail/GetPackTaskDetail?taskId={TaskId}",
null
, null, HttpMethod.Get);
}
public ApiResponse<object> UploadService(UploadServiceRequest consumable)
public ApiResponse<object> SetPackTaskDetail(PackTaskDetailRequest consumable)
{
return SendRequest<object>(globalContext.QKApiHost, "api/PackDetail/UploadService",
return SendRequest<object>(globalContext.QKApiHost, "api/PackDetail/SetPackTaskDetail",
consumable
, null, HttpMethod.Post);
}

51
BBWY.Client/APIServices/PackTaskService.cs

@ -360,6 +360,47 @@ namespace BBWY.Client.APIServices
public long[] ConsumableIds { get; set; }
}
public class PackTaskDetailRequest
{ /// <summary>
/// 任务id
/// </summary>
public long TaskId { get; set; }
/// <summary>
/// 定向收费
/// </summary>
public decimal? DirectionalFees { get; set; }
/// <summary>
/// 增量配件任务数量
/// </summary>
public int IncrementPartTaskCount { get; set; }
/// <summary>
/// 增量配件数量
/// </summary>
public int IncrementPartCount { get; set; }
/// <summary>
/// 增值服务数据
/// </summary>
public List<PackItemModel> IncreateList { get; set; }
/// <summary>
/// 耗材服务数据
/// </summary>
public List<PackItemModel> ConsumableList { get; set; }
/// <summary>
///工序服务数据
/// </summary>
public List<PackItemModel> IncrementProcessList { get; set; }
/// <summary>
/// 基础包装工序(基础包装工序)
/// </summary>
public List<PackItemModel> BasicPackProcessList { get; set; }
}
/// <summary>
/// 上传服务
/// </summary>
@ -456,11 +497,11 @@ namespace BBWY.Client.APIServices
/// <summary>
/// 服务id
/// </summary>
public long ServiceId { get; set; }
public long? ServiceId { get; set; }
/// <summary>
/// 服务数量
/// </summary>
public int ServiceCount { get; set; }
public int? ServiceCount { get; set; }
///// <summary>
///// 增值服务ids
///// </summary>
@ -506,11 +547,11 @@ namespace BBWY.Client.APIServices
/// <summary>
/// 耗材服务id
/// </summary>
public long ConsumableId { get; set; }
public long? ConsumableId { get; set; }
/// <summary>
/// 耗材服务数量
/// </summary>
public int ConsumableCount { get; set; }
public int? ConsumableCount { get; set; }
}
@ -522,7 +563,7 @@ namespace BBWY.Client.APIServices
/// <summary>
/// 增值服务Id
/// </summary>
public long PackServiceId { get; set; }
public long? PackServiceId { get; set; }
/// <summary>
/// 数量
/// </summary>

3
BBWY.Client/App.xaml

@ -8,12 +8,11 @@
ShutdownMode="OnExplicitShutdown"><!--StartupUri="/Views/MainWindow.xaml"-->
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary.MergedDictionaries >
<ResourceDictionary Source="/Resources/Themes/Color.xaml"/>
<ResourceDictionary Source="/Resources/Themes/Path.xaml"/>
<ResourceDictionary Source="/Resources/Themes/Generic.xaml"/>
<ResourceDictionary Source="/Resources/Themes/DataTemplate.xaml"/>
</ResourceDictionary.MergedDictionaries>
<vm:ViewModelLocator x:Key="Locator"/>

2
BBWY.Client/App.xaml.cs

@ -125,6 +125,8 @@ namespace BBWY.Client
serviceCollection.AddTransient<BatchPurchaseCreateNewOrderViewModel>();
serviceCollection.AddTransient<BatchPurchaseAddProductSkuViewModel>();
serviceCollection.AddTransient<PackSkuSplitConfigViewModel>();
//serviceCollection.AddScoped<PackServiceViewModel>();
#region 注册拳探SDK相关类
serviceCollection.AddSingleton<QuanTanProductClient>();

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

@ -34,7 +34,104 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
public decimal TaskId { get => taskId; set { Set(ref taskId, value); } }
private decimal taskId;
/// <summary>
/// 耗材费用价格
/// </summary>
public decimal ConsumableFees { get; set; }
/// <summary>
/// 折扣系数
/// </summary>
public decimal? DiscountFoctor { get; set; }
/// <summary>
/// 收费方式
/// </summary>
public FeesMode? FeesMode { get; set; }
/// <summary>
/// 定向费用
/// </summary>
public decimal? DirectionalFees { get; set; }
/// <summary>
/// 打包费用小计
/// </summary>
public decimal PackFees { get; set; }
/// <summary>
/// 增值费用小计
/// </summary>
public decimal IncreateFees { get; set; }
/// <summary>
/// 增值服务数据
/// </summary>
public List<ServiceItemResponse> IncreateList { get; set; }
/// <summary>
/// 耗材服务数据
/// </summary>
public List<ServiceItemResponse> ConsumableList { get; set; }
/// <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; }
}
public class PackItemResponse
{
/// <summary>
/// 服务项目
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 价格
/// </summary>
public decimal ItemPrice { get; set; }
/// <summary>
/// 数量
/// </summary>
public int ItemCount { get; set; }
/// <summary>
/// 增值服务工序 = 0, 基础包装工序 = 1,配件
/// </summary>
public ProcessType ProcessType { get; set; }
}
public enum ServiceType

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

@ -1,4 +1,6 @@
using BBWY.Client.Models.PackTask;
using BBWY.Client.Models.APIModel.Request;
using BBWY.Client.Models.PackTask;
using BBWY.Client.Views.PackTask;
using System;
using System.Collections.Generic;
using System.Text;
@ -7,19 +9,54 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
{
public class PackServiceResponse
{
public decimal Discount { get; set; }
/// <summary>
/// 增值服务数据
/// </summary>
public List<PackItemModelResponse> IncreateList { get; set; }
/// <summary>
///工序服务数据
/// 耗材服务数据
/// </summary>
public List<PackItemModelResponse> PackList { get; set; }
public List<PackItemModelResponse> ConsumableServiceList { get; set; }
/// <summary>
/// 耗材服务数据
/// </summary>
public List<PackItemModelResponse> ConsumableServiceList { get; set; }
public List<PackItemModel> ConsumableList { get; set; }
/// <summary>
///工序服务数据
/// </summary>
public List<PackItemModel> IncrementProcessList { get; set; }
/// <summary>
/// 基础包装工序(基础包装工序)
/// </summary>
public List<PackItemModel> BasicPackProcessList { get; set; }
/// <summary>
/// 增值服务项目列表
/// </summary>
public List<PackServiceDTO> IncrementItemList { get; set; }
/// <summary>
/// 工序服务项目列表()
/// </summary>
public List<PackServiceDTO> ProcessItemList { get; set; }
/// <summary>
/// 耗材服务项目列表
/// </summary>
public List<ConsumableModel> ConsumableItemList { get; set; }
/// <summary>
/// 定向收费
/// </summary>
public decimal? DirectionalFees { get; set; }
/// <summary>
/// 增量配件数量
/// </summary>
public int? IncrementPartCount { get; set; }
}
public class PackServiceDTO
@ -28,6 +65,8 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask
public string Name { get; set; }
public decimal Price { get; set; }
public ServiceType ServiceType { get; set; }
}
public class PackItemModelResponse

9
BBWY.Client/Models/Enums.cs

@ -444,5 +444,12 @@
{
= 0, = 1, = 2, = 3
}
public enum FeesMode
{
= 0, = 1, = 2
}
public enum ProcessType
{
= 0, = 1/*,其他=2//基础包装 增量配件*/
}
}

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

@ -22,11 +22,11 @@ namespace BBWY.Client.Models.PackTask
/// </summary>
public string SelectUserId { get => selectUserId; set { Set(ref selectUserId, value); } }
private long selectId;
private long? selectId;
/// <summary>
/// 选中的Id
/// </summary>
public long SelectId { get => selectId; set { Set(ref selectId, value); } }
public long? SelectId { get => selectId; set { Set(ref selectId, value); } }
private string memberName;
public string MemberName { get => memberName; set { Set(ref memberName, value); } }

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

@ -119,7 +119,7 @@ namespace BBWY.Client.Models
{
ServiceWindow service = new ServiceWindow();
//加载数据
ViewModelLocator viewModelLocator = new ViewModelLocator();
ViewModelLocator viewModelLocator = (ViewModelLocator)App.Current.Resources["Locator"];
var serviceViewModel = viewModelLocator.PackServiceList;
serviceViewModel.PackTaskModel = this;
@ -129,15 +129,12 @@ namespace BBWY.Client.Models
serviceViewModel.TaskId = TaskId;
serviceViewModel.OrderId= OrderId;
serviceViewModel.SkuId =SkuId ;
serviceViewModel.PackUserName = this.PackUser?.Replace("\r\n",",")?.Replace("\n", ",")?.Replace("\r", ",");
serviceViewModel.LoadPackDatas();
serviceViewModel.SetAllFees = new Action<FeesItemResponse, List<string>>((feesItem, packUsers) =>
serviceViewModel.SetAllFees = new Action(() =>
{
FeesItemResponse = feesItem;
PackUser = string.Join("\r\n", packUsers);
FeesItemResponse.DiscountAllFees = feesItem.disCount * feesItem.AllFees;
IsShowFees = feesItem.AllFees > 0 ? true : false;
if (ReflashTask != null) ReflashTask();
});

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

File diff suppressed because it is too large

7
BBWY.Client/ViewModels/ViewModelLocator.cs

@ -324,5 +324,12 @@ namespace BBWY.Client.ViewModels
return s.ServiceProvider.GetRequiredService<PackUserSalaryViewModel>();
}
}
void test()
{
var packuser = (App.Current as App).ServiceProvider.GetRequiredService<PackUserSalaryViewModel>();
}
}
}

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

@ -4,9 +4,225 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask"
mc:Ignorable="d"
d:DesignHeight="100" d:DesignWidth="1800">
mc:Ignorable="d" Background="White"
d:DesignHeight="150" d:DesignWidth="1800">
<Grid x:Name ="gd"/>
<!--<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Grid.ColumnDefinitions >
<ColumnDefinition Width="0"/>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</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="11" 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="2" 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="4" Grid.ColumnSpan="6" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Column="10" Grid.Row="0" Grid.RowSpan="4" BorderThickness="1,0,0,0"/>
<TextBlock Text="打包耗材" Grid.Column="10" Grid.ColumnSpan="2" 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="12" 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="12" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Grid Grid.Column="1" 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="2.00*33" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="2" 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="1.00*33" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<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="99.00" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="4" 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"/>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Text="贴条码" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Width="1" HorizontalAlignment="Right" BorderBrush="#D7D7D7" BorderThickness="0,0,1,0"/>
<TextBlock Text="快递袋包装" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Width="1" HorizontalAlignment="Right" BorderBrush="#D7D7D7" BorderThickness="0,0,1,0"/>
<Border Height="1" VerticalAlignment="Top" BorderBrush="#D7D7D7" Grid.Row="1" Grid.ColumnSpan="2" BorderThickness="0,1,0,0"/>
</Grid>
<TextBlock Text="0.42*33" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Row="0" Grid.RowSpan="3" BorderThickness="1,0,0,0"/>
</Grid>
<Grid Grid.Column="5" Grid.Row="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<TextBlock Text="增量工序" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="折彩盒" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="0.17*33" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="箱子包装" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="0.17*33" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="2" Grid.Row="1" Grid.RowSpan="2" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="2" BorderThickness="0,0,1,0"/>
<TextBlock Text="贴面单" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="0.17*33" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Border Height="1" VerticalAlignment="Top" BorderBrush="#D7D7D7" Grid.Row="1" Grid.ColumnSpan="3" BorderThickness="0,1,0,0"/>
</Grid>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.Row="0" Grid.RowSpan="3" BorderThickness="1,0,0,0"/>
</Grid>
<Grid Grid.Column="6" Grid.Row="1" Grid.RowSpan="3" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="增量配件" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="5件" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Text="0.12*33" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<Border Height="1" VerticalAlignment="Top" Grid.Row="1" BorderBrush="#D7D7D7" BorderThickness="0,1,0,0"/>
<Border Width="1" HorizontalAlignment="Left" BorderBrush="#D7D7D7" Grid.RowSpan="3" BorderThickness="0,0,1,0"/>
</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="定向收费" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<Grid Grid.Column="8" 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="9" 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="10" 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="11" 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>

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

@ -1,6 +1,7 @@
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel.Response.PackTask;
using NPOI.POIFS.Crypt.Dsig;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Linq;
@ -59,8 +60,20 @@ namespace BBWY.Client.Views.PackTask
// DependencyProperty.Register("FeesPrice", typeof(decimal), typeof(FeesExcelControl), new PropertyMetadata(ChangedProperty2));
public bool IsMin
{
get
{
return (bool)GetValue(IsMinProperty);
}
set
{
SetValue(IsMinProperty, value);
}
}
public static readonly DependencyProperty IsMinProperty =
DependencyProperty.Register("IsMin", typeof(bool), typeof(FeesExcelControl));
@ -106,10 +119,50 @@ namespace BBWY.Client.Views.PackTask
}
}
public FeesExcelControl()
{
InitializeComponent();
}
string xaml = @" <Grid xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
<Grid.ColumnDefinitions >
<ColumnDefinition [:Visity:] />
[: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+IncreateCount+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+IncreateCount+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+IncreateCount+ProcessCount:+ConsumableCount]"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
[:ListData:]
</Grid>";
string oldxaml = @" <Grid xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
<Grid.ColumnDefinitions >
[:Columns:]
</Grid.ColumnDefinitions>
@ -146,33 +199,159 @@ namespace BBWY.Client.Views.PackTask
[:ListData:]
</Grid>";
/// <summary>
/// index 从1开始 0+1
/// index 从1开始 0+1 增值服务 和打包耗材
/// </summary>
string columnData = @"
<Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""2"" >
<Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition Height=""*""/>
<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=""[:ServiceName:]"" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string columnStr = "<ColumnDefinition />";
string increateService = @"<TextBlock Text=""增值服务"" Grid.Column=""1"" Grid.ColumnSpan=""[:IncreateCount:]"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Column=""[:1+IncreateCount:]"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>";
string packProcessColumnData = @"";
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>";
string basicPackStr = @" <Grid Grid.Column=""[:index:]"" 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""/>
<Grid Grid.Row=""1"" >
<Grid.ColumnDefinitions>
[:Columns:]
</Grid.ColumnDefinitions>
[:BasicProcessData:]
<Border Height=""1"" VerticalAlignment=""Top"" BorderBrush=""#D7D7D7"" Grid.Row=""1"" Grid.ColumnSpan=""2"" BorderThickness=""0,1,0,0""/>
</Grid>
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""3"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
</Grid>";
string basicProcessdata = @" <TextBlock Text=""[:ServiceName:]"" Grid.Column=""[:index:]"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Width=""1"" HorizontalAlignment=""Right"" BorderBrush=""#D7D7D7"" BorderThickness=""0,0,1,0""/>";
string increateProcessStr = @"<Grid Grid.Column=""[:index:]"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""*""/>
<RowDefinition Height=""2*""/>
</Grid.RowDefinitions>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Grid Grid.Row=""1"">
<Grid.ColumnDefinitions>
[:Columns:]
</Grid.ColumnDefinitions>
[:IncreateProcessDatas:]
<Border Height=""1"" VerticalAlignment=""Top"" BorderBrush=""#D7D7D7"" Grid.Row=""1"" Grid.ColumnSpan=""[:IncreateProcessCount:]"" BorderThickness=""0,1,0,0""/>
</Grid>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
</Grid>";
string increateProcessData = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""2"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text=""[:ServiceName:]"" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string increatePartData = @"<Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:PartCount:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""2"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Height=""1"" VerticalAlignment=""Top"" Grid.Row=""1"" BorderBrush=""#D7D7D7"" BorderThickness=""0,1,0,0""/>
<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*""/>
<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=""[:FeesMode:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string discountFactorStr = @" <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=""[: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 workProcess = "<TextBlock Text=\"打包服务\" Grid.Column=\"[:1+IncreateCount:]\" Grid.ColumnSpan=\"[:ProcessCount:]\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"/>\r\n <Border Width=\"1\" HorizontalAlignment=\"Left\" BorderBrush=\"#D7D7D7\" Grid.Column=\"[:1+IncreateCount+ProcessCount:]\" Grid.Row=\"0\" Grid.RowSpan=\"3\" BorderThickness=\"1,0,0,0\"/>\r\n ";
string consumableService = "<TextBlock Text=\"打包耗材\" Grid.Column=\"[:1+IncreateCount+ProcessCount:]\" Grid.ColumnSpan=\"[:ConsumableCount:]\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\"/>\r\n <Border Width=\"1\" HorizontalAlignment=\"Left\" BorderBrush=\"#D7D7D7\" Grid.Column=\"[:1+IncreateCount+ProcessCount:+ConsumableCount]\" Grid.Row=\"0\" Grid.RowSpan=\"3\" BorderThickness=\"1,0,0,0\"/>\r\n ";
public FeesExcelControl()
{
InitializeComponent();
}
string columnStr = "<ColumnDefinition Width=\"[:Width:]\"/>";
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 ";
@ -191,20 +370,56 @@ namespace BBWY.Client.Views.PackTask
{
gd.Children.Clear();
});
var increateList = FeesItem.ServiceList.Where(s => s.ServiceType == ServiceType.).ToList();
var processList = FeesItem.ServiceList.Where(s => s.ServiceType == ServiceType.).ToList();
var consumableList = FeesItem.ServiceList.Where(s => s.ServiceType == ServiceType.).ToList();
int packserviceCount = 0;
bool isExitIncrementPart = false;
if (FeesItem.IncrementPartTaskCount != null && FeesItem.IncrementPartTaskCount > 0 && FeesItem.IncrementPartCount > 1)
{
isExitIncrementPart = true;
packserviceCount++;
}
var increateList = FeesItem.IncreateList;
var basicProcessList = FeesItem.PackItemList.Where(f => f.ProcessType == Models.ProcessType.).ToList();
if (basicProcessList.Count > 0) packserviceCount++;
var increateProcessList = FeesItem.PackItemList.Where(f => f.ProcessType == Models.ProcessType.).ToList();
if (increateProcessList.Count > 0) packserviceCount++;
var processList = FeesItem.PackItemList;
var consumableList = FeesItem.ConsumableList;
if (packserviceCount > 0) packserviceCount += 3;
var increateCount = increateList.Count();
var processCount = processList.Count();
var processCount = packserviceCount;
var consumableCount = consumableList.Count();
List<ServiceItemResponse> all = new List<ServiceItemResponse>();
all.AddRange(increateList);
all.AddRange(processList);
all.AddRange(consumableList);
if (consumableCount > 0)
{
consumableCount++;
}
if (increateCount > 0)
{
increateCount++;
}
if (IsMin)
{
columnStr = columnStr.Replace("[:Width:]", "Auto");
}
else
{
columnStr = columnStr.Replace("[:Width:]", "*");
}
var columnCount = 2 + all.Count + 2;
var columnCount = consumableCount + processCount + increateCount + 2;
StringBuilder columns = new StringBuilder();
for (int i = 0; i < columnCount; i++)
{
@ -212,27 +427,117 @@ namespace BBWY.Client.Views.PackTask
}
StringBuilder serviceData = new StringBuilder();
int allCount = consumableCount + processCount + increateCount;
if (isPrice)
int rowIndex = 0;
if (increateList.Count > 0)
{
for (int i = 0; i < all.Count; i++)
foreach (var item in increateList)
{
serviceData.AppendLine(columnData.Replace("[:index:]", $"{i + 1}")
.Replace("[:ServiceName:]", $"{all[i].ItemName}")
.Replace("[:ServiceCount:]", $"{all[i].ItemPrice}"));
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.IncreateFees}")
);
//totalIncrementConsumableStr
}
else
if (basicProcessList.Count > 0)//打包服务
{
rowIndex++;
StringBuilder basicSB = new StringBuilder();
StringBuilder basiccolumns = new StringBuilder();
for (int i = 0; i < basicProcessList.Count; i++)
{
basicSB.AppendLine(basicProcessdata.Replace("[:index:]", $"{i}")
.Replace("[:ServiceName:]", $"{basicProcessList[i].ItemName}")
.Replace("[:ServiceCount:]", $"{basicProcessList[i].ItemPrice}*{basicProcessList[i].ItemCount}"));
basiccolumns.AppendLine(columnStr);
}
serviceData.AppendLine(basicPackStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:Columns:]", $"{basiccolumns}")
.Replace("[:ServiceCount:]", $"{FeesItem.BasicProcessPrice}*{FeesItem.BasicProcessCount}")
.Replace("[:BasicProcessData:]", basicSB.ToString()));
}
if (increateProcessList.Count > 0)
{
for (int i = 0; i < all.Count; i++)
rowIndex++;
StringBuilder increateProcessSB = new StringBuilder();
StringBuilder increateProcesscolumns = new StringBuilder();
for (int i = 0; i < increateProcessList.Count(); i++)
{
serviceData.AppendLine(columnData.Replace("[:index:]", $"{i + 1}")
.Replace("[:ServiceName:]", $"{all[i].ItemName}")
.Replace("[:ServiceCount:]", $"{all[i].ItemPrice}*{all[i].ItemCount}"));
increateProcessSB.AppendLine(increateProcessData.Replace("[:index:]", $"{i}")
.Replace("[:ServiceName:]", $"{increateProcessList[i].ItemName}")
.Replace("[:ServiceCount:]", $"{increateProcessList[i].ItemPrice}*{increateProcessList[i].ItemCount}"));
increateProcesscolumns.AppendLine(columnStr);
}
//[:IncreateProcessCount:]
serviceData.AppendLine(increateProcessStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:IncreateProcessCount:]", $"{increateProcessList.Count()}")
.Replace("[:Columns:]", $"{increateProcesscolumns}")
.Replace("[:IncreateProcessDatas:]", $"{increateProcessSB.ToString()}")
.Replace("[:ServiceCount:]", $"{FeesItem.BasicProcessPrice}*{FeesItem.BasicProcessCount}"));
}
if (isExitIncrementPart)
{
rowIndex++;
serviceData.AppendLine(increatePartData.Replace("[:index:]", $"{rowIndex}")
.Replace("[:PartCount:]", $"{FeesItem.IncrementPartCount}")
.Replace("[:ServiceCount:]", $"{FeesItem.IncrementPartPrice}*{FeesItem.IncrementPartTaskCount}"));
}
if (processCount > 0)
{
rowIndex++;
serviceData.AppendLine(FeesModeStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:FeesMode:]", $"{FeesItem.FeesMode}"));
rowIndex++;
serviceData.AppendLine(discountFactorStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:DiscountFactor:]", $"{FeesItem.DiscountFoctor}")
);
rowIndex++;
serviceData.AppendLine(processFeesStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:PackFees:]", $"{FeesItem.PackFees}")
);
}
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 (increateCount > 0)
@ -251,14 +556,9 @@ namespace BBWY.Client.Views.PackTask
decimal discount = 0;
decimal discountFees = 0;
discount = FeesItem.disCount;
if (isPrice)
{
allFees = FeesItem.SingleFees;
}
else
{
allFees = FeesItem.AllFees;
}
allFees = FeesItem.AllFees;
discountFees = allFees * discount;
string discountStr = "原价";
@ -269,7 +569,7 @@ namespace BBWY.Client.Views.PackTask
var newGrid = xaml.Replace("[:Header:]", header.ToString())
.Replace("[:Columns:]", columns.ToString())
.Replace("[:ColumnCount:]", $"{columnCount}")
.Replace("[:ColumnCount-2:]", $"{columnCount - 4}")
.Replace("[:ColumnCount-2:]", $"{columnCount - 2}")
.Replace("[:1+IncreateCount:]", $"{increateCount + 1}")
.Replace("[:1+IncreateCount+ProcessCount:]", $"{1 + increateCount + processCount}")
.Replace("[:1+IncreateCount+ProcessCount:+ConsumableCount]", $"{1 + increateCount + processCount + consumableCount}")
@ -280,10 +580,18 @@ namespace BBWY.Client.Views.PackTask
.Replace("[:ConsumableCount:]", $"{consumableCount}")
.Replace("[:TaskId:]", $"{FeesItem.TaskId}")
.Replace("[:ListData:]", serviceData.ToString())
.Replace("[:AllFees:]", $"{allFees}")
.Replace("[:Discount:]", discountStr)
.Replace("[:DiscountFees:]", $"{discountFees.ToString(" 0.00")}");
.Replace("[:AllFees:]", $"{FeesItem.AllFees}");
//.Replace("[:Discount:]", $"{FeesItem.DiscountFoctor}")
//.Replace("[:DiscountFees:]", $"{discountFees.ToString(" 0.00")}");
if (IsMin)
{
newGrid = newGrid.Replace(@"MinWidth=""84""", "").Replace(@"[:Visity:]", "Width=\"0\"");
}
else
{
//
newGrid = newGrid.Replace(@"[:Visity:]", "");
}

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

@ -0,0 +1,11 @@
<UserControl x:Class="BBWY.Client.Views.PackTask.MinFeesExcelControl"
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="150" d:DesignWidth="1800">
<Grid x:Name ="gd"/>
</UserControl>

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

@ -0,0 +1,526 @@
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>
/// MinFeesExcelControl.xaml 的交互逻辑
/// </summary>
public partial class MinFeesExcelControl : UserControl
{
public MinFeesExcelControl()
{
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
{
get
{
return (bool)GetValue(IsMinProperty);
}
set
{
SetValue(IsMinProperty, value);
}
}
public static readonly DependencyProperty IsMinProperty =
DependencyProperty.Register("IsMin", typeof(bool), typeof(MinFeesExcelControl));
public FeesItemResponse FeesItem
{
get
{
return (FeesItemResponse)GetValue(FeesItemProperty);
}
set
{
SetValue(FeesItemProperty, value);
}
}
public static readonly DependencyProperty FeesItemProperty =
DependencyProperty.Register("FeesItem", typeof(FeesItemResponse), typeof(MinFeesExcelControl), new PropertyMetadata(ChangedProperty));
private static void ChangedProperty1(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = d as FeesExcelControl;
var newValue = e.NewValue as FeesItemResponse;
}
private static void ChangedProperty(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var control = d as MinFeesExcelControl;
// control.Str
var newValue = e.NewValue as FeesItemResponse;
control.FeesItem = newValue;
if (control.IsWareHouse)
{
control.LoadData(false);
}
else
{
control.LoadData(true);
}
}
string xaml = @" <Grid xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"">
<Grid.ColumnDefinitions >
[:Columns:]
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
<RowDefinition Height=""30"" />
<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=""Right"" BorderBrush=""#D7D7D7"" Grid.Column=""[:1+IncreateCount+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=""0"" 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+IncreateCount+ProcessCount:+ConsumableCount]"" Grid.RowSpan=""3"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:AllFees:]"" Grid.Row=""3"" Grid.Column=""[:1+IncreateCount+ProcessCount:+ConsumableCount]"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
[:ListData:]
</Grid>";
/// <summary>
/// index 从1开始 0+1 增值服务 和打包耗材
/// </summary>
string columnData = @"
<Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""*""/>
<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 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>";
string basicPackStr = @" <Grid Grid.Column=""[:index:]"" 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""/>
<Grid Grid.Row=""1"" >
<Grid.ColumnDefinitions>
[:Columns:]
</Grid.ColumnDefinitions>
[:BasicProcessData:]
<Border Height=""1"" VerticalAlignment=""Top"" BorderBrush=""#D7D7D7"" Grid.Row=""1"" Grid.ColumnSpan=""2"" BorderThickness=""0,1,0,0""/>
</Grid>
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""3"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
</Grid>";
string basicProcessdata = @" <TextBlock Text=""[:ServiceName:]"" Grid.Column=""[:index:]"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Width=""1"" HorizontalAlignment=""Right"" BorderBrush=""#D7D7D7"" BorderThickness=""0,0,1,0""/>";
string increateProcessStr = @"<Grid Grid.Column=""[:index:]"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition Height=""*""/>
<RowDefinition Height=""2*""/>
</Grid.RowDefinitions>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Grid Grid.Row=""1"">
<Grid.ColumnDefinitions>
[:Columns:]
</Grid.ColumnDefinitions>
[:IncreateProcessDatas:]
<Border Height=""1"" VerticalAlignment=""Top"" BorderBrush=""#D7D7D7"" Grid.Row=""1"" Grid.ColumnSpan=""[:IncreateProcessCount:]"" BorderThickness=""0,1,0,0""/>
</Grid>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.Row=""0"" Grid.RowSpan=""3"" BorderThickness=""1,0,0,0""/>
</Grid>";
string increateProcessData = @" <Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""2"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Border Width=""1"" HorizontalAlignment=""Left"" BorderBrush=""#D7D7D7"" Grid.RowSpan=""2"" BorderThickness=""0,0,1,0""/>
<TextBlock Text=""[:ServiceName:]"" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string increatePartData = @"<Grid Grid.Column=""[:index:]"" MinWidth=""84"" Grid.Row=""1"" Grid.RowSpan=""3"" >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="""" Grid.Row=""0"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:PartCount:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<TextBlock Text=""[:ServiceCount:]"" Grid.Row=""2"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
<Border Height=""1"" VerticalAlignment=""Top"" Grid.Row=""1"" BorderBrush=""#D7D7D7"" BorderThickness=""0,1,0,0""/>
<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*""/>
<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=""[:FeesMode:]"" Grid.Row=""1"" VerticalAlignment=""Center"" HorizontalAlignment=""Center""/>
</Grid>";
string discountFactorStr = @" <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=""[: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)
{
isPrice = false;
if (FeesItem == null || FeesItem.ServiceList.Count <= 0)
{
return;
}
try
{
App.Current.Dispatcher.Invoke(() =>
{
gd.Children.Clear();
});
int packserviceCount = 0;
bool isExitIncrementPart = false;
if (FeesItem.IncrementPartTaskCount != null && FeesItem.IncrementPartTaskCount > 0 && FeesItem.IncrementPartCount > 1)
{
isExitIncrementPart = true;
packserviceCount++;
}
var basicProcessList = FeesItem.PackItemList.Where(f => f.ProcessType == Models.ProcessType.).ToList();
if (basicProcessList.Count > 0) packserviceCount++;
var increateProcessList = FeesItem.PackItemList.Where(f => f.ProcessType == Models.ProcessType.).ToList();
if (increateProcessList.Count > 0) packserviceCount++;
var processList = FeesItem.PackItemList;
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++)
{
columns.AppendLine(columnStr);
}
StringBuilder serviceData = new StringBuilder();
int allCount = consumableCount + processCount ;
int rowIndex = 0;
if (basicProcessList.Count > 0)//打包服务
{
StringBuilder basicSB = new StringBuilder();
StringBuilder basiccolumns = new StringBuilder();
for (int i = 0; i < basicProcessList.Count; i++)
{
basicSB.AppendLine(basicProcessdata.Replace("[:index:]", $"{i}")
.Replace("[:ServiceName:]", $"{basicProcessList[i].ItemName}")
.Replace("[:ServiceCount:]", $"{basicProcessList[i].ItemPrice}*{basicProcessList[i].ItemCount}"));
basiccolumns.AppendLine(columnStr);
}
serviceData.AppendLine(basicPackStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:Columns:]", $"{basiccolumns}")
.Replace("[:ServiceCount:]", $"{FeesItem.BasicProcessPrice}*{FeesItem.BasicProcessCount}")
.Replace("[:BasicProcessData:]", basicSB.ToString()));
}
if (increateProcessList.Count > 0)
{
rowIndex++;
StringBuilder increateProcessSB = new StringBuilder();
StringBuilder increateProcesscolumns = new StringBuilder();
for (int i = 0; i < increateProcessList.Count(); i++)
{
increateProcessSB.AppendLine(increateProcessData.Replace("[:index:]", $"{i}")
.Replace("[:ServiceName:]", $"{increateProcessList[i].ItemName}")
.Replace("[:ServiceCount:]", $"{increateProcessList[i].ItemPrice}*{increateProcessList[i].ItemCount}"));
increateProcesscolumns.AppendLine(columnStr);
}
//[:IncreateProcessCount:]
serviceData.AppendLine(increateProcessStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:IncreateProcessCount:]", $"{increateProcessList.Count()}")
.Replace("[:Columns:]", $"{increateProcesscolumns}")
.Replace("[:IncreateProcessDatas:]", $"{increateProcessSB.ToString()}")
.Replace("[:ServiceCount:]", $"{FeesItem.BasicProcessPrice}*{FeesItem.BasicProcessCount}"));
}
if (isExitIncrementPart)
{
rowIndex++;
serviceData.AppendLine(increatePartData.Replace("[:index:]", $"{rowIndex}")
.Replace("[:PartCount:]", $"{FeesItem.IncrementPartCount}")
.Replace("[:ServiceCount:]", $"{FeesItem.IncrementPartPrice}*{FeesItem.IncrementPartTaskCount}"));
}
if (processCount > 0)
{
rowIndex++;
serviceData.AppendLine(FeesModeStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:FeesMode:]", $"{FeesItem.FeesMode}"));
rowIndex++;
serviceData.AppendLine(discountFactorStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:DiscountFactor:]", $"{FeesItem.DiscountFoctor}")
);
}
if (consumableList.Count > 0)
{
foreach (var item in consumableList)
{
rowIndex++;
serviceData.AppendLine(incrementConsumableStr.Replace("[:index:]", $"{rowIndex}")
.Replace("[:ServiceName:]", $"{item.ItemName}")
.Replace("[:ServiceCount:]", $""));
}
}
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 - 1}")
.Replace("[:1+IncreateCount:]", $"{0}")
.Replace("[:1+IncreateCount+ProcessCount:]", $"{ processCount}")
.Replace("[:1+IncreateCount+ProcessCount:+ConsumableCount]", $"{ processCount + consumableCount}")
.Replace("[:2+IncreateCount+ProcessCount:+ConsumableCount]", $"{1 + processCount + consumableCount}")
.Replace("[:3+IncreateCount+ProcessCount:+ConsumableCount]", $"{2 + processCount + consumableCount}")
.Replace("[:IncreateCount:]", $"{0}")
.Replace("[:ProcessCount:]", $"{processCount}")
.Replace("[:ConsumableCount:]", $"{consumableCount}")
.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\"");
}
else
{
//
newGrid = newGrid.Replace(@"[:Visity:]", "");
}
var grid = XamlReader.Parse(newGrid) as Grid;
App.Current.Dispatcher.Invoke(() =>
{
gd.Children.Add(grid);
});
}
catch
{
}
}
}
}

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

@ -46,7 +46,7 @@
</Grid.RowDefinitions>
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/>
<Grid Background="{StaticResource Border.Background}">
<TextBlock Text="发布任务" VerticalAlignment="Center" HorizontalAlignment="Center" />
<TextBlock Text="发布任务" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Grid>
<Grid Grid.Row="1" Visibility="{Binding TaskId,Converter={StaticResource objConverter},ConverterParameter=0:Visible:Collapsed}">
<StackPanel Orientation="Horizontal">

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

File diff suppressed because it is too large

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

@ -37,7 +37,14 @@ namespace BBWY.Client.Views.PackTask
private void BButton_Click(object sender, RoutedEventArgs e)
{
var localPrintServer = new LocalPrintServer();
var printQueue = localPrintServer.GetPrintQueue(cbPrintName.Text);
string printName = cbPrintName.Text.Trim();
if (string.IsNullOrEmpty(printName))
{
MessageBox.Show("选择打印机");
return;
}
var printQueue = localPrintServer.GetPrintQueue(printName);
if (printQueue.IsInError)
{
MessageBox.Show("打印机处于错误状态");

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

@ -63,16 +63,19 @@ namespace BBWY.Client.Views.PackTask
LabelModel = BarCodeModel.LabelModel
});
if (resData == null || !resData.Success)
if (resData == null)
{
MessageBox.Show("网络异常!");
return;
}
if (!resData.Success)
{
MessageBox.Show(resData.Msg);
return;
}
BarCodeModel.Id = resData.Data;
if (SaveResult != null)
SaveResult(BarCodeModel);
this.Close();
}

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

@ -93,20 +93,26 @@ namespace BBWY.Client.Views.PackTask
Shader = item.CertificateModel.Shader,
ApplyAge = item.CertificateModel.ApplyAge,
GoodsNumber = item.CertificateModel.GoodsNumber,
ProduceDate= item.CertificateModel.ProduceDate,
ProduceDate = item.CertificateModel.ProduceDate,
});
if (resData == null || !resData.Success)
if (resData == null)
{
// IsSetCertificate = false;
MessageBox.Show("网络异常!");
return;
}
// IsNeedCertificateModel = "需要";
if (!resData.Success)
{
MessageBox.Show(resData.Msg);
return;
}
item.CertificateModel.Id = resData.Data;
if (SaveResult != null) SaveResult(GoodsNumberCerList.Select(c => c.CertificateModel).ToArray());
//IsSetCertificate = false;
//setCerWindow.Close();
}
this.Close();
}
@ -197,7 +203,7 @@ namespace BBWY.Client.Views.PackTask
{
var select = test.SelectedItem as GoodsNumberCer;
if (select != null)
selectCer = select.CertificateModel.GoodsNumber;
selectCer = select.CertificateModel.GoodsNumber;
}
}
}

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

@ -15,6 +15,7 @@
Title="TaskList">
<Page.Resources>
<Style TargetType="RadioButton">
<Setter Property="IsChecked" Value="False" />
<Setter Property="Background" Value="#8080FF" />
<Setter Property="Foreground" Value="Black" />

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

@ -364,7 +364,7 @@
<StackPanel Margin="20,0,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock Text="收费:"/>
<TextBlock
Text="{Binding FeesItemResponse.DiscountAllFees, StringFormat={}{0:F2}}"
Text="{Binding FeesItemResponse.AllFees, StringFormat={}{0:F2}}"
TextWrapping="Wrap"
HorizontalAlignment="Center"
/>
@ -372,7 +372,7 @@
Style="{StaticResource path_question}"
Width="14" Margin="0,0,0,0" Fill="{StaticResource Text.Pink}"
ToolTipService.InitialShowDelay="0" ToolTipService.ShowDuration="20000"
Visibility="{Binding IsShowFees,Converter={StaticResource objConverter},ConverterParameter=true:Visible:Collapsed }"
Visibility="{Binding FeesItemResponse,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible }"
>
<Path.ToolTip>

Loading…
Cancel
Save