Browse Source

1

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
d316bd1c53
  1. 5
      BBWY.Client/APIServices/QiKu/PackDetailService.cs
  2. 14
      BBWY.Client/APIServices/QiKu/PackTaskAbortService.cs
  3. 33
      BBWY.Client/Models/APIModel/Response/PackTask/SearchTaskListResponse.cs
  4. 34
      BBWY.Client/Models/APIModel/Response/PackTask/SetPackDetailV2Response.cs
  5. 50
      BBWY.Client/ViewModels/PackTask/PackDetailViewModel.cs
  6. 40
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  7. 32
      BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
  8. 30
      BBWY.Client/Views/PackTask/PackDetailWindow.xaml
  9. 58
      BBWY.Client/Views/PackTask/PackDetailWindow.xaml.cs
  10. 47
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml
  11. 56
      BBWY.Client/Views/PackagingTask/PrintPackDetailWindow.xaml
  12. 131
      BBWY.Client/Views/PackagingTask/PrintPackDetailWindow.xaml.cs
  13. 97
      BBWY.Client/Views/SomeArrival/PrintSomeArrivalWindow.xaml
  14. 230
      BBWY.Client/Views/SomeArrival/PrintSomeArrivalWindow.xaml.cs
  15. 46
      BBWY.Client/Views/SomeArrival/SomeArrivalWindow.xaml
  16. 62
      BBWY.Client/Views/SomeArrival/SomeArrivalWindow.xaml.cs
  17. 4
      BBWY.Client/Views/SplitTask/PrintExceptionTaskWindow.xaml
  18. 7
      BBWY.Client/Views/SplitTask/PrintExceptionTaskWindow.xaml.cs

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

@ -1,4 +1,5 @@
using BBWY.Client.Models;
using BBWY.Client.Models.APIModel;
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Common.Http;
using BBWY.Common.Models;
@ -35,9 +36,9 @@ namespace BBWY.Client.APIServices
/// </summary>
/// <param name="consumable"></param>
/// <returns></returns>
public ApiResponse<object> SetPackDetail(SetPackDetailRequest consumable)
public ApiResponse<SetPackDetailV2Response> SetPackDetailV2(SetPackDetailRequest consumable)
{
return SendRequest<object>(globalContext.QKApiHost, "api/PackDetail/SetPackDetail",
return SendRequest<SetPackDetailV2Response>(globalContext.QKApiHost, "api/PackDetail/SetPackDetailV2",
consumable
, null, HttpMethod.Post);
}

14
BBWY.Client/APIServices/QiKu/PackTaskAbortService.cs

@ -58,5 +58,19 @@ namespace BBWY.Client.APIServices.QiKu
}
, null, HttpMethod.Post);
}
public ApiResponse<object> SaveTaskShelves(long TaskId, string ShelvesNumber, int? FloorNumber, string RemarkMsg)
{
return SendRequest<object>(globalContext.QKApiHost, $"api/PackTaskAbort/SaveTaskShelves",
new
{
TaskId,
ShelvesNumber,
FloorNumber,
UserName = globalContext.User.Name,
RemarkMsg
}
, null, HttpMethod.Post);
}
}
}

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

@ -142,15 +142,6 @@ namespace BBWY.Client.Models.APIModel
public string OrderId { get; set; }
///// <summary>
/////分箱情况
///// </summary>
//public WareHourseDTO[] WareHourses { get; set; }
/// <summary>
/// 地托编号
/// </summary>
public int? FloorDragNumber { get; set; }
/// <summary>
/// 质检超时时间
/// </summary>
@ -161,8 +152,6 @@ namespace BBWY.Client.Models.APIModel
/// </summary>
public DateTime? PackCompletionOverTime { get; set; }
/// <summary>
/// 质检超时备注信息
/// </summary>
@ -201,7 +190,6 @@ namespace BBWY.Client.Models.APIModel
/// </summary>
public DateTime? SendToSetSkuConfigureTime { get; set; }
/// <summary>
/// 物流状态
/// </summary>
@ -211,6 +199,27 @@ namespace BBWY.Client.Models.APIModel
/// 消息列表
/// </summary>
public List<MarkMessageModel> MarkMessageModelList { get; set; }
/// <summary>
/// 异常类型
/// </summary>
public string TaskExceptionType { get; set; }
/// <summary>
/// 货架编号
/// </summary>
public string ShelvesNumber { get; set; }
/// <summary>
/// 货架层数
/// </summary>
public int? FloorNumber { get; set; }
/// <summary>
/// 挂起异常备注
/// </summary>
public string AbortRemark { get; set; }
public DateTime? TaskAbortTime { get; set; }
}
public class ExpressOrderResponse

34
BBWY.Client/Models/APIModel/Response/PackTask/SetPackDetailV2Response.cs

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BBWY.Client.Models.APIModel
{
public class SetPackDetailV2Response
{
/// <summary>
/// 套餐任务量
/// </summary>
public int ProcessTaskCount { get; set; }
/// <summary>
/// 打包完成时间(超时时间)
/// </summary>
public DateTime? PackCompletionOverTime { get; set; }
/// <summary>
/// 包装收益
/// </summary>
public decimal PackerFees { get; set; }
/// <summary>
/// 工序套餐名称
/// </summary>
public string ProcessComboName { get; set; }
/// <summary>
/// 耗材名称列表
/// </summary>
public List<string> ConsumableNameList { get; set; }
}
}

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

