diff --git a/src/Coldairarrow.Api/Controllers/HuiYan/teamitemsController.cs b/src/Coldairarrow.Api/Controllers/HuiYan/teamitemsController.cs index d9f0dab..2308d6d 100644 --- a/src/Coldairarrow.Api/Controllers/HuiYan/teamitemsController.cs +++ b/src/Coldairarrow.Api/Controllers/HuiYan/teamitemsController.cs @@ -2,6 +2,7 @@ using Coldairarrow.Entity.DTO; using Coldairarrow.Entity.HuiYan; using Coldairarrow.Util; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Threading.Tasks; @@ -63,15 +64,49 @@ namespace Coldairarrow.Api.Controllers.HuiYan #endregion + /// + /// 获取数据 + /// + /// + /// + [HttpPost, AllowAnonymous] + public PageResult GetItems(PageInput input) + { + return _teamitemsBus.GetItems(input); + } + /// /// 添加商品信息 /// /// /// - [HttpPost] + [HttpPost, AllowAnonymous] public AjaxResult AddItem(TeamitemDto model) { return _teamitemsBus.AddItem(model); } + + /// + /// 设置商品信息 + /// + /// + /// + [HttpPost, AllowAnonymous] + public AjaxResult SetItem(TeamitemDto model) + { + return _teamitemsBus.SetItem(model); + } + + /// + /// 设置商品状态 + /// + /// + /// + /// + [HttpPost, AllowAnonymous] + public AjaxResult SetState(string id, int state) + { + return _teamitemsBus.SetState(id, state); + } } } \ No newline at end of file diff --git a/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs b/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs index 73811a3..5244289 100644 --- a/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs +++ b/src/Coldairarrow.Business/HuiYan/teamitemsBusiness.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; +using System.Linq.Expressions; using System.Threading.Tasks; namespace Coldairarrow.Business.HuiYan @@ -64,6 +65,34 @@ namespace Coldairarrow.Business.HuiYan #endregion + public PageResult GetItems(PageInput input) + { + Expression> select = (a, b) => new TeamitemDto + { + GoodsId = b.GoodsId, + HasFilter = b.HasFilter, + Platform = b.Platform, + Extensions = Newtonsoft.Json.JsonConvert.DeserializeObject>(a.ExtensionJson) + }; + + var search = input.Search; + select = select.BuildExtendSelectExpre(); + + var q_titem = GetIQueryable(); + var q = from a in q_titem.AsExpandable() + join b in Db.GetIQueryable() on a.ItemId equals b.Id into ab + from b in ab.DefaultIfEmpty() + select @select.Invoke(a, b); + + //查询对应状态 + var where = LinqHelper.True().And(c => c.State == int.Parse(search.Keyword)); + + var list = q.Where(where).GetPageResultAsync(input).Result; + + return list; + + } + public AjaxResult AddItem(TeamitemDto model) { @@ -120,5 +149,31 @@ namespace Coldairarrow.Business.HuiYan return Success(); } + + public AjaxResult SetItem(TeamitemDto model) + { + 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; + }); + + if (row > 0) + return Success(); + return Error("操作失败!"); + } + + + public AjaxResult SetState(string id,int state) + { + int row = Db.Update(c => c.Id == id, (item) => { + item.State = state; + }); + + if (row > 0) + return Success(); + return Error("操作失败!"); + } } } \ No newline at end of file diff --git a/src/Coldairarrow.IBusiness/HuiYan/IteamitemsBusiness.cs b/src/Coldairarrow.IBusiness/HuiYan/IteamitemsBusiness.cs index 752dbaf..6788257 100644 --- a/src/Coldairarrow.IBusiness/HuiYan/IteamitemsBusiness.cs +++ b/src/Coldairarrow.IBusiness/HuiYan/IteamitemsBusiness.cs @@ -14,6 +14,12 @@ namespace Coldairarrow.Business.HuiYan Task UpdateDataAsync(teamitems data); Task DeleteDataAsync(List ids); + PageResult GetItems(PageInput input); + AjaxResult AddItem(TeamitemDto model); + + + AjaxResult SetItem(TeamitemDto model); + AjaxResult SetState(string id, int state); } } \ No newline at end of file diff --git a/客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue b/客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue index c2a0adf..9d0a1d1 100644 --- a/客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue +++ b/客户端/齐越慧眼/齐越慧眼/vuepage/client/src/views/items/Index.vue @@ -51,56 +51,89 @@ - +
-
- - - ¥46.0 - 160人收货 - +
+ + + ¥{{item.Price}} + {{item.Sales}}人收货 + +
-
-
平台
-
平台
-
平台
-
平台
-
平台
+
+ 淘宝 + 京东 + 拼多多 +
-
SKU名称
+
+ + {{ext.SkuName}} +
-
采购链接
+
+ + {{ext.BuyUrl}} +
-
供应商来源方式
+
+ + + {{ext.SupplierFrom}} +
-
采购价
+
+ + {{ext.BuyPrice}} +
-
快递费
+
+ + {{ext.KDPrice}} +
-
平台扣点
+
+ + {{ext.PlatformPoint}} +
-
利润率
+
+ + {{ext.Profits}} +
-
+
- - - ¥46.0 - 160人收货 - +
+ + + + + + + +
+
+
+ + + ¥{{item.RivalPrice}} + {{item.RivalPLCount}}人评论 + +
+
@@ -108,7 +141,7 @@ -
儿童玩具男孩枪CS对战装备红外线激光枪镭射对战枪儿童真人CS武器
+
{{item.Title}}
@@ -119,12 +152,13 @@ 放弃 - 保存 + 编辑 + 保存 -
儿童玩具男孩枪CS对战装备红外线激光枪镭射对战枪儿童真人CS武器
+
{{item.RivalTitle}}
@@ -138,12 +172,37 @@ export default { data() { return { - + datas: [], + pagination: { + current: 1, + pageSize: 10, + showTotal: (total, range) => `总数:${total} 当前:${range[0]}-${range[1]}` + }, + filters: {}, + sorter: { field: 'Id', order: 'asc' }, + loading: false, + queryParam: { condition: 'State', keyword: 0 }, + selectedRowKeys: [] } }, + mounted() { + this.getDatas() + }, methods: { - getDatasByJson(row){ - + getDatas() { + this.http.post('/HuiYan/teamitems/GetItems', { + PageIndex: this.pagination.current, + PageRows: this.pagination.pageSize, + SortField: this.sorter.field || 'Id', + SortType: this.sorter.order, + Search: this.queryParam, + ...this.filters + }).then(res => { + res.Data.forEach(item => { + item.isEdit=false + }); + this.datas = res.Data + }) } }, } @@ -185,6 +244,7 @@ border-right: 0px; border-bottom: 0px; } + .borderRight { border: 1px solid rgba(215, 215, 215, 1); border-top: 0px;