19 changed files with 1547 additions and 1 deletions
@ -0,0 +1,65 @@ |
|||||
|
using Coldairarrow.Business.JDSku; |
||||
|
using Coldairarrow.Entity.JDSku; |
||||
|
using Coldairarrow.Util; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Coldairarrow.Api.Controllers.JDSku |
||||
|
{ |
||||
|
[Route("/JDSku/[controller]/[action]")]
|
||||
|
public class jdskuchangeController : BaseApiController |
||||
|
{ |
||||
|
#region DI
|
||||
|
|
||||
|
public jdskuchangeController(IjdskuchangeBusiness jdskuchangeBus) |
||||
|
{ |
||||
|
_jdskuchangeBus = jdskuchangeBus; |
||||
|
} |
||||
|
|
||||
|
IjdskuchangeBusiness _jdskuchangeBus { get; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取
|
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task<PageResult<jdskuchange>> GetDataList(PageInput<ConditionDTO> input) |
||||
|
{ |
||||
|
return await _jdskuchangeBus.GetDataListAsync(input); |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task<jdskuchange> GetTheData(IdInputDTO input) |
||||
|
{ |
||||
|
return await _jdskuchangeBus.GetTheDataAsync(input.id); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 提交
|
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task SaveData(jdskuchange data) |
||||
|
{ |
||||
|
if (data.Id.IsNullOrEmpty()) |
||||
|
{ |
||||
|
InitEntity(data); |
||||
|
|
||||
|
await _jdskuchangeBus.AddDataAsync(data); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
await _jdskuchangeBus.UpdateDataAsync(data); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task DeleteData(List<string> ids) |
||||
|
{ |
||||
|
await _jdskuchangeBus.DeleteDataAsync(ids); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
} |
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
using Coldairarrow.Business.JDSku; |
||||
|
using Coldairarrow.Entity.JDSku; |
||||
|
using Coldairarrow.Util; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Coldairarrow.Api.Controllers.JDSku |
||||
|
{ |
||||
|
[Route("/JDSku/[controller]/[action]")]
|
||||
|
public class jdskuinfoController : BaseApiController |
||||
|
{ |
||||
|
#region DI
|
||||
|
|
||||
|
public jdskuinfoController(IjdskuinfoBusiness jdskuinfoBus) |
||||
|
{ |
||||
|
_jdskuinfoBus = jdskuinfoBus; |
||||
|
} |
||||
|
|
||||
|
IjdskuinfoBusiness _jdskuinfoBus { get; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取
|
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task<PageResult<jdskuinfo>> GetDataList(PageInput<ConditionDTO> input) |
||||
|
{ |
||||
|
return await _jdskuinfoBus.GetDataListAsync(input); |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task<jdskuinfo> GetTheData(IdInputDTO input) |
||||
|
{ |
||||
|
return await _jdskuinfoBus.GetTheDataAsync(input.id); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 提交
|
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task SaveData(jdskuinfo data) |
||||
|
{ |
||||
|
if (data.Id.IsNullOrEmpty()) |
||||
|
{ |
||||
|
InitEntity(data); |
||||
|
|
||||
|
await _jdskuinfoBus.AddDataAsync(data); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
await _jdskuinfoBus.UpdateDataAsync(data); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task DeleteData(List<string> ids) |
||||
|
{ |
||||
|
await _jdskuinfoBus.DeleteDataAsync(ids); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
} |
||||
|
} |
@ -0,0 +1,78 @@ |
|||||
|
using Coldairarrow.Business.JDSku; |
||||
|
using Coldairarrow.Entity.JDSku; |
||||
|
using Coldairarrow.Util; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Coldairarrow.Api.Controllers.JDSku |
||||
|
{ |
||||
|
[Route("/JDSku/[controller]/[action]")]
|
||||
|
public class jdskutaskController : BaseApiController |
||||
|
{ |
||||
|
#region DI
|
||||
|
|
||||
|
public jdskutaskController(IjdskutaskBusiness jdskutaskBus) |
||||
|
{ |
||||
|
_jdskutaskBus = jdskutaskBus; |
||||
|
} |
||||
|
|
||||
|
IjdskutaskBusiness _jdskutaskBus { get; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 获取
|
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task<PageResult<jdskutask>> GetDataList(PageInput<ConditionDTO> input) |
||||
|
{ |
||||
|
return await _jdskutaskBus.GetDataListAsync(input); |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task<jdskutask> GetTheData(IdInputDTO input) |
||||
|
{ |
||||
|
return await _jdskutaskBus.GetTheDataAsync(input.id); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 提交
|
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task SaveData(jdskutask data) |
||||
|
{ |
||||
|
if (data.Id.IsNullOrEmpty()) |
||||
|
{ |
||||
|
InitEntity(data); |
||||
|
|
||||
|
await _jdskutaskBus.AddDataAsync(data); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
await _jdskutaskBus.UpdateDataAsync(data); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
[HttpPost] |
||||
|
public async Task DeleteData(List<string> ids) |
||||
|
{ |
||||
|
await _jdskutaskBus.DeleteDataAsync(ids); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 发布任务
|
||||
|
/// </summary>
|
||||
|
/// <param name="model"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost] |
||||
|
public async Task PushTask([FromBody] jdskutask model) |
||||
|
{ |
||||
|
await _jdskutaskBus.PushTask(model); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
using Coldairarrow.Entity.JDSku; |
||||
|
using Coldairarrow.Util; |
||||
|
using Coldairarrow.Util.DataAccess; |
||||
|
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.JDSku |
||||
|
{ |
||||
|
public class jdskuchangeBusiness : BaseBusiness<jdskuchange>, IjdskuchangeBusiness, ITransientDependency |
||||
|
{ |
||||
|
public jdskuchangeBusiness(IMDSDbAccessor db) |
||||
|
: base(db) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
#region 外部接口
|
||||
|
|
||||
|
public async Task<PageResult<jdskuchange>> GetDataListAsync(PageInput<ConditionDTO> input) |
||||
|
{ |
||||
|
var q = GetIQueryable(); |
||||
|
var where = LinqHelper.True<jdskuchange>(); |
||||
|
var search = input.Search; |
||||
|
|
||||
|
//筛选
|
||||
|
if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) |
||||
|
{ |
||||
|
var newWhere = DynamicExpressionParser.ParseLambda<jdskuchange, bool>( |
||||
|
ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); |
||||
|
where = where.And(newWhere); |
||||
|
} |
||||
|
|
||||
|
return await q.Where(where).GetPageResultAsync(input); |
||||
|
} |
||||
|
|
||||
|
public async Task<jdskuchange> GetTheDataAsync(string id) |
||||
|
{ |
||||
|
return await GetEntityAsync(id); |
||||
|
} |
||||
|
|
||||
|
public async Task AddDataAsync(jdskuchange data) |
||||
|
{ |
||||
|
await InsertAsync(data); |
||||
|
} |
||||
|
|
||||
|
public async Task UpdateDataAsync(jdskuchange data) |
||||
|
{ |
||||
|
await UpdateAsync(data); |
||||
|
} |
||||
|
|
||||
|
public async Task DeleteDataAsync(List<string> ids) |
||||
|
{ |
||||
|
await DeleteAsync(ids); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 私有成员
|
||||
|
|
||||
|
#endregion
|
||||
|
} |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
using Coldairarrow.Entity.JDSku; |
||||
|
using Coldairarrow.Util; |
||||
|
using Coldairarrow.Util.DataAccess; |
||||
|
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.JDSku |
||||
|
{ |
||||
|
public class jdskuinfoBusiness : BaseBusiness<jdskuinfo>, IjdskuinfoBusiness, ITransientDependency |
||||
|
{ |
||||
|
public jdskuinfoBusiness(IMDSDbAccessor db) |
||||
|
: base(db) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
#region 外部接口
|
||||
|
|
||||
|
public async Task<PageResult<jdskuinfo>> GetDataListAsync(PageInput<ConditionDTO> input) |
||||
|
{ |
||||
|
var q = GetIQueryable(); |
||||
|
var where = LinqHelper.True<jdskuinfo>(); |
||||
|
var search = input.Search; |
||||
|
|
||||
|
//筛选
|
||||
|
if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) |
||||
|
{ |
||||
|
var newWhere = DynamicExpressionParser.ParseLambda<jdskuinfo, bool>( |
||||
|
ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); |
||||
|
where = where.And(newWhere); |
||||
|
} |
||||
|
|
||||
|
return await q.Where(where).GetPageResultAsync(input); |
||||
|
} |
||||
|
|
||||
|
public async Task<jdskuinfo> GetTheDataAsync(string id) |
||||
|
{ |
||||
|
return await GetEntityAsync(id); |
||||
|
} |
||||
|
|
||||
|
public async Task AddDataAsync(jdskuinfo data) |
||||
|
{ |
||||
|
await InsertAsync(data); |
||||
|
} |
||||
|
|
||||
|
public async Task UpdateDataAsync(jdskuinfo data) |
||||
|
{ |
||||
|
await UpdateAsync(data); |
||||
|
} |
||||
|
|
||||
|
public async Task DeleteDataAsync(List<string> ids) |
||||
|
{ |
||||
|
await DeleteAsync(ids); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 私有成员
|
||||
|
|
||||
|
#endregion
|
||||
|
} |
||||
|
} |
@ -0,0 +1,85 @@ |
|||||
|
using Coldairarrow.Entity.JDSku; |
||||
|
using Coldairarrow.IBusiness; |
||||
|
using Coldairarrow.Util; |
||||
|
using Coldairarrow.Util.DataAccess; |
||||
|
using EFCore.Sharding; |
||||
|
using LinqKit; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.Extensions.Caching.Distributed; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Dynamic.Core; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Coldairarrow.Business.JDSku |
||||
|
{ |
||||
|
public class jdskutaskBusiness : BaseBusiness<jdskutask>, IjdskutaskBusiness, ITransientDependency |
||||
|
{ |
||||
|
readonly IOperator _operator; |
||||
|
readonly IDistributedCache _cache; |
||||
|
public jdskutaskBusiness(IDbAccessor db, IOperator @operator, IDistributedCache cache) |
||||
|
: base(db) |
||||
|
{ |
||||
|
_operator = @operator; |
||||
|
_cache = cache; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#region 外部接口
|
||||
|
|
||||
|
public async Task<PageResult<jdskutask>> GetDataListAsync(PageInput<ConditionDTO> input) |
||||
|
{ |
||||
|
var q = GetIQueryable(); |
||||
|
var where = LinqHelper.True<jdskutask>(); |
||||
|
var search = input.Search; |
||||
|
|
||||
|
//筛选
|
||||
|
if (!search.Condition.IsNullOrEmpty() && !search.Keyword.IsNullOrEmpty()) |
||||
|
{ |
||||
|
var newWhere = DynamicExpressionParser.ParseLambda<jdskutask, bool>( |
||||
|
ParsingConfig.Default, false, $@"{search.Condition}.Contains(@0)", search.Keyword); |
||||
|
where = where.And(newWhere); |
||||
|
} |
||||
|
|
||||
|
return await q.Where(where).GetPageResultAsync(input); |
||||
|
} |
||||
|
|
||||
|
public async Task<jdskutask> GetTheDataAsync(string id) |
||||
|
{ |
||||
|
return await GetEntityAsync(id); |
||||
|
} |
||||
|
|
||||
|
public async Task AddDataAsync(jdskutask data) |
||||
|
{ |
||||
|
await InsertAsync(data); |
||||
|
} |
||||
|
|
||||
|
public async Task UpdateDataAsync(jdskutask data) |
||||
|
{ |
||||
|
await UpdateAsync(data); |
||||
|
} |
||||
|
|
||||
|
public async Task DeleteDataAsync(List<string> ids) |
||||
|
{ |
||||
|
await DeleteAsync(ids); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 私有成员
|
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
public async Task PushTask(jdskutask model) |
||||
|
{ |
||||
|
model.Id = IdHelper.GetId(); |
||||
|
model.CreateTime = System.DateTime.Now; |
||||
|
model.UserId = _operator.UserId; |
||||
|
model.TeamId = _operator.TeamId; |
||||
|
model.State = null; |
||||
|
|
||||
|
await Db.InsertAsync(model); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,106 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace Coldairarrow.Entity.JDSku |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// jd采集商品变化记录
|
||||
|
/// </summary>
|
||||
|
[Table("jdskuchange")] |
||||
|
public class jdskuchange |
||||
|
{ |
||||
|
|
||||
|
/// <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 TaskId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 价格
|
||||
|
/// </summary>
|
||||
|
public Decimal? OldPrice { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新价格
|
||||
|
/// </summary>
|
||||
|
public Decimal? NewPrice { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 活动
|
||||
|
/// </summary>
|
||||
|
public String OldActive { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新活动
|
||||
|
/// </summary>
|
||||
|
public String NewActive { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 促销
|
||||
|
/// </summary>
|
||||
|
public String OldPromotion { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新促销
|
||||
|
/// </summary>
|
||||
|
public String NewPromotion { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 优惠券
|
||||
|
/// </summary>
|
||||
|
public String OldCoupons { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新优惠券
|
||||
|
/// </summary>
|
||||
|
public String NewCoupons { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 相邻sku
|
||||
|
/// </summary>
|
||||
|
public String NewSkus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新的相邻Sku
|
||||
|
/// </summary>
|
||||
|
public String OldSkus { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Sku表的Id
|
||||
|
/// </summary>
|
||||
|
public String SkuId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 旧的标题
|
||||
|
/// </summary>
|
||||
|
public String OldTitle { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 新的标题
|
||||
|
/// </summary>
|
||||
|
public String NewTitle { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace Coldairarrow.Entity.JDSku |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 京东采集sku详情表
|
||||
|
/// </summary>
|
||||
|
[Table("jdskuinfo")] |
||||
|
public class jdskuinfo |
||||
|
{ |
||||
|
|
||||
|
/// <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>
|
||||
|
/// sku
|
||||
|
/// </summary>
|
||||
|
public String Sku { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 图片地址
|
||||
|
/// </summary>
|
||||
|
public String ImgUrl { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备注
|
||||
|
/// </summary>
|
||||
|
public String Desc { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
|
||||
|
namespace Coldairarrow.Entity.JDSku |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 京东sku采集任务池
|
||||
|
/// </summary>
|
||||
|
[Table("jdskutask")] |
||||
|
public class jdskutask |
||||
|
{ |
||||
|
|
||||
|
/// <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>
|
||||
|
/// 采集的Sku
|
||||
|
/// </summary>
|
||||
|
public String Sku { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 用户自己的SKU
|
||||
|
/// </summary>
|
||||
|
public String UserSku { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 提交人
|
||||
|
/// </summary>
|
||||
|
public String UserId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采集人
|
||||
|
/// </summary>
|
||||
|
public String WorkUserId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
public Int32? State { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采集任务开始时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? WorkStartDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采集结束时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? WorkEndDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 团队ID
|
||||
|
/// </summary>
|
||||
|
public String TeamId { get; set; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
using Coldairarrow.Entity.JDSku; |
||||
|
using Coldairarrow.Util; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Coldairarrow.Business.JDSku |
||||
|
{ |
||||
|
public interface IjdskuchangeBusiness |
||||
|
{ |
||||
|
Task<PageResult<jdskuchange>> GetDataListAsync(PageInput<ConditionDTO> input); |
||||
|
Task<jdskuchange> GetTheDataAsync(string id); |
||||
|
Task AddDataAsync(jdskuchange data); |
||||
|
Task UpdateDataAsync(jdskuchange data); |
||||
|
Task DeleteDataAsync(List<string> ids); |
||||
|
} |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
using Coldairarrow.Entity.JDSku; |
||||
|
using Coldairarrow.Util; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Coldairarrow.Business.JDSku |
||||
|
{ |
||||
|
public interface IjdskuinfoBusiness |
||||
|
{ |
||||
|
Task<PageResult<jdskuinfo>> GetDataListAsync(PageInput<ConditionDTO> input); |
||||
|
Task<jdskuinfo> GetTheDataAsync(string id); |
||||
|
Task AddDataAsync(jdskuinfo data); |
||||
|
Task UpdateDataAsync(jdskuinfo data); |
||||
|
Task DeleteDataAsync(List<string> ids); |
||||
|
} |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
using Coldairarrow.Entity.JDSku; |
||||
|
using Coldairarrow.Util; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Coldairarrow.Business.JDSku |
||||
|
{ |
||||
|
public interface IjdskutaskBusiness |
||||
|
{ |
||||
|
Task<PageResult<jdskutask>> GetDataListAsync(PageInput<ConditionDTO> input); |
||||
|
Task<jdskutask> GetTheDataAsync(string id); |
||||
|
Task AddDataAsync(jdskutask data); |
||||
|
Task UpdateDataAsync(jdskutask data); |
||||
|
Task DeleteDataAsync(List<string> ids); |
||||
|
Task PushTask(jdskutask model); |
||||
|
} |
||||
|
} |
@ -0,0 +1,119 @@ |
|||||
|
<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="TaskId"> |
||||
|
<a-input v-model="entity.TaskId" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="价格" prop="OldPrice"> |
||||
|
<a-input v-model="entity.OldPrice" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="新价格" prop="NewPrice"> |
||||
|
<a-input v-model="entity.NewPrice" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="活动" prop="OldActive"> |
||||
|
<a-input v-model="entity.OldActive" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="新活动" prop="NewActive"> |
||||
|
<a-input v-model="entity.NewActive" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="促销" prop="OldPromotion"> |
||||
|
<a-input v-model="entity.OldPromotion" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="新促销" prop="NewPromotion"> |
||||
|
<a-input v-model="entity.NewPromotion" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="优惠券" prop="OldCoupons"> |
||||
|
<a-input v-model="entity.OldCoupons" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="新优惠券" prop="NewCoupons"> |
||||
|
<a-input v-model="entity.NewCoupons" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="相邻sku" prop="NewSkus"> |
||||
|
<a-input v-model="entity.NewSkus" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="新的相邻Sku" prop="OldSkus"> |
||||
|
<a-input v-model="entity.OldSkus" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="Sku表的Id" prop="SkuId"> |
||||
|
<a-input v-model="entity.SkuId" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="旧的标题" prop="OldTitle"> |
||||
|
<a-input v-model="entity.OldTitle" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="新的标题" prop="NewTitle"> |
||||
|
<a-input v-model="entity.NewTitle" 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('/JDSku/jdskuchange/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('/JDSku/jdskuchange/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,181 @@ |
|||||
|
<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="TaskId">京东采集任务ID</a-select-option> |
||||
|
<a-select-option key="OldActive">活动</a-select-option> |
||||
|
<a-select-option key="NewActive">新活动</a-select-option> |
||||
|
<a-select-option key="OldPromotion">促销</a-select-option> |
||||
|
<a-select-option key="NewPromotion">新促销</a-select-option> |
||||
|
<a-select-option key="OldCoupons">优惠券</a-select-option> |
||||
|
<a-select-option key="NewCoupons">新优惠券</a-select-option> |
||||
|
<a-select-option key="NewSkus">相邻sku</a-select-option> |
||||
|
<a-select-option key="OldSkus">新的相邻Sku</a-select-option> |
||||
|
<a-select-option key="SkuId">Sku表的Id</a-select-option> |
||||
|
<a-select-option key="OldTitle">旧的标题</a-select-option> |
||||
|
<a-select-option key="NewTitle">新的标题</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: 'TaskId', width: '10%' }, |
||||
|
{ title: '价格', dataIndex: 'OldPrice', width: '10%' }, |
||||
|
{ title: '新价格', dataIndex: 'NewPrice', width: '10%' }, |
||||
|
{ title: '活动', dataIndex: 'OldActive', width: '10%' }, |
||||
|
{ title: '新活动', dataIndex: 'NewActive', width: '10%' }, |
||||
|
{ title: '促销', dataIndex: 'OldPromotion', width: '10%' }, |
||||
|
{ title: '新促销', dataIndex: 'NewPromotion', width: '10%' }, |
||||
|
{ title: '优惠券', dataIndex: 'OldCoupons', width: '10%' }, |
||||
|
{ title: '新优惠券', dataIndex: 'NewCoupons', width: '10%' }, |
||||
|
{ title: '相邻sku', dataIndex: 'NewSkus', width: '10%' }, |
||||
|
{ title: '新的相邻Sku', dataIndex: 'OldSkus', width: '10%' }, |
||||
|
{ title: 'Sku表的Id', dataIndex: 'SkuId', width: '10%' }, |
||||
|
{ title: '旧的标题', dataIndex: 'OldTitle', width: '10%' }, |
||||
|
{ title: '新的标题', dataIndex: 'NewTitle', 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('/JDSku/jdskuchange/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('/JDSku/jdskuchange/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="sku" prop="Sku"> |
||||
|
<a-input v-model="entity.Sku" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="图片地址" prop="ImgUrl"> |
||||
|
<a-input v-model="entity.ImgUrl" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="备注" prop="Desc"> |
||||
|
<a-input v-model="entity.Desc" 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('/JDSku/jdskuinfo/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('/JDSku/jdskuinfo/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,161 @@ |
|||||
|
<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="Sku">sku</a-select-option> |
||||
|
<a-select-option key="ImgUrl">图片地址</a-select-option> |
||||
|
<a-select-option key="Desc">备注</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: 'sku', dataIndex: 'Sku', width: '10%' }, |
||||
|
{ title: '图片地址', dataIndex: 'ImgUrl', width: '10%' }, |
||||
|
{ title: '备注', dataIndex: 'Desc', 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('/JDSku/jdskuinfo/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('/JDSku/jdskuinfo/DeleteData', ids).then(resJson => { |
||||
|
resolve() |
||||
|
|
||||
|
if (resJson.Success) { |
||||
|
thisObj.$message.success('操作成功!') |
||||
|
|
||||
|
thisObj.getDataList() |
||||
|
} else { |
||||
|
thisObj.$message.error(resJson.Msg) |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,101 @@ |
|||||
|
<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="采集的Sku" prop="Sku"> |
||||
|
<a-input v-model="entity.Sku" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="用户自己的SKU" prop="UserSku"> |
||||
|
<a-input v-model="entity.UserSku" 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="采集人" prop="WorkUserId"> |
||||
|
<a-input v-model="entity.WorkUserId" 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="WorkStartDate"> |
||||
|
<a-input v-model="entity.WorkStartDate" autocomplete="off" /> |
||||
|
</a-form-model-item> |
||||
|
<a-form-model-item label="采集结束时间" prop="WorkEndDate"> |
||||
|
<a-input v-model="entity.WorkEndDate" 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('/JDSku/jdskutask/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('/JDSku/jdskutask/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,168 @@ |
|||||
|
<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="Sku">采集的Sku</a-select-option> |
||||
|
<a-select-option key="UserSku">用户自己的SKU</a-select-option> |
||||
|
<a-select-option key="UserId">提交人</a-select-option> |
||||
|
<a-select-option key="WorkUserId">采集人</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: '采集的Sku', dataIndex: 'Sku', width: '10%' }, |
||||
|
{ title: '用户自己的SKU', dataIndex: 'UserSku', width: '10%' }, |
||||
|
{ title: '提交人', dataIndex: 'UserId', width: '10%' }, |
||||
|
{ title: '采集人', dataIndex: 'WorkUserId', width: '10%' }, |
||||
|
{ title: '状态', dataIndex: 'State', width: '10%' }, |
||||
|
{ title: '采集任务开始时间', dataIndex: 'WorkStartDate', width: '10%' }, |
||||
|
{ title: '采集结束时间', dataIndex: 'WorkEndDate', 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('/JDSku/jdskutask/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('/JDSku/jdskutask/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