@ -24,6 +24,7 @@ using BBWY.Client.Models.APIModel;
using Org.BouncyCastle.Bcpg;
using System.Threading;
using Org.BouncyCastle.Ocsp;
using BBWY.Client.Views.PackagingTask;
namespace BBWY.Client.ViewModels.PackTask
{
@ -446,6 +447,15 @@ namespace BBWY.Client.ViewModels.PackTask
public string PackUserName { get => packUserName; set { Set(ref packUserName, value); } }
private string processComboName;
/// <summary>
/// 工序套餐名称
/// </summary>
public string ProcessComboName { get => processComboName; set { Set(ref processComboName, value); } }
private decimal? packerFee;
/// <summary>
/// 包装员费用
@ -945,6 +955,22 @@ namespace BBWY.Client.ViewModels.PackTask
/// 计费模式
/// </summary>
public FeesMode FeesMode { get; set; }
public DateTime? packCompletionOverTime;
/// <summary>
/// 打包完成时间(超时时间)
/// </summary>
public DateTime? PackCompletionOverTime { get => packCompletionOverTime; set { Set(ref packCompletionOverTime, value); } } //
public List<string> consumableNameList;
/// <summary>
/// 耗材名称列表
/// </summary>
public List<string> ConsumableNameList { get => consumableNameList; set { Set(ref consumableNameList, value); } } //
/// <summary>
/// 上传数据 (判断是否超量) 统一上传
/// </summary>
@ -955,8 +981,6 @@ namespace BBWY.Client.ViewModels.PackTask
System.Windows.MessageBox.Show("信息不完整,打包人设置有误");
return;
}
if (PackUserModelList != null && PackUserModelList.Count > 0)
{
if (PackUserModelList.Any(p => p.SelectUserId.IsNullOrEmpty() || p.TaskCount <= 0))
@ -979,8 +1003,6 @@ namespace BBWY.Client.ViewModels.PackTask
}
}
if (ConsumableServiceList != null && ConsumableServiceList.Count > 0)
{
if (ConsumableServiceList.Any(p => p.SelectId == null || p.TaskCount <= 0))
@ -1004,7 +1026,6 @@ namespace BBWY.Client.ViewModels.PackTask
{
FeesMode = FeesMode.;
}
SetPackDetailRequest setPackDetailRequest = new SetPackDetailRequest()
{
DirectionalSingleFees = CustomProcessSinglePrice,
@ -1013,7 +1034,7 @@ namespace BBWY.Client.ViewModels.PackTask
ConsumableFees = ConsumableFees,
TaskId = TaskId,
PackUserList = PackUserModelList?.Select(p => new PackUserModelRequest { TaskCount = p.TaskCount, UserId = p.SelectUserId }).ToList(),
ConsumableList = ConsumableServiceList?.Select(c => new ConsumableRequest { ConsumableId = c.SelectId.Value, TaskCount = c.TaskCount, ConsumableTypeName = c.ConsumableType, ConsumablePrice = c.ConsumablePrice,IsSaveConfig=c.IsHideDelete }).ToList(),
ConsumableList = ConsumableServiceList?.Select(c => new ConsumableRequest { ConsumableId = c.SelectId.Value, TaskCount = c.TaskCount, ConsumableTypeName = c.ConsumableType, ConsumablePrice = c.ConsumablePrice, IsSaveConfig = c.IsHideDelete }).ToList(),
DiscountFactory = DiscountFactory,
PackDiscountPrice = PackDiscountFees,
PackPrice = PackFees,
@ -1026,7 +1047,7 @@ namespace BBWY.Client.ViewModels.PackTask
};
var res = packDetailService.SetPackDetail(setPackDetailRequest);
var res = packDetailService.SetPackDetailV2(setPackDetailRequest);
if (res == null)
{
@ -1039,9 +1060,22 @@ namespace BBWY.Client.ViewModels.PackTask
return;
}
var names = PackUserModelList.Select(c => c.MemberList.SingleOrDefault(s => s.Id == c.SelectUserId)?.UserName);
PackUserName = string.Join(",",names);
ProcessTaskCount = res.Data.ProcessTaskCount;
PackerFee = res.Data.PackerFees;
ProcessComboName = res.Data.ProcessComboName;
ConsumableNameList = res.Data.ConsumableNameList;
PackCompletionOverTime = res.Data.PackCompletionOverTime;
// new TipsWindow("上传成功!").Show();
var win = obj as System.Windows.Window;
var win = obj as PackDetailWindow;
PrintPackDetailWindow print = new PrintPackDetailWindow(win);
print.ShowDialog();
if (ReflashWindow != null)
ReflashWindow();
win.Close();

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

@ -38,6 +38,7 @@ using BBWY.Client.Views.SplitTask;
using BBWY.Client.Extensions;
using BBWY.Client.Views.PackTaskAbort;
using System.Windows.Controls;
using BBWY.Client.Views.SomeArrival;
namespace BBWY.Client.ViewModels.PackTask
{
@ -805,6 +806,12 @@ namespace BBWY.Client.ViewModels.PackTask
/// </summary>
public ICommand PrintShelvesNumberCommand { get; set; }
/// <summary>
/// 打印部分到货任务信息
/// </summary>
public ICommand PrintShelvesCommand { get; set; }
public WareHouseListViewModel(PackTaskService packTaskService, GlobalContext globalContext, SealBoxService sealBoxService, PackUserService packUserService, MarkMessageService markMessageService, QualityTaskService qualityTaskService, PackagingTaskService packagingTaskService, PackTaskAbortService packTaskAbortService)
{
@ -947,6 +954,8 @@ namespace BBWY.Client.ViewModels.PackTask
PrintShelvesNumberCommand = new RelayCommand<PackTaskModel>(PrintShelvesNumber);
PrintShelvesCommand = new RelayCommand<PackTaskModel>(PrintShelves);
LoadSplitDatas();
}
@ -963,7 +972,11 @@ namespace BBWY.Client.ViewModels.PackTask
}
}
}
private void PrintShelves(PackTaskModel model)
{
PrintSomeArrivalWindow window = new PrintSomeArrivalWindow(packTaskAbortService, model, ReflashTask, ShelvesNumberList, FloorNumberList);
window.ShowDialog();
}
private void PrintShelvesNumber(PackTaskModel model)
@ -1261,21 +1274,22 @@ namespace BBWY.Client.ViewModels.PackTask
if (isqualityBrand)
{
if (IsNeedCer == Need.)
{
QualityWindow service = new QualityWindow(model, ReflashTask, IsNeedCer, markType, packTaskRes.Data);
service.ShowDialog();
}
else
{
BatchPrintWindow window = new BatchPrintWindow(markType, IsNeedCer, model.TaskId, model.BrandName, model.SkuCount, model.CertificateModel, model.BarCodeModel, qualityTaskService,
ReflashTask
);
window.ShowDialog();
}
//if (IsNeedCer == Need.需要 || !packTaskRes.Data.SkuPurchaseSchemeId.IsNullOrEmpty())//查看配件配件
//{
// QualityWindow service = new QualityWindow(model, ReflashTask, IsNeedCer, markType, packTaskRes.Data);
// service.ShowDialog();
//}
//else
//{
// BatchPrintWindow window = new BatchPrintWindow(markType, IsNeedCer, model.TaskId, model.BrandName, model.SkuCount, model.CertificateModel, model.BarCodeModel, qualityTaskService,
// ReflashTask
// );
// window.ShowDialog();
//}

32
BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs

@ -535,14 +535,9 @@ namespace BBWY.Client.ViewModels
}
request.BarcodeId = BarCodeModel.Id;
}
if (IsNeedPrintCer == Need.)
IsNeedPrintCer = Need.;
if (PurchaseSkuList != null && PurchaseSkuList.Count > 0 && purchaseSkuList.Any(p => p.IsNeedCer))
{
//if ()
//{
// MessageBox.Show("无可用的合格证打印!");
// return;
//}
if (PurchaseSkuList.Where(p => p.IsSetCertificate).Count() > 0)
{
MessageBox.Show("存在未确认的合格证,请先完成确认!");
@ -560,25 +555,16 @@ namespace BBWY.Client.ViewModels
return;
}
request.CerId = string.Join(",", PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO.Id));
IsNeedPrintCer = Need.;
}
try
{
var competeRes = qualityTaskService.CompeteQualityTask(request);
if (competeRes == null)
{
MessageBox.Show("网络异常");
return;
}
if (!competeRes.Success)
{
MessageBox.Show(competeRes.Msg);
return;
}
BatchPrintWindow batchPrint = new BatchPrintWindow(BrandMarkType, IsNeedPrintCer, TaskId,BrandName, SkuCount,
BatchPrintWindow batchPrint = new BatchPrintWindow(BrandMarkType, IsNeedPrintCer, TaskId, BrandName, SkuCount,
PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO != null && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray()
, BarCodeModel, qualityTaskService,()=> {
, BarCodeModel, qualityTaskService, () =>
{
ReflashWindow?.Invoke();
var window = obj as BWindow;
@ -840,6 +826,12 @@ namespace BBWY.Client.ViewModels
}));
//PurchaseSkuList.Add(item);
}
//if (cer == Need.不需要 && PurchaseSkuList != null)
// foreach (var item in PurchaseSkuList)
// {
// item.IsNeedCer = false;
// }
}
if (BarCodeModel == null)
{

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

@ -69,7 +69,6 @@
</Setter>
</Style>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="500"/>
@ -81,7 +80,7 @@
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}" Grid.ColumnSpan="2"
Background="{StaticResource Button.Background}">
<TextBlock Text="包装任务配置" HorizontalAlignment="Left" Foreground="White" Margin="20 0 0 0" VerticalAlignment="Center"/>
</Border>
@ -508,7 +507,7 @@
<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 Grid.Row="1" HorizontalAlignment="Stretch" Margin="20 10 20 10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="45"/>
<ColumnDefinition/>
@ -522,13 +521,13 @@
<c:BButton Grid.Column="2" Content="打印" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch"
Click="BButton_Click"
/>
</Grid>
</Grid>-->
</StackPanel>
</ScrollViewer.Content>
</ScrollViewer>
</Grid>
<Grid Grid.Row="1" Grid.Column="1" Visibility="Hidden" >
<Grid Grid.Row="1" Grid.Column="1" Visibility="Visible" >
<Grid x:Name="print_box" Height="492" Width="272">
<Grid Margin="0 10 0 10" Width="272">
<Grid.RowDefinitions>
@ -589,7 +588,7 @@
<TextBlock TextWrapping="Wrap">
<Run Text="任务量:"/>
<Run Text="{Binding PackTaskModel.FeesItemResponse.ProcessComboTaskCount}"/>
<Run Text="{Binding ProcessTaskCount}"/>
</TextBlock>
<TextBlock TextWrapping="Wrap" Grid.Column="1">
<Run Text="配件数量:"/>
@ -615,7 +614,7 @@
</Grid.ColumnDefinitions>
<TextBlock Margin="0 0 0 0" FontSize="15" FontWeight="Bold">
<Run Text="包装员:"/>
<Run Text="{Binding PackTaskModel.PackUser}"/>
<Run Text="{Binding PackUserName}"/>
</TextBlock>
<TextBlock Margin="0 0 0 0" Style="{StaticResource middleTextBlock}" Grid.Column="1" FontWeight="Bold">
<Run Text="包装收益:"/>
@ -624,22 +623,22 @@
</Grid>
<TextBlock Margin="0 0 0 0" FontSize="13" FontWeight="Bold">
<Run Text="截止时间:"/>
<Run Text="{Binding PackTaskModel.PackCompletionOverTime,StringFormat='d号 HH:mm'}"/>
<Run Text="{Binding PackCompletionOverTime,StringFormat='d号 HH:mm'}"/>
</TextBlock>
<TextBlock Margin="0 5 0 5">
<Run Text="工序套餐:"/>
<Run Text="{Binding PackTaskModel.FeesItemResponse.ProcessComboName}"/>
<Run Text="{Binding ProcessComboName}"/>
</TextBlock>
<ListBox
ItemsSource="{Binding PackTaskModel.FeesItemResponse.ConsumableList}"
ItemsSource="{Binding ConsumableNameList}"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Foreground="{StaticResource Text.Color}">
>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Height="40">
<TextBlock Text="{Binding ItemName}"/>
<Grid Height="20">
<TextBlock Text="{Binding }"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
@ -668,9 +667,10 @@
</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}}}"
Click="BButton_Click_1"
/>
<!-- Command="{Binding UpLoadPackCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"-->
</Grid>

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

@ -2,6 +2,7 @@
using BBWY.Client.Helpers;
using BBWY.Client.Models;
using BBWY.Client.ViewModels.PackTask;
using BBWY.Client.Views.PackagingTask;
using BBWY.Controls;
using System;
using System.Collections.Generic;
@ -40,7 +41,7 @@ namespace BBWY.Client.Views.PackTask
var serviceViewModel = this.DataContext as PackDetailViewModel;
if (model.Brand.IsNullOrEmpty())
{
if (model.BarCodeModel!=null&&!model.BarCodeModel.Brand.IsNullOrEmpty())
if (model.BarCodeModel != null && !model.BarCodeModel.Brand.IsNullOrEmpty())
model.Brand = model.BarCodeModel.Brand;
else if (model.CertificateModel != null && model.CertificateModel.Any(c => c.Brand != null))
model.Brand = model.CertificateModel.FirstOrDefault(c => c.Brand != null)?.Brand;
@ -65,8 +66,14 @@ namespace BBWY.Client.Views.PackTask
serviceViewModel.OrderId = model.OrderId;
serviceViewModel.SkuId = model.SkuId;
serviceViewModel.PackUserName = model.PackUser?.Replace("\r\n", ",")?.Replace("\n", ",")?.Replace("\r", ",");
serviceViewModel.ProcessComboName = model.FeesItemResponse?.ProcessComboName;
serviceViewModel.PackCompletionOverTime = model.PackCompletionOverTime;
serviceViewModel.ConsumableNameList = model.FeesItemResponse?.ConsumableList?.Select(c =>
{
return $"{c.ItemName}";
})?.ToList();
serviceViewModel.PackerFee = model.FeesItemResponse?.PackFees*(model.FeesItemResponse?.PackerDiscount??0.85m) ;
serviceViewModel.PackerFee = model.FeesItemResponse?.PackFees * (model.FeesItemResponse?.PackerDiscount ?? 0.85m);
serviceViewModel.LoadPackDatas();
if (reflashWindow != null)
serviceViewModel.ReflashWindow = reflashWindow;
@ -94,24 +101,27 @@ namespace BBWY.Client.Views.PackTask
// MessageBox.Show("页面加载中,请重试!");
// return;
//}
string printName = cbPrintName.Text.Trim();
PrintBox(printName);
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
{
//string printName = cbPrintName.Text.Trim();
//PrintBox(printName);
//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);
//File.WriteAllText(printNames, cbPrintName.Text);
//var serviceViewModel = this.DataContext as PackDetailViewModel;
//serviceViewModel?.ReflashWindow?.Invoke();
return;
}
@ -229,5 +239,19 @@ namespace BBWY.Client.Views.PackTask
}
}
private void BButton_Click_1(object sender, RoutedEventArgs e)
{
var serviceViewModel = this.DataContext as PackDetailViewModel;
serviceViewModel.UpLoadPackCommand.Execute(this);
}
}
}

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

