1836 lines
77 KiB
C#
1836 lines
77 KiB
C#
using AllBase.Helper;
|
||
using AllBase.Model.MvvmBaseClasses;
|
||
using NaiBa.Util.Extension;
|
||
using Newtonsoft.Json.Linq;
|
||
using NPOI.SS.Formula.Functions;
|
||
using Org.BouncyCastle.Asn1.Mozilla;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Runtime.CompilerServices;
|
||
using System.Text;
|
||
using System.Threading;
|
||
using System.Threading.Tasks;
|
||
using System.Windows;
|
||
using System.Windows.Forms;
|
||
using System.Windows.Media;
|
||
using System.Windows.Threading;
|
||
|
||
namespace AllBase.Model.DBModel
|
||
{
|
||
public class oms_wei_order_item_info : PropertyNotifyObject
|
||
{
|
||
/// <summary>
|
||
/// 订单对应店铺
|
||
/// </summary>
|
||
public ShopLoginInfo Shop
|
||
{
|
||
get { return this.GetValue(x => x.Shop); }
|
||
set { this.SetValue(x => x.Shop, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 订单扩展信息
|
||
/// </summary>
|
||
public Visibility OrderItemVisibility
|
||
{
|
||
get { return this.GetValue(x => x.OrderItemVisibility); }
|
||
set { this.SetValue(x => x.OrderItemVisibility, value); }
|
||
}
|
||
|
||
|
||
#region 订单采购参数
|
||
/// <summary>
|
||
/// 采购关联
|
||
/// </summary>
|
||
public WXBuyMapInfo PddBuyMap
|
||
{
|
||
get { return this.GetValue(x => x.PddBuyMap); }
|
||
set { this.SetValue(x => x.PddBuyMap, value); }
|
||
}
|
||
/// <summary>
|
||
/// 淘宝采购关联
|
||
/// </summary>
|
||
public WXBuyMapInfo TbBuyMap
|
||
{
|
||
get { return this.GetValue(x => x.TbBuyMap); }
|
||
set { this.SetValue(x => x.TbBuyMap, value); }
|
||
}
|
||
public Visibility MapSkusBtnVisibility
|
||
{
|
||
get { return this.GetValue(x => x.MapSkusBtnVisibility); }
|
||
set { this.SetValue(x => x.MapSkusBtnVisibility, value); }
|
||
}
|
||
public List<WXBuyMapSkusInfo> PddBuyMapSkus
|
||
{
|
||
get { return this.GetValue(x => x.PddBuyMapSkus); }
|
||
set { this.SetValue(x => x.PddBuyMapSkus, value); }
|
||
}
|
||
|
||
public List<WXBuyMapSkusInfo> TbBuyMapSkus
|
||
{
|
||
get { return this.GetValue(x => x.TbBuyMapSkus); }
|
||
set { this.SetValue(x => x.TbBuyMapSkus, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 采购按钮文字
|
||
/// </summary>
|
||
public string BuyGoodsBtnTxt
|
||
{
|
||
get { return this.GetValue(x => x.BuyGoodsBtnTxt); }
|
||
set { this.SetValue(x => x.BuyGoodsBtnTxt, value); }
|
||
}
|
||
/// <summary>
|
||
/// 采购按钮颜色
|
||
/// </summary>
|
||
public SolidColorBrush BuyGoodsBtnColor
|
||
{
|
||
get { return this.GetValue(x => x.BuyGoodsBtnColor); }
|
||
set { this.SetValue(x => x.BuyGoodsBtnColor, value); }
|
||
}
|
||
/// <summary>
|
||
/// 采购按钮背景颜色
|
||
/// </summary>
|
||
public SolidColorBrush BuyGoodsBtnBackColor
|
||
{
|
||
get { return this.GetValue(x => x.BuyGoodsBtnBackColor); }
|
||
set { this.SetValue(x => x.BuyGoodsBtnBackColor, value); }
|
||
}
|
||
/// <summary>
|
||
/// 采购按钮是否可用
|
||
/// </summary>
|
||
public bool IsBuyGoodsBtnEnabled
|
||
{
|
||
get { return this.GetValue(x => x.IsBuyGoodsBtnEnabled); }
|
||
set { this.SetValue(x => x.IsBuyGoodsBtnEnabled, value); }
|
||
}
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 订单扩展信息
|
||
/// </summary>
|
||
public order_item_ext OrderItemExt
|
||
{
|
||
get { return this.GetValue(x => x.OrderItemExt); }
|
||
set { this.SetValue(x => x.OrderItemExt, value); }
|
||
}
|
||
/// <summary>
|
||
/// 店铺后台显示的物流异常信息(订单扩展信息)
|
||
/// </summary>
|
||
public string ShopWaybillExceptionStr
|
||
{
|
||
get { return this.GetValue(x => x.ShopWaybillExceptionStr); }
|
||
set { this.SetValue(x => x.ShopWaybillExceptionStr, value); }
|
||
}
|
||
public Visibility ShopWaybillExceptionStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.ShopWaybillExceptionStrVisibility); }
|
||
set { this.SetValue(x => x.ShopWaybillExceptionStrVisibility, value); }
|
||
}
|
||
void SetOrderItemExtInfo()
|
||
{
|
||
ShopWaybillExceptionStr = OrderItemExt == null ? "" : OrderItemExt.abnormal_text.ParseToString();
|
||
ShopWaybillExceptionStrVisibility = ShopWaybillExceptionStr.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible;
|
||
}
|
||
|
||
|
||
public oms_wei_order_info ItemOrder
|
||
{
|
||
get { return this.GetValue(x => x.ItemOrder); }
|
||
set { this.SetValue(x => x.ItemOrder, value); }
|
||
}
|
||
|
||
#region 订单售后状态参数
|
||
public oms_wei_refund_info ItemRefund
|
||
{
|
||
get { return this.GetValue(x => x.ItemRefund); }
|
||
set { this.SetValue(x => x.ItemRefund, value);
|
||
RefundReasonTextStrVisibility = ItemRefund?.ReasonTextStrVisibility ?? Visibility.Collapsed;
|
||
RefundAfterSaleOrderIdVisibility = ItemRefund?.AfterSaleOrderIdVisibility ?? Visibility.Collapsed; }
|
||
}
|
||
public Visibility RefundReasonTextStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.RefundReasonTextStrVisibility); }
|
||
set { this.SetValue(x => x.RefundReasonTextStrVisibility, value); }
|
||
}
|
||
public Visibility RefundAfterSaleOrderIdVisibility
|
||
{
|
||
get { return this.GetValue(x => x.RefundAfterSaleOrderIdVisibility); }
|
||
set { this.SetValue(x => x.RefundAfterSaleOrderIdVisibility, value); }
|
||
}
|
||
|
||
public string RefundAddressStr
|
||
{
|
||
get { return this.GetValue(x => x.RefundAddressStr); }
|
||
set
|
||
{
|
||
this.SetValue(x => x.RefundAddressStr, value);
|
||
|
||
if (RefundAddressStr.ParseToString().Length > 26)
|
||
RefundAddressShortStr = string.Join("", RefundAddressStr.ParseToString().Take(26)) + "…";
|
||
else
|
||
RefundAddressShortStr = RefundAddressStr.ParseToString().Trim();
|
||
|
||
RefundAddressShortStrVisibility = RefundAddressShortStr.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible;
|
||
}
|
||
}
|
||
public string RefundAddressShortStr
|
||
{
|
||
get { return this.GetValue(x => x.RefundAddressShortStr); }
|
||
set { this.SetValue(x => x.RefundAddressShortStr, value); }
|
||
}
|
||
public Visibility RefundAddressShortStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.RefundAddressShortStrVisibility); }
|
||
set { this.SetValue(x => x.RefundAddressShortStrVisibility, value); }
|
||
}
|
||
|
||
public void SetItemRefund()
|
||
{
|
||
if (order_id == "3739902323987233280")
|
||
{
|
||
|
||
}
|
||
if (ItemOrder?.refundItems?.Count == 1)
|
||
ItemRefund = ItemOrder?.refundItems?.FirstOrDefault();
|
||
else
|
||
ItemRefund = ItemOrder?.refundItems?.FirstOrDefault(r => r.sku_id == this.sku_id);
|
||
|
||
if (ItemRefund?.status != "MERCHANT_REFUND_SUCCESS" && ItemRefund?.status != "MERCHANT_RETURN_SUCCESS")
|
||
this.RefundResultStr = "";
|
||
else
|
||
this.RefundResultStr = "商品退款数量:" + ItemRefund.count + ",订单状态:" + ItemOrder.orderStatusStr;
|
||
this.ReturnWaybillIdStr = ItemRefund?.return_waybill_id;
|
||
|
||
this.RefundDatetime = ItemRefund?.create_time == null ? DateTime.MinValue : BaseClass.StampToDateTime((ItemRefund?.create_time).ParseToInt());
|
||
if (ItemOrder != null)
|
||
ItemOrder.RefundDatetime = this.RefundDatetime;
|
||
|
||
this.RefundDateTimeStr = RefundDatetime.ToString("yy-MM-dd HH:mm:ss");
|
||
this.RefundTimeVisibility = RefundDatetime == DateTime.MinValue ? Visibility.Collapsed : Visibility.Visible;
|
||
|
||
RefundAddressStr = "";
|
||
if (ItemRefund != null)
|
||
RefundAddressStr = ItemRefund.return_user_name + " " + ItemRefund.return_tel + " " +
|
||
ItemRefund.return_province + ItemRefund.return_city + ItemRefund.return_county + ItemRefund.return_detail;
|
||
}
|
||
/// <summary>
|
||
/// 退款状态文本
|
||
/// </summary>
|
||
public string RefundResultStr
|
||
{
|
||
get { return this.GetValue(x => x.RefundResultStr); }
|
||
set { this.SetValue(x => x.RefundResultStr, value); RefundResultStrVisibility = RefundResultStr.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility RefundResultStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.RefundResultStrVisibility); }
|
||
set { this.SetValue(x => x.RefundResultStrVisibility, value); }
|
||
}
|
||
/// <summary>
|
||
/// 微信小店用户退款快递单号
|
||
/// </summary>
|
||
public string ReturnWaybillIdStr
|
||
{
|
||
get { return this.GetValue(x => x.ReturnWaybillIdStr); }
|
||
set { this.SetValue(x => x.ReturnWaybillIdStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 订单退款时间
|
||
/// </summary>
|
||
public DateTime RefundDatetime
|
||
{
|
||
get { return this.GetValue(x => x.RefundDatetime); }
|
||
set { this.SetValue(x => x.RefundDatetime, value); }
|
||
}
|
||
/// <summary>
|
||
/// 订单退款时间文本
|
||
/// </summary>
|
||
public string RefundDateTimeStr
|
||
{
|
||
get { return this.GetValue(x => x.RefundDateTimeStr); }
|
||
set { this.SetValue(x => x.RefundDateTimeStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 订单退款时间可见
|
||
/// </summary>
|
||
public Visibility RefundTimeVisibility
|
||
{
|
||
get { return this.GetValue(x => x.RefundTimeVisibility); }
|
||
set { this.SetValue(x => x.RefundTimeVisibility, value); }
|
||
}
|
||
#endregion
|
||
|
||
#region 中转仓及中转拍单相关参数
|
||
/// <summary>
|
||
/// 中转订单列表
|
||
/// </summary>
|
||
public List<oms_wei_external_procurement_log_info> ItemTransitOrders { get; set; } = new List<oms_wei_external_procurement_log_info>();
|
||
/// <summary>
|
||
/// 当前仓库订单(不可以是作废单)
|
||
/// </summary>
|
||
public oms_wei_external_procurement_log_info ItemTransitOrder
|
||
{
|
||
get { return this.GetValue(x => x.ItemTransitOrder); }
|
||
set { this.SetValue(x => x.ItemTransitOrder, value); }
|
||
}
|
||
/// <summary>
|
||
/// 当前仓库订单(可以是作废单)
|
||
/// </summary>
|
||
public oms_wei_external_procurement_log_info ItemTransitOrderWithVoid
|
||
{
|
||
get { return this.GetValue(x => x.ItemTransitOrderWithVoid); }
|
||
set { this.SetValue(x => x.ItemTransitOrderWithVoid, value); }
|
||
}
|
||
public Visibility ItemTransitOutOrderBuyerStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.ItemTransitOutOrderBuyerStrVisibility); }
|
||
set { this.SetValue(x => x.ItemTransitOutOrderBuyerStrVisibility, value); }
|
||
}
|
||
public Visibility ItemTransitOutOrderNoStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.ItemTransitOutOrderNoStrVisibility); }
|
||
set { this.SetValue(x => x.ItemTransitOutOrderNoStrVisibility, value); }
|
||
}
|
||
public List<oms_wei_external_procurement_after_sale_info> ItemTransitOrderAfterSales { get; set; } = new List<oms_wei_external_procurement_after_sale_info>();
|
||
public oms_wei_external_procurement_after_sale_info ItemTransitOrderAfterSale
|
||
{
|
||
get { return this.GetValue(x => x.ItemTransitOrderAfterSale); }
|
||
set { this.SetValue(x => x.ItemTransitOrderAfterSale, value); }
|
||
}
|
||
public List<oms_wei_transfer_extra_package> ItemTransitExtraOrders
|
||
{
|
||
get { return this.GetValue(x => x.ItemTransitExtraOrders); }
|
||
set { this.SetValue(x => x.ItemTransitExtraOrders, value); }
|
||
}
|
||
public oms_wei_transfer_extra_package ItemTransitExtraOrder
|
||
{
|
||
get { return this.GetValue(x => x.ItemTransitExtraOrder); }
|
||
set
|
||
{
|
||
this.SetValue(x => x.ItemTransitExtraOrder, value);
|
||
if (ItemTransitExtraOrder != null)
|
||
{
|
||
if (ItemTransitExtraOrder.real_logistics_code.IsNullOrEmpty())
|
||
{
|
||
ItemTransitExtraOrder.real_logistics_code = "滞留补发处理中";
|
||
}
|
||
}
|
||
TransitExtraPackageWaybillStr = (ItemTransitExtraOrder?.real_logistics_code + "-" + ItemTransitExtraOrder?.real_logistics_express_code).Trim('-');
|
||
TransitExtraPackageWaybillBtnStr = ItemTransitExtraOrder?.order_void_status == 1 ? "已作废" : "作废";
|
||
}
|
||
}
|
||
public string TransitExtraPackageWaybillStr
|
||
{
|
||
get { return this.GetValue(x => x.TransitExtraPackageWaybillStr); }
|
||
set { this.SetValue(x => x.TransitExtraPackageWaybillStr, value); TransitExtraPackageWaybillStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility TransitExtraPackageWaybillStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.TransitExtraPackageWaybillStrVisibility); }
|
||
set { this.SetValue(x => x.TransitExtraPackageWaybillStrVisibility, value); }
|
||
}
|
||
public string TransitExtraPackageWaybillBtnStr
|
||
{
|
||
get { return this.GetValue(x => x.TransitExtraPackageWaybillBtnStr); }
|
||
set { this.SetValue(x => x.TransitExtraPackageWaybillBtnStr, value); TransitExtraPackageWaybillBtnStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility TransitExtraPackageWaybillBtnStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.TransitExtraPackageWaybillBtnStrVisibility); }
|
||
set { this.SetValue(x => x.TransitExtraPackageWaybillBtnStrVisibility, value); }
|
||
}
|
||
public List<order_pdd_buyer_order> PddBuyerOrders { get; set; } = new List<order_pdd_buyer_order>();
|
||
public order_pdd_buyer_order PddBuyerOrder
|
||
{
|
||
get { return this.GetValue(x => x.PddBuyerOrder); }
|
||
set { this.SetValue(x => x.PddBuyerOrder, value); }
|
||
}
|
||
public List<order_pdd_buyer_after_sale> PddBuyerAfterSales { get; set; } = new List<order_pdd_buyer_after_sale>();
|
||
public order_pdd_buyer_after_sale PddBuyerAfterSale
|
||
{
|
||
get { return this.GetValue(x => x.PddBuyerAfterSale); }
|
||
set
|
||
{
|
||
this.SetValue(x => x.PddBuyerAfterSale, value);
|
||
// 云仓买手退货地址
|
||
this.PddBuyerAfterSaleAddressStr = this.PddBuyerAfterSale?.afterSaleAddress;
|
||
}
|
||
}
|
||
public string PddBuyerAfterSaleAddressStr
|
||
{
|
||
get { return this.GetValue(x => x.PddBuyerAfterSaleAddressStr); }
|
||
set
|
||
{
|
||
this.SetValue(x => x.PddBuyerAfterSaleAddressStr, value);
|
||
PddBuyerAfterSaleAddressStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible;
|
||
|
||
if (value.ParseToString().Length > 19)
|
||
PddBuyerAfterSaleAddressShortStr = string.Join("", value.ParseToString().Take(19)) + "…";
|
||
else
|
||
PddBuyerAfterSaleAddressShortStr = value.ParseToString();
|
||
}
|
||
}
|
||
public string PddBuyerAfterSaleAddressShortStr
|
||
{
|
||
get { return this.GetValue(x => x.PddBuyerAfterSaleAddressShortStr); }
|
||
set { this.SetValue(x => x.PddBuyerAfterSaleAddressShortStr, value); }
|
||
}
|
||
public Visibility PddBuyerAfterSaleAddressStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.PddBuyerAfterSaleAddressStrVisibility); }
|
||
set { this.SetValue(x => x.PddBuyerAfterSaleAddressStrVisibility, value); }
|
||
}
|
||
|
||
|
||
public Visibility RejectOrReturnPackageBtnVisibility
|
||
{
|
||
get { return this.GetValue(x => x.RejectOrReturnPackageBtnVisibility); }
|
||
set { this.SetValue(x => x.RejectOrReturnPackageBtnVisibility, value); }
|
||
}
|
||
|
||
public void SetTransitOrder()
|
||
{
|
||
this.ItemTransitOrder = ItemTransitOrders?.FirstOrDefault(t => t.order_void_status != 1);
|
||
this.ItemTransitOrderWithVoid = ItemTransitOrders?.FirstOrDefault();
|
||
this.SetTransitRefundStatusStr();
|
||
|
||
this.ItemTransitExtraOrder = ItemTransitExtraOrders?.FirstOrDefault(t => t.order_void_status != 1) ?? ItemTransitExtraOrders.FirstOrDefault();
|
||
|
||
this.ItemTransitOrderAfterSale = ItemTransitOrderAfterSales?.FirstOrDefault();
|
||
this.PddBuyerOrder = PddBuyerOrders?.FirstOrDefault();
|
||
// 优先找非撤销买手退款单
|
||
this.PddBuyerAfterSale = PddBuyerAfterSales?.FirstOrDefault(p => p.orderSn == this.ItemTransitOrderWithVoid?.out_order_no && p.statusText == "退款成功") ??
|
||
PddBuyerAfterSales?.FirstOrDefault(p => p.orderSn == this.ItemTransitOrderWithVoid?.out_order_no && !p.statusText.Contains("申请已撤销"));
|
||
if (PddBuyerAfterSale == null)
|
||
PddBuyerAfterSale = PddBuyerAfterSales?.FirstOrDefault(p => p.orderSn == this.ItemTransitOrderWithVoid?.out_order_no);
|
||
|
||
// 直接取号和更正取号显示的买手到仓库物流
|
||
if (ItemTransitOrder?.pre_allocated_order_no != 1 && ItemTransitOrder?.pre_allocated_order_no != 3)
|
||
this.TransitOrderWaybillToWareHouseStr = null;
|
||
else
|
||
this.TransitOrderWaybillToWareHouseStr = ItemTransitOrder.express_1_company + "-" + ItemTransitOrder.express_1_waybill;
|
||
|
||
// 提前取号物流
|
||
if (ItemTransitOrder?.pre_allocated_order_no != 2)
|
||
this.TransitOrderWaybillFakeStr = null;
|
||
else
|
||
this.TransitOrderWaybillFakeStr = ItemTransitOrder.express_1_company + "-" + ItemTransitOrder.express_1_waybill;
|
||
|
||
// 仓库下游物流
|
||
//if (ItemTransitOrder == null || ItemTransitOrder.express_2_company.IsNullOrEmpty() || ItemTransitOrder.express_2_waybill.IsNullOrEmpty())
|
||
// TransitOrderWaybillFromWareHouseStr = null;
|
||
//else
|
||
// TransitOrderWaybillFromWareHouseStr = ItemTransitOrder.express_2_company + "-" + ItemTransitOrder.express_2_waybill;
|
||
if (ItemTransitOrder != null && !ItemTransitOrder.express_2_company.IsNullOrEmpty() && !ItemTransitOrder.express_2_waybill.IsNullOrEmpty())
|
||
TransitOrderWaybillFromWareHouseStr = ItemTransitOrder.express_2_company + "-" + ItemTransitOrder.express_2_waybill;
|
||
else if (ItemTransitOrderWithVoid != null && !ItemTransitOrderWithVoid.express_2_company.IsNullOrEmpty() && !ItemTransitOrderWithVoid.express_2_waybill.IsNullOrEmpty())
|
||
TransitOrderWaybillFromWareHouseStr = ItemTransitOrderWithVoid.express_2_company + "-" + ItemTransitOrderWithVoid.express_2_waybill;
|
||
else
|
||
TransitOrderWaybillFromWareHouseStr = null;
|
||
|
||
if (order_id == "3739043283864307968")
|
||
{
|
||
var xx = ShopWaybillExceptionStr;
|
||
}
|
||
TransitWarehouseRejectSuccessTimeStr = this.ItemTransitOrderWithVoid?.rejected_time == null ? "" : this.ItemTransitOrderWithVoid.rejected_time.Value.ToString("yy-MM-dd HH:mm");
|
||
AddEditTransitWarehouseRejectStr = "申请";
|
||
if (this.ItemTransitOrderWithVoid?.has_reject == 1)
|
||
AddEditTransitWarehouseRejectStr = "已申请拒收";
|
||
if (this.ItemTransitOrderWithVoid?.has_reject == 2)
|
||
AddEditTransitWarehouseRejectStr = "申请失败";
|
||
if (this.ItemTransitOrderWithVoid?.has_reject == 3)
|
||
AddEditTransitWarehouseRejectStr = "申请成功";
|
||
if (this.ItemTransitOrderWithVoid?.has_reject == 5)
|
||
AddEditTransitWarehouseRejectStr = "已取消拒收";
|
||
if (this.ItemTransitOrderWithVoid?.has_reject == 99)
|
||
AddEditTransitWarehouseRejectStr = "拒收成功";
|
||
|
||
if (this.ItemTransitOrderWithVoid == null || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.IsAbnormal) || // 仅退款
|
||
TransitRefundStatusStr.Contains("退款成功") ||
|
||
!(this.ItemRefund?.return_waybill_id).IsNullOrEmpty() || !(this.ItemRefund?.return_detail).IsNullOrEmpty() ||
|
||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.IsAbnormal && !this.ItemOrder.IsRefund) ||
|
||
(this.ItemTransitOrderWithVoid.warehouse_status != 0 && this.ItemTransitOrderWithVoid.warehouse_status != 1) ||
|
||
string.IsNullOrEmpty(PddBuyerOrder?.order_sn))
|
||
{
|
||
if (AddEditTransitWarehouseRejectStr == "申请")
|
||
AddEditTransitWarehouseRejectStr = "";
|
||
//else if (this.ItemTransitOrderWithVoid.platform == "XDYYWC") // 义务仓已申请拒收的全部显示失败
|
||
// AddEditTransitWarehouseRejectStr = "申请拒收失败*";
|
||
}
|
||
if (AddEditTransitWarehouseRejectStr == "申请")
|
||
AddEditTransitWarehouseRejectStr = "未申请";
|
||
|
||
|
||
RejectOrReturnPackageBtnVisibility = ItemTransitOrderWithVoid != null ? Visibility.Visible : Visibility.Collapsed;
|
||
|
||
// 拦截退回操作信息
|
||
InterceptReturnInfoStr = "";
|
||
if (this.ItemTransitOrderWithVoid != null)
|
||
InterceptReturnInfoStr = this.ItemTransitOrderWithVoid.intercept_return_info;
|
||
|
||
// 仓库物流售后拦截包裹按钮上的文字,仓库作废单不存在仓库物流,所以此处必须是有效的仓库单(含作废失败)
|
||
AddEditTransitWarehouseAfterSaleStr = "添加";
|
||
if (order_id == "3739241588056569856")
|
||
{
|
||
|
||
}
|
||
if (this.ItemTransitOrderAfterSale != null)
|
||
AddEditTransitWarehouseAfterSaleStr = "已添加";
|
||
if (this.ItemTransitOrderAfterSale != null && (ItemTransitOrderWithVoid.intercept_return_status == 1 || !string.IsNullOrEmpty(ItemTransitOrderAfterSale.downstream_waybill)))
|
||
AddEditTransitWarehouseAfterSaleStr = "拦截成功";
|
||
else if (this.ItemTransitOrderAfterSale != null && ItemTransitOrderWithVoid.intercept_return_status == 2)
|
||
AddEditTransitWarehouseAfterSaleStr = "拦截失败";
|
||
if (this.ItemTransitOrderWithVoid == null || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.IsAbnormal) ||
|
||
TransitRefundStatusStr.Contains("退款成功") ||
|
||
!(this.ItemRefund?.return_waybill_id).IsNullOrEmpty() || !(this.ItemRefund?.return_detail).IsNullOrEmpty() ||
|
||
(!this.ItemOrder.IsEmergency && !this.ItemOrder.IsAbnormal && !this.ItemOrder.IsRefund) ||
|
||
this.ItemTransitOrderWithVoid.warehouse_status == 0 ||
|
||
(this.ItemTransitOrderWithVoid.warehouse_status == 1 && !AddEditTransitWarehouseRejectStr.IsNullOrEmpty() && !AddEditTransitWarehouseRejectStr.StartsWith("申请拒收失败")))
|
||
{
|
||
if (AddEditTransitWarehouseAfterSaleStr == "添加")
|
||
AddEditTransitWarehouseAfterSaleStr = "";
|
||
}
|
||
// 退货退款的,不能拦截退回总店。如果是退到退货仓,则退货仓流程,否则店家自行收货退回总店。
|
||
if (!RefundAddressStr.ParseToString().Trim().IsNullOrEmpty() || (this.ItemRefund?.type != "REFUND" && !this.ItemOrder.IsAbnormal))
|
||
{
|
||
if (AddEditTransitWarehouseAfterSaleStr == "添加")
|
||
AddEditTransitWarehouseAfterSaleStr = "";
|
||
}
|
||
if (AddEditTransitWarehouseAfterSaleStr == "添加")
|
||
AddEditTransitWarehouseAfterSaleStr = "未添加";
|
||
|
||
// 拦截退回物流单号
|
||
if (this.ItemTransitOrderAfterSale != null)
|
||
TransitWarehouseAfterSaleWayBillStr = (this.ItemTransitOrderAfterSale?.downstream_express_code + "-" + this.ItemTransitOrderAfterSale?.downstream_waybill).Trim('-');
|
||
|
||
// 拦截退回操作信息,如果实际拦截成功,则不显示中间报错信息
|
||
InterceptReturnInfoStr = "";
|
||
if (this.ItemTransitOrderWithVoid != null && AddEditTransitWarehouseAfterSaleStr != "拦截成功")
|
||
InterceptReturnInfoStr = this.ItemTransitOrderWithVoid.intercept_return_info;
|
||
|
||
// 退货仓退货
|
||
AddEditTransitWarehouseReturnOrderStr = "";
|
||
if (ItemRefund?.return_detail?.ToUpper().Contains(GlobalConfig.TransitReturnOrderReturnAddressLite) == true)
|
||
{
|
||
AddEditTransitWarehouseReturnOrderStr = DistribReturnOrderInfo == null ? "未创建" : "已创建";
|
||
if (DistribReturnOrderInfo?.warehouse_status == 1)
|
||
{
|
||
if ((DistribReturnOrderInfo?.real_logistics_express_code).IsNullOrEmpty())
|
||
AddEditTransitWarehouseReturnOrderStr = "已到仓";
|
||
else
|
||
AddEditTransitWarehouseReturnOrderStr = "已发回";
|
||
}
|
||
if (DistribReturnOrderInfo?.warehouse_status == 2)
|
||
AddEditTransitWarehouseReturnOrderStr = "创建失败";
|
||
if (DistribReturnOrderInfo?.warehouse_status == 3)
|
||
AddEditTransitWarehouseReturnOrderStr = "已创建未到仓";
|
||
if (TransitRefundStatusStr.Contains("退款成功"))
|
||
{
|
||
if (AddEditTransitWarehouseReturnOrderStr == "未创建")
|
||
AddEditTransitWarehouseReturnOrderStr = "";
|
||
}
|
||
}
|
||
}
|
||
/// <summary>
|
||
/// 仓库拒收按钮文本参数
|
||
/// </summary>
|
||
public string AddEditTransitWarehouseRejectStr
|
||
{
|
||
get { return this.GetValue(x => x.AddEditTransitWarehouseRejectStr); }
|
||
set { this.SetValue(x => x.AddEditTransitWarehouseRejectStr, value); }
|
||
}
|
||
public string TransitWarehouseRejectSuccessTimeStr
|
||
{
|
||
get { return this.GetValue(x => x.TransitWarehouseRejectSuccessTimeStr); }
|
||
set { this.SetValue(x => x.TransitWarehouseRejectSuccessTimeStr, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 仓库退货编辑按钮文本参数
|
||
/// </summary>
|
||
public string AddEditTransitWarehouseAfterSaleStr
|
||
{
|
||
get { return this.GetValue(x => x.AddEditTransitWarehouseAfterSaleStr); }
|
||
set { this.SetValue(x => x.AddEditTransitWarehouseAfterSaleStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 拦截退回操作信息/回调信息 文本
|
||
/// </summary>
|
||
public string InterceptReturnInfoStr
|
||
{
|
||
get { return this.GetValue(x => x.InterceptReturnInfoStr); }
|
||
set { this.SetValue(x => x.InterceptReturnInfoStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 仓库分销退货按钮显示文本参数
|
||
/// </summary>
|
||
public string AddEditTransitWarehouseReturnOrderStr
|
||
{
|
||
get { return this.GetValue(x => x.AddEditTransitWarehouseReturnOrderStr); }
|
||
set { this.SetValue(x => x.AddEditTransitWarehouseReturnOrderStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 仓库分销退货物流信息
|
||
/// </summary>
|
||
public string AddEditTransitWarehouseReturnOrderWaybillStr
|
||
{
|
||
get { return this.GetValue(x => x.AddEditTransitWarehouseReturnOrderWaybillStr); }
|
||
set { this.SetValue(x => x.AddEditTransitWarehouseReturnOrderWaybillStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 拍单物流编号
|
||
/// </summary>
|
||
public string TransitOrderWaybillToWareHouseStr
|
||
{
|
||
get { return this.GetValue(x => x.TransitOrderWaybillToWareHouseStr); }
|
||
set { this.SetValue(x => x.TransitOrderWaybillToWareHouseStr, value); TransitOrderWaybillToWareHouseStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility TransitOrderWaybillToWareHouseStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.TransitOrderWaybillToWareHouseStrVisibility); }
|
||
set { this.SetValue(x => x.TransitOrderWaybillToWareHouseStrVisibility, value); }
|
||
}
|
||
/// <summary>
|
||
/// 提前取号物流编号(虚拟)
|
||
/// </summary>
|
||
public string TransitOrderWaybillFakeStr
|
||
{
|
||
get { return this.GetValue(x => x.TransitOrderWaybillFakeStr); }
|
||
set { this.SetValue(x => x.TransitOrderWaybillFakeStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 仓库物流编号
|
||
/// </summary>
|
||
public string TransitOrderWaybillFromWareHouseStr
|
||
{
|
||
get { return this.GetValue(x => x.TransitOrderWaybillFromWareHouseStr); }
|
||
set { this.SetValue(x => x.TransitOrderWaybillFromWareHouseStr, value); TransitOrderWaybillFromWareHouseStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility TransitOrderWaybillFromWareHouseStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.TransitOrderWaybillFromWareHouseStrVisibility); }
|
||
set { this.SetValue(x => x.TransitOrderWaybillFromWareHouseStrVisibility, value); }
|
||
}
|
||
public string TransitWarehouseAfterSaleWayBillStr
|
||
{
|
||
get { return this.GetValue(x => x.TransitWarehouseAfterSaleWayBillStr); }
|
||
set { this.SetValue(x => x.TransitWarehouseAfterSaleWayBillStr, value); }
|
||
}
|
||
#endregion
|
||
|
||
#region 买手物流参数
|
||
public string BuyerTransitWaybillStatusStr
|
||
{
|
||
get { return this.GetValue(x => x.BuyerTransitWaybillStatusStr); }
|
||
set { this.SetValue(x => x.BuyerTransitWaybillStatusStr, value); BuyerTransitWaybillStatusStrVisibility = value.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility BuyerTransitWaybillStatusStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.BuyerTransitWaybillStatusStrVisibility); }
|
||
set { this.SetValue(x => x.BuyerTransitWaybillStatusStrVisibility, value); }
|
||
}
|
||
|
||
public void SetBuyerTransitWaybillStatusStr()
|
||
{
|
||
BuyerTransitWaybillStatusStr = "";
|
||
|
||
string refund_status = (ItemTransitOrderWithVoid?.refund_status).ParseToString();
|
||
|
||
// 已到中转仓的或者中转仓已正式发出的,买手(仓上游)状态显示为已到中转仓
|
||
//if (ItemTransitOrderWithVoid?.warehouse_status == 1 || ItemTransitOrderWithVoid?.warehouse_status == 2)
|
||
//{
|
||
// BuyerTransitWaybillStatusStr = "已到中转仓";
|
||
//}
|
||
// 拼多多买手状态为已签收的,为已到中转仓
|
||
/*else*/
|
||
if ((PddBuyerOrder?.order_status_prompt).ParseToString().Contains("已签收"))
|
||
{
|
||
BuyerTransitWaybillStatusStr = "买手已送达";
|
||
}
|
||
// 售后待用户退回商品的,至少为买手已发货
|
||
else if ((PddBuyerOrder?.order_status_prompt).ParseToString().Contains("待用户退回商品"))
|
||
{
|
||
BuyerTransitWaybillStatusStr = "买手已发货";
|
||
}
|
||
// 待收货的,至少为买手已发货
|
||
else if ((PddBuyerOrder?.order_status_prompt).ParseToString().Contains("待收货"))
|
||
{
|
||
BuyerTransitWaybillStatusStr = "买手已发货";
|
||
}
|
||
// 有退款还没完成的,至少为买手已发货(未发货一般秒退)
|
||
else if (!refund_status.Contains("退款成功") && refund_status.Length > 0)
|
||
{
|
||
BuyerTransitWaybillStatusStr = "买手已发货";
|
||
}
|
||
// 正式取号或者取号更正的,可认定买手已发货
|
||
else if (ItemTransitOrderWithVoid?.pre_allocated_order_no == 1 || ItemTransitOrderWithVoid?.pre_allocated_order_no == 3)
|
||
{
|
||
BuyerTransitWaybillStatusStr = "买手已发货";
|
||
}
|
||
else if (ItemTransitOrderWithVoid != null)
|
||
{
|
||
BuyerTransitWaybillStatusStr = "买手未发货";
|
||
}
|
||
|
||
// 文本确定后设置颜色
|
||
SetBuyerTransitWaybillStatusStrColor();
|
||
SetBuyerTransitWaybillStatusBorderColor();
|
||
SetBuyerTransitWaybillStatusBackColor();
|
||
}
|
||
public SolidColorBrush BuyerTransitWaybillStatusStrColor
|
||
{
|
||
get { return this.GetValue(x => x.BuyerTransitWaybillStatusStrColor); }
|
||
set { this.SetValue(x => x.BuyerTransitWaybillStatusStrColor, value); }
|
||
}
|
||
public void SetBuyerTransitWaybillStatusStrColor()
|
||
{
|
||
if (BuyerTransitWaybillStatusStr.StartsWith("买手已退款"))
|
||
BuyerTransitWaybillStatusStrColor = GlobalConfig.PurpleBrush;
|
||
else if (BuyerTransitWaybillStatusStr.StartsWith("买手已送达"))
|
||
BuyerTransitWaybillStatusStrColor = GlobalConfig.GreenBrush;
|
||
else if (BuyerTransitWaybillStatusStr.StartsWith("买手已发货"))
|
||
BuyerTransitWaybillStatusStrColor = GlobalConfig.YellowBrush;
|
||
else if (BuyerTransitWaybillStatusStr.StartsWith("买手未发货"))
|
||
BuyerTransitWaybillStatusStrColor = GlobalConfig.RedBrush;
|
||
else
|
||
BuyerTransitWaybillStatusStrColor = GlobalConfig.RedBrush;
|
||
}
|
||
public SolidColorBrush BuyerTransitWaybillStatusBorderColor
|
||
{
|
||
get { return this.GetValue(x => x.BuyerTransitWaybillStatusBorderColor); }
|
||
set { this.SetValue(x => x.BuyerTransitWaybillStatusBorderColor, value); }
|
||
}
|
||
public void SetBuyerTransitWaybillStatusBorderColor()
|
||
{
|
||
if (BuyerTransitWaybillStatusStr.StartsWith("买手已退款"))
|
||
BuyerTransitWaybillStatusBorderColor = GlobalConfig.PurpleBrush75;
|
||
else if (BuyerTransitWaybillStatusStr.StartsWith("买手已送达"))
|
||
BuyerTransitWaybillStatusBorderColor = GlobalConfig.GreenBrush75;
|
||
else if (BuyerTransitWaybillStatusStr.StartsWith("买手已发货"))
|
||
BuyerTransitWaybillStatusBorderColor = GlobalConfig.YellowBrush75;
|
||
else if (BuyerTransitWaybillStatusStr.StartsWith("买手未发货"))
|
||
BuyerTransitWaybillStatusBorderColor = GlobalConfig.RedBrush75;
|
||
else
|
||
BuyerTransitWaybillStatusBorderColor = GlobalConfig.RedBrush75;
|
||
}
|
||
public SolidColorBrush BuyerTransitWaybillStatusBackColor
|
||
{
|
||
get { return this.GetValue(x => x.BuyerTransitWaybillStatusBackColor); }
|
||
set { this.SetValue(x => x.BuyerTransitWaybillStatusBackColor, value); }
|
||
}
|
||
public void SetBuyerTransitWaybillStatusBackColor()
|
||
{
|
||
if (BuyerTransitWaybillStatusStr.StartsWith("买手已退款"))
|
||
BuyerTransitWaybillStatusBackColor = GlobalConfig.PurpleBrush35;
|
||
else if (BuyerTransitWaybillStatusStr.StartsWith("买手已送达"))
|
||
BuyerTransitWaybillStatusBackColor = GlobalConfig.GreenBrush35;
|
||
else if (BuyerTransitWaybillStatusStr.StartsWith("买手已发货"))
|
||
BuyerTransitWaybillStatusBackColor = GlobalConfig.YellowBrush35;
|
||
else if (BuyerTransitWaybillStatusStr.StartsWith("买手未发货"))
|
||
BuyerTransitWaybillStatusBackColor = GlobalConfig.RedBrush35;
|
||
else
|
||
BuyerTransitWaybillStatusBackColor = GlobalConfig.RedBrush35;
|
||
}
|
||
#endregion
|
||
|
||
#region 仓库物流参数
|
||
public string WarehouseWaybillStatusStr
|
||
{
|
||
get { return this.GetValue(x => x.WarehouseWaybillStatusStr); }
|
||
set { this.SetValue(x => x.WarehouseWaybillStatusStr, value); WarehouseWaybillStatusStrVisibility = value.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility WarehouseWaybillStatusStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.WarehouseWaybillStatusStrVisibility); }
|
||
set { this.SetValue(x => x.WarehouseWaybillStatusStrVisibility, value); }
|
||
}
|
||
|
||
public void SetWarehouseWaybillStatusStr()
|
||
{
|
||
if (order_id == "3737682230178873344")
|
||
{
|
||
|
||
}
|
||
WarehouseWaybillStatusStr = "";
|
||
if (ItemTransitOrderWithVoid == null)
|
||
WarehouseWaybillStatusStr = "";
|
||
// 订单不满足鸿浩仓库发货条件,无法调用鸿浩仓库接口发货
|
||
else if ((ItemTransitOrderWithVoid.raw_message.ParseToString().Contains("取号异常") ||
|
||
ItemTransitOrderWithVoid.raw_message.ParseToString().Contains("无法调用")) &&
|
||
ItemTransitOrderWithVoid.transfer_warehouse_status != 1)
|
||
{
|
||
if (ItemTransitOrderWithVoid.raw_message.Contains("超出派送范围"))
|
||
WarehouseWaybillStatusStr = "取号异常-超出派送范围";
|
||
else
|
||
WarehouseWaybillStatusStr = "取号异常";
|
||
}
|
||
else if (ItemTransitOrderWithVoid?.warehouse_status == 3)
|
||
WarehouseWaybillStatusStr = "中转拦截到仓";
|
||
else if (ItemTransitOrderWithVoid?.warehouse_status == 2)
|
||
WarehouseWaybillStatusStr = "中转已出库";
|
||
//// 老订单还用之前的逻辑判断
|
||
//else if (ItemTransitOrderWithVoid?.created_time < new DateTime(2026, 7, 14) && (ItemTransitOrderWithVoid?.pre_allocated_order_no == 1 || ItemTransitOrderWithVoid?.pre_allocated_order_no == 3) && !ItemTransitOrderWithVoid.express_2_company.IsNullOrEmpty() && !ItemTransitOrderWithVoid.express_2_waybill.IsNullOrEmpty())
|
||
// //WarehouseWaybillStatusStr = "中转已出库*";
|
||
// WarehouseWaybillStatusStr = "中转已出库";
|
||
else if (ItemTransitOrderWithVoid?.warehouse_status == 1)
|
||
WarehouseWaybillStatusStr = "中转已入库";
|
||
//else if ((ItemTransitOrderWithVoid?.pre_allocated_order_no == 1 || ItemTransitOrderWithVoid?.pre_allocated_order_no == 3) && !ItemTransitOrderWithVoid.express_2_company.IsNullOrEmpty() && !ItemTransitOrderWithVoid.express_2_waybill.IsNullOrEmpty())
|
||
// WarehouseWaybillStatusStr = "中转已发货";
|
||
//else if (ItemTransitOrderWithVoid?.pre_allocated_order_no == 1 || ItemTransitOrderWithVoid?.pre_allocated_order_no == 3)
|
||
// WarehouseWaybillStatusStr = "中转待发货";
|
||
else if (ItemTransitOrderWithVoid?.pre_allocated_order_no == 1 || ItemTransitOrderWithVoid?.pre_allocated_order_no == 3)
|
||
WarehouseWaybillStatusStr = "中转已取号";
|
||
else if (ItemTransitOrderWithVoid?.pre_allocated_order_no == 2)
|
||
WarehouseWaybillStatusStr = "中转提前取号";
|
||
//else if (ItemTransitOrderWithVoid?.order_void_status == 2)
|
||
// WarehouseWaybillStatusStr = "中转作废失败";
|
||
//else if (ItemTransitOrderWithVoid?.order_void_status == 1)
|
||
// WarehouseWaybillStatusStr = "中转已作废";
|
||
else if (ItemTransitOrderWithVoid?.pre_allocated_order_no == 0)
|
||
WarehouseWaybillStatusStr = "中转待取号";
|
||
|
||
|
||
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
|
||
{
|
||
get { return this.GetValue(x => x.WarehouseWaybillStatusBorderColor); }
|
||
set { this.SetValue(x => x.WarehouseWaybillStatusBorderColor, value); }
|
||
}
|
||
public SolidColorBrush WarehouseWaybillStatusBackColor
|
||
{
|
||
get { return this.GetValue(x => x.WarehouseWaybillStatusBackColor); }
|
||
set { this.SetValue(x => x.WarehouseWaybillStatusBackColor, value); }
|
||
}
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 中转仓表买手售后字段文字显示
|
||
/// </summary>
|
||
public string TransitRefundStatusStr
|
||
{
|
||
get { return this.GetValue(x => x.TransitRefundStatusStr); }
|
||
set { this.SetValue(x => x.TransitRefundStatusStr, value); TransitRefundStatusStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility TransitRefundStatusStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.TransitRefundStatusStrVisibility); }
|
||
set { this.SetValue(x => x.TransitRefundStatusStrVisibility, value); }
|
||
}
|
||
/// <summary>
|
||
/// 中转仓表买手售后字段文字显示背景颜色
|
||
/// </summary>
|
||
public SolidColorBrush TransitRefundStatusBackColor
|
||
{
|
||
get { return this.GetValue(x => x.TransitRefundStatusBackColor); }
|
||
set { this.SetValue(x => x.TransitRefundStatusBackColor, value); }
|
||
}
|
||
/// <summary>
|
||
/// 中转仓作废参数
|
||
/// </summary>
|
||
public string TransitRefundVoidStatusStr
|
||
{
|
||
get { return this.GetValue(x => x.TransitRefundVoidStatusStr); }
|
||
set { this.SetValue(x => x.TransitRefundVoidStatusStr, value); TransitRefundVoidStatusStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility TransitRefundVoidStatusStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.TransitRefundVoidStatusStrVisibility); }
|
||
set { this.SetValue(x => x.TransitRefundVoidStatusStrVisibility, value); }
|
||
}
|
||
public void SetTransitRefundStatusStr()
|
||
{
|
||
if (!string.IsNullOrEmpty(ItemTransitOrderWithVoid?.refund_status))
|
||
{
|
||
// 店铺售后又取消的,如果是买手还没申请售后,不显示需手动申请售后文字
|
||
if (ItemTransitOrderWithVoid.refund_status.Contains("需手动申请售后") && this.refund_status <= 1)
|
||
TransitRefundStatusStr = "";
|
||
|
||
// 显示售后金额(如果有)
|
||
else if (ItemTransitOrderWithVoid.refund_status.EndsWith("买手退款成功"))
|
||
{
|
||
if (PddBuyerAfterSale?.refundAmount != null)
|
||
TransitRefundStatusStr = ItemTransitOrderWithVoid.refund_status + "(¥" + PddBuyerAfterSale.refundAmount * 0.01m + ")";
|
||
else
|
||
TransitRefundStatusStr = ItemTransitOrderWithVoid.refund_status + "(退款金额待获取)";
|
||
}
|
||
|
||
else if (!ItemTransitOrderWithVoid.refund_status.Contains("需手动申请售后") && !ItemTransitOrderWithVoid.refund_status.Contains("已超过可申请售后的时间"))
|
||
TransitRefundStatusStr = "已申请售后 " + ItemTransitOrderWithVoid.refund_status.Replace("申请收到,", "");
|
||
else
|
||
TransitRefundStatusStr = ItemTransitOrderWithVoid.refund_status;
|
||
}
|
||
else
|
||
TransitRefundStatusStr = "";
|
||
|
||
|
||
if (TransitRefundStatusStr.Contains("退款成功"))
|
||
TransitRefundStatusBackColor = GlobalConfig.GreenBrush;
|
||
else if (TransitRefundStatusStr.Contains("需手动申请售后") || TransitRefundStatusStr.Contains("已超过可申请售后的时间") || TransitRefundStatusStr.Contains("退款失败"))
|
||
TransitRefundStatusBackColor = GlobalConfig.RedBrush;
|
||
else
|
||
TransitRefundStatusBackColor = GlobalConfig.LightOrangeBrush;
|
||
|
||
|
||
//if (ItemTransitOrderWithVoid?.order_void_status == 2)
|
||
// return "中转作废失败";
|
||
if (ItemTransitOrderWithVoid?.order_void_status == 1)
|
||
TransitRefundVoidStatusStr = "中转已作废";
|
||
else
|
||
TransitRefundVoidStatusStr = "";
|
||
}
|
||
|
||
|
||
// 仓库采购时间是否达标字段
|
||
public string OutOrderTimeQualifiedStr
|
||
{
|
||
get { return this.GetValue(x => x.OutOrderTimeQualifiedStr); }
|
||
set { this.SetValue(x => x.OutOrderTimeQualifiedStr, value); OutOrderTimeQualifiedStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility OutOrderTimeQualifiedStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.OutOrderTimeQualifiedStrVisibility); }
|
||
set { this.SetValue(x => x.OutOrderTimeQualifiedStrVisibility, value); }
|
||
}
|
||
void SetOutOrderTimeQualifiedStr()
|
||
{
|
||
if (ItemTransitOrderWithVoid == null)
|
||
OutOrderTimeQualifiedStr = "";
|
||
else
|
||
{
|
||
string timeStr = ItemTransitOrderWithVoid.created_time.ToString("yyyy-MM-dd HH:mm:ss");
|
||
if (CreateDateTime.Date != ItemTransitOrderWithVoid.created_time.Date && ItemTransitOrderWithVoid.created_time > ItemTransitOrderWithVoid.created_time.Date.AddHours(1.5))
|
||
OutOrderTimeQualifiedStr = timeStr + " ×";
|
||
else
|
||
OutOrderTimeQualifiedStr = timeStr + " √";
|
||
}
|
||
OutOrderTimeQualifiedBrush = OutOrderTimeQualifiedStr != null && OutOrderTimeQualifiedStr.EndsWith("√") ? GlobalConfig.GreenTextBrush : GlobalConfig.RedTextBrush;
|
||
}
|
||
/// <summary>
|
||
/// 仓库采购时间是否达标字段颜色
|
||
/// </summary>
|
||
public SolidColorBrush OutOrderTimeQualifiedBrush
|
||
{
|
||
get { return this.GetValue(x => x.OutOrderTimeQualifiedBrush); }
|
||
set { this.SetValue(x => x.OutOrderTimeQualifiedBrush, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 微信订单状态参数
|
||
/// </summary>
|
||
public string OrderItemStatusStr
|
||
{
|
||
get { return this.GetValue(x => x.OrderItemStatusStr); }
|
||
set { this.SetValue(x => x.OrderItemStatusStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 微信订单状态颜色
|
||
/// </summary>
|
||
public SolidColorBrush OrderItemStatusStrColor
|
||
{
|
||
get { return this.GetValue(x => x.OrderItemStatusStrColor); }
|
||
set { this.SetValue(x => x.OrderItemStatusStrColor, value); }
|
||
}
|
||
public SolidColorBrush OrderItemStatusBorderColor
|
||
{
|
||
get { return this.GetValue(x => x.OrderItemStatusBorderColor); }
|
||
set { this.SetValue(x => x.OrderItemStatusBorderColor, value); }
|
||
}
|
||
public SolidColorBrush OrderItemStatusBackColor
|
||
{
|
||
get { return this.GetValue(x => x.OrderItemStatusBackColor); }
|
||
set { this.SetValue(x => x.OrderItemStatusBackColor, value); }
|
||
}
|
||
|
||
void SetOrderItemStatusAndColor()
|
||
{
|
||
if (ItemOrder?.status == 10)
|
||
OrderItemStatusStr = "待付款";
|
||
else if (ItemOrder?.status == 12)
|
||
OrderItemStatusStr = "礼物待收下";
|
||
else if (ItemOrder?.status == 13)
|
||
OrderItemStatusStr = "一起买待成团";
|
||
else if (ItemOrder?.status == 20)
|
||
OrderItemStatusStr = "待店铺发货";
|
||
else if (ItemOrder?.status == 21)
|
||
OrderItemStatusStr = "店铺部分发货";
|
||
else if (ItemOrder?.status == 30)
|
||
OrderItemStatusStr = "待买家收货";
|
||
else if (ItemOrder?.status == 100)
|
||
OrderItemStatusStr = "订单完成";
|
||
else if (ItemOrder?.status == 200)
|
||
OrderItemStatusStr = "售后完成订单取消";
|
||
else if (ItemOrder?.status == 250)
|
||
OrderItemStatusStr = "未付款已取消";
|
||
else
|
||
OrderItemStatusStr = "未知状态";
|
||
|
||
if ("未知状态,未付款已取消,售后完成订单取消".Contains(OrderItemStatusStr))
|
||
OrderItemStatusStrColor = GlobalConfig.RedBrush;
|
||
else if("订单完成".Contains(OrderItemStatusStr))
|
||
OrderItemStatusStrColor = GlobalConfig.GreenBrush;
|
||
else if("待买家收货,店铺部分发货,待店铺发货,待付款".Contains(OrderItemStatusStr))
|
||
OrderItemStatusStrColor = GlobalConfig.YellowBrush;
|
||
else
|
||
OrderItemStatusStrColor = GlobalConfig.YellowBrush;
|
||
|
||
|
||
if ("未知状态,未付款已取消,售后完成订单取消".Contains(OrderItemStatusStr))
|
||
OrderItemStatusBorderColor = GlobalConfig.RedBrush75;
|
||
else if("订单完成".Contains(OrderItemStatusStr))
|
||
OrderItemStatusBorderColor = GlobalConfig.GreenBrush75;
|
||
else if("待买家收货,店铺部分发货,待店铺发货,待付款".Contains(OrderItemStatusStr))
|
||
OrderItemStatusBorderColor = GlobalConfig.YellowBrush75;
|
||
else
|
||
OrderItemStatusBorderColor = GlobalConfig.YellowBrush75;
|
||
|
||
|
||
if ("未知状态,未付款已取消,售后完成订单取消".Contains(OrderItemStatusStr))
|
||
OrderItemStatusBackColor = GlobalConfig.RedBrush35;
|
||
else if ("订单完成".Contains(OrderItemStatusStr))
|
||
OrderItemStatusBackColor = GlobalConfig.GreenBrush35;
|
||
else if ("待买家收货,店铺部分发货,待店铺发货,待付款".Contains(OrderItemStatusStr))
|
||
OrderItemStatusBackColor = GlobalConfig.YellowBrush35;
|
||
else
|
||
OrderItemStatusBackColor = GlobalConfig.YellowBrush35;
|
||
}
|
||
|
||
public List<distrib_return_order_info> DistribReturnOrderInfos
|
||
{
|
||
get { return this.GetValue(x => x.DistribReturnOrderInfos); }
|
||
set
|
||
{
|
||
if (value == null)
|
||
value = new List<distrib_return_order_info>();
|
||
this.SetValue(x => x.DistribReturnOrderInfos, value);
|
||
DistribReturnOrderInfo = value.OrderByDescending(dr => dr.created_at).FirstOrDefault(dr => dr.order_void_status == 0);
|
||
if (DistribReturnOrderInfo != null)
|
||
AddEditTransitWarehouseReturnOrderWaybillStr = (DistribReturnOrderInfo.real_logistics_code + "-" + DistribReturnOrderInfo.real_logistics_express_code).Trim('-');
|
||
}
|
||
}
|
||
public distrib_return_order_info DistribReturnOrderInfo
|
||
{
|
||
get { return this.GetValue(x => x.DistribReturnOrderInfo); }
|
||
set { this.SetValue(x => x.DistribReturnOrderInfo, value); }
|
||
}
|
||
|
||
public List<order_pdd_buyer_order> DirectPddBuyerOrders { get; set; } = new List<order_pdd_buyer_order>();
|
||
public order_pdd_buyer_order DirectPddBuyerOrder
|
||
{
|
||
get { return this.GetValue(x => x.DirectPddBuyerOrder); }
|
||
set
|
||
{
|
||
if (order_id == "3739364384891083264")
|
||
{
|
||
|
||
}
|
||
this.SetValue(x => x.DirectPddBuyerOrder, value);
|
||
SyncLogisticsMsg = DirectPddBuyerOrder?.sync_logistics_msg;
|
||
// 有单号就不显示错误,否则单号字段显示错误信息
|
||
if (ItemOrder.SyncWaybillIdInfo.IsNullOrEmpty())
|
||
{
|
||
ItemOrder.SyncWaybillIdInfo = SyncLogisticsMsg;
|
||
SyncLogisticsMsg = "";
|
||
}
|
||
else
|
||
SyncLogisticsMsg = "";
|
||
}
|
||
}
|
||
public string SyncLogisticsMsg
|
||
{
|
||
get { return this.GetValue(x => x.SyncLogisticsMsg); }
|
||
set { this.SetValue(x => x.SyncLogisticsMsg, value); }
|
||
}
|
||
public string DirectOrderBuyTimeStr
|
||
{
|
||
get { return this.GetValue(x => x.DirectOrderBuyTimeStr); }
|
||
set { this.SetValue(x => x.DirectOrderBuyTimeStr, value); DirectOrderBuyTimeStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility DirectOrderBuyTimeStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.DirectOrderBuyTimeStrVisibility); }
|
||
set { this.SetValue(x => x.DirectOrderBuyTimeStrVisibility, value); }
|
||
}
|
||
|
||
|
||
public List<order_pdd_buyer_after_sale> DirectPddBuyerAfterSales { get; set; } = new List<order_pdd_buyer_after_sale>();
|
||
public order_pdd_buyer_after_sale DirectPddBuyerAfterSale
|
||
{
|
||
get { return this.GetValue(x => x.DirectPddBuyerAfterSale); }
|
||
set
|
||
{
|
||
if (order_id == "3738766466298321152")
|
||
{
|
||
|
||
}
|
||
|
||
this.SetValue(x => x.DirectPddBuyerAfterSale, value);
|
||
// 直发买手退货地址
|
||
this.DirectPddBuyerAfterSaleAddressStr = DirectPddBuyerAfterSale?.afterSaleAddress;
|
||
}
|
||
}
|
||
public string DirectPddBuyerAfterSaleAddressStr
|
||
{
|
||
get { return this.GetValue(x => x.DirectPddBuyerAfterSaleAddressStr); }
|
||
set
|
||
{
|
||
this.SetValue(x => x.DirectPddBuyerAfterSaleAddressStr, value);
|
||
if (value.ParseToString().Length > 19)
|
||
DirectPddBuyerAfterSaleAddressShortStr = string.Join("", value.ParseToString().Take(19)) + "…";
|
||
else
|
||
DirectPddBuyerAfterSaleAddressShortStr = value.ParseToString();
|
||
DirectPddBuyerAfterSaleAddressStrVisibility = string.IsNullOrWhiteSpace(value) ? Visibility.Collapsed : Visibility.Visible;
|
||
}
|
||
}
|
||
public string DirectPddBuyerAfterSaleAddressShortStr
|
||
{
|
||
get { return this.GetValue(x => x.DirectPddBuyerAfterSaleAddressShortStr); }
|
||
set { this.SetValue(x => x.DirectPddBuyerAfterSaleAddressShortStr, value); }
|
||
}
|
||
public Visibility DirectPddBuyerAfterSaleAddressStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.DirectPddBuyerAfterSaleAddressStrVisibility); }
|
||
set { this.SetValue(x => x.DirectPddBuyerAfterSaleAddressStrVisibility, value); }
|
||
}
|
||
public string DirectRefundStatusStr
|
||
{
|
||
get { return this.GetValue(x => x.DirectRefundStatusStr); }
|
||
set {
|
||
if (order_id == "3739897762013171200")
|
||
{
|
||
|
||
}
|
||
this.SetValue(x => x.DirectRefundStatusStr, value);
|
||
DirectRefundStatusStrVisibility = string.IsNullOrWhiteSpace(DirectRefundStatusStr) ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility DirectRefundStatusStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.DirectRefundStatusStrVisibility); }
|
||
set { this.SetValue(x => x.DirectRefundStatusStrVisibility, value); }
|
||
}
|
||
/// <summary>
|
||
/// 直发买手售后字段文字显示背景颜色
|
||
/// </summary>
|
||
public SolidColorBrush DirectRefundStatusBackColor
|
||
{
|
||
get { return this.GetValue(x => x.DirectRefundStatusBackColor); }
|
||
set { this.SetValue(x => x.DirectRefundStatusBackColor, value); }
|
||
}
|
||
public void SetDirectOrder()
|
||
{
|
||
this.DirectPddBuyerOrder = DirectPddBuyerOrders.FirstOrDefault(p => OrderItemExt?.out_order_id == p.order_sn);
|
||
if (DirectPddBuyerOrder != null)
|
||
{
|
||
|
||
}
|
||
|
||
this.DirectPddBuyerAfterSale = DirectPddBuyerAfterSales?.Where(d => d.orderSn == ItemOrder?.out_order_no)?.FirstOrDefault(p => p.statusText == "退款成功") ??
|
||
DirectPddBuyerAfterSales?.Where(d => d.orderSn == ItemOrder?.out_order_no)?.FirstOrDefault(p => p.statusText != "申请已撤销");
|
||
if (DirectPddBuyerAfterSale == null)
|
||
DirectPddBuyerAfterSale = DirectPddBuyerAfterSales?.Where(d => d.orderSn == ItemOrder?.out_order_no)?.FirstOrDefault();
|
||
//this.DirectPddBuyerAfterSale = DirectPddBuyerAfterSales.FirstOrDefault(p => OrderItemExt?.out_order_id == p.orderSn);
|
||
// 服务端这个值不会在拍新单后覆盖,在此处使用扩展订单绑定的买手单信息修改掉,后续在拍单的时候覆盖掉
|
||
if (ItemOrder.order_id == "3738859887048176128")
|
||
{
|
||
|
||
}
|
||
if (!this.ItemOrder.out_after_sale_status.ParseToString().Contains("需手动申请售后"))
|
||
this.ItemOrder.out_after_sale_status = DirectPddBuyerAfterSale?.statusText;
|
||
|
||
DirectRefundStatusStr = this.ItemOrder.out_after_sale_status.ParseToString();
|
||
if (DirectRefundStatusStr.Contains("退款成功"))
|
||
DirectRefundStatusStr += "(¥" + DirectPddBuyerAfterSale?.refundAmount * 0.01m + ")";
|
||
|
||
DirectRefundStatusBackColor = GlobalConfig.LightOrangeBrush;
|
||
if (DirectRefundStatusStr.ParseToString().Contains("退款成功"))
|
||
DirectRefundStatusBackColor = GlobalConfig.GreenBrush;
|
||
else if (DirectRefundStatusStr.ParseToString().Contains("需手动申请售后") || DirectRefundStatusStr.ParseToString().Contains("已超过可申请售后的时间"))
|
||
DirectRefundStatusBackColor = GlobalConfig.RedBrush;
|
||
|
||
if (order_id == "3739065927020471040")
|
||
{
|
||
|
||
}
|
||
DirectOrderBuyTimeStr = DirectPddBuyerOrder != null ? DirectPddBuyerOrder.add_time.ToString("yyyy-MM-dd HH:mm:ss") : "";
|
||
}
|
||
|
||
/// <summary> 直发最后一条物流信息 </summary>
|
||
public oms_wei_ewaybill_path LatestDirectEWaybill
|
||
{
|
||
get { return this.GetValue(x => x.LatestDirectEWaybill); }
|
||
set { this.SetValue(x => x.LatestDirectEWaybill, value); }
|
||
}
|
||
|
||
/// <summary> 中转仓最后一条物流信息 </summary>
|
||
public oms_wei_ewaybill_path LatestTransitEWaybill
|
||
{
|
||
get { return this.GetValue(x => x.LatestTransitEWaybill); }
|
||
set { this.SetValue(x => x.LatestTransitEWaybill, value); }
|
||
}
|
||
|
||
public void CalcOrderPrice()
|
||
{
|
||
//get { return "¥" + (order_items.Sum(oi => oi.real_price) * 0.01m).ParseToDecimal().ToString("0.00"); }
|
||
RealPriceStr = "¥" + (real_price * 0.01m).ParseToDecimal().ToString("0.00");
|
||
|
||
//get { return "¥" + (order_items.Sum(oi => oi.cash_coupon_discounted_price.ParseToInt()) * 0.01m).ParseToDecimal().ToString("0.00"); }
|
||
CashCouponDiscountedPriceStr = "¥" + (cash_coupon_discounted_price.ParseToInt() * 0.01m).ParseToDecimal().ToString("0.00");
|
||
|
||
PostagePriceStr = "¥" + (ItemOrder?.postage_price * 0.01m / ItemOrder?.orderItems.Count).ParseToDecimal().ToString("0.00");
|
||
|
||
//get { return "¥" + (order_items.Sum(oi => oi.purchase_price.ParseToInt()) * 0.01m).ParseToDecimal().ToString("0.00"); }
|
||
PurchasePriceStr = "¥" + (purchase_price * 0.01m).ParseToDecimal().ToString("0.00");
|
||
|
||
//if (ItemOrder.out_amount > 0 || ItemTransitOrder?.out_amount > 0) return Visibility.Collapsed; return Visibility.Visible;
|
||
PurchasePriceVisibility = Visibility.Collapsed;
|
||
|
||
//get { return "¥" + (order_items.Sum(oi => oi.freight.ParseToInt()) * 0.01m).ParseToDecimal().ToString("0.00"); }
|
||
FreightStr = "¥" + (freight * 0.01m).ParseToDecimal().ToString("0.00");
|
||
|
||
//get { if (ItemOrder.out_amount > 0 || ItemTransitOrder?.out_amount > 0) return Visibility.Collapsed; return Visibility.Visible; }
|
||
FreightVisibility = Visibility.Collapsed;
|
||
|
||
//get { return "¥" + (order_items.Sum(oi => oi.predict_commission_fee.ParseToInt()) * 0.01m).ParseToDecimal().ToString("0.00"); }
|
||
PredictCommissionFeeStr = "¥" + (predict_commission_fee * 0.01m).ParseToDecimal().ToString("0.00");
|
||
|
||
//get { return "¥" + (order_items.Sum(oi => oi.commission_amount.ParseToInt()) * 0.01m).ParseToDecimal().ToString("0.00"); }
|
||
CommissionAmountStr = "¥" + (commission_amount.ParseToInt() * 0.01m).ParseToDecimal().ToString("0.00");
|
||
|
||
//get { return "¥" + (ItemOrder.out_amount * 0.01m).ParseToDecimal().ToString("0.00"); }
|
||
//if (ItemTransitOrder?.out_amount > 0)
|
||
// return "¥" + (ItemTransitOrder.out_amount * 0.01m).ParseToDecimal().ToString("0.00");
|
||
if (ItemTransitOrders.Any(t => t.refund_status != "买手退款成功"))
|
||
OutAmountStr = "¥" + (ItemTransitOrders.Where(t => t.refund_status != "买手退款成功").Sum(t => t.out_amount) * 0.01m).ParseToDecimal().ToString("0.00");
|
||
else
|
||
OutAmountStr = "¥" + ((ItemOrder?.out_amount).ParseToInt() * 0.01m).ParseToDecimal().ToString("0.00");
|
||
|
||
//ItemOrder.out_amount ItemTransitOrder.out_amount 只有一个有值
|
||
var out_amount = ItemTransitOrder?.out_amount ?? ItemOrder.out_amount / ItemOrder.orderItems.Count;
|
||
var postage_price = ItemOrder?.postage_price ?? ItemOrder.postage_price / ItemOrder.orderItems.Count;
|
||
ProfitCount = ((real_price.ParseToInt() + cash_coupon_discounted_price.ParseToInt() + postage_price - purchase_price.ParseToInt() - freight.ParseToInt() -
|
||
predict_commission_fee.ParseToInt() - commission_amount.ParseToInt() - out_amount.ParseToInt()) * 0.01m).ParseToDecimal();
|
||
|
||
//get { return "¥" + (profit * 0.01m).ParseToDecimal().ToString("0.00"); }
|
||
//get { return "¥" + ((ItemOrder.profit - ItemOrder.out_amount) * 0.01m).ParseToDecimal().ToString("0.00"); }
|
||
if (refund_status == 2 || refund_status == 3 || refund_status == 4 || refund_status == 11)
|
||
ProfitCountStr = "--";
|
||
else
|
||
ProfitCountStr = "¥" + ProfitCount.ToString("0.00");
|
||
|
||
if (refund_status == 2 || refund_status == 3 || refund_status == 4 || refund_status == 11)
|
||
ProfitStrColor = GlobalConfig.GrayBrush;
|
||
else
|
||
ProfitStrColor = ProfitCount > 0 ? GlobalConfig.GreenTextBrush : GlobalConfig.RedTextBrush;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 订单中所有商品加起来的总售价文本
|
||
/// </summary>
|
||
public string RealPriceStr
|
||
{
|
||
get { return this.GetValue(x => x.RealPriceStr); }
|
||
set { this.SetValue(x => x.RealPriceStr, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 订单内商品维度平台券优惠金额(利润需要计算这个金额在内)文本
|
||
/// </summary>
|
||
public string CashCouponDiscountedPriceStr
|
||
{
|
||
get { return this.GetValue(x => x.CashCouponDiscountedPriceStr); }
|
||
set { this.SetValue(x => x.CashCouponDiscountedPriceStr, value); }
|
||
}
|
||
|
||
public string PostagePriceStr
|
||
{
|
||
get { return this.GetValue(x => x.PostagePriceStr); }
|
||
set { this.SetValue(x => x.PostagePriceStr, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 采购价文本
|
||
/// </summary>
|
||
public string PurchasePriceStr
|
||
{
|
||
get { return this.GetValue(x => x.PurchasePriceStr); }
|
||
set { this.SetValue(x => x.PurchasePriceStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 采购价文本是否可见
|
||
/// </summary>
|
||
public Visibility PurchasePriceVisibility
|
||
{
|
||
get { return this.GetValue(x => x.PurchasePriceVisibility); }
|
||
set { this.SetValue(x => x.PurchasePriceVisibility, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 运费文本
|
||
/// </summary>
|
||
public string FreightStr
|
||
{
|
||
get { return this.GetValue(x => x.FreightStr); }
|
||
set { this.SetValue(x => x.FreightStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 运费文本是否可见
|
||
/// </summary>
|
||
public Visibility FreightVisibility
|
||
{
|
||
get { return this.GetValue(x => x.FreightVisibility); }
|
||
set { this.SetValue(x => x.FreightVisibility, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 平台服务费
|
||
/// </summary>
|
||
public string PredictCommissionFeeStr
|
||
{
|
||
get { return this.GetValue(x => x.PredictCommissionFeeStr); }
|
||
set { this.SetValue(x => x.PredictCommissionFeeStr, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 达人佣金
|
||
/// </summary>
|
||
public string CommissionAmountStr
|
||
{
|
||
get { return this.GetValue(x => x.PredictCommissionFeeStr); }
|
||
set { this.SetValue(x => x.PredictCommissionFeeStr, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 外采金额文本
|
||
/// </summary>
|
||
public string OutAmountStr
|
||
{
|
||
get { return this.GetValue(x => x.OutAmountStr); }
|
||
set { this.SetValue(x => x.OutAmountStr, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 通过计算的利润
|
||
/// </summary>
|
||
public decimal ProfitCount
|
||
{
|
||
get { return this.GetValue(x => x.ProfitCount); }
|
||
set { this.SetValue(x => x.ProfitCount, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 通过计算的利润文本
|
||
/// </summary>
|
||
public string ProfitCountStr
|
||
{
|
||
get { return this.GetValue(x => x.ProfitCountStr); }
|
||
set { this.SetValue(x => x.ProfitCountStr, value); }
|
||
}
|
||
|
||
public SolidColorBrush ProfitStrColor
|
||
{
|
||
get { return this.GetValue(x => x.ProfitStrColor); }
|
||
set { this.SetValue(x => x.ProfitStrColor, value); }
|
||
}
|
||
|
||
public DateTime CreateDateTime
|
||
{
|
||
get { return this.GetValue(x => x.CreateDateTime); }
|
||
set { this.SetValue(x => x.CreateDateTime, value); }
|
||
}
|
||
/// <summary>
|
||
/// 订单创建时间文本
|
||
/// </summary>
|
||
public string CreateDateTimeStr
|
||
{
|
||
get { return this.GetValue(x => x.CreateDateTimeStr); }
|
||
set { this.SetValue(x => x.CreateDateTimeStr, value); }
|
||
}
|
||
/// <summary>
|
||
/// 订单更新时间文本
|
||
/// </summary>
|
||
public string UpdateTimeStr
|
||
{
|
||
get { return this.GetValue(x => x.UpdateTimeStr); }
|
||
set { this.SetValue(x => x.UpdateTimeStr, value); }
|
||
}
|
||
|
||
/// <summary>
|
||
/// sku规格名称文本
|
||
/// </summary>
|
||
public string SkuAttrStr
|
||
{
|
||
get { return this.GetValue(x => x.SkuAttrStr); }
|
||
set { this.SetValue(x => x.SkuAttrStr, value); }
|
||
}
|
||
public void SetSkuAttrStr()
|
||
{
|
||
try
|
||
{
|
||
var jObj = JArray.Parse(sku_attrs);
|
||
var str = string.Join(",", jObj.Select(j => j["attr_value"].ParseToString()));
|
||
SkuAttrStr = str;
|
||
}
|
||
catch { SkuAttrStr = "获取失败"; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 拼多多秒退异常重拍按钮可见条件
|
||
/// </summary>
|
||
public Visibility BtnAbnormalBtnVisibility
|
||
{
|
||
get { return this.GetValue(x => x.BtnAbnormalBtnVisibility); }
|
||
set { this.SetValue(x => x.BtnAbnormalBtnVisibility, value); }
|
||
}
|
||
/// <summary>
|
||
/// 直发按钮可见条件
|
||
/// </summary>
|
||
public Visibility BtnDirectBuyOrderVisibility
|
||
{
|
||
get { return this.GetValue(x => x.BtnDirectBuyOrderVisibility); }
|
||
set { this.SetValue(x => x.BtnDirectBuyOrderVisibility, value); }
|
||
}
|
||
public void SetAbnormalAndDirectBtnVisibility()
|
||
{
|
||
// 买手秒退异常重拍
|
||
BtnAbnormalBtnVisibility = Visibility.Visible;
|
||
// 不是异常单的不可异常重拍
|
||
if (this.ItemOrder?.IsAbnormal != true)
|
||
BtnAbnormalBtnVisibility = Visibility.Collapsed;
|
||
// 买手未退款的,中转正式取号以后的,不可异常重拍
|
||
else if (this.ItemTransitOrder?.refund_status != "买手退款成功" ||
|
||
this.WarehouseWaybillStatusStr == "中转已取号" || this.WarehouseWaybillStatusStr == "中转已入库" ||
|
||
this.WarehouseWaybillStatusStr == "中转已出库" || this.WarehouseWaybillStatusStr == "中转拦截到仓")
|
||
BtnAbnormalBtnVisibility = Visibility.Collapsed;
|
||
// 已正式取号的,不可异常重拍
|
||
if (this.ItemTransitOrder?.pre_allocated_order_no == 1 || this.ItemTransitOrder?.pre_allocated_order_no == 3)
|
||
BtnAbnormalBtnVisibility = Visibility.Collapsed;
|
||
// 仓库异常的异常单不可异常重拍
|
||
List<string> rawMsgKeyWords = new List<string> { "取号异常", "无法调用" };
|
||
if (rawMsgKeyWords.Any(k => (this.ItemTransitOrderWithVoid?.raw_message).ParseToString().Contains(k)) && this.ItemTransitOrderWithVoid?.transfer_warehouse_status != 1)
|
||
BtnAbnormalBtnVisibility = Visibility.Collapsed;
|
||
|
||
if (order_id == "3738706885587395328")
|
||
{
|
||
|
||
}
|
||
|
||
// 直拍按钮
|
||
BtnDirectBuyOrderVisibility = Visibility.Collapsed;
|
||
//if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||
{
|
||
if (this.ItemOrder?.GetIsWaitBuy() == true && this.BuyGoodsBtnTxt != "关联拍单")
|
||
BtnDirectBuyOrderVisibility = Visibility.Visible;
|
||
if (this.ItemOrder?.GetIsAbnormal() == true && this.refund_status <= 1)
|
||
{
|
||
//if (BtnAbnormalBtnVisibility == Visibility.Collapsed && (this.ItemOrder.out_order_no.IsNullOrEmpty() || this.ItemOrder.out_after_sale_status == "退款成功"))
|
||
if (this.ItemOrder.out_order_no.IsNullOrEmpty() || this.ItemOrder.out_after_sale_status == "退款成功")
|
||
BtnDirectBuyOrderVisibility = Visibility.Visible;
|
||
}
|
||
}
|
||
//else if (GlobalConfig.CurrentBuyPlatform == "tb")
|
||
{
|
||
}
|
||
}
|
||
|
||
public string RefundStatusStr
|
||
{
|
||
get { return this.GetValue(x => x.RefundStatusStr); }
|
||
set { this.SetValue(x => x.RefundStatusStr, value); RefundStatusStrVisibility = value.IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible; }
|
||
}
|
||
public Visibility RefundStatusStrVisibility
|
||
{
|
||
get { return this.GetValue(x => x.RefundStatusStrVisibility); }
|
||
set { this.SetValue(x => x.RefundStatusStrVisibility, value); }
|
||
}
|
||
|
||
public Visibility BtnVoidTransitOrderVisibility
|
||
{
|
||
get { return this.GetValue(x => x.BtnVoidTransitOrderVisibility); }
|
||
set { this.SetValue(x => x.BtnVoidTransitOrderVisibility, value); }
|
||
}
|
||
public Visibility BtnAbnormalOrderRebuyVisibility
|
||
{
|
||
get { return this.GetValue(x => x.BtnAbnormalOrderRebuyVisibility); }
|
||
set { this.SetValue(x => x.BtnAbnormalOrderRebuyVisibility, value); }
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 订单商品表数据库id
|
||
/// </summary>
|
||
public long id { get; set; }
|
||
public long shop_id { get; set; }
|
||
/// <summary>
|
||
/// 商户ID
|
||
/// </summary>
|
||
public long merchant_id { get; set; }
|
||
/// <summary>
|
||
/// 订单id(平台订单id)
|
||
/// </summary>
|
||
public string order_id { get; set; }
|
||
/// <summary>
|
||
/// 商品spuid
|
||
/// </summary>
|
||
public string product_id { get; set; }
|
||
public string sku_id { get; set; }
|
||
/// <summary>
|
||
/// sku小图
|
||
/// </summary>
|
||
public string thumb_img { get; set; }
|
||
/// <summary>
|
||
/// sku数量
|
||
/// </summary>
|
||
public int? sku_cnt { get; set; }
|
||
/// <summary>
|
||
/// 售卖单价(单位:分)
|
||
/// </summary>
|
||
public int? sale_price { get; set; }
|
||
/// <summary>
|
||
/// 商品名称
|
||
/// </summary>
|
||
public string title { get; set; }
|
||
/// <summary>
|
||
/// 正在售后/退款流程中的 sku 数量
|
||
/// </summary>
|
||
public int? on_aftersale_sku_cnt { get; set; }
|
||
/// <summary>
|
||
/// 完成售后/退款的 sku 数量
|
||
/// </summary>
|
||
public int? finish_aftersale_sku_cnt { get; set; }
|
||
/// <summary>
|
||
/// 商品编码
|
||
/// </summary>
|
||
public string sku_code { get; set; }
|
||
/// <summary>
|
||
/// 市场单价(单位:分)
|
||
/// </summary>
|
||
public int? market_price { get; set; }
|
||
/// <summary>
|
||
/// sku属性JSON
|
||
/// </summary>
|
||
public string sku_attrs
|
||
{
|
||
get { return this.GetValue(x => x.sku_attrs); }
|
||
set { this.SetValue(x => x.sku_attrs, value); SetSkuAttrStr(); }
|
||
}
|
||
/// <summary>
|
||
/// sku实付总价,取estimate_price和change_price中较小值
|
||
/// </summary>
|
||
public int? real_price { get; set; }
|
||
/// <summary>
|
||
/// 商品外部spuid
|
||
/// </summary>
|
||
public string out_product_id { get; set; }
|
||
/// <summary>
|
||
/// 采购价
|
||
/// </summary>
|
||
public int? purchase_price { get; set; }
|
||
/// <summary>
|
||
/// 运费
|
||
/// </summary>
|
||
public int? freight { get; set; }
|
||
/// <summary>
|
||
/// 商品外部skuid
|
||
/// </summary>
|
||
public string out_sku_id { get; set; }
|
||
/// <summary>
|
||
/// 是否有优惠金额,非必填,默认为false
|
||
/// </summary>
|
||
public string is_discounted { get; set; }
|
||
/// <summary>
|
||
/// 优惠后sku总价,非必填,is_discounted为true时有值
|
||
/// </summary>
|
||
public int? estimate_price { get; set; }
|
||
/// <summary>
|
||
/// 是否修改过价格,非必填,默认为false
|
||
/// </summary>
|
||
public string is_change_price { get; set; }
|
||
/// <summary>
|
||
/// 改价后sku总价,非必填,is_change_price为true时有值
|
||
/// </summary>
|
||
public int? change_price { get; set; }
|
||
/// <summary>
|
||
/// 订单内商品维度平台券优惠金额(利润需要计算这个金额在内)
|
||
/// </summary>
|
||
public int? cash_coupon_discounted_price { get; set; }
|
||
/// <summary>
|
||
/// 区域库存id
|
||
/// </summary>
|
||
public string out_warehouse_id { get; set; }
|
||
/// <summary>
|
||
/// 退货地址
|
||
/// </summary>
|
||
public string return_address { get; set; }
|
||
/// <summary>
|
||
/// 商品发货信息JSON
|
||
/// </summary>
|
||
public string sku_deliver_info { get; set; }
|
||
/// <summary>
|
||
/// 商品额外服务信息JSON
|
||
/// </summary>
|
||
public string extra_service { get; set; }
|
||
/// <summary>
|
||
/// 是否使用了会员积分抵扣
|
||
/// </summary>
|
||
public string use_deduction { get; set; }
|
||
/// <summary>
|
||
/// 会员积分抵扣金额,单位为分
|
||
/// </summary>
|
||
public int? deduction_price { get; set; }
|
||
/// <summary>
|
||
/// 平台服务费(微信小店:预计技术服务费),单位为分
|
||
/// </summary>
|
||
public int? predict_commission_fee { get; set; }
|
||
/// <summary>
|
||
/// 达人佣金(微信小店:分账金额),单位为分
|
||
/// </summary>
|
||
public int? commission_amount { get; set; }
|
||
/// <summary>
|
||
/// 商品优惠券信息,逐步替换 order.order_detail.coupon_info
|
||
/// </summary>
|
||
public string order_product_coupon_info_list { get; set; }
|
||
/// <summary>
|
||
/// 商品id(o_goods外键)
|
||
/// </summary>
|
||
public long? erp_goods_id { get; set; }
|
||
/// <summary>
|
||
/// 商品skuid(o_goods_sku外键)
|
||
/// </summary>
|
||
public long? erp_goods_sku_id { get; set; }
|
||
/// <summary>
|
||
/// 售后状态 1:无售后或售后关闭,2:售后处理中,3:退款中,4:退款成功,11:已取消(售后完成订单取消)
|
||
/// </summary>
|
||
public int? refund_status
|
||
{
|
||
get { return this.GetValue(x => x.refund_status); }
|
||
set
|
||
{
|
||
this.SetValue(x => x.refund_status, value);
|
||
if (value == 1)
|
||
RefundStatusStr = "无售后/售后关闭";
|
||
else if (value == 2)
|
||
RefundStatusStr = "售后处理中";
|
||
else if (value == 3)
|
||
RefundStatusStr = "退款中";
|
||
else if (value == 4)
|
||
RefundStatusStr = "退款成功";
|
||
else if (value == 11)
|
||
RefundStatusStr = "售后完成订单取消";
|
||
}
|
||
}
|
||
|
||
public void SetOrderItemTextProperty()
|
||
{
|
||
CreateDateTime = BaseClass.StampToDateTime((ItemOrder?.create_time).ParseToInt());
|
||
CreateDateTimeStr = CreateDateTime.ToString("yy-MM-dd HH:mm:ss");
|
||
UpdateTimeStr = BaseClass.StampToDateTime((ItemOrder?.update_time).ParseToInt()).ToString("yy-MM-dd HH:mm:ss");
|
||
|
||
//if (PurpleBrush == null && GlobalConfig.Dispatcher != null)
|
||
//{
|
||
// // 初始化笔刷,必修Invoke;
|
||
// GlobalConfig.Dispatcher.Invoke(new Action(() =>
|
||
// {
|
||
|
||
// }));
|
||
//}
|
||
|
||
this.SetItemRefund();
|
||
this.SetTransitOrder();
|
||
this.SetDirectOrder();
|
||
this.SetBuyerTransitWaybillStatusStr();
|
||
this.SetWarehouseWaybillStatusStr();
|
||
|
||
// 拍单、代发等信息判断并控制拍单按钮
|
||
this.UpdateOrderItemBuyButton();
|
||
this.SetAbnormalAndDirectBtnVisibility();
|
||
|
||
SetEWaybillInfo();
|
||
SetOutOrderTimeQualifiedStr();
|
||
CalcOrderPrice();
|
||
SetOrderItemStatusAndColor();
|
||
SetOrderItemExtInfo();
|
||
|
||
if (this.ItemTransitOrders != null)
|
||
{
|
||
foreach (var tOrder in this.ItemTransitOrders)
|
||
{
|
||
tOrder.SetOutOrderBuyerStr();
|
||
}
|
||
ItemTransitOutOrderBuyerStrVisibility = (ItemTransitOrderWithVoid?.OutOrderBuyerStr).IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible;
|
||
ItemTransitOutOrderNoStrVisibility = (ItemTransitOrderWithVoid?.OutOrderNumStr).IsNullOrEmpty() ? Visibility.Collapsed : Visibility.Visible;
|
||
}
|
||
}
|
||
|
||
/// <summary> 初始化物流明细信息 </summary>
|
||
public void SetEWaybillInfo()
|
||
{
|
||
if(order_id == "3738794693820307200")
|
||
{
|
||
|
||
}
|
||
if (this.ItemOrder?.latestEWaybills?.Count > 0 && !string.IsNullOrEmpty(ItemTransitOrderWithVoid?.express_2_waybill))
|
||
LatestTransitEWaybill = ItemOrder.latestEWaybills.FirstOrDefault(ew => ew.waybill_id == ItemTransitOrderWithVoid.express_2_waybill);
|
||
else
|
||
LatestTransitEWaybill = null;
|
||
|
||
if (this.ItemOrder?.latestEWaybills?.Count > 0 && !string.IsNullOrEmpty(this.ItemOrder?.out_express_no))
|
||
LatestDirectEWaybill = ItemOrder.latestEWaybills.FirstOrDefault(ew => ew.waybill_id == this.ItemOrder?.out_express_no);
|
||
else
|
||
LatestDirectEWaybill = null;
|
||
}
|
||
|
||
public void UpdateOrderItemBuyButton()
|
||
{
|
||
var order_item = this;
|
||
order_item.Shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ErpShopId == order_item.shop_id.ParseToString());
|
||
|
||
// 关联商品sku
|
||
if (GlobalConfig.CurrentBuyPlatform == "pdd")
|
||
{
|
||
if (PddBuyMapSkus != null && PddBuyMapSkus.Count > 0)
|
||
MapSkusBtnVisibility = Visibility.Visible;
|
||
else
|
||
MapSkusBtnVisibility = Visibility.Collapsed;
|
||
}
|
||
else if (GlobalConfig.CurrentBuyPlatform == "tb")
|
||
{
|
||
if (TbBuyMapSkus != null && TbBuyMapSkus.Count > 0)
|
||
MapSkusBtnVisibility = Visibility.Visible;
|
||
else
|
||
MapSkusBtnVisibility = Visibility.Collapsed;
|
||
}
|
||
else
|
||
MapSkusBtnVisibility = Visibility.Collapsed;
|
||
|
||
order_item.IsBuyGoodsBtnEnabled = false;
|
||
if (GlobalConfig.CurrentBuyPlatform == "pdd" && order_item.PddBuyMap == null)
|
||
{
|
||
order_item.IsBuyGoodsBtnEnabled = true;
|
||
order_item.BuyGoodsBtnTxt = "关联拍单";
|
||
order_item.BuyGoodsBtnBackColor = GlobalConfig.PurpleBrush100;
|
||
order_item.BuyGoodsBtnColor = GlobalConfig.PurpleBrush;
|
||
}
|
||
else if (GlobalConfig.CurrentBuyPlatform == "tb" && order_item.TbBuyMap == null)
|
||
{
|
||
order_item.IsBuyGoodsBtnEnabled = true;
|
||
order_item.BuyGoodsBtnTxt = "关联拍单";
|
||
order_item.BuyGoodsBtnBackColor = GlobalConfig.PurpleBrush100;
|
||
order_item.BuyGoodsBtnColor = GlobalConfig.PurpleBrush;
|
||
}
|
||
else if (GlobalConfig.lstDangerItemWord.Any(d => order_item.title.Contains(d)))
|
||
{
|
||
order_item.IsBuyGoodsBtnEnabled = false;
|
||
order_item.BuyGoodsBtnBackColor = GlobalConfig.RedTextBrush50;
|
||
order_item.BuyGoodsBtnColor = GlobalConfig.RedTextBrush;
|
||
order_item.BuyGoodsBtnTxt = "危险品不支持中转拍单";
|
||
}
|
||
else if (Shop == null || (Shop?.LoginStatus != "登录成功" /*&& Shop?.Is29Supplier == null*/))
|
||
{
|
||
order_item.IsBuyGoodsBtnEnabled = false;
|
||
order_item.BuyGoodsBtnBackColor = GlobalConfig.RedTextBrush50;
|
||
order_item.BuyGoodsBtnColor = GlobalConfig.RedTextBrush;
|
||
order_item.BuyGoodsBtnTxt = "请登录店铺";
|
||
}
|
||
else if (Shop?.LoginStatus == "登录成功" && Shop?.Is29Supplier == null)
|
||
{
|
||
order_item.IsBuyGoodsBtnEnabled = false;
|
||
order_item.BuyGoodsBtnBackColor = GlobalConfig.OrangeBrush50;
|
||
order_item.BuyGoodsBtnColor = GlobalConfig.OrangeBrush;
|
||
order_item.BuyGoodsBtnTxt = "代发状态读取中请稍候";
|
||
}
|
||
else if (Shop?.Is29Supplier == false)
|
||
{
|
||
order_item.IsBuyGoodsBtnEnabled = true;
|
||
order_item.BuyGoodsBtnBackColor = GlobalConfig.RedTextBrush50;
|
||
order_item.BuyGoodsBtnColor = GlobalConfig.RedTextBrush;
|
||
order_item.BuyGoodsBtnTxt = "去店铺后台绑定代发";
|
||
}
|
||
else
|
||
{
|
||
order_item.IsBuyGoodsBtnEnabled = true;
|
||
order_item.BuyGoodsBtnTxt = "云仓拍单";
|
||
order_item.BuyGoodsBtnBackColor = GlobalConfig.PurpleBrush35;
|
||
order_item.BuyGoodsBtnColor = GlobalConfig.PurpleBrush;
|
||
}
|
||
|
||
// 作废重拍
|
||
if (order_item.ItemOrder.status == 20 /*&& order_item.refund_status <= 1*/ && order_item.ItemTransitOrder != null)
|
||
BtnVoidTransitOrderVisibility = Visibility.Visible;
|
||
else
|
||
BtnVoidTransitOrderVisibility = Visibility.Collapsed;
|
||
// 异常重拍
|
||
if (order_item.GetIsAbnormalOrderRebuy())
|
||
BtnAbnormalOrderRebuyVisibility = Visibility.Visible;
|
||
else
|
||
BtnAbnormalOrderRebuyVisibility = Visibility.Collapsed;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 判断中转仓订单是否可以异常重拍
|
||
/// </summary>
|
||
/// <param name="order_item"></param>
|
||
/// <returns></returns>
|
||
public bool GetIsAbnormalOrderRebuy()
|
||
{
|
||
var order_item = this;
|
||
|
||
// 不是异常单的不可异常重拍
|
||
if (order_item?.ItemOrder?.IsAbnormal != true)
|
||
return false;
|
||
// 买手未退款的,中转正式取号以后的,不可异常重拍
|
||
if (order_item.ItemTransitOrder?.refund_status != "买手退款成功" ||
|
||
order_item.WarehouseWaybillStatusStr == "中转已取号" || order_item.WarehouseWaybillStatusStr == "中转已入库" || order_item.WarehouseWaybillStatusStr == "中转已出库")
|
||
return false;
|
||
// 已正式取号的,不可异常重拍
|
||
if (order_item.ItemTransitOrder?.pre_allocated_order_no == 1 || order_item.ItemTransitOrder?.pre_allocated_order_no == 3)
|
||
return false;
|
||
// 仓库异常的异常单不可异常重拍
|
||
List<string> rawMsgKeyWords = new List<string> { "取号异常", "无法调用" };
|
||
if (rawMsgKeyWords.Any(k => (order_item.ItemTransitOrderWithVoid?.raw_message).ParseToString().Contains(k)) && order_item.ItemTransitOrderWithVoid?.transfer_warehouse_status != 1)
|
||
return false;
|
||
|
||
return true;
|
||
}
|
||
}
|
||
}
|