diff --git a/BBWY.Client/APIServices/PackTaskService.cs b/BBWY.Client/APIServices/PackTaskService.cs index 982151d2..1db4cb73 100644 --- a/BBWY.Client/APIServices/PackTaskService.cs +++ b/BBWY.Client/APIServices/PackTaskService.cs @@ -100,6 +100,15 @@ namespace BBWY.Client.APIServices return JsonConvert.DeserializeObject>(data); } + public ApiResponse GetSpuCer(string spuId) + { + HttpClientHelper helper = new HttpClientHelper(globalContext.QKApiHost); + + string url = $"{globalContext.QKApiHost}/api/PackTask/GetSpuCer?spuId={spuId}"; + var data = helper.Get(url); + + return JsonConvert.DeserializeObject>(data); + } public ApiResponse UpdateTask(CreateTaskRequest createTaskRequest) { @@ -148,6 +157,11 @@ namespace BBWY.Client.APIServices return SendRequest(globalContext.QKApiHost, "api/PackTask/CommitCer", cerRequest , null, HttpMethod.Post); } + public ApiResponse SaveSpuCer(CerRequest cerRequest) + { + return SendRequest(globalContext.QKApiHost, "api/PackTask/CommitSpuCer", cerRequest + , null, HttpMethod.Post); + } public ApiResponse GetPackMembers() { diff --git a/BBWY.Client/App.xaml.cs b/BBWY.Client/App.xaml.cs index 5cea52bc..01b9ec17 100644 --- a/BBWY.Client/App.xaml.cs +++ b/BBWY.Client/App.xaml.cs @@ -47,13 +47,13 @@ namespace BBWY.Client string userToken = string.Empty; - + #if DEBUG //仓库组测试 - // userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNjM1OTMyMDAyMjcwMDU2NDQ4IiwidGVhbUlkIjoiMTU0MDg4NTU3MDYyNzA0NzQyNCIsInNvblRlYW1JZHMiOiIxNTQwODg1NTcwNjI3MDQ3NDI0IiwiZXhwIjoxNzEwNDk2NTQ1fQ.Sx2vGJcYGf98x99slQLU3vt7yWdjspptSpbUCcZgWek"; + // userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNjM1OTMyMDAyMjcwMDU2NDQ4IiwidGVhbUlkIjoiMTU0MDg4NTU3MDYyNzA0NzQyNCIsInNvblRlYW1JZHMiOiIxNTQwODg1NTcwNjI3MDQ3NDI0IiwiZXhwIjoxNzEwNDk2NTQ1fQ.Sx2vGJcYGf98x99slQLU3vt7yWdjspptSpbUCcZgWek"; //齐越山鸡 - userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTM1MzMwMzI4ODkyMTQ5NzYwIiwidGVhbUlkIjoiMTUxNjk3NDI1MDU0MjUwMTg4OCIsInNvblRlYW1JZHMiOiIxNDM2Mjg4NTAwMjM1MjQzNTIwIiwiZXhwIjoxNjk0NjY5NjkxfQ.cSwro-7bGwOu92YejH9JhMenTai7Mvf99i2paQCmxIw"; + userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTM1MzMwMzI4ODkyMTQ5NzYwIiwidGVhbUlkIjoiMTUxNjk3NDI1MDU0MjUwMTg4OCIsInNvblRlYW1JZHMiOiIxNDM2Mjg4NTAwMjM1MjQzNTIwIiwiZXhwIjoxNjk0NjY5NjkxfQ.cSwro-7bGwOu92YejH9JhMenTai7Mvf99i2paQCmxIw"; //刷单组测试 //userToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiIxNTcxODUyODE0OTAzMTUyNjQwIiwidGVhbUlkIjoiMTU3MTg1MjQ1MDI5NjUwMDIyNCIsInNvblRlYW1JZHMiOiIiLCJleHAiOjE2OTUxNDc2ODh9.hVupdHnhgHHGo3QrMSDqhINqtq6Q5_RovWyXjiMkkEs"; @@ -105,13 +105,13 @@ namespace BBWY.Client IServiceCollection serviceCollection = new ServiceCollection(); serviceCollection.AddHttpClient(); - // serviceCollection.AddTransient(); + // serviceCollection.AddTransient(); serviceCollection.AddHttpClient("gzip").ConfigurePrimaryHttpMessageHandler(handler => new HttpClientHandler() { AutomaticDecompression = System.Net.DecompressionMethods.GZip }); - + serviceCollection.AddMemoryCache(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(gl); diff --git a/BBWY.Client/BBWYAppSettings.json b/BBWY.Client/BBWYAppSettings.json index 9622efaf..e1b3dcff 100644 --- a/BBWY.Client/BBWYAppSettings.json +++ b/BBWY.Client/BBWYAppSettings.json @@ -4,6 +4,6 @@ "MDSApiHost": "http://mdsapi.qiyue666.com", "JOSApiHost": "", "1688ApiHost": "", - //"QKApiHost": "http://localhost:8080" - "QKApiHost": "http://qiku.qiyue666.com" + "QKApiHost": "http://localhost:8080" + //"QKApiHost": "http://qiku.qiyue666.com" } \ No newline at end of file diff --git a/BBWY.Client/Models/APIModel/Request/CerRequest.cs b/BBWY.Client/Models/APIModel/Request/CerRequest.cs index 76f60bc3..971e114b 100644 --- a/BBWY.Client/Models/APIModel/Request/CerRequest.cs +++ b/BBWY.Client/Models/APIModel/Request/CerRequest.cs @@ -6,6 +6,8 @@ namespace BBWY.Client.Models.APIModel.Request { public class CerRequest { + + public string SpuId { get; set; } /// /// skuid /// diff --git a/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs b/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs index 6b156275..8a9b8902 100644 --- a/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs +++ b/BBWY.Client/Models/APIModel/Request/CreateTaskRequest.cs @@ -6,6 +6,18 @@ namespace BBWY.Client.Models.APIModel.Request { public class CreateTaskRequest { + /// + /// 货号 + /// + public string ProductNo { get; set; } + /// + /// sku图 + /// + public string Logo { get; set; } + /// + /// sku 名称 + /// + public string SkuName { get; set; } public long TaskId { get; set; } /// diff --git a/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs b/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs index 23351bee..7cdabea0 100644 --- a/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/PackTask/ProductSkuResponse.cs @@ -47,11 +47,14 @@ namespace BBWY.Client.Models.APIModel.Response.PackTask public BarCodeModel BarCodeModel { get; set; } - /// /// 合格证信息 /// public CertificateModel Certificate { get; set; } + /// + /// 合格证信息 + /// + public CertificateModel SpuCertificate { get; set; } } diff --git a/BBWY.Client/Models/PackTask/CertificateModel.cs b/BBWY.Client/Models/PackTask/CertificateModel.cs index c3cc6542..63df7554 100644 --- a/BBWY.Client/Models/PackTask/CertificateModel.cs +++ b/BBWY.Client/Models/PackTask/CertificateModel.cs @@ -12,10 +12,19 @@ namespace BBWY.Client.Models /// public long Id { get; set; } + + /// /// skuid /// public string SkuId { get; set; } + + + private string spuId; + /// + /// 品牌 + /// + public string SpuId { get => spuId; set { Set(ref spuId, value); } } private string brand; diff --git a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs index 0710aac1..af24296a 100644 --- a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs +++ b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs @@ -28,7 +28,6 @@ namespace BBWY.Client.ViewModels private ChoosePurchaseSchemeViewModel choosePurchaseSchemeViewModel; private DongDongHelper dongdongHelper; private bool isLoading; - private string searchOrderId; private DateTime startDate; private DateTime endDate; diff --git a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs index 811001ac..43447374 100644 --- a/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/CreatePackTaskViewModel.cs @@ -29,9 +29,9 @@ using System.Windows.Navigation; namespace BBWY.Client.ViewModels.PackTask { - public class CreatePackTaskViewModel : BaseVM,IDenpendency + public class CreatePackTaskViewModel : BaseVM, IDenpendency { - + private bool isLoading = false; public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } @@ -257,13 +257,48 @@ namespace BBWY.Client.ViewModels.PackTask /// /// 设置显示(条形码) /// - public bool IsSetBarCode { get => isSetBarCode; set { Set(ref isSetBarCode, value); } } + public bool IsSetBarCode + { + get => isSetBarCode; set + { + + Set(ref isSetBarCode, value); + IsNeedBarCode = IsSetBarCode ? "不需要" : "需要"; + } + } private bool isSetCertificate; /// /// 设置显示(合格证) /// - public bool IsSetCertificate { get => isSetCertificate; set { Set(ref isSetCertificate, value); } } + public bool IsSetCertificate + { + get => isSetCertificate; set + { + + Set(ref isSetCertificate, value); + IsNeedCertificateModel = IsSetCertificate ? "不需要" : "需要"; + } + } + private string setSpuCerStatus; + + public string SetSpuCerStatus { get => setSpuCerStatus; set { Set(ref setSpuCerStatus, value); } } + private bool isSetSpuCertificate = true; + + + /// + /// 设置spu显示(合格证) + /// + public bool IsSetSpuCertificate + { + get => isSetSpuCertificate; set + { + + Set(ref isSetSpuCertificate, value); + SetSpuCerStatus = IsSetSpuCertificate ? "设置spu模板" : "修改spu模板"; + } + } + private string saveTask; @@ -273,6 +308,18 @@ namespace BBWY.Client.ViewModels.PackTask public string SaveTask { get => saveTask; set { Set(ref saveTask, value); } } + private string spuId; + /// + /// 合格证 + /// + public string SpuId { get => spuId; set { Set(ref spuId, value); } } + + private CertificateModel spuCertificateModel; + /// + /// spu合格证 + /// + public CertificateModel SpuCertificateModel { get => spuCertificateModel; set { Set(ref spuCertificateModel, value); } } + private CertificateModel certificateModel; @@ -351,21 +398,25 @@ namespace BBWY.Client.ViewModels.PackTask public ICommand BarLabelCheckCommand { get; set; } public ICommand CerLabelCheckCommand { get; set; } + public ICommand SpuCerLabelCheckCommand { get; set; } public ICommand LookBarCommand { get; set; } public ICommand LookCerCommand { get; set; } + public ICommand SetSpuCerCommand { get; set; } + public ICommand SaveSpuCerCommand { get; set; } + public ICommand InseartCerCommand { get; set; } public void InitData(PackTaskModel model = null) { string[] increates = new string[] { "气泡纸", "气泡袋", "POP袋", "折纸箱", "气泡纸封边", "彩盒", "剪胶", "剪彩带", "快递袋", "收纳盒", "纸箱子", "装纸箱", "封边", "胶带", "折彩盒" }; IncreateList = new ObservableCollection(); - + SpuId = string.Empty; if (model == null) { + - SaveTask = "发布"; TaskId = 0; Logo = string.Empty; @@ -397,9 +448,9 @@ namespace BBWY.Client.ViewModels.PackTask SaveTask = "保存"; Logo = model.ItemList[0].Logo; - SearchSkuId =model.SkuId ; + SearchSkuId = model.SkuId; + - SkuId = model.SkuId; SkuCount = model.SkuCount; SkuName = model.ItemList[0].SkuName; @@ -407,8 +458,8 @@ namespace BBWY.Client.ViewModels.PackTask Brand = model.Brand; BrandName = model.ItemList[0].BrandName; this.MarkMessage = model.MarkMessage; - IsSetBarCode = model.BarCodeModel!=null ? false:true; - IsSetCertificate = model.CertificateModel!=null ? false : true; + IsSetBarCode = model.BarCodeModel != null ? false : true; + IsSetCertificate = model.CertificateModel != null ? false : true; BarCodeModel = model.BarCodeModel; CertificateModel = model.CertificateModel; SkuTitle = model.SkuTitle; @@ -416,13 +467,13 @@ namespace BBWY.Client.ViewModels.PackTask Availability = model.Availability; IsWorry = model.IsWorry; PositionType = model.PositionType; - PackType =model.PackType; + PackType = model.PackType; BasicPack = model.BasicPack; IsNeedBarCode = model.BarCodeModel != null ? "需要" : "不需要"; IsNeedCertificateModel = model.CertificateModel != null ? "需要" : "不需要"; CertificatePosition = model.CertificatePosition; TaskId = model.TaskId; - string[] increateDatas =model.Increment1.Split(','); + string[] increateDatas = model.Increment1.Split(','); bool isSelected = false; foreach (var item in increates) @@ -438,7 +489,7 @@ namespace BBWY.Client.ViewModels.PackTask IsSelected = isSelected }); } - //SearchSku(); + SearchSku(); } @@ -469,10 +520,6 @@ namespace BBWY.Client.ViewModels.PackTask IsSelected = false }); } - - - - //查询sku SearchSkuCommand = new RelayCommand(() => { @@ -485,9 +532,15 @@ namespace BBWY.Client.ViewModels.PackTask SetCertificateCommand = new RelayCommand(SetCertificate); SaveBarCodeCommand = new RelayCommand(SaveBarCode); + SetSpuCerCommand = new RelayCommand(SetSpuCer); + SaveSpuCerCommand = new RelayCommand(SaveSpuCer); + InseartCerCommand = new RelayCommand(InseartCer); + SaveCerCommand = new RelayCommand(SaveCer); BarLabelCheckCommand = new RelayCommand(BarLabelCheck); CerLabelCheckCommand = new RelayCommand(CerLabelCheck); + SpuCerLabelCheckCommand = new RelayCommand(SpuCerLabelCheck); + LookBarCommand = new RelayCommand(LookBar); LookCerCommand = new RelayCommand(LookCer); @@ -497,7 +550,76 @@ namespace BBWY.Client.ViewModels.PackTask BarLabelCheck(BarcodeLabelModel.精简模板);//默认精简模式 } + private void InseartCer() + { + CertificateModel = new CertificateModel() + { + //SpuId = SpuCertificateModel.SpuId, + SkuId = SkuId, + Brand = SpuCertificateModel.Brand, + BrandName = SpuCertificateModel.BrandName, + ExcuteStander = SpuCertificateModel.ExcuteStander, + FactoryNumber = SpuCertificateModel.FactoryNumber, + IsLogo = SpuCertificateModel.IsLogo, + LabelModel = SpuCertificateModel.LabelModel, + ProductAdress = SpuCertificateModel.ProductAdress, + ProductNo = SpuCertificateModel.ProductNo, + Shader = SpuCertificateModel.Shader, + ProductShop = SpuCertificateModel.ProductShop, + }; + } + + private void SetSpuCer() + { + + if (SpuCertificateModel == null) + { + SpuCertificateModel = new CertificateModel(); + SpuCertificateModel.ProductNo = ProductNo; + SpuCertificateModel.Brand = Brand; + SpuCertificateModel.SkuId = SkuId; + } + SpuCertificateModel.BrandName = BrandName; + setSpuCerWindow = new SetSpuCerWindow(); + setSpuCerWindow.Show(); + } + + private void SaveSpuCer() + { + if (string.IsNullOrEmpty(SpuCertificateModel.ExcuteStander) + || string.IsNullOrEmpty(SpuCertificateModel.Shader) || string.IsNullOrEmpty(SpuCertificateModel.BrandName) + || string.IsNullOrEmpty(SpuCertificateModel.Brand) || string.IsNullOrEmpty(SpuCertificateModel.ProductShop) + || string.IsNullOrEmpty(SpuCertificateModel.ProductAdress)) + { + new TipsWindow("参数出错!请重新填写!").Show(); + return; + } + var resData = packTaskService.SaveSpuCer(new CerRequest + { + Brand = SpuCertificateModel.Brand, + BrandName = SpuCertificateModel.BrandName, + ProductNo = SpuCertificateModel.ProductNo, + SpuId = SpuCertificateModel.SpuId, + ExcuteStander = SpuCertificateModel.ExcuteStander, + LabelModel = (int)SpuCertificateModel.LabelModel, + FactoryNumber = SpuCertificateModel.FactoryNumber, + IsLogo = SpuCertificateModel.IsLogo, + ProductAdress = SpuCertificateModel.ProductAdress, + ProductShop = SpuCertificateModel.ProductShop, + Shader = SpuCertificateModel.Shader + + }); + if (resData == null || !resData.Success) + { + IsSetSpuCertificate = false; + return; + } + IsNeedCertificateModel = "需要"; + CertificateModel.Id = resData.Data; + IsSetSpuCertificate = false; + setSpuCerWindow.Close(); + } private void OnSearchIncreateKeyWordChanged(string key) { @@ -558,11 +680,15 @@ namespace BBWY.Client.ViewModels.PackTask }); look.Show(); } - + private void SpuCerLabelCheck(CertificateLabelModel cer) + { + SpuCertificateModel.LabelModel = cer; + SpuCertificateModel.IsLogo = cer == CertificateLabelModel.标准有3c ? 1 : 0; + } private void CerLabelCheck(CertificateLabelModel cer) { CertificateModel.LabelModel = cer; - CertificateModel.IsLogo = cer== CertificateLabelModel.标准有3c?1:0; + CertificateModel.IsLogo = cer == CertificateLabelModel.标准有3c ? 1 : 0; } /// /// @@ -595,11 +721,11 @@ namespace BBWY.Client.ViewModels.PackTask new TipsWindow("请先查询skuId").Show(); return; } - + SearSpuCer(); if (CertificateModel == null) { - CertificateModel = new CertificateModel(); + CertificateModel = new CertificateModel(); CertificateModel.ProductNo = ProductNo; CertificateModel.Brand = Brand; CertificateModel.SkuId = SkuId; @@ -607,7 +733,7 @@ namespace BBWY.Client.ViewModels.PackTask } CertificateModel.BrandName = BrandName; setCerWindow = new SetCerWindow(); - setCerWindow.ShowDialog(); + setCerWindow.Show(); //throw new NotImplementedException(); } /// @@ -615,12 +741,12 @@ namespace BBWY.Client.ViewModels.PackTask /// private void SaveCer() { - if (string.IsNullOrEmpty(CertificateModel.ExcuteStander) + 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("参数出错!请重新填写!").ShowDialog(); + new TipsWindow("参数出错!请重新填写!").Show(); return; } var standers = CertificateModel.ExcuteStander.Split(',', StringSplitOptions.RemoveEmptyEntries); @@ -652,10 +778,10 @@ namespace BBWY.Client.ViewModels.PackTask setCerWindow.Close(); } - SetBarCodeWindow setBarCodeWindow = null; SetCerWindow setCerWindow = null; + SetBarCodeWindow setBarCodeWindow = null; SetCerWindow setCerWindow = null; SetSpuCerWindow setSpuCerWindow = null; private void SetBarCode() { - if (string.IsNullOrEmpty( SearchSkuId)) + if (string.IsNullOrEmpty(SearchSkuId)) { new TipsWindow("请先查询skuId").Show(); return; @@ -667,12 +793,12 @@ namespace BBWY.Client.ViewModels.PackTask BarCodeModel.Brand = Brand; BarCodeModel.SkuId = SkuId; BarCodeModel.SkuName = SkuName; - + } BarCodeModel.BrandName = BrandName; setBarCodeWindow = new SetBarCodeWindow(); - setBarCodeWindow.ShowDialog(); + setBarCodeWindow.Show(); } public BarcodeLabelModel LabelModel = BarcodeLabelModel.精简模板; @@ -685,7 +811,7 @@ namespace BBWY.Client.ViewModels.PackTask if (string.IsNullOrEmpty(ProductNo) || ProductNo == "待填写") { TipsWindow tips = new TipsWindow("该SKU无货号信息,将影响条形码打印\r\n请先设置好货号信息或调整打印模板类型"); - tips.ShowDialog(); + tips.Show(); return; } } @@ -706,7 +832,7 @@ namespace BBWY.Client.ViewModels.PackTask IsSetBarCode = false; return; } - + BarCodeModel.Id = resData.Data; IsNeedBarCode = "需要"; IsSetBarCode = false; @@ -728,7 +854,7 @@ namespace BBWY.Client.ViewModels.PackTask new TipsWindow("请先搜索SkuId!").Show(); return; } - if (SkuCount<=0) + if (SkuCount <= 0) { new TipsWindow("请设置SKU任务数!").Show(); return; @@ -741,7 +867,10 @@ namespace BBWY.Client.ViewModels.PackTask } var createTaskModel = new Models.APIModel.Request.CreateTaskRequest { - TaskId=TaskId, + ProductNo = ProductNo, + Logo = Logo, + SkuName = SkuName, + TaskId = TaskId, BrandName = BrandName, Availability = (int)Availability, BasicPack = (int)BasicPack, @@ -764,7 +893,7 @@ namespace BBWY.Client.ViewModels.PackTask { if (BarCodeModel == null || BarCodeModel.Id <= 0) { - new TipsWindow("请设置条形码模板").ShowDialog(); + new TipsWindow("请设置条形码模板").Show(); return; } createTaskModel.BarCodeId = BarCodeModel.Id; @@ -773,17 +902,17 @@ namespace BBWY.Client.ViewModels.PackTask { if (CertificateModel == null || CertificateModel.Id <= 0) { - new TipsWindow("请设置合格证模板").ShowDialog(); + new TipsWindow("请设置合格证模板").Show(); return; } createTaskModel.CertificateId = CertificateModel.Id;// } ApiResponse res = null; - if (TaskId>0)//修改界面 + if (TaskId > 0)//修改界面 { res = packTaskService.UpdateTask(createTaskModel); } - else + else { res = packTaskService.CreateTask(createTaskModel); } @@ -822,7 +951,7 @@ namespace BBWY.Client.ViewModels.PackTask SkuName = skuResponse.Data[0].Title; // ProductNo = skuResponse.Data[0].ProductItemNum; - + SpuId = skuResponse.Data[0].ProductId; productApiResponse = productService.GetProductList(skuResponse.Data[0].ProductId, string.Empty, string.Empty, 1); @@ -846,11 +975,13 @@ namespace BBWY.Client.ViewModels.PackTask } BrandName = productSku.Data.BrandName; - IsSetCertificate = true; + CertificateModel = productSku.Data.Certificate; + IsSetCertificate = false; if (CertificateModel == null) { CertificateModel = new CertificateModel(); + IsSetCertificate = true; } CertificateModel.Brand = Brand; @@ -858,16 +989,17 @@ namespace BBWY.Client.ViewModels.PackTask CertificateModel.ProductNo = ProductNo; CertificateModel.SkuId = SkuId; BarCodeModel = productSku.Data.BarCodeModel; + IsSetBarCode = false; if (BarCodeModel == null) { BarCodeModel = new BarCodeModel(); + IsSetBarCode = true; } BarCodeModel.Brand = Brand; BarCodeModel.BrandName = BrandName; BarCodeModel.ProductNo = ProductNo; BarCodeModel.SkuId = SkuId; BarCodeModel.SkuName = SkuName; - IsSetBarCode = true; } else { @@ -880,5 +1012,38 @@ namespace BBWY.Client.ViewModels.PackTask //查看有木有存在 } + public void SearSpuCer() + { + if (string.IsNullOrEmpty(SpuId)) + { + SearchSku(); + return; + } + SpuId = SpuId.Trim();//去掉空格 避免数据异常 + IsLoading = true; + + var productSku = packTaskService.GetSpuCer(SpuId); + if (productSku == null || !productSku.Success) + { + IsSetSpuCertificate = true; + IsLoading = false; + return; + } + SpuCertificateModel = productSku.Data; + IsSetSpuCertificate = false; + if (SpuCertificateModel == null) + { + SpuCertificateModel = new CertificateModel(); + IsSetSpuCertificate = true; + SpuCertificateModel.Brand = Brand; + SpuCertificateModel.BrandName = BrandName; + SpuCertificateModel.ProductNo = ProductNo; + SpuCertificateModel.SpuId = SpuId; + + } + IsLoading = false; + + } + } } diff --git a/BBWY.Client/ViewModels/PackTask/SetSpuCerViewModel.cs b/BBWY.Client/ViewModels/PackTask/SetSpuCerViewModel.cs new file mode 100644 index 00000000..c3879334 --- /dev/null +++ b/BBWY.Client/ViewModels/PackTask/SetSpuCerViewModel.cs @@ -0,0 +1,14 @@ +using BBWY.Common.Models; +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Controls; + +namespace BBWY.Client.ViewModels.PackTask +{ + public class SetSpuCerViewModel:ViewBase,IDenpendency//注入 + { + + public string SpuId { get; set; } + } +} diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 412ca75a..f4b4e26b 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -17,6 +17,7 @@ using System.ComponentModel; using HandyControl.Controls; using System.Windows; using System.Collections; +using NPOI.SS.Formula.Functions; namespace BBWY.Client.ViewModels.PackTask { @@ -140,12 +141,12 @@ namespace BBWY.Client.ViewModels.PackTask #endregion - + private readonly ProductService productService; private readonly ConsumableService consumableService; private readonly WorkProcessService workProcessService; private readonly PackTaskService packTaskService; private readonly IncreateServiceService increateServiceService; - public WareHouseListViewModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService) + public WareHouseListViewModel(PackTaskService packTaskService, ConsumableService consumableService, WorkProcessService workProcessService, IncreateServiceService increateServiceService, ProductService productService) { this.packTaskService = packTaskService; this.consumableService = consumableService; @@ -186,13 +187,14 @@ namespace BBWY.Client.ViewModels.PackTask SetTaskState(Models.TaskState.全部); this.workProcessService = workProcessService; this.increateServiceService = increateServiceService; + this.productService = productService; } - + #region 事件绑定 @@ -278,7 +280,6 @@ namespace BBWY.Client.ViewModels.PackTask OrderCount = dataModel.TotalCount; foreach (var item in dataModel.Items) { - var data = new PackTaskModel(packTaskService, consumableService, workProcessService, increateServiceService) { AcceptName = item.UserName, diff --git a/BBWY.Client/Views/MainWindow.xaml b/BBWY.Client/Views/MainWindow.xaml index 453ebcc3..ce06c935 100644 --- a/BBWY.Client/Views/MainWindow.xaml +++ b/BBWY.Client/Views/MainWindow.xaml @@ -26,7 +26,7 @@ - + diff --git a/BBWY.Client/Views/PackTask/CerControl.xaml b/BBWY.Client/Views/PackTask/CerControl.xaml index 9523b5b0..6c8c0df3 100644 --- a/BBWY.Client/Views/PackTask/CerControl.xaml +++ b/BBWY.Client/Views/PackTask/CerControl.xaml @@ -16,7 +16,7 @@ - + @@ -106,7 +106,7 @@ Height="44" Text="{Binding CerData.ProductAdress}" Width="296" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="63,241,0,0"/> - + diff --git a/BBWY.Client/Views/PackTask/CreatePackTask.xaml b/BBWY.Client/Views/PackTask/CreatePackTask.xaml index ad3bfd10..e23ffc54 100644 --- a/BBWY.Client/Views/PackTask/CreatePackTask.xaml +++ b/BBWY.Client/Views/PackTask/CreatePackTask.xaml @@ -17,7 +17,7 @@ MinButtonVisibility="Collapsed" MaxButtonVisibility="Collapsed" RightButtonGroupMargin="0,5,5,0" - Title="CreatePackTask" Height="350" Width="1500"> + Title="发布任务" Height="350" Width="1500"> diff --git a/BBWY.Client/Views/PackTask/FeesExcelControl.xaml.cs b/BBWY.Client/Views/PackTask/FeesExcelControl.xaml.cs index a3967cb8..395094e8 100644 --- a/BBWY.Client/Views/PackTask/FeesExcelControl.xaml.cs +++ b/BBWY.Client/Views/PackTask/FeesExcelControl.xaml.cs @@ -166,8 +166,6 @@ namespace BBWY.Client.Views.PackTask public FeesExcelControl() { InitializeComponent(); - - } @@ -226,7 +224,7 @@ namespace BBWY.Client.Views.PackTask { serviceData.AppendLine(columnData.Replace("[:index:]", $"{i + 1}") .Replace("[:ServiceName:]", $"{all[i].ItemName}") - .Replace("[:ServiceCount:]", $"{all[i].ItemCount}")); + .Replace("[:ServiceCount:]", $"{all[i].ItemPrice}*{all[i].ItemCount}")); } } StringBuilder header = new StringBuilder(); diff --git a/BBWY.Client/Views/PackTask/SetCerControl.xaml b/BBWY.Client/Views/PackTask/SetCerControl.xaml new file mode 100644 index 00000000..f7a317ca --- /dev/null +++ b/BBWY.Client/Views/PackTask/SetCerControl.xaml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/PackTask/SetCerControl.xaml.cs b/BBWY.Client/Views/PackTask/SetCerControl.xaml.cs new file mode 100644 index 00000000..cf49f2e6 --- /dev/null +++ b/BBWY.Client/Views/PackTask/SetCerControl.xaml.cs @@ -0,0 +1,86 @@ +using BBWY.Client.Models; +using BBWY.Client.Models.APIModel.Response.PackTask; +using MathNet.Numerics; +using System; +using System.Collections.Generic; +using System.ComponentModel; +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.PackTask +{ + /// + /// SetCerControl.xaml 的交互逻辑 + /// + public partial class SetCerControl : UserControl,INotifyPropertyChanged + { + public SetCerControl() + { + InitializeComponent(); + } + + + + //CertificateModel + + public CertificateModel model + { + get + { + return (CertificateModel)GetValue(modelProperty); + + } + set + { + SetValue(modelProperty, value); + NotifyPropertyChanged("CertificateModel"); + } + } + + + public static readonly DependencyProperty modelProperty = + DependencyProperty.Register("model", typeof(CertificateModel), typeof(SetCerControl), new PropertyMetadata(ChangedProperty)); + + public event PropertyChangedEventHandler PropertyChanged; + protected virtual void NotifyPropertyChanged(string propertyName) + { + if (this.PropertyChanged != null) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + + + private static void ChangedProperty(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + + + + var control = d as SetCerControl; + + var newValue = e.NewValue as CertificateModel; + if (control != null && newValue != null) + { + control.model = newValue; + //control.DataContext = newValue; + + //control.OnPropertyChanged(e); + + } + + + } + + + + } + +} diff --git a/BBWY.Client/Views/PackTask/SetCerWindow.xaml b/BBWY.Client/Views/PackTask/SetCerWindow.xaml index aacaa047..d4b5c868 100644 --- a/BBWY.Client/Views/PackTask/SetCerWindow.xaml +++ b/BBWY.Client/Views/PackTask/SetCerWindow.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:BBWY.Client.Views.PackTask" mc:Ignorable="d" Style="{StaticResource bwstyle}" - Height="799" Width="820" + Height="860" Width="820" xmlns:b="http://schemas.microsoft.com/xaml/behaviors" xmlns:ctr="clr-namespace:BBWY.Client.Converters" xmlns:cmodel="clr-namespace:BBWY.Client.Models" @@ -32,98 +32,105 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + + - + - - - - - diff --git a/BBWY.Client/Views/PackTask/SetSpuCerWindow.xaml b/BBWY.Client/Views/PackTask/SetSpuCerWindow.xaml new file mode 100644 index 00000000..3584c751 --- /dev/null +++ b/BBWY.Client/Views/PackTask/SetSpuCerWindow.xaml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/PackTask/SetSpuCerWindow.xaml.cs b/BBWY.Client/Views/PackTask/SetSpuCerWindow.xaml.cs new file mode 100644 index 00000000..d31cb5be --- /dev/null +++ b/BBWY.Client/Views/PackTask/SetSpuCerWindow.xaml.cs @@ -0,0 +1,26 @@ +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.PackTask +{ + /// + /// SetSpuCerWindow.xaml 的交互逻辑 + /// + public partial class SetSpuCerWindow : BWindow + { + public SetSpuCerWindow() + { + InitializeComponent(); + } + } +} diff --git a/BBWY.Client/WebView2Manager.cs b/BBWY.Client/WebView2Manager.cs index 063f7f82..3fd69127 100644 --- a/BBWY.Client/WebView2Manager.cs +++ b/BBWY.Client/WebView2Manager.cs @@ -20,6 +20,7 @@ namespace BBWY.Client if (wb2 == null) { wb2 = new WebView2(); + //配置环境 var wb2Setting = CoreWebView2Environment.CreateAsync(userDataFolder: io.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "WebView2UserData", userDataFolder)).Result; wb2.EnsureCoreWebView2Async(wb2Setting); wb2.CoreWebView2InitializationCompleted += Wb2_CoreWebView2InitializationCompleted;