Browse Source

1

AddValidOverTime
506583276@qq.com 2 years ago
parent
commit
44d0ed4d12
  1. 39
      BBWY.Client/APIServices/QiKu/QualityTaskService.cs
  2. 2
      BBWY.Client/Models/APIModel/Request/CreatePackTaskV2Request.cs
  3. 8
      BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs
  4. 4
      BBWY.Client/Models/APIModel/Request/UpdatePackTaskV2Request.cs
  5. 6
      BBWY.Client/Models/APIModel/Response/PackPurchaseTask/QualityTaskResponse.cs
  6. 16
      BBWY.Client/Models/APIModel/Response/QualityTask/SearchQualityTaskListResponse.cs
  7. 7
      BBWY.Client/Models/Enums.cs
  8. 3
      BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs
  9. 306
      BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs
  10. 119
      BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs
  11. 2
      BBWY.Client/Views/PackTask/WareHouseListControl.xaml
  12. 8
      BBWY.Client/Views/QualityTask/QualityWindow.xaml
  13. 12
      BBWY.Client/Views/QualityTask/QualityWindow.xaml.cs

39
BBWY.Client/APIServices/QiKu/QualityTaskService.cs

@ -1,5 +1,7 @@
using BBWY.Client.Models; using BBWY.Client.Models;
using BBWY.Client.Models.APIModel; using BBWY.Client.Models.APIModel;
using BBWY.Client.Models.APIModel.Request;
using BBWY.Client.Models.APIModel.Response.PackPurchaseTask;
using BBWY.Common.Http; using BBWY.Common.Http;
using BBWY.Common.Models; using BBWY.Common.Models;
using System; using System;
@ -46,18 +48,19 @@ namespace BBWY.Client.APIServices.QiKu
}, null, HttpMethod.Post); }, null, HttpMethod.Post);
} }
public ApiResponse<object> QualityTaskException(long TaskId, TaskExceptionType TaskExceptionType, string RemarkMsg) public ApiResponse<object> QualityTaskException(long TaskId, TaskExceptionType TaskExceptionType, string RemarkMsg)
{ {
return SendRequest<object>(globalContext.QKApiHost, $"api/QualityTask/QualityTaskException", return SendRequest<object>(globalContext.QKApiHost, $"api/QualityTask/QualityTaskException",
new { new
{
TaskId, TaskId,
TaskExceptionType, TaskExceptionType,
RemarkMsg, RemarkMsg,
UserName=globalContext.User.Name UserName = globalContext.User.Name
} }
, null, HttpMethod.Post); , null, HttpMethod.Post);
} }
@ -77,5 +80,35 @@ namespace BBWY.Client.APIServices.QiKu
} }
, null, HttpMethod.Post); , null, HttpMethod.Post);
} }
public ApiResponse<object> SendMsgToPurchaseDepartment(long TaskId, string ModelTitle, string TipMsg)
{
return SendRequest<object>(globalContext.QKApiHost, $"api/QualityTask/SendMsgToPurchaseDepartment",
new
{
TaskId,
ModelTitle,
TipMsg,
UserName = globalContext.User.Name
}
, null, HttpMethod.Post);
}
public ApiResponse<QualityTaskResponse> GetQualityTask(long taskId)
{
return SendRequest<QualityTaskResponse>(globalContext.QKApiHost, $"api/QualityTask/GetQualityTask?taskId={taskId}", null, null, HttpMethod.Post);
}
public ApiResponse<bool> CompeteQualityTask(QualityTaskRequest competeQualityTask)
{
return SendRequest<bool>(globalContext.QKApiHost, $"api/QualityTask/CompeteQualityTask", competeQualityTask, null, HttpMethod.Post);
}
} }
} }

2
BBWY.Client/Models/APIModel/Request/CreatePackTaskV2Request.cs

@ -115,6 +115,8 @@ namespace BBWY.Client.Models.APIModel.Request
/// </summary> /// </summary>
public List<string> WayBillNoList { get; set; } public List<string> WayBillNoList { get; set; }
} }

8
BBWY.Client/Models/APIModel/Request/QualityTaskRequest.cs

@ -93,10 +93,10 @@ namespace BBWY.Client.Models.APIModel.Request
///// </summary> ///// </summary>
//public DateTime? PreCompeteTime { get; set; } //public DateTime? PreCompeteTime { get; set; }
/// <summary> ///// <summary>
/// 地拖摆放编号 ///// 地拖摆放编号
/// </summary> ///// </summary>
public int? FloorDragNumber { get; set; } //public int? FloorDragNumber { get; set; }
} }
} }

4
BBWY.Client/Models/APIModel/Request/UpdatePackTaskV2Request.cs

