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