diff --git a/29WxOrderWpf/Ctrls/PDDInvoice/PDDInvoiceView.xaml b/29WxOrderWpf/Ctrls/PDDInvoice/PDDInvoiceView.xaml
index bd62198..5b88d37 100644
--- a/29WxOrderWpf/Ctrls/PDDInvoice/PDDInvoiceView.xaml
+++ b/29WxOrderWpf/Ctrls/PDDInvoice/PDDInvoiceView.xaml
@@ -222,6 +222,22 @@
Text="请输入订单号 / 商品名称"
Visibility="{Binding Text, ElementName=txtSearch, Converter={StaticResource NotHasTextVisibility}}" />
+
+
+
+
+
+
+
+
+ IsChecked="{Binding IsSelected}" />
diff --git a/29WxOrderWpf/Ctrls/PDDInvoice/Resources/invoice.js b/29WxOrderWpf/Ctrls/PDDInvoice/Resources/invoice.js
index 67939f4..5186c96 100644
--- a/29WxOrderWpf/Ctrls/PDDInvoice/Resources/invoice.js
+++ b/29WxOrderWpf/Ctrls/PDDInvoice/Resources/invoice.js
@@ -97,7 +97,7 @@ async function fillInvoiceAndApply(data = {}) {
console.log('✅ 已经申请过,无需重复操作');
return true;
}
- const successElement = findElement('//*[text()="确认您的发票信息无误后再提交"]');
+ const successElement = findElement('//*[text()="确认发票信息无误后再提交"]');
if (successElement == null) {
return false;
}
diff --git a/29WxOrderWpf/Ctrls/PDDInvoice/ViewModels/PDDInvoiceViewModel.cs b/29WxOrderWpf/Ctrls/PDDInvoice/ViewModels/PDDInvoiceViewModel.cs
index 7ab1c22..1b33fba 100644
--- a/29WxOrderWpf/Ctrls/PDDInvoice/ViewModels/PDDInvoiceViewModel.cs
+++ b/29WxOrderWpf/Ctrls/PDDInvoice/ViewModels/PDDInvoiceViewModel.cs
@@ -41,6 +41,7 @@ namespace _29WxOrderWpf.Ctrls.PDDInvoice.ViewModels;
///
public partial class PDDInvoiceViewModel : BindableBaseEx
{
+ private const string ConfigPath = "./invoice.config";
private readonly ObservableCollection _allOrders = new();
private readonly HashSet _orderSns = new();
private string _searchText = "";
@@ -49,9 +50,11 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
private bool _isInvoiceDetailOpen;
private string _invoiceTitle = "";
private string _taxNo = "";
- private CancellationTokenSource _cancellationTokenSource; public PDDInvoiceViewModel()
+ private CancellationTokenSource _cancellationTokenSource;
+ private InvoiceConfig Config { get; }
+ public PDDInvoiceViewModel()
{
-
+ Config = NaiBa.Util.Helper.ConfigHelper.LoadConfig(ConfigPath);
Orders = new ObservableCollection();
Orders.CollectionChanged += Orders_CollectionChanged;
@@ -60,6 +63,10 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
InitBrowser();
+ if (Config == null) Config = new InvoiceConfig();
+ InvoiceTitle = Config.Title;
+ TaxNo = Config.TaxNo;
+ MaxAmount = Config.MaxAmount;
if (EnvironmentHelper.IsTest)
{
@@ -105,6 +112,17 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
public ObservableCollectionThreadSafe BuyerLoginList { get; set; } = new ObservableCollectionThreadSafe();
+ public int InvoiceStatus
+ {
+ get => GetValue();
+ set => SetValue(value, InvoiceStatusChanged);
+ }
+
+ private void InvoiceStatusChanged()
+ {
+
+ }
+
public BuyerLoginInfo SelectedBuyer
{
get => GetProperty(() => SelectedBuyer);
@@ -371,6 +389,11 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
"批量开票");
if (confirm.DialogResult != true) return;
+ Config.Title = InvoiceTitle;
+ Config.TaxNo = TaxNo;
+ Config.MaxAmount = MaxAmount;
+ NaiBa.Util.Helper.ConfigHelper.SaveConfig(ConfigPath, Config);
+
await BatchInvoiceAsync(targets);
}
@@ -460,8 +483,17 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
{
var keyword = SearchText?.Trim();
Orders.Clear();
- foreach (var order in _allOrders.Where(o => IsKeywordMatch(o, keyword)))
+ bool? _tempIsInvoiced = InvoiceStatus == 0 ? null : InvoiceStatus == 2;
+ foreach (var order in _allOrders)
{
+ if (_tempIsInvoiced.HasValue)
+ {
+ if (order.IsInvoiced != _tempIsInvoiced.Value) continue;
+ }
+ if (!IsKeywordMatch(order, keyword))
+ {
+ continue;
+ }
Orders.Add(order);
}
}
@@ -476,6 +508,7 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
private void ResetSearch()
{
SearchText = "";
+ InvoiceStatus = 0;
Search();
}
///
@@ -608,6 +641,7 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
}
}
+ Orders.FirstOrDefault().IsInvoiced = true;
return Task.CompletedTask;
}
@@ -714,3 +748,9 @@ public partial class PDDInvoiceViewModel : BindableBaseEx
#endregion
}
+class InvoiceConfig
+{
+ public string Title { get; set; }
+ public string TaxNo { get; set; }
+ public decimal MaxAmount { get; set; }
+}
\ No newline at end of file