@ -105,5 +105,9 @@ namespace BBWY.Client.Models.APIModel.Request
/// 绑定快递单号 /// 绑定快递单号
/// </summary> /// </summary>
public List<string> WayBillNoList { get; set; } public List<string> WayBillNoList { get; set; }
/// <summary>
///
/// </summary>
public SaveType? SaveType { get; set; }
} }
} }

6
BBWY.Client/Models/APIModel/Response/PackPurchaseTask/QualityTaskResponse.cs

@ -103,6 +103,12 @@ namespace BBWY.Client.Models.APIModel.Response.PackPurchaseTask
/// 商家自取数 /// 商家自取数
/// </summary> /// </summary>
public int? StoreGetSelfCount { get; set; } public int? StoreGetSelfCount { get; set; }
/// <summary>
/// 是否首次验收
/// </summary>
public bool IsPassInspection { get; set; }
} }
public class WareHourseDTO public class WareHourseDTO
{ {

16
BBWY.Client/Models/APIModel/Response/QualityTask/SearchQualityTaskListResponse.cs

@ -120,15 +120,15 @@ namespace BBWY.Client.Models.APIModel
///// <summary> /// <summary>
///// 条形码数据 /// 条形码数据
///// </summary> /// </summary>
//public BarCodeDTO BarCodeDTO { get; set; } public BarCodeModel BarCodeDTO { get; set; }
///// <summary> /// <summary>
///// 合格证数据 /// 合格证数据
///// </summary> /// </summary>
//public CerDTO[] Cers { get; set; } public CertificateModel[] Cers { get; set; }
/// <summary> /// <summary>
/// 品牌 /// 品牌

7
BBWY.Client/Models/Enums.cs

@ -586,4 +586,11 @@
{ {
= 1, = 2 = 1, = 2
} }
public enum BrandMarkType
{
= 1, = 2, =3
}
} }

3
BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs

@ -897,7 +897,7 @@ namespace BBWY.Client.ViewModels.PackTask
NeedCer = IsNeedCertificateModel == Need., NeedCer = IsNeedCertificateModel == Need.,
DistributionMode = DistributionMode, DistributionMode = DistributionMode,
WayBillNoList = PackTaskExpressList?.Select(p => p.WaybillNo)?.ToList() WayBillNoList = PackTaskExpressList?.Select(p => p.WaybillNo)?.ToList()
}; };
@ -929,6 +929,7 @@ namespace BBWY.Client.ViewModels.PackTask
var updateTaskModel = JsonConvert.DeserializeObject<UpdatePackTaskV2Request>(JsonConvert.SerializeObject(createTaskModel)); var updateTaskModel = JsonConvert.DeserializeObject<UpdatePackTaskV2Request>(JsonConvert.SerializeObject(createTaskModel));
updateTaskModel.TaskId = TaskId; updateTaskModel.TaskId = TaskId;
updateTaskModel.SaveType = SaveType;
res = packTaskService.UpdatePackTaskV2(updateTaskModel); res = packTaskService.UpdatePackTaskV2(updateTaskModel);
} }
else else

306
BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs

