步步为盈
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

483 lines
14 KiB

2 years ago
using BBWY.Client.APIServices;
using BBWY.Client.Models.APIModel;
2 years ago
using BBWY.Client.Models.APIModel.Response.PackTask;
using BBWY.Client.ViewModels;
2 years ago
using BBWY.Client.ViewModels.PackTask;
2 years ago
using BBWY.Client.Views.PackTask;
2 years ago
using BBWY.Client.Views.QualityTask;
2 years ago
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
2 years ago
using System.Windows;
2 years ago
using System.Windows.Controls;
using System.Windows.Input;
2 years ago
using WebSocketSharp;
2 years ago
namespace BBWY.Client.Models
{
/// <summary>
/// 打包任务 数据绑定
/// </summary>
public class PackTaskModel : BaseVM
{
private bool isShowFees;
public bool IsShowFees { get => isShowFees; set { Set(ref isShowFees, value); } }
private long id;
public long Id { get => id; set { Set(ref id, value); } }
public ICommand PrintBarcodeCommand { get; set; }
public ICommand PrintCerCommand { get; set; }
public ICommand LookCerCommand { get; set; }
public ICommand LookBarCommand { get; set; }
public ICommand SetServiceCommand { get; set; }
2 years ago
/// <summary>
/// 修改任务
/// </summary>
public ICommand UpdateTaskCommand { get; set; }
2 years ago
public ICommand QualityTaskCommand { get; set; }
2 years ago
public Action ReflashTask { get; set; }
private void UpdateTask()
{
2 years ago
2 years ago
2 years ago
if (!this.OrderId.IsNullOrEmpty())
{
System.Windows.MessageBox.Show("暂不支持修改采购组的任务");
return;
}
PublishTaskWindow publish = new PublishTaskWindow(ReflashTask, this);
2 years ago
publish.Show();
2 years ago
}
2 years ago
2 years ago
public PackTaskModel()
2 years ago
{
PrintBarcodeCommand = new RelayCommand(PrintBarcode);
PrintCerCommand = new RelayCommand(PrintCer);
LookBarCommand = new RelayCommand(LookBar);
LookCerCommand = new RelayCommand(LookCer);
SetServiceCommand = new RelayCommand(SetService);
2 years ago
UpdateTaskCommand = new RelayCommand(UpdateTask);
2 years ago
QualityTaskCommand = new RelayCommand(QualityTask);
2 years ago
}
private void QualityTask()
{
//加载数据
2 years ago
QualityWindow service = new QualityWindow(this, ReflashTask);
2 years ago
service.Show();
2 years ago
}
private void SetService()
{
2 years ago
ServiceWindow service = new ServiceWindow(this, ReflashTask);
2 years ago
service.Show();
}
/// <summary>
/// 查看合格证
/// </summary>
private void LookCer()
{
if (CertificateModel == null)
{
new TipsWindow("该任务无设置合格证信息,无法查看!").ShowDialog();
return;
}
LookCerWindow lookCerWindow = new LookCerWindow(CertificateModel);
lookCerWindow.Show();
}
/// <summary>
/// 查看条形码
/// </summary>
private void LookBar()
{
if (BarCodeModel == null)
{
new TipsWindow("该任务无设置条形码信息,无法查看!").ShowDialog();
return;
}
LookBarCodeWindow look = new LookBarCodeWindow();
look.SetData(new BarCodeModel
2 years ago
{
Brand = BarCodeModel.Brand,
BrandName = BarCodeModel.BrandName,
LabelModel = BarCodeModel.LabelModel,
ProductNo = BarCodeModel.ProductNo,
SkuId = BarCodeModel.SkuId,
SkuName = BarCodeModel.SkuName
});
look.Show();
}
private void PrintCer()
{
if (CertificateModel == null)
{
2 years ago
new TipsWindow("该任务无设置合格证信息,无法打印!").Show();
2 years ago
return;
}
PrintWindow printWindow = new PrintWindow();
2 years ago
2 years ago
printWindow.CertificateModel = certificateModel;
2 years ago
printWindow.LoadData();
2 years ago
//printWindow.Datas = LoadCerLabelModels();
2 years ago
printWindow.Show();
}
/// <summary>
/// 打印条形码
/// </summary>
private void PrintBarcode()
{
if (BarCodeModel == null)
{
2 years ago
new TipsWindow("该任务无设置条形码信息,无法打印!").Show();
2 years ago
return;
}
2 years ago
PrintWindow printWindow = new PrintWindow();
printWindow.BarCodeModel = new BarCodeModel
2 years ago
{
Brand = BarCodeModel.Brand,
BrandName = BarCodeModel.BrandName,
LabelModel = BarCodeModel.LabelModel,
ProductNo = BarCodeModel.ProductNo,
SkuId = BarCodeModel.SkuId,
SkuName = BarCodeModel.SkuName
};
printWindow.LoadData();
2 years ago
//printWindow.Datas = LoadBarLabelModels();
2 years ago
printWindow.Show();
}
2 years ago
2 years ago
private DateTime endTime;
/// <summary>
/// 提交时间
/// </summary>
public DateTime EndTime { get => endTime; set { Set(ref endTime, value); } }
private long taskId;
/// <summary>
2 years ago
/// 任务id
2 years ago
/// </summary>
public long TaskId { get => taskId; set { Set(ref taskId, value); } }
private string departmentName;
/// <summary>
/// 部门名称
/// </summary>
public string DepartmentName { get => departmentName; set { Set(ref departmentName, value); } }
private string acceptName;
/// <summary>
/// 对接人
/// </summary>
public string AcceptName { get => acceptName; set { Set(ref acceptName, value); } }
private int skuCount;
/// <summary>
/// sku数量
/// </summary>
public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } }
2 years ago
private Availability availability;
2 years ago
/// <summary>
/// 到货情况(待收货=0,部分收货=1,已到货=2)
/// </summary>
2 years ago
public Availability Availability { get => availability; set { Set(ref availability, value); } }
2 years ago
2 years ago
2 years ago
2 years ago
private TaskState taskState;
2 years ago
/// <summary>
/// 打包仓库任务状态
/// </summary>
2 years ago
public TaskState TaskState { get => taskState; set { Set(ref taskState, value); } }
2 years ago
2 years ago
private PackType packType;
/// <summary>
/// 打包类型(单件=0,多件=1)
/// </summary>
public PackType PackType { get => packType; set { Set(ref packType, value); } }
private int goodsNumber;
/// <summary>
/// 配件数
/// </summary>
public int GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } }
private string skuTitle;
/// <summary>
/// sku配件商品名称
/// </summary>
public string SkuTitle { get => skuTitle; set { Set(ref skuTitle, value); } }
private BasicPack basicPack;
/// <summary>
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
/// </summary>
public BasicPack BasicPack { get => basicPack; set { Set(ref basicPack, value); } }
private string increment1;
/// <summary>
/// 增量1()
/// </summary>
public string Increment1 { get => increment1; set { Set(ref increment1, value); } }
2 years ago
private string positionType;
2 years ago
/// <summary>
/// 落仓(商家仓=0,云仓=1,京仓=2,聚水潭=3)
2 years ago
/// </summary>
2 years ago
public string PositionType { get => positionType; set { Set(ref positionType, value); } }
2 years ago
#region 条形码数据
/// <summary>
/// 条形码id
/// </summary>
public long BarCodeId { get; set; }
/// <summary>
/// 标签模板
/// </summary>
public BarcodeLabelModel LabelModel { get; set; }
private string brand;
/// <summary>
/// 品牌
/// </summary>
public string Brand { get => brand; set { Set(ref brand, value); } }
private string brandName;
/// <summary>
/// 品名
/// </summary>
public string BrandName { get => brandName; set { Set(ref brandName, value); } }
private string producNo;
/// <summary>
/// 货号
/// </summary>
public string ProductNo { get => producNo; set { Set(ref producNo, value); } }
private string skuName;
/// <summary>
/// sku名称
/// </summary>
public string SkuName { get => skuName; set { Set(ref skuName, value); } }
private string skuId;
/// <summary>
/// skuId(条形码号=POP+SkuId)
/// </summary>
public string SkuId { get => skuId; set { Set(ref skuId, value); } }
2 years ago
//private string modelNo;
///// <summary>
///// 型号
///// </summary>
//public string ModelNo { get => modelNo; set { Set(ref modelNo, value); } }
2 years ago
#endregion
private BarCodeModel barCodeModel;
/// <summary>
/// 合格证
/// </summary>
public BarCodeModel BarCodeModel { get => barCodeModel; set { Set(ref barCodeModel, value); } }
2 years ago
private CertificateModel[] certificateModel;
2 years ago
/// <summary>
/// 合格证
/// </summary>
2 years ago
public CertificateModel[] CertificateModel { get => certificateModel; set { Set(ref certificateModel, value); } }
2 years ago
/// <summary>
/// 合格证位置(外部包装=0,产品包装=1)
/// </summary>
private CertificatePosition certificatePosition;
/// <summary>
/// 合格证位置(外部包装=0,产品包装=1)
/// </summary>
public CertificatePosition CertificatePosition { get => certificatePosition; set { Set(ref certificatePosition, value); } }
/// <summary>
/// 注意事项(对接备注)
/// </summary>
private string markMessage;
/// <summary>
/// 注意事项(对接备注)
/// </summary>
public string MarkMessage { get => markMessage; set { Set(ref markMessage, value); } }
/// <summary>
/// 服务收费 (单个任务id 消耗的总费用)
/// </summary>
private decimal feesMoney;
/// <summary>
/// 服务收费 (单个任务id 消耗的总费用)
/// </summary>
public decimal FeesMoney { get => feesMoney; set { Set(ref feesMoney, value); } }
/// <summary>
/// 打包员
/// </summary>
private string packUser;
/// <summary>
/// 打包员
/// </summary>
public string PackUser { get => packUser; set { Set(ref packUser, value); } }
//public FeesItemTypeDTO FeesItemTypeDTO { get; set; }
private FeesItemResponse feesItemResponse;
public FeesItemResponse FeesItemResponse { get => feesItemResponse; set { Set(ref feesItemResponse, value); } }
public IList<SkuMessage> ItemList { get; set; }
2 years ago
public string OrderId { get; set; }
private int? floorDragNumber;
public int? FloorDragNumber { get => floorDragNumber; set { Set(ref floorDragNumber, value); } }
private string qualityRemainTime;
/// <summary>
/// 质检剩余时间
/// </summary>
public string QualityRemainTime { get => qualityRemainTime; set { Set(ref qualityRemainTime, value); } }
private bool isQualityOverTime;
public bool IsQualityOverTime { get => isQualityOverTime; set { Set(ref isQualityOverTime, value); } }
/// <summary>
/// 质检超时时间
/// </summary>
public DateTime? QualityCompletionOverTime { get; set; }
private string packRemainTime;
/// <summary>
/// 打包剩余时间
/// </summary>
public string PackRemainTime { get => packRemainTime; set { Set(ref packRemainTime, value); } }
/// <summary>
/// 打包完成时间(超时时间)
/// </summary>
public DateTime? PackCompletionOverTime { get; set; }
private bool isPackOverTime;
public bool IsPackOverTime { get => isPackOverTime; set { Set(ref isPackOverTime, value); } }
/// <summary>
/// 物流信息
/// </summary>
public List<ExpressOrderResponse> ExpressOrderList { get; set; }
/// <summary>
/// 需求方店铺id
/// </summary>
private string shopName;
/// <summary>
/// 需求方店铺id
/// </summary>
public string ShopName { get => shopName; set { Set(ref shopName, value); } }
private string qualityOverTimeMarkMsg;
/// <summary>
/// 质检超时备注信息
/// </summary>
public string QualityOverTimeMarkMsg { get => qualityOverTimeMarkMsg; set { Set(ref qualityOverTimeMarkMsg, value); } }
private string packOverTimeMarkMsg;
/// <summary>
/// 打包超时备注信息
/// </summary>
public string PackOverTimeMarkMsg { get => packOverTimeMarkMsg; set { Set(ref packOverTimeMarkMsg, value); } }
2 years ago
}
public class SkuMessage : NotifyObject
{
private string skuId;
2 years ago
public string SkuId { get => skuId; set { Set(ref skuId, value); } }
2 years ago
/// <summary>
/// 店铺Sku图链接
/// </summary>
private string logo;
/// <summary>
/// 店铺Sku图链接
/// </summary>
public string Logo { get => logo; set { Set(ref logo, value); } }
/// <summary>
/// 采购Sku名称
/// </summary>
private string skuName;
/// <summary>
/// 采购Sku名称
/// </summary>
public string SkuName { get => skuName; set { Set(ref skuName, value); } }
/// <summary>
/// 货号品名(手写上传)
/// </summary>
private string brandName;
/// <summary>
/// 货号品名(手写上传)
/// </summary>
public string BrandName { get => brandName; set { Set(ref brandName, value); } }
/// <summary>
/// 货号
/// </summary>
private string goodsNo;
/// <summary>
/// 货号
/// </summary>
public string GoodsNo { get => goodsNo; set { Set(ref goodsNo, value); } }
2 years ago
2 years ago
}
}