@ -185,7 +185,8 @@
<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="4" Style="{StaticResource middleTextBlock}" Visibility="{Binding TaskState, Converter={StaticResource objConverter},ConverterParameter=部分到货:Collapsed:Visible}" />
<TextBlock Text="摆放货架" Grid.Column="4" Style="{StaticResource middleTextBlock}" Visibility="{Binding TaskState, Converter={StaticResource objConverter},ConverterParameter=部分到货:Visible:Collapsed}" />
<TextBlock Text="物流信息" Grid.Column="5" Style="{StaticResource middleTextBlock}"/>
<!--<TextBlock Text="注意事项/对接备注" Grid.Column="6" Style="{StaticResource middleTextBlock}"/>-->
<TextBlock Text="费用" Grid.Column="7" Style="{StaticResource middleTextBlock}"/>
@ -408,7 +409,7 @@
</StackPanel>
</Grid>
<Grid Grid.Column="4" >
<Grid Grid.Column="4" Visibility="{Binding DataContext.TaskState,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}, Converter={StaticResource objConverter},ConverterParameter=部分到货:Collapsed:Visible}">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left">
<StackPanel Margin="10,5" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock Text="基础包装:"/>
@ -423,6 +424,37 @@
</StackPanel>
</Grid>
<Grid Grid.Column="4" Visibility="{Binding DataContext.TaskState,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}, Converter={StaticResource objConverter},ConverterParameter=部分到货:Visible:Collapsed}" >
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding ShelvesNumber, Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding ShelvesNumber}"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="号货架,"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding FloorNumber}"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="层"/>
</StackPanel>
<!--<StackPanel Orientation="Horizontal" Margin="0 10 0 0 ">
<c:BButton Content="修改" Style="{StaticResource LinkButton}"
CommandParameter="{Binding}"
Command="{Binding DataContext.UpdateShelvesNumberCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
/>
<c:BButton Content="打印" Style="{StaticResource LinkButton}" Margin="10 0 0 0 "
CommandParameter="{Binding}"
Command="{Binding DataContext.PrintShelvesNumberCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type UserControl}}}"
/>
</StackPanel>-->
</StackPanel>
</Grid>
<Grid Grid.Column="5">
<ListBox x:Name="listbox_expressorder" ItemsSource="{Binding ExpressOrderList}"
Style="{StaticResource NoScrollViewListBoxStyle}" BorderThickness="0"
@ -563,11 +595,16 @@ Command="{Binding SetServiceCommand}"
CommandParameter="{Binding}"
Command="{Binding DataContext.UpdateTaskStateCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
>
/>
</Grid>
</c:BButton>
</Grid>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" Margin="0 10 0 10" VerticalAlignment="Center" Content="打印标签"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=部分到货:Visible:Collapsed}"
CommandParameter="{Binding}"
Command="{Binding DataContext.PrintShelvesCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}"
/>
<c:BButton Grid.Column="11" HorizontalAlignment="Stretch" Style="{StaticResource LinkButton}" Margin="0 5 0 5 " VerticalAlignment="Center" Content="{Binding ShowSendMsg,Converter={StaticResource objConverter},ConverterParameter=False:任务备注:取消备注}"
CommandParameter="{Binding TaskId}"