@ -33,6 +33,8 @@ using BBWY.Client.Views.QualityTask;
using BBWY.Client.Views.QualityTipWindows; using BBWY.Client.Views.QualityTipWindows;
using System.Windows.Interop; using System.Windows.Interop;
using NPOI.SS.Formula.Functions; using NPOI.SS.Formula.Functions;
using NPOI.SS.Util;
using System.Text;
namespace BBWY.Client.ViewModels.PackTask namespace BBWY.Client.ViewModels.PackTask
{ {
@ -883,141 +885,210 @@ namespace BBWY.Client.ViewModels.PackTask
MessageBox.Show($"查找不到店铺信息, {model.ShopName}"); MessageBox.Show($"查找不到店铺信息, {model.ShopName}");
return; return;
} }
var packTaskRes = qualityTaskService.GetQualityTask(model.TaskId);//获取任务详情
if (packTaskRes == null)
{
MessageBox.Show("网络异常!");
return;
}
if (!packTaskRes.Success || packTaskRes.Data == null)
{
MessageBox.Show(packTaskRes.Msg);
return;
}
if (packTaskRes == null || !packTaskRes.Success) return;
//获取品牌和适用年龄
var skuAttsDetailRes = qualityTaskService.SearchProductAttrsBySkuId(model.SkuId, shop.AppKey, shop.AppSecret, shop.AppToken, shop.Platform); var skuAttsDetailRes = qualityTaskService.SearchProductAttrsBySkuId(model.SkuId, shop.AppKey, shop.AppSecret, shop.AppToken, shop.Platform);
if (skuAttsDetailRes == null || !skuAttsDetailRes.Success) if (skuAttsDetailRes == null || !skuAttsDetailRes.Success)
{ {
MessageBox.Show(skuAttsDetailRes?.Msg); MessageBox.Show(skuAttsDetailRes?.Msg);
return; return;
} }
var skuAttsDetail = skuAttsDetailRes.Data;
var IsPassInspection = packTaskRes.Data.IsPassInspection;
var skuAttsDetail = skuAttsDetailRes.Data;
bool isqualityCer = false; //验收合格证 bool isqualityCer = false; //验收合格证
StringBuilder sb = null;
Need IsNeedCer = Need.;
BrandMarkType markType = BrandMarkType.;
bool? isCer3CValid = null;
new QualityProductWindow("商品合格证情况", "商品包装有合格证信息", "商品包装无合格证信息", (ishaveCer) =>
{
if (ishaveCer)//验收商品 有合格证
{
if (skuAttsDetail.ApplyAge.IsNullOrEmpty() || (skuAttsDetail.IsApplyAgeOver14 != null && skuAttsDetail.IsApplyAgeOver14.Value))//不存在使用年龄 或者适用年龄大于14
{
new QualityProductWindow("商品合格证情况", "商品包装合格证上有品牌信息", "商品包装合格证上无品牌信息", (iscerhavebrand) =>
{
if (iscerhavebrand)
{
new QualityProductWindow("商品合格证情况", $"商品包装合格证上的品牌是{skuAttsDetail.Brand}", $"商品包装合格证上的品牌不是{skuAttsDetail.Brand}", (istruebrand) =>
{
if (!istruebrand)
{
//需要合格证
if (model.CertificateModel == null || !model.CertificateModel.Any())//未配置
{
sb = new StringBuilder();
sb.AppendLine("该任务未配置合格证,商品包装合格证上的品牌与详情页的品牌不符");
if (skuAttsDetail.ApplyAge.IsNullOrEmpty())
sb.Append("详情页未展示适用年龄");
else
sb.Append("详情页展示适用年龄为14岁以上");
sb.Append("请立即配置合格证信息,包装任务已被挂起.");
var res = qualityTaskService.SendMsgToPurchaseDepartment(model.TaskId, "任务未配置合格证", sb.ToString());
if (res.Success)
{
ReflashTask();//刷新任务
}
return;
}
//打印合格证 完全遮盖包装合格证信息
}
isqualityCer = true;//验收合格证完毕
}).ShowDialog();
return;
}
isqualityCer = true;//验收合格证完毕
}).ShowDialog();
}
else
{
new QualityProductWindow("商品合格证情况", "商品包装有合格证信息", "商品包装无合格证信息", (ishaveCer) => if (IsPassInspection)//验收过 跳过询问
{ {
if (ishaveCer)//验收商品 有合格证 isqualityCer = true;
{ return;
if (skuAttsDetail.ApplyAge.IsNullOrEmpty() || (skuAttsDetail.IsApplyAgeOver14 != null && skuAttsDetail.IsApplyAgeOver14.Value))//不存在使用年龄 或者适用年龄大于14 }
{ //todo: 判断是否首次验收 只支持供应链 有采购方案的
//todo: 判断是否首次验收 只支持供应链 有采购方案的 new QualityProductWindow("商品合格证情况", "商品合格证类型有3C标", "商品合格证类型无3C标", (ishave3c) =>
new QualityProductWindow("商品合格证情况", "商品合格证类型有3C标", "商品合格证类型无3C标", (ishave3c) => {
{ if (ishave3c)
if (ishave3c) {
{ sb = new StringBuilder();
//todo: 存配置 只支持供应链 有采购方案的 sb.Append("该任务商品适用年龄为14岁以下,请验证合格证上的3C信息是否有效,包装任务已被挂起.");
var res = qualityTaskService.SendMsgToPurchaseDepartment(model.TaskId, "包装合格证有3C信息且详情页适用年龄小于14岁", sb.ToString());
if (res.Success)
//验收有效性 {
ReflashTask();//刷新任务
new QualityProductWindow("商品合格证情况", "商品合格证类型有3C标", "商品合格证类型无3C标", (iscanuser) => }
{ return;
}
if (iscanuser) else
{ {
isqualityCer = true;//验收正常 //todo:
return; // 通知采购方问题 咨询是否可替款
} // MessageBox.Show("提示采购部门,当前任务详情页展示适用年龄为14岁以下, 实物商品配置的合格证没有3C,咨询是否可替款,任务已挂起");
//当前合格证3c无效 sb = new StringBuilder();
//todo: sb.AppendLine("该任务商品包装有合格证信息");
// 通知采购方问题 咨询是否可替款 sb.Append("详情页展示适用年龄为14岁以下,但是商品包装合格证无3C标");
MessageBox.Show("提示采购部门,当前任务详情页展示适用年龄为14岁以下, 实物商品配置的合格证当前合格证3c无效,任务已挂起"); sb.Append("请立即配置3C类型的合格证信息");
var res = qualityTaskService.SendMsgToPurchaseDepartment(model.TaskId, "包装有合格证信息且详情页适用年龄小于14岁", sb.ToString());
}).ShowDialog(); if (res.Success)
{
ReflashTask();//刷新任务
return; }
} }
//todo:
// 通知采购方问题 咨询是否可替款
MessageBox.Show("提示采购部门,当前任务详情页展示适用年龄为14岁以下, 实物商品配置的合格证没有3C,咨询是否可替款,任务已挂起"); }).ShowDialog();
}
}).ShowDialog(); //验收商品合格证是否有品牌
}
//验收商品合格证是否有品牌 }
else
new QualityProductWindow("商品合格证情况", "商品包装合格证上有品牌信息", "商品包装合格证上无品牌信息", (iscerhavebrand) => {
{ IsNeedCer = Need.;//需要合格证
//需要合格证
if (iscerhavebrand) if (model.CertificateModel == null || !model.CertificateModel.Any())//未配置
{ {
sb = new StringBuilder();
new QualityProductWindow("商品合格证情况", $"商品包装合格证上的品牌是{skuAttsDetail.Brand}", $"商品包装合格证上的品牌不是{skuAttsDetail.Brand}", (istruebrand) => sb.AppendLine("该任务未配置合格证,请立即配置合格证信息");
{ var res1 = qualityTaskService.SendMsgToPurchaseDepartment(model.TaskId, "任务未配置合格证", sb.ToString());
if (!istruebrand) if (res1.Success)
{ {
//需要合格证 ReflashTask();//刷新任务
if (model.CertificateModel == null || !model.CertificateModel.Any())//未配置 }
{ return;
//未配置 todo: 写接口通知采购方问题 }
MessageBox.Show("提示采购部门,当前任务未配置合格证,赶紧配置,任务已挂起");
return; if (skuAttsDetail.ApplyAge.IsNullOrEmpty() || (skuAttsDetail.IsApplyAgeOver14 != null && skuAttsDetail.IsApplyAgeOver14.Value))//不存在使用年龄 或者适用年龄大于14
} {
//打印合格证 完全遮盖包装合格证信息 isqualityCer = true;//验收正常
} return;
isqualityCer = true;//验收合格证完毕 }
}).ShowDialog(); //年龄低于14
}
if (!model.CertificateModel.Any(c => c.LabelModel != CertificateLabelModel.3c))//所有有配置的合格证都是标准3c
}).ShowDialog(); {
} isqualityCer = true;//验收正常
else return;
{ }
//需要合格证 //不存在 3c 通知采购方问题
if (model.CertificateModel == null || !model.CertificateModel.Any())//未配置 // MessageBox.Show("提示采购部门,当前任务配置的合格证没有3C,赶紧配置,任务已挂起");
{
//未配置 todo: 写接口通知采购方问题 sb = new StringBuilder();
MessageBox.Show("提示采购部门,当前任务未配置合格证,赶紧配置,任务已挂起"); sb.AppendLine("该任务商品包装无合格证信息");
return;
} sb.Append("详情页展示适用年龄为14岁以下,");
sb.Append("请立即配置3C类型的合格证信息");
if (skuAttsDetail.ApplyAge.IsNullOrEmpty() || (skuAttsDetail.IsApplyAgeOver14 != null && skuAttsDetail.IsApplyAgeOver14.Value))//不存在使用年龄 或者适用年龄大于14 var res = qualityTaskService.SendMsgToPurchaseDepartment(model.TaskId, "包装无合格证信息且详情页适用年龄小于14岁", sb.ToString());
{ if (res.Success)
isqualityCer = true;//验收正常 {
return; ReflashTask();//刷新任务
} }
//年龄低于14
if (!model.CertificateModel.Any(c => c.LabelModel != CertificateLabelModel.3c))//所有配置的合格证都是标准3c return;
{ }
isqualityCer = true;//验收正常
return; }).ShowDialog();
}
//不存在 3c 通知采购方问题
MessageBox.Show("提示采购部门,当前任务配置的合格证没有3C,赶紧配置,任务已挂起");
return;
}
}).ShowDialog();
if (isqualityCer)//合格证验收完毕 if (isqualityCer)//合格证验收完毕
{ {
bool isqualityBrand = false;
new QualityProductWindow("商品品牌情况", "商品包装有品牌信息", "商品包装无品牌信息", (ishavebrand) => new QualityProductWindow("商品品牌情况", "商品包装有品牌信息", "商品包装无品牌信息", (ishavebrand) =>
{ {
if (ishavebrand && !skuAttsDetail.IsTeamBrand)//有品牌且品牌不是集团的 if (ishavebrand && !skuAttsDetail.IsTeamBrand)//有品牌且品牌不是集团的
{ {
new QualityProductWindow($"商品品牌情况", $"商品包装品牌是{skuAttsDetail.Brand}", $"商品包装品牌不是{skuAttsDetail.Brand}", (istruebrand) => { new QualityProductWindow($"商品品牌情况", $"商品包装品牌是{skuAttsDetail.Brand}", $"商品包装品牌不是{skuAttsDetail.Brand}", (istruebrand) =>
{
if (istruebrand) if (istruebrand)
{ {
//无需贴商标 //无需贴商标
markType = BrandMarkType.;
} }
else else
{ {
markType = BrandMarkType.;
//需覆盖商标 //需覆盖商标
} }
isqualityBrand = true;
}).ShowDialog(); }).ShowDialog();
@ -1025,17 +1096,20 @@ namespace BBWY.Client.ViewModels.PackTask
} }
else else
{ {
isqualityBrand = true;
//需贴商标 //需贴商标
} markType = BrandMarkType.;
}
}).ShowDialog(); }).ShowDialog();
if (isqualityBrand)
{
QualityWindow service = new QualityWindow(model, ReflashTask, IsNeedCer, markType, packTaskRes.Data);
service.Show();
}
QualityWindow service = new QualityWindow(model, ReflashTask);
service.Show();
} }
@ -2116,19 +2190,19 @@ namespace BBWY.Client.ViewModels.PackTask
data.EndTime = item.CreateTime; data.EndTime = item.CreateTime;
data.SkuTitle = item.SkuGoodsTitle; data.SkuTitle = item.SkuGoodsTitle;
data.AcceptName = item.UserName; data.AcceptName = item.UserName;
//if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0)
//{ {
// data.BarCodeModel = item.BarCodeDTO; data.BarCodeModel = item.BarCodeDTO;
// if (data.BarCodeModel.LabelModel == BarcodeLabelModel.无型号模板) if (data.BarCodeModel.LabelModel == BarcodeLabelModel.)
// data.BarCodeModel.LabelModel = BarcodeLabelModel.精简模板; data.BarCodeModel.LabelModel = BarcodeLabelModel.;
//} }
//if (item.Cers != null) if (item.Cers != null)
//{ {
// data.CertificateModel = item.Cers; data.CertificateModel = item.Cers;
//} }
data.ReflashTask = ReflashTask; data.ReflashTask = ReflashTask;
App.Current.Dispatcher.Invoke(new Action(() => App.Current.Dispatcher.Invoke(new Action(() =>

119
BBWY.Client/ViewModels/QualityTask/QualityViewModel.cs

@ -98,14 +98,14 @@ namespace BBWY.Client.ViewModels
public ObservableCollection<string> AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } } public ObservableCollection<string> AvailabilityList { get => availabilityList; set { Set(ref availabilityList, value); } }
private int floorDragNumber; //private int floorDragNumber;
public int FloorDragNumber { get => floorDragNumber; set { Set(ref floorDragNumber, value); } } //public int FloorDragNumber { get => floorDragNumber; set { Set(ref floorDragNumber, value); } }
private ObservableCollection<int> floorDragNumberList = new ObservableCollection<int> //private ObservableCollection<int> floorDragNumberList = new ObservableCollection<int>
{ //{
}; //};
public ObservableCollection<int> FloorDragNumberList { get => floorDragNumberList; set { Set(ref floorDragNumberList, value); } } //public ObservableCollection<int> FloorDragNumberList { get => floorDragNumberList; set { Set(ref floorDragNumberList, value); } }
private ObservableCollection<WareHourseDTO> wareHourseList = new ObservableCollection<WareHourseDTO> { }; private ObservableCollection<WareHourseDTO> wareHourseList = new ObservableCollection<WareHourseDTO> { };
public ObservableCollection<WareHourseDTO> WareHourseList { get => wareHourseList; set { Set(ref wareHourseList, value); } } public ObservableCollection<WareHourseDTO> WareHourseList { get => wareHourseList; set { Set(ref wareHourseList, value); } }
@ -224,6 +224,21 @@ namespace BBWY.Client.ViewModels
public Need IsNeedCertificateModel { get => isNeedCertificateModel; set { Set(ref isNeedCertificateModel, value); } } public Need IsNeedCertificateModel { get => isNeedCertificateModel; set { Set(ref isNeedCertificateModel, value); } }
private BrandMarkType brandMarkType;
/// <summary>
/// 是否需要条形码
/// </summary>
public BrandMarkType BrandMarkType { get => brandMarkType; set { Set(ref brandMarkType, value); } }
private List<BrandMarkType> brandMarkTypeList = new List<BrandMarkType> { BrandMarkType., BrandMarkType., BrandMarkType. };
/// <summary>
/// 是否需要条形码
/// </summary>
public List<BrandMarkType> BrandMarkTypeList { get => brandMarkTypeList; set { Set(ref brandMarkTypeList, value); } }
private BarCodeModel barCodeModel; private BarCodeModel barCodeModel;
/// <summary> /// <summary>
/// 条形码 /// 条形码
@ -405,7 +420,7 @@ namespace BBWY.Client.ViewModels
#region 方法 #region 方法
private void CompeteQualityTask(object obj) private void CompeteQualityTask(object obj)
{ {
if (ArrivalQuantity==null) if (ArrivalQuantity == null)
{ {
MessageBox.Show($"请输入到货数量"); MessageBox.Show($"请输入到货数量");
return; return;
@ -416,11 +431,11 @@ namespace BBWY.Client.ViewModels
return; return;
} }
if (FloorDragNumber <= 0) //if (FloorDragNumber <= 0)
{ //{
MessageBox.Show($"请选择摆放地拖编号"); // MessageBox.Show($"请选择摆放地拖编号");
return; // return;
} //}
if (GoodProductQuantity > ArrivalQuantity) if (GoodProductQuantity > ArrivalQuantity)
{ {
@ -455,11 +470,11 @@ namespace BBWY.Client.ViewModels
IsNeedBar = IsNeedBarCode == Need., IsNeedBar = IsNeedBarCode == Need.,
IsNeedCer = IsNeedCertificateModel == Need., IsNeedCer = IsNeedCertificateModel == Need.,
TaskId = TaskId, TaskId = TaskId,
FloorDragNumber = FloorDragNumber //FloorDragNumber = FloorDragNumber
}; };
if (CreateTime>Convert.ToDateTime("2023-08-21")) if (CreateTime > Convert.ToDateTime("2023-08-21"))
{ {
if (IsNeedBarCode == Need.) if (IsNeedBarCode == Need.)
{ {
@ -497,7 +512,7 @@ namespace BBWY.Client.ViewModels
} }
} }
try try
{ {
var competeRes = packPurchaseTaskService.CompeteQualityTask(request); var competeRes = packPurchaseTaskService.CompeteQualityTask(request);
@ -519,7 +534,7 @@ namespace BBWY.Client.ViewModels
// BarCodeModel.ShopName = OriginShopName; // BarCodeModel.ShopName = OriginShopName;
//} //}
batchPrint.SetData(GoodProductQuantity.Value, batchPrint.SetData(GoodProductQuantity.Value,
PurchaseSkuList.Where(p => p.IsNeedCer&& p.CerDTO!=null && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray() PurchaseSkuList.Where(p => p.IsNeedCer && p.CerDTO != null && p.CerDTO.Id > 0).Select(p => p.CerDTO).ToArray()
, BarCodeModel); , BarCodeModel);
batchPrint.ShowDialog(); batchPrint.ShowDialog();
@ -603,16 +618,16 @@ namespace BBWY.Client.ViewModels
bool isNeedClick = true; bool isNeedClick = true;
if (CreateTime<Convert.ToDateTime("2023-08-21")) if (CreateTime < Convert.ToDateTime("2023-08-21"))
{ {
isNeedClick=false; isNeedClick = false;
} }
else else
{ {
isNeedClick = model.IsSetCertificate; isNeedClick = model.IsSetCertificate;
} }
QualitySetCerWindow setCerWindow = new QualitySetCerWindow(isNeedClick,OrderId); QualitySetCerWindow setCerWindow = new QualitySetCerWindow(isNeedClick, OrderId);
setCerWindow.LoadData(model.IsNeedCer, model.CerDTO, packPurchaseTaskService, spuCertificateModel, IsSetSpuCertificate, saveType); setCerWindow.LoadData(model.IsNeedCer, model.CerDTO, packPurchaseTaskService, spuCertificateModel, IsSetSpuCertificate, saveType);
setCerWindow.SaveResult = (s, PackCerState) => setCerWindow.SaveResult = (s, PackCerState) =>
{ {
@ -660,26 +675,14 @@ namespace BBWY.Client.ViewModels
/// <summary> /// <summary>
/// 搜索 skuId(todo:) /// 搜索 skuId(todo:)
/// </summary> /// </summary>
public void SearchSku(PackTaskModel model) public void LoadData(PackTaskModel model, Need cer, BrandMarkType brandMarkType, QualityTaskResponse qualityTaskResponse)
{ {
CreateTime = model.EndTime;
CreateTime = model.EndTime;
OriginShopName = model.ShopName; OriginShopName = model.ShopName;
// FloorDragNumber = 0;
FloorDragNumber = 0;
PurchaseSkuList = new ObservableCollection<PurchaseSku>(); PurchaseSkuList = new ObservableCollection<PurchaseSku>();
WareHourseList = new ObservableCollection<WareHourseDTO>(); WareHourseList = new ObservableCollection<WareHourseDTO>();
FloorDragNumberList = new ObservableCollection<int>();
for (int i = 0; i < 30; i++)
{
App.Current.Dispatcher.Invoke((Action)(() =>
{
FloorDragNumberList.Add(i + 1);
}));
}
TaskId = model.TaskId; TaskId = model.TaskId;
OrderId = model.OrderId; OrderId = model.OrderId;
SkuId = model.SkuId; SkuId = model.SkuId;
@ -694,10 +697,6 @@ namespace BBWY.Client.ViewModels
SkuTitle = model.SkuTitle; SkuTitle = model.SkuTitle;
BasicPack = model.BasicPack; BasicPack = model.BasicPack;
CertificatePosition = model.CertificatePosition; CertificatePosition = model.CertificatePosition;
//ArrivalQuantity = 0;
//GoodProductQuantity = 0;
IncreateList = new ObservableCollection<IncreateModel>(); IncreateList = new ObservableCollection<IncreateModel>();
string[] increateDatas = model.Increment1?.Split(','); string[] increateDatas = model.Increment1?.Split(',');
bool isSelected = false; bool isSelected = false;
@ -729,46 +728,34 @@ namespace BBWY.Client.ViewModels
ShowMarkMessage = string.Join("\r\n", resShow.Data.Select(d => d.ToString())); ShowMarkMessage = string.Join("\r\n", resShow.Data.Select(d => d.ToString()));
} }
var packTaskRes = packPurchaseTaskService.GetQualityTask(model.TaskId);
StoreGetSelfCount = qualityTaskResponse.StoreGetSelfCount;
if (packTaskRes == null)
{
MessageBox.Show("网络异常!");
return;
}
if (!packTaskRes.Success || packTaskRes.Data == null)
{
MessageBox.Show(packTaskRes.Msg);
return;
}
StoreGetSelfCount = packTaskRes.Data.StoreGetSelfCount;
SkuPurchaseSchemeId = packTaskRes.Data.SkuPurchaseSchemeId; SkuPurchaseSchemeId = qualityTaskResponse.SkuPurchaseSchemeId;
saveType = packTaskRes.Data.SaveType; saveType = qualityTaskResponse.SaveType;
if (saveType == null) if (saveType == null)
{ {
saveType = OrderId.IsNullOrEmpty() ? SaveType.C端 : SaveType.B端; saveType = OrderId.IsNullOrEmpty() ? SaveType.C端 : SaveType.B端;
} }
if (packTaskRes == null || !packTaskRes.Success) return; BarCodeModel = qualityTaskResponse.BarCodeDTO;
BarCodeModel = packTaskRes.Data.BarCodeDTO; IsNeedBarCode = qualityTaskResponse.IsNeedBar ? Need. : Need.;
IsNeedBarCode = packTaskRes.Data.IsNeedBar ? Need. : Need.; IsSetBarCode = qualityTaskResponse.BarCodeDTO == null ? true : false;
IsSetBarCode = packTaskRes.Data.BarCodeDTO == null ? true : false; IsNeedCertificateModel = qualityTaskResponse.IsNeedCer ? Need. : Need.;
IsNeedCertificateModel = packTaskRes.Data.IsNeedCer ? Need. : Need.; if (qualityTaskResponse.WareHourses != null)
if (packTaskRes.Data.WareHourses != null) qualityTaskResponse.WareHourses.ToList().ForEach(w =>
packTaskRes.Data.WareHourses.ToList().ForEach(w =>
{ {
App.Current.Dispatcher.Invoke(new Action(() => App.Current.Dispatcher.Invoke(new Action(() =>
{ {
WareHourseList.Add(w); WareHourseList.Add(w);
})); }));
}); });
WareHourseCount = WareHourseList.Count(); WareHourseCount = WareHourseList.Count();
if (packTaskRes.Data.PurchaseSkus != null) if (qualityTaskResponse.PurchaseSkus != null)
{ {
int goodsIndex = 0; int goodsIndex = 0;
foreach (var item in packTaskRes.Data.PurchaseSkus) foreach (var item in qualityTaskResponse.PurchaseSkus)
{ {
goodsIndex++; goodsIndex++;
if (item.CerDTO != null) item.CerDTO.GoodsNumberIndex = goodsIndex; if (item.CerDTO != null) item.CerDTO.GoodsNumberIndex = goodsIndex;
@ -852,8 +839,12 @@ namespace BBWY.Client.ViewModels
} }
} }
if (cer == Need.)
{
CertificatePosition = CertificatePosition.;
}
BrandMarkType = brandMarkType;
}); });

2
BBWY.Client/Views/PackTask/WareHouseListControl.xaml

@ -270,7 +270,7 @@
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<StackPanel Grid.Column="9" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" <StackPanel Grid.Column="9" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"
Visibility="{Binding TaskState,Converter={StaticResource objConverter},ConverterParameter=未到货|部分到货|待验收:Visible:Collapsed}"
> >
<!-- --> <!-- -->
<c:BButton Command="{Binding UpdateTaskCommand}" Style="{StaticResource LinkButton}" Content="修改" /> <c:BButton Command="{Binding UpdateTaskCommand}" Style="{StaticResource LinkButton}" Content="修改" />

8
BBWY.Client/Views/QualityTask/QualityWindow.xaml

@ -373,8 +373,8 @@
<ColumnDefinition Width="90"/> <ColumnDefinition Width="90"/>
<ColumnDefinition Width="140"/> <ColumnDefinition Width="140"/>
<ColumnDefinition Width="86"/> <ColumnDefinition Width="86"/>
<ColumnDefinition Width="0" /> <ColumnDefinition Width="110" />
<ColumnDefinition Width="100"/> <ColumnDefinition Width="110"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="35"/> <RowDefinition Height="35"/>
@ -400,7 +400,7 @@
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="3" Text="基础包装"/> <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="4" Text="增量耗材"/>
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="5" 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="6" Text="品牌商标"/>
<TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="7" Text="合格证位置"/> <TextBlock Grid.Row="0" Style="{StaticResource middleTextBlock}" Grid.Column="7" Text="合格证位置"/>
@ -445,7 +445,7 @@
</ComboBox> </ComboBox>
</Grid> </Grid>
<Grid Grid.Row="1" Grid.Column="6" > <Grid Grid.Row="1" Grid.Column="6" >
<ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding IsNeedCerList}" Text="{Binding IsNeedCertificateModel,Mode=TwoWay}"> <ComboBox VerticalContentAlignment="Center" BorderThickness="0" Margin="1" ItemsSource="{Binding BrandMarkTypeList}" Text="{Binding BrandMarkType,Mode=TwoWay}">
</ComboBox> </ComboBox>
</Grid> </Grid>

12
BBWY.Client/Views/QualityTask/QualityWindow.xaml.cs

@ -1,6 +1,8 @@
using BBWY.Client.Models; using BBWY.Client.Models;
using BBWY.Client.Models.APIModel.Response.PackPurchaseTask;
using BBWY.Client.ViewModels; using BBWY.Client.ViewModels;
using BBWY.Controls; using BBWY.Controls;
using NPOI.HSSF.Record.Chart;
using System; using System;
namespace BBWY.Client.Views.QualityTask namespace BBWY.Client.Views.QualityTask
@ -10,14 +12,16 @@ namespace BBWY.Client.Views.QualityTask
/// </summary> /// </summary>
public partial class QualityWindow : BWindow public partial class QualityWindow : BWindow
{ {
public QualityWindow(PackTaskModel model,Action ReflashTask) public QualityWindow(PackTaskModel model, Action ReflashTask, Need IsNeedCer, BrandMarkType markType, QualityTaskResponse qualityTaskResponse)
{ {
InitializeComponent(); InitializeComponent();
var qualityViewModel =(QualityViewModel)this.DataContext; var qualityViewModel = (QualityViewModel)this.DataContext;
if (qualityViewModel.ReflashWindow == null) if (qualityViewModel.ReflashWindow == null)
qualityViewModel.ReflashWindow = ReflashTask; qualityViewModel.ReflashWindow = ReflashTask;
qualityViewModel.SearchSku(model); qualityViewModel.LoadData(model, IsNeedCer, markType, qualityTaskResponse);
} }
} }
} }

Loading…
Cancel
Save