!188 完善服务订单管理功能,完善商品查看详情功能等其他问题。

### 1.3.0 开源社区版(会员专业版同步):
【新增】完善商品查看详情功能。#I4QTLR
【新增】订单详情页面需要增加下单客户信息。
【新增】完善服务订单管理功能,实现订单作废、导出功能;核销码实现列表,作废,导出功能。#I4OSBK
【修复】修复普通订单查看详情,因优惠信息问题导致的异常情况。#I4QXUQ
【修复】修复门店列表下的用户编辑页面名称大小写问题(linux下大小写敏感问题)。
【修复】修复微信支付成功相应的日志记录类型有误。#I4QSNZ
【修复】修复发货日志记录sku货号错误问题。#I4PX25
【修复】修复发货单列表查看详情,提示权限不足的问题。#I4QDQR

### 0.0.8 会员专业版:
【新增】新增接龙功能营销功能,实现单个活动,可以添加多个不同商品的不同sku混合选择下单。
【新增】增加接龙数据库脚本及演示文件。
【升级】升级uView组件到2.0.20版本。
【修复】修复编辑收货地址的路径中选取区域部分可以手动输入文字。
【修复】修复【微信直播带货】组件缺少获取sku分页数据的问题。#I4QKSU
【优化】调整【微信自定义交易组件】商品类目排序方式及展示内容。#I4QE0N
pull/189/head
大灰灰 3 years ago
parent 2df5615df8
commit 44fcf529b1

@ -2491,27 +2491,25 @@ namespace CoreCms.Net.Configuration
/// <summary>
/// 正常
/// </summary>
[Description("正常")]
[Description("<button type='button' class='layui-btn layui-btn-normal layui-btn-xs'>正常</button>")]
Normal = 0,
/// <summary>
/// 过期
/// </summary>
[Description("过期")]
[Description("<button type='button' class='layui-btn layui-btn-warm layui-btn-disabled layui-btn-xs'>过期</button>")]
Overdue = 1,
/// <summary>
/// 作废
/// </summary>
[Description("作废")]
[Description("<button type='button' class='layui-btn layui-btn-primary layui-btn-disabled layui-btn-xs'>作废</button>")]
Cancellation = 2,
/// <summary>
/// 已核销
/// </summary>
[Description("已核销")]
[Description("<button type='button' class='layui-btn layui-btn-disabled layui-btn-xs'>已核销</button>")]
Verification = 3
}
/// <summary>
/// 服务订单状态
/// </summary>
@ -2520,24 +2518,24 @@ namespace CoreCms.Net.Configuration
/// <summary>
/// 正常
/// </summary>
[Description("正常")]
[Description("<button type='button' class='layui-btn layui-btn-normal layui-btn-xs'>订单正常</button>")]
= 1,
/// <summary>
/// 作废
/// </summary>
[Description("作废")]
[Description("<button type='button' class='layui-btn layui-btn-primary layui-btn-disabled layui-btn-xs'>订单作废</button>")]
= 2,
/// <summary>
/// 过期
/// </summary>
[Description("过期")]
[Description("<button type='button' class='layui-btn layui-btn-warm layui-btn-disabled layui-btn-xs'>订单过期</button>")]
= 3,
/// <summary>
/// 用罄
/// </summary>
[Description("用罄")]
[Description("<button type='button' class='layui-btn layui-btn-disabled layui-btn-xs'>订单用罄</button>")]
= 4
}

@ -8,7 +8,12 @@
* Description:
***********************************************************************/
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using SqlSugar;
namespace CoreCms.Net.IRepository
{
@ -59,5 +64,22 @@ namespace CoreCms.Net.IRepository
//new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
#endregion
/// <summary>
/// 重写根据条件查询分页数据
/// </summary>
/// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
new Task<IPageList<CoreCmsUserServicesOrder>> QueryPageAsync(
Expression<Func<CoreCmsUserServicesOrder, bool>> predicate,
Expression<Func<CoreCmsUserServicesOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false);
}
}

@ -8,7 +8,12 @@
* Description:
***********************************************************************/
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using SqlSugar;
namespace CoreCms.Net.IRepository
{
@ -59,5 +64,22 @@ namespace CoreCms.Net.IRepository
//new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
#endregion
/// <summary>
/// 重写根据条件查询分页数据
/// </summary>
/// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
new Task<IPageList<CoreCmsUserServicesTicket>> QueryPageAsync(
Expression<Func<CoreCmsUserServicesTicket, bool>> predicate,
Expression<Func<CoreCmsUserServicesTicket, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false);
}
}

@ -8,9 +8,13 @@
* Description:
***********************************************************************/
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using SqlSugar;
namespace CoreCms.Net.IServices
{
@ -26,5 +30,23 @@ namespace CoreCms.Net.IServices
/// <param name="paymentId"></param>
/// <returns></returns>
Task<WebApiCallBack> CreateUserServicesTickets(string serviceOrderId, string paymentId);
/// <summary>
/// 重写根据条件查询分页数据
/// </summary>
/// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
new Task<IPageList<CoreCmsUserServicesOrder>> QueryPageAsync(
Expression<Func<CoreCmsUserServicesOrder, bool>> predicate,
Expression<Func<CoreCmsUserServicesOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false);
}
}

@ -8,7 +8,12 @@
* Description:
***********************************************************************/
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using SqlSugar;
namespace CoreCms.Net.IServices
{
@ -17,5 +22,24 @@ namespace CoreCms.Net.IServices
/// </summary>
public interface ICoreCmsUserServicesTicketServices : IBaseServices<CoreCmsUserServicesTicket>
{
/// <summary>
/// 重写根据条件查询分页数据
/// </summary>
/// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
new Task<IPageList<CoreCmsUserServicesTicket>> QueryPageAsync(
Expression<Func<CoreCmsUserServicesTicket, bool>> predicate,
Expression<Func<CoreCmsUserServicesTicket, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false);
}
}

@ -3,11 +3,13 @@
* ProjectName:
* Web: https://www.corecms.net
* Author:
* Email: jianweie@163.com
* CreateTime: 2021-06-08 22:14:59
* Email: jianweie@163.com
* CreateTime: 2022/1/15 1:30:57
* Description:
***********************************************************************/
***********************************************************************/
using SqlSugar;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace CoreCms.Net.Model.Entities
@ -15,84 +17,136 @@ namespace CoreCms.Net.Model.Entities
/// <summary>
/// 服务购买表
/// </summary>
[SugarTable("CoreCmsUserServicesOrder",TableDescription = "服务购买表")]
public partial class CoreCmsUserServicesOrder
{
/// <summary>
/// 服务购买表
/// 构造函数
/// </summary>
public CoreCmsUserServicesOrder()
{
}
/// <summary>
/// 序列
/// </summary>
[Display(Name = "序列")]
[SugarColumn(ColumnDescription = "序列", IsPrimaryKey = true, IsIdentity = true)]
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
[Required(ErrorMessage = "请输入{0}")]
public System.Int32 id { get; set; }
public System.Int32 id { get; set; }
/// <summary>
/// 服务订单编号
/// </summary>
[Display(Name = "服务订单编号")]
[SugarColumn(ColumnDescription = "服务订单编号")]
[Required(ErrorMessage = "请输入{0}")]
[StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")]
public System.String serviceOrderId { get; set; }
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
public System.String serviceOrderId { get; set; }
/// <summary>
/// 关联用户
/// </summary>
[Display(Name = "关联用户")]
[SugarColumn(ColumnDescription = "关联用户")]
[Required(ErrorMessage = "请输入{0}")]
public System.Int32 userId { get; set; }
public System.Int32 userId { get; set; }
/// <summary>
/// 关联服务
/// </summary>
[Display(Name = "关联服务")]
[SugarColumn(ColumnDescription = "关联服务")]
[Required(ErrorMessage = "请输入{0}")]
public System.Int32 servicesId { get; set; }
public System.Int32 servicesId { get; set; }
/// <summary>
/// 是否支付
/// </summary>
[Display(Name = "是否支付")]
[SugarColumn(ColumnDescription = "是否支付")]
[Required(ErrorMessage = "请输入{0}")]
public System.Boolean isPay { get; set; }
public System.Boolean isPay { get; set; }
/// <summary>
/// 支付时间
/// </summary>
[Display(Name = "支付时间")]
[SugarColumn(ColumnDescription = "支付时间", IsNullable = true)]
public System.DateTime? payTime { get; set; }
public System.DateTime? payTime { get; set; }
/// <summary>
/// 支付单号
/// </summary>
[Display(Name = "支付单号")]
[SugarColumn(ColumnDescription = "支付单号", IsNullable = true)]
[StringLength(50, ErrorMessage = "【{0}】不能超过{1}字符长度")]
public System.String paymentId { get; set; }
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
public System.String paymentId { get; set; }
/// <summary>
/// 状态
/// </summary>
[Display(Name = "状态")]
[SugarColumn(ColumnDescription = "状态")]
[Required(ErrorMessage = "请输入{0}")]
public System.Int32 status { get; set; }
public System.Int32 status { get; set; }
/// <summary>
/// 订单创建时间
/// </summary>
[Display(Name = "订单创建时间")]
[SugarColumn(ColumnDescription = "订单创建时间")]
[Required(ErrorMessage = "请输入{0}")]
public System.DateTime createTime { get; set; }
public System.DateTime createTime { get; set; }
/// <summary>
/// 截止服务时间
/// </summary>
[Display(Name = "截止服务时间")]
[SugarColumn(ColumnDescription = "截止服务时间", IsNullable = true)]
public System.DateTime? servicesEndTime { get; set; }
public System.DateTime? servicesEndTime { get; set; }
}
}
}

@ -32,5 +32,23 @@ namespace CoreCms.Net.Model.Entities
[Display(Name = "状态说明")]
[SugarColumn(IsIgnore = true)]
public string statusStr { get; set; }
/// <summary>
/// 服务标题
/// </summary>
[Display(Name = "服务标题")]
[SugarColumn(IsIgnore = true)]
public string serviceTitle { get; set; }
/// <summary>
/// 用户昵称
/// </summary>
[Display(Name = "用户昵称")]
[SugarColumn(IsIgnore = true)]
public string userName { get; set; }
}
}

@ -8,9 +8,15 @@
* Description:
***********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using SqlSugar;
namespace CoreCms.Net.Repository
{
@ -23,5 +29,81 @@ namespace CoreCms.Net.Repository
public CoreCmsUserServicesOrderRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
#region 重写根据条件查询分页数据
/// <summary>
/// 重写根据条件查询分页数据
/// </summary>
/// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
public new async Task<IPageList<CoreCmsUserServicesOrder>> QueryPageAsync(Expression<Func<CoreCmsUserServicesOrder, bool>> predicate,
Expression<Func<CoreCmsUserServicesOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false)
{
RefAsync<int> totalCount = 0;
List<CoreCmsUserServicesOrder> page;
if (blUseNoLock)
{
page = await DbClient.Queryable<CoreCmsUserServicesOrder, CoreCmsUser, CoreCmsServices>((sOrder, sUser, sService) => new JoinQueryInfos(
JoinType.Left, sOrder.userId == sUser.id, JoinType.Left, sOrder.servicesId == sService.id))
.Select((sOrder, sUser, sService) => new CoreCmsUserServicesOrder
{
id = sOrder.id,
serviceOrderId = sOrder.serviceOrderId,
userId = sOrder.userId,
servicesId = sOrder.servicesId,
isPay = sOrder.isPay,
payTime = sOrder.payTime,
paymentId = sOrder.paymentId,
status = sOrder.status,
createTime = sOrder.createTime,
servicesEndTime = sOrder.servicesEndTime,
serviceTitle = sService.title,
userName = sUser.nickName
})
.With(SqlWith.NoLock)
.MergeTable()
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
.WhereIF(predicate != null, predicate)
.ToPageListAsync(pageIndex, pageSize, totalCount);
}
else
{
page = await DbClient.Queryable<CoreCmsUserServicesOrder, CoreCmsUser, CoreCmsServices>((sOrder, sUser, sService) => new JoinQueryInfos(
JoinType.Left, sOrder.userId == sUser.id, JoinType.Left, sOrder.servicesId == sService.id))
.Select((sOrder, sUser, sService) => new CoreCmsUserServicesOrder
{
id = sOrder.id,
serviceOrderId = sOrder.serviceOrderId,
userId = sOrder.userId,
servicesId = sOrder.servicesId,
isPay = sOrder.isPay,
payTime = sOrder.payTime,
paymentId = sOrder.paymentId,
status = sOrder.status,
createTime = sOrder.createTime,
servicesEndTime = sOrder.servicesEndTime,
serviceTitle = sService.title,
userName = sUser.nickName
})
.MergeTable()
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
.WhereIF(predicate != null, predicate)
.ToPageListAsync(pageIndex, pageSize, totalCount);
}
var list = new PageList<CoreCmsUserServicesOrder>(page, pageIndex, pageSize, totalCount);
return list;
}
#endregion
}
}

@ -8,9 +8,15 @@
* Description:
***********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using SqlSugar;
namespace CoreCms.Net.Repository
{
@ -23,5 +29,76 @@ namespace CoreCms.Net.Repository
public CoreCmsUserServicesTicketRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
#region 重写根据条件查询分页数据
/// <summary>
/// 重写根据条件查询分页数据
/// </summary>
/// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
public new async Task<IPageList<CoreCmsUserServicesTicket>> QueryPageAsync(Expression<Func<CoreCmsUserServicesTicket, bool>> predicate,
Expression<Func<CoreCmsUserServicesTicket, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false)
{
RefAsync<int> totalCount = 0;
List<CoreCmsUserServicesTicket> page;
if (blUseNoLock)
{
page = await DbClient.Queryable<CoreCmsUserServicesTicket>()
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsUserServicesTicket
{
id = p.id,
serviceOrderId = p.serviceOrderId,
securityCode = p.securityCode,
redeemCode = p.redeemCode,
serviceId = p.serviceId,
userId = p.userId,
status = p.status,
validityType = p.validityType,
validityStartTime = p.validityStartTime,
validityEndTime = p.validityEndTime,
createTime = p.createTime,
isVerification = p.isVerification,
verificationTime = p.verificationTime,
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
}
else
{
page = await DbClient.Queryable<CoreCmsUserServicesTicket>()
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsUserServicesTicket
{
id = p.id,
serviceOrderId = p.serviceOrderId,
securityCode = p.securityCode,
redeemCode = p.redeemCode,
serviceId = p.serviceId,
userId = p.userId,
status = p.status,
validityType = p.validityType,
validityStartTime = p.validityStartTime,
validityEndTime = p.validityEndTime,
createTime = p.createTime,
isVerification = p.isVerification,
verificationTime = p.verificationTime,
}).ToPageListAsync(pageIndex, pageSize, totalCount);
}
var list = new PageList<CoreCmsUserServicesTicket>(page, pageIndex, pageSize, totalCount);
return list;
}
#endregion
}
}

@ -405,7 +405,7 @@ namespace CoreCms.Net.Services
var sLog = new CoreCmsStockLog
{
stockId = deliveryInfo.deliveryId,
productId = item.id,
productId = item.productId,
goodsId = item.goodsId,
nums = -sendNum,
sn = item.sn,

@ -624,8 +624,10 @@ namespace CoreCms.Net.Services
if (!string.IsNullOrEmpty(p.promotionList))
{
var jobj = JObject.Parse(p.promotionList);
var v = jobj.Values().First();
p.promotionObj = v;
if (jobj.Values().Any())
{
p.promotionObj = jobj.Values().FirstOrDefault();
}
}
});
}

@ -10,15 +10,18 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Helper;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
namespace CoreCms.Net.Services
@ -105,5 +108,27 @@ namespace CoreCms.Net.Services
return jm;
}
#region 重写根据条件查询分页数据
/// <summary>
/// 重写根据条件查询分页数据
/// </summary>
/// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
public new async Task<IPageList<CoreCmsUserServicesOrder>> QueryPageAsync(Expression<Func<CoreCmsUserServicesOrder, bool>> predicate,
Expression<Func<CoreCmsUserServicesOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false)
{
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
}
#endregion
}
}

@ -9,13 +9,15 @@
***********************************************************************/
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
using CoreCms.Net.IRepository;
using CoreCms.Net.IRepository.UnitOfWork;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Model.ViewModels.Basics;
using SqlSugar;
namespace CoreCms.Net.Services
@ -34,5 +36,26 @@ namespace CoreCms.Net.Services
_unitOfWork = unitOfWork;
}
#region 重写根据条件查询分页数据
/// <summary>
/// 重写根据条件查询分页数据
/// </summary>
/// <param name="predicate">判断集合</param>
/// <param name="orderByType">排序方式</param>
/// <param name="pageIndex">当前页面索引</param>
/// <param name="pageSize">分布大小</param>
/// <param name="orderByExpression"></param>
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
/// <returns></returns>
public new async Task<IPageList<CoreCmsUserServicesTicket>> QueryPageAsync(Expression<Func<CoreCmsUserServicesTicket, bool>> predicate,
Expression<Func<CoreCmsUserServicesTicket, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
int pageSize = 20, bool blUseNoLock = false)
{
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
}
#endregion
}
}

@ -1126,7 +1126,6 @@ namespace CoreCms.Net.Web.Admin.Controllers
/// </summary>
/// <returns></returns>
[HttpPost]
[Authorize(Permissions.Name)]
public async Task<WebApiCallBack> LogisticsByApi([FromBody] FMApiLogisticsByApiPost entity)
{
var jm = new WebApiCallBack();

@ -628,11 +628,99 @@ namespace CoreCms.Net.Web.Admin.Controllers
if (model == null)
{
jm.msg = "不存在此信息";
jm.data = entity.id;
return jm;
}
jm.code = 0;
jm.data = model;
//获取商品分类
var categories = await _coreCmsGoodsCategoryServices.GetCaChe();
categories = categories.Where(p => p.isShow == true).ToList();
//获取用户等级
var userGrade = await _userGradeServices.QueryAsync();
//用户价格体系
var goodsGrades = await _goodsGradeServices.QueryListByClauseAsync(p => p.goodsId == model.id);
//货品信息
var products =
await _productsServices.QueryListByClauseAsync(p => p.goodsId == model.id && p.isDel == false);
//扩展信息
var categoryExtend = await _categoryExtendServices.QueryListByClauseAsync(p => p.goodsId == model.id);
//获取商品分销enum
var productsDistributionType = EnumHelper.EnumToList<GlobalEnumVars.ProductsDistributionType>();
//获取参数列表
var paramsList = await _goodsParamsServices.QueryListByClauseAsync(p => p.id > 0, p => p.id, OrderByType.Desc, true);
//获取SKU列表
var skuList = await _goodsTypeSpecServices.QueryListByClauseAsync(p => p.id > 0, p => p.id, OrderByType.Desc, true);
//获取品牌
var brands = await _brandServices.QueryListByClauseAsync(p => p.id > 0 && p.isShow == true, p => p.id, OrderByType.Desc, true);
if (products != null && products.Any())
{
var pIds = products.Select(p => p.id).ToList();
if (pIds.Any())
{
// 获取商品分销明细
var pds = await _productsDistributionServices.QueryListByClauseAsync(p => pIds.Contains(p.productsId), p => p.id, OrderByType.Asc);
products.ForEach(p =>
{
foreach (var o in pds.Where(o => o.productsId == p.id))
{
p.levelOne = o.levelOne;
p.levelTwo = o.levelTwo;
p.levelThree = o.levelThree;
}
});
jm.otherData = pds;
}
}
//获取参数信息
var goodsTypeSpec = new List<CoreCmsGoodsTypeSpec>();
var goodsParams = new List<CoreCmsGoodsParams>();
//获取参数
if (!string.IsNullOrEmpty(model.goodsParamsIds))
{
var paramsIds = Utility.Helper.CommonHelper.StringToIntArray(model.goodsParamsIds);
goodsParams = await _goodsParamsServices.QueryListByClauseAsync(p => paramsIds.Contains(p.id));
}
//获取属性
if (!string.IsNullOrEmpty(model.goodsSkuIds))
{
var specIds = Utility.Helper.CommonHelper.StringToIntArray(model.goodsSkuIds);
var typeSpecs = await _typeSpecServices.QueryListByClauseAsync(p => specIds.Contains(p.id));
var typeSpecValues = await _typeSpecValueServices.QueryListByClauseAsync(p => specIds.Contains(p.specId));
typeSpecs.ForEach(p =>
{
p.specValues = typeSpecValues.Where(o => o.specId == p.id).ToList();
});
goodsTypeSpec = typeSpecs;
}
jm.data = new
{
model,
categories = GoodsHelper.GetTree(categories, false),
brands,
userGrade,
goodsGrades,
products,
categoryExtend,
goodsTypeSpec,
goodsParams,
productsDistributionType,
paramsList,
skuList
};
return jm;
}

