1同步物流单可以手动编辑取件码 2优化上海退货仓退货地址匹配逻辑

This commit is contained in:
wule committed 2026-10-04 21:32:39 +08:00
1 parent 0b47a16eb9
commit 37cb8e86ae
13 files changed
+644 -190

No files matched your search

+5
View File
@@ -71,5 +71,10 @@
<Resource Include="Ctrls\PDDInvoice\Resources\invoice.js" />
<Resource Include="gear.ico" />
</ItemGroup>
<ItemGroup>
<Compile Update="Views\ChangePickNoView.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
</Project>
@@ -72,217 +72,335 @@
ResizeBehavior="PreviousAndNext"
ShowsPreview="True" />
<wpf:SpacingStackPanel
Grid.Column="2"
Margin="4"
Orientation="Vertical"
VerticalSpacing="4">
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<wpf:SpacingStackPanel
Grid.Row="0"
Margin="4"
Orientation="Vertical"
VerticalSpacing="4">
<TextBlock FontSize="14" FontWeight="Bold">店铺商品信息:</TextBlock>
<wpf:TitleContent
x:Name="tcShopGoodsName"
Title="店铺标题:"
TitleHorizontalAlignment="Right"
TitleWidth="85">
<TextBox
x:Name="txtShopGoodsName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="店铺规格:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtShopSpecName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="店铺商品ID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtShopGoodsId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="店铺SKUID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtShopSkuId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="平台商品编码:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtSpuCode"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="平台SKU编码:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtSkuCode"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.04*" />
<ColumnDefinition Width="0.96*" />
</Grid.ColumnDefinitions>
<TextBlock FontSize="14" FontWeight="Bold">店铺商品信息:</TextBlock>
<wpf:TitleContent
Title="数量:"
Grid.Column="0"
x:Name="tcShopGoodsName"
Title="店铺标题:"
TitleHorizontalAlignment="Right"
TitleWidth="85">
<TextBox
x:Name="txtShopGoodsName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="店铺规格:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtShopOrderItemCnt"
Height="22"
x:Name="txtShopSpecName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
FontSize="15"
FontWeight="bold"
Foreground="Red"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="  总价:"
Grid.Column="1"
Margin="10,0,0,0"
TitleHorizontalAlignment="Right">
<TextBox
x:Name="txtShopOrderItemPrice"
Height="22"
BorderBrush="{StaticResource pageColorBrush}"
FontSize="15"
FontWeight="bold"
Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
</Grid>
<TextBlock
Margin="0,4,0,0"
FontSize="14"
FontWeight="Bold">
买手拍单信息:
</TextBlock>
<wpf:TitleContent
Title="商品标题:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyGoodsName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="规格名称:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuySkuName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单商品ID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyGoodsId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单SKUID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuySkuId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.04*" />
<ColumnDefinition Width="0.96*" />
</Grid.ColumnDefinitions>
<wpf:TitleContent
Title="拍单数量:"
Grid.Column="0"
Title="店铺商品ID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyCnt"
Height="22"
x:Name="txtShopGoodsId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
FontSize="15"
FontWeight="bold"
Foreground="Red"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单总价:"
Grid.Column="1"
Margin="10,0,0,0"
TitleHorizontalAlignment="Right">
Title="店铺SKUID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyPrice"
Height="22"
x:Name="txtShopSkuId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
FontSize="15"
FontWeight="bold"
Foreground="Red"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
</Grid>
<wpf:TitleContent
Title="拍单订单号:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyOrderId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="平台商品编码:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtSpuCode"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="平台SKU编码:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtSkuCode"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.04*" />
<ColumnDefinition Width="0.96*" />
</Grid.ColumnDefinitions>
<wpf:TitleContent
Title="数量:"
Grid.Column="0"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtShopOrderItemCnt"
Height="22"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
FontSize="15"
FontWeight="bold"
Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="  总价:"
Grid.Column="1"
Margin="10,0,0,0"
TitleHorizontalAlignment="Right">
<TextBox
x:Name="txtShopOrderItemPrice"
Height="22"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
FontSize="15"
FontWeight="bold"
Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
</Grid>
<wpf:TitleContent
Title="溯源码:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtSourceCode"
Height="20"
BorderBrush="#999999"
IsEnabled="False"
Background="#DDDDDD"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<TextBlock
Margin="0,4,0,0"
FontSize="14"
FontWeight="Bold">
买手拍单信息:
</TextBlock>
<wpf:TitleContent
Title="商品标题:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyGoodsName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="规格名称:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuySkuName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单商品ID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyGoodsId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单SKUID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuySkuId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1.04*" />
<ColumnDefinition Width="0.96*" />
</Grid.ColumnDefinitions>
<wpf:TitleContent
Title="拍单数量:"
Grid.Column="0"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyCnt"
Height="22"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
FontSize="15"
FontWeight="bold"
Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="拍单总价:"
Grid.Column="1"
Margin="10,0,0,0"
TitleHorizontalAlignment="Right">
<TextBox
x:Name="txtBuyPrice"
Height="22"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
FontSize="15"
FontWeight="bold"
Foreground="Red"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
</Grid>
<wpf:TitleContent
Title="拍单订单号:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtBuyOrderId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="溯源码:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtSourceCode"
Height="20"
Background="#DDDDDD"
BorderBrush="#999999"
IsEnabled="False"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
</wpf:SpacingStackPanel>
</wpf:SpacingStackPanel>
<wpf:SpacingStackPanel
Grid.Row="2"
Margin="4"
Orientation="Vertical"
VerticalSpacing="4">
<TextBlock
Margin="0,4,0,0"
FontSize="14"
FontWeight="Bold">
关联商品信息:
</TextBlock>
<wpf:TitleContent
Title="商品标题:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtMapGoodsName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="规格名称:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtMapSkuName"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="关联商品ID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtMapGoodsId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="关联SKUID:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<TextBox
x:Name="txtMapSkuId"
Height="20"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
</wpf:TitleContent>
<wpf:TitleContent
Title="发货地:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<Grid>
<TextBox
x:Name="txtSendProvince"
Height="20"
Margin="0,0,96,0"
BorderBrush="{StaticResource pageColorBrush}"
BorderThickness="1"
Style="{StaticResource BaseRoundCornerTextBoxStyle}" />
<Button
x:Name="btnManualUpdateSendProvince"
Grid.Column="1"
Height="20"
MinWidth="48"
Margin="0"
Padding="4,0"
HorizontalAlignment="Right"
Content="手动更新发货地"
FontSize="12"
Style="{StaticResource BasePageButtonStyle}" />
</Grid>
</wpf:TitleContent>
<wpf:TitleContent
Title="中转仓:"
TitleHorizontalAlignment="Right"
TitleWidth="{Binding ElementName=tcShopGoodsName, Path=TitleWidth}">
<ComboBox
x:Name="cmbTransitWarehouse"
Height="22"
SelectedIndex="0"
SelectionChanged="cmbTransitWarehouse_SelectionChanged"
Style="{StaticResource RoundedComboBox}">
<ComboBoxItem Content="仓库地址" />
</ComboBox>
</wpf:TitleContent>
</wpf:SpacingStackPanel>
</Grid>
</Grid>
</Grid>
</UserControl>
@@ -62,4 +62,9 @@ public partial class TaobaoBuyOrderCtrl : UserControl
ViewModel.ReloadCommand.Execute(null);
}
}
private void cmbTransitWarehouse_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
}
}
@@ -497,6 +497,24 @@
Content="同步订单"
Style="{StaticResource BasePageButtonStyle}"
ToolTip="同步选中的订单或选中的店铺" />
<Polyline
Grid.Column="5"
Width="10"
Margin="2,0"
VerticalAlignment="Center"
Points="5,0 5,4 5,0"
Stroke="{StaticResource mainColorBrush}"
StrokeThickness="2" />
<CheckBox
x:Name="chkNoPickupNumOrder"
Margin="2,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkNoPickupNumOrder_Click"
Content="仅显示无取件码同步物流单"
FontSize="12"
IsChecked="False" />
</WrapPanel>
</Border>
<Grid
@@ -77,6 +77,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
public DateTime nextGetOrderTime = DateTime.MinValue;
public string strSearchAll { get; set; } = "";
public bool chkNoPickupNumOrderIsChecked { get; set; } = false;
public ShipGiftService _shipGiftService { get; }
public OrderListCtrl()
{
@@ -1577,6 +1578,14 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (!orderFilterConfig.chkTransitChangeDirectOrderIsChecked == true && order.OrderBuyType == "云改直")
return true;
if (chkNoPickupNumOrderIsChecked == true)
{
if (order.SyncWaybillIdInfo.IsNullOrEmpty())
return true;
if (!order.SyncWaybillPickNo.IsNullOrEmpty())
return true;
}
var filterTimeRst = false;
Dispatcher.Invoke(new Action(() =>
{
@@ -2310,7 +2319,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
// 退货地址不是退货仓,跳过
if (orderItem.ItemRefund?.return_detail.StartsWith(GlobalConfig.TransitReturnOrderReturnAddress) == false)
if (orderItem.ItemRefund?.return_detail?.ToUpper().Contains(GlobalConfig.TransitReturnOrderReturnAddressLite) != true)
continue;
if (orderItem.DistribReturnOrderInfo == null || orderItem.DistribReturnOrderInfo.warehouse_status == 0)
@@ -2360,7 +2369,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}
// 退货地址不是退货仓,跳过
if (orderItem.ItemRefund?.return_detail.StartsWith(GlobalConfig.TransitReturnOrderReturnAddress) == false)
if (orderItem.ItemRefund?.return_detail?.ToUpper().Contains(GlobalConfig.TransitReturnOrderReturnAddressLite) != true)
continue;
// 退货包裹未发货,跳过(仅退货退款已发货的才自动去申请拼多多退货退款)
if ((orderItem.ItemRefund?.return_waybill_id).IsNullOrEmpty())
@@ -3013,6 +3022,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
GlobalConfig.BuyConfig.IsSyncDirectBuyOrderWaybill = chkSyncDirectOrderWaybill.IsChecked.ParseToBool();
StartUp.SaveBuyConfig();
}
private void chkNoPickupNumOrder_Click(object sender, RoutedEventArgs e)
{
chkNoPickupNumOrderIsChecked = chkNoPickupNumOrder.IsChecked.ParseToBool();
FilterOrders();
}
}
public class OrderFilterConfig : PropertyNotifyObject
@@ -1047,6 +1047,8 @@
TextWrapping="Wrap"
WaterMark="取件码" />
<uc:UcWaterMarkTextBox1
Margin="-2,2,4,2"
Padding="0"
@@ -1069,6 +1071,16 @@
Style="{StaticResource LinkButton}"
Tag="{Binding ItemOrder.OutExpressNoStr}"
Visibility="{Binding ItemOrder.RealSyncWaybillId, Converter={StaticResource NotHasTextVisibility}}" />
<Button
x:Name="btnEditPickNo"
Padding="0,0,0,0"
d:Content="填取件码"
Click="btnEditPickNo_Click"
Content="填取件码"
Style="{StaticResource LinkButton}"
Tag="{Binding ItemOrder.OutExpressNoStr}"
Visibility="{Binding ItemOrder.RealSyncWaybillId, Converter={StaticResource HasTextVisibility}}" />
</WrapPanel>
</wpf:TitleContent>
@@ -1925,6 +1925,19 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
MainWindow.Instance.pddBuyerOrderReadCtrl.SendAsyncWaybillOrder(orderLiteInfo, true);
}
}
private void btnEditPickNo_Click(object sender, RoutedEventArgs e)
{
if (this.DataContext is oms_wei_order_item_info orderItem)
{
ChangePickNoView changeWaybillView = new ChangePickNoView(orderItem);
new DialogWindow()
{
Title = "填写取件码",
Content = changeWaybillView,
}.ShowDialog();
}
}
}
}
@@ -0,0 +1,117 @@
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.Commands;
using AllBase;
using AllBase.Model.DBModel;
using AllBase.Model.MvvmBaseClasses;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using Work;
using Work._29Tools.BLL;
using Work._29Tools.Forms.ShopForms;
namespace _29WxOrderWpf.ViewModels
{
/// <summary>
/// 更改运单号ViewModel
/// </summary>
public class ChangePickNoViewModel : PropertyNotifyObject
{
public oms_wei_order_item_info OrderItem
{
get { return this.GetValue(x => x.OrderItem); }
set { this.SetValue(x => x.OrderItem, value); }
}
public string PickNo
{
get { return this.GetValue(x => x.PickNo); }
set { this.SetValue(x => x.PickNo, value); }
}
public bool IsChangeingPickNo
{
get { return this.GetValue(x => x.IsChangeingPickNo); }
set { this.SetValue(x => x.IsChangeingPickNo, value); }
}
/// <summary>
/// 请求关闭窗口
/// </summary>
public event Action RequestClose;
#region 命令
public ICommand ChangePickNoCommand { get; }
#endregion
private volatile bool _isWindowLoaded = false;
public ChangePickNoViewModel(oms_wei_order_item_info _orderItem)
{
OrderItem = _orderItem;
IsChangeingPickNo = false;
PickNo = (_orderItem?.ItemOrder?.SyncWaybillPickNo).ParseToString();
ChangePickNoCommand = new DelegateCommand(ChangePickNo);
}
/// <summary>
/// 窗口加载完成时调用
/// </summary>
public void Start()
{
_isWindowLoaded = true;
}
/// <summary>
/// 窗口关闭时调用,停止后台任务
/// </summary>
public void Stop()
{
_isWindowLoaded = false;
}
public void ChangePickNo()
{
IsChangeingPickNo = false;
string orderId = OrderItem.order_id;
ShopLoginInfo shop = OrderItem.Shop;
if (string.IsNullOrEmpty(PickNo))
{
BaseMsgWindow.ShowInfo("取件码不能为空");
return;
}
Task.Run(async () =>
{
var url4 = BaseClass.Build29WxObjString("vlc/UploadPickup");
var data4 = UserLogin.GetSignPostData(new
{
orderId = OrderItem.DirectPddBuyerOrder.order_sn,
pickupCode = PickNo,
});
var html4 = GetHtml.PostJson(url4, data4);
if (html4.Contains("\"code\":200"))
{
Application.Current?.Dispatcher.Invoke(new Action(() =>
{
OrderItem.ItemOrder.SyncWaybillPickNo = PickNo;
IsChangeingPickNo = false;
BaseMsgWindow.ShowInfo("修改取件码成功");
RequestClose?.Invoke();
}));
}
else
{
BaseMsgWindow.ShowInfo("修改取件码失败" + BaseRegex.GetStringJson(ref html4, "msg"));
}
});
}
}
}
+84
View File
@@ -0,0 +1,84 @@
<UserControl
x:Class="_29WxOrderWpf.Views.ChangePickNoView"
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:local="clr-namespace:_29WxOrderWpf.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
x:Name="changePickNoView"
Width="450"
Height="300"
d:DesignHeight="300"
d:DesignWidth="450"
Loaded="ChangeWaybillView_Loaded"
mc:Ignorable="d">
<Grid Background="White">
<StackPanel Margin="24,24,24,0">
<TextBlock
Margin="0,0,0,20"
HorizontalAlignment="Center"
FontSize="15"
Foreground="#333333"
Text="添加/更改取件码" />
<StackPanel>
<TextBlock
Margin="0,0,0,8"
Foreground="#555555"
Text="填写取件码:" />
<TextBox
x:Name="txtPickNo"
Height="38"
VerticalContentAlignment="Center"
d:Text="1111"
BorderBrush="#D0D0D0"
BorderThickness="1"
FontSize="18"
Text="{Binding PickNo, UpdateSourceTrigger=PropertyChanged}"
VerticalScrollBarVisibility="Auto" />
<WrapPanel Margin="0,10,0,0" FlowDirection="RightToLeft">
<Button
Width="72"
Height="26"
Margin="0,0,10,0"
HorizontalAlignment="Right"
Click="Button_Click_1"
Command="{Binding ChangePickNoCommand}"
Content="修改取件码"
Style="{StaticResource BasePageButtonStyle}" />
<Image
x:Name="imgLoading"
Width="20"
Height="20"
IsEnabled="False"
Source="{StaticResource imgLoadingPic}"
Visibility="{Binding IsChangeingPickNo, Converter={StaticResource visibleToVisibilityConverter}}">
<Image.RenderTransform>
<RotateTransform Angle="45" CenterX="10" CenterY="10" />
</Image.RenderTransform>
<Image.Triggers>
<EventTrigger RoutedEvent="Image.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
RepeatBehavior="Forever"
Storyboard.TargetName="imgLoading"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
From="360"
To="0"
Duration="0:0:3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
</WrapPanel>
<TextBlock
d:Text="如有需要,显示消息"
Text=""
TextWrapping="Wrap" />
</StackPanel>
</StackPanel>
</Grid>
</UserControl>
@@ -0,0 +1,63 @@
using _29WxOrderWpf.ViewModels;
using AllBase.Helper;
using AllBase.Model.DBModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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.Navigation;
using System.Windows.Shapes;
namespace _29WxOrderWpf.Views;
/// <summary>
/// ChangeWaybillView.xaml 的交互逻辑
/// </summary>
public partial class ChangePickNoView : UserControl
{
/// <summary>
/// 视图模型
/// </summary>
public ChangePickNoViewModel ViewModel { get; }
public ChangePickNoView(oms_wei_order_item_info _orderItem)
{
InitializeComponent();
ViewModel = new ChangePickNoViewModel(_orderItem);
ViewModel.RequestClose += ViewModel_RequestClose;
DataContext = ViewModel;
}
private void ChangeWaybillView_Loaded(object sender, RoutedEventArgs e)
{
ViewModel.Start();
}
private void ChangeWaybillView_Closed(object sender, RoutedEventArgs e)
{
ViewModel.Stop();
}
private void ViewModel_RequestClose()
{
Window parentWindow = Window.GetWindow(this);
if (this.IsLoaded && parentWindow != null)
parentWindow.Close();
MainWindow.Instance.orderListCtrl.FilterOneOrder(ViewModel.OrderItem.ItemOrder);
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
}
}
+4
View File
@@ -59,6 +59,10 @@ namespace AllBase.Helper
/// </summary>
public static string TransitReturnOrderReturnAddress { get; set; } = "真如镇街道真北路2653弄F区808号楼";
/// <summary>
/// 默认退货详细地址路和区(用于包含判断)
/// </summary>
public static string TransitReturnOrderReturnAddressLite { get; set; } = "真北路2653弄F区808号楼";
/// <summary>
/// 订单列表
/// </summary>
public static ConcurrentList<oms_wei_order_info> lstOrder { get; set; } = new ConcurrentList<oms_wei_order_info>();
+1 -1
View File
@@ -139,7 +139,7 @@ namespace AllBase.Model.DBModel
{
//return this.orderItems.All(oi => !string.IsNullOrEmpty(oi.ItemRefund?.return_waybill_id)) && this.orderItems.All(oi => oi.ItemRefund?.return_detail == GlobalConfig.TransitReturnOrderReturnAddress);
//return this.orderItems.All(oi => oi.ItemRefund?.return_detail == GlobalConfig.TransitReturnOrderReturnAddress);
return this.orderItems.All(oi => oi.ItemRefund?.return_detail.StartsWith(GlobalConfig.TransitReturnOrderReturnAddress) == true);
return this.orderItems.All(oi => oi.ItemRefund?.return_detail?.ToUpper().Contains(GlobalConfig.TransitReturnOrderReturnAddressLite) == true);
}
set { }
}
@@ -421,7 +421,7 @@ namespace AllBase.Model.DBModel
// 退货仓退货
AddEditTransitWarehouseReturnOrderStr = "";
if (ItemRefund?.return_detail.StartsWith(GlobalConfig.TransitReturnOrderReturnAddress) == true)
if (ItemRefund?.return_detail?.ToUpper().Contains(GlobalConfig.TransitReturnOrderReturnAddressLite) == true)
{
AddEditTransitWarehouseReturnOrderStr = DistribReturnOrderInfo == null ? "未创建" : "已创建";
if (DistribReturnOrderInfo?.warehouse_status == 1)