From e344500276aa9df65b8500f8448c5dc0dddfeee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=C2=B7=C3=A6?= <279202647@qq.com> Date: Mon, 25 Oct 2021 20:41:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B4=AB=E8=89=B2=E5=8B=BE?= =?UTF-8?q?=E9=80=89=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HuiYan/itemlabelsBusiness.cs | 13 ++++---- .../HuiYan/teamitemsBusiness.cs | 29 ++++++++++-------- .../UserControls/BrowerControl.xaml.cs | 19 ++++++++++-- .../齐越慧眼/vuepage/dist/img/pop.png | Bin 0 -> 3036 bytes 4 files changed, 40 insertions(+), 21 deletions(-) create mode 100644 客户端/齐越慧眼/齐越慧眼/vuepage/dist/img/pop.png diff --git a/src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs b/src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs index 2ac4182..df6cf27 100644 --- a/src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs +++ b/src/Coldairarrow.Business/HuiYan/itemlabelsBusiness.cs @@ -102,6 +102,7 @@ namespace Coldairarrow.Business.HuiYan public AjaxResult SetItemLabel(ItemLabelDto model) { + bool isAddItem = false; var item= Db.GetIQueryable().FirstOrDefault(c => c.GoodsId == model.ItemId); if (item == null) @@ -121,6 +122,8 @@ namespace Coldairarrow.Business.HuiYan if (row <= 0) return Error("添加失败!"); + + isAddItem = true; } var where = LinqHelper.True().And(c => c.ItemsId == item.Id); @@ -128,13 +131,13 @@ namespace Coldairarrow.Business.HuiYan //团队筛选 //where = where.And(c=>c.TeamId==""); + var label = GetIQueryable().FirstOrDefault(where); var result = Db.RunTransaction(() => { int row = 0; bool hasAdded = false; - var label = GetIQueryable().FirstOrDefault(where); //新增 if (label == null) { @@ -159,7 +162,6 @@ namespace Coldairarrow.Business.HuiYan break; case 2: label.IsAdded = true; - label.IsScreening = true; break; case 3: label.IsCompeting = true; @@ -174,7 +176,6 @@ namespace Coldairarrow.Business.HuiYan { hasAdded = label.IsAdded; - //更新状态 row = Db.Update(c => c.Id == label.Id, (data) => { @@ -193,7 +194,6 @@ namespace Coldairarrow.Business.HuiYan case 2: //加入产品库同时也勾选筛选 data.IsAdded = true; - data.IsScreening = true; break; case 3: data.IsCompeting = true; @@ -204,9 +204,8 @@ namespace Coldairarrow.Business.HuiYan throw new Exception("标签设置失败!"); } - //设置集团过滤 - if (model.Status == 1) + if (model.Status == 1&& !isAddItem) { Db.Update(c => c.Id == item.Id, (i) => { i.HasFilter = true; }); } @@ -228,11 +227,11 @@ namespace Coldairarrow.Business.HuiYan throw new Exception("添加产品库失败!"); } } - }); if (result.Success) return Success("操作成功!"); + return Error(result.ex.Message); } } diff --git a/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs b/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs index 7a4f99d..7145746 100644 --- a/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs +++ b/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs @@ -90,9 +90,10 @@ namespace Coldairarrow.Business.HuiYan //查询对应状态 var where = LinqHelper.True().And(c => c.State == int.Parse(search.Keyword)); + where = where.And(c => c.TeamId == _operator.TeamId); - var list = q.Where(where).GetPageResultAsync(input).Result; + var list = q.Where(where).GetPageResultAsync(input).Result; return list; @@ -116,7 +117,7 @@ namespace Coldairarrow.Business.HuiYan GoodsId = model.GoodsId, CreateTime = DateTime.Now, - CreatorId =_operator.UserId, + CreatorId = _operator.UserId, Deleted = false, HasFilter = false, Id = IdHelper.GetId(), @@ -143,7 +144,7 @@ namespace Coldairarrow.Business.HuiYan Id = IdHelper.GetId(), TeamId = _operator.TeamId, - UserId =_operator.UserId, + UserId = _operator.UserId, Price = model.Price, ItemImg = model.ItemImg, @@ -168,12 +169,13 @@ namespace Coldairarrow.Business.HuiYan model.RivalGoodsId = Regex.Match(model.RivalGoodsId + "&", "id=(.*?)&").Groups[1].Value; } } - int row= Db.Update(c=>c.Id==model.Id,(item)=> { + int row = Db.Update(c => c.Id == model.Id, (item) => + { item.ExtensionJson = Newtonsoft.Json.JsonConvert.SerializeObject(model.Extensions); item.RivalGoodsId = model.RivalGoodsId; item.RivalPLCount = model.RivalPLCount; item.RivalPrice = model.RivalPrice; - item.RivalTitle = model.RivalTitle; + item.RivalTitle = model.RivalTitle; }); if (row > 0) @@ -182,7 +184,7 @@ namespace Coldairarrow.Business.HuiYan } - public AjaxResult SetState(string id,int state) + public AjaxResult SetState(string id, int state) { //删除 if (state == 4) @@ -190,7 +192,8 @@ namespace Coldairarrow.Business.HuiYan return DeleteItem(id); } - int row = Db.Update(c => c.Id == id, (item) => { + int row = Db.Update(c => c.Id == id, (item) => + { item.State = state; }); @@ -202,9 +205,10 @@ namespace Coldairarrow.Business.HuiYan public AjaxResult DeleteItem(string id) { - var titem = Db.GetIQueryable().FirstOrDefault(c => c.Id == id); + + string itemId = Db.GetIQueryable().FirstOrDefault(c => c.Id == id)?.ItemId; - var result= Db.RunTransaction(() => + var result = Db.RunTransaction(() => { var row = Db.Delete(c => c.Id == id); @@ -212,7 +216,8 @@ namespace Coldairarrow.Business.HuiYan { throw new Exception("操作失败!"); } - row = Db.Update(c => c.ItemsId == titem.ItemId && c.TeamId == _operator.TeamId, (item) => + + row = Db.Update(c => c.ItemsId == itemId && c.TeamId == _operator.TeamId, (item) => { //item.IsScreening = false; item.IsAdded = false; @@ -220,7 +225,7 @@ namespace Coldairarrow.Business.HuiYan if (row <= 0) { - throw new Exception("删除失败!"); + throw new Exception($"删除失败!"); } }); @@ -230,7 +235,7 @@ namespace Coldairarrow.Business.HuiYan return Success(); } - return Error(); + return Error(result.ex.Message); } } } \ No newline at end of file diff --git a/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs b/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs index 0d64a99..5fcf2d2 100644 --- a/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs +++ b/客户端/齐越慧眼/齐越慧眼/UserControls/BrowerControl.xaml.cs @@ -172,6 +172,12 @@ namespace 齐越慧眼.UserControls DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').addClass(""trueBg"")"); DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.stateGraydiv').addClass(""divshow"")"); } + + if (item.IsAdded) + { + DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.myitemState').addClass(""popBg"")"); + DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{item.GoodsId}""]').parent().parent()).find('.stateGraydiv').addClass(""divshow"")"); + } } } } @@ -234,6 +240,11 @@ namespace 齐越慧眼.UserControls background-size: 100% 100%; } + .popBg + { + background: url(""nacollector://home/img/pop.png"") no-repeat; + background-size: 100% 100%; + } .falseBg { background: url(""nacollector://home/img/close.png"") no-repeat; @@ -398,14 +409,18 @@ namespace 齐越慧眼.UserControls { BrowerControl.Main.DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{itemId}""]').parent().parent()).find('.myitemState').prepend('
')"); } - } - if (type == 0||type==2) + if (type == 0) { BrowerControl.Main.DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{itemId}""]').parent().parent()).find('.myitemState').addClass(""trueBg"")"); } + if (type == 2) + { + BrowerControl.Main.DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{itemId}""]').parent().parent()).find('.myitemState').addClass(""popBg"")"); + } + BrowerControl.Main.DoJavaScript($@"$($('div#mainsrp-itemlist .items .item').find('a[data-nid=""{itemId}""]').parent().parent()).find('.stateGraydiv').addClass(""divshow"")"); } diff --git a/客户端/齐越慧眼/齐越慧眼/vuepage/dist/img/pop.png b/客户端/齐越慧眼/齐越慧眼/vuepage/dist/img/pop.png new file mode 100644 index 0000000000000000000000000000000000000000..66103d49e7076ef5f04c4c593d7ec03266f9f533 GIT binary patch literal 3036 zcmcImeQX=$8FxONrsVoHN=xhHe4(gN&c3sKXWu1G?bso)irXv=N(-^d`R<%piSNw$ zV&?-`lOO^WP#006X+t%CO#1_^6fr4^OV^3QYNS$3G>JePb<*5%laftCkxHT_*?W%T zhLUs@(k$J3@5k@?J-_FDpZ7Vx)_kzBqWs}zxK_q_U)m4f!w>1XWVwISSe zG@{W!pQ=y6>3z^Hji&TZ!PX=45${tpD~1dVC;E9qZzv4V8cpr~-Y~;<@iOe^JA#58 z`SNE_kBykQsL8Eop8_{04NTiO0Dmg128b#QGj4G2QK%)q^&ZXrVV+L0_T z4f^V|5rMN1xyz0?Rfq5qZ!_!?B_1XWB+B9z8*HTvIBCJmIZPXku~^IyGaE#y!-!K9;4m3YCKMphNS`1xy{HhW zUSV+a5mpL@<)A3QDkI|;dt^HTlrD!53g>BsNN$_Jh8cUAun{+4YDgm^ZfY5wS;N`GzPj$ki*(I5uw^?vc8)k#ek&@8&}Q76HQWysL1h zD2tI!ah*8w%lT-+v`gX{S(I8uv3up9npaq06Nnn#+ZGf!F&24DRg^Q}-HgoJ5ff&@ zQ5-`}SSxO$%_iDn+lSd`3|oeJK^}07%-jVgT1^;jrobux2rP2JK;Qj9ywFoM9nq}g;KcHjGC>upCmDoB3M4F3)s6wwnyDQ)qXi` zIgte%`5mIoR)(icART$!ile;QLZW`wf}@z#Vzn|HM&gz{+aW0kZVuDEnpIWB0Yg&2@0!4T8I8^b~e0^d>N61zpo zD{^4Z&8z14 za5g(>hE*?x9bwgM;5j5W9b99Z?=PTb+E^zKNbiv)%dm(TkYkL*J3GLU{Ld^jt|vai zMDHz~!@+I`I2;@U??(yBf}wtrvY=*?u-F17g2k-XmC*k$(sSF&b}~W-4=St?`T4=z zU%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