仓库退货订单逻辑 30%
This commit is contained in:
1 parent
d25374956e
commit
d5d235c0b0
18 files changed
+747
-39
No files matched your search
@@ -0,0 +1,195 @@
|
||||
<basewindows:BaseWindow x:Class="_29WxOrderWpf.Windows.OrderWindows.TransitReturnOrderWindow" 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="创建退货单" Height="650" Width="843" 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.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition Width="20"></ColumnDefinition>
|
||||
<ColumnDefinition Width="100"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="1">店铺订单号:</Label>
|
||||
<TextBox x:Name="txtShopOrderId" Grid.Row="1" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="2">商品名称:</Label>
|
||||
<TextBox x:Name="txtGoodsName" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="4" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="3">商品规格:</Label>
|
||||
<TextBox x:Name="txtSpecName" Grid.Row="3" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="5">收件地址解析:</Label>
|
||||
<TextBox x:Name="txtAddressAnalysis" Grid.Row="5" 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,15"/>
|
||||
<Button Grid.Row="5" Grid.Column="1" x:Name="btnAddressAnalysis" Style="{StaticResource BasePageButtonStyle}" Click="btnAddressAnalysis_Click"
|
||||
Content="解 析" MinWidth="48" Height="28" HorizontalAlignment="Right" VerticalAlignment="Bottom" Padding="4" Margin="0,0,0,15"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="6">收件人:</Label>
|
||||
<TextBox x:Name="txtUser" Grid.Row="6" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="7">收件人电话:</Label>
|
||||
<TextBox x:Name="txtMobile" Grid.Row="7" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
<Label HorizontalAlignment="Right" FontSize="14" Grid.Row="8" Margin="0,0,0,15">收件省/市/区:</Label>
|
||||
<Grid Grid.Row="8" 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,15"/>
|
||||
<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,15"/>
|
||||
<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,15"/>
|
||||
</Grid>
|
||||
|
||||
<Label VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14" Grid.Row="9">收件详细地址:</Label>
|
||||
<TextBox x:Name="txtDetailAddress" Grid.Row="9" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Label Grid.Row="1" Grid.Column="3" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14">店铺名称:</Label>
|
||||
<TextBox x:Name="txtShopName" Grid.Row="1" Grid.Column="4" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
|
||||
|
||||
<Label Grid.Row="3" Grid.Column="3" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14">商品编号:</Label>
|
||||
<TextBox x:Name="txtSpuId" Grid.Row="3" Grid.Column="4" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1" IsReadOnly="True"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
|
||||
<Label Grid.Row="4" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14">物流单号:</Label>
|
||||
<TextBox Grid.Row="4" Grid.Column="1" x:Name="txtWaybillId" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
<Label Grid.Row="4" Grid.Column="3" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14">物流公司:</Label>
|
||||
<!--<TextBox x:Name="txtExpressName" Grid.Row="4" Grid.Column="4" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>-->
|
||||
<ComboBox x:Name="cmbExpressName" Grid.Row="4" Grid.Column="4" VerticalContentAlignment="Center" VerticalAlignment="Top" IsReadOnly="False" IsEnabled="True"
|
||||
Style="{StaticResource RoundedComboBox}" Height="28" SelectedIndex="0">
|
||||
</ComboBox>
|
||||
|
||||
<Label Grid.Row="5" Grid.Column="3" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14">寄件地址选择:</Label>
|
||||
<TextBox x:Name="txtSendAddressAnalysis" Grid.Row="5" Grid.Column="4" BorderBrush="{StaticResource pageColorBrush}" Height="80" BorderThickness="1" Padding="0,4"
|
||||
Text="上海市普陀区真如镇街道真北路2653弄Z区zt √" Foreground="Green" IsReadOnly="True" Opacity="0.5"
|
||||
VerticalContentAlignment="Top" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" TextWrapping="Wrap" Margin="0,0,0,15"/>
|
||||
|
||||
<Label Grid.Row="6" Grid.Column="3" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14">寄件人:</Label>
|
||||
<TextBox x:Name="txtSendUser" Grid.Row="6" Grid.Column="4" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
<Label Grid.Row="7" Grid.Column="3" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14">寄件人电话:</Label>
|
||||
<TextBox Grid.Row="7" Grid.Column="4" x:Name="txtSendMobile" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
<Label Grid.Column="3" HorizontalAlignment="Right" FontSize="14" Grid.Row="8" Margin="0,0,0,15">寄件省/市/区:</Label>
|
||||
<Grid Grid.Row="8" Grid.Column="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Name="txtSendProvince" Grid.Row="0" Grid.Column="0" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,15"/>
|
||||
<TextBox x:Name="txtSendCity" Grid.Row="0" Grid.Column="1" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="2,0,2,15"/>
|
||||
<TextBox x:Name="txtSendCounty" Grid.Row="0" Grid.Column="2" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}" Margin="0,0,0,15"/>
|
||||
</Grid>
|
||||
|
||||
<Label Grid.Row="9" Grid.Column="3" VerticalAlignment="Top" HorizontalAlignment="Right" FontSize="14">寄件详细地址:</Label>
|
||||
<TextBox Grid.Row="9" Grid.Column="4" x:Name="txtSendDetailAddress" BorderBrush="{StaticResource pageColorBrush}" BorderThickness="1"
|
||||
Height="28" VerticalContentAlignment="Center" VerticalAlignment="Top" Style="{StaticResource BaseRoundCornerTextBoxStyle}"/>
|
||||
|
||||
|
||||
<Button Grid.Row="10" Grid.Column="4" x:Name="btnAdd" Style="{StaticResource BasePageButtonStyle}" Click="btnAdd_Click" Content="添 加" MinWidth="48" Height="28"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center" Padding="4"/>
|
||||
<Label x:Name="lblMsg" Grid.Row="10" Grid.Column="1" Grid.ColumnSpan="4" Margin="0,0,70,0" Foreground="{StaticResource PageWarningBrushCC}"></Label>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="Auto" MinHeight="40"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
<userctrls:UcWindowBoxes x:Name="ucWindowBox" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="4" MaxBoxVisibility="Visible"/>
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,215 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model.DBModel;
|
||||
using AllBase.Model.Result;
|
||||
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>
|
||||
/// TransitReturnOrderWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class TransitReturnOrderWindow : BaseWindow
|
||||
{
|
||||
public static TransitReturnOrderWindow instance { get; set; }
|
||||
public oms_wei_order_item_info OrderItem { get; set; }
|
||||
|
||||
public TransitReturnOrderWindow(oms_wei_order_item_info orderItem)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
instance = this;
|
||||
|
||||
if (orderItem != null)
|
||||
OrderItem = orderItem;
|
||||
}
|
||||
|
||||
private void mainGrid_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void TransitAfterSaleWindow_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.cmbExpressName.Items.Add("");
|
||||
this.cmbExpressName.Items.Add("邮政EMS");
|
||||
this.cmbExpressName.Items.Add("极兔速递");
|
||||
this.cmbExpressName.Items.Add("申通快递");
|
||||
this.cmbExpressName.Items.Add("韵达快递");
|
||||
this.cmbExpressName.Items.Add("圆通快递");
|
||||
this.cmbExpressName.Items.Add("中通快递");
|
||||
this.cmbExpressName.Items.Add("百世快运");
|
||||
this.cmbExpressName.Items.Add("顺丰速运");
|
||||
this.cmbExpressName.Items.Add("京东快递");
|
||||
this.cmbExpressName.Items.Add("其他快递");
|
||||
|
||||
if (OrderItem != null)
|
||||
{
|
||||
//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.txtProvince.Text = OrderItem.ItemTransitOrderAfterSale.refund_province;
|
||||
// this.txtCity.Text = OrderItem.ItemTransitOrderAfterSale.refund_city;
|
||||
// this.txtCounty.Text = OrderItem.ItemTransitOrderAfterSale.refund_county;
|
||||
//}
|
||||
|
||||
// 上海仓默认发货地址
|
||||
txtSendUser.Text = "29供应链";
|
||||
txtSendMobile.Text = "13024622251";
|
||||
txtSendProvince.Text = "上海市";
|
||||
txtSendCity.Text = "上海市";
|
||||
txtSendCounty.Text = "普陀区";
|
||||
txtSendDetailAddress.Text = "真如镇街道真北路2653弄Z区zt";
|
||||
|
||||
txtShopOrderId.Text = OrderItem.order_id;
|
||||
txtShopName.Text = OrderItem.ItemOrder?.shop_name;
|
||||
txtGoodsName.Text = OrderItem.title;
|
||||
txtSpuId.Text = OrderItem.product_id.ParseToString();
|
||||
txtSpecName.Text = OrderItem.sku_attr_str;
|
||||
|
||||
|
||||
txtWaybillId.Text = OrderItem.ItemRefund?.return_waybill_id;
|
||||
foreach (var cmbItem in cmbExpressName.Items)
|
||||
{
|
||||
if (PddBuyerOrderLiteInfo.GetWxExpressCodeToWxExpressName((OrderItem.ItemRefund?.return_delivery_id).ParseToString()) == cmbItem.ParseToString())
|
||||
{
|
||||
cmbExpressName.SelectedItem = cmbItem;
|
||||
}
|
||||
}
|
||||
//cmbExpressName.SelectedItem =
|
||||
|
||||
|
||||
if (OrderItem.PddBuyerAfterSale != null)
|
||||
{
|
||||
this.txtAddressAnalysis.Text = OrderItem.PddBuyerAfterSale.afterSaleAddress;
|
||||
btnAddressAnalysis_Click(null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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