订单筛选功能优化

This commit is contained in:
wule committed 2026-09-15 20:01:59 +08:00
1 parent 9ce8c6e6bc
commit f3ec329e77
7 files changed
+347 -62

No files matched your search

+134 -30
View File
@@ -666,15 +666,35 @@
Margin="4,0,4,4"
BorderBrush="#e0e0e0"
BorderThickness="0,0,0,1">
<CheckBox
x:Name="chkDirectSendFailed"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkDirectSendFailed_Click"
Content="直拍发货失败"
FontSize="12" />
<WrapPanel>
<CheckBox
x:Name="chkDirectSendFailed"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkDirectSendFailed_Click"
Content="直拍发货失败"
FontSize="12" />
<CheckBox
x:Name="chkWaitSend48HourNoWaybill"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkWaitSendNoWaybill_Click"
Content="48小时未发货"
FontSize="12" />
<CheckBox
x:Name="chkWaitSend72HourNoWaybill"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkWaitSendNoWaybill_Click"
Content="72小时未发货"
FontSize="12" />
</WrapPanel>
</Border>
</TabItem>
<TabItem
@@ -700,15 +720,43 @@
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox
x:Name="chkNeedCheckExpress"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkNeedCheckExpress_Click"
Content="需核对物流"
FontSize="12" />
<WrapPanel>
<CheckBox
x:Name="chkNeedCheckExpress"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkNeedCheckExpress_Click"
Content="需核对物流"
FontSize="12" />
<Polyline
Grid.Column="3"
Width="10"
Margin="5,0"
VerticalAlignment="Center"
Points="5,0 5,8 5,0"
Stroke="{StaticResource mainColorBrush}"
StrokeThickness="2" />
<CheckBox
x:Name="chk48HourNoWaybill"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkNoWaybill_Click"
Content="48小时未发货"
FontSize="12" />
<CheckBox
x:Name="chk72HourNoWaybill"
Margin="6,8"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="{StaticResource mainColorBrush}"
Click="chkNoWaybill_Click"
Content="72小时未发货"
FontSize="12" />
</WrapPanel>
<WrapPanel
Grid.Column="2"
d:Opacity="0.2"
@@ -1017,7 +1065,7 @@
</wpf:TitleContent>
<wpf:TitleContent
Title="拦截退回总店状态"
Margin="4,0,4,0"
Margin="8,0,4,0"
VerticalContentAlignment="Center"
FontSize="12"
Foreground="Black"
@@ -1090,17 +1138,7 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<WrapPanel>
<Button
x:Name="btnBatchRefund2"
Grid.Column="1"
Height="20"
MinWidth="48"
Margin="6,6"
Padding="4,0"
Click="btnBatchRefund_Click"
Content="批量申请买手售后"
FontSize="12"
Style="{StaticResource BasePageButtonStyle}" />
<CheckBox
x:Name="chkShopIsRefund"
Grid.Column="0"
@@ -1139,6 +1177,72 @@
Click="chkUpShopAddressAnalyseFailed_Click"
Content="总店地址解析失败"
FontSize="12" />
<Polyline
Grid.Column="14"
Width="10"
Margin="5,0"
VerticalAlignment="Center"
Points="5,0 5,8 5,0"
Stroke="{StaticResource mainColorBrush}"
StrokeThickness="2"
Visibility="Visible" />
<wpf:TitleContent
Title="买手退货状态"
Margin="4,0,4,0"
VerticalContentAlignment="Center"
FontSize="12"
Foreground="Black"
Placement="Left"
TitleVerticalAlignment="Center">
<ComboBox
x:Name="cmbReturnOrderBuyerStatus"
Width="130"
Height="23"
SelectedIndex="0"
SelectionChanged="cmbReturnOrderBuyerStatus_SelectionChanged"
Style="{StaticResource RoundedComboBox}">
<ComboBoxItem Content="请选择" />
<ComboBoxItem Content="买手待申请售后" />
<ComboBoxItem Content="买手待退货" />
<ComboBoxItem Content="买手已寄出待商家退款" />
<ComboBoxItem Content="买手退货失败" />
</ComboBox>
</wpf:TitleContent>
<Button
x:Name="btnBatchRefund2"
Grid.Column="1"
Height="20"
MinWidth="48"
Margin="6,6"
Padding="4,0"
Click="btnBatchRefund_Click"
Content="批量申请买手售后"
FontSize="12"
Style="{StaticResource BasePageButtonStyle}" />
<wpf:TitleContent
Title="退货仓状态"
Margin="8,0,4,0"
VerticalContentAlignment="Center"
FontSize="12"
Foreground="Black"
Placement="Left"
TitleVerticalAlignment="Center">
<ComboBox
x:Name="cmbReturnOrderStatus"
Width="100"
Height="23"
SelectedIndex="0"
SelectionChanged="cmbReturnOrderStatus_SelectionChanged"
Style="{StaticResource RoundedComboBox}">
<ComboBoxItem Content="请选择" />
<ComboBoxItem Content="未创建" />
<ComboBoxItem Content="创建失败" />
<ComboBoxItem Content="已创建未到仓" />
<ComboBoxItem Content="已到仓" />
<ComboBoxItem Content="已发回" />
</ComboBox>
</wpf:TitleContent>
</WrapPanel>
</Grid>
</Border>
@@ -1557,6 +1557,31 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
if (!rst2)
return true;
}
if (chkWaitSend72HourNoWaybill.IsChecked == true)
{
if (order.orderItems.Any(oi => oi.DirectPddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && bOrder?.order_time <= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72))))
{ }
else if (order.orderItems.Any(oi => oi.PddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && bOrder?.order_time <= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72))))
{ }
else
return true;
}
else if (chkWaitSend48HourNoWaybill.IsChecked == true)
{
if (order.orderItems.Any(oi => oi.DirectPddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && (bOrder?.order_time < BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-48)) &&
bOrder.order_time >= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72)))))
{ }
else if (order.orderItems.Any(oi => oi.PddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && (bOrder?.order_time < BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-48)) &&
bOrder.order_time >= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72)))))
{ }
else
return true;
}
}
if (filterHeadStr.StartsWith("待收货"))
{
@@ -1585,6 +1610,31 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
return true;
if (chkWaitReceiveWarehouseIsSendOut.IsChecked == true && order.orderItems.All(oi => oi.WarehouseWaybillStatusStr != "中转已出库"))
return true;
if (chk72HourNoWaybill.IsChecked == true)
{
if (order.orderItems.Any(oi => oi.DirectPddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && bOrder?.order_time <= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72))))
{ }
else if (order.orderItems.Any(oi => oi.PddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && bOrder?.order_time <= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72))))
{ }
else
return true;
}
else if (chk48HourNoWaybill.IsChecked == true)
{
if (order.orderItems.Any(oi => oi.DirectPddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && (bOrder?.order_time < BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-48)) &&
bOrder.order_time >= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72)))))
{ }
else if (order.orderItems.Any(oi => oi.PddBuyerOrders.OrderByDescending(bo => bo.order_time).FirstOrDefault() is order_pdd_buyer_order bOrder &&
(bOrder?.tracking_number).IsNullOrEmpty() && (bOrder?.order_time < BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-48)) &&
bOrder.order_time >= BaseClass.DateTimeToTimestampSeconds(DateTime.Now.AddHours(-72)))))
{ }
else
return true;
}
}
if (filterHeadStr.StartsWith("异常需重拍") && !order.isAbnormal)
{
@@ -1683,12 +1733,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
foreach (var orderItem in order.orderItems)
{
for (int i = 0; i < 1000; i++)
{
var receiver = TransitReturnOrderWindow.PddAddressAnalysis(orderItem.PddBuyerAfterSale?.afterSaleAddress);
if (!receiver.receiver_address.IsNullOrEmpty())
return true;
}
var receiver = TransitReturnOrderWindow.PddAddressAnalysis(orderItem.PddBuyerAfterSale?.afterSaleAddress);
if (!receiver.receiver_address.IsNullOrEmpty() && receiver.receiver_name.Length <= 15)
return true;
}
}
else
@@ -1699,11 +1746,34 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
foreach (var orderItem in order.orderItems)
{
var receiver = TransitReturnOrderWindow.PddAddressAnalysis(orderItem.DirectPddBuyerAfterSale?.afterSaleAddress);
if (!receiver.receiver_address.IsNullOrEmpty())
if (!receiver.receiver_address.IsNullOrEmpty() && receiver.receiver_name.Length <= 15)
return true;
}
}
}
var cmbReturnOrderStatusText = cmbReturnOrderStatus.SelectedItem.ParseToString().Replace("System.Windows.Controls.ComboBoxItem: ", "");
if (cmbReturnOrderStatusText == "未创建" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr == "未创建"))
return true;
if (cmbReturnOrderStatusText == "创建失败" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr == "创建失败"))
return true;
if (cmbReturnOrderStatusText == "已创建未到仓" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr.StartsWith("已创建未到仓")))
return true;
if (cmbReturnOrderStatusText == "已到仓" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr.StartsWith("已到仓")))
return true;
if (cmbReturnOrderStatusText == "已发回" && !order.orderItems.Any(oi => oi.AddEditTransitWarehouseReturnOrderStr.StartsWith("已发回")))
return true;
var cmbReturnOrderBuyerStatusText = cmbReturnOrderBuyerStatus.SelectedItem.ParseToString().Replace("System.Windows.Controls.ComboBoxItem: ", "");
if (cmbReturnOrderBuyerStatusText == "买手待申请售后" && order.orderItems.All(oi => !oi.TransitRefundStatusStr.Contains("需手动申请售后")))
return true;
else if (cmbReturnOrderBuyerStatusText == "买手待退货" && order.orderItems.All(oi => !oi.TransitRefundStatusStr.Contains("待用户发货")))
return true;
else if (cmbReturnOrderBuyerStatusText == "买手已寄出待商家退款" && order.orderItems.All(oi => !oi.TransitRefundStatusStr.Contains("商家处理中")))
return true;
else if (cmbReturnOrderBuyerStatusText == "买手退货失败" && order.orderItems.All(oi => !oi.TransitRefundStatusStr.Contains("退款失败")))
return true;
}
if (filterHeadStr.StartsWith("售后完成单"))
{
@@ -2762,6 +2832,38 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls
Content = autoBuyIntroForm,
}.ShowDialog();
}
private void chkNoWaybill_Click(object sender, RoutedEventArgs e)
{
if (sender is CheckBox chk)
{
var isCheck = !chk.IsChecked.ParseToBool();
chk48HourNoWaybill.IsChecked = chk72HourNoWaybill.IsChecked = false;
chk.IsChecked = !isCheck;
}
FilterOrders();
}
private void chkWaitSendNoWaybill_Click(object sender, RoutedEventArgs e)
{
if (sender is CheckBox chk)
{
var isCheck = !chk.IsChecked.ParseToBool();
chkWaitSend48HourNoWaybill.IsChecked = chkWaitSend72HourNoWaybill.IsChecked = false;
chk.IsChecked = !isCheck;
}
FilterOrders();
}
private void cmbReturnOrderStatus_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
FilterOrders();
}
private void cmbReturnOrderBuyerStatus_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
FilterOrders();
}
}
public class OrderFilterConfig : PropertyNotifyObject
@@ -430,15 +430,33 @@
</WrapPanel>
<!-- 售后状态 -->
<TextBlock
x:Name="txtStatusStr"
HorizontalAlignment="Center"
VerticalAlignment="Top"
d:Text="售后状态"
Background="Transparent"
Foreground="{Binding ItemRefund.RefundStatusColor}"
Text="{Binding ItemRefund.RefundStatusStr}"
Visibility="{Binding ElementName=txtStatusStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
<WrapPanel>
<TextBlock
x:Name="txtOrderItemStatusStr"
HorizontalAlignment="Center"
VerticalAlignment="Top"
d:Text="物品售后状态"
Background="Transparent"
Foreground="{Binding ItemRefund.RefundStatusColor}"
Text="{Binding RefundStatusStr}"
Visibility="{Binding ElementName=txtOrderItemStatusStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Top"
Background="Transparent"
Foreground="{Binding ItemRefund.RefundStatusColor}"
Text=":"
Visibility="{Binding ElementName=txtOrderItemStatusStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
<TextBlock
x:Name="txtStatusStr"
HorizontalAlignment="Center"
VerticalAlignment="Top"
d:Text="售后状态"
Background="Transparent"
Foreground="{Binding ItemRefund.RefundStatusColor}"
Text="{Binding ItemRefund.RefundStatusStr}"
Visibility="{Binding ElementName=txtStatusStr, Path=Text, Converter={StaticResource HasTextVisibility}}" />
</WrapPanel>
<!-- 售后原因 -->
<TextBlock
x:Name="txtRefundReasonTextStr"
@@ -1115,7 +1133,7 @@
WaterMark="云仓退货" />
<Button
x:Name="btnRetrunOrder"
d:Content="添加"
d:Content="未创建"
Click="btnReturnOrder_Click"
Content="{Binding AddEditTransitWarehouseReturnOrderStr}"
Style="{StaticResource LinkButton}" />
@@ -110,7 +110,8 @@ namespace _29WxOrderWpf.Windows.OrderWindows
txtMobile.Text = OrderItem.DistribReturnOrderInfo.receiver_phone;
}
if (OrderItem.AddEditTransitWarehouseReturnOrderStr == "已创建" || OrderItem.AddEditTransitWarehouseReturnOrderStr == "处理中")
if (OrderItem.AddEditTransitWarehouseReturnOrderStr == "已创建未到仓" || OrderItem.AddEditTransitWarehouseReturnOrderStr == "已到仓" ||
OrderItem.AddEditTransitWarehouseReturnOrderStr == "已发回")
btnAdd.IsEnabled = false;
}
}
@@ -254,7 +255,7 @@ namespace _29WxOrderWpf.Windows.OrderWindows
if (wxExpressName.IsNullOrEmpty() || OrderItem.ItemRefund.return_waybill_id.IsNullOrEmpty() || receiver.receiver_name.IsNullOrEmpty() || receiver.receiver_phone.IsNullOrEmpty() ||
receiver.receiver_province.IsNullOrEmpty() || receiver.receiver_city.IsNullOrEmpty() || receiver.receiver_area.IsNullOrEmpty() || receiver.receiver_address.IsNullOrEmpty())
{
if (!string.IsNullOrWhiteSpace(aftersaleAddress))
if (!string.IsNullOrWhiteSpace(aftersaleAddress) || receiver.receiver_name.Length > 15)
{
// todo 提示地址解析失败请手动提交
OrderItem.AddEditTransitWarehouseReturnOrderStr = "解析失败请手动添加";