@ -1,948 +0,0 @@
/***********************************************************************
* Project: CoreCms
* ProjectName:
* Web: https://www.corecms.net
* Author:
* Email: jianweie@163.com
* CreateTime: 2021/1/31 21:45:10
* Description:
***********************************************************************/
using CoreCms.Net.Configuration;
using CoreCms.Net.Filter;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using NPOI.HSSF.UserModel;
using SqlSugar;
using System;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace CoreCms.Net.Web.Admin.Controllers
{
/// <summary>
/// 服务消费券
///</summary>
[Description("服务消费券")]
[Route("api/[controller]/[action]")]
[ApiController]
[RequiredErrorForAdmin]
[Authorize(Permissions.Name)]
public class CoreCmsUserServicesTicketController : ControllerBase
{
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly ICoreCmsUserServicesTicketServices _CoreCmsUserServicesTicketServices;
/// <summary>
/// 构造函数
///</summary>
public CoreCmsUserServicesTicketController(IWebHostEnvironment webHostEnvironment
, ICoreCmsUserServicesTicketServices CoreCmsUserServicesTicketServices
)
{
_webHostEnvironment = webHostEnvironment;
_CoreCmsUserServicesTicketServices = CoreCmsUserServicesTicketServices;
}
#region 获取列表============================================================
// POST: Api/CoreCmsUserServicesTicket/GetPageList
/// <summary>
/// 获取列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Description("获取列表")]
public async Task<AdminUiCallBack> GetPageList()
{
var jm = new AdminUiCallBack();
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
var where = PredicateBuilder.True<CoreCmsUserServicesTicket>();
//获取排序字段
var orderField = Request.Form["orderField"].FirstOrDefault();
Expression<Func<CoreCmsUserServicesTicket, object>> orderEx;
switch (orderField)
{
case "id":
orderEx = p => p.id;
break;
case "serviceOrderId":
orderEx = p => p.serviceOrderId;
break;
case "securityCode":
orderEx = p => p.securityCode;
break;
case "redeemCode":
orderEx = p => p.redeemCode;
break;
case "serviceId":
orderEx = p => p.serviceId;
break;
case "userId":
orderEx = p => p.userId;
break;
case "status":
orderEx = p => p.status;
break;
case "validityType":
orderEx = p => p.validityType;
break;
case "validityStartTime":
orderEx = p => p.validityStartTime;
break;
case "validityEndTime":
orderEx = p => p.validityEndTime;
break;
case "createTime":
orderEx = p => p.createTime;
break;
case "isVerification":
orderEx = p => p.isVerification;
break;
case "verificationTime":
orderEx = p => p.verificationTime;
break;
default:
orderEx = p => p.id;
break;
}
//设置排序方式
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
var orderBy = orderDirection switch
{
"asc" => OrderByType.Asc,
"desc" => OrderByType.Desc,
_ => OrderByType.Desc
};
//查询筛选
//序列 int
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
if (id > 0)
{
where = where.And(p => p.id == id);
}
//关联购买订单 nvarchar
var serviceOrderId = Request.Form["serviceOrderId"].FirstOrDefault();
if (!string.IsNullOrEmpty(serviceOrderId))
{
where = where.And(p => p.serviceOrderId.Contains(serviceOrderId));
}
//兑换码 nvarchar
var redeemCode = Request.Form["redeemCode"].FirstOrDefault();
if (!string.IsNullOrEmpty(redeemCode))
{
where = where.And(p => p.redeemCode.Contains(redeemCode));
}
//关联服务项目id int
var serviceId = Request.Form["serviceId"].FirstOrDefault().ObjectToInt(0);
if (serviceId > 0)
{
where = where.And(p => p.serviceId == serviceId);
}
//关联用户id int
var userId = Request.Form["userId"].FirstOrDefault().ObjectToInt(0);
if (userId > 0)
{
where = where.And(p => p.userId == userId);
}
//状态 int
var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0);
if (status > 0)
{
where = where.And(p => p.status == status);
}
//核销有效期类型 int
var validityType = Request.Form["validityType"].FirstOrDefault().ObjectToInt(0);
if (validityType > 0)
{
where = where.And(p => p.validityType == validityType);
}
//核销开始时间 datetime
var validityStartTime = Request.Form["validityStartTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(validityStartTime))
{
if (validityStartTime.Contains("到"))
{
var dts = validityStartTime.Split("到");
var dtStart = dts[0].Trim().ObjectToDate();
where = where.And(p => p.validityStartTime > dtStart);
var dtEnd = dts[1].Trim().ObjectToDate();
where = where.And(p => p.validityStartTime < dtEnd);
}
else
{
var dt = validityStartTime.ObjectToDate();
where = where.And(p => p.validityStartTime > dt);
}
}
//核销结束时间 datetime
var validityEndTime = Request.Form["validityEndTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(validityEndTime))
{
if (validityEndTime.Contains("到"))
{
var dts = validityEndTime.Split("到");
var dtStart = dts[0].Trim().ObjectToDate();
where = where.And(p => p.validityEndTime > dtStart);
var dtEnd = dts[1].Trim().ObjectToDate();
where = where.And(p => p.validityEndTime < dtEnd);
}
else
{
var dt = validityEndTime.ObjectToDate();
where = where.And(p => p.validityEndTime > dt);
}
}
//创建时间 datetime
var createTime = Request.Form["createTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(createTime))
{
if (createTime.Contains("到"))
{
var dts = createTime.Split("到");
var dtStart = dts[0].Trim().ObjectToDate();
where = where.And(p => p.createTime > dtStart);
var dtEnd = dts[1].Trim().ObjectToDate();
where = where.And(p => p.createTime < dtEnd);
}
else
{
var dt = createTime.ObjectToDate();
where = where.And(p => p.createTime > dt);
}
}
//是否核销 bit
var isVerification = Request.Form["isVerification"].FirstOrDefault();
if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "true")
{
where = where.And(p => p.isVerification == true);
}
else if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "false")
{
where = where.And(p => p.isVerification == false);
}
//核销时间 datetime
var verificationTime = Request.Form["verificationTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(verificationTime))
{
if (verificationTime.Contains("到"))
{
var dts = verificationTime.Split("到");
var dtStart = dts[0].Trim().ObjectToDate();
where = where.And(p => p.verificationTime > dtStart);
var dtEnd = dts[1].Trim().ObjectToDate();
where = where.And(p => p.verificationTime < dtEnd);
}
else
{
var dt = verificationTime.ObjectToDate();
where = where.And(p => p.verificationTime > dt);
}
}
//获取数据
var list = await _CoreCmsUserServicesTicketServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize);
//返回数据
jm.data = list;
jm.code = 0;
jm.count = list.TotalCount;
jm.msg = "数据调用成功!";
return jm;
}
#endregion 获取列表============================================================
#region 首页数据============================================================
// POST: Api/CoreCmsUserServicesTicket/GetIndex
/// <summary>
/// 首页数据
/// </summary>
/// <returns></returns>
[HttpPost]
[Description("首页数据")]
public AdminUiCallBack GetIndex()
{
//返回数据
var jm = new AdminUiCallBack { code = 0 };
return jm;
}
#endregion 首页数据============================================================
#region 创建数据============================================================
// POST: Api/CoreCmsUserServicesTicket/GetCreate
/// <summary>
/// 创建数据
/// </summary>
/// <returns></returns>
[HttpPost]
[Description("创建数据")]
public AdminUiCallBack GetCreate()
{
//返回数据
var jm = new AdminUiCallBack { code = 0 };
return jm;
}
#endregion 创建数据============================================================
#region 创建提交============================================================
// POST: Api/CoreCmsUserServicesTicket/DoCreate
/// <summary>
/// 创建提交
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("创建提交")]
public async Task<AdminUiCallBack> DoCreate([FromBody] CoreCmsUserServicesTicket entity)
{
var jm = new AdminUiCallBack();
var bl = await _CoreCmsUserServicesTicketServices.InsertAsync(entity) > 0;
jm.code = bl ? 0 : 1;
jm.msg = (bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure);
return jm;
}
#endregion 创建提交============================================================
#region 编辑数据============================================================
// POST: Api/CoreCmsUserServicesTicket/GetEdit
/// <summary>
/// 编辑数据
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("编辑数据")]
public async Task<AdminUiCallBack> GetEdit([FromBody] FMIntId entity)
{
var jm = new AdminUiCallBack();
var model = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id);
if (model == null)
{
jm.msg = "不存在此信息";
return jm;
}
jm.code = 0;
jm.data = model;
return jm;
}
#endregion 编辑数据============================================================
#region 编辑提交============================================================
// POST: Api/CoreCmsUserServicesTicket/Edit
/// <summary>
/// 编辑提交
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("编辑提交")]
public async Task<AdminUiCallBack> DoEdit([FromBody] CoreCmsUserServicesTicket entity)
{
var jm = new AdminUiCallBack();
var oldModel = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id);
if (oldModel == null)
{
jm.msg = "不存在此信息";
return jm;
}
//事物处理过程开始
oldModel.serviceOrderId = entity.serviceOrderId;
oldModel.securityCode = entity.securityCode;
oldModel.redeemCode = entity.redeemCode;
oldModel.serviceId = entity.serviceId;
oldModel.userId = entity.userId;
oldModel.status = entity.status;
oldModel.validityType = entity.validityType;
oldModel.validityStartTime = entity.validityStartTime;
oldModel.validityEndTime = entity.validityEndTime;
oldModel.createTime = entity.createTime;
oldModel.isVerification = entity.isVerification;
oldModel.verificationTime = entity.verificationTime;
//事物处理过程结束
var bl = await _CoreCmsUserServicesTicketServices.UpdateAsync(oldModel);
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
return jm;
}
#endregion 编辑提交============================================================
#region 删除数据============================================================
// POST: Api/CoreCmsUserServicesTicket/DoDelete/10
/// <summary>
/// 单选删除
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("单选删除")]
public async Task<AdminUiCallBack> DoDelete([FromBody] FMIntId entity)
{
var jm = new AdminUiCallBack();
var model = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id);
if (model == null)
{
jm.msg = GlobalConstVars.DataisNo;
return jm;
}
var bl = await _CoreCmsUserServicesTicketServices.DeleteByIdAsync(entity.id);
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
return jm;
}
#endregion 删除数据============================================================
#region 批量删除============================================================
// POST: Api/CoreCmsUserServicesTicket/DoBatchDelete/10,11,20
/// <summary>
/// 批量删除
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("批量删除")]
public async Task<AdminUiCallBack> DoBatchDelete([FromBody] FMArrayIntIds entity)
{
var jm = new AdminUiCallBack();
var bl = await _CoreCmsUserServicesTicketServices.DeleteByIdsAsync(entity.id);
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
return jm;
}
#endregion 批量删除============================================================
#region 预览数据============================================================
// POST: Api/CoreCmsUserServicesTicket/GetDetails/10
/// <summary>
/// 预览数据
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("预览数据")]
public async Task<AdminUiCallBack> GetDetails([FromBody] FMIntId entity)
{
var jm = new AdminUiCallBack();
var model = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id);
if (model == null)
{
jm.msg = "不存在此信息";
return jm;
}
jm.code = 0;
jm.data = model;
return jm;
}
#endregion 预览数据============================================================
#region 选择导出============================================================
// POST: Api/CoreCmsUserServicesTicket/SelectExportExcel/10
/// <summary>
/// 选择导出
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("选择导出")]
public async Task<AdminUiCallBack> SelectExportExcel([FromBody] FMArrayIntIds entity)
{
var jm = new AdminUiCallBack();
//创建Excel文件的对象
var book = new HSSFWorkbook();
//添加一个sheet
var mySheet = book.CreateSheet("Sheet1");
//获取list数据
var listModel = await _CoreCmsUserServicesTicketServices.QueryListByClauseAsync(p => entity.id.Contains(p.id), p => p.id, OrderByType.Asc);
//给sheet1添加第一行的头部标题
var headerRow = mySheet.CreateRow(0);
var headerStyle = ExcelHelper.GetHeaderStyle(book);
var cell0 = headerRow.CreateCell(0);
cell0.SetCellValue("序列");
cell0.CellStyle = headerStyle;
mySheet.SetColumnWidth(0, 10 * 256);
var cell1 = headerRow.CreateCell(1);
cell1.SetCellValue("关联购买订单");
cell1.CellStyle = headerStyle;
mySheet.SetColumnWidth(1, 10 * 256);
var cell2 = headerRow.CreateCell(2);
cell2.SetCellValue("安全码");
cell2.CellStyle = headerStyle;
mySheet.SetColumnWidth(2, 10 * 256);
var cell3 = headerRow.CreateCell(3);
cell3.SetCellValue("兑换码");
cell3.CellStyle = headerStyle;
mySheet.SetColumnWidth(3, 10 * 256);
var cell4 = headerRow.CreateCell(4);
cell4.SetCellValue("关联服务项目id");
cell4.CellStyle = headerStyle;
mySheet.SetColumnWidth(4, 10 * 256);
var cell5 = headerRow.CreateCell(5);
cell5.SetCellValue("关联用户id");
cell5.CellStyle = headerStyle;
mySheet.SetColumnWidth(5, 10 * 256);
var cell6 = headerRow.CreateCell(6);
cell6.SetCellValue("状态");
cell6.CellStyle = headerStyle;
mySheet.SetColumnWidth(6, 10 * 256);
var cell7 = headerRow.CreateCell(7);
cell7.SetCellValue("核销有效期类型");
cell7.CellStyle = headerStyle;
mySheet.SetColumnWidth(7, 10 * 256);
var cell8 = headerRow.CreateCell(8);
cell8.SetCellValue("核销开始时间");
cell8.CellStyle = headerStyle;
mySheet.SetColumnWidth(8, 10 * 256);
var cell9 = headerRow.CreateCell(9);
cell9.SetCellValue("核销结束时间");
cell9.CellStyle = headerStyle;
mySheet.SetColumnWidth(9, 10 * 256);
var cell10 = headerRow.CreateCell(10);
cell10.SetCellValue("创建时间");
cell10.CellStyle = headerStyle;
mySheet.SetColumnWidth(10, 10 * 256);
var cell11 = headerRow.CreateCell(11);
cell11.SetCellValue("是否核销");
cell11.CellStyle = headerStyle;
mySheet.SetColumnWidth(11, 10 * 256);
var cell12 = headerRow.CreateCell(12);
cell12.SetCellValue("核销时间");
cell12.CellStyle = headerStyle;
mySheet.SetColumnWidth(12, 10 * 256);
headerRow.Height = 30 * 20;
var commonCellStyle = ExcelHelper.GetCommonStyle(book);
//将数据逐步写入sheet1各个行
for (var i = 0; i < listModel.Count; i++)
{
var rowTemp = mySheet.CreateRow(i + 1);
var rowTemp0 = rowTemp.CreateCell(0);
rowTemp0.SetCellValue(listModel[i].id.ToString());
rowTemp0.CellStyle = commonCellStyle;
var rowTemp1 = rowTemp.CreateCell(1);
rowTemp1.SetCellValue(listModel[i].serviceOrderId.ToString());
rowTemp1.CellStyle = commonCellStyle;
var rowTemp2 = rowTemp.CreateCell(2);
rowTemp2.SetCellValue(listModel[i].securityCode.ToString());
rowTemp2.CellStyle = commonCellStyle;
var rowTemp3 = rowTemp.CreateCell(3);
rowTemp3.SetCellValue(listModel[i].redeemCode.ToString());
rowTemp3.CellStyle = commonCellStyle;
var rowTemp4 = rowTemp.CreateCell(4);
rowTemp4.SetCellValue(listModel[i].serviceId.ToString());
rowTemp4.CellStyle = commonCellStyle;
var rowTemp5 = rowTemp.CreateCell(5);
rowTemp5.SetCellValue(listModel[i].userId.ToString());
rowTemp5.CellStyle = commonCellStyle;
var rowTemp6 = rowTemp.CreateCell(6);
rowTemp6.SetCellValue(listModel[i].status.ToString());
rowTemp6.CellStyle = commonCellStyle;
var rowTemp7 = rowTemp.CreateCell(7);
rowTemp7.SetCellValue(listModel[i].validityType.ToString());
rowTemp7.CellStyle = commonCellStyle;
var rowTemp8 = rowTemp.CreateCell(8);
rowTemp8.SetCellValue(listModel[i].validityStartTime.ToString());
rowTemp8.CellStyle = commonCellStyle;
var rowTemp9 = rowTemp.CreateCell(9);
rowTemp9.SetCellValue(listModel[i].validityEndTime.ToString());
rowTemp9.CellStyle = commonCellStyle;
var rowTemp10 = rowTemp.CreateCell(10);
rowTemp10.SetCellValue(listModel[i].createTime.ToString());
rowTemp10.CellStyle = commonCellStyle;
var rowTemp11 = rowTemp.CreateCell(11);
rowTemp11.SetCellValue(listModel[i].isVerification.ToString());
rowTemp11.CellStyle = commonCellStyle;
var rowTemp12 = rowTemp.CreateCell(12);
rowTemp12.SetCellValue(listModel[i].verificationTime.ToString());
rowTemp12.CellStyle = commonCellStyle;
}
// 导出excel
string webRootPath = _webHostEnvironment.WebRootPath;
string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicket导出(选择结果).xls";
string filePath = webRootPath + tpath;
DirectoryInfo di = new DirectoryInfo(filePath);
if (!di.Exists)
{
di.Create();
}
FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create);
book.Write(fileHssf);
fileHssf.Close();
jm.code = 0;
jm.msg = GlobalConstVars.ExcelExportSuccess;
jm.data = tpath + fileName;
return jm;
}
#endregion 选择导出============================================================
#region 查询导出============================================================
// POST: Api/CoreCmsUserServicesTicket/QueryExportExcel/10
/// <summary>
/// 查询导出
/// </summary>
/// <returns></returns>
[HttpPost]
[Description("查询导出")]
public async Task<AdminUiCallBack> QueryExportExcel()
{
var jm = new AdminUiCallBack();
var where = PredicateBuilder.True<CoreCmsUserServicesTicket>();
//查询筛选
//序列 int
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
if (id > 0)
{
where = where.And(p => p.id == id);
}
//关联购买订单 nvarchar
var serviceOrderId = Request.Form["serviceOrderId"].FirstOrDefault();
if (!string.IsNullOrEmpty(serviceOrderId))
{
where = where.And(p => p.serviceOrderId.Contains(serviceOrderId));
}
//兑换码 nvarchar
var redeemCode = Request.Form["redeemCode"].FirstOrDefault();
if (!string.IsNullOrEmpty(redeemCode))
{
where = where.And(p => p.redeemCode.Contains(redeemCode));
}
//关联服务项目id int
var serviceId = Request.Form["serviceId"].FirstOrDefault().ObjectToInt(0);
if (serviceId > 0)
{
where = where.And(p => p.serviceId == serviceId);
}
//关联用户id int
var userId = Request.Form["userId"].FirstOrDefault().ObjectToInt(0);
if (userId > 0)
{
where = where.And(p => p.userId == userId);
}
//状态 int
var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0);
if (status > 0)
{
where = where.And(p => p.status == status);
}
//核销有效期类型 int
var validityType = Request.Form["validityType"].FirstOrDefault().ObjectToInt(0);
if (validityType > 0)
{
where = where.And(p => p.validityType == validityType);
}
//核销开始时间 datetime
var validityStartTime = Request.Form["validityStartTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(validityStartTime))
{
var dt = validityStartTime.ObjectToDate();
where = where.And(p => p.validityStartTime > dt);
}
//核销结束时间 datetime
var validityEndTime = Request.Form["validityEndTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(validityEndTime))
{
var dt = validityEndTime.ObjectToDate();
where = where.And(p => p.validityEndTime > dt);
}
//创建时间 datetime
var createTime = Request.Form["createTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(createTime))
{
var dt = createTime.ObjectToDate();
where = where.And(p => p.createTime > dt);
}
//是否核销 bit
var isVerification = Request.Form["isVerification"].FirstOrDefault();
if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "true")
{
where = where.And(p => p.isVerification == true);
}
else if (!string.IsNullOrEmpty(isVerification) && isVerification.ToLowerInvariant() == "false")
{
where = where.And(p => p.isVerification == false);
}
//核销时间 datetime
var verificationTime = Request.Form["verificationTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(verificationTime))
{
var dt = verificationTime.ObjectToDate();
where = where.And(p => p.verificationTime > dt);
}
//获取数据
//创建Excel文件的对象
var book = new HSSFWorkbook();
//添加一个sheet
var mySheet = book.CreateSheet("Sheet1");
//获取list数据
var listModel = await _CoreCmsUserServicesTicketServices.QueryListByClauseAsync(where, p => p.id, OrderByType.Asc);
//给sheet1添加第一行的头部标题
var headerRow = mySheet.CreateRow(0);
var headerStyle = ExcelHelper.GetHeaderStyle(book);
var cell0 = headerRow.CreateCell(0);
cell0.SetCellValue("序列");
cell0.CellStyle = headerStyle;
mySheet.SetColumnWidth(0, 10 * 256);
var cell1 = headerRow.CreateCell(1);
cell1.SetCellValue("关联购买订单");
cell1.CellStyle = headerStyle;
mySheet.SetColumnWidth(1, 10 * 256);
var cell2 = headerRow.CreateCell(2);
cell2.SetCellValue("安全码");
cell2.CellStyle = headerStyle;
mySheet.SetColumnWidth(2, 10 * 256);
var cell3 = headerRow.CreateCell(3);
cell3.SetCellValue("兑换码");
cell3.CellStyle = headerStyle;
mySheet.SetColumnWidth(3, 10 * 256);
var cell4 = headerRow.CreateCell(4);
cell4.SetCellValue("关联服务项目id");
cell4.CellStyle = headerStyle;
mySheet.SetColumnWidth(4, 10 * 256);
var cell5 = headerRow.CreateCell(5);
cell5.SetCellValue("关联用户id");
cell5.CellStyle = headerStyle;
mySheet.SetColumnWidth(5, 10 * 256);
var cell6 = headerRow.CreateCell(6);
cell6.SetCellValue("状态");
cell6.CellStyle = headerStyle;
mySheet.SetColumnWidth(6, 10 * 256);
var cell7 = headerRow.CreateCell(7);
cell7.SetCellValue("核销有效期类型");
cell7.CellStyle = headerStyle;
mySheet.SetColumnWidth(7, 10 * 256);
var cell8 = headerRow.CreateCell(8);
cell8.SetCellValue("核销开始时间");
cell8.CellStyle = headerStyle;
mySheet.SetColumnWidth(8, 10 * 256);
var cell9 = headerRow.CreateCell(9);
cell9.SetCellValue("核销结束时间");
cell9.CellStyle = headerStyle;
mySheet.SetColumnWidth(9, 10 * 256);
var cell10 = headerRow.CreateCell(10);
cell10.SetCellValue("创建时间");
cell10.CellStyle = headerStyle;
mySheet.SetColumnWidth(10, 10 * 256);
var cell11 = headerRow.CreateCell(11);
cell11.SetCellValue("是否核销");
cell11.CellStyle = headerStyle;
mySheet.SetColumnWidth(11, 10 * 256);
var cell12 = headerRow.CreateCell(12);
cell12.SetCellValue("核销时间");
cell12.CellStyle = headerStyle;
mySheet.SetColumnWidth(12, 10 * 256);
headerRow.Height = 30 * 20;
var commonCellStyle = ExcelHelper.GetCommonStyle(book);
//将数据逐步写入sheet1各个行
for (var i = 0; i < listModel.Count; i++)
{
var rowTemp = mySheet.CreateRow(i + 1);
var rowTemp0 = rowTemp.CreateCell(0);
rowTemp0.SetCellValue(listModel[i].id.ToString());
rowTemp0.CellStyle = commonCellStyle;
var rowTemp1 = rowTemp.CreateCell(1);
rowTemp1.SetCellValue(listModel[i].serviceOrderId.ToString());
rowTemp1.CellStyle = commonCellStyle;
var rowTemp2 = rowTemp.CreateCell(2);
rowTemp2.SetCellValue(listModel[i].securityCode.ToString());
rowTemp2.CellStyle = commonCellStyle;
var rowTemp3 = rowTemp.CreateCell(3);
rowTemp3.SetCellValue(listModel[i].redeemCode.ToString());
rowTemp3.CellStyle = commonCellStyle;
var rowTemp4 = rowTemp.CreateCell(4);
rowTemp4.SetCellValue(listModel[i].serviceId.ToString());
rowTemp4.CellStyle = commonCellStyle;
var rowTemp5 = rowTemp.CreateCell(5);
rowTemp5.SetCellValue(listModel[i].userId.ToString());
rowTemp5.CellStyle = commonCellStyle;
var rowTemp6 = rowTemp.CreateCell(6);
rowTemp6.SetCellValue(listModel[i].status.ToString());
rowTemp6.CellStyle = commonCellStyle;
var rowTemp7 = rowTemp.CreateCell(7);
rowTemp7.SetCellValue(listModel[i].validityType.ToString());
rowTemp7.CellStyle = commonCellStyle;
var rowTemp8 = rowTemp.CreateCell(8);
rowTemp8.SetCellValue(listModel[i].validityStartTime.ToString());
rowTemp8.CellStyle = commonCellStyle;
var rowTemp9 = rowTemp.CreateCell(9);
rowTemp9.SetCellValue(listModel[i].validityEndTime.ToString());
rowTemp9.CellStyle = commonCellStyle;
var rowTemp10 = rowTemp.CreateCell(10);
rowTemp10.SetCellValue(listModel[i].createTime.ToString());
rowTemp10.CellStyle = commonCellStyle;
var rowTemp11 = rowTemp.CreateCell(11);
rowTemp11.SetCellValue(listModel[i].isVerification.ToString());
rowTemp11.CellStyle = commonCellStyle;
var rowTemp12 = rowTemp.CreateCell(12);
rowTemp12.SetCellValue(listModel[i].verificationTime.ToString());
rowTemp12.CellStyle = commonCellStyle;
}
// 写入到excel
string webRootPath = _webHostEnvironment.WebRootPath;
string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicket导出(查询结果).xls";
string filePath = webRootPath + tpath;
DirectoryInfo di = new DirectoryInfo(filePath);
if (!di.Exists)
{
di.Create();
}
FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create);
book.Write(fileHssf);
fileHssf.Close();
jm.code = 0;
jm.msg = GlobalConstVars.ExcelExportSuccess;
jm.data = tpath + fileName;
return jm;
}
#endregion 查询导出============================================================
#region 设置是否核销============================================================
// POST: Api/CoreCmsUserServicesTicket/DoSetisVerification/10
/// <summary>
/// 设置是否核销
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("设置是否核销")]
public async Task<AdminUiCallBack> DoSetisVerification([FromBody] FMUpdateBoolDataByIntId entity)
{
var jm = new AdminUiCallBack();
var oldModel = await _CoreCmsUserServicesTicketServices.QueryByIdAsync(entity.id);
if (oldModel == null)
{
jm.msg = "不存在此信息";
return jm;
}
oldModel.isVerification = (bool)entity.data;
var bl = await _CoreCmsUserServicesTicketServices.UpdateAsync(oldModel);
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
return jm;
}
#endregion 设置是否核销============================================================
}
}

