22 changed files with 775 additions and 259 deletions
@ -0,0 +1,116 @@ |
|||||
|
using BBWY.Client.APIServices; |
||||
|
using BBWY.Client.Models; |
||||
|
using GalaSoft.MvvmLight.Command; |
||||
|
using HandyControl.Controls; |
||||
|
using System.Threading.Tasks; |
||||
|
using System.Windows.Input; |
||||
|
|
||||
|
namespace BBWY.Client.ViewModels |
||||
|
{ |
||||
|
public class EditServiceOrderViewModel : BaseVM |
||||
|
{ |
||||
|
|
||||
|
private ServiceOrderService serviceOrderService; |
||||
|
/// <summary>
|
||||
|
/// 主键Id
|
||||
|
/// </summary>
|
||||
|
private long servicePId; |
||||
|
private string orderId; |
||||
|
private ServiceResult? serviceResult; |
||||
|
private decimal? sdRefundFreight; |
||||
|
private ReturnDirection? returnDirection; |
||||
|
private string renewalOrderId; |
||||
|
private decimal? reissueAfterSaleAmount; |
||||
|
private string returnCheckRemark; |
||||
|
private StorageType? renewalType; |
||||
|
private string renewalPurchaseOrderId; |
||||
|
private Platform? renewalPurchasePlatform; |
||||
|
private decimal? reissueFreight; |
||||
|
private decimal? reissueProductAmount; |
||||
|
private bool isLoading; |
||||
|
|
||||
|
|
||||
|
public ServiceResult? ServiceResult { get => serviceResult; set { Set(ref serviceResult, value); } } |
||||
|
public decimal? SDRefundFreight { get => sdRefundFreight; set { Set(ref sdRefundFreight, value); } } |
||||
|
public ReturnDirection? ReturnDirection { get => returnDirection; set { Set(ref returnDirection, value); } } |
||||
|
public string RenewalOrderId { get => renewalOrderId; set { Set(ref renewalOrderId, value); } } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 售后补发成本
|
||||
|
/// </summary>
|
||||
|
public decimal? ReissueAfterSaleAmount { get => reissueAfterSaleAmount; set { Set(ref reissueAfterSaleAmount, value); } } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 退货检查备注
|
||||
|
/// </summary>
|
||||
|
public string ReturnCheckRemark { get => returnCheckRemark; set { Set(ref returnCheckRemark, value); } } |
||||
|
|
||||
|
public StorageType? RenewalType { get => renewalType; set { Set(ref renewalType, value); } } |
||||
|
|
||||
|
public string RenewalPurchaseOrderId { get => renewalPurchaseOrderId; set { Set(ref renewalPurchaseOrderId, value); } } |
||||
|
|
||||
|
public Platform? RenewalPurchasePlatform { get => renewalPurchasePlatform; set { Set(ref renewalPurchasePlatform, value); } } |
||||
|
|
||||
|
public ICommand SaveCommand { get; set; } |
||||
|
|
||||
|
public decimal? ReissueFreight { get => reissueFreight; set { Set(ref reissueFreight, value); } } |
||||
|
|
||||
|
public decimal? ReissueProductAmount { get => reissueProductAmount; set { Set(ref reissueProductAmount, value); } } |
||||
|
|
||||
|
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } |
||||
|
|
||||
|
public EditServiceOrderViewModel(ServiceOrderService serviceOrderService) |
||||
|
{ |
||||
|
this.serviceOrderService = serviceOrderService; |
||||
|
SaveCommand = new RelayCommand(Save); |
||||
|
} |
||||
|
|
||||
|
public void SetData(ServiceOrder serviceOrder) |
||||
|
{ |
||||
|
this.servicePId = serviceOrder.Id; |
||||
|
this.orderId = serviceOrder.OrderId; |
||||
|
this.ServiceResult = serviceOrder.ServiceResult; |
||||
|
this.SDRefundFreight = serviceOrder.SDRefundFreight; |
||||
|
this.ReturnDirection = serviceOrder.ReturnDirection; |
||||
|
this.RenewalOrderId = serviceOrder.RenewalOrderId; |
||||
|
this.ReissueAfterSaleAmount = serviceOrder.ReissueAfterSaleAmount; |
||||
|
this.ReturnCheckRemark = serviceOrder.ReturnCheckRemark; |
||||
|
this.RenewalType = serviceOrder.RenewalType; |
||||
|
this.RenewalPurchaseOrderId = serviceOrder.RenewalPurchaseOrderId; |
||||
|
this.RenewalPurchasePlatform = serviceOrder.RenewalPurchasePlatform; |
||||
|
this.ReissueFreight = serviceOrder.ReissueFreight; |
||||
|
this.ReissueProductAmount = serviceOrder.ReissueProductAmount; |
||||
|
} |
||||
|
|
||||
|
private void Save() |
||||
|
{ |
||||
|
if (IsLoading) |
||||
|
return; |
||||
|
IsLoading = true; |
||||
|
Task.Factory.StartNew(() => serviceOrderService.EditServiceOrder(servicePId, |
||||
|
orderId, |
||||
|
ServiceResult, |
||||
|
SDRefundFreight, |
||||
|
ReturnDirection, |
||||
|
RenewalOrderId, |
||||
|
ReissueAfterSaleAmount, |
||||
|
ReturnCheckRemark, |
||||
|
RenewalType, |
||||
|
RenewalPurchaseOrderId, |
||||
|
RenewalPurchasePlatform, |
||||
|
ReissueFreight, |
||||
|
ReissueProductAmount)).ContinueWith(t => |
||||
|
{ |
||||
|
IsLoading = false; |
||||
|
var r = t.Result; |
||||
|
if (!r.Success) |
||||
|
{ |
||||
|
App.Current.Dispatcher.Invoke(() => MessageBox.Show(r.Msg, "提示")); |
||||
|
return; |
||||
|
} |
||||
|
//closeEditServiceOrder
|
||||
|
GalaSoft.MvvmLight.Messaging.Messenger.Default.Send(true, "closeEditServiceOrder"); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,179 @@ |
|||||
|
<c:BWindow x:Class="BBWY.Client.Views.ServiceOrder.EditServiceOrder" |
||||
|
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.ServiceOrder" |
||||
|
mc:Ignorable="d" |
||||
|
xmlns:clientModel="clr-namespace:BBWY.Client.Models" |
||||
|
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
||||
|
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
||||
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
||||
|
Style="{StaticResource bwstyle}" |
||||
|
DataContext="{Binding EditServiceOrder,Source={StaticResource Locator}}" |
||||
|
Title="EditServiceOrder" Height="450" Width="340"> |
||||
|
<c:BWindow.Resources> |
||||
|
<ObjectDataProvider x:Key="serviceResultProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> |
||||
|
<ObjectDataProvider.MethodParameters> |
||||
|
<x:Type TypeName="clientModel:ServiceResult"/> |
||||
|
</ObjectDataProvider.MethodParameters> |
||||
|
</ObjectDataProvider> |
||||
|
<ObjectDataProvider x:Key="returnDirectionProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> |
||||
|
<ObjectDataProvider.MethodParameters> |
||||
|
<x:Type TypeName="clientModel:ReturnDirection"/> |
||||
|
</ObjectDataProvider.MethodParameters> |
||||
|
</ObjectDataProvider> |
||||
|
<ObjectDataProvider x:Key="storageTypeProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> |
||||
|
<ObjectDataProvider.MethodParameters> |
||||
|
<x:Type TypeName="clientModel:StorageType"/> |
||||
|
</ObjectDataProvider.MethodParameters> |
||||
|
</ObjectDataProvider> |
||||
|
<ObjectDataProvider x:Key="platformProvider" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> |
||||
|
<ObjectDataProvider.MethodParameters> |
||||
|
<x:Type TypeName="clientModel:Platform"/> |
||||
|
</ObjectDataProvider.MethodParameters> |
||||
|
</ObjectDataProvider> |
||||
|
</c:BWindow.Resources> |
||||
|
<Grid> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition Height="30"/> |
||||
|
<RowDefinition/> |
||||
|
<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" Margin="5"> |
||||
|
<Grid Height="25"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="处理结果:" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
||||
|
<ComboBox ItemsSource="{Binding Source={StaticResource serviceResultProvider}}" |
||||
|
SelectedItem="{Binding ServiceResult,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" |
||||
|
Grid.Column="1" |
||||
|
HorizontalAlignment="Left" |
||||
|
VerticalContentAlignment="Center" |
||||
|
Width="160" |
||||
|
Margin="5,0,0,0"/> |
||||
|
</Grid> |
||||
|
<Grid Height="25" Margin="0,5,0,0" |
||||
|
Visibility="{Binding ServiceResult,ConverterParameter=换新|线下换新|退货:Visible:Collapsed,Converter={StaticResource objConverter}}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="退货去向:" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
||||
|
<ComboBox ItemsSource="{Binding Source={StaticResource returnDirectionProvider}}" |
||||
|
SelectedItem="{Binding ReturnDirection,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" |
||||
|
Grid.Column="1" |
||||
|
HorizontalAlignment="Left" |
||||
|
VerticalContentAlignment="Center" |
||||
|
Width="160" |
||||
|
Margin="5,0,0,0"/> |
||||
|
</Grid> |
||||
|
<Grid Height="25" Margin="0,5,0,0" |
||||
|
Visibility="{Binding ServiceResult,ConverterParameter=SD退货:Visible:Collapsed,Converter={StaticResource objConverter}}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="SD退货运费:" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
||||
|
<c:BTextBox Text="{Binding SDRefundFreight}" Width="160" Grid.Column="1" HorizontalAlignment="Left" |
||||
|
Height="25" Margin="5,0,0,0"/> |
||||
|
</Grid> |
||||
|
<Grid Height="25" Margin="0,5,0,0" |
||||
|
Visibility="{Binding ServiceResult,ConverterParameter=换新:Visible:Collapsed,Converter={StaticResource objConverter}}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="换新单号:" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
||||
|
<c:BTextBox Text="{Binding RenewalOrderId}" Width="160" Grid.Column="1" HorizontalAlignment="Left" |
||||
|
Height="25" Margin="5,0,0,0"/> |
||||
|
</Grid> |
||||
|
<Grid Height="25" Margin="0,5,0,0" |
||||
|
Visibility="{Binding ServiceResult,ConverterParameter=换新|线下换新|退货|商品补发|原返|仅退款:Visible:Collapsed,Converter={StaticResource objConverter}}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="售后补偿:" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
||||
|
<c:BTextBox Text="{Binding ReissueAfterSaleAmount}" Width="160" Grid.Column="1" HorizontalAlignment="Left" |
||||
|
Height="25" Margin="5,0,0,0"/> |
||||
|
</Grid> |
||||
|
<Grid Height="25" Margin="0,5,0,0" |
||||
|
Visibility="{Binding ServiceResult,ConverterParameter=线下换新:Visible:Collapsed,Converter={StaticResource objConverter}}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="换新方式:" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
||||
|
<ComboBox ItemsSource="{Binding Source={StaticResource storageTypeProvider}}" |
||||
|
SelectedItem="{Binding RenewalType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" |
||||
|
Grid.Column="1" |
||||
|
HorizontalAlignment="Left" |
||||
|
VerticalContentAlignment="Center" |
||||
|
Width="160" |
||||
|
Margin="5,0,0,0"/> |
||||
|
</Grid> |
||||
|
<Grid Height="25" Margin="0,5,0,0" |
||||
|
Visibility="{Binding ServiceResult,ConverterParameter=线下换新:Visible:Collapsed,Converter={StaticResource objConverter}}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
<ColumnDefinition/> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="采购单号:" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
||||
|
<c:BTextBox Text="{Binding RenewalPurchaseOrderId}" Width="160" Grid.Column="1" HorizontalAlignment="Left" |
||||
|
Height="25" Margin="5,0,0,0"/> |
||||
|
<ComboBox ItemsSource="{Binding Source={StaticResource platformProvider}}" |
||||
|
SelectedItem="{Binding RenewalPurchasePlatform,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" |
||||
|
Grid.Column="2" |
||||
|
HorizontalAlignment="Left" |
||||
|
VerticalContentAlignment="Center" |
||||
|
MinWidth="70"/> |
||||
|
</Grid> |
||||
|
<Grid Height="25" Margin="0,5,0,0" |
||||
|
Visibility="{Binding ServiceResult,ConverterParameter=商品补发:Visible:Collapsed,Converter={StaticResource objConverter}}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="补发快递费:" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
||||
|
<c:BTextBox Text="{Binding ReissueFreight}" Width="160" Grid.Column="1" HorizontalAlignment="Left" |
||||
|
Height="25" Margin="5,0,0,0"/> |
||||
|
</Grid> |
||||
|
<Grid Height="25" Margin="0,5,0,0" |
||||
|
Visibility="{Binding ServiceResult,ConverterParameter=商品补发:Visible:Collapsed,Converter={StaticResource objConverter}}"> |
||||
|
<Grid.ColumnDefinitions> |
||||
|
<ColumnDefinition Width="80"/> |
||||
|
<ColumnDefinition/> |
||||
|
</Grid.ColumnDefinitions> |
||||
|
<TextBlock Text="补发货款成本:" VerticalAlignment="Center" HorizontalAlignment="Right"/> |
||||
|
<c:BTextBox Text="{Binding ReissueProductAmount}" Width="160" Grid.Column="1" HorizontalAlignment="Left" |
||||
|
Height="25" Margin="5,0,0,0"/> |
||||
|
</Grid> |
||||
|
</StackPanel> |
||||
|
|
||||
|
<Grid Grid.Row="2" Margin="5,0"> |
||||
|
<Grid.RowDefinitions> |
||||
|
<RowDefinition Height="Auto"/> |
||||
|
<RowDefinition/> |
||||
|
</Grid.RowDefinitions> |
||||
|
|
||||
|
<TextBlock Text="退货检查备注:" Margin="0,3"/> |
||||
|
<TextBox Grid.Row="1" AcceptsReturn="True" |
||||
|
TextWrapping="Wrap" Padding="3" |
||||
|
Text="{Binding ReturnCheckRemark}"/> |
||||
|
</Grid> |
||||
|
|
||||
|
<c:BButton Content="保存" Width="80" HorizontalAlignment="Right" Grid.Row="3" |
||||
|
Command="{Binding SaveCommand}" Margin="0,0,5,0"/> |
||||
|
</Grid> |
||||
|
</c:BWindow> |
@ -0,0 +1,28 @@ |
|||||
|
using BBWY.Client.ViewModels; |
||||
|
using BBWY.Controls; |
||||
|
|
||||
|
namespace BBWY.Client.Views.ServiceOrder |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// EditServiceOrder.xaml 的交互逻辑
|
||||
|
/// </summary>
|
||||
|
public partial class EditServiceOrder : BWindow |
||||
|
{ |
||||
|
public EditServiceOrder(Models.ServiceOrder serviceOrder) |
||||
|
{ |
||||
|
InitializeComponent(); |
||||
|
(this.DataContext as EditServiceOrderViewModel).SetData(serviceOrder); |
||||
|
GalaSoft.MvvmLight.Messaging.Messenger.Default.Register<bool>(this, "closeEditServiceOrder", (r) => |
||||
|
{ |
||||
|
if (r) |
||||
|
{ |
||||
|
this.Dispatcher.Invoke(() => |
||||
|
{ |
||||
|
this.DialogResult = true; |
||||
|
this.Close(); |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
namespace BBWY.Server.Model.Dto |
||||
|
{ |
||||
|
public class EditQueryServiceOrderRequest |
||||
|
{ |
||||
|
public long ServicePId { get; set; } |
||||
|
|
||||
|
public string OrderId { get; set; } |
||||
|
|
||||
|
public Enums.ServiceResult? ServiceResult { get; set; } |
||||
|
public decimal? SDRefundFreight { get; set; } |
||||
|
public Enums.ReturnDirection? ReturnDirection { get; set; } |
||||
|
public string RenewalOrderId { get; set; } |
||||
|
public decimal? ReissueAfterSaleAmount { get; set; } |
||||
|
public string ReturnCheckRemark { get; set; } |
||||
|
public Enums.StorageType? RenewalType { get; set; } |
||||
|
public string RenewalPurchaseOrderId { get; set; } |
||||
|
public Enums.Platform? RenewalPurchasePlatform { get; set; } |
||||
|
public decimal? ReissueFreight { get; set; } |
||||
|
public decimal? ReissueProductAmount { get; set; } |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue