36 changed files with 901 additions and 348 deletions
@ -0,0 +1,203 @@ |
|||
using System; |
|||
|
|||
namespace BBWY.Client.Models |
|||
{ |
|||
public class ManualEditCostOrderSku : NotifyObject |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 发货运费
|
|||
/// </summary>
|
|||
private decimal deliveryExpressFreight; |
|||
private string deliveryExpressFreightStr; |
|||
|
|||
/// <summary>
|
|||
/// 单件成本
|
|||
/// </summary>
|
|||
private decimal unitCost; |
|||
|
|||
/// <summary>
|
|||
/// Sku成本(商品成本)
|
|||
/// </summary>
|
|||
private decimal skuAmount; |
|||
private string skuAmountStr; |
|||
|
|||
/// <summary>
|
|||
/// 采购运费
|
|||
/// </summary>
|
|||
private decimal purchaseFreight; |
|||
private string purchaseFreightStr; |
|||
|
|||
/// <summary>
|
|||
/// 头程运费
|
|||
/// </summary>
|
|||
private decimal firstFreight; |
|||
private string firstFreightStr; |
|||
|
|||
/// <summary>
|
|||
/// 操作费
|
|||
/// </summary>
|
|||
private decimal operationAmount; |
|||
private string operationAmountStr; |
|||
|
|||
/// <summary>
|
|||
/// 耗材费
|
|||
/// </summary>
|
|||
private decimal consumableAmount; |
|||
private string consumableAmountStr; |
|||
|
|||
/// <summary>
|
|||
/// 仓储费
|
|||
/// </summary>
|
|||
private decimal storageAmount; |
|||
private string storageAmountStr; |
|||
|
|||
/// <summary>
|
|||
/// 总计(不含发货运费)
|
|||
/// </summary>
|
|||
private decimal totalCost; |
|||
|
|||
/// <summary>
|
|||
/// SkuId
|
|||
/// </summary>
|
|||
public string Id { get; set; } |
|||
|
|||
public int ItemTotal { get; set; } |
|||
|
|||
public string ProductId { get; set; } |
|||
|
|||
public string ProductItemNum { get; set; } |
|||
|
|||
public double Price { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Sku标题
|
|||
/// </summary>
|
|||
public string Title { get; set; } |
|||
|
|||
public string Logo { get; set; } |
|||
public decimal DeliveryExpressFreight |
|||
{ |
|||
get => deliveryExpressFreight; set |
|||
{ |
|||
if (Set(ref deliveryExpressFreight, value)) |
|||
{ |
|||
OnAmountChanged?.Invoke(); |
|||
} |
|||
} |
|||
} |
|||
public decimal UnitCost { get => unitCost; set { Set(ref unitCost, value); } } |
|||
public decimal SkuAmount |
|||
{ |
|||
get => skuAmount; set |
|||
{ |
|||
if (Set(ref skuAmount, value)) |
|||
{ |
|||
CalculationCost(); |
|||
} |
|||
} |
|||
} |
|||
public decimal PurchaseFreight { get => purchaseFreight; set { if (Set(ref purchaseFreight, value)) { CalculationCost(); } } } |
|||
public decimal FirstFreight { get => firstFreight; set { if (Set(ref firstFreight, value)) { CalculationCost(); } } } |
|||
public decimal OperationAmount { get => operationAmount; set { if (Set(ref operationAmount, value)) { CalculationCost(); } } } |
|||
public decimal ConsumableAmount { get => consumableAmount; set { if (Set(ref consumableAmount, value)) { CalculationCost(); } } } |
|||
public decimal StorageAmount { get => storageAmount; set { if (Set(ref storageAmount, value)) { CalculationCost(); } } } |
|||
public decimal TotalCost |
|||
{ |
|||
get => totalCost; set |
|||
{ |
|||
if (Set(ref totalCost, value)) |
|||
{ |
|||
OnAmountChanged?.Invoke(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
private void CalculationCost() |
|||
{ |
|||
TotalCost = SkuAmount + PurchaseFreight + FirstFreight + OperationAmount + ConsumableAmount + StorageAmount; |
|||
UnitCost = ItemTotal == 0 ? 0 : TotalCost / ItemTotal; |
|||
} |
|||
|
|||
public Action OnAmountChanged { get; set; } |
|||
|
|||
public string SkuAmountStr |
|||
{ |
|||
get => skuAmountStr; set |
|||
{ |
|||
if (Set(ref skuAmountStr, value)) |
|||
{ |
|||
if (decimal.TryParse(skuAmountStr, out decimal d)) |
|||
SkuAmount = d; |
|||
} |
|||
} |
|||
} |
|||
public string PurchaseFreightStr |
|||
{ |
|||
get => purchaseFreightStr; set |
|||
{ |
|||
if (Set(ref purchaseFreightStr, value)) |
|||
{ |
|||
if (decimal.TryParse(purchaseFreightStr, out decimal d)) |
|||
PurchaseFreight = d; |
|||
} |
|||
} |
|||
} |
|||
public string FirstFreightStr |
|||
{ |
|||
get => firstFreightStr; set |
|||
{ |
|||
if (Set(ref firstFreightStr, value)) |
|||
{ |
|||
if (decimal.TryParse(firstFreightStr, out decimal d)) |
|||
FirstFreight = d; |
|||
} |
|||
} |
|||
} |
|||
public string ConsumableAmountStr |
|||
{ |
|||
get => consumableAmountStr; set |
|||
{ |
|||
if (Set(ref consumableAmountStr, value)) |
|||
{ |
|||
if (decimal.TryParse(consumableAmountStr, out decimal d)) |
|||
ConsumableAmount = d; |
|||
} |
|||
} |
|||
} |
|||
public string StorageAmountStr |
|||
{ |
|||
get => storageAmountStr; set |
|||
{ |
|||
if (Set(ref storageAmountStr, value)) |
|||
{ |
|||
if (decimal.TryParse(storageAmountStr, out decimal d)) |
|||
StorageAmount = d; |
|||
} |
|||
} |
|||
} |
|||
public string OperationAmountStr |
|||
{ |
|||
get => operationAmountStr; set |
|||
{ |
|||
if (Set(ref operationAmountStr, value)) |
|||
{ |
|||
if (decimal.TryParse(operationAmountStr, out decimal d)) |
|||
OperationAmount = d; |
|||
} |
|||
} |
|||
} |
|||
|
|||
public string DeliveryExpressFreightStr |
|||
{ |
|||
get => deliveryExpressFreightStr; set |
|||
{ |
|||
if (Set(ref deliveryExpressFreightStr, value)) |
|||
{ |
|||
if (decimal.TryParse(deliveryExpressFreightStr, out decimal d)) |
|||
DeliveryExpressFreight = d; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,18 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace BBWY.Client.Models |
|||
{ |
|||
public class Department2 |
|||
{ |
|||
public string Id { get; set; } |
|||
|
|||
public string Name { get; set; } |
|||
|
|||
public IList<Shop> ShopList { get; set; } |
|||
|
|||
public Department2() |
|||
{ |
|||
ShopList = new List<Shop>(); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue