1中转仓订单退货功能 2中转仓订单运费根据oem或管理员设定调整 3其他一些问题修复
This commit is contained in:
1 parent
d6f81f9ef4
commit
2e20cbdf68
24 files changed
+834
-292
No files matched your search
@@ -0,0 +1,99 @@
|
||||
<basewindows:BaseWindow x:Class="_29WxOrderWpf.Windows.OrderWindows.TransitAfterSaleWindow" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||
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:_29WxOrderWpf.Windows.OrderWindows"
|
||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls" xmlns:buyerctrls="clr-namespace:_29WxOrderWpf.Ctrls.BuyerCtrls"
|
||||
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
|
||||
Title="TransitAfterSaleWindow" Height="650" Width="600" ResizeMode="NoResize" Loaded="TransitAfterSaleWindow_Loaded">
|
||||
<Grid Background="Transparent" x:Name="mainGrid" Margin="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid x:Name="gridTitle">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition Width="auto"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{StaticResource main29WeixinIcon}" Height="50" Width="50" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4"></Image>
|
||||
<Label x:Name="lblAppName" FontSize="20" Margin="0,0,0,0" Foreground="{StaticResource mainColorLightBrush}" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" VerticalContentAlignment="Center" Content="中转单售后" Grid.Column="1"></Label>
|
||||
</Grid>
|
||||
<Border Background="White" Grid.Row="1" Padding="40, 20">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="1">仓库:</Label>
|
||||
<ComboBox x:Name="cmbWareHouse" Grid.Row="1" Grid.Column="1" VerticalContentAlignment="Center" VerticalAlignment="Top" IsReadOnly="True" IsEnabled="False"
|
||||
Style="{StaticResource RoundedComboBox}" Height="28" SelectedIndex="0" Margin="0,0,0,25">
|
||||
</ComboBox>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="2">物流公司:</Label>
|
||||
<TextBox x:Name="txtExpressName" Grid.Row="2" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="3">物流单号:</Label>
|
||||
<TextBox x:Name="txtWarehouseWaybill" Grid.Row="3" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="4">地址解析:</Label>
|
||||
<TextBox x:Name="txtAddressAnalysis" Grid.Row="4" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" Height="80" BorderThickness="1" Padding="0,4"
|
||||
VerticalContentAlignment="Top" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" TextWrapping="Wrap" Margin="0,0,0,25"/>
|
||||
<Button Grid.Row="4" Grid.Column="1" x:Name="btnAddressAnalysis" Style="{StaticResource BasePageButtonStyle}" Click="btnAddressAnalysis_Click"
|
||||
Margin="4, 29" Content="解 析" MinWidth="48" Height="28" HorizontalAlignment="Right" VerticalAlignment="Bottom" Padding="4"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="5">收件人:</Label>
|
||||
<TextBox x:Name="txtUser" Grid.Row="5" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="6">联系电话:</Label>
|
||||
<TextBox x:Name="txtMobile" Grid.Row="6" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="7">省/市/区:</Label>
|
||||
<Grid Grid.Row="7" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Name="txtProvince" Grid.Row="0" Grid.Column="0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
<TextBox x:Name="txtCity" Grid.Row="0" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="2,0,2,25"/>
|
||||
<TextBox x:Name="txtCounty" Grid.Row="0" Grid.Column="2" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
</Grid>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="8">详细地址:</Label>
|
||||
<TextBox x:Name="txtDetailAddress" Grid.Row="8" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,25"/>
|
||||
|
||||
<Button Grid.Row="9" Grid.Column="1" x:Name="btnAdd" Style="{StaticResource BasePageButtonStyle}" Click="btnAdd_Click"
|
||||
Margin="0,0,0,0" Content="添 加" MinWidth="48" Height="28" HorizontalAlignment="left" VerticalAlignment="Top" Padding="4"/>
|
||||
<Label x:Name="lblMsg" Foreground="{StaticResource PageWarningBrushCC}"></Label>
|
||||
</Grid>
|
||||
</Border>
|
||||
<userctrls:UcWindowBoxes x:Name="ucWindowBox" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Visible"/>
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,185 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
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.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using Work._29Tools.BLL;
|
||||
|
||||
namespace _29WxOrderWpf.Windows.OrderWindows
|
||||
{
|
||||
/// <summary>
|
||||
/// TransitAfterSaleWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TransitAfterSaleWindow : BaseWindow
|
||||
{
|
||||
public oms_wei_order_item_info OrderItem { get; set; }
|
||||
|
||||
public TransitAfterSaleWindow(oms_wei_order_item_info orderItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
if (orderItem != null)
|
||||
OrderItem = orderItem;
|
||||
}
|
||||
|
||||
private void mainGrid_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void TransitAfterSaleWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
foreach (var warehouse in TransitWarehouseData.TransitWarehouseList)
|
||||
{
|
||||
this.cmbWareHouse.Items.Add(warehouse.TransName);
|
||||
}
|
||||
|
||||
if (OrderItem != null)
|
||||
{
|
||||
this.cmbWareHouse.Text = TransitWarehouseData.TransitWarehouseList.FirstOrDefault(t => t.TransId == OrderItem.ItemTransitOrder?.platform)?.TransName;
|
||||
this.txtExpressName.Text = OrderItem.ItemTransitOrder?.express_2_company;
|
||||
this.txtWarehouseWaybill.Text = OrderItem.ItemTransitOrder?.express_2_waybill;
|
||||
|
||||
if (OrderItem.ItemTransitOrderAfterSale != null)
|
||||
{
|
||||
btnAdd.IsEnabled = false;
|
||||
|
||||
this.txtUser.Text = OrderItem.ItemTransitOrderAfterSale.recipient_name;
|
||||
this.txtMobile.Text = OrderItem.ItemTransitOrderAfterSale.recipient_phone;
|
||||
this.txtDetailAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_detail_address;
|
||||
//this.txtAddress.Text = OrderItem.ItemTransitOrderAfterSale.refund_province + "/" + OrderItem.ItemTransitOrderAfterSale.refund_city + "/" + OrderItem.ItemTransitOrderAfterSale.refund_county;
|
||||
this.txtProvince.Text = OrderItem.ItemTransitOrderAfterSale.refund_province;
|
||||
this.txtCity.Text = OrderItem.ItemTransitOrderAfterSale.refund_city;
|
||||
this.txtCounty.Text = OrderItem.ItemTransitOrderAfterSale.refund_county;
|
||||
}
|
||||
}
|
||||
|
||||
if (OrderItem?.ItemTransitOrder?.warehouse_status != 0 && OrderItem?.ItemTransitOrder?.warehouse_status != 1)
|
||||
{
|
||||
btnAdd.IsEnabled = false;
|
||||
//BaseMsgWindow.ShowError("当前订单仓库状态不支持售后,请联系买家直接退回总店!");
|
||||
lblMsg.Content = "当前订单仓库状态不支持售后,请联系买家直接退回总店!";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (OrderItem?.ItemTransitOrder?.warehouse_status != 0 && OrderItem?.ItemTransitOrder?.warehouse_status != 1)
|
||||
{
|
||||
BaseMsgWindow.ShowError("当前订单仓库状态不支持售后,请联系买家直接退回总店!");
|
||||
return;
|
||||
}
|
||||
|
||||
//http://localhost:8088/oms-api/external_procurement/createReturnPackage
|
||||
//{
|
||||
// "orderNo": "3737011320735026432",
|
||||
// "orderCode": "4600000167202606117621000767",
|
||||
// "refundProvince": "安徽省",
|
||||
// "refundCity": "合肥市",
|
||||
// "refundCounty": "瑶海区",
|
||||
// "refundDetailAddress": "某街道 1”,
|
||||
// "recipientName": "张三",
|
||||
// "recipientPhone": "13800138000"
|
||||
//} post(json)请求方式,如果使用客户端账户扣款增加一个参数account_user
|
||||
|
||||
JObject data = new JObject();
|
||||
data["orderNo"] = OrderItem.order_id;
|
||||
data["orderCode"] = OrderItem.ItemTransitOrder?.order_code;
|
||||
data["refundProvince"] = txtProvince.Text.Trim();
|
||||
data["refundCity"] = txtCity.Text.Trim();
|
||||
data["refundCounty"] = txtCounty.Text.Trim();
|
||||
data["refundDetailAddress"] = txtDetailAddress.Text.Trim();
|
||||
data["recipientName"] = txtUser.Text.Trim();
|
||||
data["recipientPhone"] = txtMobile.Text.Trim();
|
||||
data["account_user"] = BaseClass.UserName;
|
||||
data["accountUser"] = BaseClass.UserName;
|
||||
//data["platform"] = "WEISHOP";
|
||||
var getTransitAfterSaleUrl = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/createReturnPackage";
|
||||
var getTransitAfterSaleStr = JsonHelper.SerializeObject(data);
|
||||
var getTransitAfterSaleRst = HttpResponseWXBLL.e57PostResponse(getTransitAfterSaleUrl, getTransitAfterSaleStr, "");
|
||||
if (!getTransitAfterSaleRst.ParseToString().Contains("<code>200</code>") && !getTransitAfterSaleRst.ParseToString().Contains("<code>0</code>"))
|
||||
{
|
||||
string msg = BaseRegex.GetStringXml(ref getTransitAfterSaleRst, "msg");
|
||||
if (msg.IsNullOrEmpty())
|
||||
msg = getTransitAfterSaleRst;
|
||||
BaseMsgWindow.ShowError("中转售后添加失败,服务端返回 " + msg, "", this);
|
||||
}
|
||||
else
|
||||
{
|
||||
//<AjaxResult><msg>创建退货包裹成功</msg><code>0</code></AjaxResult>
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(OrderItem.order_id);
|
||||
MainWindow.Instance.orderListCtrl.FilterOrders();
|
||||
BaseMsgWindow.ShowInfo("添加退货包裹成功", "", this);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAddressAnalysis_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var txt = txtAddressAnalysis.Text.Trim();
|
||||
txt = txt.Replace("\r", "").Replace("\n", "");
|
||||
|
||||
|
||||
// 定义座机号的正则表达式
|
||||
string landlinePattern = @"\d{3}-\d{8}|\d{4}-\d{7}";
|
||||
// 定义手机号的正则表达式
|
||||
string mobilePattern = @"1[3-9]\d{9}";
|
||||
|
||||
// 使用正则表达式匹配座机号和手机号
|
||||
Match landlineMatch = Regex.Match(txt, landlinePattern);
|
||||
Match mobileMatch = Regex.Match(txt, mobilePattern);
|
||||
|
||||
var phone = "";
|
||||
if (landlineMatch.Success)
|
||||
{
|
||||
phone = landlineMatch.Value;
|
||||
txt = txt.Replace(phone, " ");
|
||||
}
|
||||
if (mobileMatch.Success)
|
||||
{
|
||||
phone = mobileMatch.Value;
|
||||
txt = txt.Replace(phone, " ");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(phone))
|
||||
{
|
||||
txtMobile.Text = phone;
|
||||
}
|
||||
|
||||
var province = GlobalConfig.Divisions.FirstOrDefault(d => txt.Contains(d.name));
|
||||
if (province == null)
|
||||
return;
|
||||
txtProvince.Text = province.name;
|
||||
var city = province.children.FirstOrDefault(c => txt.Contains(c.name));
|
||||
if (city == null)
|
||||
return;
|
||||
txtCity.Text = city.name;
|
||||
var county = city.children.FirstOrDefault(c => txt.Contains(c.name));
|
||||
if (county == null)
|
||||
return;
|
||||
txtCounty.Text = county.name;
|
||||
txt = txt.Replace(county.name, " ").Replace(city.name, " ").Replace(province.name, " ");
|
||||
|
||||
var tArr = txt.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
|
||||
tArr = tArr.OrderBy(t => t.Length).ToArray();
|
||||
this.txtUser.Text = tArr.FirstOrDefault();
|
||||
this.txtDetailAddress.Text = string.Join("", tArr).Replace(this.txtUser.Text, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user