53 changed files with 3694 additions and 991 deletions
@ -0,0 +1,118 @@ |
|||
using BBWY.Client.Models; |
|||
using BBWY.Client.Models.APIModel; |
|||
using BBWY.Client.Models.APIModel.Request; |
|||
using BBWY.Client.Models.APIModel.Response.PackPurchaseTask; |
|||
using BBWY.Client.Models.APIModel.Response.PackTask; |
|||
using BBWY.Common.Http; |
|||
using BBWY.Common.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Net.Http; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.APIServices |
|||
{ |
|||
public class PackPurchaseTaskService : BaseApiService, IDenpendency |
|||
{ |
|||
public PackPurchaseTaskService(RestApiService restApiService, GlobalContext globalContext) : base(restApiService, globalContext) |
|||
{ |
|||
} |
|||
public ApiResponse<long> UpdatePurchaseTask(UpdatePurchaseTaskRequest updatePurchaseTaskRequest) |
|||
{ |
|||
return SendRequest<long>(globalContext.QKApiHost, "api/PackPurchaseTask/UpdatePurchaseTask", updatePurchaseTaskRequest, null, HttpMethod.Post); |
|||
} |
|||
|
|||
public ApiResponse<ConfigPackResponse> GetConfigPack(string skuId, string skuPurchaseSchemeId, string orderId) |
|||
{ |
|||
return SendRequest<ConfigPackResponse>(globalContext.QKApiHost, "api/PackPurchaseTask/GetConfigPack", new |
|||
{ |
|||
skuId, |
|||
skuPurchaseSchemeId, |
|||
orderId |
|||
} |
|||
, null, HttpMethod.Post); |
|||
} |
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="orderId"></param>
|
|||
/// <param name="skuId"></param>
|
|||
/// <param name="availability">到货情况(物流状态)(已到货 = 0,部分到货 = 1,未到货 = 2)</param>
|
|||
/// <returns></returns>
|
|||
public ApiResponse<long> UpdateAvailabilityState(string orderId, string skuId, int availability) |
|||
{ |
|||
return SendRequest<long>(globalContext.QKApiHost, "api/PackPurchaseTask/UpdatePurchaseTask", new |
|||
{ |
|||
orderId, |
|||
skuId, |
|||
availability |
|||
}, null, HttpMethod.Post); |
|||
} |
|||
|
|||
public ApiResponse<long> SaveBarCode(BarCodeRequest barCodeModel) |
|||
{ |
|||
return SendRequest<long>(globalContext.QKApiHost, "api/PackTask/CommitBarCode", barCodeModel |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
public ApiResponse<long> SaveCer(CerRequest cerRequest) |
|||
{ |
|||
return SendRequest<long>(globalContext.QKApiHost, "api/Certificate/CommitCerData", cerRequest |
|||
, null, HttpMethod.Post); |
|||
} |
|||
|
|||
|
|||
public ApiResponse<ProductSkuResponse> GetProductSku(string skuId) |
|||
{ |
|||
|
|||
return SendRequest<ProductSkuResponse>(globalContext.QKApiHost, $"api/PackTask/SearchProduct?skuId={skuId}&ShopId={globalContext.User.Shop.ShopId}", null, null, HttpMethod.Get); |
|||
|
|||
} |
|||
|
|||
public ApiResponse<bool> UpdateOrderPackState(string skuId, string orderId) |
|||
{ |
|||
|
|||
return SendRequest<bool>(globalContext.QKApiHost, $"api/PackPurchaseTask/UpdateOrderPackState", new |
|||
{ |
|||
skuId, |
|||
orderId |
|||
}, null, HttpMethod.Post); |
|||
|
|||
} |
|||
|
|||
public ApiResponse<bool> IsExitQikuTask(string skuId, string orderId) |
|||
{ |
|||
|
|||
return SendRequest<bool>(globalContext.QKApiHost, $"api/PackPurchaseTask/IsExitQikuTask", new |
|||
{ |
|||
skuId, |
|||
orderId |
|||
}, null, HttpMethod.Post); |
|||
|
|||
} |
|||
|
|||
public ApiResponse<QualityTaskResponse> GetQualityTask(long taskId) |
|||
{ |
|||
|
|||
return SendRequest<QualityTaskResponse>(globalContext.QKApiHost, $"api/PackPurchaseTask/GetQualityTask?taskId={taskId}", null, null, HttpMethod.Post); |
|||
|
|||
} |
|||
|
|||
public ApiResponse<bool> CompeteQualityTask(QualityTaskRequest competeQualityTask) |
|||
{ |
|||
|
|||
return SendRequest<bool>(globalContext.QKApiHost, $"api/PackPurchaseTask/CompeteQualityTask", competeQualityTask, null, HttpMethod.Post); |
|||
|
|||
} |
|||
|
|||
public ApiResponse<BarCodeModel> SearchBarCode(string skuId) |
|||
{ |
|||
|
|||
return SendRequest<BarCodeModel>(globalContext.QKApiHost, $"api/Barcode/SearchBarCodeBySkuId?skuId={skuId}", null, null, HttpMethod.Get); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,97 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel.Request |
|||
{ |
|||
public class QualityTaskRequest |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 任务id
|
|||
/// </summary>
|
|||
public long TaskId { get; set; } |
|||
/// <summary>
|
|||
/// 拳探订单id
|
|||
/// </summary>
|
|||
public string OrderId { get; set; } |
|||
/// <summary>
|
|||
/// skuid
|
|||
/// </summary>
|
|||
public string SkuId { get; set; } |
|||
/// <summary>
|
|||
/// 备注信息
|
|||
/// </summary>
|
|||
public string MarkMessage { get; set; } |
|||
/// <summary>
|
|||
/// 配件数
|
|||
/// </summary>
|
|||
public int GoodsNumber { get; set; } |
|||
/// <summary>
|
|||
/// sku配件名称
|
|||
/// </summary>
|
|||
public string SkuGoodsTitle { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 增量1()
|
|||
/// </summary>
|
|||
public string Increment1 { get; set; } |
|||
/// <summary>
|
|||
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
|
|||
/// </summary>
|
|||
public BasicPack BasicPack { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 打包类型(单件=0,多件=1)
|
|||
/// </summary>
|
|||
public PackType PackType { get; set; } |
|||
/// <summary>
|
|||
/// 货号品名(手写上传)
|
|||
/// </summary>
|
|||
public string BrandName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 合格证位置(外部包装=0,产品包装=1)
|
|||
/// </summary>
|
|||
public CertificatePosition CertificatePosition { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 合格证id
|
|||
/// </summary>
|
|||
public string CerId { get; set; } |
|||
/// <summary>
|
|||
/// 显示的条码Id
|
|||
/// </summary>
|
|||
public long? BarcodeId { get; set; } |
|||
//public BarCodeDTO BarCodeDTO { get; set; }
|
|||
/// <summary>
|
|||
/// 是否需要合格证
|
|||
/// </summary>
|
|||
public bool IsNeedBar { get; set; } |
|||
/// <summary>
|
|||
/// 是否需要合格证
|
|||
/// </summary>
|
|||
public bool IsNeedCer { get; set; } |
|||
|
|||
///// <summary>
|
|||
///// 配件列表
|
|||
///// </summary>
|
|||
//public PurchaseSku[] PurchaseSkus { get; set; }
|
|||
|
|||
/// <summary>
|
|||
/// 到货数量
|
|||
/// </summary>
|
|||
public int ArrivalQuantity { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 良品数量
|
|||
/// </summary>
|
|||
public int GoodProductQuantity { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 预计完成时间
|
|||
/// </summary>
|
|||
public DateTime? PreCompeteTime { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,139 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel.Request |
|||
{ |
|||
/// <summary>
|
|||
/// 修改采购单任务
|
|||
/// </summary>
|
|||
public class UpdatePurchaseTaskRequest |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// sku数量
|
|||
/// </summary>
|
|||
public int SkuCount { get; set; } |
|||
/// <summary>
|
|||
/// 到货情况(已到货 = 0,部分到货 = 1,未到货 = 2)
|
|||
/// </summary>
|
|||
public int Availability { get; set; } |
|||
/// <summary>
|
|||
/// 落仓(本地仓=0,齐越仓=1,京东仓=2)
|
|||
/// </summary>
|
|||
public int PositionType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 打包类型(单件=0,多件=1)
|
|||
/// </summary>
|
|||
public int PackType { get; set; } |
|||
/// <summary>
|
|||
/// 配件数量
|
|||
/// </summary>
|
|||
public int GoodsNumber { get; set; } |
|||
/// <summary>
|
|||
/// sku配件名称
|
|||
/// </summary>
|
|||
public string SkuGoodsTitle { get; set; } |
|||
/// <summary>
|
|||
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
|
|||
/// </summary>
|
|||
public int BasicPack { get; set; } |
|||
/// <summary>
|
|||
/// 增量耗材
|
|||
/// </summary>
|
|||
public string Increment1 { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 注意事项
|
|||
/// </summary>
|
|||
public string MarkMessage { get; set; } |
|||
|
|||
/// <summary>
|
|||
///条形码Id
|
|||
/// </summary>
|
|||
public long? BarCodeId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 合格证Id 格式: id,id 186,187
|
|||
/// </summary>
|
|||
public string CerId { get; set; } |
|||
/// <summary>
|
|||
/// 是否需要条形码
|
|||
/// </summary>
|
|||
public bool? NeedBar { get; set; } |
|||
/// <summary>
|
|||
/// 是否需要合格证
|
|||
/// </summary>
|
|||
public bool? NeedCer { get; set; } |
|||
/// <summary>
|
|||
/// 合格证位置
|
|||
/// </summary>
|
|||
public int? CertificatePosition { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 加急
|
|||
/// </summary>
|
|||
public int IsWorry { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 拳探订单id
|
|||
/// </summary>
|
|||
public string OrderId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// skuId
|
|||
/// </summary>
|
|||
public string SkuId { get; set; } |
|||
|
|||
#region 更新数据
|
|||
/// <summary>
|
|||
/// 品名
|
|||
/// </summary>
|
|||
public string BrandName { get; set; } |
|||
/// <summary>
|
|||
/// 货号
|
|||
/// </summary>
|
|||
public string ProductNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 图
|
|||
/// </summary>
|
|||
public string Logo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 名称
|
|||
/// </summary>
|
|||
public string SkuName { get; set; } |
|||
/// <summary>
|
|||
/// 品牌
|
|||
/// </summary>
|
|||
public string Brand { get; set; } |
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 采购方案id
|
|||
/// </summary>
|
|||
public string SkuPurchaseSchemeId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 保存 配置商品合格证状态配置信息
|
|||
/// </summary>
|
|||
public PurchaseSkuSpec[] PurchaseSkuSpecs { get; set; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 配置商品合格证状态
|
|||
/// </summary>
|
|||
public class PurchaseSkuSpec |
|||
{ |
|||
/// <summary>
|
|||
/// 商品配件id
|
|||
/// </summary>
|
|||
public string PurchaseSkuId { get; set; } |
|||
/// <summary>
|
|||
/// 合格证配置状态
|
|||
/// </summary>
|
|||
public bool IsNeedCer { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,63 @@ |
|||
using BBWY.Client.Models.APIModel.Response.PackTask; |
|||
using BBWY.Client.Models.QualityTask; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
/// <summary>
|
|||
/// 配置打包信息数据
|
|||
/// </summary>
|
|||
public class ConfigPackResponse |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 配件列表
|
|||
/// </summary>
|
|||
public PurchaseSku[] PurchaseSkus { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 采购方案id
|
|||
/// </summary>
|
|||
public string SkuPurchaseSchemeId { get; set; } |
|||
/// <summary>
|
|||
/// 条形码
|
|||
/// </summary>
|
|||
public BarCodeModel BarCode { get; set; } |
|||
|
|||
public PackConfig PackConfig { get; set; } |
|||
} |
|||
///// <summary>
|
|||
///// 配件sku
|
|||
///// </summary>
|
|||
//public class PurchaseSku
|
|||
//{
|
|||
// /// <summary>
|
|||
// /// 配件图
|
|||
// /// </summary>
|
|||
// public string Logo { get; set; }
|
|||
// /// <summary>
|
|||
// /// 配件商品Id
|
|||
// /// </summary>
|
|||
// public string PurchaseSkuId { get; set; }
|
|||
|
|||
// /// <summary>
|
|||
// /// 配件商品spuId
|
|||
// /// </summary>
|
|||
// public string PurchaseProductId { get; set; }
|
|||
// /// <summary>
|
|||
// /// 配件名称
|
|||
// /// </summary>
|
|||
// public string Title { get; set; }
|
|||
// /// <summary>
|
|||
// /// 是否需要配置合格证
|
|||
// /// </summary>
|
|||
// public bool IsNeedCer { get; set; }
|
|||
|
|||
// /// <summary>
|
|||
// /// 合格证配置信息
|
|||
// /// </summary>
|
|||
// public CertificateModel CerDTO { get; set; }
|
|||
//}
|
|||
} |
@ -0,0 +1,121 @@ |
|||
using BBWY.Client.Models.QualityTask; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel.Response.PackPurchaseTask |
|||
{ |
|||
public class QualityTaskResponse |
|||
{ |
|||
/// <summary>
|
|||
/// 任务id
|
|||
/// </summary>
|
|||
public long Id { get; set; } |
|||
/// <summary>
|
|||
/// 拳探订单id
|
|||
/// </summary>
|
|||
public string OrderId { get; set; } |
|||
/// <summary>
|
|||
/// 备注信息
|
|||
/// </summary>
|
|||
public string MarkMessage { get; set; } |
|||
/// <summary>
|
|||
/// Sku打包数量
|
|||
/// </summary>
|
|||
public int SkuCount { get; set; } |
|||
/// <summary>
|
|||
/// skuid
|
|||
/// </summary>
|
|||
public string SkuId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// sku标题
|
|||
/// </summary>
|
|||
public string SkuName { get; set; } |
|||
/// <summary>
|
|||
/// 采购方案id
|
|||
/// </summary>
|
|||
public string SkuPurchaseSchemeId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 配件数
|
|||
/// </summary>
|
|||
public int GoodsNumber { get; set; } |
|||
/// <summary>
|
|||
/// sku配件名称
|
|||
/// </summary>
|
|||
public string SkuGoodsTitle { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 增量1()
|
|||
/// </summary>
|
|||
public string Increment1 { get; set; } |
|||
/// <summary>
|
|||
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
|
|||
/// </summary>
|
|||
public int BasicPack { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 打包类型(单件=0,多件=1)
|
|||
/// </summary>
|
|||
public int PackType { get; set; } |
|||
/// <summary>
|
|||
/// 货号品名(手写上传)
|
|||
/// </summary>
|
|||
public string BrandName { get; set; } |
|||
/// <summary>
|
|||
/// 货号
|
|||
/// </summary>
|
|||
public string ProductNo { get; set; } |
|||
/// <summary>
|
|||
/// 分箱配置
|
|||
/// </summary>
|
|||
public WareHourseDTO[] WareHourses { get; set; } |
|||
|
|||
|
|||
public BarCodeModel BarCodeDTO { get; set; } |
|||
/// <summary>
|
|||
/// 是否需要合格证
|
|||
/// </summary>
|
|||
public bool IsNeedBar { get; set; } |
|||
/// <summary>
|
|||
/// 是否需要合格证
|
|||
/// </summary>
|
|||
public bool IsNeedCer { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 合格证位置(外部包装=0,产品包装=1)
|
|||
/// </summary>
|
|||
public int? CertificatePosition { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 配件列表
|
|||
/// </summary>
|
|||
public PurchaseSku[] PurchaseSkus { get; set; } |
|||
} |
|||
public class WareHourseDTO |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 序号
|
|||
/// </summary>
|
|||
public int Index { get; set; } |
|||
/// <summary>
|
|||
/// 仓库id
|
|||
/// </summary>
|
|||
public string WareId { get; set; } |
|||
/// <summary>
|
|||
/// 仓库名称
|
|||
/// </summary>
|
|||
public string WareName { get; set; } |
|||
/// <summary>
|
|||
/// 数量
|
|||
/// </summary>
|
|||
public int Count { get; set; } |
|||
/// <summary>
|
|||
/// 仓库类型
|
|||
/// </summary>
|
|||
public WareType? WareType { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,169 @@ |
|||
using BBWY.Client.Models.APIModel.Response.PackPurchaseTask; |
|||
using BBWY.Client.Models.APIModel.Response.PackTask; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.APIModel |
|||
{ |
|||
public class SearchTaskListResponse |
|||
{ |
|||
/// <summary>
|
|||
/// 查询总数据(判断总页数)
|
|||
/// </summary>
|
|||
public int TotalCount { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 页面返回的数据
|
|||
/// </summary>
|
|||
public PackTaskData[] Items { get; set; } |
|||
} |
|||
|
|||
|
|||
public class PackTaskData |
|||
{ |
|||
/// <summary>
|
|||
/// 图片链接
|
|||
/// </summary>
|
|||
public string Logo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务id
|
|||
/// </summary>
|
|||
public long TaskId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 需求方创建日期
|
|||
/// </summary>
|
|||
public DateTime CreateTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务状态
|
|||
/// </summary>
|
|||
public PackTaskState TaskState { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 需求方团队
|
|||
/// </summary>
|
|||
public string DepartmentName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 需求方店铺
|
|||
/// </summary>
|
|||
public string ShopName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 货号
|
|||
/// </summary>
|
|||
public string ProductItemNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 货号品名
|
|||
/// </summary>
|
|||
public string BrandName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 对接人
|
|||
/// </summary>
|
|||
public string UserName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 打包人
|
|||
/// </summary>
|
|||
public string[] PackUserName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// skuid
|
|||
/// </summary>
|
|||
public string SkuId { get; set; } |
|||
/// <summary>
|
|||
/// SKU标题
|
|||
/// </summary>
|
|||
public string SkuName { get; set; } |
|||
/// <summary>
|
|||
/// sku数量
|
|||
/// </summary>
|
|||
public int SkuCount { get; set; } |
|||
/// <summary>
|
|||
/// 打包类型(单件=0,多件=1)
|
|||
/// </summary>
|
|||
public int PackType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 落仓(本地仓=0,齐越仓=1,京东仓=2,聚水潭=3)
|
|||
/// </summary>
|
|||
public string PositionType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
|
|||
/// </summary>
|
|||
public int BasicPack { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 增量1()
|
|||
/// </summary>
|
|||
public string Increment1 { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 到货情况(待收货=0,部分收货=1,已到货=2)
|
|||
/// </summary>
|
|||
public int Availability { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 服务费用数据
|
|||
/// </summary>
|
|||
public FeesItemResponse FeesItemResponse { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 合格证位置(外部包装=0,产品包装=1)
|
|||
/// </summary>
|
|||
public int? CertificatePosition { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// sku配件名称
|
|||
/// </summary>
|
|||
public string SkuGoodsTitle { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 配件数
|
|||
/// </summary>
|
|||
public int GoodsNumber { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 注意事项(对接备注)
|
|||
/// </summary>
|
|||
public string MarkMessage { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 条形码数据
|
|||
/// </summary>
|
|||
public BarCodeModel BarCodeDTO { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 合格证数据
|
|||
/// </summary>
|
|||
public CertificateModel[] Cers { get; set; } |
|||
/// <summary>
|
|||
/// 是否加急
|
|||
/// </summary>
|
|||
public int IsWorry { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 品牌
|
|||
/// </summary>
|
|||
public string Brand { get; set; } |
|||
|
|||
public string OrderId { get; set; } |
|||
|
|||
/// <summary>
|
|||
///分箱情况
|
|||
/// </summary>
|
|||
public WareHourseDTO[] WareHourses { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,56 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 采购Sku基础信息对象
|
|||
/// </summary>
|
|||
public class PurchaseSkuBasicInfoResponse |
|||
{ |
|||
/// <summary>
|
|||
/// 采购SKU基础信息列表
|
|||
/// </summary>
|
|||
public IList<PurchaseSkuItemBasicInfoResponse> ItemList { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 采购商
|
|||
/// </summary>
|
|||
public Purchaser Purchaser { get; set; } |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 采购Sku基础信息对象
|
|||
/// </summary>
|
|||
public class PurchaseSkuItemBasicInfoResponse |
|||
{ |
|||
/// <summary>
|
|||
/// 采购SPU
|
|||
/// </summary>
|
|||
public string PurchaseProductId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 采购SKU
|
|||
/// </summary>
|
|||
public string PurchaseSkuId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 采购SPEC 1688独有属性 下单需要
|
|||
/// </summary>
|
|||
public string PurchaseSkuSpecId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// SKU标题
|
|||
/// </summary>
|
|||
public string Title { get; set; } |
|||
|
|||
public string Logo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 单价
|
|||
/// </summary>
|
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,73 @@ |
|||
using GalaSoft.MvvmLight; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace BBWY.Client.Models.QualityTask |
|||
{ |
|||
/// <summary>
|
|||
/// 配件sku
|
|||
/// </summary>
|
|||
public class PurchaseSku : NotifyObject |
|||
{ |
|||
|
|||
public string PurchaseProductId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 配件图
|
|||
/// </summary>
|
|||
private string logo; |
|||
/// <summary>
|
|||
/// 配件商品Id
|
|||
/// </summary>
|
|||
private string purchaseSkuId; |
|||
/// <summary>
|
|||
/// 配件名称
|
|||
/// </summary>
|
|||
private string title; |
|||
/// <summary>
|
|||
/// 是否需要配置合格证
|
|||
/// </summary>
|
|||
private bool isNeedCer; |
|||
/// <summary>
|
|||
/// 配件图
|
|||
/// </summary>
|
|||
public string Logo { get => logo; set { Set(ref logo, value); } } |
|||
/// <summary>
|
|||
/// 配件商品Id
|
|||
/// </summary>
|
|||
public string PurchaseSkuId { get => purchaseSkuId; set { Set(ref purchaseSkuId, value); } } |
|||
/// <summary>
|
|||
/// 配件名称
|
|||
/// </summary>
|
|||
public string Title { get => title; set { Set(ref title, value); } } |
|||
/// <summary>
|
|||
/// 是否需要配置合格证
|
|||
/// </summary>
|
|||
public bool IsNeedCer { get => isNeedCer; set { Set(ref isNeedCer, value); } } |
|||
|
|||
/// <summary>
|
|||
/// 合格证配置信息
|
|||
/// </summary>
|
|||
public CertificateModel cerDTO; |
|||
/// <summary>
|
|||
/// 合格证配置信息
|
|||
/// </summary>
|
|||
public CertificateModel CerDTO { get => cerDTO; set { Set(ref cerDTO, value); } } |
|||
|
|||
private bool isSetCertificate; |
|||
/// <summary>
|
|||
/// 设置显示(合格证)
|
|||
/// </summary>
|
|||
public bool IsSetCertificate |
|||
{ |
|||
get => isSetCertificate; set |
|||
{ |
|||
|
|||
Set(ref isSetCertificate, value); |
|||
//IsNeedCertificateModel = IsSetCertificate ? Need.不需要 : Need.需要;
|
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,745 @@ |
|||
using BBWY.Client.APIServices; |
|||
using BBWY.Client.Models.PackTask; |
|||
using BBWY.Client.Models; |
|||
using BBWY.Client.Views.PackTask; |
|||
using BBWY.Common.Models; |
|||
using GalaSoft.MvvmLight.Command; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Collections.ObjectModel; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Windows.Input; |
|||
using System.Windows; |
|||
using BBWY.Client.Models.QualityTask; |
|||
using BBWY.Client.Views.QualityTask; |
|||
using BBWY.Client.Models.APIModel.Response.PackPurchaseTask; |
|||
using NPOI.Util.ArrayExtensions; |
|||
using System.Threading.Tasks; |
|||
using Org.BouncyCastle.Asn1.Crmf; |
|||
using System.Runtime.InteropServices.WindowsRuntime; |
|||
using NPOI.Util; |
|||
using BBWY.Controls; |
|||
|
|||
namespace BBWY.Client.ViewModels |
|||
{ |
|||
public class QualityViewModel : BaseVM, IDenpendency |
|||
{ |
|||
#region 属性
|
|||
|
|||
|
|||
public int goodProductQuantity; |
|||
public int arrivalQuantity; |
|||
|
|||
/// <summary>
|
|||
/// 到货数量
|
|||
/// </summary>
|
|||
public int ArrivalQuantity { get => arrivalQuantity; set { Set(ref arrivalQuantity, value); } } |
|||
|
|||
/// <summary>
|
|||
/// 良品数量
|
|||
/// </summary>
|
|||
public int GoodProductQuantity { get => goodProductQuantity; set { Set(ref goodProductQuantity, value); } } |
|||
|
|||
/// <summary>
|
|||
/// 预计完成时间
|
|||
/// </summary>
|
|||
public DateTime? PreCompeteTime { get; set; } |
|||
|
|||
private ObservableCollection<PurchaseSku> purchaseSkuList; |
|||
public ObservableCollection<PurchaseSku> PurchaseSkuList { get => purchaseSkuList; set { Set(ref purchaseSkuList, value); } } |
|||
|
|||
private string searchSkuId; |
|||
public string SearchSkuId { get => searchSkuId; set { Set(ref searchSkuId, value); } } |
|||
|
|||
// public long TaskId { get; set; }
|
|||
//private bool isSelected;
|
|||
//public bool IsSelected { get => isSelected; set { Set(ref isSelected, value); } }
|
|||
|
|||
private ObservableCollection<string> worryList = new ObservableCollection<string> { |
|||
"否","是" |
|||
}; |
|||
public ObservableCollection<string> WorryList { get => worryList; set { Set(ref worryList, value); } } |
|||
|
|||
private ObservableCollection<string> positionTypeList = new ObservableCollection<string> { |
|||
"商家仓","齐越仓", "京东仓","聚水潭仓"}; |
|||
public ObservableCollection<string> PositionTypeList { get => positionTypeList; set { Set(ref positionTypeList, value); } } |
|||
|
|||
private ObservableCollection<string> packTypeList = new ObservableCollection<string> { |
|||
"单件","多件" |
|||
}; |
|||
public ObservableCollection<string> PackTypeList { get => packTypeList; set { Set(ref packTypeList, value); } } |
|||
|
|||
private ObservableCollection<string> basicPackList = new ObservableCollection<string> { |
|||
"快递袋","纸箱","麻袋" |
|||
}; |
|||
public ObservableCollection<string> BasicPackList { get => basicPackList; set { Set(ref basicPackList, value); } } |
|||
|
|||
private ObservableCollection<string> isNeedBarCodeList = new ObservableCollection<string> { |
|||
"需要", "不需要" }; |
|||
public ObservableCollection<string> IsNeedBarCodeList { get => isNeedBarCodeList; set { Set(ref isNeedBarCodeList, value); } } |
|||
|
|||
private ObservableCollection<string> isNeedCerList = new ObservableCollection<string> { |
|||
"需要", "不需要" }; |
|||
public ObservableCollection<string> IsNeedCerList { get => isNeedCerList; set { Set(ref isNeedCerList, value); } } |
|||
|
|||
|
|||
private ObservableCollection<string> certificatePositionList = new ObservableCollection<string> { |
|||
"无","外部包装","产品包装" |
|||
}; |
|||
public ObservableCollection<string> CertificatePositionList { get => certificatePositionList; set { Set(ref certificatePositionList, value); } } |
|||
|
|||
private ObservableCollection<string> availabilityList = new ObservableCollection<string> { |
|||
"已到货","部分到货","未到货" |
|||
}; |
|||
public ObservableCollection<string> AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } } |
|||
|
|||
|
|||
private ObservableCollection<string> preCompeteTimeDayList = new ObservableCollection<string> { |
|||
|
|||
}; |
|||
public ObservableCollection<string> PreCompeteTimeDayList { get => preCompeteTimeDayList; set { Set(ref preCompeteTimeDayList, value); } } |
|||
|
|||
|
|||
private ObservableCollection<string> preCompeteTimeHourList = new ObservableCollection<string> { |
|||
"12点前","18点前","21点前" |
|||
}; |
|||
public ObservableCollection<string> PreCompeteTimeHourList { get => preCompeteTimeHourList; set { Set(ref preCompeteTimeHourList, value); } } |
|||
|
|||
//
|
|||
public string preCompeteTimeDay; |
|||
public string PreCompeteTimeDay { get => preCompeteTimeDay; set { Set(ref preCompeteTimeDay, value); } } |
|||
|
|||
|
|||
|
|||
public string preCompeteTimeHour; |
|||
public string PreCompeteTimeHour { get => preCompeteTimeHour; set { Set(ref preCompeteTimeHour, value); } } |
|||
|
|||
|
|||
private ObservableCollection<WareHourseDTO> wareHourseList = new ObservableCollection<WareHourseDTO> { }; |
|||
public ObservableCollection<WareHourseDTO> WareHourseList { get => wareHourseList; set { Set(ref wareHourseList, value); } } |
|||
|
|||
private int wareHourseCount; |
|||
public int WareHourseCount { get => wareHourseCount; set { Set(ref wareHourseCount, value); } } |
|||
|
|||
|
|||
|
|||
private int skuCount; |
|||
/// <summary>
|
|||
/// Sku任务数
|
|||
/// </summary>
|
|||
public int SkuCount { get => skuCount; set { Set(ref skuCount, value); } } |
|||
|
|||
private string skuId; |
|||
/// <summary>
|
|||
/// Sku
|
|||
/// </summary>
|
|||
public string SkuId { get => skuId; set { Set(ref skuId, value); } } |
|||
|
|||
|
|||
|
|||
public string OrderId { get; set; } |
|||
|
|||
private string logo; |
|||
/// <summary>
|
|||
/// 店铺Sku图链接
|
|||
/// </summary>
|
|||
public string Logo { get => logo; set { Set(ref logo, value); } } |
|||
|
|||
private string skuName; |
|||
/// <summary>
|
|||
/// 采购Sku名称
|
|||
/// </summary>
|
|||
public string SkuName { get => skuName; set { Set(ref skuName, value); } } |
|||
|
|||
private string brand; |
|||
/// <summary>
|
|||
/// 品牌
|
|||
/// </summary>
|
|||
public string Brand { get => brand; set { Set(ref brand, value); } } |
|||
|
|||
|
|||
private string productNo; |
|||
/// <summary>
|
|||
/// 货号
|
|||
/// </summary>
|
|||
public string ProductNo { get => productNo; set { Set(ref productNo, value); } } |
|||
|
|||
private string brandName; |
|||
/// <summary>
|
|||
/// 品名(手写上传)
|
|||
/// </summary>
|
|||
public string BrandName { get => brandName; set { Set(ref brandName, value); } } |
|||
|
|||
|
|||
private int goodsNumber; |
|||
/// <summary>
|
|||
/// 配件数
|
|||
/// </summary>
|
|||
public int GoodsNumber { get => goodsNumber; set { Set(ref goodsNumber, value); } } |
|||
private Worry isWorry; |
|||
/// <summary>
|
|||
/// 是否加急
|
|||
/// </summary>
|
|||
public Worry IsWorry { get => isWorry; set { Set(ref isWorry, value); } } |
|||
|
|||
private TaskState availability; |
|||
/// <summary>
|
|||
/// 到货情况(待收货=0,部分收货=1,已到货=2)
|
|||
/// </summary>
|
|||
public TaskState Availability { get => availability; set { Set(ref availability, value); } } |
|||
|
|||
private PackType packType; |
|||
/// <summary>
|
|||
/// 打包类型(单件=0,多件=1)
|
|||
/// </summary>
|
|||
public PackType PackType { get => packType; set { Set(ref packType, value); } } |
|||
|
|||
private BasicPack basicPack; |
|||
/// <summary>
|
|||
/// 基础包装(快递袋=0,纸箱=1,麻袋=2)
|
|||
/// </summary>
|
|||
public BasicPack BasicPack { get => basicPack; set { Set(ref basicPack, value); } } |
|||
|
|||
private PositionType positionType; |
|||
/// <summary>
|
|||
/// 落仓(商家仓=0,齐越仓=1,京东仓=2,聚水潭仓=3)
|
|||
/// </summary>
|
|||
public PositionType PositionType { get => positionType; set { Set(ref positionType, value); } } |
|||
|
|||
private string skuTitle; |
|||
/// <summary>
|
|||
/// sku配件商品名称
|
|||
/// </summary>
|
|||
public string SkuTitle { get => skuTitle; set { Set(ref skuTitle, value); } } |
|||
|
|||
private Need isNeedBarCode; |
|||
/// <summary>
|
|||
/// 是否需要合格证
|
|||
/// </summary>
|
|||
public Need IsNeedBarCode { get => isNeedBarCode; set { Set(ref isNeedBarCode, value); } } |
|||
|
|||
|
|||
private Need isNeedCertificateModel; |
|||
/// <summary>
|
|||
/// 是否需要条形码
|
|||
/// </summary>
|
|||
public Need IsNeedCertificateModel { get => isNeedCertificateModel; set { Set(ref isNeedCertificateModel, value); } } |
|||
|
|||
|
|||
private BarCodeModel barCodeModel; |
|||
/// <summary>
|
|||
/// 条形码
|
|||
/// </summary>
|
|||
public BarCodeModel BarCodeModel { get => barCodeModel; set { Set(ref barCodeModel, value); } } |
|||
|
|||
|
|||
private bool isSetBarCode; |
|||
/// <summary>
|
|||
/// 设置显示(条形码)
|
|||
/// </summary>
|
|||
public bool IsSetBarCode |
|||
{ |
|||
get => isSetBarCode; |
|||
set |
|||
{ |
|||
|
|||
Set(ref isSetBarCode, value); |
|||
// IsNeedBarCode = IsSetBarCode ? Need.不需要 : Need.需要;
|
|||
} |
|||
} |
|||
|
|||
private bool isSetCertificate; |
|||
/// <summary>
|
|||
/// 设置显示(合格证)
|
|||
/// </summary>
|
|||
public bool IsSetCertificate |
|||
{ |
|||
get => isSetCertificate; set |
|||
{ |
|||
|
|||
Set(ref isSetCertificate, value); |
|||
//IsNeedCertificateModel = IsSetCertificate ? Need.不需要 : Need.需要;
|
|||
} |
|||
} |
|||
private string setSpuCerStatus; |
|||
|
|||
public string SetSpuCerStatus { get => setSpuCerStatus; set { Set(ref setSpuCerStatus, value); } } |
|||
private bool isSetSpuCertificate = true; |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 设置spu显示(合格证)
|
|||
/// </summary>
|
|||
public bool IsSetSpuCertificate |
|||
{ |
|||
get => isSetSpuCertificate; set |
|||
{ |
|||
|
|||
Set(ref isSetSpuCertificate, value); |
|||
SetSpuCerStatus = IsSetSpuCertificate ? "设置spu模板" : "修改spu模板"; |
|||
} |
|||
} |
|||
|
|||
|
|||
private string saveTask; |
|||
|
|||
/// <summary>
|
|||
/// 设置显示(合格证)
|
|||
/// </summary>
|
|||
public string SaveTask { get => saveTask; set { Set(ref saveTask, value); } } |
|||
|
|||
|
|||
private string spuId; |
|||
/// <summary>
|
|||
/// 合格证
|
|||
/// </summary>
|
|||
public string SpuId { get => spuId; set { Set(ref spuId, value); } } |
|||
|
|||
private CertificateModel spuCertificateModel; |
|||
/// <summary>
|
|||
/// spu合格证
|
|||
/// </summary>
|
|||
public CertificateModel SpuCertificateModel { get => spuCertificateModel; set { Set(ref spuCertificateModel, value); } } |
|||
|
|||
|
|||
|
|||
private CertificateModel certificateModel; |
|||
/// <summary>
|
|||
/// 合格证
|
|||
/// </summary>
|
|||
public CertificateModel CertificateModel { get => certificateModel; set { Set(ref certificateModel, value); } } |
|||
|
|||
/// <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); } } |
|||
|
|||
|
|||
private ObservableCollection<IncreateModel> increateList; |
|||
/// <summary>
|
|||
/// 增量耗材查询关键字
|
|||
/// </summary>
|
|||
public ObservableCollection<IncreateModel> IncreateList { get => increateList; set { Set(ref increateList, value); } } |
|||
string[] increates = new string[] { "气泡纸", "气泡袋", "POP袋", "折纸箱", "气泡纸封边", "彩盒", "剪胶", "剪彩带", "快递袋", "收纳盒", "纸箱子", "装纸箱", "封边", "胶带", "折彩盒" }; |
|||
|
|||
PackPurchaseTaskService packPurchaseTaskService; |
|||
PackTaskService packTaskService; |
|||
ProductService productService; |
|||
GlobalContext globalContext; |
|||
private bool isLoading = false; |
|||
public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } |
|||
|
|||
PurchaseService purchaseService; |
|||
public string OriginShopName { get; set; } |
|||
public string SkuPurchaseSchemeId { get; set; } |
|||
public Platform Platform { get; set; } |
|||
public string ShopId { get; set; } |
|||
public long TaskId { get; set; } |
|||
public string UserName { get; set; } |
|||
|
|||
public ICommand SetBarCodeCommand { get; set; } |
|||
public ICommand SetCertificateCommand { get; set; } |
|||
public ICommand LookBarCommand { get; set; } |
|||
public ICommand LookCerCommand { get; set; } |
|||
|
|||
public ICommand OpenSkuDetailCommand { get; set; } |
|||
public ICommand CompeteQualityTaskCommand { get; set; } |
|||
public ICommand SearchSkuCommand { get; set; } |
|||
#endregion
|
|||
|
|||
public QualityViewModel(ProductService productService, GlobalContext globalContext, PackPurchaseTaskService packPurchaseTaskService, PurchaseService purchaseService, PackTaskService packTaskService) |
|||
{ |
|||
this.packPurchaseTaskService = packPurchaseTaskService; |
|||
this.productService = productService; |
|||
this.globalContext = globalContext; |
|||
|
|||
OpenSkuDetailCommand = new RelayCommand<object>(OpenSkuDetail); |
|||
SetBarCodeCommand = new RelayCommand(SetBarCode); |
|||
SetCertificateCommand = new RelayCommand<PurchaseSku>(SetCertificate); |
|||
LookBarCommand = new RelayCommand(LookBar); |
|||
LookCerCommand = new RelayCommand<CertificateModel>(LookCer); |
|||
CompeteQualityTaskCommand = new RelayCommand<object>(CompeteQualityTask); |
|||
IncreateList = new ObservableCollection<IncreateModel>(); |
|||
foreach (var item in increates) |
|||
{ |
|||
IncreateList.Add(new IncreateModel |
|||
{ |
|||
IncreateName = item, |
|||
IsSelected = false |
|||
}); |
|||
} |
|||
|
|||
this.purchaseService = purchaseService; |
|||
this.packTaskService = packTaskService; |
|||
|
|||
} |
|||
|
|||
|
|||
#region 方法
|
|||
private void CompeteQualityTask(object obj) |
|||
{ |
|||
|
|||
|
|||
if (GoodProductQuantity > ArrivalQuantity) |
|||
{ |
|||
MessageBox.Show($"良品数量:{GoodProductQuantity}不能大于到货数量:{ArrivalQuantity}"); |
|||
return; |
|||
} |
|||
|
|||
if (ArrivalQuantity == 0) |
|||
{ |
|||
MessageBox.Show($"到货数量不能:{ArrivalQuantity}!"); |
|||
return; |
|||
} |
|||
|
|||
var request = new Models.APIModel.Request.QualityTaskRequest |
|||
{ |
|||
BasicPack = BasicPack, |
|||
ArrivalQuantity = ArrivalQuantity, |
|||
GoodProductQuantity = GoodProductQuantity, |
|||
Increment1 = string.Join(",", IncreateList.Where(i => i.IsSelected).Select(i => i.IncreateName)), |
|||
BrandName = BrandName, |
|||
CertificatePosition = CertificatePosition, |
|||
MarkMessage = MarkMessage, |
|||
OrderId = OrderId, |
|||
PackType = PackType, |
|||
GoodsNumber = GoodsNumber, |
|||
SkuGoodsTitle = SkuTitle, |
|||
SkuId = SkuId, |
|||
IsNeedBar = IsNeedBarCode == Need.需要, |
|||
IsNeedCer = IsNeedCertificateModel == Need.需要, |
|||
TaskId = TaskId |
|||
}; |
|||
if (IsNeedBarCode == Need.需要) |
|||
{ |
|||
if (BarCodeModel.Id <= 0) |
|||
{ |
|||
MessageBox.Show("条形码不能为空"); |
|||
return; |
|||
} |
|||
request.BarcodeId = BarCodeModel.Id; |
|||
} |
|||
if (IsNeedCertificateModel == Need.需要) |
|||
{ |
|||
if (PurchaseSkuList == null && PurchaseSkuList.Count <= 0) |
|||
{ |
|||
MessageBox.Show("无可用的合格证打印!"); |
|||
return; |
|||
} |
|||
if (PurchaseSkuList.Where(p => p.IsSetCertificate).Count() > 0) |
|||
{ |
|||
MessageBox.Show("存在未确认的合格证,请先完成确认!"); |
|||
return; |
|||
} |
|||
if (PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Count() <= 0) |
|||
{ |
|||
MessageBox.Show("无可选的合格证打印!"); |
|||
return; |
|||
} |
|||
request.CerId = string.Join(",", PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO.Id)); |
|||
|
|||
} |
|||
|
|||
int hour = Convert.ToInt32(PreCompeteTimeHour.Replace("点前", "")); |
|||
|
|||
var date = Convert.ToDateTime(PreCompeteTimeDay); |
|||
|
|||
request.PreCompeteTime = date.AddHours(hour); |
|||
|
|||
|
|||
var competeRes = packPurchaseTaskService.CompeteQualityTask(request); |
|||
if (competeRes == null) |
|||
{ |
|||
MessageBox.Show("网络异常"); |
|||
return; |
|||
} |
|||
if (!competeRes.Success) |
|||
{ |
|||
MessageBox.Show(competeRes.Msg); |
|||
return; |
|||
} |
|||
BatchPrintWindow batchPrint = new BatchPrintWindow(); |
|||
|
|||
batchPrint.SetData(GoodProductQuantity, |
|||
PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray() |
|||
, BarCodeModel); |
|||
|
|||
batchPrint.ShowDialog(); |
|||
|
|||
|
|||
if (ReflashWindow != null) ReflashWindow(); |
|||
var window = obj as BWindow; |
|||
|
|||
window.Close(); |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
private void SetBarCode() |
|||
{ |
|||
if (string.IsNullOrEmpty(SkuId)) |
|||
{ |
|||
return; |
|||
} |
|||
if (BarCodeModel == null) |
|||
{ |
|||
var resCode = packPurchaseTaskService.SearchBarCode(SkuId); |
|||
if (resCode==null) |
|||
{ |
|||
BarCodeModel = new BarCodeModel(); |
|||
BarCodeModel.ProductNo = ProductNo; |
|||
BarCodeModel.Brand = Brand; |
|||
BarCodeModel.SkuId = SkuId; |
|||
BarCodeModel.SkuName = SkuName; |
|||
} |
|||
else |
|||
{ |
|||
BarCodeModel = resCode.Data; |
|||
} |
|||
|
|||
} |
|||
if (!string.IsNullOrEmpty(BrandName)) |
|||
BarCodeModel.BrandName = BrandName; |
|||
|
|||
SetBarCodeWindow setBarCodeWindow = new SetBarCodeWindow(); |
|||
setBarCodeWindow.LoadData(BarCodeModel, packTaskService); |
|||
setBarCodeWindow.SaveResult = b => |
|||
{ |
|||
BarCodeModel = b; |
|||
IsSetBarCode = false; |
|||
IsNeedBarCode = Need.需要; |
|||
}; |
|||
setBarCodeWindow.Show(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 设置合格证
|
|||
/// </summary>
|
|||
private void SetCertificate(PurchaseSku model) |
|||
{ |
|||
|
|||
if (model.CerDTO == null) |
|||
{ |
|||
model.CerDTO = new CertificateModel |
|||
{ |
|||
ProductNo = ProductNo, |
|||
Brand = Brand, |
|||
SkuId = SkuId, |
|||
PurchaseSkuId = model.PurchaseSkuId |
|||
|
|||
}; |
|||
} |
|||
if (!string.IsNullOrEmpty(BrandName)) |
|||
model.CerDTO.BrandName = BrandName; |
|||
|
|||
QualitySetCerWindow setCerWindow = new QualitySetCerWindow(); |
|||
setCerWindow.LoadData(model.IsNeedCer, model.CerDTO, packPurchaseTaskService, spuCertificateModel, IsSetSpuCertificate); |
|||
setCerWindow.SaveResult = (s, PackCerState) => |
|||
{ |
|||
if (string.IsNullOrEmpty(s.PurchaseSkuId)) |
|||
{ |
|||
var sku = PurchaseSkuList.SingleOrDefault(p => p.CerDTO.GoodsNumber == s.GoodsNumber); |
|||
sku.CerDTO = s; |
|||
sku.IsSetCertificate = false; |
|||
sku.IsNeedCer = PackCerState == PackCerState.合格证信息; |
|||
IsNeedCertificateModel = Need.需要; |
|||
return; |
|||
} |
|||
var skus = PurchaseSkuList.SingleOrDefault(p => p.PurchaseSkuId == s.PurchaseSkuId); |
|||
skus.CerDTO = s; |
|||
skus.IsSetCertificate = false; |
|||
skus.IsNeedCer = PackCerState == PackCerState.合格证信息; |
|||
IsNeedCertificateModel = Need.需要; |
|||
}; |
|||
setCerWindow.Show(); |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 查看合格证
|
|||
/// </summary>
|
|||
private void LookCer(CertificateModel certificate) |
|||
{ |
|||
|
|||
QualityLookCerWindow lookCerWindow = new QualityLookCerWindow(certificate); |
|||
lookCerWindow.Show(); |
|||
} |
|||
/// <summary>
|
|||
/// 查看条形码
|
|||
/// </summary>
|
|||
private void LookBar() |
|||
{ |
|||
LookBarCodeWindow look = new LookBarCodeWindow(); |
|||
look.SetData(BarCodeModel); |
|||
look.Show(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 搜索 skuId(todo:)
|
|||
/// </summary>
|
|||
public void SearchSku(PackTaskModel model) |
|||
{ |
|||
InitData(); |
|||
TaskId = model.TaskId; |
|||
OrderId =model.OrderId; |
|||
SkuId = model.SkuId; |
|||
SkuName = model.ItemList[0].SkuName; |
|||
Logo = model.ItemList[0].Logo.Replace("80x80", "200x200").Replace("200x200", "150x150"); |
|||
BrandName = model.ItemList[0].BrandName; |
|||
|
|||
SkuCount = model.SkuCount; |
|||
brand = model.Brand; |
|||
|
|||
ProductNo = model.ProductNo; |
|||
MarkMessage = model.MarkMessage; |
|||
PackType = model.PackType; |
|||
GoodsNumber = model.GoodsNumber; |
|||
SkuTitle = model.SkuTitle; |
|||
BasicPack = model.BasicPack; |
|||
CertificatePosition = model.CertificatePosition; |
|||
|
|||
|
|||
string[] increateDatas = model.Increment1?.Split(','); |
|||
bool isSelected = false; |
|||
foreach (var item in increates) |
|||
{ |
|||
isSelected = false; |
|||
if (increateDatas != null && increateDatas.Count() > 0 && increateDatas.Contains(item)) |
|||
{ |
|||
isSelected = true; |
|||
} |
|||
App.Current.Dispatcher.Invoke(() => |
|||
{ |
|||
IncreateList.Add(new IncreateModel |
|||
{ |
|||
IncreateName = item, |
|||
IsSelected = isSelected |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
|
|||
var packTaskRes = packPurchaseTaskService.GetQualityTask(model.TaskId); |
|||
if (packTaskRes == null || !packTaskRes.Success) return; |
|||
BarCodeModel = packTaskRes.Data.BarCodeDTO; |
|||
IsNeedBarCode = packTaskRes.Data.IsNeedBar ? Need.需要 : Need.不需要; |
|||
IsSetBarCode = packTaskRes.Data.IsNeedBar ? false : true; |
|||
IsNeedCertificateModel = packTaskRes.Data.IsNeedCer ? Need.需要 : Need.不需要; |
|||
if (packTaskRes.Data.WareHourses != null) |
|||
packTaskRes.Data.WareHourses.ToList().ForEach(w => |
|||
{ |
|||
WareHourseList.Add(w); |
|||
}); |
|||
WareHourseCount = WareHourseList.Count(); |
|||
if (packTaskRes.Data.PurchaseSkus != null) |
|||
{ |
|||
|
|||
|
|||
foreach (var item in packTaskRes.Data.PurchaseSkus) |
|||
{ |
|||
item.IsSetCertificate = true; |
|||
if (string.IsNullOrEmpty(item.PurchaseProductId)) |
|||
{ |
|||
PurchaseSkuList.Add(item); continue; |
|||
} |
|||
|
|||
var list = purchaseService.GetPurchaseSkuBasicInfo(item.PurchaseProductId); |
|||
if (list == null&&!list.Success) |
|||
{ |
|||
PurchaseSkuList.Add(item); continue; |
|||
} |
|||
|
|||
var skuItem = list.Data.ItemList.FirstOrDefault(f => f.PurchaseSkuId == item.PurchaseSkuId); |
|||
App.Current.Dispatcher.Invoke(new Action(() => |
|||
{ |
|||
PurchaseSkuList.Add(new PurchaseSku |
|||
{ |
|||
Logo = skuItem.Logo, |
|||
Title = skuItem.Title, |
|||
IsNeedCer = item.IsNeedCer, |
|||
PurchaseSkuId = item.PurchaseSkuId, |
|||
CerDTO = item.CerDTO, |
|||
IsSetCertificate = item.IsSetCertificate, |
|||
}); |
|||
})); |
|||
//PurchaseSkuList.Add(item);
|
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
} |
|||
public Action ReflashWindow { get; set; } |
|||
public void InitData() |
|||
{ |
|||
PurchaseSkuList = new ObservableCollection<PurchaseSku>(); |
|||
WareHourseList = new ObservableCollection<WareHourseDTO>(); |
|||
PreCompeteTimeDayList = new ObservableCollection<string>(); |
|||
|
|||
var date = DateTime.Now.Date; |
|||
for (int i = 0; i < 7; i++) |
|||
{ |
|||
PreCompeteTimeDayList.Add(date.AddDays(i).ToString("yyyy-MM-dd")); |
|||
} |
|||
|
|||
PreCompeteTimeDay = date.ToString("yyyy-MM-dd"); |
|||
|
|||
IsSetBarCode = true; |
|||
SkuTitle = ""; |
|||
BrandName = ""; |
|||
GoodsNumber = 0; |
|||
PackType = PackType.单件; |
|||
BasicPack = BasicPack.快递袋; |
|||
// Availability = (TaskState.)config.Availability;
|
|||
//MarkMessage = config.MarkMessage;
|
|||
CertificatePosition = CertificatePosition.无; |
|||
// Increment1 = config.Increment1;
|
|||
|
|||
IsNeedBarCode = Need.需要; |
|||
IsNeedCertificateModel = Need.不需要; |
|||
} |
|||
|
|||
private void OpenSkuDetail(object param) |
|||
{ |
|||
var paramList = (object[])param; |
|||
// var orderId = paramList[0].ToString();
|
|||
var skuId = paramList[0].ToString(); |
|||
|
|||
|
|||
var url = $"https://item.jd.com/{skuId}.html"; |
|||
try |
|||
{ |
|||
System.Diagnostics.Process.Start("explorer.exe", url); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
Clipboard.SetText(url); |
|||
MessageBox.Show($"{ex.Message}\r\n调用浏览器失败,网页链接已复制到剪切板,请手动打开浏览器访问", "提示"); |
|||
} |
|||
|
|||
} |
|||
|
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,75 @@ |
|||
<c:BWindow x:Class="BBWY.Client.Views.QualityTask.BatchPrintWindow" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:local="clr-namespace:BBWY.Client.Views.QualityTask" |
|||
mc:Ignorable="d" |
|||
Style="{StaticResource bwstyle}" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
Height="300" Width="300" |
|||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
|||
xmlns:ctr="clr-namespace:BBWY.Client.Converters" |
|||
xmlns:cmodel="clr-namespace:BBWY.Client.Models" |
|||
xmlns:sys="clr-namespace:System;assembly=mscorlib" |
|||
CloseButtonVisibility="Visible" |
|||
CloseButtonColor="{StaticResource WindowButtonColor}" |
|||
MinButtonVisibility="Collapsed" |
|||
MaxButtonVisibility="Collapsed" |
|||
RightButtonGroupMargin="0,5,5,0"> |
|||
<!-- DataContext="{Binding CreateSetBarCodeView,Source={StaticResource Locator}}"--> |
|||
<Window.Resources> |
|||
<ResourceDictionary > |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/> |
|||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/> |
|||
|
|||
</ResourceDictionary.MergedDictionaries> |
|||
</ResourceDictionary> |
|||
</Window.Resources> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="30"/> |
|||
<RowDefinition/> |
|||
<RowDefinition Height="40"/> |
|||
</Grid.RowDefinitions> |
|||
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}" |
|||
Background="{StaticResource Border.Background}"> |
|||
<TextBlock Text="打印" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|||
</Border> |
|||
|
|||
<StackPanel Grid.Row="1" Orientation="Vertical" > |
|||
<StackPanel Orientation="Horizontal" Margin=" 50 50 0 0" HorizontalAlignment="Left"> |
|||
<TextBlock Margin="0 0 5 0" VerticalAlignment="Center" HorizontalAlignment="Left" Text="打印机:"/> |
|||
|
|||
<Border BorderBrush="{StaticResource Border.Brush}" VerticalAlignment="Center" BorderThickness="1"> |
|||
<ComboBox x:Name="cbPrints" BorderThickness="0" Height="30" Width="150" VerticalAlignment="Center" HorizontalAlignment="Left" /> |
|||
</Border> |
|||
|
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin=" 50 10 0 0" HorizontalAlignment="Left"> |
|||
|
|||
<TextBlock HorizontalAlignment="Left" Text="良品数量:" Margin="0 0 5 0" /> |
|||
|
|||
<TextBlock Name="goodProductQuantity" HorizontalAlignment="Left" Margin="0 0 5 0" /> |
|||
|
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="50 10 0 0"> |
|||
<TextBlock Text="条形码数量:" VerticalAlignment="Center" Margin="0 0 5 0" /> |
|||
<c:BTextBox Name="barNumber" Width="100" WaterRemark="条形码数量"/> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="50 10 0 0"> |
|||
<TextBlock Text="合格证数量:" VerticalAlignment="Center" Margin="0 0 5 0" /> |
|||
<c:BTextBox Name="cerNumber" Width="100" WaterRemark="合格证数量"/> |
|||
</StackPanel> |
|||
|
|||
</StackPanel> |
|||
|
|||
|
|||
|
|||
|
|||
<Border Grid.Row="2" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Background}" BorderThickness="1"/> |
|||
<c:BButton Background="{StaticResource Button.Background}" Grid.Row="2" Content="打印" HorizontalAlignment="Right" Width="100" VerticalAlignment="Stretch" Click="BButton_Click" |
|||
/> |
|||
</Grid> |
|||
</c:BWindow> |
@ -0,0 +1,210 @@ |
|||
using BBWY.Client.Helpers; |
|||
using BBWY.Client.Models; |
|||
using BBWY.Client.Views.PackTask; |
|||
using BBWY.Controls; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Drawing; |
|||
using System.Drawing.Printing; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Input; |
|||
using System.Windows.Media; |
|||
using System.Windows.Media.Imaging; |
|||
using System.Windows.Shapes; |
|||
|
|||
namespace BBWY.Client.Views.QualityTask |
|||
{ |
|||
/// <summary>
|
|||
/// BatchPrintWindow.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class BatchPrintWindow : BWindow |
|||
{ |
|||
public BatchPrintWindow() |
|||
{ |
|||
InitializeComponent(); |
|||
this.Loaded += BatchPrintWindow_Loaded; |
|||
} |
|||
|
|||
public void SetData(int GoodProductQuantity, CertificateModel[] CertificateModel, BarCodeModel BarCodeModel) |
|||
{ |
|||
this.BarCodeModel = BarCodeModel; |
|||
this.GoodProductQuantity = GoodProductQuantity; |
|||
goodProductQuantity.Text = GoodProductQuantity.ToString(); |
|||
this.CertificateModel = CertificateModel; |
|||
|
|||
this.DataContext = this; |
|||
} |
|||
|
|||
|
|||
|
|||
public CertificateModel[] CertificateModel { get; set; } |
|||
|
|||
public BarCodeModel BarCodeModel { get; set; } |
|||
|
|||
|
|||
public int GoodProductQuantity { get; set; } |
|||
|
|||
private void BatchPrintWindow_Loaded(object sender, RoutedEventArgs e) |
|||
{ |
|||
LoadPrints(); |
|||
} |
|||
/// <summary>
|
|||
/// 获取打印机名称
|
|||
/// </summary>
|
|||
private void LoadPrints() |
|||
{ |
|||
var printingNames = PrinterSettings.InstalledPrinters;//获取本机的打印机数据
|
|||
int index = -1; |
|||
int selectIndex = 0; |
|||
foreach (string name in printingNames) |
|||
{ |
|||
if (name == "Microsoft XPS Document Writer" || name == "Microsoft Print to PDF" || name == "Fax") |
|||
{ |
|||
continue; |
|||
} |
|||
index++; |
|||
if (name.Contains("Deli")) |
|||
{ |
|||
selectIndex = index; |
|||
} |
|||
cbPrints.Items.Add(name); |
|||
} |
|||
if (cbPrints.Items.Count > selectIndex) |
|||
{ |
|||
cbPrints.SelectedIndex = selectIndex; |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
private void PrintData(int printCount, string printName, BarCodeModel barCode = null, CertificateModel certificateModel = null) |
|||
{ |
|||
try |
|||
{ |
|||
|
|||
PrintDocument document = new PrintDocument(); |
|||
document.PrinterSettings.PrinterName = printName;//使用打印机名称,指定特定的打印机进行打印。
|
|||
//设置打印页面
|
|||
//document.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize("Custom", 236, 157);
|
|||
document.PrintPage += (s, a) => |
|||
{ |
|||
Font font = new Font("宋体", 6, System.Drawing.FontStyle.Regular); |
|||
if (barCode != null) |
|||
{ |
|||
MyPrintHelper.PrintBarcode(ref a, barCode, font); |
|||
} |
|||
if (certificateModel != null) |
|||
{ |
|||
MyPrintHelper.PrintCertificate(ref a, certificateModel, font); |
|||
} |
|||
|
|||
}; |
|||
document.PrinterSettings.Copies = (short)printCount;//打印份数
|
|||
document.Print(); |
|||
|
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
App.Current.Dispatcher.Invoke(() => |
|||
{ |
|||
new TipsWindow($"打印失败,{ex.Message}").Show(); |
|||
}); |
|||
|
|||
} |
|||
} |
|||
|
|||
private void Document_PrintPage(object sender, PrintPageEventArgs args) |
|||
{ |
|||
|
|||
Font font = new Font("宋体", 6, System.Drawing.FontStyle.Regular); |
|||
if (BarCodeModel != null) |
|||
{ |
|||
MyPrintHelper.PrintBarcode(ref args, BarCodeModel, font); |
|||
} |
|||
if (CertificateModel != null) |
|||
{ |
|||
foreach (var cer in CertificateModel) |
|||
{ |
|||
MyPrintHelper.PrintCertificate(ref args, cer, font); |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
|
|||
private void BButton_Click(object sender, RoutedEventArgs e) |
|||
{ |
|||
int cerNum = 0, barNum = 0; |
|||
if (!string.IsNullOrEmpty(cerNumber.Text)) |
|||
try |
|||
{ |
|||
cerNum = Convert.ToInt32(cerNumber.Text); |
|||
} |
|||
catch |
|||
{ |
|||
MessageBox.Show("请输入数字"); |
|||
return; |
|||
} |
|||
if (!string.IsNullOrEmpty(barNumber.Text)) |
|||
try |
|||
{ |
|||
barNum = Convert.ToInt32(barNumber.Text); |
|||
} |
|||
catch |
|||
{ |
|||
MessageBox.Show("请输入数字"); |
|||
return; |
|||
} |
|||
|
|||
|
|||
|
|||
if (barNum > 0) |
|||
{ |
|||
if (BarCodeModel == null) |
|||
{ |
|||
MessageBox.Show("未设置条形码模板"); |
|||
return; |
|||
} |
|||
} |
|||
if (cerNum > 0) |
|||
{ |
|||
if (CertificateModel == null || CertificateModel.Count() <= 0) |
|||
{ |
|||
MessageBox.Show("未设置合格证模板"); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
string printName = cbPrints.Text; |
|||
Task.Factory.StartNew(() => |
|||
{ |
|||
|
|||
if (barNum > 0) |
|||
{ |
|||
if (BarCodeModel != null) |
|||
PrintData(barNum, printName, BarCodeModel); |
|||
|
|||
} |
|||
if (cerNum > 0) |
|||
{ |
|||
if (CertificateModel != null && CertificateModel.Count() > 0) |
|||
foreach (var cer in CertificateModel) |
|||
PrintData(cerNum, printName, null, cer); |
|||
} |
|||
|
|||
App.Current.Dispatcher.Invoke(new Action(() => |
|||
{ |
|||
this.Close(); |
|||
})); |
|||
}); |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
<c:BWindow x:Class="BBWY.Client.Views.QualityTask.QualityLookCerWindow" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:local="clr-namespace:BBWY.Client.Views.PackTask" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
mc:Ignorable="d" |
|||
CloseButtonVisibility="Visible" |
|||
CloseButtonColor="{StaticResource WindowButtonColor}" |
|||
MinButtonVisibility="Collapsed" |
|||
MaxButtonVisibility="Collapsed" |
|||
RightButtonGroupMargin="0,5,5,0" |
|||
Title="QualityLookCerWindow" Height="373" Width="386" > |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="40"/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}" |
|||
Background="{StaticResource Border.Background}"> |
|||
<TextBlock Text="查看合格证" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|||
</Border> |
|||
<local:CerControl Grid.Row="1" model="{Binding CertificateModel,Mode=TwoWay}"/> |
|||
</Grid> |
|||
</c:BWindow> |
@ -0,0 +1,31 @@ |
|||
using BBWY.Client.Extensions; |
|||
using BBWY.Client.Models; |
|||
using BBWY.Controls; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Input; |
|||
using System.Windows.Media; |
|||
using System.Windows.Media.Imaging; |
|||
using System.Windows.Shapes; |
|||
|
|||
namespace BBWY.Client.Views.QualityTask |
|||
{ |
|||
/// <summary>
|
|||
/// QualityLookCerWindow.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class QualityLookCerWindow : BWindow |
|||
{ |
|||
public QualityLookCerWindow(CertificateModel certificate) |
|||
{ |
|||
CertificateModel = certificate.Copy(); |
|||
InitializeComponent(); |
|||
this.DataContext = this; |
|||
} |
|||
public CertificateModel CertificateModel { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,166 @@ |
|||
<UserControl x:Class="BBWY.Client.Views.QualityTask.QualitySetCerControl" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:local="clr-namespace:BBWY.Client.Views.QualityTask" |
|||
mc:Ignorable="d" |
|||
xmlns:cmodel="clr-namespace:BBWY.Client.Models" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
d:DesignHeight="300" d:DesignWidth="382"> |
|||
<Grid DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:QualitySetCerControl}}}"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="40"/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<StackPanel Grid.Row="0" Orientation="Horizontal"> |
|||
<RadioButton GroupName="cer" HorizontalAlignment="Left" VerticalContentAlignment="Center" IsChecked="{Binding model.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.标准无3c}}" Checked="RadioButton_Checked" CommandParameter="{x:Static cmodel:CertificateLabelModel.标准无3c}" Content="标准" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/> |
|||
<RadioButton GroupName="cer" HorizontalAlignment="Left" VerticalContentAlignment="Center" IsChecked="{Binding model.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.标准有3c}}" Checked="RadioButton_Checked" CommandParameter="{x:Static cmodel:CertificateLabelModel.标准有3c}" Content="带3c标" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/> |
|||
<RadioButton GroupName="cer" HorizontalAlignment="Left" VerticalContentAlignment="Center" IsChecked="{Binding model.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.无型号}}" Checked="RadioButton_Checked" CommandParameter="{x:Static cmodel:CertificateLabelModel.无型号}" Content="无型号" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/> |
|||
<RadioButton GroupName="cer" HorizontalAlignment="Left" VerticalContentAlignment="Center" IsChecked="{Binding model.LabelModel,Converter={StaticResource enumToBooleanConverter},ConverterParameter={x:Static cmodel:CertificateLabelModel.适用年龄 }}" Checked="RadioButton_Checked" CommandParameter="{x:Static cmodel:CertificateLabelModel.适用年龄}" Content="适用年龄" Margin="10,0,0,0" Height="30" VerticalAlignment="Top"/> |
|||
</StackPanel> |
|||
<DockPanel Grid.Row="1" > |
|||
<Border Visibility="{Binding model.LabelModel,Converter={StaticResource objConverter}, ConverterParameter=无型号:Visible:Collapsed}" BorderBrush="Black" BorderThickness="1" Width="380" Height="298" Margin="1" VerticalAlignment="Top" HorizontalAlignment="Left"> |
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Center" Text="合格证" FontSize="18" Margin="0 10 0 25" /> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="品牌:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0" /> |
|||
<c:BTextBox Height="25" Text="{Binding model.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
<TextBlock Text="品名:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
|
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 10"> |
|||
<TextBlock Text="材质:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.Shader,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left"/> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="执行标准:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" /> |
|||
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Height="25" Text="{Binding model.ExcuteStander,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 10"> |
|||
<TextBlock Text="生产日期:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" /> |
|||
<c:BTextBox WaterRemark="不填则不打印" Height="25" Text="{Binding model.ProduceDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="生产商:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18 0 0 0" /> |
|||
<c:BTextBox Height="25" Text="{Binding model.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 0"> |
|||
<TextBlock Text="地址:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30 0 0 0" /> |
|||
<c:BTextBox TextWrapping ="Wrap" AcceptsReturn="True" Height="44" Text="{Binding model.ProductAdress,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Border> |
|||
<Border Name="shiyongnianling" Visibility="{Binding model.LabelModel,Converter={StaticResource objConverter}, ConverterParameter=适用年龄:Visible:Collapsed}" BorderBrush="Black" BorderThickness="1" Width="380" Height="298" Margin="1" VerticalAlignment="Top" HorizontalAlignment="Left"> |
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Center" Text="合格证" FontSize="18" Margin="0 10 0 25" /> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="品牌:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0" /> |
|||
<c:BTextBox Height="25" Text="{Binding model.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
<TextBlock Text="品名:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
|
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 10"> |
|||
<TextBlock Text="材质:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.Shader,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left"/> |
|||
<TextBlock Text="适用年龄:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6,0,0,0" /> |
|||
<c:BTextBox Height="25" Text="{Binding model.ApplyAge,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="124" VerticalAlignment="Top" HorizontalAlignment="Left"/> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="执行标准:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" /> |
|||
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Height="25" Text="{Binding model.ExcuteStander,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 10"> |
|||
<TextBlock Text="生产日期:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" /> |
|||
<c:BTextBox WaterRemark="不填则不打印" Height="25" Text="{Binding model.ProduceDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="生产商:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18 0 0 0" /> |
|||
<c:BTextBox Height="25" Text="{Binding model.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 0"> |
|||
<TextBlock Text="地址:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30 0 0 0" /> |
|||
<c:BTextBox TextWrapping ="Wrap" AcceptsReturn="True" Height="44" Text="{Binding model.ProductAdress,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Border> |
|||
<Border Visibility="{Binding model.LabelModel,Converter={StaticResource objConverter}, ConverterParameter=标准无3c:Visible:Collapsed}" BorderBrush="Black" BorderThickness="1" Width="380" Height="298" Margin="1" VerticalAlignment="Top" HorizontalAlignment="Left"> |
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock VerticalAlignment="Top" HorizontalAlignment="Center" Text="合格证" FontSize="18" Margin="0 10 0 25" /> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="品牌:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0" /> |
|||
<c:BTextBox Height="25" Text="{Binding model.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
<TextBlock Text="型号:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.ProductNo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 10"> |
|||
<TextBlock Text="品名:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
<TextBlock Text="材质:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.Shader,Mode=TwoWay}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left"/> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="执行标准:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" /> |
|||
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Height="25" Text="{Binding model.ExcuteStander,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 10"> |
|||
<TextBlock Text="生产日期:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" /> |
|||
<c:BTextBox WaterRemark="不填则不打印" Height="25" Text="{Binding model.ProduceDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="生产商:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18 0 0 0" /> |
|||
<c:BTextBox Height="25" Text="{Binding model.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 0"> |
|||
<TextBlock Text="地址:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30 0 0 0" /> |
|||
<c:BTextBox TextWrapping ="Wrap" AcceptsReturn="True" Height="44" Text="{Binding model.ProductAdress,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Border> |
|||
<Border Visibility="{Binding model.LabelModel,Converter={StaticResource objConverter}, ConverterParameter=标准有3c:Visible:Collapsed}" BorderBrush="Black" BorderThickness="1" Width="380" Height="298" Margin="1" VerticalAlignment="Top" HorizontalAlignment="Left"> |
|||
<StackPanel Orientation="Vertical"> |
|||
|
|||
<StackPanel Orientation="Horizontal" > |
|||
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="合格证" FontSize="18" Margin="157 0 70 0" /> |
|||
<Image Source="pack://siteoforigin:,,,/Resources/Images/3c.png" Width="54" Height="40" VerticalAlignment="Top" Margin="0 5 0 0" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 2 0 5"> |
|||
<TextBlock Text="工厂编号:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="203,0,0,0" /> |
|||
<c:BTextBox Text="{Binding model.FactoryNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="25" Width="100" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="品牌:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0" /> |
|||
<c:BTextBox Height="25" Text="{Binding model.Brand,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
<TextBlock Text="型号:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.ProductNo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 10"> |
|||
<TextBlock Text="品名:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.BrandName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
<TextBlock Text="材质:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30,0,0,0"/> |
|||
<c:BTextBox Height="25" Text="{Binding model.Shader,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="126" VerticalAlignment="Top" HorizontalAlignment="Left"/> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="执行标准:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" /> |
|||
<c:BTextBox WaterRemark="如多个标准请使用逗号分隔" Height="25" Text="{Binding model.ExcuteStander,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 10 0 10"> |
|||
<TextBlock Text="生产日期:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="6 0 0 0" /> |
|||
<c:BTextBox WaterRemark="不填则不打印" Height="25" Text="{Binding model.ProduceDate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal"> |
|||
<TextBlock Text="生产商:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18 0 0 0" /> |
|||
<c:BTextBox Height="25" Text="{Binding model.ProductShop,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 5 0 0"> |
|||
<TextBlock Text="地址:" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="30 0 0 0" /> |
|||
<c:BTextBox TextWrapping ="Wrap" AcceptsReturn="True" Height="44" Text="{Binding model.ProductAdress,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Border> |
|||
</DockPanel> |
|||
</Grid> |
|||
</UserControl> |
@ -0,0 +1,64 @@ |
|||
using BBWY.Client.Models; |
|||
using BBWY.Client.Views.PackTask; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Input; |
|||
using System.Windows.Media; |
|||
using System.Windows.Media.Imaging; |
|||
using System.Windows.Navigation; |
|||
using System.Windows.Shapes; |
|||
|
|||
namespace BBWY.Client.Views.QualityTask |
|||
{ |
|||
/// <summary>
|
|||
/// QualitySetCerControl.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class QualitySetCerControl : UserControl |
|||
{ |
|||
public QualitySetCerControl() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
public CertificateModel model |
|||
{ |
|||
get { return (CertificateModel)GetValue(modelProperty); } |
|||
set |
|||
{ |
|||
SetValue(modelProperty, value); |
|||
} |
|||
} |
|||
public static readonly DependencyProperty modelProperty = |
|||
DependencyProperty.Register("model", typeof(CertificateModel), typeof(QualitySetCerControl), new PropertyMetadata(ChangedProperty)); |
|||
|
|||
private static void ChangedProperty(DependencyObject d, DependencyPropertyChangedEventArgs e) |
|||
{ |
|||
//var control = d as CerControl;
|
|||
//var data = e.NewValue as CertificateModel;
|
|||
//if (data != null)
|
|||
//{
|
|||
// control.SetData(data);
|
|||
//}
|
|||
} |
|||
private void RadioButton_Checked(object sender, RoutedEventArgs e) |
|||
{ |
|||
var rabtn = sender as RadioButton; |
|||
if (rabtn != null && rabtn.CommandParameter != null) |
|||
{ |
|||
var labModel = Enum.Parse<CertificateLabelModel>(rabtn.CommandParameter.ToString()); |
|||
model.LabelModel = labModel; |
|||
model.IsLogo = labModel == CertificateLabelModel.标准有3c ? 1 : 0; |
|||
} |
|||
|
|||
var data = e.Source as string; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,53 @@ |
|||
<c:BWindow x:Class="BBWY.Client.Views.QualityTask.QualitySetCerWindow" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
|
|||
xmlns:local ="clr-namespace:BBWY.Client.Views.QualityTask" |
|||
xmlns:cmodel="clr-namespace:BBWY.Client.Models" |
|||
mc:Ignorable="d" |
|||
xmlns:c ="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
CloseButtonVisibility="Visible" |
|||
CloseButtonColor="{StaticResource WindowButtonColor}" |
|||
MinButtonVisibility="Collapsed" |
|||
MaxButtonVisibility="Collapsed" Height="480" Width="383" |
|||
RightButtonGroupMargin="0,5,5,0"> |
|||
<Grid DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:QualitySetCerWindow}}}"> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="40"/> |
|||
<RowDefinition/> |
|||
<RowDefinition Height="40"/> |
|||
</Grid.RowDefinitions> |
|||
<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource MainMenu.BorderBrush}" |
|||
Background="{StaticResource Border.Background}"> |
|||
<TextBlock Text="设置合格证" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|||
</Border> |
|||
|
|||
<Grid Grid.Row="1"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="60"/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="20 10 0 0"> |
|||
<c:BButton Content="合格证信息" Width="100" |
|||
Background="{Binding PackCerState,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=合格证信息:#8080FF:#F2F2F2}" |
|||
Foreground="{Binding PackCerState,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=合格证信息:White:#4A4A4A}" |
|||
Command="{Binding SetPackCerStateCommand}" CommandParameter="{x:Static cmodel:PackCerState.合格证信息}"/> |
|||
<c:BButton Content="无需合格证" Width="100" |
|||
Background="{Binding PackCerState,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=无需合格证:#8080FF:#F2F2F2}" |
|||
Foreground="{Binding PackCerState,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=无需合格证:White:#4A4A4A}" |
|||
Command="{Binding SetPackCerStateCommand}" CommandParameter="{x:Static cmodel:PackCerState.无需合格证}"/> |
|||
</StackPanel> |
|||
|
|||
<Grid Grid.Row="1" Visibility="{Binding PackCerState,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=合格证信息:Visible:Collapsed}"> |
|||
<local:QualitySetCerControl model="{Binding CertificateModel,Mode=TwoWay}"/> |
|||
</Grid> |
|||
|
|||
</Grid> |
|||
<Border Grid.Row="2" Height="1" VerticalAlignment="Top" BorderBrush="{StaticResource Border.Background}" BorderThickness="1"/> |
|||
<c:BButton x:Name="save_btn" Background="{StaticResource Button.Selected.Background}" Grid.Row="2" Content="确认" HorizontalAlignment="Right" Margin="0 0 5 0" Width="100" VerticalAlignment="Stretch" |
|||
Click="save_btn_Click" /> |
|||
</Grid> |
|||
</c:BWindow> |
@ -0,0 +1,137 @@ |
|||
using BBWY.Client.Models.APIModel.Request; |
|||
using BBWY.Client.Models; |
|||
using BBWY.Client.Views.PackTask; |
|||
using GalaSoft.MvvmLight.Command; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using System.Windows; |
|||
using System.Windows.Controls; |
|||
using System.Windows.Data; |
|||
using System.Windows.Documents; |
|||
using System.Windows.Input; |
|||
using System.Windows.Media; |
|||
using System.Windows.Media.Imaging; |
|||
using System.Windows.Shapes; |
|||
using BBWY.Client.Extensions; |
|||
using BBWY.Client.APIServices; |
|||
using BBWY.Controls; |
|||
|
|||
namespace BBWY.Client.Views.QualityTask |
|||
{ |
|||
/// <summary>
|
|||
/// QualitySetCerWindow.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class QualitySetCerWindow : BWindow |
|||
{ |
|||
public QualitySetCerWindow() |
|||
{ |
|||
InitializeComponent(); |
|||
SetPackCerStateCommand = new RelayCommand<PackCerState>(SetPackCerState); |
|||
} |
|||
|
|||
private void SetPackCerState(PackCerState obj) |
|||
{ |
|||
PackCerState = obj; |
|||
} |
|||
|
|||
public void LoadData(bool isNeedCer, CertificateModel CertificateModel, PackPurchaseTaskService packTaskService, CertificateModel SpuCertificateModel, bool IsSetSpuCertificate) |
|||
{ |
|||
this.CertificateModel = CertificateModel.Copy(); |
|||
this.packTaskService = packTaskService; |
|||
PackCerState = isNeedCer ? PackCerState.合格证信息 : PackCerState.无需合格证; |
|||
this.DataContext = this; |
|||
} |
|||
|
|||
public ICommand SetPackCerStateCommand { get; set; } |
|||
|
|||
|
|||
public PackCerState PackCerState |
|||
{ |
|||
get |
|||
{ |
|||
return (PackCerState)GetValue(PackCerStateProperty); |
|||
|
|||
} |
|||
set |
|||
{ |
|||
SetValue(PackCerStateProperty, value); |
|||
|
|||
} |
|||
} |
|||
|
|||
|
|||
public static readonly DependencyProperty PackCerStateProperty = |
|||
DependencyProperty.Register("PackCerState", typeof(PackCerState), typeof(QualitySetCerWindow)); |
|||
|
|||
public bool IsSetSpuCertificate { get; set; } |
|||
public PackPurchaseTaskService packTaskService { get; set; } |
|||
public CertificateModel CertificateModel { get; set; } |
|||
public CertificateModel SpuCertificateModel { get; set; } |
|||
|
|||
public Action<CertificateModel, PackCerState> SaveResult { get; set; } |
|||
|
|||
|
|||
private void save_btn_Click(object sender, RoutedEventArgs e) |
|||
{ |
|||
|
|||
if (PackCerState== PackCerState.无需合格证) |
|||
{ |
|||
if (SaveResult != null) SaveResult(CertificateModel, PackCerState); |
|||
this.Close(); |
|||
return; |
|||
} |
|||
if (string.IsNullOrEmpty(CertificateModel.ExcuteStander) |
|||
|| string.IsNullOrEmpty(CertificateModel.Shader) || string.IsNullOrEmpty(CertificateModel.BrandName) |
|||
|| string.IsNullOrEmpty(CertificateModel.Brand) || string.IsNullOrEmpty(CertificateModel.ProductShop) |
|||
|| string.IsNullOrEmpty(CertificateModel.ProductAdress)) |
|||
{ |
|||
//new TipsWindow("参数出错!请重新填写!").Show();
|
|||
MessageBox.Show("有未填写的参数"); |
|||
return; |
|||
} |
|||
if((CertificateModel.LabelModel== CertificateLabelModel.标准无3c|| CertificateModel.LabelModel == CertificateLabelModel.标准有3c) && string.IsNullOrEmpty( CertificateModel.ProductNo)) |
|||
{ |
|||
MessageBox.Show("型号不能为空"); |
|||
return; |
|||
} |
|||
if ( CertificateModel.LabelModel == CertificateLabelModel.标准有3c && string.IsNullOrEmpty(CertificateModel.FactoryNumber)) |
|||
{ |
|||
MessageBox.Show("工厂编号不能为空"); |
|||
return; |
|||
} |
|||
if (CertificateModel.LabelModel == CertificateLabelModel.适用年龄 && string.IsNullOrEmpty(CertificateModel.ApplyAge)) |
|||
{ |
|||
MessageBox.Show("适用年龄不能为空"); |
|||
return; |
|||
} |
|||
var standers = CertificateModel.ExcuteStander.Split(',', StringSplitOptions.RemoveEmptyEntries); |
|||
var resData = packTaskService.SaveCer(new CerRequest |
|||
{ |
|||
Brand = CertificateModel.Brand, |
|||
BrandName = CertificateModel.BrandName, |
|||
ProductNo = CertificateModel.ProductNo, |
|||
SkuId = CertificateModel.SkuId, |
|||
ExcuteStander = CertificateModel.ExcuteStander, |
|||
LabelModel = (int)CertificateModel.LabelModel, |
|||
FactoryNumber = CertificateModel.FactoryNumber, |
|||
IsLogo = CertificateModel.IsLogo, |
|||
ProductAdress = CertificateModel.ProductAdress, |
|||
ProductShop = CertificateModel.ProductShop, |
|||
Shader = CertificateModel.Shader, |
|||
ApplyAge = CertificateModel.ApplyAge, |
|||
GoodsNumber = CertificateModel.GoodsNumber, |
|||
ProduceDate = CertificateModel.ProduceDate, |
|||
PurchaseSkuId = CertificateModel.PurchaseSkuId, |
|||
}); |
|||
if (resData == null || !resData.Success) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
CertificateModel.Id = resData.Data; |
|||
if (SaveResult != null) SaveResult(CertificateModel, PackCerState); |
|||
this.Close(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,489 @@ |
|||
<c:BWindow x:Class="BBWY.Client.Views.QualityTask.QualityWindow" |
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|||
mc:Ignorable="d" |
|||
xmlns:b="http://schemas.microsoft.com/xaml/behaviors" |
|||
xmlns:hc="https://handyorg.github.io/handycontrol" |
|||
xmlns:c="clr-namespace:BBWY.Controls;assembly=BBWY.Controls" |
|||
CloseButtonVisibility="Visible" |
|||
CloseButtonColor="{StaticResource WindowButtonColor}" |
|||
DataContext="{Binding QualityTask,Source={StaticResource Locator}}" |
|||
MinButtonVisibility="Collapsed" |
|||
MaxButtonVisibility="Collapsed" |
|||
RightButtonGroupMargin="0,5,5,0" |
|||
Height="666" Width="1200"> |
|||
<Window.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/> |
|||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
</ResourceDictionary> |
|||
|
|||
</Window.Resources> |
|||
|
|||
<Grid> |
|||
|
|||
|
|||
|
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="40"/> |
|||
|
|||
<RowDefinition/> |
|||
<RowDefinition Height="40"/> |
|||
</Grid.RowDefinitions> |
|||
<c:RoundWaitProgress Play="{Binding IsLoading}" Panel.ZIndex="999"/> |
|||
<Grid Background="{StaticResource Border.Background}"> |
|||
<TextBlock Text="质检任务信息" VerticalAlignment="Center" HorizontalAlignment="Center" /> |
|||
</Grid> |
|||
<Grid Grid.Row="1"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="190"/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
<Grid Grid.Column="0"> |
|||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center"> |
|||
|
|||
<c:BAsyncImage UrlSource="{Binding Logo}" |
|||
Width="150" Height="150" |
|||
VerticalAlignment="Top" Margin="0 10 0 0" |
|||
Cursor="Hand"> |
|||
<b:Interaction.Triggers> |
|||
<b:EventTrigger EventName="PreviewMouseLeftButtonDown"> |
|||
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"> |
|||
<b:InvokeCommandAction.CommandParameter> |
|||
<MultiBinding Converter="{StaticResource mptConverter}"> |
|||
<Binding Path="SkuId"/> |
|||
</MultiBinding> |
|||
</b:InvokeCommandAction.CommandParameter> |
|||
</b:InvokeCommandAction> |
|||
</b:EventTrigger> |
|||
</b:Interaction.Triggers> |
|||
</c:BAsyncImage> |
|||
|
|||
|
|||
<StackPanel Orientation="Vertical" Width="170"> |
|||
|
|||
<TextBlock Margin="10 10 0 0" TextTrimming="CharacterEllipsis"> |
|||
<TextBlock.ToolTip> |
|||
<ToolTip Style="{StaticResource OrderCouponToolipStyle}"> |
|||
<TextBlock Text="{Binding SkuId}"/> |
|||
</ToolTip> |
|||
</TextBlock.ToolTip> |
|||
<Run Text="SKU:"/> |
|||
<Run Text="{Binding SkuId}"/> |
|||
</TextBlock > |
|||
<TextBlock Margin="10 10 10 10" TextTrimming="CharacterEllipsis"> |
|||
<TextBlock.ToolTip> |
|||
<ToolTip Style="{StaticResource OrderCouponToolipStyle}"> |
|||
<TextBlock Text="{Binding SkuName}"/> |
|||
</ToolTip> |
|||
</TextBlock.ToolTip> |
|||
<Run Text="名称:"/> |
|||
<Run Text="{Binding SkuName}"/> |
|||
</TextBlock > |
|||
<TextBlock Margin="10 0 10 10"> |
|||
<Run Text="货号:"/> |
|||
<Run Text="{Binding ProductNo}"/> |
|||
</TextBlock> |
|||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="10 0 0 10" Height="30"> |
|||
<TextBlock Text="品名:" VerticalAlignment="Center"/> |
|||
<c:BTextBox Text="{Binding BrandName}" Height="30" Width="120" WaterRemark="请输入品名"/> |
|||
|
|||
</StackPanel> |
|||
<StackPanel Margin="10 0 0 10" Orientation="Horizontal"> |
|||
<TextBlock Text="条形码:"/> |
|||
<c:BButton Content="待设置" Style="{StaticResource LinkButton}" Width="35" Height="15" Command="{Binding SetBarCodeCommand}" |
|||
Visibility="{Binding IsSetBarCode, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }" |
|||
/> |
|||
<StackPanel Visibility="{Binding IsSetBarCode, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }" Orientation="Horizontal" HorizontalAlignment="Center" > |
|||
<c:BButton Content="查看" Style="{StaticResource LinkButton}" Width="35" Height="15" Command="{Binding LookBarCommand}"/> |
|||
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Width="35" Height="15" Command="{Binding SetBarCodeCommand}"/> |
|||
</StackPanel > |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Grid> |
|||
<Grid Grid.Column="1"> |
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock Text="任务信息" Margin="20 10" FontSize="13" FontWeight="Bold" HorizontalAlignment="Left" /> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="465"/> |
|||
<ColumnDefinition/> |
|||
</Grid.ColumnDefinitions> |
|||
<StackPanel Orientation="Vertical" Margin="20 10 " HorizontalAlignment="Left"> |
|||
<StackPanel Orientation="Horizontal" Height="30"> |
|||
<TextBlock VerticalAlignment="Center"> |
|||
<Run Text="采购数量:"/> |
|||
<Run Text="{Binding SkuCount}"/> |
|||
</TextBlock> |
|||
<UniformGrid Columns="2" Margin="30 0 0 0"> |
|||
<TextBlock Text="到货数量: " VerticalAlignment="Center"/> |
|||
<c:BTextBox WaterRemark="数量" Text="{Binding ArrivalQuantity}" Height="30"/> |
|||
</UniformGrid> |
|||
<UniformGrid Columns="2" Margin="30 0 0 0"> |
|||
<TextBlock Text="良品数量: " VerticalAlignment="Center"/> |
|||
<c:BTextBox WaterRemark="数量" Text="{Binding GoodProductQuantity}" Height="30"/> |
|||
</UniformGrid> |
|||
|
|||
</StackPanel> |
|||
<StackPanel Orientation="Horizontal" Margin="0 30 0 0" > |
|||
<TextBlock VerticalAlignment="Center" Visibility="{Binding WareHourseCount,Mode=TwoWay,Converter={StaticResource objConverter}, ConverterParameter=0:Collapsed:Visible}" > |
|||
<Run Text="份数:"/> |
|||
<Run Text="{Binding WareHourseCount,Mode=TwoWay}"/> |
|||
</TextBlock> |
|||
<UniformGrid Columns="3" Margin="45 0 0 0" Height="30"> |
|||
<TextBlock Text="预计完成时间: " VerticalAlignment="Center"/> |
|||
<Border BorderBrush="{StaticResource Border.Brush}" Height="30" BorderThickness="1"> |
|||
<hc:ComboBox BorderThickness="0" ItemsSource="{Binding PreCompeteTimeDayList}" SelectedIndex="0" Text="{Binding PreCompeteTimeDay}"> |
|||
|
|||
</hc:ComboBox> |
|||
</Border> |
|||
<Border BorderBrush="{StaticResource Border.Brush}" Height="30" Margin="10 0 0 0" BorderThickness="1"> |
|||
<hc:ComboBox BorderThickness="0" ItemsSource="{Binding PreCompeteTimeHourList}" SelectedIndex="0" Text="{Binding PreCompeteTimeHour}"> |
|||
|
|||
</hc:ComboBox> |
|||
</Border> |
|||
</UniformGrid> |
|||
|
|||
|
|||
</StackPanel> |
|||
</StackPanel> |
|||
<c:BTextBox WaterRemark="打包备注" Text="{Binding MarkMessage,Mode=TwoWay}" Grid.Column="1" Margin="0 5 10 5" Height="80"/> |
|||
</Grid> |
|||
|
|||
<ListBox Grid.Row="2" Grid.ColumnSpan="2" |
|||
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
|||
BorderThickness="1,1,0,1" |
|||
BorderBrush="{StaticResource Border.Brush}" |
|||
ItemsSource="{Binding WareHourseList}" |
|||
Width="Auto" |
|||
Margin="20,0,0,10" |
|||
HorizontalAlignment="Left" |
|||
> |
|||
<ListBox.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<StackPanel Orientation="Horizontal"/> |
|||
</ItemsPanelTemplate> |
|||
</ListBox.ItemsPanel> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<Grid Width="auto" Height="90"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition/> |
|||
<RowDefinition/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
<TextBlock Text="{Binding Index,StringFormat=第\{0\}份}" Style="{StaticResource middleTextBlock}"/> |
|||
<TextBlock Grid.Row="1" Text="{Binding Count}" Style="{StaticResource middleTextBlock}"/> |
|||
<TextBlock Grid.Row="2" Style="{StaticResource middleTextBlock}" Margin="5 0 5 0 "> |
|||
<Run Text="{Binding WareName}"/> |
|||
|
|||
</TextBlock> |
|||
<Border Width="1" Grid.RowSpan="3" HorizontalAlignment="Right" |
|||
Background="{StaticResource Border.Brush}"/> |
|||
<Border Height="1" Background="{StaticResource Border.Brush}" |
|||
VerticalAlignment="Bottom"/> |
|||
<Border Height="1" Background="{StaticResource Border.Brush}" |
|||
VerticalAlignment="Bottom" Grid.Row="1"/> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
|
|||
</ListBox> |
|||
|
|||
|
|||
|
|||
<TextBlock Text="配件商品信息" Margin="20 10 0 10" FontSize="13" FontWeight="Bold" VerticalAlignment="Top" HorizontalAlignment="Left" /> |
|||
<Grid > |
|||
<ListBox x:Name="listbox_order" HorizontalAlignment="Left" |
|||
Height="155" Width="900" Margin="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" |
|||
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
|||
ItemsSource="{Binding PurchaseSkuList,Mode=TwoWay}" |
|||
BorderBrush="{StaticResource Border.Brush}" |
|||
BorderThickness="0" Visibility="{Binding OrderId,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=#null:Collapsed:Visible}" |
|||
Foreground="{StaticResource Text.Color}"> |
|||
<ListBox.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<StackPanel Orientation="Horizontal" IsItemsHost="True"/> |
|||
</ItemsPanelTemplate> |
|||
</ListBox.ItemsPanel> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<Grid |
|||
MinHeight="100"> |
|||
<StackPanel Orientation="Horizontal" Height="150"> |
|||
<c:BAsyncImage UrlSource="{Binding Logo}" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" |
|||
Height="150" Width="150" Stretch="Fill" |
|||
VerticalAlignment="Top" Margin="20 0 0 0" |
|||
Cursor="Hand"> |
|||
<!--<b:Interaction.Triggers> |
|||
<b:EventTrigger EventName="PreviewMouseLeftButtonDown"> |
|||
<b:InvokeCommandAction Command="{Binding DataContext.OpenSkuDetailCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"> |
|||
<b:InvokeCommandAction.CommandParameter> |
|||
<MultiBinding Converter="{StaticResource mptConverter}"> |
|||
<Binding Path="SkuId"/> |
|||
</MultiBinding> |
|||
</b:InvokeCommandAction.CommandParameter> |
|||
</b:InvokeCommandAction> |
|||
</b:EventTrigger> |
|||
</b:Interaction.Triggers>--> |
|||
</c:BAsyncImage> |
|||
<DockPanel VerticalAlignment="Top" Width="190" Height="150"> |
|||
|
|||
<TextBlock Margin="10 10 0 0" DockPanel.Dock="Top" TextTrimming="CharacterEllipsis"> |
|||
<TextBlock.ToolTip> |
|||
<ToolTip Style="{StaticResource OrderCouponToolipStyle}"> |
|||
<TextBlock Text="{Binding PurchaseSkuId}"/> |
|||
</ToolTip> |
|||
</TextBlock.ToolTip> |
|||
<Run Text="配件商品ID:"/> |
|||
<Run Text="{Binding PurchaseSkuId}"/> |
|||
</TextBlock > |
|||
<TextBlock Margin="10 10 0 10" DockPanel.Dock="Top" TextTrimming="CharacterEllipsis"> |
|||
<TextBlock.ToolTip> |
|||
<ToolTip Style="{StaticResource OrderCouponToolipStyle}"> |
|||
<TextBlock Text="{Binding Title}"/> |
|||
</ToolTip> |
|||
</TextBlock.ToolTip> |
|||
<Run Text="SKU名称:"/> |
|||
<Run Text="{Binding Title}"/> |
|||
</TextBlock > |
|||
|
|||
|
|||
<StackPanel Margin="10 0 0 0" Height="25" VerticalAlignment="Bottom" DockPanel.Dock="Bottom" Orientation="Horizontal"> |
|||
<TextBlock Text="合格证:" VerticalAlignment="Center"/> |
|||
|
|||
<StackPanel Orientation="Horizontal" |
|||
Visibility="{Binding IsNeedCer, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }"> |
|||
|
|||
<c:BButton Content="待确认" Style="{StaticResource LinkButton}" Width="35" Height="15" |
|||
Command="{Binding DataContext. SetCertificateCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" |
|||
CommandParameter="{Binding }" |
|||
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }"/> |
|||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" |
|||
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }"> |
|||
<c:BButton Content="查看" Style="{StaticResource LinkButton}" Width="35" Height="15" |
|||
CommandParameter="{Binding PurchaseSkuId}" |
|||
Command="{Binding DataContext. LookCerCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"/> |
|||
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Width="35" Height="15" CommandParameter="{Binding }" |
|||
Command="{Binding DataContext.SetCertificateCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" |
|||
/> |
|||
</StackPanel > |
|||
|
|||
</StackPanel> |
|||
|
|||
|
|||
<StackPanel Orientation="Horizontal" |
|||
Visibility="{Binding IsNeedCer, Converter={StaticResource objConverter}, ConverterParameter=true:Collapsed:Visible }"> |
|||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" |
|||
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }"> |
|||
<c:BButton Content="无需合格证" Style="{StaticResource LinkButton}" Height="15" Margin="5 0 0 0" |
|||
CommandParameter="{Binding PurchaseSkuId}" |
|||
Command="{Binding DataContext. LookCerCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"/> |
|||
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Width="35" Height="15" CommandParameter="{Binding }" |
|||
Command="{Binding DataContext.SetCertificateCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" |
|||
/> |
|||
</StackPanel > |
|||
</StackPanel> |
|||
|
|||
|
|||
|
|||
</StackPanel> |
|||
|
|||
|
|||
|
|||
|
|||
</DockPanel> |
|||
</StackPanel> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
</ListBox> |
|||
|
|||
<ListBox HorizontalAlignment="Left" |
|||
Height="155" Width="900" Margin="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" |
|||
ItemContainerStyle="{StaticResource NoBgListBoxItemStyle}" |
|||
ItemsSource="{Binding PurchaseSkuList,Mode=TwoWay}" |
|||
BorderBrush="{StaticResource Border.Brush}" |
|||
BorderThickness="0" Visibility="{Binding OrderId,Mode=TwoWay,Converter={StaticResource objConverter},ConverterParameter=#null:Visible:Collapsed}" |
|||
Foreground="{StaticResource Text.Color}"> |
|||
<ListBox.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<StackPanel Orientation="Horizontal" IsItemsHost="True"/> |
|||
</ItemsPanelTemplate> |
|||
</ListBox.ItemsPanel> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<Grid |
|||
MinHeight="100"> |
|||
<StackPanel Orientation="Horizontal" Height="150"> |
|||
<Border Margin="20 0 0 0" BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Height="150" Width="150"> |
|||
<StackPanel Orientation="Vertical"> |
|||
<Border BorderBrush="{StaticResource Border.Brush}" BorderThickness="1" Height="30 " Margin="10 50 10 30"> |
|||
<TextBlock Text="{Binding CerDTO.GoodsNumber,StringFormat=配件{0}}" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|||
|
|||
</Border> |
|||
|
|||
<StackPanel Margin="10 0 0 0" Height="25" VerticalAlignment="Bottom" Orientation="Horizontal"> |
|||
<TextBlock Text="合格证: " VerticalAlignment="Center"/> |
|||
|
|||
<StackPanel Orientation="Horizontal" |
|||
Visibility="{Binding IsNeedCer, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }"> |
|||
|
|||
<c:BButton Content="待确认" Style="{StaticResource LinkButton}" Width="35" Height="15" |
|||
Command="{Binding DataContext. SetCertificateCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" |
|||
CommandParameter="{Binding }" |
|||
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=true:Visible:Collapsed }"/> |
|||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" |
|||
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }"> |
|||
<c:BButton Content="查看" Style="{StaticResource LinkButton}" Width="35" Height="15" |
|||
CommandParameter="{Binding CerDTO}" |
|||
Command="{Binding DataContext. LookCerCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"/> |
|||
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Width="35" Height="15" CommandParameter="{Binding }" |
|||
Command="{Binding DataContext.SetCertificateCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" |
|||
/> |
|||
</StackPanel > |
|||
|
|||
</StackPanel> |
|||
|
|||
|
|||
<StackPanel Orientation="Horizontal" |
|||
Visibility="{Binding IsNeedCer, Converter={StaticResource objConverter}, ConverterParameter=true:Collapsed:Visible }"> |
|||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" |
|||
Visibility="{Binding IsSetCertificate, Converter={StaticResource objConverter}, ConverterParameter=false:Visible:Collapsed }"> |
|||
<TextBlock Text="无需合格证" Height="15" Margin="0 0 0 0" |
|||
/> |
|||
<!--<c:BButton Content="无需合格证" Style="{StaticResource LinkButton}" Height="15" Margin="5 0 0 0" |
|||
CommandParameter="{Binding PurchaseSkuId}" |
|||
Command="{Binding DataContext. LookCerCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}"/>--> |
|||
<c:BButton Content="修改" Style="{StaticResource LinkButton}" Width="35" Height="15" CommandParameter="{Binding }" |
|||
Command="{Binding DataContext.SetCertificateCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}}}" |
|||
/> |
|||
</StackPanel > |
|||
</StackPanel> |
|||
|
|||
|
|||
|
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Border> |
|||
|
|||
</StackPanel> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
</ListBox> |
|||
</Grid> |
|||
|
|||
<TextBlock Text="打包配置" FontWeight="Bold" FontSize="13" Margin="20 23 0 0" HorizontalAlignment="Left" VerticalAlignment="Top"/> |
|||
<Grid Height="70" Margin="20 20 20 0"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="77"/> |
|||
<ColumnDefinition Width="77"/> |
|||
<ColumnDefinition MinWidth="77"/> |
|||
<ColumnDefinition Width="90"/> |
|||
<ColumnDefinition Width="140"/> |
|||
<ColumnDefinition Width="86"/> |
|||
<ColumnDefinition Width="86"/> |
|||
<ColumnDefinition Width="100"/> |
|||
</Grid.ColumnDefinitions> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="35"/> |
|||
<RowDefinition/> |
|||
</Grid.RowDefinitions> |
|||
<Border Grid.Row="0" Grid.ColumnSpan="8" VerticalAlignment="Top" Height="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.Row="0" Grid.ColumnSpan="8" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.Row="1" Grid.ColumnSpan="8" VerticalAlignment="Bottom" Height="1" Background="{StaticResource Border.Brush}"/> |
|||
|
|||
<Border Grid.RowSpan="2" Grid.Column="0" HorizontalAlignment="Left" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.RowSpan="2" Grid.Column="0" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.RowSpan="2" Grid.Column="1" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.RowSpan="2" Grid.Column="2" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.RowSpan="2" Grid.Column="3" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.RowSpan="2" Grid.Column="4" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.RowSpan="2" Grid.Column="5" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.RowSpan="2" Grid.Column="6" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
<Border Grid.RowSpan="2" Grid.Column="7" HorizontalAlignment="Right" Width="1" Background="{StaticResource Border.Brush}"/> |
|||
|
|||
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="0" Text="组合类型"/> |
|||
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="1" Text="配件数量"/> |
|||
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="2" Text="SKU配件商品"/> |
|||
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="3" Text="基础包装"/> |
|||
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="4" Text="增量耗材"/> |
|||
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="5" Text="条码标签"/> |
|||
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="6" Text="合格证"/> |
|||
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="7" Text="合格证位置"/> |
|||
|
|||
|
|||
<Grid Grid.Row="1" Grid.Column="0" > |
|||
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding PackTypeList}" Text="{Binding PackType}" > |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
<c:BTextBox BorderBrush="Transparent" Grid.Row="1" Grid.Column="1" Height="30" Margin="5" Text="{Binding GoodsNumber,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
|||
<c:BTextBox BorderBrush="Transparent" Grid.Row="1" Grid.Column="2" Height="30" Margin="5" Text="{Binding SkuTitle,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
|||
<Grid Grid.Row="1" Grid.Column="3" > |
|||
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding BasicPackList}" Text="{Binding BasicPack}" > |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
|
|||
|
|||
<Grid Grid.Row="1" Grid.Column="4"> |
|||
<hc:CheckComboBox BorderThickness="0" IsTextSearchEnabled="True" ItemsSource="{Binding IncreateList}" |
|||
ShowClearButton="True" |
|||
MinWidth="90" |
|||
Height="25" |
|||
Margin="5,0,5,0"> |
|||
<hc:CheckComboBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<StackPanel Orientation="Horizontal" Margin="5,2.5"> |
|||
<CheckBox Content="{Binding IncreateName}" IsChecked="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
|||
</StackPanel> |
|||
</DataTemplate> |
|||
</hc:CheckComboBox.ItemTemplate> |
|||
<hc:CheckComboBox.ItemContainerStyle> |
|||
<Style TargetType="{x:Type hc:CheckComboBoxItem}" BasedOn="{StaticResource NoBgListBoxItemStyle}"> |
|||
<Setter Property="IsSelected" Value="{Binding IsSelected,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/> |
|||
</Style> |
|||
</hc:CheckComboBox.ItemContainerStyle> |
|||
</hc:CheckComboBox> |
|||
</Grid> |
|||
|
|||
<Grid Grid.Row="1" Grid.Column="5" > |
|||
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding IsNeedBarCodeList}" Text="{Binding IsNeedBarCode,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
<Grid Grid.Row="1" Grid.Column="6" > |
|||
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding IsNeedCerList}" Text="{Binding IsNeedCertificateModel,Mode=TwoWay}"> |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
<Grid Grid.Row="1" Grid.Column="7" > |
|||
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding CertificatePositionList}" Text="{Binding CertificatePosition}"> |
|||
|
|||
</ComboBox> |
|||
</Grid> |
|||
</Grid> |
|||
|
|||
</StackPanel> |
|||
</Grid> |
|||
|
|||
<Border Width="1" Background="{StaticResource Border.Brush}" HorizontalAlignment="Right" /> |
|||
</Grid> |
|||
<Grid Grid.Row="2"> |
|||
|
|||
<c:BButton Content="完成质检" Width="100" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="0,2,19,2" |
|||
Command="{Binding CompeteQualityTaskCommand}" |
|||
CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type c:BWindow}}}" |
|||
Background="{StaticResource Button.Selected.Background}" BorderThickness="0" Foreground="White"/> |
|||
</Grid> |
|||
<Border Height="1" Background="{StaticResource Border.Brush}" Grid.Row="1" VerticalAlignment="Bottom"/> |
|||
</Grid> |
|||
</c:BWindow> |
@ -0,0 +1,16 @@ |
|||
using BBWY.Controls; |
|||
|
|||
|
|||
namespace BBWY.Client.Views.QualityTask |
|||
{ |
|||
/// <summary>
|
|||
/// QualityWindow.xaml 的交互逻辑
|
|||
/// </summary>
|
|||
public partial class QualityWindow : BWindow |
|||
{ |
|||
public QualityWindow() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue