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>(); ShopServiceGroupList = new List<string>();
ShopServiceGroupLowerList = new List<string>(); ShopServiceGroupLowerList = new List<string>();
ClientVersion = "10145"; ClientVersion = "10147";
} }
private User user; private User user;

34
BBWY.Client/Helpers/MyPrintHelper.cs

@ -40,11 +40,11 @@ namespace BBWY.Client.Helpers
//SetBarStander(barCode, ref args, font); //SetBarStander(barCode, ref args, font);
break; break;
case BarcodeLabelModel.: case BarcodeLabelModel.:
font = new Font("宋体", 10, System.Drawing.FontStyle.Regular); //font = new Font("宋体", 10, System.Drawing.FontStyle.Regular);
//SetBar(barCode, ref args, font, 15); ////SetBar(barCode, ref args, font, 15);
SetBarSimplify(barCode, ref args, font); //SetBarSimplify(barCode, ref args, font);
break; //break;
case BarcodeLabelModel.: case BarcodeLabelModel.:
font = new Font("宋体", 10, System.Drawing.FontStyle.Regular); font = new Font("宋体", 10, System.Drawing.FontStyle.Regular);
SetBar(barCode, ref args, font, 7); SetBar(barCode, ref args, font, 7);
@ -61,26 +61,26 @@ namespace BBWY.Client.Helpers
string barcodeSku = $"POP{barCode.SkuId}"; string barcodeSku = $"POP{barCode.SkuId}";
Barcode barcode = new Barcode(); Barcode barcode = new Barcode();
System.Drawing.Image img = barcode.Encode(TYPE.CODE128, barcodeSku, 500, 40); 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;//字体高度 var sizeHeight = size.Height;//字体高度
topHeigth += 10; topHeigth += 10;
switch (barCode.LabelModel) //switch (barCode.LabelModel)
{ //{
case BarcodeLabelModel.: // case BarcodeLabelModel.无型号模板:
case BarcodeLabelModel.: // case BarcodeLabelModel.标准模板:
args.Graphics.DrawString($"品牌: {barCode.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, topHeigth)); // args.Graphics.DrawString($"品牌: {barCode.Brand}", font, System.Drawing.Brushes.Black, new PointF(10, topHeigth));
topHeigth += (heightSpace + sizeHeight); // topHeigth += (heightSpace + sizeHeight);
break; // break;
case BarcodeLabelModel.: // case BarcodeLabelModel.精简模板:
break; // break;
} //}
//args.Graphics.DrawString($"品名: {barCode.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, topHeigth)); args.Graphics.DrawString($"品名: {barCode.BrandName}", font, System.Drawing.Brushes.Black, new PointF(10, topHeigth));
//topHeigth += (heightSpace + sizeHeight); topHeigth += (heightSpace + sizeHeight);
switch (barCode.LabelModel) 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}}}"> <Grid DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:MinBarcodeControl}}}">
<DockPanel Grid.Row="1"> <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"> <Border Name="jingjian" Visibility="{Binding model.LabelModel,Converter={StaticResource objConverter},ConverterParameter=精简模板:Visible:Collapsed}" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Margin="1">
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical" >
<TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" >
<TextBlock Margin="10,25,10,0" 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="规格:"/>
<Run Text="{Binding model.SkuName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> <Run Text="{Binding model.SkuName}"/>
</TextBlock> </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="店铺:"/>
<Run Text="{Binding model.ShopName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> <Run Text="{Binding model.ShopName}"/>
</TextBlock> </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" > <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> </TextBlock>
</StackPanel> </StackPanel>
</Border> </Border>
@ -29,8 +33,8 @@
<StackPanel Orientation="Vertical" > <StackPanel Orientation="Vertical" >
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" > <TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" >
<Run Text="品:"/> <Run Text="品:"/>
<Run Text="{Binding model.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> <Run Text="{Binding model.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
</TextBlock> </TextBlock>
<TextBlock Margin="10,10,10,0" FontSize="15" FontWeight="Black" > <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"> <Border Name="wuxinghao" Visibility="{Binding model.LabelModel,Converter={StaticResource objConverter},ConverterParameter=无型号模板:Visible:Collapsed}" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Margin="1">
<StackPanel Orientation="Vertical" > <StackPanel Orientation="Vertical" >
<TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" > <TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" >
<Run Text="品:"/> <Run Text="品:"/>
<Run Text="{Binding model.Brand}"/> <Run Text="{Binding model.BrandName}"/>
</TextBlock> </TextBlock>
<TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" > <TextBlock Margin="10,10,10,5" FontSize="15" FontWeight="Black" >

Loading…
Cancel
Save