@ -1,631 +0,0 @@
/***********************************************************************
* Project: CoreCms
* ProjectName:
* Web: https://www.corecms.net
* Author:
* Email: jianweie@163.com
* CreateTime: 2021/1/31 21:45:10
* Description:
***********************************************************************/
using System;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Filter;
using CoreCms.Net.Loging;
using CoreCms.Net.IServices;
using CoreCms.Net.Utility.Helper;
using CoreCms.Net.Utility.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using NPOI.HSSF.UserModel;
using SqlSugar;
namespace CoreCms.Net.Web.Admin.Controllers
{
/// <summary>
/// 服务券核验日志
///</summary>
[Description("服务券核验日志")]
[Route("api/[controller]/[action]")]
[ApiController]
[RequiredErrorForAdmin]
[Authorize(Permissions.Name)]
public class CoreCmsUserServicesTicketVerificationLogController : ControllerBase
{
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly ICoreCmsUserServicesTicketVerificationLogServices _CoreCmsUserServicesTicketVerificationLogServices;
/// <summary>
/// 构造函数
///</summary>
public CoreCmsUserServicesTicketVerificationLogController(IWebHostEnvironment webHostEnvironment
, ICoreCmsUserServicesTicketVerificationLogServices CoreCmsUserServicesTicketVerificationLogServices
)
{
_webHostEnvironment = webHostEnvironment;
_CoreCmsUserServicesTicketVerificationLogServices = CoreCmsUserServicesTicketVerificationLogServices;
}
#region 获取列表============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/GetPageList
/// <summary>
/// 获取列表
/// </summary>
/// <returns></returns>
[HttpPost]
[Description("获取列表")]
public async Task<AdminUiCallBack> GetPageList()
{
var jm = new AdminUiCallBack();
var pageCurrent = Request.Form["page"].FirstOrDefault().ObjectToInt(1);
var pageSize = Request.Form["limit"].FirstOrDefault().ObjectToInt(30);
var where = PredicateBuilder.True<CoreCmsUserServicesTicketVerificationLog>();
//获取排序字段
var orderField = Request.Form["orderField"].FirstOrDefault();
Expression<Func<CoreCmsUserServicesTicketVerificationLog, object>> orderEx;
switch (orderField)
{
case "id":
orderEx = p => p.id;
break;
case "storeId":
orderEx = p => p.storeId;
break;
case "verificationUserId":
orderEx = p => p.verificationUserId;
break;
case "ticketId":
orderEx = p => p.ticketId;
break;
case "ticketRedeemCode":
orderEx = p => p.ticketRedeemCode;
break;
case "verificationTime":
orderEx = p => p.verificationTime;
break;
default:
orderEx = p => p.id;
break;
}
//设置排序方式
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
var orderBy = orderDirection switch
{
"asc" => OrderByType.Asc,
"desc" => OrderByType.Desc,
_ => OrderByType.Desc
};
//查询筛选
//序列 int
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
if (id > 0)
{
where = where.And(p => p.id == id);
}
//核销门店id int
var storeId = Request.Form["storeId"].FirstOrDefault().ObjectToInt(0);
if (storeId > 0)
{
where = where.And(p => p.storeId == storeId);
}
//核验人 int
var verificationUserId = Request.Form["verificationUserId"].FirstOrDefault().ObjectToInt(0);
if (verificationUserId > 0)
{
where = where.And(p => p.verificationUserId == verificationUserId);
}
//服务券序列 int
var ticketId = Request.Form["ticketId"].FirstOrDefault().ObjectToInt(0);
if (ticketId > 0)
{
where = where.And(p => p.ticketId == ticketId);
}
//核验码 nvarchar
var ticketRedeemCode = Request.Form["ticketRedeemCode"].FirstOrDefault();
if (!string.IsNullOrEmpty(ticketRedeemCode))
{
where = where.And(p => p.ticketRedeemCode.Contains(ticketRedeemCode));
}
//核验时间 datetime
var verificationTime = Request.Form["verificationTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(verificationTime))
{
if (verificationTime.Contains("到"))
{
var dts = verificationTime.Split("到");
var dtStart = dts[0].Trim().ObjectToDate();
where = where.And(p => p.verificationTime > dtStart);
var dtEnd = dts[1].Trim().ObjectToDate();
where = where.And(p => p.verificationTime < dtEnd);
}
else
{
var dt = verificationTime.ObjectToDate();
where = where.And(p => p.verificationTime > dt);
}
}
//获取数据
var list = await _CoreCmsUserServicesTicketVerificationLogServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize);
//返回数据
jm.data = list;
jm.code = 0;
jm.count = list.TotalCount;
jm.msg = "数据调用成功!";
return jm;
}
#endregion
#region 首页数据============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/GetIndex
/// <summary>
/// 首页数据
/// </summary>
/// <returns></returns>
[HttpPost]
[Description("首页数据")]
public AdminUiCallBack GetIndex()
{
//返回数据
var jm = new AdminUiCallBack { code = 0 };
return jm;
}
#endregion
#region 创建数据============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/GetCreate
/// <summary>
/// 创建数据
/// </summary>
/// <returns></returns>
[HttpPost]
[Description("创建数据")]
public AdminUiCallBack GetCreate()
{
//返回数据
var jm = new AdminUiCallBack { code = 0 };
return jm;
}
#endregion
#region 创建提交============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/DoCreate
/// <summary>
/// 创建提交
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("创建提交")]
public async Task<AdminUiCallBack> DoCreate([FromBody] CoreCmsUserServicesTicketVerificationLog entity)
{
var jm = new AdminUiCallBack();
var bl = await _CoreCmsUserServicesTicketVerificationLogServices.InsertAsync(entity) > 0;
jm.code = bl ? 0 : 1;
jm.msg = (bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure);
return jm;
}
#endregion
#region 编辑数据============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/GetEdit
/// <summary>
/// 编辑数据
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("编辑数据")]
public async Task<AdminUiCallBack> GetEdit([FromBody] FMIntId entity)
{
var jm = new AdminUiCallBack();
var model = await _CoreCmsUserServicesTicketVerificationLogServices.QueryByIdAsync(entity.id);
if (model == null)
{
jm.msg = "不存在此信息";
return jm;
}
jm.code = 0;
jm.data = model;
return jm;
}
#endregion
#region 编辑提交============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/Edit
/// <summary>
/// 编辑提交
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("编辑提交")]
public async Task<AdminUiCallBack> DoEdit([FromBody] CoreCmsUserServicesTicketVerificationLog entity)
{
var jm = new AdminUiCallBack();
var oldModel = await _CoreCmsUserServicesTicketVerificationLogServices.QueryByIdAsync(entity.id);
if (oldModel == null)
{
jm.msg = "不存在此信息";
return jm;
}
//事物处理过程开始
oldModel.id = entity.id;
oldModel.storeId = entity.storeId;
oldModel.verificationUserId = entity.verificationUserId;
oldModel.ticketId = entity.ticketId;
oldModel.ticketRedeemCode = entity.ticketRedeemCode;
oldModel.verificationTime = entity.verificationTime;
//事物处理过程结束
var bl = await _CoreCmsUserServicesTicketVerificationLogServices.UpdateAsync(oldModel);
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
return jm;
}
#endregion
#region 删除数据============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/DoDelete/10
/// <summary>
/// 单选删除
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("单选删除")]
public async Task<AdminUiCallBack> DoDelete([FromBody] FMIntId entity)
{
var jm = new AdminUiCallBack();
var model = await _CoreCmsUserServicesTicketVerificationLogServices.QueryByIdAsync(entity.id);
if (model == null)
{
jm.msg = GlobalConstVars.DataisNo;
return jm;
}
var bl = await _CoreCmsUserServicesTicketVerificationLogServices.DeleteByIdAsync(entity.id);
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
return jm;
}
#endregion
#region 批量删除============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/DoBatchDelete/10,11,20
/// <summary>
/// 批量删除
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("批量删除")]
public async Task<AdminUiCallBack> DoBatchDelete([FromBody] FMArrayIntIds entity)
{
var jm = new AdminUiCallBack();
var bl = await _CoreCmsUserServicesTicketVerificationLogServices.DeleteByIdsAsync(entity.id);
jm.code = bl ? 0 : 1;
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
return jm;
}
#endregion
#region 预览数据============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/GetDetails/10
/// <summary>
/// 预览数据
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("预览数据")]
public async Task<AdminUiCallBack> GetDetails([FromBody] FMIntId entity)
{
var jm = new AdminUiCallBack();
var model = await _CoreCmsUserServicesTicketVerificationLogServices.QueryByIdAsync(entity.id);
if (model == null)
{
jm.msg = "不存在此信息";
return jm;
}
jm.code = 0;
jm.data = model;
return jm;
}
#endregion
#region 选择导出============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/SelectExportExcel/10
/// <summary>
/// 选择导出
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
[HttpPost]
[Description("选择导出")]
public async Task<AdminUiCallBack> SelectExportExcel([FromBody] FMArrayIntIds entity)
{
var jm = new AdminUiCallBack();
//创建Excel文件的对象
var book = new HSSFWorkbook();
//添加一个sheet
var mySheet = book.CreateSheet("Sheet1");
//获取list数据
var listModel = await _CoreCmsUserServicesTicketVerificationLogServices.QueryListByClauseAsync(p => entity.id.Contains(p.id), p => p.id, OrderByType.Asc);
//给sheet1添加第一行的头部标题
var headerRow = mySheet.CreateRow(0);
var headerStyle = ExcelHelper.GetHeaderStyle(book);
var cell0 = headerRow.CreateCell(0);
cell0.SetCellValue("序列");
cell0.CellStyle = headerStyle;
mySheet.SetColumnWidth(0, 10 * 256);
var cell1 = headerRow.CreateCell(1);
cell1.SetCellValue("核销门店id");
cell1.CellStyle = headerStyle;
mySheet.SetColumnWidth(1, 10 * 256);
var cell2 = headerRow.CreateCell(2);
cell2.SetCellValue("核验人");
cell2.CellStyle = headerStyle;
mySheet.SetColumnWidth(2, 10 * 256);
var cell3 = headerRow.CreateCell(3);
cell3.SetCellValue("服务券序列");
cell3.CellStyle = headerStyle;
mySheet.SetColumnWidth(3, 10 * 256);
var cell4 = headerRow.CreateCell(4);
cell4.SetCellValue("核验码");
cell4.CellStyle = headerStyle;
mySheet.SetColumnWidth(4, 10 * 256);
var cell5 = headerRow.CreateCell(5);
cell5.SetCellValue("核验时间");
cell5.CellStyle = headerStyle;
mySheet.SetColumnWidth(5, 10 * 256);
headerRow.Height = 30 * 20;
var commonCellStyle = ExcelHelper.GetCommonStyle(book);
//将数据逐步写入sheet1各个行
for (var i = 0; i < listModel.Count; i++)
{
var rowTemp = mySheet.CreateRow(i + 1);
var rowTemp0 = rowTemp.CreateCell(0);
rowTemp0.SetCellValue(listModel[i].id.ToString());
rowTemp0.CellStyle = commonCellStyle;
var rowTemp1 = rowTemp.CreateCell(1);
rowTemp1.SetCellValue(listModel[i].storeId.ToString());
rowTemp1.CellStyle = commonCellStyle;
var rowTemp2 = rowTemp.CreateCell(2);
rowTemp2.SetCellValue(listModel[i].verificationUserId.ToString());
rowTemp2.CellStyle = commonCellStyle;
var rowTemp3 = rowTemp.CreateCell(3);
rowTemp3.SetCellValue(listModel[i].ticketId.ToString());
rowTemp3.CellStyle = commonCellStyle;
var rowTemp4 = rowTemp.CreateCell(4);
rowTemp4.SetCellValue(listModel[i].ticketRedeemCode.ToString());
rowTemp4.CellStyle = commonCellStyle;
var rowTemp5 = rowTemp.CreateCell(5);
rowTemp5.SetCellValue(listModel[i].verificationTime.ToString());
rowTemp5.CellStyle = commonCellStyle;
}
// 导出excel
string webRootPath = _webHostEnvironment.WebRootPath;
string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicketVerificationLog导出(选择结果).xls";
string filePath = webRootPath + tpath;
DirectoryInfo di = new DirectoryInfo(filePath);
if (!di.Exists)
{
di.Create();
}
FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create);
book.Write(fileHssf);
fileHssf.Close();
jm.code = 0;
jm.msg = GlobalConstVars.ExcelExportSuccess;
jm.data = tpath + fileName;
return jm;
}
#endregion
#region 查询导出============================================================
// POST: Api/CoreCmsUserServicesTicketVerificationLog/QueryExportExcel/10
/// <summary>
/// 查询导出
/// </summary>
/// <returns></returns>
[HttpPost]
[Description("查询导出")]
public async Task<AdminUiCallBack> QueryExportExcel()
{
var jm = new AdminUiCallBack();
var where = PredicateBuilder.True<CoreCmsUserServicesTicketVerificationLog>();
//查询筛选
//序列 int
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
if (id > 0)
{
where = where.And(p => p.id == id);
}
//核销门店id int
var storeId = Request.Form["storeId"].FirstOrDefault().ObjectToInt(0);
if (storeId > 0)
{
where = where.And(p => p.storeId == storeId);
}
//核验人 int
var verificationUserId = Request.Form["verificationUserId"].FirstOrDefault().ObjectToInt(0);
if (verificationUserId > 0)
{
where = where.And(p => p.verificationUserId == verificationUserId);
}
//服务券序列 int
var ticketId = Request.Form["ticketId"].FirstOrDefault().ObjectToInt(0);
if (ticketId > 0)
{
where = where.And(p => p.ticketId == ticketId);
}
//核验码 nvarchar
var ticketRedeemCode = Request.Form["ticketRedeemCode"].FirstOrDefault();
if (!string.IsNullOrEmpty(ticketRedeemCode))
{
where = where.And(p => p.ticketRedeemCode.Contains(ticketRedeemCode));
}
//核验时间 datetime
var verificationTime = Request.Form["verificationTime"].FirstOrDefault();
if (!string.IsNullOrEmpty(verificationTime))
{
var dt = verificationTime.ObjectToDate();
where = where.And(p => p.verificationTime > dt);
}
//获取数据
//创建Excel文件的对象
var book = new HSSFWorkbook();
//添加一个sheet
var mySheet = book.CreateSheet("Sheet1");
//获取list数据
var listModel = await _CoreCmsUserServicesTicketVerificationLogServices.QueryListByClauseAsync(where, p => p.id, OrderByType.Asc);
//给sheet1添加第一行的头部标题
var headerRow = mySheet.CreateRow(0);
var headerStyle = ExcelHelper.GetHeaderStyle(book);
var cell0 = headerRow.CreateCell(0);
cell0.SetCellValue("序列");
cell0.CellStyle = headerStyle;
mySheet.SetColumnWidth(0, 10 * 256);
var cell1 = headerRow.CreateCell(1);
cell1.SetCellValue("核销门店id");
cell1.CellStyle = headerStyle;
mySheet.SetColumnWidth(1, 10 * 256);
var cell2 = headerRow.CreateCell(2);
cell2.SetCellValue("核验人");
cell2.CellStyle = headerStyle;
mySheet.SetColumnWidth(2, 10 * 256);
var cell3 = headerRow.CreateCell(3);
cell3.SetCellValue("服务券序列");
cell3.CellStyle = headerStyle;
mySheet.SetColumnWidth(3, 10 * 256);
var cell4 = headerRow.CreateCell(4);
cell4.SetCellValue("核验码");
cell4.CellStyle = headerStyle;
mySheet.SetColumnWidth(4, 10 * 256);
var cell5 = headerRow.CreateCell(5);
cell5.SetCellValue("核验时间");
cell5.CellStyle = headerStyle;
mySheet.SetColumnWidth(5, 10 * 256);
headerRow.Height = 30 * 20;
var commonCellStyle = ExcelHelper.GetCommonStyle(book);
//将数据逐步写入sheet1各个行
for (var i = 0; i < listModel.Count; i++)
{
var rowTemp = mySheet.CreateRow(i + 1);
var rowTemp0 = rowTemp.CreateCell(0);
rowTemp0.SetCellValue(listModel[i].id.ToString());
rowTemp0.CellStyle = commonCellStyle;
var rowTemp1 = rowTemp.CreateCell(1);
rowTemp1.SetCellValue(listModel[i].storeId.ToString());
rowTemp1.CellStyle = commonCellStyle;
var rowTemp2 = rowTemp.CreateCell(2);
rowTemp2.SetCellValue(listModel[i].verificationUserId.ToString());
rowTemp2.CellStyle = commonCellStyle;
var rowTemp3 = rowTemp.CreateCell(3);
rowTemp3.SetCellValue(listModel[i].ticketId.ToString());
rowTemp3.CellStyle = commonCellStyle;
var rowTemp4 = rowTemp.CreateCell(4);
rowTemp4.SetCellValue(listModel[i].ticketRedeemCode.ToString());
rowTemp4.CellStyle = commonCellStyle;
var rowTemp5 = rowTemp.CreateCell(5);
rowTemp5.SetCellValue(listModel[i].verificationTime.ToString());
rowTemp5.CellStyle = commonCellStyle;
}
// 写入到excel
string webRootPath = _webHostEnvironment.WebRootPath;
string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-CoreCmsUserServicesTicketVerificationLog导出(查询结果).xls";
string filePath = webRootPath + tpath;
DirectoryInfo di = new DirectoryInfo(filePath);
if (!di.Exists)
{
di.Create();
}
FileStream fileHssf = new FileStream(filePath + fileName, FileMode.Create);
book.Write(fileHssf);
fileHssf.Close();
jm.code = 0;
jm.msg = GlobalConstVars.ExcelExportSuccess;
jm.data = tpath + fileName;
return jm;
}
#endregion
}
}

