1中转仓订单退货功能 2中转仓订单运费根据oem或管理员设定调整 3其他一些问题修复
This commit is contained in:
1 parent
d6f81f9ef4
commit
2e20cbdf68
24 files changed
+834
-292
No files matched your search
@@ -168,7 +168,7 @@
|
||||
<Compile Include="Ctrls\ShopCtrls\ShopListCtrl.xaml.cs">
|
||||
<DependentUpon>ShopListCtrl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="LoginWindows\LoginWindow.xaml.cs">
|
||||
<Compile Include="Windows\LoginWindows\LoginWindow.xaml.cs">
|
||||
<DependentUpon>LoginWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Ctrls\OrderCtrls\OrderListCtrl.xaml.cs">
|
||||
@@ -184,6 +184,9 @@
|
||||
<DependentUpon>UcWindowBoxes.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Utils\UiCtrlUtils.cs" />
|
||||
<Compile Include="Windows\OrderWindows\TransitAfterSaleWindow.xaml.cs">
|
||||
<DependentUpon>TransitAfterSaleWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="BaseWindows\BaseMsgWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -216,7 +219,7 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="LoginWindows\LoginWindow.xaml">
|
||||
<Page Include="Windows\LoginWindows\LoginWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
@@ -284,6 +287,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Windows\OrderWindows\TransitAfterSaleWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
@@ -379,6 +386,7 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="29_common_icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -185,6 +185,8 @@
|
||||
<CheckBox Content="过滤多件商品订单" x:Name="chkNoMultiOrder" BorderBrush="{StaticResource mainColorBrush}" FontSize="12" HorizontalAlignment="Left"
|
||||
Margin="8,0,0,0" VerticalAlignment="Top" Checked="chkSubFilterSonditions_Checked" Unchecked="chkSubFilterSonditions_Checked" IsChecked="true"/>
|
||||
</WrapPanel>
|
||||
<TextBlock Margin="10,6" FontSize="12" VerticalAlignment="Top" HorizontalAlignment="Right" Text="注:需中转仓订单,店铺后台勿自行发货,发货后中转仓将无法打单"
|
||||
Foreground="{StaticResource PageWarningBrushCC}"></TextBlock>
|
||||
</Grid>
|
||||
<Grid x:Name="lstTitle" Grid.Row="2" Margin="8,0,8,0" Background="{StaticResource ListHeadBackColorBrush}">
|
||||
<Border BorderThickness="0,0,1,0" BorderBrush="{StaticResource ListHeadBorderColorBrush}">
|
||||
|
||||
@@ -266,10 +266,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}));
|
||||
break;
|
||||
}
|
||||
List<oms_wei_external_procurement_after_sale_info> pddTransitAfterSales = new List<oms_wei_external_procurement_after_sale_info>();
|
||||
List<oms_wei_external_procurement_after_sale_info> transitAfterSaleList = new List<oms_wei_external_procurement_after_sale_info>();
|
||||
try
|
||||
{
|
||||
pddTransitAfterSales = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_after_sale_info>(JObject.Parse(html5)["data"].ParseToString())
|
||||
transitAfterSaleList = JsonHelper.DeserializeJsonToList<oms_wei_external_procurement_after_sale_info>(JObject.Parse(html5)["data"].ParseToString())
|
||||
.OrderByDescending(p => p.created_time).ToList();
|
||||
}
|
||||
catch { }
|
||||
@@ -310,6 +310,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
}
|
||||
}));
|
||||
|
||||
//装载订单商品详情
|
||||
order.orderItems = new ObservableCollection<oms_wei_order_item_info>();
|
||||
foreach (var item in orderItems.Where(oi => oi.order_id == order.order_id))
|
||||
@@ -318,6 +319,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
item.ItemOrder = order;
|
||||
order.orderItems.Add(item);
|
||||
|
||||
// 更新店铺是否加入代发情况
|
||||
item.Shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == item.order_id);
|
||||
Dispatcher.Invoke(new Action(() => { item.UpdateOrderItemBuyButton(); }));
|
||||
|
||||
@@ -338,16 +340,23 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id && t.order_sku_id == item.sku_id));
|
||||
else
|
||||
item.ItemTransitOrders.AddRange(transitOrderList.Where(t => t.order_no == item.order_id));
|
||||
item.ItemTransitOrderAfterSales = transitAfterSaleList.Where(a => item.ItemTransitOrders.Any(t => t.out_order_no == a.order_code)).ToList();
|
||||
|
||||
// 中转仓买手订单
|
||||
item.PddBuyerOrders = pddBuyerOrders.Where(po => po.wx_order_id == item.order_id && po.wx_sku_id == item.sku_id).ToList();
|
||||
}
|
||||
//装载订单售后详情
|
||||
|
||||
// 装载订单售后详情
|
||||
order.refundItems = new ObservableCollection<oms_wei_refund_info>(refunds.Where(of => of.order_id == order.order_id));
|
||||
|
||||
// 读取订单后立即赋值,防止滚动时实时赋值造成卡顿
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
orderItem.SetItemRefund(order.refundItems.ToList());
|
||||
orderItem.SetTransitOrder();
|
||||
orderItem.SetItemRefund();
|
||||
}
|
||||
|
||||
// 删除再添加,触发更新。 todo: 如果已存在相同订单,则直接修改更新
|
||||
var orderExist = GlobalConfig.lstOrder.FirstOrDefault(o => o.order_id == order.order_id);
|
||||
if (orderExist != null)
|
||||
GlobalConfig.lstOrder.Remove(orderExist);
|
||||
@@ -361,9 +370,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
GlobalConfig.lstOrder.Add(order);
|
||||
}
|
||||
if (order.orderItems.Count > 1)
|
||||
{
|
||||
}
|
||||
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
@@ -518,12 +524,13 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// 过滤多件商品
|
||||
if (chkNoMultiOrder.IsChecked.ParseToBool() && order.orderItems.Sum(o => o.sku_cnt) > 1)
|
||||
// 过滤多子单订单
|
||||
if (chkNoMultiOrder.IsChecked.ParseToBool() && order.orderItems.Count() > 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (chkOnlyWarehouseOrder.IsChecked.ParseToBool() && order.status >= 30 && order.orderItems.All(oi => oi.ItemTransitOrderWithVoid == null))
|
||||
// 过滤非中转仓订单
|
||||
if (chkOnlyWarehouseOrder.IsChecked.ParseToBool() && !order.IsWaitBuy && order.orderItems.All(oi => oi.ItemTransitOrderWithVoid == null))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,28 +39,21 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
this.DataContextChanged += OrderListRowCtrl_DataContextChanged;
|
||||
}
|
||||
|
||||
private void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
private async void OrderListRowCtrl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_info order)
|
||||
{
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
{
|
||||
int index = 0;
|
||||
foreach (var orderItem in order.orderItems)
|
||||
{
|
||||
gridChildOrder.RowDefinitions.Insert(gridChildOrder.RowDefinitions.Count - 1, new RowDefinition() { Height = GridLength.Auto });
|
||||
//Thread.Sleep(5);
|
||||
index++;
|
||||
//Dispatcher.Invoke(new Action(() =>
|
||||
//{
|
||||
var rowItem = new OrderListRowItemCtrl() { DataContext = orderItem, Name = "rowItem" + index };
|
||||
Grid.SetRow(rowItem, index);
|
||||
this.gridChildOrder.Children.Add(rowItem);
|
||||
//}));
|
||||
if (index >= 5)
|
||||
break;
|
||||
}
|
||||
//});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
ShopBLL.CheckShopLogin(shop);
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
{
|
||||
// 在线直接进店
|
||||
shopLoginForm.openType = EnumOpenType.manage;
|
||||
shopLoginForm.WindowState = System.Windows.Forms.FormWindowState.Maximized;
|
||||
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/home";
|
||||
@@ -53,6 +54,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
else
|
||||
{
|
||||
// 掉线登录
|
||||
shopLoginForm.openType = EnumOpenType.login;
|
||||
shopLoginForm.ShowDialog();
|
||||
|
||||
|
||||
@@ -96,11 +96,10 @@
|
||||
Visibility="{Binding ItemOrder.ship_done_time_visibility}"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="发货时间" Text="{Binding ItemOrder.ship_done_time_str}" Grid.Column="1" Grid.Row="2" Margin="60,2,4,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Visibility="{Binding ItemOrder.ship_done_time_visibility}"/>
|
||||
<!--refund_time_str-->
|
||||
<TextBox Text="退款时间:" Grid.Column="1" Grid.Row="3" Margin="0,2,4,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="0"
|
||||
Visibility="{Binding refund_time_visibility}"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="退款时间" Text="{Binding refund_time_str}" Grid.Column="1" Grid.Row="3" Margin="60,2,4,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Visibility="{Binding refund_time_visibility}"/>
|
||||
Visibility="{Binding RefundTimeVisibility}"/>
|
||||
<uc:UcWaterMarkTextBox WaterMark="退款时间" Text="{Binding RefundTimeStr}" Grid.Column="1" Grid.Row="3" Margin="60,2,4,2" VerticalAlignment="Top"
|
||||
Background="Transparent" IsReadOnly="True" BorderThickness="0" TextWrapping="Wrap" Visibility="{Binding RefundTimeVisibility}"/>
|
||||
</Grid>
|
||||
<!--订单利润-->
|
||||
<Grid Grid.Column="4" Background="Transparent" VerticalAlignment="Center">
|
||||
@@ -173,7 +172,7 @@
|
||||
<TextBox Text="{Binding ItemRefund.reasonTextStr}" Grid.Column="1" Grid.Row="3" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True"
|
||||
x:Name="txtRefundReasonTextStr" BorderThickness="0" Foreground="#f56c6c" HorizontalAlignment="Center"
|
||||
Visibility="{Binding ElementName=txtRefundReasonTextStr,Path=Text,Converter={StaticResource HasTextVisibility}}"/>
|
||||
<TextBox Text="{Binding refundResultStr}" Grid.Column="1" Grid.Row="4" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True"
|
||||
<TextBox Text="{Binding RefundResultStr}" Grid.Column="1" Grid.Row="4" Margin="0,2,0,2" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True"
|
||||
x:Name="txtRefundResult" BorderThickness="0" Foreground="#f56c6c" HorizontalAlignment="Center"
|
||||
Visibility="{Binding ElementName=txtRefundResult,Path=Text,Converter={StaticResource HasTextVisibility}}"/>
|
||||
|
||||
@@ -364,6 +363,14 @@
|
||||
<Button Grid.Column="1" Grid.Row="2" x:Name="btnCancelEditAppRemark" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
|
||||
Margin="0,0,0,0" Content="取消" Click="btnCancelEditAppRemark_Click" Visibility="Collapsed"></Button>
|
||||
</WrapPanel>
|
||||
|
||||
<WrapPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="4" Visibility="{Binding AddEditTransitWarehouseAfterSaleStr,Converter={StaticResource HasTextVisibility}}">
|
||||
<TextBox Text="中转售后:" Grid.Column="1" Grid.Row="2" Margin="0,1,-8,1" VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderBrush="Transparent" BorderThickness="1"/>
|
||||
<uc:UcWaterMarkTextBox x:Name="txtTransitWarehouseAfterSale" WaterMark="订单售后" Text="{Binding ItemOrder.soft_remark}" Grid.Column="1" Grid.Row="2" Margin="0,1,0,1"
|
||||
VerticalAlignment="Top" Background="Transparent" IsReadOnly="True" BorderThickness="1" TextWrapping="Wrap"/>
|
||||
<Button Grid.Column="1" Grid.Row="2" x:Name="btnAddEditTransitWarehouseAfterSale" Background="Transparent" HorizontalAlignment="Center" Foreground="{StaticResource PageLinkBrush}" BorderBrush="Transparent"
|
||||
Margin="2,0,0,0" Content="{Binding AddEditTransitWarehouseAfterSaleStr}" Click="btnAddEditTransitWarehouseAfterSale_Click"></Button>
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
<!--操作-->
|
||||
<Grid Grid.Column="8" Background="Transparent" VerticalAlignment="Center">
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using _29WxOrderWpf.Converters;
|
||||
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
using _29WxOrderWpf.UserControls;
|
||||
using _29WxOrderWpf.Windows.OrderWindows;
|
||||
using AllBase;
|
||||
using AllBase.Helper;
|
||||
using AllBase.Model;
|
||||
@@ -204,9 +205,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
BaseMsgWindow.ShowError("请选择买手号");
|
||||
return;
|
||||
}
|
||||
if (orderItem.sku_cnt > 1 || orderItem.ItemOrder.orderItems.Count > 1)
|
||||
if (/*orderItem.sku_cnt > 1 ||*/ orderItem.ItemOrder.orderItems.Count > 1)
|
||||
{
|
||||
BaseMsgWindow.ShowError("多单或多件商品订单中转仓暂不支持");
|
||||
//BaseMsgWindow.ShowError("多子单或多件商品订单中转仓暂不支持");
|
||||
BaseMsgWindow.ShowError("多子单订单中转仓暂不支持");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -230,6 +232,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
orderItem = newOrder?.orderItems?.FirstOrDefault(oi => oi.sku_id == skuId);
|
||||
if (orderItem == null)
|
||||
return;
|
||||
|
||||
// 如果是退款单,弹出退款窗口
|
||||
if (/*orderItem?.ItemRefund?.count > 0 &&*/ orderItem.refund_status > 1)
|
||||
{
|
||||
@@ -252,7 +255,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 拍单前检测买手号是否在线
|
||||
if (GlobalConfig.CurrentPddBuyer.status == "在线")
|
||||
{
|
||||
@@ -268,29 +270,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return;
|
||||
}
|
||||
|
||||
//if (!GlobalConfig.BuyConfig.IsUseAppBalance)
|
||||
//{
|
||||
|
||||
// var url = BaseClass.Build29WxObjString("shop/get_shop_erp_merchant");
|
||||
// var data = UserLogin.GetSignaturex();
|
||||
// data += "&corporate_account_user_id=" + orderItem.Shop.ErpCorporateAccountUserId;
|
||||
// data += "&manage_user_id=" + orderItem.Shop.ErpManageUserId;
|
||||
// data += "&shop_id=" + orderItem.Shop.ErpShopId;
|
||||
// var html = GetHtml.PostUtf8(url, data);
|
||||
// if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
// html = GetHtml.PostUtf8(url, data);
|
||||
// if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
// {
|
||||
// Dispatcher.Invoke(new Action(() =>
|
||||
// {
|
||||
// //BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
// //btnBuyOrder.Cursor = Cursors.Hand;
|
||||
// GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
// }));
|
||||
// //return;
|
||||
// }
|
||||
//}
|
||||
|
||||
orderRetry:
|
||||
// 拍单前查询账户余额
|
||||
if (GlobalConfig.BuyConfig.IsUseAppBalance)
|
||||
@@ -318,17 +297,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
//BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg"));
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
if (orderItem.Shop.ErpCorporateAccountUserId == null && orderItem.Shop.ErpManageUserId == null)
|
||||
{
|
||||
GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
StartUp.SaveBuyConfig();
|
||||
BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg") + ",自动切换为快递余额拍单。");
|
||||
goto orderRetry;
|
||||
}
|
||||
//return;
|
||||
GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
StartUp.SaveBuyConfig();
|
||||
BaseMsgWindow.ShowError("未找到店铺账户!" + BaseRegex.GetStringJson(ref html, "msg") + ",自动切换为快递余额拍单。");
|
||||
goto orderRetry;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
|
||||
{
|
||||
@@ -340,14 +314,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
//BaseMsgWindow.ShowError("未找到店铺账户!");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
StartUp.SaveBuyConfig();
|
||||
BaseMsgWindow.ShowError("未找到店铺账户!自动切换为快递余额拍单。");
|
||||
goto orderRetry;
|
||||
//return;
|
||||
}
|
||||
|
||||
var balance = erpM.balance.ParseToDecimal();
|
||||
@@ -355,10 +327,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,请先充值!");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
GlobalConfig.BuyConfig.IsUseAppBalance = true;
|
||||
StartUp.SaveBuyConfig();
|
||||
BaseMsgWindow.ShowError("ERP账户余额不足(剩余" + balance.ToString("0.00") + "元,拍单至少需保留10元),无法中转拍单,自动切换为快递余额拍单。");
|
||||
goto orderRetry;
|
||||
}
|
||||
}
|
||||
catch
|
||||
@@ -411,6 +385,32 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
return;
|
||||
}
|
||||
|
||||
// 检测是否加入代发
|
||||
if (orderItem.Shop?.LoginStatus == "登录成功")
|
||||
{
|
||||
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"supplierName\":\"29供货商\"")) // "supplierName":"29供货商"
|
||||
{
|
||||
orderItem.Shop.Is29Supplier = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopBLL.CheckShopLogin(orderItem.Shop);
|
||||
if (orderItem.Shop?.LoginStatus == "登录成功")
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("店铺后台未查询到该代发单,请确认店铺在线且商品加入代发");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 掉线提示重登
|
||||
if (orderItem.Shop?.LoginStatus != "登录成功")
|
||||
{
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
@@ -426,43 +426,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}));
|
||||
return;
|
||||
}
|
||||
// 检测是否加入代发
|
||||
if (orderItem.Shop?.LoginStatus == "登录成功")
|
||||
{
|
||||
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierOrderList(orderItem.Shop, orderItem.order_id);
|
||||
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"supplierName\":\"29供货商\"")) // "supplierName":"29供货商"
|
||||
{
|
||||
orderItem.Shop.Is29Supplier = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopBLL.CheckShopLogin(orderItem.Shop);
|
||||
if (orderItem.Shop?.LoginStatus != "登录成功")
|
||||
{
|
||||
foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == orderItem.Shop.ErpShopId).ToList())
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var oi in ord.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { oi.UpdateOrderItemBuyButton(); }));
|
||||
}
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("请登录店铺");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgWindow.ShowError("店铺后台未查询到该代发单,请确认店铺在线且商品加入代发");
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 打开拍单窗口
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
btnBuyOrder.Cursor = Cursors.Hand;
|
||||
@@ -483,6 +448,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
// "&order_extra_type=1&refer_page_element=open_btn&source_channel=0&refer_page_name=goods_detail" +
|
||||
// "&refer_page_id=10014_" + BaseClass.DateTimeToTimestampSeconds(DateTime.Now) + Randomx.GetNumber(3) + "_tny5ifswls&refer_page_sn=10014";
|
||||
|
||||
buyOrderForm.ShowBuyMask = true;
|
||||
buyOrderForm.InitUrl = "https://mobile.yangkeduo.com/order_checkout.html?sku_id=" + orderItem.BuyMap.map_sku_id +
|
||||
"&group_id=1" + Randomx.GetNumber(11) + "&goods_id=" + orderItem.BuyMap.map_goods_id + "&goods_number=" + orderItem.sku_cnt +
|
||||
"&page_from=101";
|
||||
@@ -496,6 +462,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
buyOrderForm.pnlMap.Visible = false;
|
||||
}
|
||||
buyOrderForm.ShowDialog();
|
||||
// 窗口关闭后更新运费信息
|
||||
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
|
||||
}));
|
||||
});
|
||||
@@ -511,12 +478,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
//if (order_item.BuyMap == null && order_item.ItemOrder.out_amount == 0)
|
||||
// txtProfitForecast.Visibility = Visibility.Visible;
|
||||
|
||||
btnDeleteTransitOrder.Visibility = Visibility.Collapsed;
|
||||
//if (BaseClass.SaLevel == 1 && order_item.ItemTransitOrder != null)
|
||||
//{
|
||||
// btnDeleteTransitOrder.Visibility = Visibility.Visible;
|
||||
//}
|
||||
|
||||
order_item.UpdateOrderItemBuyButton();
|
||||
|
||||
Task.Run(() =>
|
||||
@@ -531,11 +492,16 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}));
|
||||
});
|
||||
|
||||
// 作废重拍
|
||||
if (order_item.ItemOrder.status == 20 /*&& order_item.refund_status <= 1*/ && order_item.ItemTransitOrder != null)
|
||||
{
|
||||
btnDeleteTransitOrder.Visibility = Visibility.Visible;
|
||||
}
|
||||
//待采购不显示所有采购信息状态(否则会显示作废订单状态)
|
||||
else
|
||||
{
|
||||
btnDeleteTransitOrder.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
// 待采购不显示所有采购信息状态(否则会显示作废订单状态)
|
||||
if (GlobalConfig.OrderTabHeaderStr.StartsWith("待采购"))
|
||||
{
|
||||
wpBuyAccount.Visibility = Visibility.Collapsed;
|
||||
@@ -545,10 +511,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
wpTransitBuyerRefundStatus.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//imgOrderItem.Source = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void txtOutOrderNumStr_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
@@ -681,7 +643,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
if (orderItem.ItemTransitOrder == null)
|
||||
{
|
||||
BaseMsgWindow.ShowError("订单状态已修改,请确认后重试");
|
||||
BaseMsgWindow.ShowError("要作废的中转订单不存在,请确认后重试");
|
||||
return;
|
||||
}
|
||||
});
|
||||
@@ -733,16 +695,28 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
//}' 成功返回code:0 失败返回code:1
|
||||
|
||||
string url2 = "https://po.e57.cn/prod-api/api/oms-api/external_procurement/discardOrder";
|
||||
var data = new JObject();
|
||||
data["orderNo"] = orderItem.order_id;
|
||||
data["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
|
||||
var dataStr2 = JsonHelper.SerializeObject(data);
|
||||
var data2 = new JObject();
|
||||
data2["orderNo"] = orderItem.order_id;
|
||||
data2["outOrderNo"] = orderItem.ItemTransitOrder.out_order_no;
|
||||
var dataStr2 = JsonHelper.SerializeObject(data2);
|
||||
var discardRst = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
|
||||
if (discardRst.Contains("<code>0</code>") || discardRst.Contains("<code>200</code>"))
|
||||
{
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(orderId);
|
||||
MainWindow.Instance.orderListCtrl.FilterOrders();
|
||||
BaseMsgWindow.ShowInfo("订单作废成功,请重新拍单");
|
||||
|
||||
var url3 = BaseClass.Build29WxObjString("user/get_all_user");
|
||||
var data3 = UserLogin.GetSignaturex();
|
||||
data3 += "&search_user_name=" + BaseClass.UserName;
|
||||
var html = GetHtml.PostUtf8(url3, data3);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
html = GetHtml.PostUtf8(url3, data3);
|
||||
if (html.Contains("\"code\":200"))
|
||||
{
|
||||
BaseClass.Balance = BaseRegex.GetDecimalJson(ref html, "balance");
|
||||
MainWindow.Instance.Balance = BaseClass.Balance.ToString("0.00");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -763,5 +737,20 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnAddEditTransitWarehouseAfterSale_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (this.DataContext is oms_wei_order_item_info orderItem)
|
||||
{
|
||||
var transitAfterSale = orderItem.ItemTransitOrderAfterSale;
|
||||
if (orderItem.ItemTransitOrder?.warehouse_status == 2 && orderItem.AddEditTransitWarehouseAfterSaleStr == "添加")
|
||||
{
|
||||
BaseMsgWindow.ShowError("商品已出库,请联系卖家直接退回总店!");
|
||||
return;
|
||||
}
|
||||
TransitAfterSaleWindow transitAfterSaleWindow = new TransitAfterSaleWindow(orderItem);
|
||||
transitAfterSaleWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using _29WxOrderWpf.BaseWindows;
|
||||
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
using _29WxOrderWpf.Ctrls.OrderCtrls;
|
||||
using _29WxOrderWpf.Windows.LoginWindows;
|
||||
using AllBase;
|
||||
using AllBase.DouYinModel.Result;
|
||||
using AllBase.Extension;
|
||||
@@ -69,7 +70,7 @@ namespace _29WxOrderWpf
|
||||
new Thread(AutoAntiGrabbingMechanism).Start(); // 反抓包
|
||||
|
||||
#region 弹出登录窗口
|
||||
LoginWindows.LoginWindow loginWindow = new LoginWindows.LoginWindow(App.args);
|
||||
LoginWindow loginWindow = new LoginWindow(App.args);
|
||||
loginWindow.Owner = this;
|
||||
loginWindow.ShowDialog();
|
||||
#endregion
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
<basewindows:BaseWindow x:Class="_29WxOrderWpf.LoginWindows.LoginWindow" xmlns:basewindows="clr-namespace:_29WxOrderWpf.BaseWindows"
|
||||
<basewindows:BaseWindow x:Class="_29WxOrderWpf.Windows.LoginWindows.LoginWindow" 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.LoginWindows"
|
||||
xmlns:local="clr-namespace:_29WxOrderWpf.Windows.LoginWindows"
|
||||
xmlns:userctrls="clr-namespace:_29WxOrderWpf.UserControls"
|
||||
mc:Ignorable="d" Style="{StaticResource BaseNoneBorderWindowStyle}"
|
||||
x:Name="loginWindow" Title="登录" Height="300" Width="400" ResizeMode="NoResize" Loaded="loginWindow_Loaded" Closing="BaseWindow_Closing">
|
||||
+1
-1
@@ -23,7 +23,7 @@ using System.Windows.Shapes;
|
||||
using Work;
|
||||
using Work.BaseForms;
|
||||
|
||||
namespace _29WxOrderWpf.LoginWindows
|
||||
namespace _29WxOrderWpf.Windows.LoginWindows
|
||||
{
|
||||
/// <summary>
|
||||
/// LoginWindow.xaml 的交互逻辑
|
||||
@@ -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