Browse Source

打印 品牌换店铺

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
bdc5e7857a
  1. 2
      BBWY.Client/GlobalContext.cs
  2. 34
      BBWY.Client/Helpers/MyPrintHelper.cs
  3. 28
      BBWY.Client/Views/PackTask/MinBarcodeControl.xaml

2
BBWY.Client/GlobalContext.cs

@ -13,7 +13,7 @@ namespace BBWY.Client
{
ShopServiceGroupList = new List<string>();
ShopServiceGroupLowerList = new List<string>();
ClientVersion = "10145";
ClientVersion = "10147";
}
private User user;

34
BBWY.Client/Helpers/MyPrintHelper.cs

@ -40,11 +40,11 @@ namespace BBWY.Client.Helpers
//SetBarStander(barCode, ref args, font);
break;
case BarcodeLabelModel.:
font = new Font("宋体", 10, System.Drawing.FontStyle.Regular);
//SetBar(barCode, ref args, font, 15);
//font = new Font("宋体", 10, System.Drawing.FontStyle.Regular);
////SetBar(barCode, ref args, font, 15);
SetBarSimplify(barCode, ref args, font);
break;
//SetBarSimplify(barCode, ref args, font);
//break;
case BarcodeLabelModel.:
font = new Font("宋体", 10, System.Drawing.FontStyle.Regular);
SetBar(barCode, ref args, font, 7);
@ -61,26 +61,26 @@ namespace BBWY.Client.Helpers
string barcodeSku = $"POP{barCode.SkuId}";
Barcode barcode = new Barcode();
System.Drawing.Image img = barcode.Encode(TYPE.CODE128, barcodeSku, 500, 40);
SizeF size = args.Graphics.MeasureString("品", font);
SizeF size = args.Graphics.MeasureString("品", font);
var sizeHeight = size.Height;//字体高度
topHeigth += 10;
switch (barCode.LabelModel)
{
case BarcodeLabelModel.:
case BarcodeLabelModel.:
args.Graphics.DrawString($"品牌: {barCode.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, topHeigth));
topHeigth += (heightSpace + sizeHeight);
break;
case BarcodeLabelModel.:
break;
}
//switch (barCode.LabelModel)
//{
// case BarcodeLabelModel.无型号模板:
// case BarcodeLabelModel.标准模板:
// args.Graphics.DrawString($"品牌: {barCode.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, topHeigth));
// topHeigth += (heightSpace + sizeHeight);
// break;
// case BarcodeLabelModel.精简模板:
// break;
//}
//args.Graphics.DrawString($"品名: {barCode.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, topHeigth));
//topHeigth += (heightSpace + sizeHeight);
args.Graphics.DrawString($"品名: {barCode.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, topHeigth));
topHeigth += (heightSpace + sizeHeight);
switch (barCode.LabelModel)

28
BBWY.Client/Views/PackTask/MinBarcodeControl.xaml

@ -9,19 +9,23 @@
<Grid DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:MinBarcodeControl}}}">
<DockPanel Grid.Row="1">
<Border Name="jingjian" Visibility="{Binding model.LabelModel,Converter={StaticResource objConverter},ConverterParameter=精简模板:Visible:Collapsed}" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Margin="1">
<StackPanel Orientation="Vertical">
<TextBlock Margin="10,25,10,0" FontSize="15" FontWeight="Black" >
<StackPanel Orientation="Vertical" >
<TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" >
<Run Text="品名:"/>
<Run Text="{Binding model.BrandName}"/>
</TextBlock>
<TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" >
<Run Text="规格:"/>
<Run Text="{Binding model.SkuName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<Run Text="{Binding model.SkuName}"/>
</TextBlock>
<TextBlock Margin="10,25,10,0" FontSize="15" FontWeight="Black" >
<TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" >
<Run Text="店铺:"/>
<Run Text="{Binding model.ShopName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<Run Text="{Binding model.ShopName}"/>
</TextBlock>
<Image Source="{Binding BarcodeImage,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="10,25,10,0"/>
<Image Source="{Binding BarcodeImage,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Margin="10,10,10,0"/>
<TextBlock Text="POP" HorizontalAlignment="Center" Margin="10,0,10,0" FontSize="15" FontWeight="Black" >
<Run Text="{Binding model.SkuId,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<Run Text="{Binding model.SkuId}"/>
</TextBlock>
</StackPanel>
</Border>
@ -29,8 +33,8 @@
<StackPanel Orientation="Vertical" >
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品:"/>
<Run Text="{Binding model.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
<Run Text="品:"/>
<Run Text="{Binding model.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
@ -54,8 +58,8 @@
<Border Name="wuxinghao" Visibility="{Binding model.LabelModel,Converter={StaticResource objConverter},ConverterParameter=无型号模板:Visible:Collapsed}" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Margin="1">
<StackPanel Orientation="Vertical" >
<TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" >
<Run Text="品:"/>
<Run Text="{Binding model.Brand}"/>
<Run Text="品:"/>
<Run Text="{Binding model.BrandName}"/>
</TextBlock>
<TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" >

Loading…
Cancel
Save