20 changed files with 1733 additions and 37 deletions
@ -0,0 +1,65 @@ |
|||
using Coldairarrow.Business.HuiYan; |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using Coldairarrow.Util; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Api.Controllers.HuiYan |
|||
{ |
|||
[Route("/HuiYan/[controller]/[action]")]
|
|||
public class itemlabelsController : BaseApiController |
|||
{ |
|||
#region DI
|
|||
|
|||
public itemlabelsController(IitemlabelsBusiness itemlabelsBus) |
|||
{ |
|||
_itemlabelsBus = itemlabelsBus; |
|||
} |
|||
|
|||
IitemlabelsBusiness _itemlabelsBus { get; } |
|||
|
|||
#endregion
|
|||
|
|||
#region 获取
|
|||
|
|||
[HttpPost] |
|||
public async Task<PageResult<itemlabels>> GetDataList(PageInput<ConditionDTO> input) |
|||
{ |
|||
return await _itemlabelsBus.GetDataListAsync(input); |
|||
} |
|||
|
|||
[HttpPost] |
|||
public async Task<itemlabels> GetTheData(IdInputDTO input) |
|||
{ |
|||
return await _itemlabelsBus.GetTheDataAsync(input.id); |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 提交
|
|||
|
|||
[HttpPost] |
|||
public async Task SaveData(itemlabels data) |
|||
{ |
|||
if (data.Id.IsNullOrEmpty()) |
|||
{ |
|||
InitEntity(data); |
|||
|
|||
await _itemlabelsBus.AddDataAsync(data); |
|||
} |
|||
else |
|||
{ |
|||
await _itemlabelsBus.UpdateDataAsync(data); |
|||
} |
|||
} |
|||
|
|||
[HttpPost] |
|||
public async Task DeleteData(List<string> ids) |
|||
{ |
|||
await _itemlabelsBus.DeleteDataAsync(ids); |
|||
} |
|||
|
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
using Coldairarrow.Business.HuiYan; |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using Coldairarrow.Util; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Api.Controllers.HuiYan |
|||
{ |
|||
[Route("/HuiYan/[controller]/[action]")]
|
|||
public class itemsController : BaseApiController |
|||
{ |
|||
#region DI
|
|||
|
|||
public itemsController(IitemsBusiness itemsBus) |
|||
{ |
|||
_itemsBus = itemsBus; |
|||
} |
|||
|
|||
IitemsBusiness _itemsBus { get; } |
|||
|
|||
#endregion
|
|||
|
|||
#region 获取
|
|||
|
|||
[HttpPost] |
|||
public async Task<PageResult<items>> GetDataList(PageInput<ConditionDTO> input) |
|||
{ |
|||
return await _itemsBus.GetDataListAsync(input); |
|||
} |
|||
|
|||
[HttpPost] |
|||
public async Task<items> GetTheData(IdInputDTO input) |
|||
{ |
|||
return await _itemsBus.GetTheDataAsync(input.id); |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 提交
|
|||
|
|||
[HttpPost] |
|||
public async Task SaveData(items data) |
|||
{ |
|||
if (data.Id.IsNullOrEmpty()) |
|||
{ |
|||
InitEntity(data); |
|||
|
|||
await _itemsBus.AddDataAsync(data); |
|||
} |
|||
else |
|||
{ |
|||
await _itemsBus.UpdateDataAsync(data); |
|||
} |
|||
} |
|||
|
|||
[HttpPost] |
|||
public async Task DeleteData(List<string> ids) |
|||
{ |
|||
await _itemsBus.DeleteDataAsync(ids); |
|||
} |
|||
|
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,77 @@ |
|||
using Coldairarrow.Business.HuiYan; |
|||
using Coldairarrow.Entity.DTO; |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using Coldairarrow.Util; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Api.Controllers.HuiYan |
|||
{ |
|||
[Route("/HuiYan/[controller]/[action]")]
|
|||
public class teamitemsController : BaseApiController |
|||
{ |
|||
#region DI
|
|||
|
|||
public teamitemsController(IteamitemsBusiness teamitemsBus) |
|||
{ |
|||
_teamitemsBus = teamitemsBus; |
|||
} |
|||
|
|||
IteamitemsBusiness _teamitemsBus { get; } |
|||
|
|||
#endregion
|
|||
|
|||
#region 获取
|
|||
|
|||
[HttpPost] |
|||
public async Task<PageResult<teamitems>> GetDataList(PageInput<ConditionDTO> input) |
|||
{ |
|||
return await _teamitemsBus.GetDataListAsync(input); |
|||
} |
|||
|
|||
[HttpPost] |
|||
public async Task<teamitems> GetTheData(IdInputDTO input) |
|||
{ |
|||
return await _teamitemsBus.GetTheDataAsync(input.id); |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 提交
|
|||
|
|||
[HttpPost] |
|||
public async Task SaveData(teamitems data) |
|||
{ |
|||
if (data.Id.IsNullOrEmpty()) |
|||
{ |
|||
InitEntity(data); |
|||
|
|||
await _teamitemsBus.AddDataAsync(data); |
|||
} |
|||
else |
|||
{ |
|||
await _teamitemsBus.UpdateDataAsync(data); |
|||
} |
|||
} |
|||
|
|||
[HttpPost] |
|||
public async Task DeleteData(List<string> ids) |
|||
{ |
|||
await _teamitemsBus.DeleteDataAsync(ids); |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 添加商品信息
|
|||
/// </summary>
|
|||
/// <param name="model"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
public AjaxResult AddItem(TeamitemDto model) |
|||
{ |
|||
return _teamitemsBus.AddItem(model); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using Coldairarrow.Util; |
|||
using EFCore.Sharding; |
|||
using LinqKit; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Linq.Dynamic.Core; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Business.HuiYan |
|||
{ |
|||
public class itemlabelsBusiness : BaseBusiness<itemlabels>, IitemlabelsBusiness, ITransientDependency |
|||
{ |
|||
public itemlabelsBusiness(IDbAccessor db) |
|||
: base(db) |
|||
{ |
|||
} |
|||
|
|||
#region 外部接口
|
|||
|
|||
public async Task<PageResult<itemlabels>> GetDataListAsync(PageInput<ConditionDTO> input) |
|||
{ |
|||
var q = GetIQueryable(); |
|||
var where = LinqHelper.True<itemlabels>(); |
|||
var search = input.Search; |
|||
|
|||
//筛选
|
|||
if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) |
|||
{ |
|||
var newWhere = DynamicExpressionParser.ParseLambda<itemlabels, bool>( |
|||
ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); |
|||
where = where.And(newWhere); |
|||
} |
|||
|
|||
return await q.Where(where).GetPageResultAsync(input); |
|||
} |
|||
|
|||
public async Task<itemlabels> GetTheDataAsync(string id) |
|||
{ |
|||
return await GetEntityAsync(id); |
|||
} |
|||
|
|||
public async Task AddDataAsync(itemlabels data) |
|||
{ |
|||
await InsertAsync(data); |
|||
} |
|||
|
|||
public async Task UpdateDataAsync(itemlabels data) |
|||
{ |
|||
await UpdateAsync(data); |
|||
} |
|||
|
|||
public async Task DeleteDataAsync(List<string> ids) |
|||
{ |
|||
await DeleteAsync(ids); |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 私有成员
|
|||
|
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using Coldairarrow.Util; |
|||
using EFCore.Sharding; |
|||
using LinqKit; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Linq.Dynamic.Core; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Business.HuiYan |
|||
{ |
|||
public class itemsBusiness : BaseBusiness<items>, IitemsBusiness, ITransientDependency |
|||
{ |
|||
public itemsBusiness(IDbAccessor db) |
|||
: base(db) |
|||
{ |
|||
} |
|||
|
|||
#region 外部接口
|
|||
|
|||
public async Task<PageResult<items>> GetDataListAsync(PageInput<ConditionDTO> input) |
|||
{ |
|||
var q = GetIQueryable(); |
|||
var where = LinqHelper.True<items>(); |
|||
var search = input.Search; |
|||
|
|||
//筛选
|
|||
if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) |
|||
{ |
|||
var newWhere = DynamicExpressionParser.ParseLambda<items, bool>( |
|||
ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); |
|||
where = where.And(newWhere); |
|||
} |
|||
|
|||
return await q.Where(where).GetPageResultAsync(input); |
|||
} |
|||
|
|||
public async Task<items> GetTheDataAsync(string id) |
|||
{ |
|||
return await GetEntityAsync(id); |
|||
} |
|||
|
|||
public async Task AddDataAsync(items data) |
|||
{ |
|||
await InsertAsync(data); |
|||
} |
|||
|
|||
public async Task UpdateDataAsync(items data) |
|||
{ |
|||
await UpdateAsync(data); |
|||
} |
|||
|
|||
public async Task DeleteDataAsync(List<string> ids) |
|||
{ |
|||
await DeleteAsync(ids); |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 私有成员
|
|||
|
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,124 @@ |
|||
using Coldairarrow.Entity.DTO; |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using Coldairarrow.Util; |
|||
using EFCore.Sharding; |
|||
using LinqKit; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Linq.Dynamic.Core; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Business.HuiYan |
|||
{ |
|||
public class teamitemsBusiness : BaseBusiness<teamitems>, IteamitemsBusiness, ITransientDependency |
|||
{ |
|||
public teamitemsBusiness(IDbAccessor db) |
|||
: base(db) |
|||
{ |
|||
} |
|||
|
|||
#region 外部接口
|
|||
|
|||
public async Task<PageResult<teamitems>> GetDataListAsync(PageInput<ConditionDTO> input) |
|||
{ |
|||
var q = GetIQueryable(); |
|||
var where = LinqHelper.True<teamitems>(); |
|||
var search = input.Search; |
|||
|
|||
//筛选
|
|||
if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) |
|||
{ |
|||
var newWhere = DynamicExpressionParser.ParseLambda<teamitems, bool>( |
|||
ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); |
|||
where = where.And(newWhere); |
|||
} |
|||
|
|||
return await q.Where(where).GetPageResultAsync(input); |
|||
} |
|||
|
|||
public async Task<teamitems> GetTheDataAsync(string id) |
|||
{ |
|||
return await GetEntityAsync(id); |
|||
} |
|||
|
|||
public async Task AddDataAsync(teamitems data) |
|||
{ |
|||
await InsertAsync(data); |
|||
} |
|||
|
|||
public async Task UpdateDataAsync(teamitems data) |
|||
{ |
|||
await UpdateAsync(data); |
|||
} |
|||
|
|||
public async Task DeleteDataAsync(List<string> ids) |
|||
{ |
|||
await DeleteAsync(ids); |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 私有成员
|
|||
|
|||
#endregion
|
|||
|
|||
|
|||
public AjaxResult AddItem(TeamitemDto model) |
|||
{ |
|||
|
|||
model.Extensions = new List<TeamItemExtension>(); |
|||
|
|||
for (int i = 0; i < 5; i++) |
|||
model.Extensions.Add(new TeamItemExtension() { Platform = 0 }); |
|||
|
|||
var item = Db.GetIQueryable<items>().FirstOrDefault(c => c.GoodsId == model.GoodsId); |
|||
if (item == null) |
|||
{ |
|||
item = new items() |
|||
{ |
|||
GoodsId = model.GoodsId, |
|||
|
|||
CreateTime = DateTime.Now, |
|||
CreatorId = string.Empty, |
|||
Deleted = false, |
|||
HasFilter = false, |
|||
Id = IdHelper.GetId(), |
|||
Platform = 0 |
|||
}; |
|||
|
|||
if (Db.Insert<items>(item) <= 0) |
|||
{ |
|||
return Error("商品添加失败!"); |
|||
} |
|||
} |
|||
|
|||
//设置为初选
|
|||
int row = Db.Insert<teamitems>(new teamitems() |
|||
{ |
|||
State = 0, |
|||
CreateTime = DateTime.Now, |
|||
CreatorId = string.Empty, |
|||
Deleted = false, |
|||
ExtensionJson = Newtonsoft.Json.JsonConvert.SerializeObject(model.Extensions), |
|||
Id = IdHelper.GetId(), |
|||
//待完善
|
|||
TeamId = string.Empty, |
|||
UserId = string.Empty, |
|||
|
|||
Price = model.Price, |
|||
ItemImg = model.ItemImg, |
|||
Sales = model.Sales, |
|||
Title = model.Title, |
|||
|
|||
ItemId = item.Id |
|||
}); |
|||
|
|||
if (row <= 0) |
|||
return Error("商品信息添加失败!"); |
|||
|
|||
return Success(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,75 @@ |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Entity.DTO |
|||
{ |
|||
public class TeamitemDto:teamitems |
|||
{ |
|||
/// <summary>
|
|||
/// 平台
|
|||
/// </summary>
|
|||
public int Platform { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否集团过滤
|
|||
/// </summary>
|
|||
public bool HasFilter { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 宝贝ID
|
|||
/// </summary>
|
|||
public string GoodsId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 扩展信息
|
|||
/// </summary>
|
|||
public List<TeamItemExtension> Extensions { get; set; } |
|||
} |
|||
|
|||
public class TeamItemExtension |
|||
{ |
|||
/// <summary>
|
|||
/// 平台
|
|||
/// </summary>
|
|||
public int Platform { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// SKU名称
|
|||
/// </summary>
|
|||
public string SkuName { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 采购链接
|
|||
/// </summary>
|
|||
public string BuyUrl { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 供应商来源方式
|
|||
/// </summary>
|
|||
public string SupplierFrom { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 采购价格
|
|||
/// </summary>
|
|||
public decimal BuyPrice { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 快递费
|
|||
/// </summary>
|
|||
public decimal KDPrice { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 平台扣点
|
|||
/// </summary>
|
|||
public decimal PlatformPoint { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 利润率
|
|||
/// </summary>
|
|||
public decimal Profits { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,71 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
|
|||
namespace Coldairarrow.Entity.HuiYan |
|||
{ |
|||
/// <summary>
|
|||
/// itemlabels
|
|||
/// </summary>
|
|||
[Table("itemlabels")] |
|||
public class itemlabels |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 主键
|
|||
/// </summary>
|
|||
[Key, Column(Order = 1)] |
|||
public String Id { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建时间
|
|||
/// </summary>
|
|||
public DateTime CreateTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建人Id
|
|||
/// </summary>
|
|||
public String CreatorId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 否已删除
|
|||
/// </summary>
|
|||
public Boolean Deleted { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 宝贝ID
|
|||
/// </summary>
|
|||
public String ItemsId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否筛选
|
|||
/// </summary>
|
|||
public Boolean IsScreening { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否过滤
|
|||
/// </summary>
|
|||
public Boolean IsFilter { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否竞品
|
|||
/// </summary>
|
|||
public Boolean IsCompeting { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否加入产品库
|
|||
/// </summary>
|
|||
public Boolean IsAdded { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 添加人
|
|||
/// </summary>
|
|||
public String UserId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 团队ID
|
|||
/// </summary>
|
|||
public String TeamId { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,51 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
|
|||
namespace Coldairarrow.Entity.HuiYan |
|||
{ |
|||
/// <summary>
|
|||
/// items
|
|||
/// </summary>
|
|||
[Table("items")] |
|||
public class items |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 主键
|
|||
/// </summary>
|
|||
[Key, Column(Order = 1)] |
|||
public String Id { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建时间
|
|||
/// </summary>
|
|||
public DateTime CreateTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建人Id
|
|||
/// </summary>
|
|||
public String CreatorId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 否已删除
|
|||
/// </summary>
|
|||
public Boolean Deleted { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 宝贝ID
|
|||
/// </summary>
|
|||
public String GoodsId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否集团过滤
|
|||
/// </summary>
|
|||
public Boolean HasFilter { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 所属平台
|
|||
/// </summary>
|
|||
public Int32 Platform { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,111 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
|
|||
namespace Coldairarrow.Entity.HuiYan |
|||
{ |
|||
/// <summary>
|
|||
/// teamitems
|
|||
/// </summary>
|
|||
[Table("teamitems")] |
|||
public class teamitems |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 主键
|
|||
/// </summary>
|
|||
[Key, Column(Order = 1)] |
|||
public String Id { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建时间
|
|||
/// </summary>
|
|||
public DateTime CreateTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建人Id
|
|||
/// </summary>
|
|||
public String CreatorId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 否已删除
|
|||
/// </summary>
|
|||
public Boolean Deleted { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 商品表的ID
|
|||
/// </summary>
|
|||
public String ItemId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 宝贝标题
|
|||
/// </summary>
|
|||
public String Title { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 宝贝价格
|
|||
/// </summary>
|
|||
public Decimal? Price { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 收货人数
|
|||
/// </summary>
|
|||
public Int32? Sales { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 商品图片
|
|||
/// </summary>
|
|||
public String ItemImg { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 添加人
|
|||
/// </summary>
|
|||
public String UserId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 团队Id
|
|||
/// </summary>
|
|||
public String TeamId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 对标商品标题
|
|||
/// </summary>
|
|||
public String RivalTitle { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 对标商品价格
|
|||
/// </summary>
|
|||
public Decimal? RivalPrice { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 对标收货人数
|
|||
/// </summary>
|
|||
public String RivalSales { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 对标商品图片
|
|||
/// </summary>
|
|||
public String RivalImg { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 对标商品ID
|
|||
/// </summary>
|
|||
public String RivalGoodsId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 状态
|
|||
/// </summary>
|
|||
public Int32? State { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 扩展信息
|
|||
/// </summary>
|
|||
public String ExtensionJson { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 对标商品评价数量
|
|||
/// </summary>
|
|||
public Int32? RivalPLCount { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using Coldairarrow.Util; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Business.HuiYan |
|||
{ |
|||
public interface IitemlabelsBusiness |
|||
{ |
|||
Task<PageResult<itemlabels>> GetDataListAsync(PageInput<ConditionDTO> input); |
|||
Task<itemlabels> GetTheDataAsync(string id); |
|||
Task AddDataAsync(itemlabels data); |
|||
Task UpdateDataAsync(itemlabels data); |
|||
Task DeleteDataAsync(List<string> ids); |
|||
} |
|||
} |
@ -0,0 +1,16 @@ |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using Coldairarrow.Util; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Business.HuiYan |
|||
{ |
|||
public interface IitemsBusiness |
|||
{ |
|||
Task<PageResult<items>> GetDataListAsync(PageInput<ConditionDTO> input); |
|||
Task<items> GetTheDataAsync(string id); |
|||
Task AddDataAsync(items data); |
|||
Task UpdateDataAsync(items data); |
|||
Task DeleteDataAsync(List<string> ids); |
|||
} |
|||
} |
@ -0,0 +1,19 @@ |
|||
using Coldairarrow.Entity.DTO; |
|||
using Coldairarrow.Entity.HuiYan; |
|||
using Coldairarrow.Util; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Coldairarrow.Business.HuiYan |
|||
{ |
|||
public interface IteamitemsBusiness |
|||
{ |
|||
Task<PageResult<teamitems>> GetDataListAsync(PageInput<ConditionDTO> input); |
|||
Task<teamitems> GetTheDataAsync(string id); |
|||
Task AddDataAsync(teamitems data); |
|||
Task UpdateDataAsync(teamitems data); |
|||
Task DeleteDataAsync(List<string> ids); |
|||
|
|||
AjaxResult AddItem(TeamitemDto model); |
|||
} |
|||
} |
@ -0,0 +1,98 @@ |
|||
<template> |
|||
<a-modal |
|||
:title="title" |
|||
width="40%" |
|||
:visible="visible" |
|||
:confirmLoading="loading" |
|||
@ok="handleSubmit" |
|||
@cancel="()=>{this.visible=false}" |
|||
> |
|||
<a-spin :spinning="loading"> |
|||
<a-form-model ref="form" :model="entity" :rules="rules" v-bind="layout"> |
|||
<a-form-model-item label="宝贝ID" prop="ItemsId"> |
|||
<a-input v-model="entity.ItemsId" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="是否筛选" prop="IsScreening"> |
|||
<a-input v-model="entity.IsScreening" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="是否过滤" prop="IsFilter"> |
|||
<a-input v-model="entity.IsFilter" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="是否竞品" prop="IsCompeting"> |
|||
<a-input v-model="entity.IsCompeting" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="是否加入产品库" prop="IsAdded"> |
|||
<a-input v-model="entity.IsAdded" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="添加人" prop="UserId"> |
|||
<a-input v-model="entity.UserId" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="团队ID" prop="TeamId"> |
|||
<a-input v-model="entity.TeamId" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
</a-form-model> |
|||
</a-spin> |
|||
</a-modal> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
props: { |
|||
parentObj: Object |
|||
}, |
|||
data() { |
|||
return { |
|||
layout: { |
|||
labelCol: { span: 5 }, |
|||
wrapperCol: { span: 18 } |
|||
}, |
|||
visible: false, |
|||
loading: false, |
|||
entity: {}, |
|||
rules: {}, |
|||
title: '' |
|||
} |
|||
}, |
|||
methods: { |
|||
init() { |
|||
this.visible = true |
|||
this.entity = {} |
|||
this.$nextTick(() => { |
|||
this.$refs['form'].clearValidate() |
|||
}) |
|||
}, |
|||
openForm(id, title) { |
|||
this.init() |
|||
|
|||
if (id) { |
|||
this.loading = true |
|||
this.$http.post('/HuiYan/itemlabels/GetTheData', { id: id }).then(resJson => { |
|||
this.loading = false |
|||
|
|||
this.entity = resJson.Data |
|||
}) |
|||
} |
|||
}, |
|||
handleSubmit() { |
|||
this.$refs['form'].validate(valid => { |
|||
if (!valid) { |
|||
return |
|||
} |
|||
this.loading = true |
|||
this.$http.post('/HuiYan/itemlabels/SaveData', this.entity).then(resJson => { |
|||
this.loading = false |
|||
|
|||
if (resJson.Success) { |
|||
this.$message.success('操作成功!') |
|||
this.visible = false |
|||
|
|||
this.parentObj.getDataList() |
|||
} else { |
|||
this.$message.error(resJson.Msg) |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,165 @@ |
|||
<template> |
|||
<a-card :bordered="false"> |
|||
<div class="table-operator"> |
|||
<a-button type="primary" icon="plus" @click="hanldleAdd()">新建</a-button> |
|||
<a-button |
|||
type="primary" |
|||
icon="minus" |
|||
@click="handleDelete(selectedRowKeys)" |
|||
:disabled="!hasSelected()" |
|||
:loading="loading" |
|||
>删除</a-button> |
|||
<a-button type="primary" icon="redo" @click="getDataList()">刷新</a-button> |
|||
</div> |
|||
|
|||
<div class="table-page-search-wrapper"> |
|||
<a-form layout="inline"> |
|||
<a-row :gutter="10"> |
|||
<a-col :md="4" :sm="24"> |
|||
<a-form-item label="查询类别"> |
|||
<a-select allowClear v-model="queryParam.condition"> |
|||
<a-select-option key="ItemsId">宝贝ID</a-select-option> |
|||
<a-select-option key="UserId">添加人</a-select-option> |
|||
<a-select-option key="TeamId">团队ID</a-select-option> |
|||
</a-select> |
|||
</a-form-item> |
|||
</a-col> |
|||
<a-col :md="4" :sm="24"> |
|||
<a-form-item> |
|||
<a-input v-model="queryParam.keyword" placeholder="关键字" /> |
|||
</a-form-item> |
|||
</a-col> |
|||
<a-col :md="6" :sm="24"> |
|||
<a-button type="primary" @click="() => {this.pagination.current = 1; this.getDataList()}">查询</a-button> |
|||
<a-button style="margin-left: 8px" @click="() => (queryParam = {})">重置</a-button> |
|||
</a-col> |
|||
</a-row> |
|||
</a-form> |
|||
</div> |
|||
|
|||
<a-table |
|||
ref="table" |
|||
:columns="columns" |
|||
:rowKey="row => row.Id" |
|||
:dataSource="data" |
|||
:pagination="pagination" |
|||
:loading="loading" |
|||
@change="handleTableChange" |
|||
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
|||
:bordered="true" |
|||
size="small" |
|||
> |
|||
<span slot="action" slot-scope="text, record"> |
|||
<template> |
|||
<a @click="handleEdit(record.Id)">编辑</a> |
|||
<a-divider type="vertical" /> |
|||
<a @click="handleDelete([record.Id])">删除</a> |
|||
</template> |
|||
</span> |
|||
</a-table> |
|||
|
|||
<edit-form ref="editForm" :parentObj="this"></edit-form> |
|||
</a-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import EditForm from './EditForm' |
|||
|
|||
const columns = [ |
|||
{ title: '宝贝ID', dataIndex: 'ItemsId', width: '10%' }, |
|||
{ title: '是否筛选', dataIndex: 'IsScreening', width: '10%' }, |
|||
{ title: '是否过滤', dataIndex: 'IsFilter', width: '10%' }, |
|||
{ title: '是否竞品', dataIndex: 'IsCompeting', width: '10%' }, |
|||
{ title: '是否加入产品库', dataIndex: 'IsAdded', width: '10%' }, |
|||
{ title: '添加人', dataIndex: 'UserId', width: '10%' }, |
|||
{ title: '团队ID', dataIndex: 'TeamId', width: '10%' }, |
|||
{ title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' } } |
|||
] |
|||
|
|||
export default { |
|||
components: { |
|||
EditForm |
|||
}, |
|||
mounted() { |
|||
this.getDataList() |
|||
}, |
|||
data() { |
|||
return { |
|||
data: [], |
|||
pagination: { |
|||
current: 1, |
|||
pageSize: 10, |
|||
showTotal: (total, range) => `总数:${total} 当前:${range[0]}-${range[1]}` |
|||
}, |
|||
filters: {}, |
|||
sorter: { field: 'Id', order: 'asc' }, |
|||
loading: false, |
|||
columns, |
|||
queryParam: {}, |
|||
selectedRowKeys: [] |
|||
} |
|||
}, |
|||
methods: { |
|||
handleTableChange(pagination, filters, sorter) { |
|||
this.pagination = { ...pagination } |
|||
this.filters = { ...filters } |
|||
this.sorter = { ...sorter } |
|||
this.getDataList() |
|||
}, |
|||
getDataList() { |
|||
this.selectedRowKeys = [] |
|||
|
|||
this.loading = true |
|||
this.$http |
|||
.post('/HuiYan/itemlabels/GetDataList', { |
|||
PageIndex: this.pagination.current, |
|||
PageRows: this.pagination.pageSize, |
|||
SortField: this.sorter.field || 'Id', |
|||
SortType: this.sorter.order, |
|||
Search: this.queryParam, |
|||
...this.filters |
|||
}) |
|||
.then(resJson => { |
|||
this.loading = false |
|||
this.data = resJson.Data |
|||
const pagination = { ...this.pagination } |
|||
pagination.total = resJson.Total |
|||
this.pagination = pagination |
|||
}) |
|||
}, |
|||
onSelectChange(selectedRowKeys) { |
|||
this.selectedRowKeys = selectedRowKeys |
|||
}, |
|||
hasSelected() { |
|||
return this.selectedRowKeys.length > 0 |
|||
}, |
|||
hanldleAdd() { |
|||
this.$refs.editForm.openForm() |
|||
}, |
|||
handleEdit(id) { |
|||
this.$refs.editForm.openForm(id) |
|||
}, |
|||
handleDelete(ids) { |
|||
var thisObj = this |
|||
this.$confirm({ |
|||
title: '确认删除吗?', |
|||
onOk() { |
|||
return new Promise((resolve, reject) => { |
|||
thisObj.$http.post('/HuiYan/itemlabels/DeleteData', ids).then(resJson => { |
|||
resolve() |
|||
|
|||
if (resJson.Success) { |
|||
thisObj.$message.success('操作成功!') |
|||
|
|||
thisObj.getDataList() |
|||
} else { |
|||
thisObj.$message.error(resJson.Msg) |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,86 @@ |
|||
<template> |
|||
<a-modal |
|||
:title="title" |
|||
width="40%" |
|||
:visible="visible" |
|||
:confirmLoading="loading" |
|||
@ok="handleSubmit" |
|||
@cancel="()=>{this.visible=false}" |
|||
> |
|||
<a-spin :spinning="loading"> |
|||
<a-form-model ref="form" :model="entity" :rules="rules" v-bind="layout"> |
|||
<a-form-model-item label="宝贝ID" prop="GoodsId"> |
|||
<a-input v-model="entity.GoodsId" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="是否集团过滤" prop="HasFilter"> |
|||
<a-input v-model="entity.HasFilter" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="所属平台" prop="Platform"> |
|||
<a-input v-model="entity.Platform" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
</a-form-model> |
|||
</a-spin> |
|||
</a-modal> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
props: { |
|||
parentObj: Object |
|||
}, |
|||
data() { |
|||
return { |
|||
layout: { |
|||
labelCol: { span: 5 }, |
|||
wrapperCol: { span: 18 } |
|||
}, |
|||
visible: false, |
|||
loading: false, |
|||
entity: {}, |
|||
rules: {}, |
|||
title: '' |
|||
} |
|||
}, |
|||
methods: { |
|||
init() { |
|||
this.visible = true |
|||
this.entity = {} |
|||
this.$nextTick(() => { |
|||
this.$refs['form'].clearValidate() |
|||
}) |
|||
}, |
|||
openForm(id, title) { |
|||
this.init() |
|||
|
|||
if (id) { |
|||
this.loading = true |
|||
this.$http.post('/HuiYan/items/GetTheData', { id: id }).then(resJson => { |
|||
this.loading = false |
|||
|
|||
this.entity = resJson.Data |
|||
}) |
|||
} |
|||
}, |
|||
handleSubmit() { |
|||
this.$refs['form'].validate(valid => { |
|||
if (!valid) { |
|||
return |
|||
} |
|||
this.loading = true |
|||
this.$http.post('/HuiYan/items/SaveData', this.entity).then(resJson => { |
|||
this.loading = false |
|||
|
|||
if (resJson.Success) { |
|||
this.$message.success('操作成功!') |
|||
this.visible = false |
|||
|
|||
this.parentObj.getDataList() |
|||
} else { |
|||
this.$message.error(resJson.Msg) |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,159 @@ |
|||
<template> |
|||
<a-card :bordered="false"> |
|||
<div class="table-operator"> |
|||
<a-button type="primary" icon="plus" @click="hanldleAdd()">新建</a-button> |
|||
<a-button |
|||
type="primary" |
|||
icon="minus" |
|||
@click="handleDelete(selectedRowKeys)" |
|||
:disabled="!hasSelected()" |
|||
:loading="loading" |
|||
>删除</a-button> |
|||
<a-button type="primary" icon="redo" @click="getDataList()">刷新</a-button> |
|||
</div> |
|||
|
|||
<div class="table-page-search-wrapper"> |
|||
<a-form layout="inline"> |
|||
<a-row :gutter="10"> |
|||
<a-col :md="4" :sm="24"> |
|||
<a-form-item label="查询类别"> |
|||
<a-select allowClear v-model="queryParam.condition"> |
|||
<a-select-option key="GoodsId">宝贝ID</a-select-option> |
|||
</a-select> |
|||
</a-form-item> |
|||
</a-col> |
|||
<a-col :md="4" :sm="24"> |
|||
<a-form-item> |
|||
<a-input v-model="queryParam.keyword" placeholder="关键字" /> |
|||
</a-form-item> |
|||
</a-col> |
|||
<a-col :md="6" :sm="24"> |
|||
<a-button type="primary" @click="() => {this.pagination.current = 1; this.getDataList()}">查询</a-button> |
|||
<a-button style="margin-left: 8px" @click="() => (queryParam = {})">重置</a-button> |
|||
</a-col> |
|||
</a-row> |
|||
</a-form> |
|||
</div> |
|||
|
|||
<a-table |
|||
ref="table" |
|||
:columns="columns" |
|||
:rowKey="row => row.Id" |
|||
:dataSource="data" |
|||
:pagination="pagination" |
|||
:loading="loading" |
|||
@change="handleTableChange" |
|||
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
|||
:bordered="true" |
|||
size="small" |
|||
> |
|||
<span slot="action" slot-scope="text, record"> |
|||
<template> |
|||
<a @click="handleEdit(record.Id)">编辑</a> |
|||
<a-divider type="vertical" /> |
|||
<a @click="handleDelete([record.Id])">删除</a> |
|||
</template> |
|||
</span> |
|||
</a-table> |
|||
|
|||
<edit-form ref="editForm" :parentObj="this"></edit-form> |
|||
</a-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import EditForm from './EditForm' |
|||
|
|||
const columns = [ |
|||
{ title: '宝贝ID', dataIndex: 'GoodsId', width: '10%' }, |
|||
{ title: '是否集团过滤', dataIndex: 'HasFilter', width: '10%' }, |
|||
{ title: '所属平台', dataIndex: 'Platform', width: '10%' }, |
|||
{ title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' } } |
|||
] |
|||
|
|||
export default { |
|||
components: { |
|||
EditForm |
|||
}, |
|||
mounted() { |
|||
this.getDataList() |
|||
}, |
|||
data() { |
|||
return { |
|||
data: [], |
|||
pagination: { |
|||
current: 1, |
|||
pageSize: 10, |
|||
showTotal: (total, range) => `总数:${total} 当前:${range[0]}-${range[1]}` |
|||
}, |
|||
filters: {}, |
|||
sorter: { field: 'Id', order: 'asc' }, |
|||
loading: false, |
|||
columns, |
|||
queryParam: {}, |
|||
selectedRowKeys: [] |
|||
} |
|||
}, |
|||
methods: { |
|||
handleTableChange(pagination, filters, sorter) { |
|||
this.pagination = { ...pagination } |
|||
this.filters = { ...filters } |
|||
this.sorter = { ...sorter } |
|||
this.getDataList() |
|||
}, |
|||
getDataList() { |
|||
this.selectedRowKeys = [] |
|||
|
|||
this.loading = true |
|||
this.$http |
|||
.post('/HuiYan/items/GetDataList', { |
|||
PageIndex: this.pagination.current, |
|||
PageRows: this.pagination.pageSize, |
|||
SortField: this.sorter.field || 'Id', |
|||
SortType: this.sorter.order, |
|||
Search: this.queryParam, |
|||
...this.filters |
|||
}) |
|||
.then(resJson => { |
|||
this.loading = false |
|||
this.data = resJson.Data |
|||
const pagination = { ...this.pagination } |
|||
pagination.total = resJson.Total |
|||
this.pagination = pagination |
|||
}) |
|||
}, |
|||
onSelectChange(selectedRowKeys) { |
|||
this.selectedRowKeys = selectedRowKeys |
|||
}, |
|||
hasSelected() { |
|||
return this.selectedRowKeys.length > 0 |
|||
}, |
|||
hanldleAdd() { |
|||
this.$refs.editForm.openForm() |
|||
}, |
|||
handleEdit(id) { |
|||
this.$refs.editForm.openForm(id) |
|||
}, |
|||
handleDelete(ids) { |
|||
var thisObj = this |
|||
this.$confirm({ |
|||
title: '确认删除吗?', |
|||
onOk() { |
|||
return new Promise((resolve, reject) => { |
|||
thisObj.$http.post('/HuiYan/items/DeleteData', ids).then(resJson => { |
|||
resolve() |
|||
|
|||
if (resJson.Success) { |
|||
thisObj.$message.success('操作成功!') |
|||
|
|||
thisObj.getDataList() |
|||
} else { |
|||
thisObj.$message.error(resJson.Msg) |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,122 @@ |
|||
<template> |
|||
<a-modal |
|||
:title="title" |
|||
width="40%" |
|||
:visible="visible" |
|||
:confirmLoading="loading" |
|||
@ok="handleSubmit" |
|||
@cancel="()=>{this.visible=false}" |
|||
> |
|||
<a-spin :spinning="loading"> |
|||
<a-form-model ref="form" :model="entity" :rules="rules" v-bind="layout"> |
|||
<a-form-model-item label="商品表的ID" prop="ItemId"> |
|||
<a-input v-model="entity.ItemId" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="宝贝标题" prop="Title"> |
|||
<a-input v-model="entity.Title" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="宝贝价格" prop="Price"> |
|||
<a-input v-model="entity.Price" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="收货人数" prop="Sales"> |
|||
<a-input v-model="entity.Sales" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="商品图片" prop="ItemImg"> |
|||
<a-input v-model="entity.ItemImg" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="添加人" prop="UserId"> |
|||
<a-input v-model="entity.UserId" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="团队Id" prop="TeamId"> |
|||
<a-input v-model="entity.TeamId" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="对标商品标题" prop="RivalTitle"> |
|||
<a-input v-model="entity.RivalTitle" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="对标商品价格" prop="RivalPrice"> |
|||
<a-input v-model="entity.RivalPrice" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="对标收货人数" prop="RivalSales"> |
|||
<a-input v-model="entity.RivalSales" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="对标商品图片" prop="RivalImg"> |
|||
<a-input v-model="entity.RivalImg" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="对标商品ID" prop="RivalGoodsId"> |
|||
<a-input v-model="entity.RivalGoodsId" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="状态" prop="State"> |
|||
<a-input v-model="entity.State" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="扩展信息" prop="ExtensionJson"> |
|||
<a-input v-model="entity.ExtensionJson" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
<a-form-model-item label="对标商品评价数量" prop="RivalPLCount"> |
|||
<a-input v-model="entity.RivalPLCount" autocomplete="off" /> |
|||
</a-form-model-item> |
|||
</a-form-model> |
|||
</a-spin> |
|||
</a-modal> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
props: { |
|||
parentObj: Object |
|||
}, |
|||
data() { |
|||
return { |
|||
layout: { |
|||
labelCol: { span: 5 }, |
|||
wrapperCol: { span: 18 } |
|||
}, |
|||
visible: false, |
|||
loading: false, |
|||
entity: {}, |
|||
rules: {}, |
|||
title: '' |
|||
} |
|||
}, |
|||
methods: { |
|||
init() { |
|||
this.visible = true |
|||
this.entity = {} |
|||
this.$nextTick(() => { |
|||
this.$refs['form'].clearValidate() |
|||
}) |
|||
}, |
|||
openForm(id, title) { |
|||
this.init() |
|||
|
|||
if (id) { |
|||
this.loading = true |
|||
this.$http.post('/HuiYan/teamitems/GetTheData', { id: id }).then(resJson => { |
|||
this.loading = false |
|||
|
|||
this.entity = resJson.Data |
|||
}) |
|||
} |
|||
}, |
|||
handleSubmit() { |
|||
this.$refs['form'].validate(valid => { |
|||
if (!valid) { |
|||
return |
|||
} |
|||
this.loading = true |
|||
this.$http.post('/HuiYan/teamitems/SaveData', this.entity).then(resJson => { |
|||
this.loading = false |
|||
|
|||
if (resJson.Success) { |
|||
this.$message.success('操作成功!') |
|||
this.visible = false |
|||
|
|||
this.parentObj.getDataList() |
|||
} else { |
|||
this.$message.error(resJson.Msg) |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,180 @@ |
|||
<template> |
|||
<a-card :bordered="false"> |
|||
<div class="table-operator"> |
|||
<a-button type="primary" icon="plus" @click="hanldleAdd()">新建</a-button> |
|||
<a-button |
|||
type="primary" |
|||
icon="minus" |
|||
@click="handleDelete(selectedRowKeys)" |
|||
:disabled="!hasSelected()" |
|||
:loading="loading" |
|||
>删除</a-button> |
|||
<a-button type="primary" icon="redo" @click="getDataList()">刷新</a-button> |
|||
</div> |
|||
|
|||
<div class="table-page-search-wrapper"> |
|||
<a-form layout="inline"> |
|||
<a-row :gutter="10"> |
|||
<a-col :md="4" :sm="24"> |
|||
<a-form-item label="查询类别"> |
|||
<a-select allowClear v-model="queryParam.condition"> |
|||
<a-select-option key="ItemId">商品表的ID</a-select-option> |
|||
<a-select-option key="Title">宝贝标题</a-select-option> |
|||
<a-select-option key="ItemImg">商品图片</a-select-option> |
|||
<a-select-option key="UserId">添加人</a-select-option> |
|||
<a-select-option key="TeamId">团队Id</a-select-option> |
|||
<a-select-option key="RivalTitle">对标商品标题</a-select-option> |
|||
<a-select-option key="RivalSales">对标收货人数</a-select-option> |
|||
<a-select-option key="RivalImg">对标商品图片</a-select-option> |
|||
<a-select-option key="RivalGoodsId">对标商品ID</a-select-option> |
|||
<a-select-option key="ExtensionJson">扩展信息</a-select-option> |
|||
</a-select> |
|||
</a-form-item> |
|||
</a-col> |
|||
<a-col :md="4" :sm="24"> |
|||
<a-form-item> |
|||
<a-input v-model="queryParam.keyword" placeholder="关键字" /> |
|||
</a-form-item> |
|||
</a-col> |
|||
<a-col :md="6" :sm="24"> |
|||
<a-button type="primary" @click="() => {this.pagination.current = 1; this.getDataList()}">查询</a-button> |
|||
<a-button style="margin-left: 8px" @click="() => (queryParam = {})">重置</a-button> |
|||
</a-col> |
|||
</a-row> |
|||
</a-form> |
|||
</div> |
|||
|
|||
<a-table |
|||
ref="table" |
|||
:columns="columns" |
|||
:rowKey="row => row.Id" |
|||
:dataSource="data" |
|||
:pagination="pagination" |
|||
:loading="loading" |
|||
@change="handleTableChange" |
|||
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" |
|||
:bordered="true" |
|||
size="small" |
|||
> |
|||
<span slot="action" slot-scope="text, record"> |
|||
<template> |
|||
<a @click="handleEdit(record.Id)">编辑</a> |
|||
<a-divider type="vertical" /> |
|||
<a @click="handleDelete([record.Id])">删除</a> |
|||
</template> |
|||
</span> |
|||
</a-table> |
|||
|
|||
<edit-form ref="editForm" :parentObj="this"></edit-form> |
|||
</a-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import EditForm from './EditForm' |
|||
|
|||
const columns = [ |
|||
{ title: '商品表的ID', dataIndex: 'ItemId', width: '10%' }, |
|||
{ title: '宝贝标题', dataIndex: 'Title', width: '10%' }, |
|||
{ title: '宝贝价格', dataIndex: 'Price', width: '10%' }, |
|||
{ title: '收货人数', dataIndex: 'Sales', width: '10%' }, |
|||
{ title: '商品图片', dataIndex: 'ItemImg', width: '10%' }, |
|||
{ title: '添加人', dataIndex: 'UserId', width: '10%' }, |
|||
{ title: '团队Id', dataIndex: 'TeamId', width: '10%' }, |
|||
{ title: '对标商品标题', dataIndex: 'RivalTitle', width: '10%' }, |
|||
{ title: '对标商品价格', dataIndex: 'RivalPrice', width: '10%' }, |
|||
{ title: '对标收货人数', dataIndex: 'RivalSales', width: '10%' }, |
|||
{ title: '对标商品图片', dataIndex: 'RivalImg', width: '10%' }, |
|||
{ title: '对标商品ID', dataIndex: 'RivalGoodsId', width: '10%' }, |
|||
{ title: '状态', dataIndex: 'State', width: '10%' }, |
|||
{ title: '扩展信息', dataIndex: 'ExtensionJson', width: '10%' }, |
|||
{ title: '对标商品评价数量', dataIndex: 'RivalPLCount', width: '10%' }, |
|||
{ title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' } } |
|||
] |
|||
|
|||
export default { |
|||
components: { |
|||
EditForm |
|||
}, |
|||
mounted() { |
|||
this.getDataList() |
|||
}, |
|||
data() { |
|||
return { |
|||
data: [], |
|||
pagination: { |
|||
current: 1, |
|||
pageSize: 10, |
|||
showTotal: (total, range) => `总数:${total} 当前:${range[0]}-${range[1]}` |
|||
}, |
|||
filters: {}, |
|||
sorter: { field: 'Id', order: 'asc' }, |
|||
loading: false, |
|||
columns, |
|||
queryParam: {}, |
|||
selectedRowKeys: [] |
|||
} |
|||
}, |
|||
methods: { |
|||
handleTableChange(pagination, filters, sorter) { |
|||
this.pagination = { ...pagination } |
|||
this.filters = { ...filters } |
|||
this.sorter = { ...sorter } |
|||
this.getDataList() |
|||
}, |
|||
getDataList() { |
|||
this.selectedRowKeys = [] |
|||
|
|||
this.loading = true |
|||
this.$http |
|||
.post('/HuiYan/teamitems/GetDataList', { |
|||
PageIndex: this.pagination.current, |
|||
PageRows: this.pagination.pageSize, |
|||
SortField: this.sorter.field || 'Id', |
|||
SortType: this.sorter.order, |
|||
Search: this.queryParam, |
|||
...this.filters |
|||
}) |
|||
.then(resJson => { |
|||
this.loading = false |
|||
this.data = resJson.Data |
|||
const pagination = { ...this.pagination } |
|||
pagination.total = resJson.Total |
|||
this.pagination = pagination |
|||
}) |
|||
}, |
|||
onSelectChange(selectedRowKeys) { |
|||
this.selectedRowKeys = selectedRowKeys |
|||
}, |
|||
hasSelected() { |
|||
return this.selectedRowKeys.length > 0 |
|||
}, |
|||
hanldleAdd() { |
|||
this.$refs.editForm.openForm() |
|||
}, |
|||
handleEdit(id) { |
|||
this.$refs.editForm.openForm(id) |
|||
}, |
|||
handleDelete(ids) { |
|||
var thisObj = this |
|||
this.$confirm({ |
|||
title: '确认删除吗?', |
|||
onOk() { |
|||
return new Promise((resolve, reject) => { |
|||
thisObj.$http.post('/HuiYan/teamitems/DeleteData', ids).then(resJson => { |
|||
resolve() |
|||
|
|||
if (resJson.Success) { |
|||
thisObj.$message.success('操作成功!') |
|||
|
|||
thisObj.getDataList() |
|||
} else { |
|||
thisObj.$message.error(resJson.Msg) |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue