506583276@qq.com 2 years ago
parent
commit
279075bff0
  1. 17
      BBWYB.Client/Models/PackPurchaseTask/PurchaseSku.cs
  2. 56
      BBWYB.Client/ViewModels/PackPurchaseTask/UpdatePurchaseTaskViewModel.cs
  3. 103
      BBWYB.Client/Views/PackPurchaseTask/UpdatePurchaseTaskWindow.xaml

17
BBWYB.Client/Models/PackPurchaseTask/PurchaseSku.cs

@ -10,7 +10,7 @@ namespace BBWYB.Client.Models.PackPurchaseTask
/// <summary>
/// 配件sku
/// </summary>
public class PurchaseSku:ObservableObject
public class PurchaseSku : ObservableObject
{
/// <summary>
@ -32,7 +32,7 @@ namespace BBWYB.Client.Models.PackPurchaseTask
/// <summary>
/// 配件图
/// </summary>
public string Logo { get=>logo; set { SetProperty(ref logo, value); } }
public string Logo { get => logo; set { SetProperty(ref logo, value); } }
/// <summary>
/// 配件商品Id
/// </summary>
@ -48,21 +48,16 @@ namespace BBWYB.Client.Models.PackPurchaseTask
/// <summary>
/// 合格证配置信息
/// </summary>
public CertificateModel CerDTO { get ; set ; }
public CertificateModel CerDTO { get; set; }
private bool isSetCertificate;
/// <summary>
/// 设置显示(合格证)
/// </summary>
public bool IsSetCertificate
{
get => isSetCertificate; set
{
public bool IsSetCertificate { get => isSetCertificate; set { SetProperty(ref isSetCertificate, value); } }
SetProperty(ref isSetCertificate, value);
//IsNeedCertificateModel = IsSetCertificate ? Need.不需要 : Need.需要;
}
}
}
}

56
BBWYB.Client/ViewModels/PackPurchaseTask/UpdatePurchaseTaskViewModel.cs

@ -472,34 +472,28 @@ namespace BBWYB.Client.ViewModels
Brand = productApiResponse.Data.Items[0].BrandName;
}
IsNeedBarCode = Need.;
IsSetBarCode = true;
IsSetCertificate = true;
var productSku = packPurchaseTaskService.GetConfigPack(SkuId, "", OrderId);
if (productSku == null || !productSku.Success || productSku.Data == null)
if (productSku == null)
{
MessageBox.Show(productSku.Msg);
MessageBox.Show("网络异常!");
return false;
}
PurchaseSkuList = new ObservableCollection<Models.PackPurchaseTask.PurchaseSku>();
SkuPurchaseSchemeId = null;
if (productSku.Success && productSku.Data != null && !string.IsNullOrEmpty(productSku.Data.SkuPurchaseSchemeId))
{
SkuPurchaseSchemeId = productSku.Data.SkuPurchaseSchemeId;
BarCodeModel = productSku.Data.BarCode;
if (BarCodeModel == null)
{
BarCodeModel = new BarCodeModel();
}
if (!string.IsNullOrEmpty(Brand))
BarCodeModel.Brand = Brand;
if (!string.IsNullOrEmpty(BrandName))
BarCodeModel.BrandName = BrandName;
BarCodeModel.ProductNo = ProductNo;
BarCodeModel.SkuId = SkuId;
BarCodeModel.SkuName = SkuName;
PurchaseSkuList = new ObservableCollection<Models.PackPurchaseTask.PurchaseSku>();
foreach (var item in productSku.Data.PurchaseSkus)
{
var list = purchaseService.GetPurchaseSkuBasicInfo(item.PurchaseProductId);
if (list == null) continue;
if (list == null || !list.Success || list.Data == null) continue;
var skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId);
if (skuItem == null)
{
@ -520,9 +514,7 @@ namespace BBWYB.Client.ViewModels
}));
}
IsNeedBarCode = Need.;
IsSetBarCode = true;
IsSetCertificate = true;
if (productSku.Data.PackConfig != null)
{
var config = productSku.Data.PackConfig;
@ -564,6 +556,30 @@ namespace BBWYB.Client.ViewModels
}
}
}
else
{
PurchaseSkuList.Add(new Models.PackPurchaseTask.PurchaseSku
{
CerDTO = new CertificateModel { }
});
}
if (BarCodeModel == null)
{
BarCodeModel = new BarCodeModel();
}
if (!string.IsNullOrEmpty(Brand))
BarCodeModel.Brand = Brand;
if (!string.IsNullOrEmpty(BrandName))
BarCodeModel.BrandName = BrandName;
BarCodeModel.ProductNo = ProductNo;
BarCodeModel.SkuId = SkuId;
BarCodeModel.SkuName = SkuName;
return true;

