订单列表
待采购 增加批量礼物 代发货 增加礼物按钮
This commit is contained in:
1 parent
751b0d43e8
commit
b4615eb41c
10 files changed
+4816
-3550
No files matched your search
@@ -2,6 +2,7 @@
|
||||
using _29WxOrderWpf.Common;
|
||||
using _29WxOrderWpf.Ctrls.BuyerCtrls;
|
||||
using _29WxOrderWpf.Ctrls.Statistics;
|
||||
using _29WxOrderWpf.Services;
|
||||
using _29WxOrderWpf.Utils;
|
||||
using AllBase;
|
||||
using AllBase.Extension;
|
||||
@@ -11,11 +12,14 @@ using AllBase.Model.DBModel;
|
||||
using AllBase.Model.Result;
|
||||
using AllBase.Util;
|
||||
using CefSharp.DevTools.Autofill;
|
||||
using CefSharp.DevTools.FedCm;
|
||||
using NaiBa.Util.Extension;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Security.Policy;
|
||||
@@ -30,11 +34,13 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using TemuKJD.ToolForms;
|
||||
using Work;
|
||||
using Work._29Tools.BLL;
|
||||
using Work.BuyUsers;
|
||||
using static _29WxOrderWpf.Services.ShipGiftService;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
@@ -52,11 +58,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
|
||||
public string strSearchAll = "";
|
||||
public List<string> lstFilterText { get; set; }
|
||||
|
||||
public ShipGiftService _shipGiftService { get; }
|
||||
public OrderListCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
_shipGiftService = new ShipGiftService();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
@@ -129,6 +136,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
/// <param name="filterGetCondition">按过滤条件读取读取服务端订单</param>
|
||||
public void GetOrder(string orderIds = "", bool filterGetCondition = false)
|
||||
{
|
||||
BottomMsg = "开始读取订单...";
|
||||
StartProgress();
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
imgLoading.Visibility = Visibility.Visible;
|
||||
@@ -378,6 +387,8 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
if (string.IsNullOrEmpty(orderIds))
|
||||
hasReadOrder = true;
|
||||
|
||||
CompleteProgress();
|
||||
BottomMsg = "订单读取完成";
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
imgLoading.Visibility = Visibility.Collapsed;
|
||||
@@ -1308,7 +1319,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
private void TabItem_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
var tabItems = this.tabOrderType.Items.Cast<TabItem>();
|
||||
wpFilter.Margin = new Thickness(tabItems.Sum(t => t.ActualWidth) + 18, wpFilter.Margin.Top, wpFilter.Margin.Right, wpFilter.Margin.Bottom);
|
||||
|
||||
Point position1 = txtFilterRemark.TranslatePoint(new Point(0, 0), gridOrderListCtrl);
|
||||
Point position2 = txtFilterRemark.TranslatePoint(new Point(0, 0), wpFilter);
|
||||
@@ -1452,7 +1462,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
int index = 0;
|
||||
foreach (var tmpOrderItem in tmpOrderItems)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() => { txtMsg.Text = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index++; }));
|
||||
Dispatcher.Invoke(new Action(() => { BottomMsg = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index++; }));
|
||||
|
||||
var pddOrderSn = "";
|
||||
if (tmpOrderItem.ItemOrder?.OrderBuyType == "云仓")
|
||||
@@ -1621,10 +1631,10 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
html3 = GetHtml.PostUtf8(url3, data3);
|
||||
}
|
||||
MainWindow.Instance.orderListCtrl.GetOrder(tmpOrderItem.order_id);
|
||||
Dispatcher.Invoke(new Action(() => { txtMsg.Text = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
|
||||
Dispatcher.Invoke(new Action(() => { BottomMsg = "正在处理买手退货,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
|
||||
}
|
||||
|
||||
Dispatcher.Invoke(new Action(() => { txtMsg.Text = "买手退货处理完成,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
|
||||
Dispatcher.Invoke(new Action(() => { BottomMsg = "买手退货处理完成,总计:" + tmpOrderItems.Count + ",已处理:" + index; }));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1825,6 +1835,82 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
|
||||
{
|
||||
FilterOrders();
|
||||
}
|
||||
|
||||
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
//private bool _IsShipGift;
|
||||
//public bool IsShipGift
|
||||
//{
|
||||
// get => _IsShipGift;
|
||||
// set => SetProperty(ref _IsShipGift, value);
|
||||
//}
|
||||
|
||||
public ICommand MultipleShipGiftCommand => new AsyncDelegateCommand(MultipleShipGift);
|
||||
/// <summary>
|
||||
/// 批量发送礼品单
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
|
||||
private async Task MultipleShipGift()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var list = GlobalConfig.lstFilterOrder.Where(a => a.IsSelect).ToList();
|
||||
int count = list.Count;
|
||||
if (count == 0)
|
||||
{
|
||||
BaseMsgWindow.ShowError("请选取要发货的订单", "Error");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
GiftType giftType = GiftType._160;
|
||||
if (cb_gift.SelectedIndex == 0)
|
||||
{
|
||||
giftType = GiftType._155;
|
||||
}
|
||||
else
|
||||
{
|
||||
giftType = GiftType._155;
|
||||
}
|
||||
int index = 1;
|
||||
int sucessCount = 0;
|
||||
int errorCount = 0;
|
||||
foreach (oms_wei_order_info item in list)
|
||||
{
|
||||
var ret = await _shipGiftService.Send(item.order_id, giftType);
|
||||
if (ret)
|
||||
{
|
||||
sucessCount++;
|
||||
item.gift_order_status = 1;
|
||||
this.FilterOneOrder(item, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
errorCount++;
|
||||
}
|
||||
|
||||
SetProgress(index, count);
|
||||
BottomMsg = $"礼品单发送进度:{index}/{count}\t\t{item.orderItems.FirstOrDefault()?.title ?? ""}";
|
||||
index++;
|
||||
}
|
||||
|
||||
BottomMsg = $"礼品单发送完成 成功:{sucessCount} 失败:{errorCount} 总数:{count}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgWindow.ShowError("礼品单发货失败\n" + ex.Message, "Error");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class OrderFilterConfig
|
||||
|
||||
Reference in new issue
Block a user