mirror of https://gitee.com/CoreUnion/CoreShop.git
!188 完善服务订单管理功能,完善商品查看详情功能等其他问题。
### 1.3.0 开源社区版(会员专业版同步): 【新增】完善商品查看详情功能。#I4QTLR 【新增】订单详情页面需要增加下单客户信息。 【新增】完善服务订单管理功能,实现订单作废、导出功能;核销码实现列表,作废,导出功能。#I4OSBK 【修复】修复普通订单查看详情,因优惠信息问题导致的异常情况。#I4QXUQ 【修复】修复门店列表下的用户编辑页面名称大小写问题(linux下大小写敏感问题)。 【修复】修复微信支付成功相应的日志记录类型有误。#I4QSNZ 【修复】修复发货日志记录sku货号错误问题。#I4PX25 【修复】修复发货单列表查看详情,提示权限不足的问题。#I4QDQR ### 0.0.8 会员专业版: 【新增】新增接龙功能营销功能,实现单个活动,可以添加多个不同商品的不同sku混合选择下单。 【新增】增加接龙数据库脚本及演示文件。 【升级】升级uView组件到2.0.20版本。 【修复】修复编辑收货地址的路径中选取区域部分可以手动输入文字。 【修复】修复【微信直播带货】组件缺少获取sku分页数据的问题。#I4QKSU 【优化】调整【微信自定义交易组件】商品类目排序方式及展示内容。#I4QE0Npull/189/head
parent
2df5615df8
commit
44fcf529b1
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -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,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,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,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,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>
|
Loading…
Reference in New Issue