@ -0,0 +1,744 @@
<script type="text/html" template lay-done="layui.data.done(d);">
<div class="layui-fluid addGoods">
<div class="layui-row layui-col-space15">
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsGoods-editForm" id="LAY-app-CoreCmsGoods-editForm">
<div class="layui-tab layui-tab-card" style="margin: 0 0 10px 0">
<ul class="layui-tab-title">
<li class="layui-this">基础信息</li>
<li>图集/视频</li>
<li>SKU/货品设置</li>
<li>参数设置</li>
<li>会员折扣</li>
<li>商品详情</li>
</ul>
<div class="layui-tab-content" style="min-height: 500px;">
<div class="layui-tab-item layui-show">
<div class="layui-form-item">
<label class="layui-form-label">商品名称</label>
<div class="layui-input-inline layui-inline-100 layui-form-mid">{{d.params.data.model.name }}</div>
</div>
<div class="layui-form-item">
<label for="goodsCategoryId" class="layui-form-label">商品分类</label>
<div class="layui-input-inline layui-inline-6">
<div id="goodsCategoryId_SelectCreateTree" class="ew-xmselect-tree" lay-verType="tips" lay-reqText="请选择商品分类"></div>
</div>
<label class="layui-form-label">扩展分类:</label>
<div class="layui-input-inline layui-inline-10">
<div id="goodsCategoryIdExtend_SelectCreateTree" class="xm-select-demo"></div>
</div>
</div>
<div class="layui-form-item">
<label for="brandId" class="layui-form-label">品牌</label>
<div class="layui-input-inline layui-inline-6" id="brandIdView">
<select name="goods[brandId]" id="brandId" disabled="disabled">
<option value="0"></option>
{{# layui.each(d.params.data.brands, function(index, item){ }}
<option value="{{ item.id }}" {{item.id===d.params.data.model.brandId?'selected="selected"':''}}>{{ item.name }}</option>
{{# }); }}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">商品编码</label>
<div class="layui-input-inline layui-inline-100 layui-form-mid">{{d.params.data.model.bn }}</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">商品简介</label>
<div class="layui-input-inline layui-inline-100 layui-form-mid">{{d.params.data.model.brief }}</div>
</div>
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">其他参数</a></legend></fieldset>
<div class="layui-form-item">
<label class="layui-form-label">重量</label>
<div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.model.weight }}克</div>
<label class="layui-form-label">单位</label>
<div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.model.unit }}</div>
<label class="layui-form-label">商品排序</label>
<div class="layui-input-inline layui-inline-3 layui-form-mid">{{d.params.data.model.sort }}</div>
</div>
<div class="layui-form-item">
<label for="isMarketable" class="layui-form-label layui-form-required">是否上架</label>
<div class="layui-input-inline layui-inline-3">
<input type="checkbox" lay-filter="switch" name="goods[isMarketable]" {{d.params.data.model.isMarketable ?'checked="checked"':'' }} id="isMarketable" lay-skin="switch" lay-text="上架|下架" disabled="disabled">
</div>
<label for="isNomalVirtual" class="layui-form-label layui-form-required">虚拟商品</label>
<div class="layui-input-inline layui-inline-3">
<input type="checkbox" lay-filter="switch" name="goods[isNomalVirtual]" {{d.params.data.model.isNomalVirtual ?'checked="checked"':'' }} id="isNomalVirtual" lay-skin="switch" lay-text="是|否" disabled="disabled">
</div>
<label for="isRecommend" class="layui-form-label layui-form-required">是否推荐</label>
<div class="layui-input-inline layui-inline-3">
<input type="checkbox" lay-filter="switch" name="goods[isRecommend]" {{d.params.data.model.isRecommend ?'checked="checked"':'' }} id="isRecommend" lay-skin="switch" lay-text="是|否" disabled="disabled">
</div>
<label for="isHot" class="layui-form-label layui-form-required">是否热门</label>
<div class="layui-input-inline layui-inline-3">
<input type="checkbox" lay-filter="switch" name="goods[isHot]" {{d.params.data.model.isHot ?'checked="checked"':'' }} id="isHot" lay-skin="switch" lay-text="是|否" disabled="disabled">
</div>
</div>
</div>
<div class="layui-tab-item">
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">封面图</a></legend></fieldset>
<div class="layui-form-item">
<label class="layui-form-label" for="avatarImage">封面图:</label>
<div class="layui-input-inline layui-inline-12 layui-form-mid">{{d.params.data.model.image}}</div>
<div class="layui-input-inline">
<div class="layui-upload">
<img class="layui-upload-img" id="viewImgBox" src="{{d.params.data.model.image || layui.setter.noImagePicUrl }}">
</div>
</div>
</div>
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">图集</a></legend></fieldset>
<div class="layui-form-item">
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
<div class="layui-upload-list" id="upload-more-list"></div>
</blockquote>
</div>
<fieldset class="layui-elem-field layui-field-title site-title"><legend><a name="compress">媒体</a></legend></fieldset>
<div class="layui-form-item">
<label class="layui-form-label" for="video">视频:</label>
<div class="layui-input-inline layui-inline-12 layui-form-mid">{{d.params.data.model.video ||'无'}}</div>
</div>
</div>
<div class="layui-tab-item">
<!--<blockquote class="layui-elem-quote">
1、选择对应的【商品类型】将进入多SKU货品模式。同时如果类别有参数也将进行显示设置。<br/>
2、设置多SKU后商品本身的价格只做对外展示用实际以进入商品详情选择不同货品为准。<br/>
3、货品SKU组合属性值只支持中文、英文、数字、大写符号小写符号三个-、/、.<br/>
4、货号必须为SN字母开头<br/>
5、如果不设置单货品重量将默认使用商品重量为1个单位的重量。
</blockquote>-->
<div class="layui-form-item">
<label for="brandId" class="layui-form-label">佣金设置</label>
<div class="layui-input-inline layui-inline-6">
{{# layui.each(d.params.data.productsDistributionType, function(index, item){ }}
<input type="radio" name="goods[productsDistributionType]" disabled="disabled" value="{{ item.value }}" title="{{ item.description }}" {{item.value===d.params.data.model.productsDistributionType?'checked="checked"':''}}>
{{# }); }}
</div>
</div>
<!--<div class="layui-form-item">
<label class="layui-form-label">开启SKU</label>
<div class="layui-input-inline">
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" id="openSpecBtn" lay-active="openSpecBtn" data-id="typeInfo.id" style="margin-top:5px;margin-left: 10px;">启用SKU</button>
</div>
</div>-->
<div class="layui-form-item" id="goodsTypeIdViewBox" style="display: none;">
<label for="goodsTypeId" class="layui-form-label">选择SKU模型</label>
<div class="layui-input-inline layui-inline-10">
<div id="goodsSku_SelectCreateTree" class="xm-select-demo"></div>
</div>
</div>
<div id="product-info">
</div>
</div>
<div class="layui-tab-item">
<div class="layui-form-item">
<label class="layui-form-label">参数模型选择</label>
<div class="layui-input-inline layui-inline-10">
<div id="goodsParams_SelectCreateTree" class="xm-select-demo"></div>
</div>
</div>
<div id="parametersBox">
</div>
</div>
<div class="layui-tab-item">
<blockquote class="layui-elem-quote">
会员价为0时使用默认价格。大于0时商品实际价格=货品销售价-会员价
</blockquote>
<div class="layui-form-item">
{{# layui.each(d.params.data.userGrade, function(index, item){ }}
<label class="layui-form-label layui-form-required">{{ item.title }}</label>
<div class="layui-input-inline layui-inline-3 layui-form-mid">{{getUserGradePrice(d.params.data.goodsGrades, item.id, item.value || 0)}}</div>
{{# }); }}
</div>
</div>
<div class="layui-tab-item">
<div class="layui-form-item layui-form-text">
<div class="layui-input-block">
{{d.params.data.model.intro}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</script>
<script id="getSpec_tpl" type="text/html">
<table class="layui-table" lay-size="sm">
<colgroup>
<col width="150">
<col width="150">
<col width="150">
<col>
<col width="80">
<col width="80">
<col width="80">
<col width="80">
<col width="80">
<col width="80">
<col width="80">
<col width="80">
<col width="80">
</colgroup>
<thead>
<tr>
<th>默认货品</th>
<th>图片</th>
<th>货号</th>
<th>SKU</th>
<th>冻结库存</th>
<th>重量(克)</th>
<th>库存</th>
<th><i class="required-color">*</i>销售价</th>
<th>成本价</th>
<th>市场价</th>
<th>一级返现</th>
<th>二级返现</th>
<th>三级返现</th>
</tr>
</thead>
<tbody id="productsTbody">
{{# layui.each(d, function(index, item){ }}
<tr>
<td>
<input type="hidden" value="{{item.id}}" name="product[id][]" />
<input type="hidden" value="{{item.goodsId || 0}}" name="product[goodsId][]" />
<input type="checkbox" id="product[{{item.spesDesc}}][isDefalut]" name="product[isDefalut][]" title="是否默认" {{item.isDefalut? 'checked="true"':''}} value="{{item.isDefalut? '1':'0'}}" class="isdefalut" lay-filter="isdefalut" disabled="disabled">
</td>
<td class="spec-td">
<div class="spec_image">
<div class="spec_image_item">
<!--<div class="del-img">
x
</div>-->
<img src="{{ item.images && item.images !='null'? item.images : layui.setter.noImagePicUrl }}" id="productImagesSrc" style="width:60px;height:60px">
</div>
<input type="hidden" id="productImagesInput" name="product[images][]" value="{{item.images}}">
</div>
</td>
<td>
{{item.sn}}
</td>
<td>
{{item.spesDesc}}
</td>
<td>
{{item.freezeStock}}
</td>
<td>
{{item.weight}}
</td>
<td class="have-add-td">
{{item.stock}}
</td>
<td>
{{item.price}}
</td>
<td>
{{item.costprice}}
</td>
<td>
{{item.mktprice}}
</td>
<td>
{{item.levelOne}}
</td>
<td>
{{item.levelTwo}}
</td>
<td>
{{item.levelThree}}
</td>
</tr>
{{# }); }}
</tbody>
</table>
</script>
<script id="params_tpl" type="text/html">
{{# if(d.goodsParams){ }}
<blockquote class="layui-elem-quote">
{{# layui.each(d.goodsParams, function(index, item){ }}
<div class="layui-form-item" {{#if(item.type && item.type!='text'){}} pane {{# } }}>
<label class="layui-form-label">{{item.name}}</label>
<div class="layui-input-block">
{{# if(item.type && item.type==='radio'){ }}
{{# layui.each(layui.coreHelper.stringToArray(item.value), function(indexRadio, itemRadio){ }}
<input type="radio" name="paramsValue[{{index}}]" value="{{itemRadio}}" title="{{itemRadio}}" {{ setRadioParameters(d.arrParameters, item.id , itemRadio) ?'checked':'' }} lay-verType="tips" lay-verify="required" disabled="disabled">
{{# }); }}
{{# } else if (item.type && item.type==='checkbox'){ }}
{{# layui.each(layui.coreHelper.stringToArray(item.value), function(indexCheckbox, itemCheckbox){ }}
<input type="checkbox" name="paramsValue[{{index}}][]" value="{{itemCheckbox}}" lay-skin="primary" {{ setCheckboxParameters(d.arrParameters, item.id , itemCheckbox) ?'checked':'' }} title="{{itemCheckbox}}" disabled="disabled">
{{# }); }}
{{# } else if (item.type && item.type==='text'){ }}
<input type="text" name="paramsValue[{{index}}]" value="{{setTextParameters(d.arrParameters, item.id)}}" class="layui-input" disabled="disabled">
{{# } else { }}
{{# } }}
</div>
</div>
{{# }); }}
</blockquote>
{{# } }}
</script>
<script id="sku_tpl" type="text/html">
<form id="spec_form">
<div id="spec_select" style="display: none">
<blockquote class="layui-elem-quote">
{{# if(d.goodsTypeSpec){ }}
{{# layui.each(d.goodsTypeSpec, function(index, item){ }}
<div class="layui-card">
<div class="layui-card-header">{{item.name}}</div>
<div class="layui-card-body">
<div class="layui-form-item">
{{# layui.each(item.specValues, function(indexValue, itemValue){ }}
<div class="spec-item">
<div class="checkboxBox">
<input type="checkbox" name="selectSpec.{{itemValue.id}}.{{item.name}}" value="{{itemValue.value}}" lay-skin="switch" {{isSelectedTypeSpec(d.model.spesDesc, itemValue.id,item.name)?'checked="checked"':''}} lay-filter="spec_select" class="spec-select" lay-text="启用|关闭" disabled="disabled">
</div>
<div class="layui-input-inline layui-inline-3 layui-form-mid">{{getSelectedTypeSpecValue(d.model.newSpec, itemValue.id, itemValue.value)}}</div>
</div>
{{# }); }}
</div>
</div>
</div>
{{# }); }}
{{# } }}
</blockquote>
</div>
<div id="more_spec"></div>
</form>
</script>
<script id="image_tpl" type="text/html">
{{# layui.each(d, function(index, item){ }}
<div class="imgdiv">
<img src="{{ item }}" class="layui-upload-img" onclick='layui.coreHelper.viewImage("{{ item }}")' style="width: 100px;height:100px;">
</div>
{{# }); }}
</script>
<script>
var $;
var debug = layui.setter.debug;
var types;
var imgs = [];
var thumbnailBtn;
var _that = this;
var enptyProducts;
var oldSingleData = {};
var oldMultitermData = [];
var tempMultitermData = [];
layui.data.done = function (d) {
types = d.params.data.types;
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d.data); }
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'dtree', 'view', 'laytpl', 'xmSelect', 'layedit', 'util', 'cropperImg'],
function () {
$ = layui.$;
var form = layui.form
, admin = layui.admin
, laydate = layui.laydate
, upload = layui.upload
, dtree = layui.dtree
, view = layui.view
, laytpl = layui.laytpl
, xmSelect = layui.xmSelect
, layedit = layui.layedit
, util = layui.util
, cropperImg = layui.cropperImg
, coreHelper = layui.coreHelper;
var element = layui.element;
//初始化图片
var defaultImg = 'no';
if (d.params.data.model.images) {
imgs = d.params.data.model.images.split(',');
defaultImg = imgs[0];
$('#imageIds').val(imgs);
var getTpl = image_tpl.innerHTML, viewBox = document.getElementById('upload-more-list');
laytpl(getTpl).render(imgs, function (html) {
viewBox.innerHTML = html;
});
}
//初始化已经确认商品SKU
if (d.params.data.goodsTypeSpec) {
var tmpData = { goodsTypeSpec: d.params.data.goodsTypeSpec, model: d.params.data.model };
//赋值商品参数数据
var getTpl = sku_tpl.innerHTML, viewBox = document.getElementById('product-info');
laytpl(getTpl).render(tmpData, function (html) {
viewBox.innerHTML = html;
});
}
var arrParameters = [];
//初始化已经确认商品参数
if (d.params.data.goodsParams) {
if (d.params.data.model.parameters) {
var arr = d.params.data.model.parameters.split('|');
for (var i = 0; i < arr.length; i++) {
var arrChild = arr[i].split(':');
arrParameters.push(arrChild);
}
}
var tmpData = { goodsParams: d.params.data.goodsParams, arrParameters: arrParameters };
//赋值商品参数数据
var getTpl = params_tpl.innerHTML, viewBox = document.getElementById('parametersBox');
laytpl(getTpl).render(tmpData, function (html) {
viewBox.innerHTML = html;
});
}
//初始化数据
enptyProducts = {
id: 0,
goodsId: 0,
isDefalut: true,
images: layui.setter.noImagePicUrl,
sn: layui.coreHelper.getSN('SN'),
spesDesc: "",
stock: 1000,
weight: 0,
price: 0,
costprice: 0,
mktprice: 0,
levelOne: 0,
levelTwo: 0,
levelThree: 0,
}
oldMultitermData = d.params.data.products;
if (d.params.data.model.openSpec == 1) {
oldSingleData = enptyProducts;
tempMultitermData = d.params.data.products;
} else {
oldSingleData = d.params.data.products[0];
}
//初始化商品信息
var getTpl = getSpec_tpl.innerHTML, viewBox = document.getElementById('more_spec');
var tmpData = oldMultitermData;
laytpl(getTpl).render(tmpData, function (html) {
viewBox.innerHTML = html;
});
$('#productsCount').val(oldMultitermData.length);
if (d.params.data.model.openSpec == 1) {
$("#spec_select").show();
$("#parametersBox").show();
$("#goodsTypeIdViewBox").show();
var btn = $('#openSpecBtn');
$(btn).html("取消SKU");
}
// 渲染商品分类
var insXmSelGoodsCategoryId = xmSelect.render({
el: '#goodsCategoryId_SelectCreateTree',
height: '250px',
data: d.params.data.categories.data,
initValue: d.params.data.model ? [d.params.data.model.goodsCategoryId] : [],
//model: { label: { type: 'text' } },
name: 'goodsCategoryId',
prop: {
name: 'title',
value: 'id'
},
layVerify: 'required',
layVerType: 'msg',
radio: true,
clickClose: true,
disabled: true,
tree: {
show: true,
indent: 15,
strict: false,
expandedKeys: true
}
});
//渲染商品扩展分类
var arr = [];
if (d.params.data.categoryExtend.length > 0) {
for (var i = 0; i < d.params.data.categoryExtend.length; i++) {
arr.push(d.params.data.categoryExtend[i].goodsCategroyId);
}
}
var insXmSelGoodsCategoryIdExtend = xmSelect.render({
el: '#goodsCategoryIdExtend_SelectCreateTree',
height: '250px',
data: d.params.data.categories.data,
//initValue: mData ? [mData.parentId] : [],
//model: { label: { type: 'text' } },
name: 'goodsCategoryIdExtend',
prop: {
name: 'title',
value: 'id'
},
disabled: true,
initValue: arr,
//layVerify: 'required',
//layVerType: 'msg',
//radio: false,
//clickClose: true,
autoRow: true,
tree: {
//是否显示树状结构
show: true,
//是否展示三角图标
showFolderIcon: true,
//是否显示虚线
showLine: true,
//间距
indent: 20,
//默认展开节点的数组, 为 true 时, 展开所有节点
expandedKeys: true,
//是否严格遵守父子模式
strict: false,
//是否开启极简模式
simple: false,
}
});
var arrParams = [];
if (d.params.data.model.goodsParamsIds) {
arrParams = d.params.data.model.goodsParamsIds.split(',');
}
//渲染商品扩展分类
var insGoodsParams = xmSelect.render({
el: '#goodsParams_SelectCreateTree',
height: '250px',
data: d.params.data.paramsList,
//model: { label: { type: 'text' } },
name: 'goodsParamsIds',
prop: {
name: 'name',
value: 'id'
},
disabled: true,
initValue: arrParams,
tree: {
//是否显示树状结构
show: true,
//是否展示三角图标
showFolderIcon: true,
//是否显示虚线
showLine: true,
//间距
indent: 20,
//默认展开节点的数组, 为 true 时, 展开所有节点
expandedKeys: true,
//是否严格遵守父子模式
strict: false,
//是否开启极简模式
simple: false,
}
});
var arrSku = [];
if (d.params.data.model.goodsSkuIds) {
arrSku = d.params.data.model.goodsSkuIds.split(',');
}
//渲染商品扩展分类
var insgoodsSKU = xmSelect.render({
el: '#goodsSku_SelectCreateTree',
height: '250px',
data: d.params.data.skuList,
//model: { label: { type: 'text' } },
name: 'goodsSkuIds',
prop: {
name: 'name',
value: 'id'
},
disabled: true,
initValue: arrSku,
tree: {
//是否显示树状结构
show: true,
//是否展示三角图标
showFolderIcon: true,
//是否显示虚线
showLine: true,
//间距
indent: 20,
//默认展开节点的数组, 为 true 时, 展开所有节点
expandedKeys: true,
//是否严格遵守父子模式
strict: false,
//是否开启极简模式
simple: false,
}
});
function openSpecBox(is_open) {
if (is_open == '0') {
$("input[name=openSpec]").val("1");
$("#spec_select").show();
$("#goodsTypeIdViewBox").show();
$("#openSpecBtn").html("取消SKU");
console.log("取消SKU");
if (_that.tempMultitermData.length == 0) {
$('#more_spec').html('');
$('#productsCount').val(0);
} else {
var getTpl = getSpec_tpl.innerHTML, viewBox = document.getElementById('more_spec');
laytpl(getTpl).render(_that.tempMultitermData, function (html) {
viewBox.innerHTML = html;
});
$('#productsCount').val(_that.tempMultitermData.length);
}
} else {
$("input[name=openSpec]").val("0");
$("#spec_select").hide();
$("#goodsTypeIdViewBox").hide();
$("#openSpecBtn").html("启用SKU");
console.log("启用SKU");
var arr = [];
arr.push(_that.oldSingleData);
var getTpl = getSpec_tpl.innerHTML, viewBox = document.getElementById('more_spec');
laytpl(getTpl).render(arr, function (html) {
viewBox.innerHTML = html;
});
$('#productsCount').val(1);
}
form.render();
}
form.render();
})
};
//删除图片
function delImg(obj, imageUrl) {
var imgDiv = $(obj).parent().parent().parent();
imgDiv.remove();
var index = imgs.indexOf(imageUrl);
if (index > -1) {
imgs.splice(index, 1);
}
$('#imageIds').val(imgs);
}
//设为默认图
function setDefault(obj, imageUrl) {
var imgDiv = $(obj).parent().parent().parent();
$("#upload-more-list").prepend(imgDiv);
var index = imgs.indexOf(imageUrl);
if (index > -1) {
imgs.unshift(imgs.splice(index, 1)[0]);
}
$('#imageIds').val(imgs);
}
//获取设置参数文字内容
function setTextParameters(parameters, id) {
if (parameters) {
for (var i = 0; i < parameters.length; i++) {
if (parameters[i][0] == id) {
return parameters[i][1];
}
}
}
return '';
}
//获取设置参数单选内容
function setRadioParameters(parameters, id, value) {
if (parameters) {
for (var i = 0; i < parameters.length; i++) {
if (parameters[i][0] == id && parameters[i][1] == value) {
return true;
}
}
}
return false;
}
//获取设置参数复选框内容
function setCheckboxParameters(parameters, id, value) {
if (parameters) {
for (var i = 0; i < parameters.length; i++) {
if (parameters[i][0] == id) {
var arr = parameters[i][1].split(',');
for (var j = 0; j < arr.length; j++) {
if (value == arr[j]) {
return true;
}
}
}
}
}
return false;
}
//获取不同会员级别价格
function getUserGradePrice(parameters, id, value) {
if (parameters) {
for (var i = 0; i < parameters.length; i++) {
if (parameters[i].gradeId == id) {
return parameters[i].gradePrice
}
}
return value;
}
return value;
}
//判断SKU是否选中
function isSelectedTypeSpec(parameters, id, value) {
if (parameters) {
var arr = parameters.split('|');
for (var i = 0; i < arr.length; i++) {
var str = id + '.' + value;
var child = arr[i].split(':');
if (child[0] === str) {
return true;
}
}
return false;
}
return false;
}
function getSelectedTypeSpecValue(parameters, id, value) {
if (parameters) {
var arr = parameters.split('|');
for (var i = 0; i < arr.length; i++) {
var child = arr[i].split(':');
if (child[0] === id.toString()) {
return child[1];
}
}
return value;
}
return value;
}
</script>

@ -118,6 +118,11 @@
, element = layui.element
, view = layui.view;
//监听行双击事件
table.on('rowDouble(LAY-app-CoreCmsGoods-tableBox)', function (obj) {
//查看详情
doDetails(obj);
});
//重载form
@ -255,13 +260,14 @@
}
});
});
//监听行双击事件
//table.on('rowDouble(LAY-app-CoreCmsGoods-tableBox)', function (obj) {
//});
//监听工具条
table.on('tool(LAY-app-CoreCmsGoods-tableBox)',
function (obj) {
if (obj.event === 'del') {
if (obj.event === 'detail') {
doDetails(obj);
} else if (obj.event === 'del') {
doDelete(obj);
} else if (obj.event === 'edit') {
doEdit(obj)
@ -421,6 +427,32 @@
}
});
}
//执行预览操作
function doDetails(obj) {
console.log(obj);
coreHelper.Post("Api/CoreCmsGoods/GetDetails", { id: obj.data.id }, function (e) {
if (e.code === 0) {
admin.popup({
shadeClose: false,
title: '查看详情',
area: ['95%', '95%'],
id: 'LAY-popup-CoreCmsGoods-details',
success: function (layero, index) {
view(this.id).render('good/goods/details', { data: e.data }).done(function () {
form.render();
});
// 禁止弹窗出现滚动条
//$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
layer.msg(e.msg);
}
});
}
//删除商品
function delGoods(delidsStr) {
layer.confirm('确定删除吗?删除后将无法恢复。',

@ -183,6 +183,26 @@
<label class="layui-form-label">买家备注</label>
<div class="layui-input-inline layui-form-mid layui-inline-10">{{d.params.data.memo||'无'}}</div>
</div>
<!--下单用户-->
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
<legend style="font-size:14px;">下单用户</legend>
</fieldset>
<div class="layui-form-item">
<label class="layui-form-label">用户编号</label>
<div class="layui-input-inline layui-inline-3 layui-form-mid">
{{d.params.data.user.id}}
</div>
<label class="layui-form-label">用户手机</label>
<div class="layui-input-inline layui-inline-3 layui-form-mid">
{{d.params.data.user.mobile}}
</div><label class="layui-form-label">用户昵称</label>
<div class="layui-input-inline layui-inline-3 layui-form-mid">
{{d.params.data.user.nickName}}
</div><label class="layui-form-label">微信编号</label>
<div class="layui-input-inline layui-inline-3 layui-form-mid">
{{d.params.data.user.userWx}}
</div>
</div>
</div>
<!--商品详情-->

@ -1,73 +1,80 @@
<script type="text/html" template lay-done="layui.data.done(d);">
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsUserServicesOrder-createForm" id="LAY-app-CoreCmsUserServicesOrder-createForm">
<div class="layui-form-item">
<label for="serviceOrderId" class="layui-form-label layui-form-required">服务订单编号</label>
<div class="layui-input-block">
<input name="serviceOrderId" lay-verType="tips" lay-verify="required|verifyserviceOrderId" class="layui-input" lay-reqText="请输入服务订单编号" placeholder="请输入服务订单编号" />
</div>
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsUserServicesOrder-createForm" id="LAY-app-CoreCmsUserServicesOrder-createForm">
<div class="layui-form-item">
<label for="id" class="layui-form-label layui-form-required">序列</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入序列" lay-reqText="请输入序列并为数字" />
</div>
<div class="layui-form-item">
<label for="userId" class="layui-form-label layui-form-required">关联用户</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="userId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入关联用户" lay-reqText="请输入关联用户并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="serviceOrderId" class="layui-form-label layui-form-required">服务订单编号</label>
<div class="layui-input-block">
<input name="serviceOrderId" lay-verType="tips" lay-verify="required|verifyserviceOrderId" class="layui-input" lay-reqText="请输入服务订单编号" placeholder="请输入服务订单编号"/>
</div>
<div class="layui-form-item">
<label for="servicesId" class="layui-form-label layui-form-required">关联服务</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="servicesId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入关联服务" lay-reqText="请输入关联服务并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="userId" class="layui-form-label layui-form-required">关联用户</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="userId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入关联用户" lay-reqText="请输入关联用户并为数字" />
</div>
<div class="layui-form-item" pane>
<label for="isPay" class="layui-form-label layui-form-required">是否支付</label>
<div class="layui-input-block">
<input type="checkbox" lay-filter="switch" name="isPay" lay-skin="switch" lay-text="开启|关闭">
</div>
</div>
<div class="layui-form-item">
<label for="servicesId" class="layui-form-label layui-form-required">关联服务</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="servicesId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入关联服务" lay-reqText="请输入关联服务并为数字" />
</div>
<div class="layui-form-item">
<label for="payTime" class="layui-form-label layui-form-required">支付时间</label>
<div class="layui-input-block">
<input name="payTime" id="createTime-CoreCmsUserServicesOrder-payTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入支付时间" lay-reqText="请输入支付时间" />
</div>
</div>
<div class="layui-form-item" pane>
<label for="isPay" class="layui-form-label layui-form-required">是否支付</label>
<div class="layui-input-block">
<input type="checkbox" lay-filter="switch" name="isPay" lay-skin="switch" lay-text="开启|关闭">
</div>
<div class="layui-form-item">
<label for="paymentId" class="layui-form-label layui-form-required">支付单号</label>
<div class="layui-input-block">
<input name="paymentId" lay-verType="tips" lay-verify="required|verifypaymentId" class="layui-input" lay-reqText="请输入支付单号" placeholder="请输入支付单号" />
</div>
</div>
<div class="layui-form-item">
<label for="payTime" class="layui-form-label layui-form-required">支付时间</label>
<div class="layui-input-block">
<input name="payTime" id="createTime-CoreCmsUserServicesOrder-payTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入支付时间" lay-reqText="请输入支付时间" />
</div>
<div class="layui-form-item">
<label for="status" class="layui-form-label layui-form-required">状态</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入状态" lay-reqText="请输入状态并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="paymentId" class="layui-form-label layui-form-required">支付单号</label>
<div class="layui-input-block">
<input name="paymentId" lay-verType="tips" lay-verify="required|verifypaymentId" class="layui-input" lay-reqText="请输入支付单号" placeholder="请输入支付单号"/>
</div>
<div class="layui-form-item">
<label for="createTime" class="layui-form-label layui-form-required">订单创建时间</label>
<div class="layui-input-block">
<input name="createTime" id="createTime-CoreCmsUserServicesOrder-createTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入订单创建时间" lay-reqText="请输入订单创建时间" />
</div>
</div>
<div class="layui-form-item">
<label for="status" class="layui-form-label layui-form-required">状态</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入状态" lay-reqText="请输入状态并为数字" />
</div>
<div class="layui-form-item">
<label for="servicesEndTime" class="layui-form-label layui-form-required">截止服务时间</label>
<div class="layui-input-block">
<input name="servicesEndTime" id="createTime-CoreCmsUserServicesOrder-servicesEndTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入截止服务时间" lay-reqText="请输入截止服务时间" />
</div>
</div>
<div class="layui-form-item">
<label for="createTime" class="layui-form-label layui-form-required">订单创建时间</label>
<div class="layui-input-block">
<input name="createTime" id="createTime-CoreCmsUserServicesOrder-createTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入订单创建时间" lay-reqText="请输入订单创建时间" />
</div>
<div class="layui-form-item text-right">
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsUserServicesOrder-createForm-submit" id="LAY-app-CoreCmsUserServicesOrder-createForm-submit" value="确认添加">
</div>
<div class="layui-form-item">
<label for="servicesEndTime" class="layui-form-label layui-form-required">截止服务时间</label>
<div class="layui-input-block">
<input name="servicesEndTime" id="createTime-CoreCmsUserServicesOrder-servicesEndTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入截止服务时间" lay-reqText="请输入截止服务时间" />
</div>
</div>
<div class="layui-form-item text-right core-hidden">
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsUserServicesOrder-createForm-submit" id="LAY-app-CoreCmsUserServicesOrder-createForm-submit" value="确认添加">
</div>
</div>
</script>
<script>
var debug= layui.setter.debug;
@ -83,7 +90,7 @@
, upload = layui.upload
, cropperImg = layui.cropperImg
, coreHelper = layui.coreHelper;
laydate.render({
elem: '#createTime-CoreCmsUserServicesOrder-payTime',
type: 'datetime'
@ -97,12 +104,12 @@
type: 'datetime'
});
form.verify({
verifyserviceOrderId: [/^[\S]{0,50}$/,'服务订单编号最大只允许输入50位字符,且不能出现空格'],
verifypaymentId: [/^[\S]{0,50}$/,'支付单号最大只允许输入50位字符,且不能出现空格'],
verifyserviceOrderId: [/^.{0,50}$/,'服务订单编号最大只允许输入50位字符'],
verifypaymentId: [/^.{0,50}$/,'支付单号最大只允许输入50位字符'],
});
//重载form
form.render(null, 'LAY-app-CoreCmsUserServicesOrder-createForm');
})
};
</script>
</script>

@ -1,107 +1,273 @@
<script type="text/html" template lay-done="layui.data.done(d);">
<table class="layui-table layui-form" lay-filter="LAY-app-CoreCmsUserServicesOrder-detailsForm" id="LAY-app-CoreCmsUserServicesOrder-detailsForm">
<colgroup>
<col width="150">
<col>
</colgroup>
<tbody>
<tr>
<td>
<label for="serviceOrderId">服务订单编号</label>
</td>
<td>
{{ d.params.data.serviceOrderId || '' }}
</td>
</tr>
<tr>
<td>
<label for="userId">关联用户</label>
</td>
<td>
{{ d.params.data.userId || '' }}
</td>
</tr>
<tr>
<td>
<label for="servicesId">关联服务</label>
</td>
<td>
{{ d.params.data.servicesId || '' }}
</td>
</tr>
<tr>
<td>
<label for="isPay">是否支付</label>
</td>
<td>
<input type="checkbox" disabled name="isPay" value="{{d.params.data.isPay}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="isPay" {{ d.params.data.isPay ? 'checked' : '' }}>
</td>
</tr>
<tr>
<td>
<label for="payTime">支付时间</label>
</td>
<td>
{{ d.params.data.payTime || '' }}
</td>
</tr>
<tr>
<td>
<label for="paymentId">支付单号</label>
</td>
<td>
{{ d.params.data.paymentId || '' }}
</td>
</tr>
<tr>
<td>
<label for="status">状态</label>
</td>
<td>
{{ d.params.data.status || '' }}
</td>
</tr>
<tr>
<td>
<label for="createTime">订单创建时间</label>
</td>
<td>
{{ d.params.data.createTime || '' }}
</td>
</tr>
<tr>
<td>
<label for="servicesEndTime">截止服务时间</label>
</td>
<td>
{{ d.params.data.servicesEndTime || '' }}
</td>
</tr>
</tbody>
</table>
<div class="table-body">
<table id="LAY-app-CoreCmsUserServicesTicket-tableBox" lay-filter="LAY-app-CoreCmsUserServicesTicket-tableBox"></table>
</div>
<script type="text/html" id="LAY-app-CoreCmsUserServicesTicket-toolbar">
<div class="layui-form coreshop-toolbar-search-form">
<div class="layui-form-item">
<div class="layui-inline">
<div class="layui-input-inline">
<input type="text" name="redeemCode" placeholder="请输入兑换码" class="layui-input">
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline">
<select name="status">
<option value="">请选择类型</option>
{{# layui.each(d.params.data.servicesTicketStatus, function(index, item){ }}
<option value="{{ item.value }}">{{ item.description }}</option>
{{# }); }}
</select>
</div>
</div>
<!--<div class="layui-inline">
<div class="layui-input-inline">
<input type="text" name="validityType" placeholder="请输入核销有效期类型" class="layui-input">
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline" style="width: 260px;">
<input type="text" name="validityStartTime" id="searchTime-CoreCmsUserServicesTicket-validityStartTime" placeholder="请输入核销开始时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline" style="width: 260px;">
<input type="text" name="validityEndTime" id="searchTime-CoreCmsUserServicesTicket-validityEndTime" placeholder="请输入核销结束时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="createTime">创建时间</label>
<div class="layui-input-inline" style="width: 260px;">
<input type="text" name="createTime" id="searchTime-CoreCmsUserServicesTicket-createTime" placeholder="请输入创建时间" class="layui-input">
</div>
</div>-->
<div class="layui-inline">
<div class="layui-input-inline">
<select name="isVerification">
<option value="">请选择是否核销</option>
<option value="True"></option>
<option value="False"></option>
</select>
</div>
</div>
<div class="layui-inline">
<div class="layui-input-inline" style="width: 260px;">
<input type="text" name="verificationTime" id="searchTime-CoreCmsUserServicesTicket-verificationTime" placeholder="请输入核销时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-CoreCmsUserServicesTicket-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
</div>
</div>
</div>
</script>
</script>
<script type="text/html" id="LAY-app-CoreCmsUserServicesTicket-pagebar">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" lay-event="selectExportExcel"><i class="layui-icon layui-icon-add-circle"></i>选择导出</button>
<button class="layui-btn layui-btn-sm" lay-event="queryExportExcel"><i class="layui-icon layui-icon-download-circle"></i>查询导出</button>
</div>
</script>
<script type="text/html" id="LAY-app-CoreCmsUserServicesTicket-tableBox-bar">
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="cancellation">作废</a>
</script>
<script>
var debug= layui.setter.debug;
var debug = layui.setter.debug;
layui.data.done = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d.params.data); }
layui.use(['admin', 'form', 'coreHelper'], function () {
layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'], function () {
var $ = layui.$
, setter = layui.setter
, admin = layui.admin
, table = layui.table
, form = layui.form
, laydate = layui.laydate
, setter = layui.setter
, coreHelper = layui.coreHelper
, form = layui.form;
form.render(null, 'LAY-app-CoreCmsUserServicesOrder-detailsForm');
, util = layui.util
, view = layui.view;
var searchwhere;
//监听搜索
form.on('submit(LAY-app-CoreCmsUserServicesTicket-search)',
function (data) {
var field = data.field;
searchwhere = field;
//执行重载
table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox', { where: field });
});
//数据绑定
table.render({
elem: '#LAY-app-CoreCmsUserServicesTicket-tableBox',
url: layui.setter.apiUrl + 'Api/CoreCmsUserServicesOrder/GetTicketPageList?serviceOrderId=' + d.params.data.model.serviceOrderId,
method: 'POST',
toolbar: '#LAY-app-CoreCmsUserServicesTicket-toolbar',
pagebar: '#LAY-app-CoreCmsUserServicesTicket-pagebar',
className: 'pagebarbox',
defaultToolbar: ['filter', 'print', 'exports'],
height: 'full-227',//面包屑142px,搜索框4行172,3行137,2行102,1行67
page: true,
limit: 30,
limits: [10, 15, 20, 25, 30, 50, 100, 200],
text: { none: '暂无相关数据' },
cols: [
[
{ type: "checkbox", fixed: "left" },
{ field: 'id', title: '序列', width: 50, sort: false },
//{ field: 'serviceOrderId', title: '关联购买订单', sort: false, width: 105 },
{ field: 'securityCode', title: '安全码', sort: false, width: 155 },
{ field: 'redeemCode', title: '兑换码', sort: false, width: 70 },
//{ field: 'serviceId', title: '关联服务项目id', sort: false, width: 105 },
//{ field: 'userId', title: '关联用户id', sort: false, width: 105 },
{
field: 'status', title: '状态', sort: false, width: 70, templet: function (data) {
for (var i = 0; i < d.params.data.servicesTicketStatus.length; i++) {
if (data.status == d.params.data.servicesTicketStatus[i].value) {
return d.params.data.servicesTicketStatus[i].description;
}
}
return "";
}
},
//{ field: 'validityType', title: '核销有效期类型', sort: false, width: 105 },
{
field: 'validityType', title: '有效期类型', sort: false, width: 80,
templet: function (data) {
for (var j = 0; j < d.params.data.types.length; j++) {
if (d.params.data.types[j].value == data.validityType) {
return d.params.data.types[j].description;
}
}
return "";
}
},
{ field: 'validityStartTime', title: '核销开始时间', width: 130, sort: false },
{ field: 'validityEndTime', title: '核销结束时间', width: 130, sort: false },
{ field: 'createTime', title: '创建时间', width: 130, sort: false },
{ field: 'isVerification', title: '是否核销', width: 65, templet: '#switch_isVerification', sort: false, unresize: true },
{ field: 'verificationTime', title: '核销时间', width: 130, sort: false },
{ width: 60, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsUserServicesTicket-tableBox-bar' }
]
]
});
//监听工具条
table.on('tool(LAY-app-CoreCmsUserServicesTicket-tableBox)',
function(obj) {
if (obj.event === 'cancellation') {
doCancellation(obj);
}
});
//头工具栏事件
table.on('pagebar(LAY-app-CoreCmsUserServicesTicket-tableBox)', function (obj) {
var checkStatus = table.checkStatus(obj.config.id);
switch (obj.event) {
case 'selectExportExcel':
doSelectExportExcel(checkStatus);
break;
case 'queryExportExcel':
doQueryExportexcel();
break;
};
});
//作废核销码记录
function doCancellation(obj) {
layer.confirm('确定要作废当前核销码吗?',
function (index) {
coreHelper.Post("Api/CoreCmsUserServicesOrder/DoCancellationTicket", { id: obj.data.id }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox');
layer.msg(e.msg);
});
});
}
//执行查询条件导出excel
function doQueryExportexcel() {
layer.confirm('确定根据当前的查询条件导出数据吗?',
function (index) {
var field = searchwhere;
coreHelper.PostForm("Api/CoreCmsUserServicesOrder/QueryTicketExportExcel", field, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
if (e.code === 0) {
window.open(e.data);
} else {
layer.msg(e.msg);
}
});
});
}
//执行选择目录导出数据
function doSelectExportExcel(checkStatus) {
var checkData = checkStatus.data;
if (checkData.length === 0) {
return layer.msg('请选择您要导出的数据');
}
layer.confirm('确定导出选择的内容吗?',
function (index) {
var delidsStr = [];
layui.each(checkData,
function (index, item) {
delidsStr.push(item.id);
});
layer.close(index);
coreHelper.Post("Api/CoreCmsUserServicesOrder/SelectTicketExportExcel", { id: delidsStr }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
if (e.code === 0) {
window.open(e.data);
} else {
layer.msg(e.msg);
}
});
});
}
laydate.render({
elem: '#searchTime-CoreCmsUserServicesTicket-validityStartTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesTicket-validityEndTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesTicket-createTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesTicket-verificationTime',
type: 'datetime',
range: '到',
});
//监听 表格复选框操作
layui.form.on('switch(switch_isVerification)', function (obj) {
coreHelper.Post("Api/CoreCmsUserServicesTicket/DoSetisVerification", { id: this.value, data: obj.elem.checked }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
//table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox');
layer.msg(e.msg);
});
});
form.render();
});
};
</script>
</script>
<!--设置是否核销-->
<script type="text/html" id="switch_isVerification">
<input type="checkbox" name="switch_isVerification" value="{{d.id}}" lay-skin="switch" lay-text="是|否" lay-filter="switch_isVerification" {{ d.isVerification ? 'checked' : '' }}>
</script>

@ -1,101 +1,115 @@
<script type="text/html" template lay-done="layui.data.sendParams(d);">
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsUserServicesOrder-editForm" id="LAY-app-CoreCmsUserServicesOrder-editForm">
<div class="layui-form-item">
<input type="hidden" name="id" value="{{d.params.data.id || '' }}" />
<div class="layui-form-item">
<label for="id" class="layui-form-label layui-form-required">序列</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.id || '' }}" placeholder="请输入序列" lay-reqText="请输入序列并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="serviceOrderId" class="layui-form-label layui-form-required">服务订单编号</label>
<div class="layui-input-block">
<input name="serviceOrderId" lay-verType="tips" lay-verify="required|verifyserviceOrderId" class="layui-input" placeholder="请输入服务订单编号" lay-reqText="请输入服务订单编号" value="{{d.params.data.serviceOrderId || '' }}" />
<input name="serviceOrderId" lay-verType="tips" lay-verify="required|verifyserviceOrderId" class="layui-input" placeholder="请输入服务订单编号" lay-reqText="请输入服务订单编号" value="{{d.params.data.serviceOrderId || '' }}" />
</div>
</div>
<div class="layui-form-item">
<div class="layui-form-item">
<label for="userId" class="layui-form-label layui-form-required">关联用户</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="userId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.userId || '' }}" placeholder="请输入关联用户" lay-reqText="请输入关联用户并为数字" />
<input type="number" min="0" max="999999" name="userId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.userId || '' }}" placeholder="请输入关联用户" lay-reqText="请输入关联用户并为数字" />
</div>
</div>
<div class="layui-form-item">
<div class="layui-form-item">
<label for="servicesId" class="layui-form-label layui-form-required">关联服务</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="servicesId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.servicesId || '' }}" placeholder="请输入关联服务" lay-reqText="请输入关联服务并为数字" />
<input type="number" min="0" max="999999" name="servicesId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.servicesId || '' }}" placeholder="请输入关联服务" lay-reqText="请输入关联服务并为数字" />
</div>
</div>
<div class="layui-form-item" pane>
<div class="layui-form-item" pane>
<label for="isPay" class="layui-form-label layui-form-required">是否支付</label>
<div class="layui-input-block">
<input type="checkbox" lay-filter="switch" name="isPay" {{ d.params.data.isPay ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭"> </div> </div> <div class="layui-form-item"> <label for="payTime" class="layui-form-label layui-form-required">支付时间</label> <div class="layui-input-block"> <input name="payTime" id="editTime-CoreCmsUserServicesOrder-payTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入支付时间" lay-reqText="请输入支付时间" value="{{d.params.data.payTime || '' }} " />
<input type="checkbox" lay-filter="switch" name="isPay" {{ d.params.data.isPay ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭">
</div>
</div>
<div class="layui-form-item">
<div class="layui-form-item">
<label for="payTime" class="layui-form-label layui-form-required">支付时间</label>
<div class="layui-input-block">
<input name="payTime" id="editTime-CoreCmsUserServicesOrder-payTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入支付时间" lay-reqText="请输入支付时间" value="{{d.params.data.payTime || '' }}"/>
</div>
</div>
<div class="layui-form-item">
<label for="paymentId" class="layui-form-label layui-form-required">支付单号</label>
<div class="layui-input-block">
<input name="paymentId" lay-verType="tips" lay-verify="required|verifypaymentId" class="layui-input" placeholder="请输入支付单号" lay-reqText="请输入支付单号" value="{{d.params.data.paymentId || '' }}" />
<input name="paymentId" lay-verType="tips" lay-verify="required|verifypaymentId" class="layui-input" placeholder="请输入支付单号" lay-reqText="请输入支付单号" value="{{d.params.data.paymentId || '' }}" />
</div>
</div>
<div class="layui-form-item">
<div class="layui-form-item">
<label for="status" class="layui-form-label layui-form-required">状态</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.status || '' }}" placeholder="请输入状态" lay-reqText="请输入状态并为数字" />
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.status || '' }}" placeholder="请输入状态" lay-reqText="请输入状态并为数字" />
</div>
</div>
<div class="layui-form-item">
<div class="layui-form-item">
<label for="createTime" class="layui-form-label layui-form-required">订单创建时间</label>
<div class="layui-input-block">
<input name="createTime" id="editTime-CoreCmsUserServicesOrder-createTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入订单创建时间" lay-reqText="请输入订单创建时间" value="{{d.params.data.createTime || '' }}" />
<input name="createTime" id="editTime-CoreCmsUserServicesOrder-createTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入订单创建时间" lay-reqText="请输入订单创建时间" value="{{d.params.data.createTime || '' }}"/>
</div>
</div>
<div class="layui-form-item">
<div class="layui-form-item">
<label for="servicesEndTime" class="layui-form-label layui-form-required">截止服务时间</label>
<div class="layui-input-block">
<input name="servicesEndTime" id="editTime-CoreCmsUserServicesOrder-servicesEndTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入截止服务时间" lay-reqText="请输入截止服务时间" value="{{d.params.data.servicesEndTime || '' }}" />
<input name="servicesEndTime" id="editTime-CoreCmsUserServicesOrder-servicesEndTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入截止服务时间" lay-reqText="请输入截止服务时间" value="{{d.params.data.servicesEndTime || '' }}"/>
</div>
</div>
<div class="layui-form-item text-right">
<div class="layui-form-item text-right core-hidden">
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsUserServicesOrder-editForm-submit" id="LAY-app-CoreCmsUserServicesOrder-editForm-submit" value="确认编辑">
</div>
</div>
</script>
<script>
var debug = layui.setter.debug;
var debug= layui.setter.debug;
layui.data.sendParams = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d.params.data); }
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
function () {
var $ = layui.$
, form = layui.form
, admin = layui.admin
, laydate = layui.laydate
, upload = layui.upload
, cropperImg = layui.cropperImg
, coreHelper = layui.coreHelper;
laydate.render({
elem: '#editTime-CoreCmsUserServicesOrder-payTime',
type: 'datetime'
});
laydate.render({
elem: '#editTime-CoreCmsUserServicesOrder-createTime',
type: 'datetime'
});
laydate.render({
elem: '#editTime-CoreCmsUserServicesOrder-servicesEndTime',
type: 'datetime'
});
form.verify({
verifyserviceOrderId: [/^[\S]{0,50}$/, '服务订单编号最大只允许输入50位字符,且不能出现空格'],
verifypaymentId: [/^[\S]{0,50}$/, '支付单号最大只允许输入50位字符且不能出现空格'],
});
//重载form
form.render(null, 'LAY-app-CoreCmsUserServicesOrder-editForm');
})
function () {
var $ = layui.$
, form = layui.form
, admin = layui.admin
, laydate = layui.laydate
, upload = layui.upload
, cropperImg = layui.cropperImg
, coreHelper = layui.coreHelper;
laydate.render({
elem: '#editTime-CoreCmsUserServicesOrder-payTime',
type: 'datetime'
});
laydate.render({
elem: '#editTime-CoreCmsUserServicesOrder-createTime',
type: 'datetime'
});
laydate.render({
elem: '#editTime-CoreCmsUserServicesOrder-servicesEndTime',
type: 'datetime'
});
form.verify({
verifyserviceOrderId: [/^.{0,50}$/,'服务订单编号最大只允许输入50位字符'],
verifypaymentId: [/^.{0,50}$/,'支付单号最大只允许输入50位字符'],
});
//重载form
form.render(null, 'LAY-app-CoreCmsUserServicesOrder-editForm');
})
};
</script>
</script>

@ -10,65 +10,68 @@
<style>
/* 重写样式 */
</style>
<script type="text/html" template lay-type="Post" lay-url="{{ layui.setter.apiUrl }}Api/CoreCmsUserServicesOrder/GetIndex" lay-done="layui.data.done(d);">
<script type="text/html" template lay-type="Post" lay-url="Api/CoreCmsUserServicesOrder/GetIndex" lay-done="layui.data.done(d);">
</script>
<div class="table-body">
<table id="LAY-app-CoreCmsUserServicesOrder-tableBox" lay-filter="LAY-app-CoreCmsUserServicesOrder-tableBox"></table>
</div>
<script type="text/html" id="LAY-app-CoreCmsUserServicesOrder-toolbar">
<div class="layui-form coreshop-toolbar-search-form">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" for="serviceOrderId">服务订单编号</label>
<div class="layui-input-inline">
<input type="text" name="serviceOrderId" placeholder="请输入服务订单编号" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="userId">关联用户</label>
<div class="layui-input-inline">
<input type="text" name="userId" placeholder="请输入关联用户" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="servicesId">关联服务</label>
<div class="layui-input-inline">
<input type="text" name="servicesId" placeholder="请输入关联服务" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="isPay">是否支付</label>
<div class="layui-input-inline">
<select name="isPay">
<option value="">请选择</option>
<option value="">请选择是否支付</option>
<option value="True"></option>
<option value="False"></option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="payTime">支付时间</label>
<div class="layui-input-inline core-time-input">
<input type="text" name="payTime" id="searchTime-CoreCmsUserServicesOrder-payTime" placeholder="请输入支付时间" class="layui-input">
<div class="layui-input-inline">
<input type="text" name="paymentId" placeholder="请输入支付单号" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="paymentId">支付单号</label>
<div class="layui-input-inline">
<input type="text" name="paymentId" placeholder="请输入支付单号" class="layui-input">
<select name="status">
<option value="">请选择状态</option>
{{# layui.each(indexData.serviceOrderStatus, function(index, item){ }}
<option value="{{ item.value }}">{{ item.title }}</option>
{{# }); }}
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="status">状态</label>
<div class="layui-input-inline">
<input type="text" name="status" placeholder="请输入状态" class="layui-input">
<div class="layui-input-inline" style="width: 260px;">
<input type="text" name="payTime" id="searchTime-CoreCmsUserServicesOrder-payTime" placeholder="请输入支付时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="createTime">订单创建时间</label>
<div class="layui-input-inline core-time-input">
<div class="layui-input-inline" style="width: 260px;">
<input type="text" name="createTime" id="searchTime-CoreCmsUserServicesOrder-createTime" placeholder="请输入订单创建时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="servicesEndTime">截止服务时间</label>
<div class="layui-input-inline core-time-input">
<div class="layui-input-inline" style="width: 260px;">
<input type="text" name="servicesEndTime" id="searchTime-CoreCmsUserServicesOrder-servicesEndTime" placeholder="请输入截止服务时间" class="layui-input">
</div>
</div>
@ -78,32 +81,27 @@
</div>
</div>
</script>
<div class="table-body">
<table id="LAY-app-CoreCmsUserServicesOrder-tableBox" lay-filter="LAY-app-CoreCmsUserServicesOrder-tableBox"></table>
</div>
<script type="text/html" id="LAY-app-CoreCmsUserServicesOrder-toolbar">
<script type="text/html" id="LAY-app-CoreCmsUserServicesOrder-pagebar">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i>添加数据</button>
<button class="layui-btn layui-btn-sm" lay-event="batchDelete"><i class="layui-icon layui-icon-delete"></i>批量删除</button>
<button class="layui-btn layui-btn-sm" lay-event="selectExportExcel"><i class="layui-icon layui-icon-add-circle"></i>选择导出</button>
<button class="layui-btn layui-btn-sm" lay-event="queryExportExcel"><i class="layui-icon layui-icon-download-circle"></i>查询导出</button>
</div>
</script>
<script type="text/html" id="LAY-app-CoreCmsUserServicesOrder-tableBox-bar">
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#CoreCmsUserServicesOrderTbDelDrop{{d.LAY_INDEX}}" no-shade="true">删除</a>
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="CoreCmsUserServicesOrderTbDelDrop{{d.LAY_INDEX}}"
<a class="layui-btn layui-btn-xs" lay-event="detail">核销码</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#CoreCmsUserServicesOrderTbCancellationDrop{{d.LAY_INDEX}}" no-shade="true">作废</a>
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="CoreCmsUserServicesOrderTbCancellationDrop{{d.LAY_INDEX}}"
style="max-width: 200px;white-space: normal;min-width: auto;margin-left: 10px;">
<div class="dropdown-anchor"></div>
<div class="dropdown-popconfirm-title">
<i class="layui-icon layui-icon-help"></i>
确定要删除吗?
确定要作废订单吗?
</div>
<div class="dropdown-popconfirm-btn">
<a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a>
<a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a>
<a class="layui-btn layui-btn-normal cursor" lay-event="cancellation">确定</a>
</div>
</div>
</script>
@ -128,23 +126,6 @@
, util = layui.util
, view = layui.view;
laydate.render({
elem: '#searchTime-CoreCmsUserServicesOrder-payTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesOrder-createTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesOrder-servicesEndTime',
type: 'datetime',
range: '到',
});
//重载form
form.render();
var searchwhere;
//监听搜索
form.on('submit(LAY-app-CoreCmsUserServicesOrder-search)',
@ -160,6 +141,8 @@
url: layui.setter.apiUrl + 'Api/CoreCmsUserServicesOrder/GetPageList',
method: 'POST',
toolbar: '#LAY-app-CoreCmsUserServicesOrder-toolbar',
pagebar: '#LAY-app-CoreCmsUserServicesOrder-pagebar',
className: 'pagebarbox',
defaultToolbar: ['filter', 'print', 'exports'],
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
page: true,
@ -169,16 +152,30 @@
cols: [
[
{ type: "checkbox", fixed: "left" },
{ field: 'serviceOrderId', title: '服务订单编号', sort: false, width: 105 },
{ field: 'userId', title: '关联用户', sort: false, width: 105 },
{ field: 'servicesId', title: '关联服务', sort: false, width: 105 },
{ field: 'id', title: '序列', width: 50, sort: false },
{ field: 'serviceOrderId', title: '服务订单编号', sort: false, width: 125 },
{
field: 'userId', title: '关联用户', sort: false, width: 155, templet: function (d) {
return d.userId + '【' + d.userName + '】';
}
},
{ field: 'serviceTitle', title: '关联服务', sort: false },
{ field: 'isPay', title: '是否支付', width: 95, templet: '#switch_isPay', sort: false, unresize: true },
{ field: 'payTime', title: '支付时间', width: 130, sort: false },
{ field: 'paymentId', title: '支付单号', sort: false, width: 105 },
{ field: 'status', title: '状态', sort: false, width: 105 },
{ field: 'paymentId', title: '支付单号', sort: false, width: 125 },
{
field: 'status', title: '状态', sort: false, width: 80, templet: function (data) {
for (var i = 0; i < d.data.serviceOrderStatus.length; i++) {
if (data.status == d.data.serviceOrderStatus[i].value) {
return d.data.serviceOrderStatus[i].description;
}
}
return "";
}
},
{ field: 'createTime', title: '订单创建时间', width: 130, sort: false },
{ field: 'servicesEndTime', title: '截止服务时间', width: 130, sort: false },
{ width: 142, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsUserServicesOrder-tableBox-bar' }
{ width: 122, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsUserServicesOrder-tableBox-bar' }
]
]
});
@ -198,15 +195,9 @@
doDetails(obj);
});
//头工具栏事件
table.on('toolbar(LAY-app-CoreCmsUserServicesOrder-tableBox)', function (obj) {
table.on('pagebar(LAY-app-CoreCmsUserServicesOrder-tableBox)', function (obj) {
var checkStatus = table.checkStatus(obj.config.id);
switch (obj.event) {
case 'addData':
doCreate();
break;
case 'batchDelete':
doBatchDelete(checkStatus);
break;
case 'selectExportExcel':
doSelectExportExcel(checkStatus);
break;
@ -220,94 +211,11 @@
function (obj) {
if (obj.event === 'detail') {
doDetails(obj);
} else if (obj.event === 'del') {
doDelete(obj);
} else if (obj.event === 'edit') {
doEdit(obj)
}
});
//执行创建操作
function doCreate() {
coreHelper.Post("Api/CoreCmsUserServicesOrder/GetCreate", null, function (e) {
if (e.code === 0) {
admin.popup({
shadeClose: false,
title: '创建数据',
area: ['600px', '500px'],
id: 'LAY-popup-CoreCmsUserServicesOrder-create',
success: function (layero, index) {
view(this.id).render('order/servicesOrder/create', { data: e.data }).done(function () {
//监听提交
form.on('submit(LAY-app-CoreCmsUserServicesOrder-createForm-submit)',
function (data) {
var field = data.field; //获取提交的字段
field.isPay = field.isPay == 'on';
if (debug) { console.log(field); } //开启调试返回数据
//提交 Ajax 成功后,关闭当前弹层并重载表格
coreHelper.Post("Api/CoreCmsUserServicesOrder/DoCreate", field, function (e) {
console.log(e)
if (e.code === 0) {
layui.table.reloadData('LAY-app-CoreCmsUserServicesOrder-tableBox'); //重载表格
layer.close(index); //再执行关闭
layer.msg(e.msg);
} else {
layer.msg(e.msg);
}
});
});
});
// 禁止弹窗出现滚动条
$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
layer.msg(e.msg);
} else if (obj.event === 'cancellation') {
doCancellation(obj);
}
});
}
//执行编辑操作
function doEdit(obj) {
coreHelper.Post("Api/CoreCmsUserServicesOrder/GetEdit", { id: obj.data.id }, function (e) {
if (e.code === 0) {
admin.popup({
shadeClose: false,
title: '编辑数据',
area: ['600px', '500px'],
id: 'LAY-popup-CoreCmsUserServicesOrder-edit',
success: function (layero, index) {
view(this.id).render('order/servicesOrder/edit', { data: e.data }).done(function () {
//监听提交
form.on('submit(LAY-app-CoreCmsUserServicesOrder-editForm-submit)',
function (data) {
var field = data.field; //获取提交的字段
field.isPay = field.isPay == 'on';
if (debug) { console.log(field); } //开启调试返回数据
//提交 Ajax 成功后,关闭当前弹层并重载表格
coreHelper.Post("Api/CoreCmsUserServicesOrder/DoEdit", field, function (e) {
console.log(e)
if (e.code === 0) {
layui.table.reloadData('LAY-app-CoreCmsUserServicesOrder-tableBox'); //重载表格
layer.close(index); //再执行关闭
layer.msg(e.msg);
} else {
layer.msg(e.msg);
}
});
});
})
// 禁止弹窗出现滚动条
$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
layer.msg(e.msg);
}
});
}
//执行预览操作
function doDetails(obj) {
coreHelper.Post("Api/CoreCmsUserServicesOrder/GetDetails", { id: obj.data.id }, function (e) {
@ -315,14 +223,14 @@
admin.popup({
shadeClose: false,
title: '查看详情',
area: ['600px', '500px'],
area: ['1200px', '90%'],
id: 'LAY-popup-CoreCmsUserServicesOrder-details',
success: function (layero, index) {
view(this.id).render('order/servicesOrder/details', { data: e.data }).done(function () {
form.render();
});
// 禁止弹窗出现滚动条
$(layero).children('.layui-layer-content').css('overflow', 'visible');
//$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
@ -330,34 +238,14 @@
}
});
}
//执行单个删除
function doDelete(obj) {
coreHelper.Post("Api/CoreCmsUserServicesOrder/DoDelete", { id: obj.data.id }, function (e) {
//执行作废订
function doCancellation(obj) {
coreHelper.Post("Api/CoreCmsUserServicesOrder/DoCancellation", { id: obj.data.id }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
table.reloadData('LAY-app-CoreCmsUserServicesOrder-tableBox');
layer.msg(e.msg);
});
}
//执行批量删除
function doBatchDelete(checkStatus) {
var checkData = checkStatus.data;
if (checkData.length === 0) {
return layer.msg('请选择要删除的数据');
}
layer.confirm('确定删除吗?删除后将无法恢复。',
function (index) {
var delidsStr = [];
layui.each(checkData,
function (index, item) {
delidsStr.push(item.id);
});
coreHelper.Post("Api/CoreCmsUserServicesOrder/DoBatchDelete", { id: delidsStr }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
table.reloadData('LAY-app-CoreCmsUserServicesOrder-tableBox');
layer.msg(e.msg);
});
});
}
//执行查询条件导出excel
function doQueryExportexcel() {
layer.confirm('确定根据当前的查询条件导出数据吗?',
@ -397,6 +285,24 @@
});
});
}
laydate.render({
elem: '#searchTime-CoreCmsUserServicesOrder-payTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesOrder-createTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesOrder-servicesEndTime',
type: 'datetime',
range: '到',
});
//监听 表格复选框操作
layui.form.on('switch(switch_isPay)', function (obj) {
@ -407,11 +313,15 @@
});
});
//重载form
form.render();
});
};
</script>
<!--设置是否支付-->
<script type="text/html" id="switch_isPay">
<input type="checkbox" name="switch_isPay" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="switch_isPay" {{ d.isPay ? 'checked' : '' }}>
</script>
<input type="checkbox" name="switch_isPay" value="{{d.id}}" lay-skin="switch" lay-text="已支付|未支付" lay-filter="switch_isPay" {{ d.isPay ? 'checked' : '' }}>
</script>

@ -1,140 +0,0 @@
<script type="text/html" template lay-done="layui.data.done(d);">
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsUserServicesTicket-createForm" id="LAY-app-CoreCmsUserServicesTicket-createForm">
<div class="layui-form-item">
<label for="id" class="layui-form-label layui-form-required">序列</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入序列" lay-reqText="请输入序列并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="serviceOrderId" class="layui-form-label layui-form-required">关联购买订单</label>
<div class="layui-input-block">
<input name="serviceOrderId" lay-verType="tips" lay-verify="required|verifyserviceOrderId" class="layui-input" lay-reqText="请输入关联购买订单" placeholder="请输入关联购买订单" />
</div>
</div>
<div class="layui-form-item">
<label for="securityCode" class="layui-form-label layui-form-required">安全码</label>
<div class="layui-input-block">
<input name="securityCode" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入安全码" lay-reqText="请输入安全码" />
</div>
</div>
<div class="layui-form-item">
<label for="redeemCode" class="layui-form-label layui-form-required">兑换码</label>
<div class="layui-input-block">
<input name="redeemCode" lay-verType="tips" lay-verify="required|verifyredeemCode" class="layui-input" lay-reqText="请输入兑换码" placeholder="请输入兑换码" />
</div>
</div>
<div class="layui-form-item">
<label for="serviceId" class="layui-form-label layui-form-required">关联服务项目id</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="serviceId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入关联服务项目id" lay-reqText="请输入关联服务项目id并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="userId" class="layui-form-label layui-form-required">关联用户id</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="userId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入关联用户id" lay-reqText="请输入关联用户id并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="status" class="layui-form-label layui-form-required">状态</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入状态" lay-reqText="请输入状态并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="validityType" class="layui-form-label layui-form-required">核销有效期类型</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="validityType" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入核销有效期类型" lay-reqText="请输入核销有效期类型并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="validityStartTime" class="layui-form-label layui-form-required">核销开始时间</label>
<div class="layui-input-block">
<input name="validityStartTime" id="createTime-CoreCmsUserServicesTicket-validityStartTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入核销开始时间" lay-reqText="请输入核销开始时间" />
</div>
</div>
<div class="layui-form-item">
<label for="validityEndTime" class="layui-form-label layui-form-required">核销结束时间</label>
<div class="layui-input-block">
<input name="validityEndTime" id="createTime-CoreCmsUserServicesTicket-validityEndTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入核销结束时间" lay-reqText="请输入核销结束时间" />
</div>
</div>
<div class="layui-form-item">
<label for="createTime" class="layui-form-label layui-form-required">创建时间</label>
<div class="layui-input-block">
<input name="createTime" id="createTime-CoreCmsUserServicesTicket-createTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入创建时间" lay-reqText="请输入创建时间" />
</div>
</div>
<div class="layui-form-item" pane>
<label for="isVerification" class="layui-form-label layui-form-required">是否核销</label>
<div class="layui-input-block">
<input type="checkbox" lay-filter="switch" name="isVerification" lay-skin="switch" lay-text="开启|关闭">
</div>
</div>
<div class="layui-form-item">
<label for="verificationTime" class="layui-form-label layui-form-required">核销时间</label>
<div class="layui-input-block">
<input name="verificationTime" id="createTime-CoreCmsUserServicesTicket-verificationTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入核销时间" lay-reqText="请输入核销时间" />
</div>
</div>
<div class="layui-form-item text-right">
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsUserServicesTicket-createForm-submit" id="LAY-app-CoreCmsUserServicesTicket-createForm-submit" value="确认添加">
</div>
</div>
</script>
<script>
var debug= layui.setter.debug;
layui.data.done = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d.params.data); }
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
function () {
var $ = layui.$
, form = layui.form
, admin = layui.admin
, laydate = layui.laydate
, upload = layui.upload
, cropperImg = layui.cropperImg
, coreHelper = layui.coreHelper;
laydate.render({
elem: '#createTime-CoreCmsUserServicesTicket-validityStartTime',
type: 'datetime'
});
laydate.render({
elem: '#createTime-CoreCmsUserServicesTicket-validityEndTime',
type: 'datetime'
});
laydate.render({
elem: '#createTime-CoreCmsUserServicesTicket-createTime',
type: 'datetime'
});
laydate.render({
elem: '#createTime-CoreCmsUserServicesTicket-verificationTime',
type: 'datetime'
});
form.verify({
verifyserviceOrderId: [/^[\S]{0,50}$/,'关联购买订单最大只允许输入50位字符且不能出现空格'],
verifyredeemCode: [/^[\S]{0,50}$/,'兑换码最大只允许输入50位字符且不能出现空格'],
});
//重载form
form.render(null, 'LAY-app-CoreCmsUserServicesTicket-createForm');
})
};
</script>

@ -1,143 +0,0 @@
<script type="text/html" template lay-done="layui.data.done(d);">
<table class="layui-table layui-form" lay-filter="LAY-app-CoreCmsUserServicesTicket-detailsForm" id="LAY-app-CoreCmsUserServicesTicket-detailsForm">
<colgroup>
<col width="150">
<col>
</colgroup>
<tbody>
<tr>
<td>
<label for="id">序列</label>
</td>
<td>
{{ d.params.data.id || '' }}
</td>
</tr>
<tr>
<td>
<label for="serviceOrderId">关联购买订单</label>
</td>
<td>
{{ d.params.data.serviceOrderId || '' }}
</td>
</tr>
<tr>
<td>
<label for="securityCode">安全码</label>
</td>
<td>
{{ d.params.data.securityCode || '' }}
</td>
</tr>
<tr>
<td>
<label for="redeemCode">兑换码</label>
</td>
<td>
{{ d.params.data.redeemCode || '' }}
</td>
</tr>
<tr>
<td>
<label for="serviceId">关联服务项目id</label>
</td>
<td>
{{ d.params.data.serviceId || '' }}
</td>
</tr>
<tr>
<td>
<label for="userId">关联用户id</label>
</td>
<td>
{{ d.params.data.userId || '' }}
</td>
</tr>
<tr>
<td>
<label for="status">状态</label>
</td>
<td>
{{ d.params.data.status || '' }}
</td>
</tr>
<tr>
<td>
<label for="validityType">核销有效期类型</label>
</td>
<td>
{{ d.params.data.validityType || '' }}
</td>
</tr>
<tr>
<td>
<label for="validityStartTime">核销开始时间</label>
</td>
<td>
{{ d.params.data.validityStartTime || '' }}
</td>
</tr>
<tr>
<td>
<label for="validityEndTime">核销结束时间</label>
</td>
<td>
{{ d.params.data.validityEndTime || '' }}
</td>
</tr>
<tr>
<td>
<label for="createTime">创建时间</label>
</td>
<td>
{{ d.params.data.createTime || '' }}
</td>
</tr>
<tr>
<td>
<label for="isVerification">是否核销</label>
</td>
<td>
<input type="checkbox" disabled name="isVerification" value="{{d.params.data.isVerification}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="isVerification" {{ d.params.data.isVerification ? 'checked' : '' }}>
</td>
</tr>
<tr>
<td>
<label for="verificationTime">核销时间</label>
</td>
<td>
{{ d.params.data.verificationTime || '' }}
</td>
</tr>
</tbody>
</table>
</script>
<script>
var debug = layui.setter.debug;
layui.data.done = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d.params.data); }
layui.use(['admin', 'form', 'coreHelper'], function () {
var $ = layui.$
, setter = layui.setter
, admin = layui.admin
, coreHelper = layui.coreHelper
, form = layui.form;
form.render(null, 'LAY-app-CoreCmsUserServicesTicket-detailsForm');
});
};
</script>

@ -1,140 +0,0 @@
<script type="text/html" template lay-done="layui.data.sendParams(d);">
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsUserServicesTicket-editForm" id="LAY-app-CoreCmsUserServicesTicket-editForm">
<input type="hidden" name="id" value="{{d.params.data.id || '' }}" />
<div class="layui-form-item">
<label for="id" class="layui-form-label layui-form-required">序列</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.id || '' }}" placeholder="请输入序列" lay-reqText="请输入序列并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="serviceOrderId" class="layui-form-label layui-form-required">关联购买订单</label>
<div class="layui-input-block">
<input name="serviceOrderId" lay-verType="tips" lay-verify="required|verifyserviceOrderId" class="layui-input" placeholder="请输入关联购买订单" lay-reqText="请输入关联购买订单" value="{{d.params.data.serviceOrderId || '' }}" />
</div>
</div>
<div class="layui-form-item">
<label for="securityCode" class="layui-form-label layui-form-required">安全码</label>
<div class="layui-input-block">
<input name="securityCode" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入安全码" lay-reqText="请输入安全码" value="{{d.params.data.securityCode || '' }}" />
</div>
</div>
<div class="layui-form-item">
<label for="redeemCode" class="layui-form-label layui-form-required">兑换码</label>
<div class="layui-input-block">
<input name="redeemCode" lay-verType="tips" lay-verify="required|verifyredeemCode" class="layui-input" placeholder="请输入兑换码" lay-reqText="请输入兑换码" value="{{d.params.data.redeemCode || '' }}" />
</div>
</div>
<div class="layui-form-item">
<label for="serviceId" class="layui-form-label layui-form-required">关联服务项目id</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="serviceId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.serviceId || '' }}" placeholder="请输入关联服务项目id" lay-reqText="请输入关联服务项目id并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="userId" class="layui-form-label layui-form-required">关联用户id</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="userId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.userId || '' }}" placeholder="请输入关联用户id" lay-reqText="请输入关联用户id并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="status" class="layui-form-label layui-form-required">状态</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.status || '' }}" placeholder="请输入状态" lay-reqText="请输入状态并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="validityType" class="layui-form-label layui-form-required">核销有效期类型</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="validityType" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.validityType || '' }}" placeholder="请输入核销有效期类型" lay-reqText="请输入核销有效期类型并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="validityStartTime" class="layui-form-label layui-form-required">核销开始时间</label>
<div class="layui-input-block">
<input name="validityStartTime" id="editTime-CoreCmsUserServicesTicket-validityStartTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入核销开始时间" lay-reqText="请输入核销开始时间" value="{{d.params.data.validityStartTime || '' }}" />
</div>
</div>
<div class="layui-form-item">
<label for="validityEndTime" class="layui-form-label layui-form-required">核销结束时间</label>
<div class="layui-input-block">
<input name="validityEndTime" id="editTime-CoreCmsUserServicesTicket-validityEndTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入核销结束时间" lay-reqText="请输入核销结束时间" value="{{d.params.data.validityEndTime || '' }}" />
</div>
</div>
<div class="layui-form-item">
<label for="createTime" class="layui-form-label layui-form-required">创建时间</label>
<div class="layui-input-block">
<input name="createTime" id="editTime-CoreCmsUserServicesTicket-createTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入创建时间" lay-reqText="请输入创建时间" value="{{d.params.data.createTime || '' }}" />
</div>
</div>
<div class="layui-form-item" pane>
<label for="isVerification" class="layui-form-label layui-form-required">是否核销</label>
<div class="layui-input-block">
<input type="checkbox" lay-filter="switch" name="isVerification" {{ d.params.data.isVerification ? 'checked' : '' }} lay-skin="switch" lay-text="开启|关闭">
</div>
</div>
<div class="layui-form-item">
<label for="verificationTime" class="layui-form-label layui-form-required">核销时间</label>
<div class="layui-input-block">
<input name="verificationTime" id="editTime-CoreCmsUserServicesTicket-verificationTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入核销时间" lay-reqText="请输入核销时间" value="{{d.params.data.verificationTime || '' }}" />
</div>
</div>
<div class="layui-form-item text-right">
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsUserServicesTicket-editForm-submit" id="LAY-app-CoreCmsUserServicesTicket-editForm-submit" value="确认编辑">
</div>
</div>
</script>
<script>
var debug= layui.setter.debug;
layui.data.sendParams = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d.params.data); }
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
function () {
var $ = layui.$
, form = layui.form
, admin = layui.admin
, laydate = layui.laydate
, upload = layui.upload
, cropperImg = layui.cropperImg
, coreHelper = layui.coreHelper;
laydate.render({
elem: '#editTime-CoreCmsUserServicesTicket-validityStartTime',
type: 'datetime'
});
laydate.render({
elem: '#editTime-CoreCmsUserServicesTicket-validityEndTime',
type: 'datetime'
});
laydate.render({
elem: '#editTime-CoreCmsUserServicesTicket-createTime',
type: 'datetime'
});
laydate.render({
elem: '#editTime-CoreCmsUserServicesTicket-verificationTime',
type: 'datetime'
});
form.verify({
verifyserviceOrderId: [/^[\S]{0,50}$/,'关联购买订单最大只允许输入50位字符且不能出现空格'],
verifyredeemCode: [/^[\S]{0,50}$/,'兑换码最大只允许输入50位字符且不能出现空格'],
});
//重载form
form.render(null, 'LAY-app-CoreCmsUserServicesTicket-editForm');
})
};
</script>

@ -1,447 +0,0 @@
<title>服务消费券</title>
<!--当前位置开始-->
<div class="layui-card layadmin-header">
<div class="layui-breadcrumb" lay-filter="breadcrumb">
<script type="text/html" template lay-done="layui.data.updateMainBreadcrumb();">
</script>
</div>
</div>
<!--当前位置结束-->
<style>
/* 重写样式 */
</style>
<script type="text/html" template lay-type="Post" lay-url="{{ layui.setter.apiUrl }}Api/CoreCmsUserServicesTicket/GetIndex" lay-done="layui.data.done(d);">
<div class="layui-form coreshop-toolbar-search-form">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" for="id">序列</label>
<div class="layui-input-inline">
<input type="text" name="id" placeholder="请输入序列" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="serviceOrderId">关联购买订单</label>
<div class="layui-input-inline">
<input type="text" name="serviceOrderId" placeholder="请输入关联购买订单" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="securityCode">安全码</label>
<div class="layui-input-inline">
<input type="text" name="securityCode" placeholder="请输入安全码" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="redeemCode">兑换码</label>
<div class="layui-input-inline">
<input type="text" name="redeemCode" placeholder="请输入兑换码" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="serviceId">关联服务项目id</label>
<div class="layui-input-inline">
<input type="text" name="serviceId" placeholder="请输入关联服务项目id" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="userId">关联用户id</label>
<div class="layui-input-inline">
<input type="text" name="userId" placeholder="请输入关联用户id" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="status">状态</label>
<div class="layui-input-inline">
<input type="text" name="status" placeholder="请输入状态" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="validityType">核销有效期类型</label>
<div class="layui-input-inline">
<input type="text" name="validityType" placeholder="请输入核销有效期类型" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="validityStartTime">核销开始时间</label>
<div class="layui-input-inline core-time-input">
<input type="text" name="validityStartTime" id="searchTime-CoreCmsUserServicesTicket-validityStartTime" placeholder="请输入核销开始时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="validityEndTime">核销结束时间</label>
<div class="layui-input-inline core-time-input">
<input type="text" name="validityEndTime" id="searchTime-CoreCmsUserServicesTicket-validityEndTime" placeholder="请输入核销结束时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="createTime">创建时间</label>
<div class="layui-input-inline core-time-input">
<input type="text" name="createTime" id="searchTime-CoreCmsUserServicesTicket-createTime" placeholder="请输入创建时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="isVerification">是否核销</label>
<div class="layui-input-inline">
<select name="isVerification">
<option value="">请选择</option>
<option value="True"></option>
<option value="False"></option>
</select>
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="verificationTime">核销时间</label>
<div class="layui-input-inline core-time-input">
<input type="text" name="verificationTime" id="searchTime-CoreCmsUserServicesTicket-verificationTime" placeholder="请输入核销时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-CoreCmsUserServicesTicket-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
</div>
</div>
</div>
</script>
<div class="table-body">
<table id="LAY-app-CoreCmsUserServicesTicket-tableBox" lay-filter="LAY-app-CoreCmsUserServicesTicket-tableBox"></table>
</div>
<script type="text/html" id="LAY-app-CoreCmsUserServicesTicket-toolbar">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i>添加数据</button>
<button class="layui-btn layui-btn-sm" lay-event="batchDelete"><i class="layui-icon layui-icon-delete"></i>批量删除</button>
<button class="layui-btn layui-btn-sm" lay-event="selectExportExcel"><i class="layui-icon layui-icon-add-circle"></i>选择导出</button>
<button class="layui-btn layui-btn-sm" lay-event="queryExportExcel"><i class="layui-icon layui-icon-download-circle"></i>查询导出</button>
</div>
</script>
<script type="text/html" id="LAY-app-CoreCmsUserServicesTicket-tableBox-bar">
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#CoreCmsUserServicesTicketTbDelDrop{{d.LAY_INDEX}}" no-shade="true">删除</a>
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="CoreCmsUserServicesTicketTbDelDrop{{d.LAY_INDEX}}"
style="max-width: 200px;white-space: normal;min-width: auto;margin-left: 10px;">
<div class="dropdown-anchor"></div>
<div class="dropdown-popconfirm-title">
<i class="layui-icon layui-icon-help"></i>
确定要删除吗?
</div>
<div class="dropdown-popconfirm-btn">
<a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a>
<a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a>
</div>
</div>
</script>
<script>
var indexData;
var debug= layui.setter.debug;
layui.data.done = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d); }
indexData = d.data;
layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'],
function () {
var $ = layui.$
, admin = layui.admin
, table = layui.table
, form = layui.form
, laydate = layui.laydate
, setter = layui.setter
, coreHelper = layui.coreHelper
, util = layui.util
, view = layui.view;
laydate.render({
elem: '#searchTime-CoreCmsUserServicesTicket-validityStartTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesTicket-validityEndTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesTicket-createTime',
type: 'datetime',
range: '到',
});
laydate.render({
elem: '#searchTime-CoreCmsUserServicesTicket-verificationTime',
type: 'datetime',
range: '到',
});
//重载form
form.render();
var searchwhere;
//监听搜索
form.on('submit(LAY-app-CoreCmsUserServicesTicket-search)',
function(data) {
var field = data.field;
searchwhere = field;
//执行重载
table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox',{ where: field });
});
//数据绑定
table.render({
elem: '#LAY-app-CoreCmsUserServicesTicket-tableBox',
url: layui.setter.apiUrl + 'Api/CoreCmsUserServicesTicket/GetPageList',
method: 'POST',
toolbar: '#LAY-app-CoreCmsUserServicesTicket-toolbar',
defaultToolbar: ['filter', 'print', 'exports'],
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
page: true,
limit: 30,
limits: [10, 15, 20, 25, 30, 50, 100, 200],
text: {none: '暂无相关数据'},
cols: [
[
{ type: "checkbox", fixed: "left" },
{ field: 'id', title: '序列', width: 60, sort: false},
{ field: 'serviceOrderId', title: '关联购买订单', sort: false,width: 105 },
{ field: 'securityCode', title: '安全码', sort: false,width: 105 },
{ field: 'redeemCode', title: '兑换码', sort: false,width: 105 },
{ field: 'serviceId', title: '关联服务项目id', sort: false,width: 105 },
{ field: 'userId', title: '关联用户id', sort: false,width: 105 },
{ field: 'status', title: '状态', sort: false,width: 105 },
{ field: 'validityType', title: '核销有效期类型', sort: false,width: 105 },
{ field: 'validityStartTime', title: '核销开始时间', width: 130, sort: false},
{ field: 'validityEndTime', title: '核销结束时间', width: 130, sort: false},
{ field: 'createTime', title: '创建时间', width: 130, sort: false},
{ field: 'isVerification', title: '是否核销', width: 95, templet: '#switch_isVerification', sort: false , unresize: true},
{ field: 'verificationTime', title: '核销时间', width: 130, sort: false},
{ width: 162, align: 'center', title:'操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsUserServicesTicket-tableBox-bar' }
]
]
});
//监听排序事件
table.on('sort(LAY-app-CoreCmsUserServicesTicket-tableBox)', function(obj){
table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox', {
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
orderField: obj.field, //排序字段
orderDirection: obj.type //排序方式
}
});
});
//监听行双击事件
table.on('rowDouble(LAY-app-CoreCmsUserServicesTicket-tableBox)', function (obj) {
//查看详情
doDetails(obj);
});
//头工具栏事件
table.on('toolbar(LAY-app-CoreCmsUserServicesTicket-tableBox)', function (obj) {
var checkStatus = table.checkStatus(obj.config.id);
switch (obj.event) {
case 'addData':
doCreate();
break;
case 'batchDelete':
doBatchDelete(checkStatus);
break;
case 'selectExportExcel':
doSelectExportExcel(checkStatus);
break;
case 'queryExportExcel':
doQueryExportexcel();
break;
};
});
//监听工具条
table.on('tool(LAY-app-CoreCmsUserServicesTicket-tableBox)',
function(obj) {
if (obj.event === 'detail') {
doDetails(obj);
} else if (obj.event === 'del') {
doDelete(obj);
} else if (obj.event === 'edit') {
doEdit(obj)
}
});
//执行创建操作
function doCreate(){
coreHelper.Post("Api/CoreCmsUserServicesTicket/GetCreate", null, function (e) {
if (e.code === 0) {
admin.popup({ shadeClose: false,
title: '创建数据',
area: ['600px', '500px'],
id: 'LAY-popup-CoreCmsUserServicesTicket-create',
success: function (layero, index) {
view(this.id).render('serviceGoods/servicesTicketcreate', { data: e.data }).done(function () {
//监听提交
form.on('submit(LAY-app-CoreCmsUserServicesTicket-createForm-submit)',
function(data) {
var field = data.field; //获取提交的字段
field.isVerification = field.isVerification == 'on';
if (debug) { console.log(field); } //开启调试返回数据
//提交 Ajax 成功后,关闭当前弹层并重载表格
coreHelper.Post("Api/CoreCmsUserServicesTicket/DoCreate", field, function (e) {
console.log(e)
if (e.code === 0) {
layui.table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox'); //重载表格
layer.close(index); //再执行关闭
layer.msg(e.msg);
} else {
layer.msg(e.msg);
}
});
});
});
// 禁止弹窗出现滚动条
$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
layer.msg(e.msg);
}
});
}
//执行编辑操作
function doEdit(obj){
coreHelper.Post("Api/CoreCmsUserServicesTicket/GetEdit", {id:obj.data.id}, function (e) {
if (e.code === 0) {
admin.popup({ shadeClose: false,
title: '编辑数据',
area: ['600px', '500px'],
id: 'LAY-popup-CoreCmsUserServicesTicket-edit',
success: function (layero, index) {
view(this.id).render('serviceGoods/servicesTicketedit', { data: e.data }).done(function () {
//监听提交
form.on('submit(LAY-app-CoreCmsUserServicesTicket-editForm-submit)',
function(data) {
var field = data.field; //获取提交的字段
field.isVerification = field.isVerification == 'on';
if (debug) { console.log(field); } //开启调试返回数据
//提交 Ajax 成功后,关闭当前弹层并重载表格
coreHelper.Post("Api/CoreCmsUserServicesTicket/DoEdit", field, function (e) {
console.log(e)
if (e.code === 0) {
layui.table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox'); //重载表格
layer.close(index); //再执行关闭
layer.msg(e.msg);
} else {
layer.msg(e.msg);
}
});
});
})
// 禁止弹窗出现滚动条
$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
layer.msg(e.msg);
}
});
}
//执行预览操作
function doDetails(obj) {
coreHelper.Post("Api/CoreCmsUserServicesTicket/GetDetails", { id: obj.data.id }, function (e) {
if (e.code === 0) {
admin.popup({ shadeClose: false,
title: '查看详情',
area: ['600px', '500px'],
id: 'LAY-popup-CoreCmsUserServicesTicket-details',
success: function (layero, index) {
view(this.id).render('serviceGoods/servicesTicketdetails', { data: e.data }).done(function () {
form.render();
});
// 禁止弹窗出现滚动条
$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
layer.msg(e.msg);
}
});
}
//执行单个删除
function doDelete(obj){
coreHelper.Post("Api/CoreCmsUserServicesTicket/DoDelete", { id: obj.data.id }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox');
layer.msg(e.msg);
});
}
//执行批量删除
function doBatchDelete(checkStatus){
var checkData = checkStatus.data;
if (checkData.length === 0) {
return layer.msg('请选择要删除的数据');
}
layer.confirm('确定删除吗?删除后将无法恢复。',
function(index) {
var delidsStr = [];
layui.each(checkData,
function(index, item) {
delidsStr.push(item.id);
});
coreHelper.Post("Api/CoreCmsUserServicesTicket/DoBatchDelete", { id: delidsStr }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox');
layer.msg(e.msg);
});
});
}
//执行查询条件导出excel
function doQueryExportexcel(){
layer.confirm('确定根据当前的查询条件导出数据吗?',
function(index) {
var field = searchwhere;
coreHelper.PostForm("Api/CoreCmsUserServicesTicket/QueryExportExcel", field, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
if (e.code === 0) {
window.open(e.data);
} else {
layer.msg(e.msg);
}
});
});
}
//执行选择目录导出数据
function doSelectExportExcel(checkStatus){
var checkData = checkStatus.data;
if (checkData.length === 0) {
return layer.msg('请选择您要导出的数据');
}
layer.confirm('确定导出选择的内容吗?',
function(index) {
var delidsStr = [];
layui.each(checkData,
function(index, item) {
delidsStr.push(item.id);
});
layer.close(index);
coreHelper.Post("Api/CoreCmsUserServicesTicket/SelectExportExcel", { id: delidsStr }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
if (e.code === 0) {
window.open(e.data);
} else {
layer.msg(e.msg);
}
});
});
}
//监听 表格复选框操作
layui.form.on('switch(switch_isVerification)', function (obj) {
coreHelper.Post("Api/CoreCmsUserServicesTicket/DoSetisVerification", { id: this.value, data: obj.elem.checked }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
//table.reloadData('LAY-app-CoreCmsUserServicesTicket-tableBox');
layer.msg(e.msg);
});
});
});
};
</script>
<!--设置是否核销-->
<script type="text/html" id="switch_isVerification">
<input type="checkbox" name="switch_isVerification" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="switch_isVerification" {{ d.isVerification ? 'checked' : '' }}>
</script>

@ -1,78 +0,0 @@
<script type="text/html" template lay-done="layui.data.done(d);">
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsUserServicesTicketVerificationLog-createForm" id="LAY-app-CoreCmsUserServicesTicketVerificationLog-createForm">
<div class="layui-form-item">
<label for="id" class="layui-form-label layui-form-required">序列</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入序列" lay-reqText="请输入序列并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="storeId" class="layui-form-label layui-form-required">核销门店id</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="storeId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入核销门店id" lay-reqText="请输入核销门店id并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="verificationUserId" class="layui-form-label layui-form-required">核验人</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="verificationUserId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入核验人" lay-reqText="请输入核验人并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="ticketId" class="layui-form-label layui-form-required">服务券序列</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="ticketId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入服务券序列" lay-reqText="请输入服务券序列并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="ticketRedeemCode" class="layui-form-label layui-form-required">核验码</label>
<div class="layui-input-block">
<input name="ticketRedeemCode" lay-verType="tips" lay-verify="required|verifyticketRedeemCode" class="layui-input" lay-reqText="请输入核验码" placeholder="请输入核验码" />
</div>
</div>
<div class="layui-form-item">
<label for="verificationTime" class="layui-form-label layui-form-required">核验时间</label>
<div class="layui-input-block">
<input name="verificationTime" id="createTime-CoreCmsUserServicesTicketVerificationLog-verificationTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入核验时间" lay-reqText="请输入核验时间" />
</div>
</div>
<div class="layui-form-item text-right">
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsUserServicesTicketVerificationLog-createForm-submit" id="LAY-app-CoreCmsUserServicesTicketVerificationLog-createForm-submit" value="确认添加">
</div>
</div>
</script>
<script>
var debug= layui.setter.debug;
layui.data.done = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d.params.data); }
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
function () {
var $ = layui.$
, form = layui.form
, admin = layui.admin
, laydate = layui.laydate
, upload = layui.upload
, cropperImg = layui.cropperImg
, coreHelper = layui.coreHelper;
laydate.render({
elem: '#createTime-CoreCmsUserServicesTicketVerificationLog-verificationTime',
type: 'datetime'
});
form.verify({
verifyticketRedeemCode: [/^[\S]{0,50}$/,'核验码最大只允许输入50位字符且不能出现空格'],
});
//重载form
form.render(null, 'LAY-app-CoreCmsUserServicesTicketVerificationLog-createForm');
})
};
</script>

@ -1,80 +0,0 @@
<script type="text/html" template lay-done="layui.data.done(d);">
<table class="layui-table layui-form" lay-filter="LAY-app-CoreCmsUserServicesTicketVerificationLog-detailsForm" id="LAY-app-CoreCmsUserServicesTicketVerificationLog-detailsForm">
<colgroup>
<col width="150">
<col>
</colgroup>
<tbody>
<tr>
<td>
<label for="id">序列</label>
</td>
<td>
{{ d.params.data.id || '' }}
</td>
</tr>
<tr>
<td>
<label for="storeId">核销门店id</label>
</td>
<td>
{{ d.params.data.storeId || '' }}
</td>
</tr>
<tr>
<td>
<label for="verificationUserId">核验人</label>
</td>
<td>
{{ d.params.data.verificationUserId || '' }}
</td>
</tr>
<tr>
<td>
<label for="ticketId">服务券序列</label>
</td>
<td>
{{ d.params.data.ticketId || '' }}
</td>
</tr>
<tr>
<td>
<label for="ticketRedeemCode">核验码</label>
</td>
<td>
{{ d.params.data.ticketRedeemCode || '' }}
</td>
</tr>
<tr>
<td>
<label for="verificationTime">核验时间</label>
</td>
<td>
{{ d.params.data.verificationTime || '' }}
</td>
</tr>
</tbody>
</table>
</script>
<script>
var debug= layui.setter.debug;
layui.data.done = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d.params.data); }
layui.use(['admin', 'form', 'coreHelper'], function () {
var $ = layui.$
, setter = layui.setter
, admin = layui.admin
, coreHelper = layui.coreHelper
, form = layui.form;
form.render(null, 'LAY-app-CoreCmsUserServicesTicketVerificationLog-detailsForm');
});
};
</script>

@ -1,78 +0,0 @@
<script type="text/html" template lay-done="layui.data.sendParams(d);">
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsUserServicesTicketVerificationLog-editForm" id="LAY-app-CoreCmsUserServicesTicketVerificationLog-editForm">
<input type="hidden" name="id" value="{{d.params.data.id || '' }}" />
<div class="layui-form-item">
<label for="id" class="layui-form-label layui-form-required">序列</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.id || '' }}" placeholder="请输入序列" lay-reqText="请输入序列并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="storeId" class="layui-form-label layui-form-required">核销门店id</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="storeId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.storeId || '' }}" placeholder="请输入核销门店id" lay-reqText="请输入核销门店id并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="verificationUserId" class="layui-form-label layui-form-required">核验人</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="verificationUserId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.verificationUserId || '' }}" placeholder="请输入核验人" lay-reqText="请输入核验人并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="ticketId" class="layui-form-label layui-form-required">服务券序列</label>
<div class="layui-input-block">
<input type="number" min="0" max="999999" name="ticketId" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.ticketId || '' }}" placeholder="请输入服务券序列" lay-reqText="请输入服务券序列并为数字" />
</div>
</div>
<div class="layui-form-item">
<label for="ticketRedeemCode" class="layui-form-label layui-form-required">核验码</label>
<div class="layui-input-block">
<input name="ticketRedeemCode" lay-verType="tips" lay-verify="required|verifyticketRedeemCode" class="layui-input" placeholder="请输入核验码" lay-reqText="请输入核验码" value="{{d.params.data.ticketRedeemCode || '' }}" />
</div>
</div>
<div class="layui-form-item">
<label for="verificationTime" class="layui-form-label layui-form-required">核验时间</label>
<div class="layui-input-block">
<input name="verificationTime" id="editTime-CoreCmsUserServicesTicketVerificationLog-verificationTime" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入核验时间" lay-reqText="请输入核验时间" value="{{d.params.data.verificationTime || '' }}" />
</div>
</div>
<div class="layui-form-item text-right">
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsUserServicesTicketVerificationLog-editForm-submit" id="LAY-app-CoreCmsUserServicesTicketVerificationLog-editForm-submit" value="确认编辑">
</div>
</div>
</script>
<script>
var debug= layui.setter.debug;
layui.data.sendParams = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d.params.data); }
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
function () {
var $ = layui.$
, form = layui.form
, admin = layui.admin
, laydate = layui.laydate
, upload = layui.upload
, cropperImg = layui.cropperImg
, coreHelper = layui.coreHelper;
laydate.render({
elem: '#editTime-CoreCmsUserServicesTicketVerificationLog-verificationTime',
type: 'datetime'
});
form.verify({
verifyticketRedeemCode: [/^[\S]{0,50}$/,'核验码最大只允许输入50位字符且不能出现空格'],
});
//重载form
form.render(null, 'LAY-app-CoreCmsUserServicesTicketVerificationLog-editForm');
})
};
</script>

@ -1,362 +0,0 @@
<title>服务券核验日志</title>
<!--当前位置开始-->
<div class="layui-card layadmin-header">
<div class="layui-breadcrumb" lay-filter="breadcrumb">
<script type="text/html" template lay-done="layui.data.updateMainBreadcrumb();">
</script>
</div>
</div>
<!--当前位置结束-->
<style>
/* 重写样式 */
</style>
<script type="text/html" template lay-type="Post" lay-url="{{ layui.setter.apiUrl }}Api/CoreCmsUserServicesTicketVerificationLog/GetIndex" lay-done="layui.data.done(d);">
<div class="layui-form coreshop-toolbar-search-form">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label" for="id">序列</label>
<div class="layui-input-inline">
<input type="text" name="id" placeholder="请输入序列" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="storeId">核销门店id</label>
<div class="layui-input-inline">
<input type="text" name="storeId" placeholder="请输入核销门店id" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="verificationUserId">核验人</label>
<div class="layui-input-inline">
<input type="text" name="verificationUserId" placeholder="请输入核验人" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="ticketId">服务券序列</label>
<div class="layui-input-inline">
<input type="text" name="ticketId" placeholder="请输入服务券序列" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="ticketRedeemCode">核验码</label>
<div class="layui-input-inline">
<input type="text" name="ticketRedeemCode" placeholder="请输入核验码" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label" for="verificationTime">核验时间</label>
<div class="layui-input-inline core-time-input">
<input type="text" name="verificationTime" id="searchTime-CoreCmsUserServicesTicketVerificationLog-verificationTime" placeholder="请输入核验时间" class="layui-input">
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-CoreCmsUserServicesTicketVerificationLog-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
</div>
</div>
</div>
</script>
<div class="table-body">
<table id="LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox" lay-filter="LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox"></table>
</div>
<script type="text/html" id="LAY-app-CoreCmsUserServicesTicketVerificationLog-toolbar">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i>添加数据</button>
<button class="layui-btn layui-btn-sm" lay-event="batchDelete"><i class="layui-icon layui-icon-delete"></i>批量删除</button>
<button class="layui-btn layui-btn-sm" lay-event="selectExportExcel"><i class="layui-icon layui-icon-add-circle"></i>选择导出</button>
<button class="layui-btn layui-btn-sm" lay-event="queryExportExcel"><i class="layui-icon layui-icon-download-circle"></i>查询导出</button>
</div>
</script>
<script type="text/html" id="LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox-bar">
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#CoreCmsUserServicesTicketVerificationLogTbDelDrop{{d.LAY_INDEX}}" no-shade="true">删除</a>
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="CoreCmsUserServicesTicketVerificationLogTbDelDrop{{d.LAY_INDEX}}"
style="max-width: 200px;white-space: normal;min-width: auto;margin-left: 10px;">
<div class="dropdown-anchor"></div>
<div class="dropdown-popconfirm-title">
<i class="layui-icon layui-icon-help"></i>
确定要删除吗?
</div>
<div class="dropdown-popconfirm-btn">
<a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a>
<a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a>
</div>
</div>
</script>
<script>
var indexData;
var debug= layui.setter.debug;
layui.data.done = function (d) {
//开启调试情况下获取接口赋值数据
if (debug) { console.log(d); }
indexData = d.data;
layui.use(['index', 'table', 'laydate', 'util', 'coredropdown', 'coreHelper'],
function () {
var $ = layui.$
, admin = layui.admin
, table = layui.table
, form = layui.form
, laydate = layui.laydate
, setter = layui.setter
, coreHelper = layui.coreHelper
, util = layui.util
, view = layui.view;
laydate.render({
elem: '#searchTime-CoreCmsUserServicesTicketVerificationLog-verificationTime',
type: 'datetime',
range: '到',
});
//重载form
form.render();
var searchwhere;
//监听搜索
form.on('submit(LAY-app-CoreCmsUserServicesTicketVerificationLog-search)',
function(data) {
var field = data.field;
searchwhere = field;
//执行重载
table.reloadData('LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox',{ where: field });
});
//数据绑定
table.render({
elem: '#LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox',
url: layui.setter.apiUrl + 'Api/CoreCmsUserServicesTicketVerificationLog/GetPageList',
method: 'POST',
toolbar: '#LAY-app-CoreCmsUserServicesTicketVerificationLog-toolbar',
defaultToolbar: ['filter', 'print', 'exports'],
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
page: true,
limit: 30,
limits: [10, 15, 20, 25, 30, 50, 100, 200],
text: {none: '暂无相关数据'},
cols: [
[
{ type: "checkbox", fixed: "left" },
{ field: 'id', title: '序列', width: 60, sort: false},
{ field: 'storeId', title: '核销门店id', sort: false,width: 105 },
{ field: 'verificationUserId', title: '核验人', sort: false,width: 105 },
{ field: 'ticketId', title: '服务券序列', sort: false,width: 105 },
{ field: 'ticketRedeemCode', title: '核验码', sort: false,width: 105 },
{ field: 'verificationTime', title: '核验时间', width: 130, sort: false},
{ width: 162, align: 'center', title:'操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox-bar' }
]
]
});
//监听排序事件
table.on('sort(LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox)', function(obj){
table.reloadData('LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox', {
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
orderField: obj.field, //排序字段
orderDirection: obj.type //排序方式
}
});
});
//监听行双击事件
table.on('rowDouble(LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox)', function (obj) {
//查看详情
doDetails(obj);
});
//头工具栏事件
table.on('toolbar(LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox)', function (obj) {
var checkStatus = table.checkStatus(obj.config.id);
switch (obj.event) {
case 'addData':
doCreate();
break;
case 'batchDelete':
doBatchDelete(checkStatus);
break;
case 'selectExportExcel':
doSelectExportExcel(checkStatus);
break;
case 'queryExportExcel':
doQueryExportexcel();
break;
};
});
//监听工具条
table.on('tool(LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox)',
function(obj) {
if (obj.event === 'detail') {
doDetails(obj);
} else if (obj.event === 'del') {
doDelete(obj);
} else if (obj.event === 'edit') {
doEdit(obj)
}
});
//执行创建操作
function doCreate(){
coreHelper.Post("Api/CoreCmsUserServicesTicketVerificationLog/GetCreate", null, function (e) {
if (e.code === 0) {
admin.popup({ shadeClose: false,
title: '创建数据',
area: ['600px', '500px'],
id: 'LAY-popup-CoreCmsUserServicesTicketVerificationLog-create',
success: function (layero, index) {
view(this.id).render('serviceGoods/servicesticketverificationlog/create', { data: e.data }).done(function () {
//监听提交
form.on('submit(LAY-app-CoreCmsUserServicesTicketVerificationLog-createForm-submit)',
function(data) {
var field = data.field; //获取提交的字段
if (debug) { console.log(field); } //开启调试返回数据
//提交 Ajax 成功后,关闭当前弹层并重载表格
coreHelper.Post("Api/CoreCmsUserServicesTicketVerificationLog/DoCreate", field, function (e) {
console.log(e)
if (e.code === 0) {
layui.table.reloadData('LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox'); //重载表格
layer.close(index); //再执行关闭
layer.msg(e.msg);
} else {
layer.msg(e.msg);
}
});
});
});
// 禁止弹窗出现滚动条
$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
layer.msg(e.msg);
}
});
}
//执行编辑操作
function doEdit(obj){
coreHelper.Post("Api/CoreCmsUserServicesTicketVerificationLog/GetEdit", {id:obj.data.id}, function (e) {
if (e.code === 0) {
admin.popup({ shadeClose: false,
title: '编辑数据',
area: ['600px', '500px'],
id: 'LAY-popup-CoreCmsUserServicesTicketVerificationLog-edit',
success: function (layero, index) {
view(this.id).render('serviceGoods/servicesticketverificationlog/edit', { data: e.data }).done(function () {
//监听提交
form.on('submit(LAY-app-CoreCmsUserServicesTicketVerificationLog-editForm-submit)',
function(data) {
var field = data.field; //获取提交的字段
if (debug) { console.log(field); } //开启调试返回数据
//提交 Ajax 成功后,关闭当前弹层并重载表格
coreHelper.Post("Api/CoreCmsUserServicesTicketVerificationLog/DoEdit", field, function (e) {
console.log(e)
if (e.code === 0) {
layui.table.reloadData('LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox'); //重载表格
layer.close(index); //再执行关闭
layer.msg(e.msg);
} else {
layer.msg(e.msg);
}
});
});
})
// 禁止弹窗出现滚动条
$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
layer.msg(e.msg);
}
});
}
//执行预览操作
function doDetails(obj) {
coreHelper.Post("Api/CoreCmsUserServicesTicketVerificationLog/GetDetails", { id: obj.data.id }, function (e) {
if (e.code === 0) {
admin.popup({ shadeClose: false,
title: '查看详情',
area: ['600px', '500px'],
id: 'LAY-popup-CoreCmsUserServicesTicketVerificationLog-details',
success: function (layero, index) {
view(this.id).render('serviceGoods/servicesticketverificationlog/details', { data: e.data }).done(function () {
form.render();
});
// 禁止弹窗出现滚动条
$(layero).children('.layui-layer-content').css('overflow', 'visible');
}
});
} else {
layer.msg(e.msg);
}
});
}
//执行单个删除
function doDelete(obj){
coreHelper.Post("Api/CoreCmsUserServicesTicketVerificationLog/DoDelete", { id: obj.data.id }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
table.reloadData('LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox');
layer.msg(e.msg);
});
}
//执行批量删除
function doBatchDelete(checkStatus){
var checkData = checkStatus.data;
if (checkData.length === 0) {
return layer.msg('请选择要删除的数据');
}
layer.confirm('确定删除吗?删除后将无法恢复。',
function(index) {
var delidsStr = [];
layui.each(checkData,
function(index, item) {
delidsStr.push(item.id);
});
coreHelper.Post("Api/CoreCmsUserServicesTicketVerificationLog/DoBatchDelete", { id: delidsStr }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
table.reloadData('LAY-app-CoreCmsUserServicesTicketVerificationLog-tableBox');
layer.msg(e.msg);
});
});
}
//执行查询条件导出excel
function doQueryExportexcel(){
layer.confirm('确定根据当前的查询条件导出数据吗?',
function(index) {
var field = searchwhere;
coreHelper.PostForm("Api/CoreCmsUserServicesTicketVerificationLog/QueryExportExcel", field, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
if (e.code === 0) {
window.open(e.data);
} else {
layer.msg(e.msg);
}
});
});
}
//执行选择目录导出数据
function doSelectExportExcel(checkStatus){
var checkData = checkStatus.data;
if (checkData.length === 0) {
return layer.msg('请选择您要导出的数据');
}
layer.confirm('确定导出选择的内容吗?',
function(index) {
var delidsStr = [];
layui.each(checkData,
function(index, item) {
delidsStr.push(item.id);
});
layer.close(index);
coreHelper.Post("Api/CoreCmsUserServicesTicketVerificationLog/SelectExportExcel", { id: delidsStr }, function (e) {
if (debug) { console.log(e); } //开启调试返回数据
if (e.code === 0) {
window.open(e.data);
} else {
layer.msg(e.msg);
}
});
});
}
//监听 表格复选框操作
});
};
</script>

@ -389,7 +389,7 @@
area: ['380px', '200px'],
id: 'LAY-popup-CoreCmsStore-clerkEdit',
success: function (layero, index) {
view(this.id).render('shop/store/clerkEdit', { data: e.data }).done(function () {
view(this.id).render('shop/store/clerkedit', { data: e.data }).done(function () {
//监听提交
form.on('submit(LAY-app-CoreCmsStore-clerkEdit-submit)',
function (data) {

@ -65,11 +65,12 @@ namespace CoreCms.Net.Web.WebApi.Controllers.PayNotify
await _redisOperationRepository.ListLeftPushAsync(RedisMessageQueueKey.WeChatPayNotice, JsonConvert.SerializeObject(notify));
return WeChatPayNotifyResult.Success;
}
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "微信支付成功回调", JsonConvert.SerializeObject(notify));
return NoContent();
}
catch (Exception ex)
{
NLogUtil.WriteAll(LogLevel.Trace, LogType.Refund, "微信支付成功回调", "统一下单支付结果通知", ex);
NLogUtil.WriteAll(LogLevel.Trace, LogType.Order, "微信支付成功回调", "统一下单支付结果通知", ex);
return NoContent();
}
}

Loading…
Cancel
Save