From 4b142236e2697168c610d62167eb3640607af43f Mon Sep 17 00:00:00 2001 From: "506583276@qq.com" <506583276@qq.com> Date: Mon, 10 Jul 2023 15:15:07 +0800 Subject: [PATCH] 1 --- .../APIServices/QiKu/PackTaskService.cs | 22 +++---------------- .../Models/BatchPurchase/BatchPublishTask.cs | 6 ++++- .../PackTask/CreatePackTaskViewModel.cs | 6 ++++- .../PackTask/PublishTaskViewModel.cs | 22 +++++++++++-------- .../ViewModels/PackTask/TaskListViewModel.cs | 4 +++- .../PackTask/WareHouseListViewModel.cs | 6 +++-- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/BBWY.Client/APIServices/QiKu/PackTaskService.cs b/BBWY.Client/APIServices/QiKu/PackTaskService.cs index ab5511d9..3206967a 100644 --- a/BBWY.Client/APIServices/QiKu/PackTaskService.cs +++ b/BBWY.Client/APIServices/QiKu/PackTaskService.cs @@ -27,7 +27,7 @@ namespace BBWY.Client.APIServices - public ApiResponse GetTaskList(string skuId = null, string taskId = null, + public ApiResponse SearchTaskList(string skuId = null, string taskId = null, TaskState? TaskState = null, int pageIndex = 1, @@ -36,15 +36,6 @@ namespace BBWY.Client.APIServices ) { - if (taskId != null && !string.IsNullOrEmpty(taskId.Trim())) - { - return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new - { - TaskId = taskId, - ShopId = globalContext.User.Shop.ShopId.ToString() - - }, null, HttpMethod.Post); - } return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new { @@ -56,7 +47,7 @@ namespace BBWY.Client.APIServices ShopId = globalContext.User.Shop.ShopId.ToString() }, null, HttpMethod.Post); } - public ApiResponse GetWareHouseList(string WayBillNo = null, string SourceExpressName = null, string departmentName = null, string skuId = null, string taskId = null, + public ApiResponse SearchTaskList(string WayBillNo = null, string SourceExpressName = null, string departmentName = null, string skuId = null, string taskId = null, TaskState? TaskState = null, string ShopName = null, @@ -64,14 +55,7 @@ namespace BBWY.Client.APIServices int pageSize = 10 ) { - if (taskId != null && !string.IsNullOrEmpty(taskId.Trim())) - { - return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new - { - TaskId = taskId - }, null, HttpMethod.Post); - } return SendRequest(globalContext.QKApiHost, "api/PackTask/SearchTaskList", new { DepartmentName = departmentName, @@ -96,7 +80,7 @@ namespace BBWY.Client.APIServices } - public ApiResponse GetProductSku(string skuId) + public ApiResponse SearchProduct(string skuId) { HttpClientHelper helper = new HttpClientHelper(globalContext.QKApiHost); diff --git a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs index e2070218..f36fa522 100644 --- a/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs +++ b/BBWY.Client/Models/BatchPurchase/BatchPublishTask.cs @@ -419,7 +419,7 @@ namespace BBWY.Client.Models Brand = productApiResponse.Data.Items[0].BrandName; } - var productSku = packTaskService.GetProductSku(skuid); + var productSku = packTaskService.SearchProduct(skuid); if (productSku == null || !productSku.Success) { @@ -452,6 +452,10 @@ namespace BBWY.Client.Models BarCodeModel = new BarCodeModel(); IsSetBarCode = true; } + if (BarCodeModel.LabelModel== BarcodeLabelModel.无型号模板) + { + BarCodeModel.LabelModel = BarcodeLabelModel.精简模板; + } BarCodeModel.Brand = Brand; if (!string.IsNullOrEmpty(BrandName)) BarCodeModel.BrandName = BrandName; diff --git a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs index ca445be9..b49ef77b 100644 --- a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs @@ -872,7 +872,7 @@ namespace BBWY.Client.ViewModels.PackTask Brand = productApiResponse.Data.Items[0].BrandName; } - var productSku = packTaskService.GetProductSku(searchSkuId); + var productSku = packTaskService.SearchProduct(searchSkuId); if (productSku == null || !productSku.Success) { IsLoading = false; @@ -943,6 +943,10 @@ namespace BBWY.Client.ViewModels.PackTask BarCodeModel = new BarCodeModel(); IsSetBarCode = true; } + if (BarCodeModel.LabelModel == BarcodeLabelModel.无型号模板) + { + BarCodeModel.LabelModel = BarcodeLabelModel.精简模板; + } BarCodeModel.Brand = Brand; if (!string.IsNullOrEmpty(BrandName)) BarCodeModel.BrandName = BrandName; diff --git a/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs index 30ff4435..9b83b04a 100644 --- a/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/PublishTaskViewModel.cs @@ -446,7 +446,7 @@ namespace BBWY.Client.ViewModels.PackTask Brand = productApiResponse.Data.Items[0].BrandName; } - var productSku = packTaskService.GetProductSku(skuid); + var productSku = packTaskService.SearchProduct(skuid); if (productSku == null || !productSku.Success || productSku.Data == null) return; if (TaskId <= 0) @@ -476,6 +476,9 @@ namespace BBWY.Client.ViewModels.PackTask { BarCodeModel = new BarCodeModel(); } + if (BarCodeModel.LabelModel == BarcodeLabelModel.无型号模板) + BarCodeModel.LabelModel = BarcodeLabelModel.精简模板; + BarCodeModel.Brand = Brand; if (!string.IsNullOrEmpty(BrandName)) BarCodeModel.BrandName = BrandName; @@ -487,9 +490,9 @@ namespace BBWY.Client.ViewModels.PackTask { IsNeedBarCode = Need.需要; IsSetBarCode = true; - + } - if (productSku.Data.PackConfig != null&&TaskId<=0) + if (productSku.Data.PackConfig != null && TaskId <= 0) { var config = productSku.Data.PackConfig; SkuTitle = config.SkuGoodsTitle; @@ -569,7 +572,7 @@ namespace BBWY.Client.ViewModels.PackTask } - + public Action ReflashWindow { get; set; } public void InitData(PackTaskModel model = null) { @@ -611,7 +614,7 @@ namespace BBWY.Client.ViewModels.PackTask return; } SaveTask = "保存"; - Logo = model.ItemList[0].Logo.Replace("80x80","200x200"); + Logo = model.ItemList[0].Logo.Replace("80x80", "200x200"); SearchSkuId = model.SkuId; SkuId = model.SkuId; SkuCount = model.SkuCount; @@ -726,7 +729,7 @@ namespace BBWY.Client.ViewModels.PackTask ShopId = globalContext.User.Shop.ShopId.ToString(), NeedBar = IsNeedBarCode == Need.需要, NeedCer = IsNeedCertificateModel == Need.需要 - + }; if (IsNeedBarCode == Need.需要) { @@ -741,7 +744,7 @@ namespace BBWY.Client.ViewModels.PackTask { if (CertificateModel == null || IsSetCertificate || CertificateModel.Count() <= 0) { - MessageBox.Show ("请设置合格证模板","提示"); + MessageBox.Show("请设置合格证模板", "提示"); return; } createTaskModel.CerId = string.Join(",", CertificateModel.Where(c => c.Id > 0).Select(c => c.Id));// @@ -757,11 +760,12 @@ namespace BBWY.Client.ViewModels.PackTask res = packTaskService.CreateTask(createTaskModel); } - if(res == null) { + if (res == null) + { MessageBox.Show("未知错误"); return; } - if (!res .Success) + if (!res.Success) { MessageBox.Show(res.Msg); return; diff --git a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs index f17c215c..7e14ae69 100644 --- a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs @@ -522,7 +522,7 @@ namespace BBWY.Client.ViewModels.PackTask try { PackTaskList = new ObservableCollection();//初始化数据 - var datas = packTaskService.GetTaskList(SearchSkuId, SearchTaskId, this.TaskState, + var datas = packTaskService.SearchTaskList(SearchSkuId, SearchTaskId, this.TaskState, PageIndex, PageSize); if (datas != null && datas.Data != null && datas.Success) { @@ -581,6 +581,8 @@ namespace BBWY.Client.ViewModels.PackTask if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) { data.BarCodeModel = item.BarCodeDTO; + if (data.BarCodeModel.LabelModel == BarcodeLabelModel.无型号模板) + data.BarCodeModel.LabelModel = BarcodeLabelModel.精简模板; } if (item.Cers != null) { diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index fc6eafed..c2b2b747 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -1343,7 +1343,7 @@ namespace BBWY.Client.ViewModels.PackTask PackTaskList = new ObservableCollection();//初始化数据 - var datas = packTaskService.GetWareHouseList(SearchWayBillNo, SearchExpressName, SearchDepartment, SearchSkuId, SearchTaskId, this.TaskState, SearchShopName, + var datas = packTaskService.SearchTaskList(SearchWayBillNo, SearchExpressName, SearchDepartment, SearchSkuId, SearchTaskId, this.TaskState, SearchShopName, PageIndex, PageSize); if (datas != null && datas.Data != null && datas.Success) { @@ -1408,8 +1408,10 @@ namespace BBWY.Client.ViewModels.PackTask if (item.BarCodeDTO != null && item.BarCodeDTO.Id > 0) { - + data.BarCodeModel = item.BarCodeDTO; + if (data.BarCodeModel.LabelModel == BarcodeLabelModel.无型号模板) + data.BarCodeModel.LabelModel = BarcodeLabelModel.精简模板; } if (item.Cers != null)