103
BBWYB.Client/Views/PackPurchaseTask/UpdatePurchaseTaskWindow.xaml

@ -128,13 +128,14 @@
<Grid Grid.Column="1">
<ListBox x:Name="listbox_order" HorizontalAlignment="Left"
Height="150" Width="900" Margin="0" ScrollViewer.HorizontalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
ItemsSource="{Binding PurchaseSkuList,Mode=TwoWay}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Foreground="{StaticResource Text.Color}">
Foreground="{StaticResource Text.Color}"
Visibility="{Binding SkuPurchaseSchemeId,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}"
>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" />
@ -236,6 +237,104 @@
</DockPanel>
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<ListBox x:Name="listbox_noSchemeId" HorizontalAlignment="Left"
Height="150" Width="900" Margin="0" ScrollViewer.HorizontalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}"
ItemsSource="{Binding PurchaseSkuList,Mode=TwoWay}"
BorderBrush="{StaticResource Border.Brush}"
BorderThickness="0"
Foreground="{StaticResource Text.Color}"
Visibility="{Binding SkuPurchaseSchemeId,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}"
>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid
MinHeight="100">
<StackPanel Orientation="Horizontal" Height="150">
<c:BAsyncImage UrlSource="{Binding Logo}" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1"
Height="150" Width="150" Stretch="Fill"
VerticalAlignment="Top" Margin="20 0 0 0"
Cursor="Hand">
</c:BAsyncImage>
<DockPanel VerticalAlignment="Top" Width="190" Height="150">
<TextBlock Margin="10 10 0 0" DockPanel.Dock="Top" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding PurchaseSkuId}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="配件商品ID:"/>
<Run Text="{Binding PurchaseSkuId}"/>
</TextBlock >
<TextBlock Margin="10 10 0 10" DockPanel.Dock="Top" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<ToolTip Style="{StaticResource OrderCouponToolipStyle}">
<TextBlock Text="{Binding Title}"/>
</ToolTip>
</TextBlock.ToolTip>
<Run Text="SKU名称:"/>
<Run Text="{Binding Title}"/>
</TextBlock >
<StackPanel Margin="10 0 0 0" Height="25" VerticalAlignment="Bottom" DockPanel.Dock="Bottom" Orientation="Horizontal">
<TextBlock Text="合格证:" VerticalAlignment="Center"/>
<StackPanel Orientation="Horizontal"
Visibility="{Binding IsNeedCer, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }">
<!--Content="{Binding CerDTO,Converter={StaticResource objConverter},ConverterParameter=#null:待设置:待确认}"-->
<c:BButton Content="待确认" Style="{StaticResource LinkButton}" Width="35" Height="15"
Command="{Binding DataContext. SetCertificateCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"
CommandParameter="{Binding }"
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }">
<c:BButton Content="查看" Style="{StaticResource LinkButton}" Width="35" Height="15"
CommandParameter="{Binding PurchaseSkuId}"
Command="{Binding DataContext. LookCerCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"/>
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Width="35" Height="15" CommandParameter="{Binding }"
Command="{Binding DataContext.SetCertificateCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"
/>
</StackPanel >
</StackPanel>
<StackPanel Orientation="Horizontal"
Visibility="{Binding IsNeedCer, Converter={StaticResource objConverter}, ConverterParameter=true:Collapsed:Visible }">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" >
<!--Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }"-->
<TextBlock Text="无需合格证" Height="15" Margin="5 0 0 0"
/>
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Width="35" Height="15" CommandParameter="{Binding }"
Command="{Binding DataContext.SetCertificateCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"
/>
</StackPanel >
</StackPanel>
</StackPanel>
</DockPanel>
</StackPanel>
</Grid>

Loading…
Cancel
Save