56
BBWY.Client/Views/PackagingTask/PrintPackDetailWindow.xaml

@ -0,0 +1,56 @@
<c:BWindow x:Class="BBWY.Client.Views.PackagingTask.PrintPackDetailWindow"
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.PackagingTask"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
Height="219" Width="378"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!-- DataContext="{Binding CreateSetBarCodeView,Source={StaticResource Locator}}"-->
<Window.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>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="打印包装明细" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<StackPanel Grid.Row="1" Orientation="Vertical" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 10">
<TextBlock Margin="0 0 5 0" Style="{StaticResource middleTextBlock}" Text="打印机:"/>
<Border BorderBrush="{StaticResource Border.Brush}" VerticalAlignment="Center" BorderThickness="1" Height="30" >
<ComboBox x:Name="cbPrints" BorderThickness="0" Height="25" Width="200" VerticalAlignment="Center" HorizontalAlignment="Left" ItemsSource="{Binding PrintList}" Text="{Binding PrintName}" />
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="62 0 0 0">
<TextBlock Margin="0 0 5 0" Style="{StaticResource middleTextBlock}" Text="份数:"/>
<c:BTextBox Text="{Binding PrintCount}" Height="30" Width="200" />
</StackPanel>
</StackPanel>
<Border Grid.Row="2" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Background}" BorderThickness="1"/>
<c:BButton Background="{StaticResource Button.Background}" Grid.Row="2" Content="打印" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch" Click="BButton_Click"
/>
</Grid>
</c:BWindow>

131
BBWY.Client/Views/PackagingTask/PrintPackDetailWindow.xaml.cs

@ -0,0 +1,131 @@
using BBWY.Client.Models;
using BBWY.Client.Views.PackTask;
using BBWY.Client.Views.SplitTask;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing.Printing;
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;
using WebSocketSharp;
namespace BBWY.Client.Views.PackagingTask
{
/// <summary>
/// PrintPackDetailWindow.xaml 的交互逻辑
/// </summary>
public partial class PrintPackDetailWindow : BWindow
{
public PrintPackDetailWindow(PackDetailWindow printWindow)
{
InitializeComponent();
InitPrintList();
this.DataContext = this;
this.printWindow = printWindow;
}
private PackTaskModel model;
PackDetailWindow printWindow;
/// <summary>
/// 打印机列表
/// </summary>
public ObservableCollection<string> PrintList { get; set; }
public string PrintName { get; set; }
public int PrintCount { get => printCount; set { Set(ref printCount, value); } }
private int printCount = 1;
public void InitPrintList()
{
PrintList = new ObservableCollection<string>();
var printingNames = PrinterSettings.InstalledPrinters;//获取本机的打印机数据
int index = -1;
int selectIndex = 0;
foreach (string name in printingNames)
{
if (name == "Microsoft XPS Document Writer" || name == "Microsoft Print to PDF" || name == "Fax")
{
continue;
}
index++;
if (name.Contains("Deli"))
{
selectIndex = index;
}
PrintList.Add(name);
}
try
{
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string printNames = System.IO.Path.Combine(applicationPath, "printName.init");
if (File.Exists(printNames))
{
PrintName = File.ReadAllText(printNames);
}
else
{
if (PrintList.Count > 0)
{
PrintName = PrintList[0].ToString();
}
}
}
catch (Exception)
{
}
}
private void BButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
if (PrintName.IsNullOrEmpty())
{
MessageBox.Show("请选择打印设备");
return;
}
if (string.IsNullOrEmpty(PrintName))
{
return;
}
var localPrintServer = new LocalPrintServer();
var printQueue = localPrintServer.GetPrintQueue(PrintName);
if (printQueue.IsInError)
{
System.Windows.MessageBox.Show("打印机处于错误状态");
return;
}
for (int i = 0; i < PrintCount; i++)
{
printWindow.PrintBox(PrintName);
}
this.Close();
}
}
}

97
BBWY.Client/Views/SomeArrival/PrintSomeArrivalWindow.xaml

@ -0,0 +1,97 @@
<c:BWindow x:Class="BBWY.Client.Views.SomeArrival.PrintSomeArrivalWindow"
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.SomeArrival"
mc:Ignorable="d"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
Height="330" Width="378"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:ctr="clr-namespace:BBWY.Client.Converters"
xmlns:cmodel="clr-namespace:BBWY.Client.Models"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
CloseButtonVisibility="Visible"
CloseButtonColor="{StaticResource WindowButtonColor}"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0">
<!-- DataContext="{Binding CreateSetBarCodeView,Source={StaticResource Locator}}"-->
<Window.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>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="80"/>
<RowDefinition/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}"
Background="{StaticResource Border.Background}">
<TextBlock Text="打印异常任务" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<StackPanel Orientation="Vertical" Grid.Row="2" HorizontalAlignment="Left" Margin="50 0 0 10">
<StackPanel Orientation="Horizontal" Margin="0 10 0 10">
<TextBlock Text="摆放货架:" Style="{StaticResource middleTextBlock}" />
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" CornerRadius="1" Height="30">
<StackPanel Orientation="Horizontal">
<Label Content="货架编号" BorderThickness="0 0 0 0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="70"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Left"/>
<ComboBox Height="30" HorizontalAlignment="Stretch" ItemsSource="{Binding ShelvesNumberList}" Text="{Binding ShelvesNumber}" BorderThickness="0" Margin="1" />
</StackPanel>
</Border>
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" CornerRadius="1" Height="30" Margin="10 0 0 0">
<StackPanel Orientation="Horizontal">
<Label Content="货架层数" BorderThickness="0 0 0 0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="70"/>
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Left"/>
<ComboBox Height="30" HorizontalAlignment="Stretch" ItemsSource="{Binding FloorNumberList}" Text="{Binding FloorNumber}" BorderThickness="0" Margin="1" />
</StackPanel>
</Border>
</StackPanel>
<c:BTextBox Text="{Binding RemarkMsg}" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" WaterRemark="备注消息" VerticalAlignment="Top" MinHeight="100" TextWrapping="Wrap" AcceptsReturn="True" />
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Vertical" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 10">
<TextBlock Margin="0 0 5 0" Style="{StaticResource middleTextBlock}" Text="打印机:"/>
<Border BorderBrush="{StaticResource Border.Brush}" VerticalAlignment="Center" BorderThickness="1" Height="30" >
<ComboBox x:Name="cbPrints" BorderThickness="0" Height="25" Width="200" VerticalAlignment="Center" HorizontalAlignment="Left" ItemsSource="{Binding PrintList}" Text="{Binding PrintName}" />
</Border>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="62 0 0 0">
<TextBlock Margin="0 0 5 0" Style="{StaticResource middleTextBlock}" Text="份数:"/>
<c:BTextBox Text="{Binding PrintCount}" Height="30" Width="200" />
</StackPanel>
</StackPanel>
<Border Grid.Row="3" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Background}" BorderThickness="1"/>
<c:BButton Background="{StaticResource Button.Background}" Grid.Row="3" Content="打印" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch" Click="BButton_Click"
/>
</Grid>
</c:BWindow>

230
BBWY.Client/Views/SomeArrival/PrintSomeArrivalWindow.xaml.cs

@ -0,0 +1,230 @@
using BBWY.Client.APIServices.QiKu;
using BBWY.Client.Extensions;
using BBWY.Client.Models;
using BBWY.Client.Views.SplitTask;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing.Printing;
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;
using WebSocketSharp;
namespace BBWY.Client.Views.SomeArrival
{
/// <summary>
/// PrintSomeArrivalWindow.xaml 的交互逻辑
/// </summary>
public partial class PrintSomeArrivalWindow : BWindow
{
public PrintSomeArrivalWindow(PackTaskAbortService packTaskAbortService, PackTaskModel model, Action reFlashWindow, List<string> shelvesNumberList, List<int> floorNumberList)
{
InitializeComponent();
InitPrintList();
this.DataContext = this;
this.model = model;
this.packTaskAbortService = packTaskAbortService;
if (!model.ShelvesNumber.IsNullOrEmpty())
ShelvesNumber = model.ShelvesNumber;
if (model.FloorNumber != null) FloorNumber = model.FloorNumber;
if (model.AbortRemark != null) RemarkMsg = model.AbortRemark;
FloorNumberList = floorNumberList;
ShelvesNumberList = shelvesNumberList;
ReFlashWindow = reFlashWindow;
}
private string remarkMsg;
/// <summary>
/// 货架
/// </summary>
public string RemarkMsg { get => remarkMsg; set { Set(ref remarkMsg, value); } }
Action ReFlashWindow;
PackTaskAbortService packTaskAbortService;
private List<int> floorNumberList = new List<int> { 1, 2, 3, 4 };
/// <summary>
/// 层数列表
/// </summary>
public List<int> FloorNumberList { get => floorNumberList; set { Set(ref floorNumberList, value); } }
private int? floorNumber;
/// <summary>
///层数
/// </summary>
public int? FloorNumber { get => floorNumber; set { Set(ref floorNumber, value); } }
private List<string> shelvesNumberList;
/// <summary>
/// 货架列表
/// </summary>
public List<string> ShelvesNumberList { get => shelvesNumberList; set { Set(ref shelvesNumberList, value); } }
private string shelvesNumber;
/// <summary>
/// 货架
/// </summary>
public string ShelvesNumber { get => shelvesNumber; set { Set(ref shelvesNumber, value); } }
private PackTaskModel model;
/// <summary>
/// 打印机列表
/// </summary>
public ObservableCollection<string> PrintList { get; set; }
public string PrintName { get; set; }
public int PrintCount { get => printCount; set { Set(ref printCount, value); } }
private int printCount = 1;
public void InitPrintList()
{
PrintList = new ObservableCollection<string>();
var printingNames = PrinterSettings.InstalledPrinters;//获取本机的打印机数据
int index = -1;
int selectIndex = 0;
foreach (string name in printingNames)
{
if (name == "Microsoft XPS Document Writer" || name == "Microsoft Print to PDF" || name == "Fax")
{
continue;
}
index++;
if (name.Contains("Deli"))
{
selectIndex = index;
}
PrintList.Add(name);
}
try
{
var applicationPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string printNames = System.IO.Path.Combine(applicationPath, "printName.init");
if (File.Exists(printNames))
{
PrintName = File.ReadAllText(printNames);
}
else
{
if (PrintList.Count > 0)
{
PrintName = PrintList[0].ToString();
}
}
}
catch (Exception)
{
}
}
public void PrintBox()
{
}
private void BButton_Click(object sender, System.Windows.RoutedEventArgs e)
{
if (PrintName.IsNullOrEmpty())
{
MessageBox.Show("请选择打印设备");
return;
}
if (string.IsNullOrEmpty(PrintName))
{
return;
}
var localPrintServer = new LocalPrintServer();
var printQueue = localPrintServer.GetPrintQueue(PrintName);
if (printQueue.IsInError)
{
System.Windows.MessageBox.Show("打印机处于错误状态");
return;
}
if (ShelvesNumber.IsNullOrEmpty() || FloorNumber==null )
{
MessageBox.Show("请输入摆放货架位置");
return;
}
var res = packTaskAbortService.SaveTaskShelves(model.TaskId, ShelvesNumber, FloorNumber,remarkMsg);
if (res==null||!res.Success)
{
MessageBox.Show(res.Msg ?? "未知错误!");
return;
}
model.ShelvesNumber = ShelvesNumber;
model.FloorNumber = FloorNumber;
model.AbortRemark = RemarkMsg;
SomeArrivalWindow window = new SomeArrivalWindow(model);
//window.ShowDialog();
for (int i = 0; i < PrintCount; i++)
{
window.Print(PrintName);
}
this.Close();
ReFlashWindow?.Invoke();
try
{
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, PrintName);
}
catch (Exception)
{
}
}
}
}

46
BBWY.Client/Views/SomeArrival/SomeArrivalWindow.xaml

@ -0,0 +1,46 @@
<c:BWindow x:Class="BBWY.Client.Views.SomeArrival.SomeArrivalWindow"
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.SomeArrival"
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls"
mc:Ignorable="d"
CloseButtonVisibility="Visible"
WindowStartupLocation="CenterScreen"
CloseButtonColor="White"
MinButtonVisibility="Collapsed"
MaxButtonVisibility="Collapsed"
RightButtonGroupMargin="0,5,5,0"
Title="ExceptionTaskWindow" Height="567" Width="388">
<Grid Visibility="Visible" >
<Grid x:Name="print_box" Height="492" Width="272">
<StackPanel Margin="10 10 10 10" Width="252" HorizontalAlignment="Center" Orientation="Vertical">
<TextBlock FontSize="28" FontWeight="Bold">
<Run Text="任务ID:"/>
</TextBlock>
<TextBlock FontSize="60" FontWeight="Bold">
<Run Text="{Binding Model.TaskIdRemark}"/>
</TextBlock>
<StackPanel Orientation="Horizontal" Margin="0 10 0 10">
<TextBlock Style="{StaticResource middleTextBlock}" Text="摆放货号: " FontSize="20" />
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding Model.ShelvesNumber}" FontSize="20"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="号货架,第" FontSize="20"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="{Binding Model.FloorNumber}" FontSize="20"/>
<TextBlock Style="{StaticResource middleTextBlock}" Text="层" FontSize="20"/>
</StackPanel>
<TextBlock TextWrapping="Wrap" >
<Run Text="备注信息:"/>
<Run Text="{Binding Model.AbortRemark}"/>
</TextBlock>
</StackPanel>
</Grid>
</Grid>
</c:BWindow>

62
BBWY.Client/Views/SomeArrival/SomeArrivalWindow.xaml.cs

@ -0,0 +1,62 @@
using BBWY.Client.Helpers;
using BBWY.Client.Models;
using BBWY.Controls;
using System;
using System.Collections.Generic;
using System.Printing;
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.SomeArrival
{
/// <summary>
/// SomeArrivalWindow.xaml 的交互逻辑
/// </summary>
public partial class SomeArrivalWindow : BWindow
{
public SomeArrivalWindow(PackTaskModel model)
{
InitializeComponent();
this.DataContext = this;
Model = model;
}
private PackTaskModel model;
public PackTaskModel Model { get => model; set { Set(ref model, value); } }
public string taskIdRemark;
public string TaskIdRemark { get => taskIdRemark; set { Set(ref taskIdRemark, value); } }
public string remarkMsg;
public string RemarkMsg { get => remarkMsg; set { Set(ref remarkMsg, value); } }
public string exceptType;
public string ExceptType { get => exceptType; set { Set(ref exceptType, value); } }
public void Print(string printName)
{
MyPrintHelper.SetDefaultPrint(printName);//设置默认打印机
PrintDialog printDialog = new PrintDialog();
//Height="492" Width="272" 567 388
printDialog.PrintTicket.PageOrientation = PageOrientation.ReversePortrait;//设置为横向打印 PageOrientation.Landscape Portrait为纵向 //设置纸张大小
var pageWidth = (int)Math.Ceiling(printDialog.PrintableAreaWidth);
var pageHeight = (int)Math.Ceiling(printDialog.PrintableAreaHeight);
printDialog.PrintTicket.PageMediaSize = new PageMediaSize(pageWidth, pageHeight);
print_box.Height = pageHeight;
print_box.Width = pageWidth;
this.print_box.Arrange(new Rect(new System.Windows.Point(0, 0), new System.Windows.Size(pageWidth, pageHeight)));
this.UpdateLayout(); //刷新界面
printDialog.PrintVisual(this.print_box, "打印任务");
this.Close();
}
}
}

4
BBWY.Client/Views/SplitTask/PrintExceptionTaskWindow.xaml

@ -37,7 +37,6 @@ Style="{StaticResource bwstyle}"
Background="{StaticResource Border.Background}">
<TextBlock Text="打印异常任务" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<StackPanel Grid.Row="1" Orientation="Vertical" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="50 0 0 10">
<TextBlock Margin="0 0 5 0" Style="{StaticResource middleTextBlock}" Text="打印机:"/>
@ -58,9 +57,6 @@ Style="{StaticResource bwstyle}"
</StackPanel>
<Border Grid.Row="2" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Background}" BorderThickness="1"/>
<c:BButton Background="{StaticResource Button.Background}" Grid.Row="2" Content="打印" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch" Click="BButton_Click"
/>

7
BBWY.Client/Views/SplitTask/PrintExceptionTaskWindow.xaml.cs

@ -1,6 +1,7 @@
using BBWY.Client.Models;
using BBWY.Client.Models.APIModel;
using BBWY.Client.Views.FallWare;
using BBWY.Client.Views.PackTask;
using BBWY.Controls;
using System;
using System.Collections.Generic;
@ -116,8 +117,12 @@ namespace BBWY.Client.Views.SplitTask
}
ExceptionTaskWindow window = new ExceptionTaskWindow(model);
//window.ShowDialog();
for (int i = 0; i < PrintCount; i++)
{
window.Print(PrintName);
}
this.Close();

Loading…
Cancel
Save