49 changed files with 4423 additions and 438 deletions
@ -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); |
|||
} |
|||
} |
|||
} |
@ -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; } |
|||
} |
|||
} |
@ -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); } } |
|||
} |
|||
} |
@ -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 |
|||
{ |
|||
|
|||
|
|||
} |
|||
} |
@ -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; } |
|||
|
|||
|
|||
} |
|||
} |
@ -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; } |
|||
} |
|||
} |
@ -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; } |
|||
} |
|||
} |
@ -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); } } |
|||
} |
|||
} |
File diff suppressed because it is too large
@ -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> |
@ -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 |
|||
{ |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
} |
|||
} |
@ -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> |
@ -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 |
|||
{ |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
} |
|||
} |
@ -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> |
@ -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); |
|||
|
|||
|
|||
|
|||
} |
|||
} |
|||
} |
@ -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> |
@ -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(); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue