优化数量计算时候的卡顿问题

This commit is contained in:
wule committed 2026-08-24 07:02:49 +08:00
1 parent 9ddc4c3640
commit c8adf98ae5
8 files changed
+381 -218

No files matched your search

@@ -297,6 +297,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
{ {
var url1 = url; var url1 = url;
var data1 = responseData; var data1 = responseData;
if (data1.Contains("214874201671006"))
{
}
//if (data1.Contains("260415-154067299863696") || data1.Contains("待用户退回商品") || data1.Contains("已寄出,待商家处理") || data1.Contains("待商家处理退货申请") || data1.Contains("待用户拒收商品")) //if (data1.Contains("260415-154067299863696") || data1.Contains("待用户退回商品") || data1.Contains("已寄出,待商家处理") || data1.Contains("待商家处理退货申请") || data1.Contains("待用户拒收商品"))
//{ //{
@@ -356,8 +360,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
// 读订单 // 读订单
if (/*(cefAddress.Contains("orders.html")) &&*/ if (/*(cefAddress.Contains("orders.html")) &&*/
url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v")) url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v"))
{ {
Task.Run(() => Task.Run(() =>
{ {
CefReadBuyerOrder(url1, data1); CefReadBuyerOrder(url1, data1);
}); });
@@ -444,6 +448,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
List<order_item_ext> GetOrderItemExtInfo(string out_order_nos) List<order_item_ext> GetOrderItemExtInfo(string out_order_nos)
{ {
if (out_order_nos.IsNullOrEmpty())
return new List<order_item_ext>();
var url3 = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info"); var url3 = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info");
var data3 = UserLogin.GetSignaturex(); var data3 = UserLogin.GetSignaturex();
data3 += "&out_order_id_in=" + out_order_nos; data3 += "&out_order_id_in=" + out_order_nos;
@@ -467,7 +473,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
// 直接过滤掉仓库作废单 // 直接过滤掉仓库作废单
//transitOrderList = transitOrderList.Where(t => t.order_void_status != 1).ToList(); //transitOrderList = transitOrderList.Where(t => t.order_void_status != 1).ToList();
} }
catch catch (Exception ex)
{ {
transitOrderList = new List<order_item_ext>(); transitOrderList = new List<order_item_ext>();
} }
@@ -614,9 +620,9 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
if (data.Contains("轻奢壁挂式香皂盒置物架卫生间沥水家居可拆卸收纳盒翻盖肥皂盒")) if (data.Contains("轻奢壁挂式香皂盒置物架卫生间沥水家居可拆卸收纳盒翻盖肥皂盒"))
{ {
} }
var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => url.Contains(b.buyer_id)); var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => url.Contains(b.buyer_id));
if (buyer == null) if (buyer == null)
return; return;
@@ -649,7 +655,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
// 提取拼多多外采订单列表 // 提取拼多多外采订单列表
var out_order_nos = string.Join(",", list.Select(bo => bo.order_sn)); var out_order_nos = string.Join(",", list.Select(bo => bo.order_sn));
if (out_order_nos.Contains("260730-639463637281501")) if (out_order_nos.Contains("260817-535832839751006"))
{ {
} }
@@ -686,7 +692,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls
o.buyerId = buyer.buyer_id; o.buyerId = buyer.buyer_id;
o.buyerName = buyer.buyer_name; o.buyerName = buyer.buyer_name;
if (o.order_sn == "260730-639463637281501") if (o.order_sn == "260817-535832839751006")
{ {
} }
@@ -111,6 +111,7 @@
Grid.Column="4" Grid.Column="4"
Height="28" Height="28"
Margin="0,0,-6,0" Margin="0,0,-6,0"
TextChanged="txtShopName_TextChanged"
TextWrapping="NoWrap" TextWrapping="NoWrap"
WaterMark="全部店铺" /> WaterMark="全部店铺" />
<Button <Button
@@ -264,37 +265,38 @@
Margin="2,0" Margin="2,0"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
d:IsChecked="True"
BorderBrush="{StaticResource mainColorBrush}" BorderBrush="{StaticResource mainColorBrush}"
Click="chkHideGreenFlag_Click" Click="chkHideGreenFlag_Click"
Content="隐藏标记订单" Content="隐藏标记订单"
FontSize="12" FontSize="12"
IsChecked="true" /> IsChecked="{Binding orderFilterConfig.chkHideGreenFlagIsChecked}" />
</WrapPanel> </WrapPanel>
<wpf:SpacingStackPanel Grid.Column="13" HorizontalSpacing="5"> <wpf:SpacingStackPanel Grid.Column="13" HorizontalSpacing="5">
<Button <Button
Width="30" Width="30"
Height="28" Height="28"
Padding="4" Padding="4"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Command="{Binding ShowShopRevenueStatisticsDialogViewCommand}" Command="{Binding ShowShopRevenueStatisticsDialogViewCommand}"
Style="{StaticResource BasePageButtonStyle}" Style="{StaticResource BasePageButtonStyle}"
ToolTip="利润统计"> ToolTip="利润统计">
<TextBlock Style="{StaticResource TextBlockIcon}" Text="{StaticResource txt-data_pie}" /> <TextBlock Style="{StaticResource TextBlockIcon}" Text="{StaticResource txt-data_pie}" />
</Button> </Button>
<Button <Button
Width="30" Width="30"
Height="28" Height="28"
Padding="4" Padding="4"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Command="{Binding ShowPDDInvoiceDialogCommand}" Command="{Binding ShowPDDInvoiceDialogCommand}"
Style="{StaticResource BasePageButtonStyle}" Style="{StaticResource BasePageButtonStyle}"
ToolTip="发票助手"> ToolTip="发票助手">
<TextBlock Style="{StaticResource TextBlockIcon}" Text="{StaticResource txt-fapiao}" /> <TextBlock Style="{StaticResource TextBlockIcon}" Text="{StaticResource txt-fapiao}" />
</Button> </Button>
</wpf:SpacingStackPanel> </wpf:SpacingStackPanel>
</Grid> </Grid>
<Border <Border
x:Name="filterConfig" x:Name="filterConfig"
@@ -307,11 +309,12 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
d:IsChecked="True"
BorderBrush="{StaticResource mainColorBrush}" BorderBrush="{StaticResource mainColorBrush}"
Checked="chkSubFilterSonditions_Checked" Checked="chkSubFilterSonditions_Checked"
Content="过滤非本系统订单" Content="过滤非本系统订单"
FontSize="12" FontSize="12"
IsChecked="true" IsChecked="{Binding orderFilterConfig.chkOnlyWarehouseOrderIsChecked}"
Unchecked="chkSubFilterSonditions_Checked" /> Unchecked="chkSubFilterSonditions_Checked" />
<CheckBox <CheckBox
x:Name="chkNoMultiOrder" x:Name="chkNoMultiOrder"
@@ -319,11 +322,12 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
d:IsChecked="True"
BorderBrush="{StaticResource mainColorBrush}" BorderBrush="{StaticResource mainColorBrush}"
Checked="chkSubFilterSonditions_Checked" Checked="chkSubFilterSonditions_Checked"
Content="过滤多商品订单" Content="过滤多商品订单"
FontSize="12" FontSize="12"
IsChecked="true" IsChecked="{Binding orderFilterConfig.chkHideGreenFlagIsChecked}"
Unchecked="chkSubFilterSonditions_Checked" /> Unchecked="chkSubFilterSonditions_Checked" />
<Polyline <Polyline
Grid.Column="5" Grid.Column="5"
@@ -339,11 +343,12 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
d:IsChecked="True"
BorderBrush="{StaticResource mainColorBrush}" BorderBrush="{StaticResource mainColorBrush}"
Checked="chkSubFilterSonditions_Checked" Checked="chkSubFilterSonditions_Checked"
Content="云仓" Content="云仓"
FontSize="12" FontSize="12"
IsChecked="true" IsChecked="{Binding orderFilterConfig.chkTransitOrderIsChecked}"
Unchecked="chkSubFilterSonditions_Checked" /> Unchecked="chkSubFilterSonditions_Checked" />
<CheckBox <CheckBox
x:Name="chkDirectOrder" x:Name="chkDirectOrder"
@@ -351,11 +356,12 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
d:IsChecked="True"
BorderBrush="{StaticResource mainColorBrush}" BorderBrush="{StaticResource mainColorBrush}"
Checked="chkSubFilterSonditions_Checked" Checked="chkSubFilterSonditions_Checked"
Content="直发" Content="直发"
FontSize="12" FontSize="12"
IsChecked="true" IsChecked="{Binding orderFilterConfig.chkDirectOrderIsChecked}"
Unchecked="chkSubFilterSonditions_Checked" /> Unchecked="chkSubFilterSonditions_Checked" />
<CheckBox <CheckBox
x:Name="chkTransitChangeDirectOrder" x:Name="chkTransitChangeDirectOrder"
@@ -363,11 +369,12 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
d:IsChecked="True"
BorderBrush="{StaticResource mainColorBrush}" BorderBrush="{StaticResource mainColorBrush}"
Checked="chkSubFilterSonditions_Checked" Checked="chkSubFilterSonditions_Checked"
Content="云改直" Content="云改直"
FontSize="12" FontSize="12"
IsChecked="true" IsChecked="{Binding orderFilterConfig.chkTransitChangeDirectOrderIsChecked}"
Unchecked="chkSubFilterSonditions_Checked" /> Unchecked="chkSubFilterSonditions_Checked" />
<Polyline <Polyline
Grid.Column="5" Grid.Column="5"
@@ -387,7 +394,7 @@
Checked="chkSubFilterSonditions_Checked" Checked="chkSubFilterSonditions_Checked"
Content="过滤备注" Content="过滤备注"
FontSize="12" FontSize="12"
IsChecked="False" IsChecked="{Binding orderFilterConfig.chkFilterRemarkIsChecked}"
Unchecked="chkSubFilterSonditions_Checked" /> Unchecked="chkSubFilterSonditions_Checked" />
<WrapPanel> <WrapPanel>
<Border <Border
@@ -11,8 +11,10 @@ using AllBase.Extension;
using AllBase.Helper; using AllBase.Helper;
using AllBase.Model; using AllBase.Model;
using AllBase.Model.DBModel; using AllBase.Model.DBModel;
using AllBase.Model.MvvmBaseClasses;
using AllBase.Model.Result; using AllBase.Model.Result;
using AllBase.Util; using AllBase.Util;
using CefSharp.DevTools.Accessibility;
using CefSharp.DevTools.Autofill; using CefSharp.DevTools.Autofill;
using CefSharp.DevTools.FedCm; using CefSharp.DevTools.FedCm;
using NaiBa.Util; using NaiBa.Util;
@@ -22,6 +24,7 @@ using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
@@ -52,16 +55,22 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
/// <summary> /// <summary>
/// OrderListCtrl.xaml 的交互逻辑 /// OrderListCtrl.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class OrderListCtrl : UserControl public partial class OrderListCtrl : UserControl, INotifyPropertyChanged
{ {
public CheckBox chkSelectAll = null; public CheckBox chkSelectAll = null;
public OrderFilterConfig orderFilterConfig = null; OrderFilterConfig _orderFilterConfig;
public OrderFilterConfig orderFilterConfig
{
get { return _orderFilterConfig; }
set { if (_orderFilterConfig != value)
_orderFilterConfig = value;
OnPropertyChanged(new PropertyChangedEventArgs("orderFilterConfig"));
}
}
public bool IsAutoReadOrder = true; public bool IsAutoReadOrder = true;
public DateTime nextGetOrderTime = DateTime.MinValue; public DateTime nextGetOrderTime = DateTime.MinValue;
public string strSearchAll { get; set; } = ""; public string strSearchAll { get; set; } = "";
public ConcurrentList<string> lstFilterOrderIds { get; set; } = new ConcurrentList<string>();
public ConcurrentList<string> lstFilterRemarkText { get; set; } = new ConcurrentList<string>();
public ShipGiftService _shipGiftService { get; } public ShipGiftService _shipGiftService { get; }
public OrderListCtrl() public OrderListCtrl()
{ {
@@ -77,8 +86,16 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
orderFilterConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig<OrderFilterConfig>("wx_order_filter_config"); orderFilterConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig<OrderFilterConfig>("wx_order_filter_config");
if (orderFilterConfig == null) if (orderFilterConfig == null)
orderFilterConfig = new OrderFilterConfig(); orderFilterConfig = new OrderFilterConfig();
this.txtFilterGoodsName.Text = string.Join(";", orderFilterConfig.FilterGoodsName); this.txtFilterGoodsName.Text = string.Join(";", orderFilterConfig.lstFilterGoodsName);
this.cmbFilterGoodsNameType.SelectedItem = cmbFilterGoodsNameType.Items.Cast<ComboBoxItem>().FirstOrDefault(tb => (tb.Content as TextBlock)?.Text == orderFilterConfig.FilterGoodsNameType); this.cmbFilterGoodsNameType.SelectedItem = cmbFilterGoodsNameType.Items.Cast<ComboBoxItem>().FirstOrDefault(tb => (tb.Content as TextBlock)?.Text == orderFilterConfig.FilterGoodsNameType);
orderFilterConfig.chkHideGreenFlagIsChecked = true; // 隐藏标记
orderFilterConfig.chkNoMultiOrderIsChecked = true; // 多子订单不显示
orderFilterConfig.chkOnlyWarehouseOrderIsChecked = true; // 过滤非本系统订单
orderFilterConfig.chkTransitOrderIsChecked = true; // 云仓
orderFilterConfig.chkDirectOrderIsChecked = true; // 直发
orderFilterConfig.chkTransitChangeDirectOrderIsChecked = true; // 云改直
orderFilterConfig.lstFilterOrderIds = new ConcurrentList<string>();
orderFilterConfig.lstFilterRemarkText = new ConcurrentList<string>();
dateStart.SelectedDate = DateTime.Now.Date.AddDays(-7); dateStart.SelectedDate = DateTime.Now.Date.AddDays(-7);
dateEnd.SelectedDate = DateTime.Now.Date.AddDays(1).AddSeconds(-1); dateEnd.SelectedDate = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
@@ -118,8 +135,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (DateTime.Now > nextGetOrderTime) if (DateTime.Now > nextGetOrderTime)
{ {
Dispatcher.Invoke(new Action(() =>
{
btnSearch.Content = "读单";
}));
GetOrder(); GetOrder();
nextGetOrderTime = DateTime.Now.AddMinutes(25); nextGetOrderTime = DateTime.Now.AddMinutes(25);
} }
Thread.Sleep(1000); Thread.Sleep(1000);
@@ -158,6 +178,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
while (true && (IsAutoReadOrder || !string.IsNullOrEmpty(orderIds))) while (true && (IsAutoReadOrder || !string.IsNullOrEmpty(orderIds)))
{ {
BottomMsg = "当前正在读取订单...,第" + (page + 1) + "页";
if (page >= totalPage) if (page >= totalPage)
{ {
break; break;
@@ -185,9 +206,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
// 按过滤条件读取 已废弃 // 按过滤条件读取 已废弃
//if (filterGetCondition) //if (filterGetCondition)
//{ //{
// if (!string.IsNullOrEmpty(txtShopName.Text.Trim())) // if (!string.IsNullOrEmpty(orderFilterConfig.txtFilterShopNameText))
// { // {
// var shopNames = txtShopName.Text.Trim().Split(';').Where(s => !s.IsNullOrEmpty()).ToList(); // var shopNames = orderFilterConfig.txtFilterShopNameText.Split(';').Where(s => !s.IsNullOrEmpty()).ToList();
// shop_id = string.Join(",", GlobalConfig.ShopLoginList.Where(s => shopNames.Contains(s.ShopAccount)).Select(s => s.ErpShopId).Where(s => !s.IsNullOrEmpty())); // shop_id = string.Join(",", GlobalConfig.ShopLoginList.Where(s => shopNames.Contains(s.ShopAccount)).Select(s => s.ErpShopId).Where(s => !s.IsNullOrEmpty()));
// } // }
//} //}
@@ -357,10 +378,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
} }
} }
Dispatcher.Invoke(new Action(() => //Dispatcher.Invoke(new Action(() => { disPlayOrderTabOrderCount(); }));
{ disPlayOrderTabOrderCount();
disPlayOrderTabOrderCount();
}));
var totalCount = BaseRegex.GetIntJson(ref html, "count"); var totalCount = BaseRegex.GetIntJson(ref html, "count");
if (totalCount > 0) if (totalCount > 0)
@@ -372,10 +392,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
} }
// 处理店铺后台物流异常单 // 处理店铺后台物流异常单
BottomMsg = "当前正在读取物流异常单...";
if (string.IsNullOrEmpty(orderIds)) if (string.IsNullOrEmpty(orderIds))
GetShopWaybillExceptionOrder(); GetShopWaybillExceptionOrder();
// 处理拒收单 // 处理拒收单
BottomMsg = "当前正在处理拒收单...";
if (string.IsNullOrEmpty(orderIds)) if (string.IsNullOrEmpty(orderIds))
Task.Run(async () => Task.Run(async () =>
{ {
@@ -383,10 +405,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
}); });
// 处理中转仓退货包裹 // 处理中转仓退货包裹
BottomMsg = "当前正在处理中转仓退回...";
if (string.IsNullOrEmpty(orderIds)) if (string.IsNullOrEmpty(orderIds))
AutoUpdateTransitPackageToPddShop(); AutoUpdateTransitPackageToPddShop();
// 处理退货仓分销退货 // 处理退货仓分销退货
BottomMsg = "当前正在处理分销退货...";
if (string.IsNullOrEmpty(orderIds)) if (string.IsNullOrEmpty(orderIds))
Task.Run(async () => Task.Run(async () =>
{ {
@@ -1066,61 +1090,53 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
public void disPlayOrderTabOrderCount() public void disPlayOrderTabOrderCount()
{ {
//var orders = string.Join("','", GlobalConfig.lstFilterOrder.Select(o => o.order_id));
var orders = string.Join("','", GlobalConfig.lstFilterOrder.Select(o => o.order_id)); //var orders1 = string.Join(",", GlobalConfig.lstFilterOrder.Select(o => o.order_id));
var orders1 = string.Join(",", GlobalConfig.lstFilterOrder.Select(o => o.order_id));
var tabItems = this.tabOrderType.Items.Cast<TabItem>();
var tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待采购"));
var userOrderLst = GlobalConfig.lstOrder.Where(o => GlobalConfig.ShopLoginList.Any(s => s.ErpShopId.ParseToLong() == o.shop_id)).ToList(); var userOrderLst = GlobalConfig.lstOrder.Where(o => GlobalConfig.ShopLoginList.Any(s => s.ErpShopId.ParseToLong() == o.shop_id)).ToList();
TabItem tabItem = null;
List<TabItem> tabItems = this.tabOrderType.Items.Cast<TabItem>().ToList();
Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待采购")); }));
if (tabItem != null) if (tabItem != null)
{ {
var filteLstTmp = new ObservableCollection<oms_wei_order_info>(userOrderLst.Where(o => !GetOrderIsFilter(o, "待采购"))); var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "待采购")).ToList();
//tabItem.Header = "待采购(" + userOrderLst.Where(r => r.IsWaitBuy).Count() + "|" + filteLstTmp.Where(r => r.IsWaitBuy).Count() + ")"; Dispatcher.Invoke(new Action(() => { tabItem.Header = "待采购(" + userOrderLst.Where(r => r.IsWaitBuy).Count() + "|" + filteLstTmp.Count() + ")"; }));
tabItem.Header = "待采购(" + userOrderLst.Where(r => r.IsWaitBuy).Count() + "|" + filteLstTmp.Count() + ")";
} }
tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待发货")); Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待发货")); }));
if (tabItem != null) if (tabItem != null)
{ {
var filteLstTmp = new ObservableCollection<oms_wei_order_info>(userOrderLst.Where(o => !GetOrderIsFilter(o, "待发货"))); var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "待发货")).ToList();
//tabItem.Header = "待发货(" + userOrderLst.Where(r => r.IsWaitSend).Count() + "|" + filteLstTmp.Where(r => r.IsWaitSend).Count() + ")"; Dispatcher.Invoke(new Action(() => { tabItem.Header = "待发货(" + userOrderLst.Where(r => r.IsWaitSend).Count() + "|" + filteLstTmp.Count() + ")"; }));
tabItem.Header = "待发货(" + userOrderLst.Where(r => r.IsWaitSend).Count() + "|" + filteLstTmp.Count() + ")";
} }
tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待收货")); Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待收货")); }));
if (tabItem != null) if (tabItem != null)
{ {
var filteLstTmp = new ObservableCollection<oms_wei_order_info>(userOrderLst.Where(o => !GetOrderIsFilter(o, "待收货"))); var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "待收货")).ToList();
//tabItem.Header = "待收货(" + userOrderLst.Where(r => r.IsWaitReceive).Count() + "|" + filteLstTmp.Where(r => r.IsWaitReceive).Count() + ")"; Dispatcher.Invoke(new Action(() => { tabItem.Header = "待收货(" + userOrderLst.Where(r => r.IsWaitReceive).Count() + "|" + filteLstTmp.Count() + ")"; }));
tabItem.Header = "待收货(" + userOrderLst.Where(r => r.IsWaitReceive).Count() + "|" + filteLstTmp.Count() + ")";
} }
tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("售后完成单")); Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("售后完成单")); }));
if (tabItem != null) if (tabItem != null)
{ {
var filteLstTmp = new ObservableCollection<oms_wei_order_info>(userOrderLst.Where(o => !GetOrderIsFilter(o, "售后完成单"))); var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "售后完成单")).ToList();
//tabItem.Header = "售后完成单(" + userOrderLst.Where(r => r.IsRefund).Count() + "|" + filteLstTmp.Where(r => r.IsRefund).Count() + ")"; Dispatcher.Invoke(new Action(() => { tabItem.Header = "售后完成单(" + userOrderLst.Where(r => r.IsRefund).Count() + "|" + filteLstTmp.Count() + ")"; }));
tabItem.Header = "售后完成单(" + userOrderLst.Where(r => r.IsRefund).Count() + "|" + filteLstTmp.Count() + ")";
} }
tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("需处理售后单")); Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("需处理售后单")); }));
if (tabItem != null) if (tabItem != null)
{ {
var filteLstTmp = new ObservableCollection<oms_wei_order_info>(userOrderLst.Where(o => !GetOrderIsFilter(o, "需处理售后单"))); var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "需处理售后单")).ToList();
//tabItem.Header = "需处理售后单(" + userOrderLst.Where(r => r.IsEmergency).Count() + "|" + filteLstTmp.Where(r => r.IsEmergency).Count() + ")"; Dispatcher.Invoke(new Action(() => { tabItem.Header = "需处理售后单(" + userOrderLst.Where(r => r.IsEmergency).Count() + "|" + filteLstTmp.Count() + ")"; }));
tabItem.Header = "需处理售后单(" + userOrderLst.Where(r => r.IsEmergency).Count() + "|" + filteLstTmp.Count() + ")";
} }
tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("异常单")); Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("异常单")); }));
if (tabItem != null) if (tabItem != null)
{ {
var filteLstTmp = new ObservableCollection<oms_wei_order_info>(userOrderLst.Where(o => !GetOrderIsFilter(o, "异常单"))); var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "异常单")).ToList();
//tabItem.Header = "异常单(" + userOrderLst.Where(r => r.isAbnormal).Count() + "|" + filteLstTmp.Where(r => r.isAbnormal).Count() + ")"; Dispatcher.Invoke(new Action(() => { tabItem.Header = "异常单(" + userOrderLst.Where(r => r.isAbnormal).Count() + "|" + filteLstTmp.Count() + ")"; }));
tabItem.Header = "异常单(" + userOrderLst.Where(r => r.isAbnormal).Count() + "|" + filteLstTmp.Count() + ")";
} }
tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("全部订单")); Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("全部订单")); }));
if (tabItem != null) if (tabItem != null)
{ {
var filteLstTmp = new ObservableCollection<oms_wei_order_info>(userOrderLst.Where(o => !GetOrderIsFilter(o, "全部订单"))); var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "全部订单")).ToList();
tabItem.Header = "全部订单(" + userOrderLst.Count() + "|" + filteLstTmp.Count() + ")"; Dispatcher.Invoke(new Action(() => { tabItem.Header = "全部订单(" + userOrderLst.Count() + "|" + filteLstTmp.Count() + ")"; }));
} }
//txtMsg.Text = "当前条件共计 " + GlobalConfig.lstFilterOrder.Count() + " 条订单记录"; //txtMsg.Text = "当前条件共计 " + GlobalConfig.lstFilterOrder.Count() + " 条订单记录";
} }
@@ -1205,15 +1221,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
} }
// 过滤id // 过滤id
if (lstFilterOrderIds.Count > 0) if (orderFilterConfig.lstFilterOrderIds.Count > 0)
{ {
if (!lstFilterOrderIds.Contains(order.order_id)) if (!orderFilterConfig.lstFilterOrderIds.Contains(order.order_id))
return true; return true;
} }
// 其他一级过滤选项 // 其他一级过滤选项
else else
{ {
if (chkHideGreenFlag.IsChecked == true && order.colour_flag == 4) if (orderFilterConfig.chkHideGreenFlagIsChecked == true && order.colour_flag == 4)
return true; return true;
if (!GlobalConfig.ShopLoginList.Any(s => s.ErpShopId.ParseToLong() == order.shop_id)) if (!GlobalConfig.ShopLoginList.Any(s => s.ErpShopId.ParseToLong() == order.shop_id))
@@ -1245,77 +1261,114 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
} }
// 过滤店铺名称 // 过滤店铺名称
if (!string.IsNullOrEmpty(txtShopName.Text.Trim()) && !(";" + txtShopName.Text.Trim() + ";").Contains(";" + order.shop_name + ";")) if (!string.IsNullOrEmpty(orderFilterConfig.txtFilterShopNameText) && !(";" + orderFilterConfig.txtFilterShopNameText + ";").Contains(";" + order.shop_name + ";"))
{ {
return true; return true;
} }
// 过滤商品名称 // 过滤商品名称
if (!string.IsNullOrEmpty(txtFilterGoodsName.Text.Trim())) if (orderFilterConfig.lstFilterGoodsName != null && orderFilterConfig.lstFilterGoodsName.Count > 0)
{ {
if (orderFilterConfig.FilterGoodsNameType == "标题包含" && !orderFilterConfig.FilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name)))) if (orderFilterConfig.FilterGoodsNameType == "标题包含" && !orderFilterConfig.lstFilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name))))
return true; return true;
else if (orderFilterConfig.FilterGoodsNameType == "标题不含" && orderFilterConfig.FilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name)))) else if (orderFilterConfig.FilterGoodsNameType == "标题不含" && orderFilterConfig.lstFilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name))))
return true; return true;
} }
// 过滤多子单订单 // 过滤多子单订单
if (chkNoMultiOrder.IsChecked.ParseToBool() && order.orderItems.Count() > 1) if (orderFilterConfig.chkNoMultiOrderIsChecked && order.orderItems.Count() > 1)
{ {
return true; return true;
} }
// 过滤非中转仓订单 // 过滤非中转仓订单
if (chkOnlyWarehouseOrder.IsChecked.ParseToBool() && !order.IsWaitBuy && if (orderFilterConfig.chkOnlyWarehouseOrderIsChecked && !order.IsWaitBuy &&
order.orderItems.All(oi => oi.ItemTransitOrderWithVoid == null) && order.orderItems.All(oi => oi.OrderItemExt?.buy_type != "直发")) order.orderItems.All(oi => oi.ItemTransitOrderWithVoid == null) && order.orderItems.All(oi => oi.OrderItemExt?.buy_type != "直发"))
{ {
return true; return true;
} }
// 过滤备注 // 过滤备注
if (chkFilterRemark.IsChecked == true && !string.IsNullOrEmpty(txtFilterRemark.Text)) if (orderFilterConfig.chkFilterRemarkIsChecked && orderFilterConfig.lstFilterRemarkText != null && orderFilterConfig.lstFilterRemarkText.Count > 0)
{ {
if (cmbFilterRemark.SelectedItem is ComboBoxItem comboBoxItem) if (cmbFilterRemark.SelectedItem is ComboBoxItem comboBoxItem)
{ {
if (comboBoxItem.Content is TextBlock tb) if (comboBoxItem.Content is TextBlock tb)
{ {
if (tb.Text == "店铺备注包含" && !lstFilterRemarkText.Contains(order.shop_remark)) if (tb.Text == "店铺备注包含" && !orderFilterConfig.lstFilterRemarkText.Contains(order.shop_remark))
return true; return true;
else if (tb.Text == "软件备注包含" && !lstFilterRemarkText.Contains(order.soft_remark)) else if (tb.Text == "软件备注包含" && !orderFilterConfig.lstFilterRemarkText.Contains(order.soft_remark))
return true; return true;
else if (tb.Text == "店铺备注不含" && lstFilterRemarkText.Contains(order.shop_remark)) else if (tb.Text == "店铺备注不含" && orderFilterConfig.lstFilterRemarkText.Contains(order.shop_remark))
return true; return true;
else if (tb.Text == "软件备注不含" && lstFilterRemarkText.Contains(order.soft_remark)) else if (tb.Text == "软件备注不含" && orderFilterConfig.lstFilterRemarkText.Contains(order.soft_remark))
return true; return true;
} }
} }
} }
if (!chkDirectOrder.IsChecked == true && order.OrderBuyType == "直发") if (!orderFilterConfig.chkDirectOrderIsChecked == true && order.OrderBuyType == "直发")
return true; return true;
if (!chkTransitOrder.IsChecked == true && order.OrderBuyType == "云仓") if (!orderFilterConfig.chkTransitOrderIsChecked == true && order.OrderBuyType == "云仓")
return true; return true;
if (!chkTransitChangeDirectOrder.IsChecked == true && order.OrderBuyType == "云改直") if (!orderFilterConfig.chkTransitChangeDirectOrderIsChecked == true && order.OrderBuyType == "云改直")
return true; return true;
// 过滤时间范围 var filterTimeRst = false;
if (cmbTimeType.SelectedItem is ComboBoxItem cbi) Dispatcher.Invoke(new Action(() =>
{ {
if (cbi.Content is TextBlock tb) // 过滤时间范围
if (cmbTimeType.SelectedItem is ComboBoxItem cbi)
{ {
if (tb.Text == "更新时间") if (cbi.Content is TextBlock tb)
{ {
if (order.UpdateDateTime < dateStart.SelectedDate.Value) if (tb.Text == "更新时间")
return true; {
if (chkEndDate.IsChecked == true && order.UpdateDateTime > dateEnd.SelectedDate.Value.AddDays(1)) if (order.UpdateDateTime < dateStart.SelectedDate.Value)
return true; {
} filterTimeRst = true;
if (tb.Text == "成交时间") return;
{ }
if (order.CreateDateTime < dateStart.SelectedDate.Value) if (chkEndDate.IsChecked == true && order.UpdateDateTime > dateEnd.SelectedDate.Value.AddDays(1))
return true; {
if (chkEndDate.IsChecked == true && order.CreateDateTime > dateEnd.SelectedDate.Value.AddDays(1)) filterTimeRst = true;
return true; return;
}
}
if (tb.Text == "成交时间")
{
if (order.CreateDateTime < dateStart.SelectedDate.Value)
{
filterTimeRst = true;
return;
}
if (chkEndDate.IsChecked == true && order.CreateDateTime > dateEnd.SelectedDate.Value.AddDays(1))
{
filterTimeRst = true;
return;
}
}
} }
} }
} }));
if (filterTimeRst)
return filterTimeRst;
var filterHeadStrRst = false;
Dispatcher.Invoke(new Action(() =>
{
filterHeadStrRst = FilterTabPage(order, filterHeadStr);
}));
if (filterHeadStrRst)
return filterHeadStrRst;
} }
return false;
}
/// <summary>
/// 过滤标签页
/// </summary>
/// <param name="order"></param>
/// <param name="filterHeadStr"></param>
/// <returns></returns>
private bool FilterTabPage(oms_wei_order_info order, string filterHeadStr)
{
// 过滤标签页 // 过滤标签页
if (filterHeadStr.IsNullOrEmpty()) if (filterHeadStr.IsNullOrEmpty())
filterHeadStr = GlobalConfig.OrderTabHeaderStr; filterHeadStr = GlobalConfig.OrderTabHeaderStr;
@@ -1328,8 +1381,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{ {
if (!order.IsWaitBuy) if (!order.IsWaitBuy)
return true; return true;
//if (order.IsRefund)
// return true;
if (chkMapProdOnly.IsChecked == true && order.orderItems.All(oi => oi.BuyMap == null)) if (chkMapProdOnly.IsChecked == true && order.orderItems.All(oi => oi.BuyMap == null))
return true; return true;
if (chkNoMapProdOnly.IsChecked == true && order.orderItems.All(oi => oi.BuyMap != null)) if (chkNoMapProdOnly.IsChecked == true && order.orderItems.All(oi => oi.BuyMap != null))
@@ -1417,10 +1468,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (chkAftersaleWarehouseIsNotPickup.IsChecked == true && order.orderItems.All(oi => oi.WarehouseWaybillStatusStr != "中转待取号" && !oi.WarehouseWaybillStatusStr.Contains("取号异常"))) if (chkAftersaleWarehouseIsNotPickup.IsChecked == true && order.orderItems.All(oi => oi.WarehouseWaybillStatusStr != "中转待取号" && !oi.WarehouseWaybillStatusStr.Contains("取号异常")))
return true; return true;
if (chkAftersaleWarehouseIsPickup.IsChecked == true && order.orderItems.All(oi => oi.WarehouseWaybillStatusStr != "中转提前取号" && oi.WarehouseWaybillStatusStr != "中转已取号" && if (chkAftersaleWarehouseIsPickup.IsChecked == true && order.orderItems.All(oi => oi.WarehouseWaybillStatusStr != "中转提前取号" && oi.WarehouseWaybillStatusStr != "中转已取号" &&
oi.WarehouseWaybillStatusStr != "中转已入库" && oi.WarehouseWaybillStatusStr != "中转已出库")) oi.WarehouseWaybillStatusStr != "中转已入库" && oi.WarehouseWaybillStatusStr != "中转已出库"))
return true; return true;
} }
return false; return false;
} }
@@ -1440,7 +1490,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
this.txtShopName.Text = string.Join(";", list.Where(s => s.IsSelect == true).Select(s => s.ShopAccount)); this.txtShopName.Text = string.Join(";", list.Where(s => s.IsSelect == true).Select(s => s.ShopAccount));
FilterOrders(); FilterOrders();
} }
MainWindow.Instance.shopListCtrl.IsVisibleChanged -= ShopListCtrl_IsVisibleChanged; MainWindow.Instance.shopListCtrl.IsVisibleChanged -= ShopListCtrl_IsVisibleChanged;
} }
@@ -1454,18 +1503,19 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
Thread.Sleep(5000); Thread.Sleep(5000);
Dispatcher.Invoke(new Action(() => { this.btnSearch.IsEnabled = true; })); Dispatcher.Invoke(new Action(() => { this.btnSearch.IsEnabled = true; }));
}); });
Task.Run(() => //Task.Run(() =>
{ //{
GetOrder(); // GetOrder();
nextGetOrderTime = DateTime.Now.AddMinutes(25); // nextGetOrderTime = DateTime.Now.AddMinutes(25);
}); //});
nextGetOrderTime = DateTime.Now;
} }
private async void btnFilter_Click(object sender, RoutedEventArgs e) private async void btnFilter_Click(object sender, RoutedEventArgs e)
{ {
if (lstFilterOrderIds.Count == 1 && !GlobalConfig.lstOrder.Any(o => o.order_id == lstFilterOrderIds.FirstOrDefault())) if (orderFilterConfig.lstFilterOrderIds.Count == 1 && !GlobalConfig.lstOrder.Any(o => o.order_id == orderFilterConfig.lstFilterOrderIds.FirstOrDefault()))
{ {
await Task.Run(() => { this.GetOrder(lstFilterOrderIds.FirstOrDefault()); }); await Task.Run(() => { this.GetOrder(orderFilterConfig.lstFilterOrderIds.FirstOrDefault()); });
} }
FilterOrders(); FilterOrders();
} }
@@ -2190,12 +2240,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
private void txtFilterRemark_TextChanged(object sender, TextChangedEventArgs e) private void txtFilterRemark_TextChanged(object sender, TextChangedEventArgs e)
{ {
lstFilterRemarkText = [.. txtFilterRemark.Text.Trim().Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),]; orderFilterConfig.lstFilterRemarkText = [.. txtFilterRemark.Text.Trim().Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),];
} }
private void txtOrderId_TextChanged(object arg1, TextChangedEventArgs arg2) private void txtOrderId_TextChanged(object arg1, TextChangedEventArgs arg2)
{ {
lstFilterOrderIds = [.. txtFilterOrderId.Text.Trim().Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),]; orderFilterConfig.lstFilterOrderIds = [.. txtFilterOrderId.Text.Trim().Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),];
} }
private void chkEmergencyReturnOrRefund_Click(object sender, RoutedEventArgs e) private void chkEmergencyReturnOrRefund_Click(object sender, RoutedEventArgs e)
@@ -2287,14 +2337,27 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
{ {
if (IsLoaded) if (IsLoaded)
{ {
if (string.Join(";", orderFilterConfig.FilterGoodsName) != txtFilterGoodsName.Text) if (string.Join(";", orderFilterConfig.lstFilterGoodsName) != txtFilterGoodsName.Text)
{ {
orderFilterConfig.FilterGoodsName = txtFilterGoodsName.Text.Split(new string[] { ";", ";", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); orderFilterConfig.lstFilterGoodsName = txtFilterGoodsName.Text.Split(new string[] { ";", ";", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList();
NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_order_filter_config", orderFilterConfig); NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_order_filter_config", orderFilterConfig);
} }
} }
} }
private void txtShopName_TextChanged(object arg1, TextChangedEventArgs arg2)
{
if (IsLoaded)
{
//if (string.Join(";", orderFilterConfig.FilterGoodsName) != txtFilterGoodsName.Text)
//{
// orderFilterConfig.FilterGoodsName = txtFilterGoodsName.Text.Split(new string[] { ";", ";", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList();
// NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_order_filter_config", orderFilterConfig);
//}
orderFilterConfig.txtFilterShopNameText = txtShopName.Text.Trim();
}
}
private void cmbFilterGoodsNameType_SelectionChanged(object sender, SelectionChangedEventArgs e) private void cmbFilterGoodsNameType_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
if (IsLoaded) if (IsLoaded)
@@ -2327,9 +2390,80 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
} }
public class OrderFilterConfig public class OrderFilterConfig : PropertyNotifyObject
{ {
public string FilterGoodsNameType { get; set; } = "标题包含"; public string FilterGoodsNameType { get; set; } = "标题包含";
public List<string> FilterGoodsName { get; set; } = new List<string>(); public List<string> lstFilterGoodsName { get; set; } = new List<string>();
/// <summary>
/// 隐藏标记
/// </summary>
public bool chkHideGreenFlagIsChecked
{
get { return this.GetValue(x => x.chkHideGreenFlagIsChecked); }
set { this.SetValue(x => x.chkHideGreenFlagIsChecked, value); }
}
/// <summary>
/// 过滤非本系统订单
/// </summary>
public bool chkOnlyWarehouseOrderIsChecked
{
get { return this.GetValue(x => x.chkOnlyWarehouseOrderIsChecked); }
set { this.SetValue(x => x.chkOnlyWarehouseOrderIsChecked, value); }
}
/// <summary>
/// 过滤多子单订单
/// </summary>
public bool chkNoMultiOrderIsChecked
{
get { return this.GetValue(x => x.chkNoMultiOrderIsChecked); }
set { this.SetValue(x => x.chkNoMultiOrderIsChecked, value); }
}
/// <summary>
/// 云仓
/// </summary>
public bool chkTransitOrderIsChecked
{
get { return this.GetValue(x => x.chkTransitOrderIsChecked); }
set { this.SetValue(x => x.chkTransitOrderIsChecked, value); }
}
/// <summary>
/// 直发
/// </summary>
public bool chkDirectOrderIsChecked
{
get { return this.GetValue(x => x.chkDirectOrderIsChecked); }
set { this.SetValue(x => x.chkDirectOrderIsChecked, value); }
}
/// <summary>
/// 云改直
/// </summary>
public bool chkTransitChangeDirectOrderIsChecked
{
get { return this.GetValue(x => x.chkTransitChangeDirectOrderIsChecked); }
set { this.SetValue(x => x.chkTransitChangeDirectOrderIsChecked, value); }
}
/// <summary>
/// 过滤备注
/// </summary>
public bool chkFilterRemarkIsChecked
{
get { return this.GetValue(x => x.chkFilterRemarkIsChecked); }
set { this.SetValue(x => x.chkFilterRemarkIsChecked, value); }
}
public ConcurrentList<string> lstFilterOrderIds
{
get { return this.GetValue(x => x.lstFilterOrderIds); }
set { this.SetValue(x => x.lstFilterOrderIds, value); }
}
public ConcurrentList<string> lstFilterRemarkText
{
get { return this.GetValue(x => x.lstFilterRemarkText); }
set { this.SetValue(x => x.lstFilterRemarkText, value); }
}
public string txtFilterShopNameText
{
get { return this.GetValue(x => x.txtFilterShopNameText); }
set { this.SetValue(x => x.txtFilterShopNameText, value); }
}
} }
} }
+1 -1
View File
@@ -36,7 +36,7 @@ namespace AllBase
/// 版本ID /// 版本ID
/// </summary> /// </summary>
public static int VersionCount = 256; public static int VersionCount = 257;
public static string ServerUrl { get; set; } = "http://1.13.195.131:9000"; public static string ServerUrl { get; set; } = "http://1.13.195.131:9000";
public static string DebugUrl { get; set; } = "http://localhost:9000"; public static string DebugUrl { get; set; } = "http://localhost:9000";
+4 -2
View File
@@ -129,6 +129,8 @@ namespace AllBase.Helper
public static SolidColorBrush RedTextBrush = new SolidColorBrush(Color.FromArgb(255, 250, 71, 51)); public static SolidColorBrush RedTextBrush = new SolidColorBrush(Color.FromArgb(255, 250, 71, 51));
public static SolidColorBrush RedTextBrush205 = new SolidColorBrush(Color.FromArgb(205, 250, 71, 51)); public static SolidColorBrush RedTextBrush205 = new SolidColorBrush(Color.FromArgb(205, 250, 71, 51));
public static SolidColorBrush RedTextBrush50 = new SolidColorBrush(Color.FromArgb(50, 250, 71, 51)); public static SolidColorBrush RedTextBrush50 = new SolidColorBrush(Color.FromArgb(50, 250, 71, 51));
#endregion public static SolidColorBrush LightRedTextBrush = new SolidColorBrush(Color.FromArgb(255, 245, 108, 108));
} public static SolidColorBrush LightOrangeTextBrush = new SolidColorBrush(Color.FromArgb(255, 230, 162, 60));
#endregion
}
} }
@@ -567,62 +567,58 @@ namespace AllBase.Model.DBModel
// WarehouseWaybillStatusStr = "中转已作废"; // WarehouseWaybillStatusStr = "中转已作废";
else if (ItemTransitOrderWithVoid?.pre_allocated_order_no == 0) else if (ItemTransitOrderWithVoid?.pre_allocated_order_no == 0)
WarehouseWaybillStatusStr = "中转待取号"; WarehouseWaybillStatusStr = "中转待取号";
}
public SolidColorBrush WarehouseWaybillStatusStrColor
{
get
{
var warehouseWaybillStatusStr = WarehouseWaybillStatusStr.ParseToString();
//if (warehouseWaybillStatusStr.StartsWith("中转已作废"))
// return PurpleBrush;
if (warehouseWaybillStatusStr.StartsWith("中转已出库") || warehouseWaybillStatusStr.StartsWith("中转拦截到仓"))
return GlobalConfig.GreenBrush;
if (warehouseWaybillStatusStr.StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号"))
return GlobalConfig.YellowBrush;
if (warehouseWaybillStatusStr.StartsWith("中转待取号"))
return GlobalConfig.RedBrush;
return GlobalConfig.RedBrush;
}
set { }
}
public void SetWarehouseWaybillStatusStrColor()
{
}
var warehouseWaybillStatusStr = WarehouseWaybillStatusStr.ParseToString();
// 状态文字颜色
//if (warehouseWaybillStatusStr.StartsWith("中转已作废"))
// WarehouseWaybillStatusStrColor = PurpleBrush;
if (warehouseWaybillStatusStr.StartsWith("中转已出库") || warehouseWaybillStatusStr.StartsWith("中转拦截到仓"))
WarehouseWaybillStatusStrColor = GlobalConfig.GreenBrush;
else if (warehouseWaybillStatusStr.StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号"))
WarehouseWaybillStatusStrColor = GlobalConfig.YellowBrush;
else if (warehouseWaybillStatusStr.StartsWith("中转待取号"))
WarehouseWaybillStatusStrColor = GlobalConfig.RedBrush;
else
WarehouseWaybillStatusStrColor = GlobalConfig.RedBrush;
// 状态边框颜色
//if (warehouseWaybillStatusStr.StartsWith("中转已作废"))
// WarehouseWaybillStatusBorderColor = PurpleBrush75;
if (warehouseWaybillStatusStr.StartsWith("中转已出库"))
WarehouseWaybillStatusBorderColor = GlobalConfig.GreenBrush75;
else if (warehouseWaybillStatusStr.StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号"))
WarehouseWaybillStatusBorderColor = GlobalConfig.YellowBrush75;
else if (warehouseWaybillStatusStr.StartsWith("中转待取号"))
WarehouseWaybillStatusBorderColor = GlobalConfig.RedBrush75;
else
WarehouseWaybillStatusBorderColor = GlobalConfig.RedBrush75;
// 状态背景颜色
//if (warehouseWaybillStatusStr.StartsWith("中转已作废"))
// WarehouseWaybillStatusBackColor = PurpleBrush35
if (warehouseWaybillStatusStr.ParseToString().StartsWith("中转已出库"))
WarehouseWaybillStatusBackColor = GlobalConfig.GreenBrush35;
else if(warehouseWaybillStatusStr.ParseToString().StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号"))
WarehouseWaybillStatusBackColor = GlobalConfig.YellowBrush35;
else if(warehouseWaybillStatusStr.ParseToString().StartsWith("中转待取号"))
WarehouseWaybillStatusBackColor = GlobalConfig.RedBrush35;
else
WarehouseWaybillStatusBackColor = GlobalConfig.RedBrush35;
}
public SolidColorBrush WarehouseWaybillStatusStrColor
{
get { return this.GetValue(x => x.WarehouseWaybillStatusStrColor); }
set { this.SetValue(x => x.WarehouseWaybillStatusStrColor, value); }
}
public SolidColorBrush WarehouseWaybillStatusBorderColor public SolidColorBrush WarehouseWaybillStatusBorderColor
{ {
get get { return this.GetValue(x => x.WarehouseWaybillStatusBorderColor); }
{ set { this.SetValue(x => x.WarehouseWaybillStatusBorderColor, value); }
string warehouseWaybillStatusStr = this.WarehouseWaybillStatusStr.ParseToString(); }
//if (warehouseWaybillStatusStr.StartsWith("中转已作废"))
// return PurpleBrush75;
if (warehouseWaybillStatusStr.StartsWith("中转已出库"))
return GlobalConfig.GreenBrush75;
if (warehouseWaybillStatusStr.StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号"))
return GlobalConfig.YellowBrush75;
if (warehouseWaybillStatusStr.StartsWith("中转待取号"))
return GlobalConfig.RedBrush75;
return GlobalConfig.RedBrush75;
}
set { }
}
public SolidColorBrush WarehouseWaybillStatusBackColor public SolidColorBrush WarehouseWaybillStatusBackColor
{ {
get get { return this.GetValue(x => x.WarehouseWaybillStatusBackColor); }
{ set { this.SetValue(x => x.WarehouseWaybillStatusBackColor, value); }
string warehouseWaybillStatusStr = this.WarehouseWaybillStatusStr.ParseToString(); }
//if (warehouseWaybillStatusStr.StartsWith("中转已作废"))
// return PurpleBrush35
if (warehouseWaybillStatusStr.ParseToString().StartsWith("中转已出库"))
return GlobalConfig.GreenBrush35;
if (warehouseWaybillStatusStr.ParseToString().StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号"))
return GlobalConfig.YellowBrush35;
if (warehouseWaybillStatusStr.ParseToString().StartsWith("中转待取号"))
return GlobalConfig.RedBrush35;
return GlobalConfig.RedBrush35;
}
set { }
}
#endregion #endregion
/// <summary> /// <summary>
+17 -15
View File
@@ -1,4 +1,5 @@
using AllBase.Model.MvvmBaseClasses; using AllBase.Helper;
using AllBase.Model.MvvmBaseClasses;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -24,20 +25,10 @@ namespace AllBase.Model.DBModel
/// 退款状态颜色 /// 退款状态颜色
/// </summary> /// </summary>
public SolidColorBrush RefundStatusColor public SolidColorBrush RefundStatusColor
{ {
get get { return this.GetValue(x => x.RefundStatusColor); }
{ set { this.SetValue(x => x.RefundStatusColor, value); }
if (status == "MERCHANT_PROCESSING" || status == "PLATFORM_REFUNDING" || status == "USER_WAIT_RETURN" || status == "MERCHANT_WAIT_RECEIPT" || }
status == "USER_WAIT_CONFIRM" || status == "USER_WAIT_CONFIRM_UPDATE" || status == "USER_WAIT_HANDLE_MERCHANT_AFTER_SALE" ||
status == "WAIT_PACKAGE_INTERCEPT")
return new SolidColorBrush(Color.FromRgb(230, 162, 60));
if (status == "MERCHANT_REFUND_SUCCESS" || status == "MERCHANT_RETURN_SUCCESS" ||
status == "USER_CANCELD" /*|| status == "MERCHANT_REJECT_REFUND" || status == "MERCHANT_REJECT_RETURN" || status == "RETURN_CLOSED" || status == "PLATFORM_REFUND_FAIL" || status == "MERCHANT_FAIL"*/)
return new SolidColorBrush(Color.FromRgb(103, 194, 58));
return new SolidColorBrush(Color.FromRgb(245, 108, 108));
}
set { }
}
/// <summary> /// <summary>
/// 售后原因文字 /// 售后原因文字
/// </summary> /// </summary>
@@ -116,6 +107,17 @@ namespace AllBase.Model.DBModel
this.IsRefund = true; this.IsRefund = true;
if (RefundStatusStr == "售后状态读取失败") if (RefundStatusStr == "售后状态读取失败")
this.IsRefund = true; this.IsRefund = true;
// 设置售后状态颜色
if (status == "MERCHANT_PROCESSING" || status == "PLATFORM_REFUNDING" || status == "USER_WAIT_RETURN" || status == "MERCHANT_WAIT_RECEIPT" ||
status == "USER_WAIT_CONFIRM" || status == "USER_WAIT_CONFIRM_UPDATE" || status == "USER_WAIT_HANDLE_MERCHANT_AFTER_SALE" ||
status == "WAIT_PACKAGE_INTERCEPT")
RefundStatusColor = GlobalConfig.LightOrangeTextBrush;
else if (status == "MERCHANT_REFUND_SUCCESS" || status == "MERCHANT_RETURN_SUCCESS" ||
status == "USER_CANCELD" /*|| status == "MERCHANT_REJECT_REFUND" || status == "MERCHANT_REJECT_RETURN" || status == "RETURN_CLOSED" || status == "PLATFORM_REFUND_FAIL" || status == "MERCHANT_FAIL"*/)
RefundStatusColor = GlobalConfig.GreenTextBrush;
else
RefundStatusColor = GlobalConfig.LightRedTextBrush;
} }
} }
/// <summary> /// <summary>
+29 -13
View File
@@ -126,18 +126,22 @@ namespace TemuKJD.ToolForms
{ {
for (int i = 3; i > 0; i--) for (int i = 3; i > 0; i--)
{ {
Invoke(new Action(() => if (this.Created)
{ Invoke(new Action(() =>
this.pnlMask.Visible = true; {
this.pnlMask.Text = "自动拍单倒计时\r\n" + i; this.pnlMask.Visible = true;
})); this.pnlMask.Text = "自动拍单倒计时\r\n" + i;
}));
else
break;
Thread.Sleep(1000); Thread.Sleep(1000);
} }
Invoke(new Action(() => if (this.Created)
{ Invoke(new Action(() =>
this.pnlMask.Visible = false; {
})); this.pnlMask.Visible = false;
}));
}); });
} }
@@ -470,6 +474,9 @@ namespace TemuKJD.ToolForms
var oneGoodsPrice = BaseRegex.GetIntJson(ref data, "goodsPrice"); var oneGoodsPrice = BaseRegex.GetIntJson(ref data, "goodsPrice");
var buyCnt = BaseRegex.GetIntJson(ref data, "goods_number"); var buyCnt = BaseRegex.GetIntJson(ref data, "goods_number");
var buyPrice = BaseRegex.GetIntJson(ref data, "pay_price"); var buyPrice = BaseRegex.GetIntJson(ref data, "pay_price");
if (!this.Created)
return;
Invoke(new Action(() => Invoke(new Action(() =>
{ {
if (!goodsId.IsNullOrZero()) this.txtBuyGoodsId.Text = goodsId.ParseToString(); if (!goodsId.IsNullOrZero()) this.txtBuyGoodsId.Text = goodsId.ParseToString();
@@ -480,7 +487,9 @@ namespace TemuKJD.ToolForms
if (!buyPrice.IsNullOrZero()) this.txtBuyPrice.Text = (buyPrice * 0.01m).ParseToString(); if (!buyPrice.IsNullOrZero()) this.txtBuyPrice.Text = (buyPrice * 0.01m).ParseToString();
})); }));
Invoke(new Action(() => if (!this.Created)
return;
Invoke(new Action(() =>
{ {
if (BuyType == "direct" && txtBuyTransitWarehouse.Text.Contains("******")) if (BuyType == "direct" && txtBuyTransitWarehouse.Text.Contains("******"))
{ {
@@ -653,6 +662,8 @@ namespace TemuKJD.ToolForms
//} //}
})();"; })();";
var ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true); var ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
if (!this.Created)
return "窗口已关闭";
ts1.Wait(5000); ts1.Wait(5000);
for (int i = 0; i < 20; i++) for (int i = 0; i < 20; i++)
{ {
@@ -680,7 +691,10 @@ namespace TemuKJD.ToolForms
ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true); ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
for (int i = 0; i < 20; i++) for (int i = 0; i < 20; i++)
{ {
if (ts1.Result.Result.Value is string rstStr) if (!this.Created)
return "窗口已关闭";
if (ts1.Result.Result.Value is string rstStr)
{ {
if (rstStr == "success") if (rstStr == "success")
break; break;
@@ -739,8 +753,10 @@ namespace TemuKJD.ToolForms
} }
ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true); ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true);
for (int i = 0; i < 20; i++) for (int i = 0; i < 20; i++)
{ {
if (ts1.Result.Result.Value is string rstStr) if (!this.Created)
return "窗口已关闭";
if (ts1.Result.Result.Value is string rstStr)
{ {
if (rstStr == "success") if (rstStr == "success")
break; break;