333
This commit is contained in:
parent
dc7cb7a864
commit
612359f92a
|
|
@ -281,6 +281,7 @@
|
|||
public const string CacheSQRooms = "CacheSQRooms";
|
||||
public const string CacheSQRoomUnavailableTimes = "CacheSQRoomUnavailableTimes";
|
||||
public const string CacheSQReservations = "CacheSQReservations";
|
||||
public const string CacheSQReservationParticipants = "CacheSQReservationParticipants";
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2025/9/3 0:53:58
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.IRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// 预约记录表 工厂接口
|
||||
/// </summary>
|
||||
public interface ISQReservationParticipantsRepository : IBaseRepository<SQReservationParticipants>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(SQReservationParticipants entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(SQReservationParticipants entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<SQReservationParticipants> entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<SQReservationParticipants>> GetCaChe();
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
Task<List<SQReservationParticipants>> UpdateCaChe();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
new Task<IPageList<SQReservationParticipants>> QueryPageAsync(
|
||||
Expression<Func<SQReservationParticipants, bool>> predicate,
|
||||
Expression<Func<SQReservationParticipants, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2025/9/3 0:53:58
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.IServices
|
||||
{
|
||||
/// <summary>
|
||||
/// 预约记录表 服务工厂接口
|
||||
/// </summary>
|
||||
public interface ISQReservationParticipantsServices : IBaseServices<SQReservationParticipants>
|
||||
{
|
||||
#region 重写增删改查操作===========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> InsertAsync(SQReservationParticipants entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(SQReservationParticipants entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> UpdateAsync(List<SQReservationParticipants> entity);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdAsync(object id);
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
new Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<SQReservationParticipants>> GetCaChe();
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
Task<List<SQReservationParticipants>> UpdateCaChe();
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
new Task<IPageList<SQReservationParticipants>> QueryPageAsync(
|
||||
Expression<Func<SQReservationParticipants, bool>> predicate,
|
||||
Expression<Func<SQReservationParticipants, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="13.0.1" />
|
||||
<PackageReference Include="sqlSugarCore" Version="5.1.4.129" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
116
CoreCms.Net.Model/Entities/SQ/SQReservationParticipants.cs
Normal file
116
CoreCms.Net.Model/Entities/SQ/SQReservationParticipants.cs
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2025/9/3 0:53:58
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CoreCms.Net.Model.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// 预约记录表
|
||||
/// </summary>
|
||||
public partial class SQReservationParticipants
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
/// </summary>
|
||||
public SQReservationParticipants()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 参与记录ID
|
||||
/// </summary>
|
||||
[Display(Name = "参与记录ID")]
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 预约ID
|
||||
/// </summary>
|
||||
[Display(Name = "预约ID")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 reservation_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 参与者ID(关联用户表,暂时占位)
|
||||
/// </summary>
|
||||
[Display(Name = "参与者ID(关联用户表,暂时占位)")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 user_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 角色:0=参与者,1=发起者
|
||||
/// </summary>
|
||||
[Display(Name = "角色:0=参与者,1=发起者")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 role { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加入时间
|
||||
/// </summary>
|
||||
[Display(Name = "加入时间")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime join_time { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 退出时间
|
||||
/// </summary>
|
||||
[Display(Name = "退出时间")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.DateTime? quit_time { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 状态,0正常,1已退出
|
||||
/// </summary>
|
||||
[Display(Name = "状态,0正常,1已退出")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 status { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
***********************************************************************/
|
||||
|
||||
using SqlSugar;
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
|
|
@ -25,248 +26,252 @@ namespace CoreCms.Net.Model.Entities
|
|||
public SQReservations()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 预约ID
|
||||
/// </summary>
|
||||
[Display(Name = "预约ID")]
|
||||
|
||||
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 组局名称
|
||||
/// </summary>
|
||||
[Display(Name = "组局名称")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:100,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String title { get; set; }
|
||||
|
||||
|
||||
[StringLength(maximumLength: 100, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String title { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 房间ID
|
||||
/// </summary>
|
||||
[Display(Name = "房间ID")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 room_id { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 room_id { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 房间名称(冗余存储,比如 304号-大包,30元/小时)
|
||||
/// </summary>
|
||||
[Display(Name = "房间名称(冗余存储,比如 304号-大包,30元/小时)")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:100,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String room_name { get; set; }
|
||||
|
||||
|
||||
[StringLength(maximumLength: 100, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String room_name { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 开始时间
|
||||
/// </summary>
|
||||
[Display(Name = "开始时间")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime start_time { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.DateTime start_time { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 结束时间
|
||||
/// </summary>
|
||||
[Display(Name = "结束时间")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime end_time { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.DateTime end_time { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 时长(分钟)
|
||||
/// </summary>
|
||||
[Display(Name = "时长(分钟)")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 duration_minutes { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 duration_minutes { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 人数
|
||||
/// </summary>
|
||||
[Display(Name = "人数")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 player_count { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 player_count { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 玩法类型(如:补克)
|
||||
/// </summary>
|
||||
[Display(Name = "玩法类型(如:补克)")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String game_type { get; set; }
|
||||
|
||||
|
||||
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String game_type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 具体规则(如:斗地主)
|
||||
/// </summary>
|
||||
[Display(Name = "具体规则(如:斗地主)")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength:50,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String game_rule { get; set; }
|
||||
|
||||
|
||||
[StringLength(maximumLength: 50, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public System.String game_rule { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 其他补充
|
||||
/// </summary>
|
||||
[Display(Name = "其他补充")]
|
||||
|
||||
|
||||
[StringLength(maximumLength:255,ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String extra_info { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
[StringLength(maximumLength: 255, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
||||
|
||||
public System.String extra_info { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否禁烟:0=不限制,1=禁烟,2=不禁烟
|
||||
/// </summary>
|
||||
[Display(Name = "是否禁烟:0=不限制,1=禁烟,2=不禁烟")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 is_smoking { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 is_smoking { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 性别限制:0=不限,1=男,2=女
|
||||
/// </summary>
|
||||
[Display(Name = "性别限制:0=不限,1=男,2=女")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 gender_limit { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 gender_limit { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 最低信誉分
|
||||
/// </summary>
|
||||
[Display(Name = "最低信誉分")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Decimal? credit_limit { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Decimal? credit_limit { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 最小年龄限制
|
||||
/// </summary>
|
||||
[Display(Name = "最小年龄限制")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32? min_age { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32? min_age { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 最大年龄限制,0=不限
|
||||
/// </summary>
|
||||
[Display(Name = "最大年龄限制,0=不限")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32? max_age { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32? max_age { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 鸽子费(保证金)
|
||||
/// </summary>
|
||||
[Display(Name = "鸽子费(保证金)")]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Decimal? deposit_fee { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Decimal? deposit_fee { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 状态:0=待开始,1=进行中,2=已结束,3=取消
|
||||
/// </summary>
|
||||
[Display(Name = "状态:0=待开始,1=进行中,2=已结束,3=取消")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.Int32 status { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.Int32 status { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[Display(Name = "创建时间")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime created_at { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.DateTime created_at { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新时间
|
||||
/// </summary>
|
||||
[Display(Name = "更新时间")]
|
||||
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
|
||||
|
||||
|
||||
public System.DateTime updated_at { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public System.DateTime updated_at { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[Display(Name = "备注")]
|
||||
|
||||
[StringLength(maximumLength: 255, ErrorMessage = "{0}不能超过{1}字")]
|
||||
public System.String remarks { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace CoreCms.Net.Model.Entities
|
|||
/// <summary>
|
||||
/// 房间号(如:304号-大包)
|
||||
/// </summary>
|
||||
[Display(Name = "房间号(如:304号-大包)")]
|
||||
[Display(Name = "房间名称")]
|
||||
|
||||
[Required(ErrorMessage = "请输入{0}")]
|
||||
[StringLength(maximumLength: 100, ErrorMessage = "{0}不能超过{1}字")]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
using AutoMapper;
|
||||
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CoreCms.Net.Model.ViewModels.SQ
|
||||
{
|
||||
[AutoMap(typeof(SQReservationParticipants))]
|
||||
public class SQReservationParticipantsDto : SQReservationParticipants
|
||||
{
|
||||
/// <summary>
|
||||
/// 组局名称
|
||||
/// </summary>
|
||||
public string ReservationName { get; set; }
|
||||
/// <summary>
|
||||
/// 用户昵称
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户头像
|
||||
/// </summary>
|
||||
public string AvatarImage { get; set; }
|
||||
}
|
||||
}
|
||||
18
CoreCms.Net.Model/ViewModels/SQ/SQReservationsDto.cs
Normal file
18
CoreCms.Net.Model/ViewModels/SQ/SQReservationsDto.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using AutoMapper;
|
||||
|
||||
using CoreCms.Net.Model.Entities;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CoreCms.Net.Model.ViewModels.SQ
|
||||
{
|
||||
[AutoMap(typeof(SQReservations))]
|
||||
public class SQReservationsDto : SQReservations
|
||||
{
|
||||
public List<SQReservationParticipantsDto> Participants { get; set; }
|
||||
}
|
||||
}
|
||||
242
CoreCms.Net.Repository/SQ/SQReservationParticipantsRepository.cs
Normal file
242
CoreCms.Net.Repository/SQ/SQReservationParticipantsRepository.cs
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2025/9/3 0:53:58
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Caching.Manual;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
namespace CoreCms.Net.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// 预约记录表 接口实现
|
||||
/// </summary>
|
||||
public class SQReservationParticipantsRepository : BaseRepository<SQReservationParticipants>, ISQReservationParticipantsRepository
|
||||
{
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
public SQReservationParticipantsRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(SQReservationParticipants entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Insertable(entity).ExecuteReturnIdentityAsync() > 0;
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.CreateSuccess : GlobalConstVars.CreateFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(SQReservationParticipants entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var oldModel = await DbClient.Queryable<SQReservationParticipants>().In(entity.id).SingleAsync();
|
||||
if (oldModel == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
//事物处理过程开始
|
||||
oldModel.id = entity.id;
|
||||
oldModel.reservation_id = entity.reservation_id;
|
||||
oldModel.user_id = entity.user_id;
|
||||
oldModel.role = entity.role;
|
||||
oldModel.join_time = entity.join_time;
|
||||
oldModel.quit_time = entity.quit_time;
|
||||
oldModel.status = entity.status;
|
||||
|
||||
//事物处理过程结束
|
||||
var bl = await DbClient.Updateable(oldModel).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<SQReservationParticipants> entity)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Updateable(entity).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.EditSuccess : GlobalConstVars.EditFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<SQReservationParticipants>(id).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var bl = await DbClient.Deleteable<SQReservationParticipants>().In(ids).ExecuteCommandHasChangeAsync();
|
||||
jm.code = bl ? 0 : 1;
|
||||
jm.msg = bl ? GlobalConstVars.DeleteSuccess : GlobalConstVars.DeleteFailure;
|
||||
if (bl)
|
||||
{
|
||||
await UpdateCaChe();
|
||||
}
|
||||
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<SQReservationParticipants>> GetCaChe()
|
||||
{
|
||||
var cache = ManualDataCache.Instance.Get<List<SQReservationParticipants>>(GlobalConstVars.CacheSQReservationParticipants);
|
||||
if (cache != null)
|
||||
{
|
||||
return cache;
|
||||
}
|
||||
return await UpdateCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<SQReservationParticipants>> UpdateCaChe()
|
||||
{
|
||||
var list = await DbClient.Queryable<SQReservationParticipants>().With(SqlWith.NoLock).ToListAsync();
|
||||
ManualDataCache.Instance.Set(GlobalConstVars.CacheSQReservationParticipants, list);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<SQReservationParticipants>> QueryPageAsync(Expression<Func<SQReservationParticipants, bool>> predicate,
|
||||
Expression<Func<SQReservationParticipants, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<SQReservationParticipants> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<SQReservationParticipants>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new SQReservationParticipants
|
||||
{
|
||||
id = p.id,
|
||||
reservation_id = p.reservation_id,
|
||||
user_id = p.user_id,
|
||||
role = p.role,
|
||||
join_time = p.join_time,
|
||||
quit_time = p.quit_time,
|
||||
status = p.status,
|
||||
|
||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<SQReservationParticipants>()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate).Select(p => new SQReservationParticipants
|
||||
{
|
||||
id = p.id,
|
||||
reservation_id = p.reservation_id,
|
||||
user_id = p.user_id,
|
||||
role = p.role,
|
||||
join_time = p.join_time,
|
||||
quit_time = p.quit_time,
|
||||
status = p.status,
|
||||
|
||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<SQReservationParticipants>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
137
CoreCms.Net.Services/SQ/SQReservationParticipantsServices.cs
Normal file
137
CoreCms.Net.Services/SQ/SQReservationParticipantsServices.cs
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2025/9/3 0:53:58
|
||||
* Description: 暂无
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
using CoreCms.Net.Configuration;
|
||||
using CoreCms.Net.IRepository;
|
||||
using CoreCms.Net.IRepository.UnitOfWork;
|
||||
using CoreCms.Net.IServices;
|
||||
using CoreCms.Net.Model.Entities;
|
||||
using CoreCms.Net.Model.ViewModels.Basics;
|
||||
using CoreCms.Net.Model.ViewModels.UI;
|
||||
using SqlSugar;
|
||||
|
||||
|
||||
namespace CoreCms.Net.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 预约记录表 接口实现
|
||||
/// </summary>
|
||||
public class SQReservationParticipantsServices : BaseServices<SQReservationParticipants>, ISQReservationParticipantsServices
|
||||
{
|
||||
private readonly ISQReservationParticipantsRepository _dal;
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
|
||||
public SQReservationParticipantsServices(IUnitOfWork unitOfWork, ISQReservationParticipantsRepository dal)
|
||||
{
|
||||
this._dal = dal;
|
||||
base.BaseDal = dal;
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
|
||||
#region 实现重写增删改查操作==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步插入方法
|
||||
/// </summary>
|
||||
/// <param name="entity">实体数据</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> InsertAsync(SQReservationParticipants entity)
|
||||
{
|
||||
return await _dal.InsertAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(SQReservationParticipants entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写异步更新方法方法
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> UpdateAsync(List<SQReservationParticipants> entity)
|
||||
{
|
||||
return await _dal.UpdateAsync(entity);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID的数据
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdAsync(object id)
|
||||
{
|
||||
return await _dal.DeleteByIdAsync(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重写删除指定ID集合的数据(批量删除)
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
public new async Task<AdminUiCallBack> DeleteByIdsAsync(int[] ids)
|
||||
{
|
||||
return await _dal.DeleteByIdsAsync(ids);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 获取缓存的所有数据==========================================================
|
||||
|
||||
/// <summary>
|
||||
/// 获取缓存的所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<SQReservationParticipants>> GetCaChe()
|
||||
{
|
||||
return await _dal.GetCaChe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新cache
|
||||
/// </summary>
|
||||
public async Task<List<SQReservationParticipants>> UpdateCaChe()
|
||||
{
|
||||
return await _dal.UpdateCaChe();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<SQReservationParticipants>> QueryPageAsync(Expression<Func<SQReservationParticipants, bool>> predicate,
|
||||
Expression<Func<SQReservationParticipants, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,689 @@
|
|||
/***********************************************************************
|
||||
* Project: CoreCms
|
||||
* ProjectName: 核心内容管理系统
|
||||
* Web: https://www.corecms.net
|
||||
* Author: 大灰灰
|
||||
* Email: jianweie@163.com
|
||||
* CreateTime: 2025/9/3 0:53:58
|
||||
* 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;
|
||||
using CoreCms.Net.Web.Admin.Infrastructure;
|
||||
using AutoMapper;
|
||||
using System.Collections.Generic;
|
||||
using CoreCms.Net.Model.ViewModels.SQ;
|
||||
using Essensoft.Paylink.Alipay.Domain;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 预约记录表
|
||||
///</summary>
|
||||
[Description("预约记录表")]
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
[RequiredErrorForAdmin]
|
||||
[Authorize]
|
||||
public class SQReservationParticipantsController : ControllerBase
|
||||
{
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly ISQReservationParticipantsServices _SQReservationParticipantsServices;
|
||||
private readonly IMapper _mapper;
|
||||
private readonly ICoreCmsUserServices _userServices;
|
||||
private readonly ISQReservationsServices _SQReservationsServices;
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
///</summary>
|
||||
public SQReservationParticipantsController(IWebHostEnvironment webHostEnvironment
|
||||
, ISQReservationParticipantsServices SQReservationParticipantsServices
|
||||
, IMapper mapper
|
||||
, ICoreCmsUserServices userServices
|
||||
, ISQReservationsServices SQReservationsServices
|
||||
)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_SQReservationParticipantsServices = SQReservationParticipantsServices;
|
||||
_mapper = mapper;
|
||||
_userServices = userServices;
|
||||
_SQReservationsServices = SQReservationsServices;
|
||||
}
|
||||
|
||||
#region 获取列表============================================================
|
||||
// POST: Api/SQReservationParticipants/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<SQReservationParticipants>();
|
||||
//获取排序字段
|
||||
var orderField = Request.Form["orderField"].FirstOrDefault();
|
||||
|
||||
Expression<Func<SQReservationParticipants, object>> orderEx = orderField switch
|
||||
{
|
||||
"id" => p => p.id,
|
||||
"reservation_id" => p => p.reservation_id,
|
||||
"user_id" => p => p.user_id,
|
||||
"role" => p => p.role,
|
||||
"join_time" => p => p.join_time,
|
||||
"quit_time" => p => p.quit_time,
|
||||
"status" => p => p.status,
|
||||
_ => p => p.id
|
||||
};
|
||||
|
||||
//设置排序方式
|
||||
var orderDirection = Request.Form["orderDirection"].FirstOrDefault();
|
||||
var orderBy = orderDirection switch
|
||||
{
|
||||
"asc" => OrderByType.Asc,
|
||||
"desc" => OrderByType.Desc,
|
||||
_ => OrderByType.Desc
|
||||
};
|
||||
//查询筛选
|
||||
|
||||
//参与记录ID int
|
||||
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (id > 0)
|
||||
{
|
||||
where = where.And(p => p.id == id);
|
||||
}
|
||||
//预约ID int
|
||||
var reservation_id = Request.Form["reservation_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (reservation_id > 0)
|
||||
{
|
||||
where = where.And(p => p.reservation_id == reservation_id);
|
||||
}
|
||||
//参与者ID(关联用户表,暂时占位) int
|
||||
var user_id = Request.Form["user_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (user_id > 0)
|
||||
{
|
||||
where = where.And(p => p.user_id == user_id);
|
||||
}
|
||||
List<int> userids = null;
|
||||
//参与者ID(关联用户表,暂时占位) int
|
||||
var user_name = Request.Form["user_name"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(user_name))
|
||||
{
|
||||
var _userIds = await _userServices.QueryListByClauseAsync(it => it.userName.Contains(user_name));
|
||||
if (_userIds == null || _userIds.Count == 0)
|
||||
{
|
||||
userids = new List<int>();
|
||||
}
|
||||
else
|
||||
{
|
||||
userids = _userIds.Select(it => it.id).ToList();
|
||||
}
|
||||
|
||||
//where = where.And(p => p.user_id == user_id);
|
||||
}
|
||||
if (userids != null)
|
||||
{
|
||||
where = where.And(p => userids.Contains(p.user_id));
|
||||
}
|
||||
//角色:0=参与者,1=发起者 int
|
||||
var role = Request.Form["role"].FirstOrDefault().ObjectToInt(0);
|
||||
if (role > 0)
|
||||
{
|
||||
where = where.And(p => p.role == role);
|
||||
}
|
||||
//user_name
|
||||
//加入时间 datetime
|
||||
var join_time = Request.Form["join_time"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(join_time))
|
||||
{
|
||||
if (join_time.Contains("到"))
|
||||
{
|
||||
var dts = join_time.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.join_time > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.join_time < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = join_time.ObjectToDate();
|
||||
where = where.And(p => p.join_time > dt);
|
||||
}
|
||||
}
|
||||
//退出时间 datetime
|
||||
var quit_time = Request.Form["quit_time"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(quit_time))
|
||||
{
|
||||
if (quit_time.Contains("到"))
|
||||
{
|
||||
var dts = quit_time.Split("到");
|
||||
var dtStart = dts[0].Trim().ObjectToDate();
|
||||
where = where.And(p => p.quit_time > dtStart);
|
||||
var dtEnd = dts[1].Trim().ObjectToDate();
|
||||
where = where.And(p => p.quit_time < dtEnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var dt = quit_time.ObjectToDate();
|
||||
where = where.And(p => p.quit_time > dt);
|
||||
}
|
||||
}
|
||||
//状态,0正常,1已退出 int
|
||||
var status = Request.Form["status"].FirstOrDefault().ObjectToInt(-1);
|
||||
if (status > -1)
|
||||
{
|
||||
where = where.And(p => p.status == status);
|
||||
}
|
||||
//获取数据
|
||||
var list = await _SQReservationParticipantsServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true);
|
||||
var pageList = _mapper.Map<List<SQReservationParticipantsDto>>(list);
|
||||
if (pageList != null && pageList.Count > 0)
|
||||
{
|
||||
var reIds = pageList.Select(it => it.reservation_id).ToList();
|
||||
var userIds = pageList.Select(it => it.user_id).ToList();
|
||||
var re = await _SQReservationsServices.QueryListByClauseAsync(p => reIds.Contains(p.id));
|
||||
var users = await _userServices.QueryListByClauseAsync(p => userIds.Contains(p.id));
|
||||
foreach (var item in pageList)
|
||||
{
|
||||
var reservation = re.FirstOrDefault(it => it.id == item.reservation_id);
|
||||
if (reservation != null)
|
||||
{
|
||||
item.ReservationName = reservation.title;
|
||||
}
|
||||
var user = users.FirstOrDefault(it => it.id == item.user_id);
|
||||
if (user != null)
|
||||
{
|
||||
item.UserName = user.userName;
|
||||
}
|
||||
}
|
||||
}
|
||||
//返回数据
|
||||
jm.data = pageList;
|
||||
jm.code = 0;
|
||||
jm.count = list.TotalCount;
|
||||
jm.msg = "数据调用成功!";
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 首页数据============================================================
|
||||
// POST: Api/SQReservationParticipants/GetIndex
|
||||
/// <summary>
|
||||
/// 首页数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("首页数据")]
|
||||
public AdminUiCallBack GetIndex()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建数据============================================================
|
||||
// POST: Api/SQReservationParticipants/GetCreate
|
||||
/// <summary>
|
||||
/// 创建数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建数据")]
|
||||
public AdminUiCallBack GetCreate()
|
||||
{
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0 };
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 创建提交============================================================
|
||||
// POST: Api/SQReservationParticipants/DoCreate
|
||||
/// <summary>
|
||||
/// 创建提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("创建提交")]
|
||||
public async Task<AdminUiCallBack> DoCreate([FromBody] SQReservationParticipants entity)
|
||||
{
|
||||
var jm = await _SQReservationParticipantsServices.InsertAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑数据============================================================
|
||||
// POST: Api/SQReservationParticipants/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 _SQReservationParticipantsServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
jm.code = 0;
|
||||
jm.data = model;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑提交============================================================
|
||||
// POST: Api/SQReservationParticipants/Edit
|
||||
/// <summary>
|
||||
/// 编辑提交
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("编辑提交")]
|
||||
public async Task<AdminUiCallBack> DoEdit([FromBody] SQReservationParticipants entity)
|
||||
{
|
||||
var jm = await _SQReservationParticipantsServices.UpdateAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除数据============================================================
|
||||
// POST: Api/SQReservationParticipants/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 _SQReservationParticipantsServices.ExistsAsync(p => p.id == entity.id, true);
|
||||
if (!model)
|
||||
{
|
||||
jm.msg = GlobalConstVars.DataisNo;
|
||||
return jm;
|
||||
}
|
||||
jm = await _SQReservationParticipantsServices.DeleteByIdAsync(entity.id);
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 批量删除============================================================
|
||||
// POST: Api/SQReservationParticipants/DoBatchDelete/10,11,20
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("批量删除")]
|
||||
public async Task<AdminUiCallBack> DoBatchDelete([FromBody] FMArrayIntIds entity)
|
||||
{
|
||||
var jm = await _SQReservationParticipantsServices.DeleteByIdsAsync(entity.id);
|
||||
return jm;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 预览数据============================================================
|
||||
// POST: Api/SQReservationParticipants/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 _SQReservationParticipantsServices.QueryByIdAsync(entity.id, false);
|
||||
if (model == null)
|
||||
{
|
||||
jm.msg = "不存在此信息";
|
||||
return jm;
|
||||
}
|
||||
jm.code = 0;
|
||||
jm.data = model;
|
||||
|
||||
return jm;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 选择导出============================================================
|
||||
// POST: Api/SQReservationParticipants/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 _SQReservationParticipantsServices.QueryListByClauseAsync(p => entity.id.Contains(p.id), p => p.id, OrderByType.Asc, true);
|
||||
//给sheet1添加第一行的头部标题
|
||||
var headerRow = mySheet.CreateRow(0);
|
||||
var headerStyle = ExcelHelper.GetHeaderStyle(book);
|
||||
|
||||
var cell0 = headerRow.CreateCell(0);
|
||||
cell0.SetCellValue("参与记录ID");
|
||||
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("参与者ID(关联用户表,暂时占位)");
|
||||
cell2.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(2, 10 * 256);
|
||||
|
||||
var cell3 = headerRow.CreateCell(3);
|
||||
cell3.SetCellValue("角色:0=参与者,1=发起者");
|
||||
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);
|
||||
|
||||
var cell6 = headerRow.CreateCell(6);
|
||||
cell6.SetCellValue("状态,0正常,1已退出");
|
||||
cell6.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(6, 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].reservation_id.ToString());
|
||||
rowTemp1.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp2 = rowTemp.CreateCell(2);
|
||||
rowTemp2.SetCellValue(listModel[i].user_id.ToString());
|
||||
rowTemp2.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp3 = rowTemp.CreateCell(3);
|
||||
rowTemp3.SetCellValue(listModel[i].role.ToString());
|
||||
rowTemp3.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp4 = rowTemp.CreateCell(4);
|
||||
rowTemp4.SetCellValue(listModel[i].join_time.ToString());
|
||||
rowTemp4.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp5 = rowTemp.CreateCell(5);
|
||||
rowTemp5.SetCellValue(listModel[i].quit_time.ToString());
|
||||
rowTemp5.CellStyle = commonCellStyle;
|
||||
|
||||
var rowTemp6 = rowTemp.CreateCell(6);
|
||||
rowTemp6.SetCellValue(listModel[i].status.ToString());
|
||||
rowTemp6.CellStyle = commonCellStyle;
|
||||
|
||||
}
|
||||
// 导出excel
|
||||
string webRootPath = _webHostEnvironment.WebRootPath;
|
||||
string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
|
||||
string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-SQReservationParticipants导出(选择结果).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/SQReservationParticipants/QueryExportExcel/10
|
||||
/// <summary>
|
||||
/// 查询导出
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Description("查询导出")]
|
||||
public async Task<AdminUiCallBack> QueryExportExcel()
|
||||
{
|
||||
var jm = new AdminUiCallBack();
|
||||
|
||||
var where = PredicateBuilder.True<SQReservationParticipants>();
|
||||
//查询筛选
|
||||
|
||||
//参与记录ID int
|
||||
var id = Request.Form["id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (id > 0)
|
||||
{
|
||||
where = where.And(p => p.id == id);
|
||||
}
|
||||
//预约ID int
|
||||
var reservation_id = Request.Form["reservation_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (reservation_id > 0)
|
||||
{
|
||||
where = where.And(p => p.reservation_id == reservation_id);
|
||||
}
|
||||
//参与者ID(关联用户表,暂时占位) int
|
||||
var user_id = Request.Form["user_id"].FirstOrDefault().ObjectToInt(0);
|
||||
if (user_id > 0)
|
||||
{
|
||||
where = where.And(p => p.user_id == user_id);
|
||||
}
|
||||
//角色:0=参与者,1=发起者 int
|
||||
var role = Request.Form["role"].FirstOrDefault().ObjectToInt(0);
|
||||
if (role > 0)
|
||||
{
|
||||
where = where.And(p => p.role == role);
|
||||
}
|
||||
//加入时间 datetime
|
||||
var join_time = Request.Form["join_time"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(join_time))
|
||||
{
|
||||
var dt = join_time.ObjectToDate();
|
||||
where = where.And(p => p.join_time > dt);
|
||||
}
|
||||
//退出时间 datetime
|
||||
var quit_time = Request.Form["quit_time"].FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(quit_time))
|
||||
{
|
||||
var dt = quit_time.ObjectToDate();
|
||||
where = where.And(p => p.quit_time > dt);
|
||||
}
|
||||
//状态,0正常,1已退出 int
|
||||
var status = Request.Form["status"].FirstOrDefault().ObjectToInt(0);
|
||||
if (status > 0)
|
||||
{
|
||||
where = where.And(p => p.status == status);
|
||||
}
|
||||
//获取数据
|
||||
//创建Excel文件的对象
|
||||
var book = new HSSFWorkbook();
|
||||
//添加一个sheet
|
||||
var mySheet = book.CreateSheet("Sheet1");
|
||||
//获取list数据
|
||||
var listModel = await _SQReservationParticipantsServices.QueryListByClauseAsync(where, p => p.id, OrderByType.Asc, true);
|
||||
//给sheet1添加第一行的头部标题
|
||||
var headerRow = mySheet.CreateRow(0);
|
||||
var headerStyle = ExcelHelper.GetHeaderStyle(book);
|
||||
|
||||
var cell0 = headerRow.CreateCell(0);
|
||||
cell0.SetCellValue("参与记录ID");
|
||||
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("参与者ID(关联用户表,暂时占位)");
|
||||
cell2.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(2, 10 * 256);
|
||||
|
||||
var cell3 = headerRow.CreateCell(3);
|
||||
cell3.SetCellValue("角色:0=参与者,1=发起者");
|
||||
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);
|
||||
|
||||
var cell6 = headerRow.CreateCell(6);
|
||||
cell6.SetCellValue("状态,0正常,1已退出");
|
||||
cell6.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(6, 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].reservation_id.ToString());
|
||||
rowTemp1.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp2 = rowTemp.CreateCell(2);
|
||||
rowTemp2.SetCellValue(listModel[i].user_id.ToString());
|
||||
rowTemp2.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp3 = rowTemp.CreateCell(3);
|
||||
rowTemp3.SetCellValue(listModel[i].role.ToString());
|
||||
rowTemp3.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp4 = rowTemp.CreateCell(4);
|
||||
rowTemp4.SetCellValue(listModel[i].join_time.ToString());
|
||||
rowTemp4.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp5 = rowTemp.CreateCell(5);
|
||||
rowTemp5.SetCellValue(listModel[i].quit_time.ToString());
|
||||
rowTemp5.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
|
||||
var rowTemp6 = rowTemp.CreateCell(6);
|
||||
rowTemp6.SetCellValue(listModel[i].status.ToString());
|
||||
rowTemp6.CellStyle = commonCellStyle;
|
||||
|
||||
|
||||
}
|
||||
// 写入到excel
|
||||
string webRootPath = _webHostEnvironment.WebRootPath;
|
||||
string tpath = "/files/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
|
||||
string fileName = DateTime.Now.ToString("yyyyMMddHHmmssfff") + "-SQReservationParticipants导出(查询结果).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
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -33,6 +33,8 @@ using SqlSugar;
|
|||
using CoreCms.Net.Web.Admin.Infrastructure;
|
||||
using CoreCms.Net.Services;
|
||||
using System.Collections.Generic;
|
||||
using AutoMapper;
|
||||
using CoreCms.Net.Model.ViewModels.SQ;
|
||||
|
||||
namespace CoreCms.Net.Web.Admin.Controllers
|
||||
{
|
||||
|
|
@ -51,6 +53,9 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
private readonly ISQRoomsServices _SQRoomsServices;
|
||||
private readonly ISysDictionaryDataServices _sysDictionaryDataServices;
|
||||
private readonly ISysDictionaryServices _sysDictionaryServices;
|
||||
private readonly ISQReservationParticipantsServices _SQReservationParticipantsServices;
|
||||
private readonly IMapper _mapper;
|
||||
private readonly ICoreCmsUserServices _userServices;
|
||||
/// <summary>
|
||||
/// 构造函数
|
||||
///</summary>
|
||||
|
|
@ -59,6 +64,11 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
, ISQRoomsServices SQRoomsServices
|
||||
, ISysDictionaryServices sysDictionaryServices
|
||||
, ISysDictionaryDataServices sysDictionaryDataServices
|
||||
, ISQReservationParticipantsServices sQReservationParticipantsServices
|
||||
, IMapper mapper
|
||||
,
|
||||
ICoreCmsUserServices userServices
|
||||
|
||||
)
|
||||
{
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
|
|
@ -66,6 +76,9 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
_SQRoomsServices = SQRoomsServices;
|
||||
_sysDictionaryServices = sysDictionaryServices;
|
||||
_sysDictionaryDataServices = sysDictionaryDataServices;
|
||||
_SQReservationParticipantsServices = sQReservationParticipantsServices;
|
||||
_mapper = mapper;
|
||||
_userServices = userServices;
|
||||
}
|
||||
|
||||
#region 获取列表============================================================
|
||||
|
|
@ -290,8 +303,39 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
}
|
||||
//获取数据
|
||||
var list = await _SQReservationsServices.QueryPageAsync(where, orderEx, orderBy, pageCurrent, pageSize, true);
|
||||
var pageList = _mapper.Map<List<SQReservationsDto>>(list);
|
||||
var rIds = list.Select(it => it.id).ToList();
|
||||
if (rIds != null && rIds.Count > 0)
|
||||
{
|
||||
var participants = await _SQReservationParticipantsServices.QueryListByClauseAsync(it => rIds.Contains(it.reservation_id), "", true);
|
||||
List<CoreCmsUser> userList = new List<CoreCmsUser>();
|
||||
if (participants != null && participants.Count > 0)
|
||||
{
|
||||
var userIds = participants.Select(it => it.user_id).ToList();
|
||||
userList = await _userServices.QueryListByClauseAsync(it => userIds.Contains(it.id), "", true);
|
||||
}
|
||||
foreach (var item in pageList)
|
||||
{
|
||||
var temp = participants.Where(it => it.reservation_id == item.id).OrderBy(it=>it.role).ThenBy(it=>it.status).ToList();
|
||||
var dto = _mapper.Map<List<SQReservationParticipantsDto>>(temp);
|
||||
if (userList != null && userList.Count > 0)
|
||||
{
|
||||
foreach (var p in dto)
|
||||
{
|
||||
var u = userList.FirstOrDefault(it => it.id == p.user_id);
|
||||
if (u != null)
|
||||
{
|
||||
p.UserName = u.nickName;
|
||||
p.AvatarImage = u.avatarImage;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
item.Participants = dto;
|
||||
}
|
||||
}
|
||||
//返回数据
|
||||
jm.data = list;
|
||||
jm.data = pageList;
|
||||
jm.code = 0;
|
||||
jm.count = list.TotalCount;
|
||||
jm.msg = "数据调用成功!";
|
||||
|
|
@ -326,7 +370,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
});
|
||||
}
|
||||
//返回数据
|
||||
var jm = new AdminUiCallBack { code = 0, msg="" };
|
||||
var jm = new AdminUiCallBack { code = 0, msg = "" };
|
||||
|
||||
jm.data = new { roomOptions = data, dicOptions = options };
|
||||
return jm;
|
||||
|
|
@ -360,6 +404,9 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
[Description("创建提交")]
|
||||
public async Task<AdminUiCallBack> DoCreate([FromBody] SQReservations entity)
|
||||
{
|
||||
entity.created_at = DateTime.Now;
|
||||
entity.updated_at = DateTime.Now;
|
||||
entity.remarks = "后台管理手动创建!";
|
||||
var jm = await _SQReservationsServices.InsertAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
|
|
@ -402,6 +449,14 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
[Description("编辑提交")]
|
||||
public async Task<AdminUiCallBack> DoEdit([FromBody] SQReservations entity)
|
||||
{
|
||||
var e = _SQReservationsServices.QueryById(entity.id);
|
||||
if (e == null)
|
||||
{
|
||||
throw new ArgumentNullException("未找到数据");
|
||||
}
|
||||
entity.created_at = e.created_at;
|
||||
entity.remarks = e.remarks;
|
||||
entity.updated_at = DateTime.Now;
|
||||
var jm = await _SQReservationsServices.UpdateAsync(entity);
|
||||
return jm;
|
||||
}
|
||||
|
|
@ -514,7 +569,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
mySheet.SetColumnWidth(2, 10 * 256);
|
||||
|
||||
var cell3 = headerRow.CreateCell(3);
|
||||
cell3.SetCellValue("房间名称(冗余存储,比如 304号-大包,30元/小时)");
|
||||
cell3.SetCellValue("房间名称");
|
||||
cell3.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(3, 10 * 256);
|
||||
|
||||
|
|
@ -539,12 +594,12 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
mySheet.SetColumnWidth(7, 10 * 256);
|
||||
|
||||
var cell8 = headerRow.CreateCell(8);
|
||||
cell8.SetCellValue("玩法类型(如:补克)");
|
||||
cell8.SetCellValue("玩法类型");
|
||||
cell8.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(8, 10 * 256);
|
||||
|
||||
var cell9 = headerRow.CreateCell(9);
|
||||
cell9.SetCellValue("具体规则(如:斗地主)");
|
||||
cell9.SetCellValue("具体规则");
|
||||
cell9.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(9, 10 * 256);
|
||||
|
||||
|
|
@ -554,12 +609,12 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
mySheet.SetColumnWidth(10, 10 * 256);
|
||||
|
||||
var cell11 = headerRow.CreateCell(11);
|
||||
cell11.SetCellValue("是否禁烟:0=不限制,1=禁烟,2=不禁烟");
|
||||
cell11.SetCellValue("是否禁烟");
|
||||
cell11.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(11, 10 * 256);
|
||||
|
||||
var cell12 = headerRow.CreateCell(12);
|
||||
cell12.SetCellValue("性别限制:0=不限,1=男,2=女");
|
||||
cell12.SetCellValue("性别限制");
|
||||
cell12.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(12, 10 * 256);
|
||||
|
||||
|
|
@ -574,17 +629,17 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
mySheet.SetColumnWidth(14, 10 * 256);
|
||||
|
||||
var cell15 = headerRow.CreateCell(15);
|
||||
cell15.SetCellValue("最大年龄限制,0=不限");
|
||||
cell15.SetCellValue("最大年龄限制");
|
||||
cell15.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(15, 10 * 256);
|
||||
|
||||
var cell16 = headerRow.CreateCell(16);
|
||||
cell16.SetCellValue("鸽子费(保证金)");
|
||||
cell16.SetCellValue("鸽子费");
|
||||
cell16.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(16, 10 * 256);
|
||||
|
||||
var cell17 = headerRow.CreateCell(17);
|
||||
cell17.SetCellValue("状态:0=待开始,1=进行中,2=已结束,3=取消");
|
||||
cell17.SetCellValue("状态");
|
||||
cell17.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(17, 10 * 256);
|
||||
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
mySheet.SetColumnWidth(0, 10 * 256);
|
||||
|
||||
var cell1 = headerRow.CreateCell(1);
|
||||
cell1.SetCellValue("房间号");
|
||||
cell1.SetCellValue("房间名称");
|
||||
cell1.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(1, 10 * 256);
|
||||
|
||||
|
|
@ -463,7 +463,7 @@ namespace CoreCms.Net.Web.Admin.Controllers
|
|||
mySheet.SetColumnWidth(0, 10 * 256);
|
||||
|
||||
var cell1 = headerRow.CreateCell(1);
|
||||
cell1.SetCellValue("房间号");
|
||||
cell1.SetCellValue("房间名称");
|
||||
cell1.CellStyle = headerStyle;
|
||||
mySheet.SetColumnWidth(1, 10 * 256);
|
||||
|
||||
|
|
|
|||
|
|
@ -3658,12 +3658,95 @@
|
|||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController">
|
||||
<summary>
|
||||
预约记录表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.#ctor(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ISQReservationParticipantsServices,AutoMapper.IMapper,CoreCms.Net.IServices.ICoreCmsUserServices,CoreCms.Net.IServices.ISQReservationsServices)">
|
||||
<summary>
|
||||
构造函数
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.GetPageList">
|
||||
<summary>
|
||||
获取列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.GetIndex">
|
||||
<summary>
|
||||
首页数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.GetCreate">
|
||||
<summary>
|
||||
创建数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.DoCreate(CoreCms.Net.Model.Entities.SQReservationParticipants)">
|
||||
<summary>
|
||||
创建提交
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.GetEdit(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||
<summary>
|
||||
编辑数据
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.DoEdit(CoreCms.Net.Model.Entities.SQReservationParticipants)">
|
||||
<summary>
|
||||
编辑提交
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.DoDelete(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||
<summary>
|
||||
单选删除
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.DoBatchDelete(CoreCms.Net.Model.FromBody.FMArrayIntIds)">
|
||||
<summary>
|
||||
批量删除
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.GetDetails(CoreCms.Net.Model.FromBody.FMIntId)">
|
||||
<summary>
|
||||
预览数据
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.SelectExportExcel(CoreCms.Net.Model.FromBody.FMArrayIntIds)">
|
||||
<summary>
|
||||
选择导出
|
||||
</summary>
|
||||
<param name="entity"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationParticipantsController.QueryExportExcel">
|
||||
<summary>
|
||||
查询导出
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:CoreCms.Net.Web.Admin.Controllers.SQReservationsController">
|
||||
<summary>
|
||||
预约表
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationsController.#ctor(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ISQReservationsServices,CoreCms.Net.IServices.ISQRoomsServices,CoreCms.Net.IServices.ISysDictionaryServices,CoreCms.Net.IServices.ISysDictionaryDataServices)">
|
||||
<member name="M:CoreCms.Net.Web.Admin.Controllers.SQReservationsController.#ctor(Microsoft.AspNetCore.Hosting.IWebHostEnvironment,CoreCms.Net.IServices.ISQReservationsServices,CoreCms.Net.IServices.ISQRoomsServices,CoreCms.Net.IServices.ISysDictionaryServices,CoreCms.Net.IServices.ISysDictionaryDataServices,CoreCms.Net.IServices.ISQReservationParticipantsServices,AutoMapper.IMapper,CoreCms.Net.IServices.ICoreCmsUserServices)">
|
||||
<summary>
|
||||
构造函数
|
||||
</summary>
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ using Microsoft.Extensions.DependencyInjection.Extensions;
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using Yitter.IdGenerator;
|
||||
using CoreCms.Net.Model.ViewModels.SQ;
|
||||
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
|
@ -49,7 +50,7 @@ builder.Services.AddCorsSetup();
|
|||
//添加session支持(session依赖于cache进行存储)
|
||||
builder.Services.AddSession();
|
||||
// AutoMapper支持
|
||||
builder.Services.AddAutoMapper(typeof(AutoMapperConfiguration));
|
||||
builder.Services.AddAutoMapper(typeof(AutoMapperConfiguration).Assembly, typeof(SQReservationParticipantsDto).Assembly);
|
||||
|
||||
//使用 SignalR
|
||||
builder.Services.AddSignalR();
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,88 @@
|
|||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-SQReservationParticipants-createForm" id="LAY-app-SQReservationParticipants-createForm">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="id" class="layui-form-label layui-form-required">参与记录ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入参与记录ID" lay-reqText="请输入参与记录ID并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="reservation_id" class="layui-form-label layui-form-required">预约ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="reservation_id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入预约ID" lay-reqText="请输入预约ID并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="user_id" class="layui-form-label layui-form-required">参与者ID(关联用户表,暂时占位)</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="user_id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入参与者ID(关联用户表,暂时占位)" lay-reqText="请输入参与者ID(关联用户表,暂时占位)并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="role" class="layui-form-label layui-form-required">角色:0=参与者,1=发起者</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="role" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入角色:0=参与者,1=发起者" lay-reqText="请输入角色:0=参与者,1=发起者并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="join_time" class="layui-form-label layui-form-required">加入时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="join_time" id="createTime-SQReservationParticipants-join_time" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入加入时间" lay-reqText="请输入加入时间" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="quit_time" class="layui-form-label layui-form-required">退出时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="quit_time" id="createTime-SQReservationParticipants-quit_time" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入退出时间" lay-reqText="请输入退出时间" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="status" class="layui-form-label layui-form-required">状态,0正常,1已退出</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入状态,0正常,1已退出" lay-reqText="请输入状态,0正常,1已退出并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-SQReservationParticipants-createForm-submit" id="LAY-app-SQReservationParticipants-createForm-submit" value="确认添加">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
var debug= layui.setter.debug;
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
|
||||
function () {
|
||||
var $ = layui.$
|
||||
, form = layui.form
|
||||
, admin = layui.admin
|
||||
, laydate = layui.laydate
|
||||
, upload = layui.upload
|
||||
, cropperImg = layui.cropperImg
|
||||
, coreHelper = layui.coreHelper;
|
||||
|
||||
laydate.render({
|
||||
elem: '#createTime-SQReservationParticipants-join_time',
|
||||
type: 'datetime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#createTime-SQReservationParticipants-quit_time',
|
||||
type: 'datetime'
|
||||
});
|
||||
form.verify({
|
||||
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-SQReservationParticipants-createForm');
|
||||
})
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<table class="layui-table layui-form" lay-filter="LAY-app-SQReservationParticipants-detailsForm" id="LAY-app-SQReservationParticipants-detailsForm">
|
||||
<colgroup>
|
||||
<col width="100">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="id">参与记录ID</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.id || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="reservation_id">预约ID</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.reservation_id || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="user_id">参与者ID(关联用户表,暂时占位)</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.user_id || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="role">角色:0=参与者,1=发起者</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.role || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="join_time">加入时间</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.join_time || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="quit_time">退出时间</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.quit_time || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="status">状态,0正常,1已退出</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.status || '' }}
|
||||
</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-SQReservationParticipants-detailsForm');
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<script type="text/html" template lay-done="layui.data.sendParams(d);">
|
||||
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-SQReservationParticipants-editForm" id="LAY-app-SQReservationParticipants-editForm">
|
||||
<input type="hidden" name="id" value="{{d.params.data.id || '' }}" />
|
||||
<div class="layui-form-item">
|
||||
<label for="id" class="layui-form-label layui-form-required">参与记录ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.id || '' }}" placeholder="请输入参与记录ID" lay-reqText="请输入参与记录ID并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="reservation_id" class="layui-form-label layui-form-required">预约ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="reservation_id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.reservation_id || '' }}" placeholder="请输入预约ID" lay-reqText="请输入预约ID并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="user_id" class="layui-form-label layui-form-required">参与者ID(关联用户表,暂时占位)</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="user_id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.user_id || '' }}" placeholder="请输入参与者ID(关联用户表,暂时占位)" lay-reqText="请输入参与者ID(关联用户表,暂时占位)并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="role" class="layui-form-label layui-form-required">角色:0=参与者,1=发起者</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="role" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.role || '' }}" placeholder="请输入角色:0=参与者,1=发起者" lay-reqText="请输入角色:0=参与者,1=发起者并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="join_time" class="layui-form-label layui-form-required">加入时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="join_time" id="editTime-SQReservationParticipants-join_time" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入加入时间" lay-reqText="请输入加入时间" value="{{d.params.data.join_time || '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="quit_time" class="layui-form-label layui-form-required">退出时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="quit_time" id="editTime-SQReservationParticipants-quit_time" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入退出时间" lay-reqText="请输入退出时间" value="{{d.params.data.quit_time || '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="status" class="layui-form-label layui-form-required">状态,0正常,1已退出</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.status || '' }}" placeholder="请输入状态,0正常,1已退出" lay-reqText="请输入状态,0正常,1已退出并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-SQReservationParticipants-editForm-submit" id="LAY-app-SQReservationParticipants-editForm-submit" value="确认编辑">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
var debug= layui.setter.debug;
|
||||
layui.data.sendParams = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
|
||||
function () {
|
||||
var $ = layui.$
|
||||
, form = layui.form
|
||||
, admin = layui.admin
|
||||
, laydate = layui.laydate
|
||||
, upload = layui.upload
|
||||
, cropperImg = layui.cropperImg
|
||||
, coreHelper = layui.coreHelper;
|
||||
|
||||
laydate.render({
|
||||
elem: '#editTime-SQReservationParticipants-join_time',
|
||||
type: 'datetime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#editTime-SQReservationParticipants-quit_time',
|
||||
type: 'datetime'
|
||||
});
|
||||
form.verify({
|
||||
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-SQReservationParticipants-editForm');
|
||||
})
|
||||
};
|
||||
</script>
|
||||
|
|
@ -0,0 +1,419 @@
|
|||
<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="Api/SQReservationParticipants/GetIndex" lay-done="layui.data.done(d);">
|
||||
|
||||
</script>
|
||||
<div class="table-body">
|
||||
<table id="LAY-app-SQReservationParticipants-tableBox" lay-filter="LAY-app-SQReservationParticipants-tableBox"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="LAY-app-SQReservationParticipants-toolbar">
|
||||
<div class="layui-form coreshop-toolbar-search-form">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="user_id">用户Id</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="user_id" placeholder="用户id" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="user_name">用户昵称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="user_name" placeholder="用户昵称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="reservation_id">预约ID</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="reservation_id" placeholder="请输入预约ID" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="role">角色</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="role" lay-search>
|
||||
<option value="">请选择角色</option>
|
||||
<option value="0">参与者</option>
|
||||
<option value="1">发起者</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="join_time">加入时间</label>
|
||||
<div class="layui-input-inline" style="width: 260px;">
|
||||
<input type="text" name="join_time" id="searchTime-SQReservationParticipants-join_time" placeholder="请输入加入时间" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="quit_time">退出时间</label>
|
||||
<div class="layui-input-inline" style="width: 260px;">
|
||||
<input type="text" name="quit_time" id="searchTime-SQReservationParticipants-quit_time" placeholder="请输入退出时间" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="status">状态</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="status" lay-search>
|
||||
<option value="">请选择状态</option>
|
||||
<option value="0">正常</option>
|
||||
<option value="1">已退出</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-SQReservationParticipants-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="LAY-app-SQReservationParticipants-pagebar">
|
||||
<div class="layui-btn-container">
|
||||
<!-- <button class="layui-btn layui-btn-sm" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i>添加数据</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="batchDelete"><i class="layui-icon layui-icon-delete"></i>批量删除</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="selectExportExcel"><i class="layui-icon layui-icon-add-circle"></i>选择导出</button>
|
||||
<button class="layui-btn layui-btn-sm" lay-event="queryExportExcel"><i class="layui-icon layui-icon-download-circle"></i>查询导出</button> -->
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="LAY-app-SQReservationParticipants-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="#SQReservationParticipantsTbDelDrop{{d.LAY_INDEX}}" no-shade="true">删除</a>
|
||||
<div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="SQReservationParticipantsTbDelDrop{{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;
|
||||
|
||||
var searchwhere;
|
||||
//监听搜索
|
||||
form.on('submit(LAY-app-SQReservationParticipants-search)',
|
||||
function(data) {
|
||||
var field = data.field;
|
||||
searchwhere = field;
|
||||
//执行重载
|
||||
table.reloadData('LAY-app-SQReservationParticipants-tableBox',{ where: field });
|
||||
});
|
||||
//数据绑定
|
||||
table.render({
|
||||
elem: '#LAY-app-SQReservationParticipants-tableBox',
|
||||
url: layui.setter.apiUrl + 'Api/SQReservationParticipants/GetPageList',
|
||||
method: 'POST',
|
||||
toolbar: '#LAY-app-SQReservationParticipants-toolbar',
|
||||
pagebar: '#LAY-app-SQReservationParticipants-pagebar',
|
||||
className: 'pagebarbox',
|
||||
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: 'ID', width: 60, sort: false},
|
||||
{ field: 'reservation_id', title: '预约ID', sort: false,width: 105 },
|
||||
{ field: 'reservationName', title: '组局名称', sort: false,width: 205 },
|
||||
{ field: 'user_id', title: '用户Id', sort: false,width: 105 },
|
||||
{ field: 'userName', title: '用户昵称', sort: false,width: 205 },
|
||||
{ field: 'role', title: '角色', sort: false, width: 105, templet: function(d){
|
||||
if(d.role == 0) return '<span class="layui-badge layui-bg-blue">参与者</span>';
|
||||
if(d.role == 1) return '<span class="layui-badge layui-bg-orange">发起者</span>';
|
||||
return d.role;
|
||||
}},
|
||||
{ field: 'join_time', title: '加入时间', width: 130, sort: false},
|
||||
{ field: 'quit_time', title: '退出时间', width: 130, sort: false},
|
||||
{ field: 'status', title: '状态', sort: false, width: 105, templet: function(d){
|
||||
if(d.status == 0) return '<span class="layui-badge layui-bg-green">正常</span>';
|
||||
if(d.status == 1) return '<span class="layui-badge layui-bg-gray">已退出</span>';
|
||||
return d.status;
|
||||
}},
|
||||
// { width: 162, align: 'center', title:'操作', fixed: 'right', toolbar: '#LAY-app-SQReservationParticipants-tableBox-bar' }
|
||||
]
|
||||
]
|
||||
});
|
||||
//监听排序事件
|
||||
table.on('sort(LAY-app-SQReservationParticipants-tableBox)', function(obj){
|
||||
table.reloadData('LAY-app-SQReservationParticipants-tableBox', {
|
||||
initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
|
||||
where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
||||
orderField: obj.field, //排序字段
|
||||
orderDirection: obj.type //排序方式
|
||||
}
|
||||
});
|
||||
});
|
||||
//监听行双击事件
|
||||
table.on('rowDouble(LAY-app-SQReservationParticipants-tableBox)', function (obj) {
|
||||
//查看详情
|
||||
|
||||
doDetails(obj);
|
||||
});
|
||||
//头工具栏事件
|
||||
table.on('pagebar(LAY-app-SQReservationParticipants-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-SQReservationParticipants-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/SQReservationParticipants/GetCreate", null, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '创建数据',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationParticipants-create',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQReservationParticipants/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservationParticipants-createForm-submit)',
|
||||
function(data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
|
||||
if (debug) { console.log(field); } //开启调试返回数据
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
coreHelper.Post("Api/SQReservationParticipants/DoCreate", field, function (e) {
|
||||
console.log(e)
|
||||
if (e.code === 0) {
|
||||
layui.table.reloadData('LAY-app-SQReservationParticipants-tableBox'); //重载表格
|
||||
layer.close(index); //再执行关闭
|
||||
layer.msg(e.msg);
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||
}
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
layero.contents().find("#LAY-app-SQReservationParticipants-createForm-submit").click();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行编辑操作
|
||||
function doEdit(obj){
|
||||
coreHelper.Post("Api/SQReservationParticipants/GetEdit", {id:obj.data.id}, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '编辑数据',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationParticipants-edit',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQReservationParticipants/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservationParticipants-editForm-submit)',
|
||||
function(data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
|
||||
|
||||
if (debug) { console.log(field); } //开启调试返回数据
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
coreHelper.Post("Api/SQReservationParticipants/DoEdit", field, function (e) {
|
||||
console.log(e)
|
||||
if (e.code === 0) {
|
||||
layui.table.reloadData('LAY-app-SQReservationParticipants-tableBox'); //重载表格
|
||||
layer.close(index); //再执行关闭
|
||||
layer.msg(e.msg);
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
// 禁止弹窗出现滚动条
|
||||
$(layero).children('.layui-layer-content').css('overflow', 'visible');
|
||||
}
|
||||
, btn: ['确定', '取消']
|
||||
, yes: function (index, layero) {
|
||||
layero.contents().find("#LAY-app-SQReservationParticipants-editForm-submit").click();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.msg(e.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行预览操作
|
||||
function doDetails(obj) {
|
||||
return;
|
||||
coreHelper.Post("Api/SQReservationParticipants/GetDetails", { id: obj.data.id }, function (e) {
|
||||
if (e.code === 0) {
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '查看详情',
|
||||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationParticipants-details',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQReservationParticipants/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/SQReservationParticipants/DoDelete", { id: obj.data.id }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
table.reloadData('LAY-app-SQReservationParticipants-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/SQReservationParticipants/DoBatchDelete", { id: delidsStr }, function (e) {
|
||||
if (debug) { console.log(e); } //开启调试返回数据
|
||||
table.reloadData('LAY-app-SQReservationParticipants-tableBox');
|
||||
layer.msg(e.msg);
|
||||
});
|
||||
});
|
||||
}
|
||||
//执行查询条件导出excel
|
||||
function doQueryExportexcel(){
|
||||
layer.confirm('确定根据当前的查询条件导出数据吗?',
|
||||
function(index) {
|
||||
var field = searchwhere;
|
||||
coreHelper.PostForm("Api/SQReservationParticipants/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/SQReservationParticipants/SelectExportExcel", { 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-SQReservationParticipants-join_time',
|
||||
type: 'datetime',
|
||||
fullPanel: true,
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#searchTime-SQReservationParticipants-quit_time',
|
||||
type: 'datetime',
|
||||
fullPanel: true,
|
||||
});
|
||||
|
||||
//监听 表格复选框操作
|
||||
|
||||
|
||||
//重载form
|
||||
form.render();
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="start_time" class="layui-form-label layui-form-required">开始时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="start_time" id="createTime-SQReservations-start_time" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入开始时间" lay-reqText="请输入开始时间" />
|
||||
<input name="start_time" id="createTime-SQReservations-start_time" type="text" lay-verType="tips" lay-verify="required|datetime|startTime" class="layui-input" placeholder="请输入开始时间" lay-reqText="请输入开始时间" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="end_time" class="layui-form-label layui-form-required">结束时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="end_time" id="createTime-SQReservations-end_time" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入结束时间" lay-reqText="请输入结束时间" />
|
||||
<input name="end_time" id="createTime-SQReservations-end_time" type="text" lay-verType="tips" lay-verify="required|datetime|endTime" class="layui-input" placeholder="请输入结束时间" lay-reqText="请输入结束时间" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -57,7 +57,12 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="player_count" class="layui-form-label layui-form-required">人数</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="player_count" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入人数" lay-reqText="请输入人数并为数字" />
|
||||
<select name="player_count" lay-verType="tips" lay-verify="required" lay-reqText="请选择人数">
|
||||
<option value="1">1人</option>
|
||||
<option value="2">2人</option>
|
||||
<option value="3">3人</option>
|
||||
<option value="4">4人</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -91,7 +96,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="extra_info" class="layui-form-label layui-form-required">其他补充</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="extra_info" lay-verType="tips" lay-verify="required|verifyextra_info" class="layui-input" lay-reqText="请输入其他补充" placeholder="请输入其他补充"/>
|
||||
<input name="extra_info" lay-verType="tips" lay-verify="verifyextra_info" class="layui-input" lay-reqText="请输入其他补充" placeholder="请输入其他补充"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -99,7 +104,9 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="is_smoking" class="layui-form-label layui-form-required">是否禁烟</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="is_smoking" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="0=不限制,1=禁烟,2=不禁烟" lay-reqText="请输入是否禁烟:0=不限制,1=禁烟,2=不禁烟并为数字" />
|
||||
<input type="radio" name="is_smoking" value="0" title="不限制" checked>
|
||||
<input type="radio" name="is_smoking" value="1" title="禁烟">
|
||||
<input type="radio" name="is_smoking" value="2" title="不禁烟">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -110,7 +117,9 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="gender_limit" class="layui-form-label layui-form-required">性别限制</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="gender_limit" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="0=不限,1=男,2=女" lay-reqText="请输入性别限制:0=不限,1=男,2=女并为数字" />
|
||||
<input type="radio" name="gender_limit" value="0" title="不限性别" checked>
|
||||
<input type="radio" name="gender_limit" value="1" title="男">
|
||||
<input type="radio" name="gender_limit" value="2" title="女">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -118,7 +127,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="credit_limit" class="layui-form-label layui-form-required">最低信誉分</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="credit_limit" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入最低信誉分" lay-reqText="请输入最低信誉分" />
|
||||
<input name="credit_limit" lay-verType="tips" lay-verify="required" class="layui-input" value="0" placeholder="请输入最低信誉分" lay-reqText="请输入最低信誉分" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -129,7 +138,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="min_age" class="layui-form-label layui-form-required">最小年龄限制</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="min_age" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入最小年龄限制" lay-reqText="请输入最小年龄限制并为数字" />
|
||||
<input type="number" min="0" max="100" name="min_age" lay-verType="tips" lay-verify="required|number|minAge" class="layui-input" value="0" placeholder="请输入最小年龄限制" lay-reqText="请输入最小年龄限制并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -137,7 +146,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="max_age" class="layui-form-label layui-form-required">最大年龄限制</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="max_age" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="0=不限" lay-reqText="请输入最大年龄限制,0=不限并为数字" />
|
||||
<input type="number" min="0" max="100" name="max_age" lay-verType="tips" lay-verify="required|number|maxAge" class="layui-input" value="0" placeholder="0=不限" lay-reqText="请输入最大年龄限制,0=不限并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -148,7 +157,9 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="deposit_fee" class="layui-form-label layui-form-required">鸽子费</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="deposit_fee" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入鸽子费(保证金)" lay-reqText="请输入鸽子费(保证金)" />
|
||||
<input type="radio" name="deposit_fee" value="0" title="0元" checked>
|
||||
<input type="radio" name="deposit_fee" value="5" title="5元" disabled>
|
||||
<input type="radio" name="deposit_fee" value="10" title="10元" disabled>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -156,26 +167,12 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="status" class="layui-form-label layui-form-required">状态</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="1" placeholder="0=待开始,1=进行中,2=已结束,3=取消" lay-reqText="请输入状态:0=待开始,1=进行中,2=已结束,3=取消并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="created_at" class="layui-form-label layui-form-required">创建时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="created_at" id="createTime-SQReservations-created_at" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入创建时间" lay-reqText="请输入创建时间" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="updated_at" class="layui-form-label layui-form-required">更新时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="updated_at" id="createTime-SQReservations-updated_at" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入更新时间" lay-reqText="请输入更新时间" />
|
||||
<select name="status" lay-verType="tips" lay-verify="required" lay-reqText="请选择状态">
|
||||
<option value="0">待开始</option>
|
||||
<option value="1">进行中</option>
|
||||
<option value="2">已结束</option>
|
||||
<option value="3">已取消</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -228,7 +225,7 @@
|
|||
if (Array.isArray(dicOptions) && dicOptions.length) {
|
||||
dicOptions.forEach(function (gameType) {
|
||||
if (gameType && (gameType.id !== undefined) && gameType.name) {
|
||||
$gameTypeSelect.append('<option value="' + gameType.id + '">' + gameType.name + '</option>');
|
||||
$gameTypeSelect.append('<option value="' + gameType.name + '">' + gameType.name + '</option>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -241,7 +238,7 @@
|
|||
if (selectedId) {
|
||||
var parent = null;
|
||||
for (var i = 0; i < (dicOptions || []).length; i++) {
|
||||
if (String(dicOptions[i].id) === String(selectedId)) {
|
||||
if (String(dicOptions[i].name) === String(selectedId)) {
|
||||
parent = dicOptions[i];
|
||||
break;
|
||||
}
|
||||
|
|
@ -249,7 +246,7 @@
|
|||
if (parent && Array.isArray(parent.children) && parent.children.length) {
|
||||
parent.children.forEach(function (rule) {
|
||||
if (rule && (rule.id !== undefined) && rule.name) {
|
||||
$gameRuleSelect.append('<option value="' + rule.id + '">' + rule.name + '</option>');
|
||||
$gameRuleSelect.append('<option value="' + rule.name + '">' + rule.name + '</option>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -261,25 +258,31 @@
|
|||
laydate.render({
|
||||
elem: '#createTime-SQReservations-start_time',
|
||||
type: 'datetime',
|
||||
fullPanel: true,
|
||||
min: new Date().getTime()-1000, // 开始时间不能小于当前时间
|
||||
done: function(value, date) {
|
||||
calculateDuration();
|
||||
// 更新结束时间的最小值
|
||||
var startTime = new Date(value);
|
||||
laydate.render({
|
||||
elem: '#createTime-SQReservations-end_time',
|
||||
type: 'datetime',
|
||||
min: startTime.getTime(),
|
||||
done: function(endValue, endDate) {
|
||||
calculateDuration();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#createTime-SQReservations-end_time',
|
||||
type: 'datetime',
|
||||
fullPanel: true,
|
||||
min: new Date().getTime()-1000, // 结束时间不能小于当前时间
|
||||
done: function(value, date) {
|
||||
calculateDuration();
|
||||
}
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#createTime-SQReservations-created_at',
|
||||
type: 'datetime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#createTime-SQReservations-updated_at',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
// 计算时长函数
|
||||
function calculateDuration() {
|
||||
|
|
@ -306,8 +309,53 @@
|
|||
verifygame_type: [/^.{0,50}$/,'玩法类型最大只允许输入50位字符'],
|
||||
verifygame_rule: [/^.{0,50}$/,'具体规则最大只允许输入50位字符'],
|
||||
verifyextra_info: [/^.{0,255}$/,'其他补充最大只允许输入255位字符'],
|
||||
minAge: function(value) {
|
||||
if (value != 0 && value < 18) {
|
||||
return '最小年龄不能小于18岁';
|
||||
}
|
||||
},
|
||||
maxAge: function(value) {
|
||||
if (value > 100) {
|
||||
return '最大年龄不能超过100岁';
|
||||
}
|
||||
},
|
||||
startTime: function(value) {
|
||||
if (value) {
|
||||
var startTime = new Date(value);
|
||||
var now = new Date();
|
||||
// if (startTime < now) {
|
||||
// return '开始时间不能小于当前时间';
|
||||
// }
|
||||
}
|
||||
},
|
||||
endTime: function(value) {
|
||||
if (value) {
|
||||
var endTime = new Date(value);
|
||||
var startTime = new Date($('#createTime-SQReservations-start_time').val());
|
||||
if (endTime <= startTime) {
|
||||
return '结束时间必须大于开始时间';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 监听鸽子费选择
|
||||
form.on('radio', function(data) {
|
||||
if (data.elem.name === 'deposit_fee') {
|
||||
var depositValue = data.value;
|
||||
var $depositRadios = $('input[name="deposit_fee"]');
|
||||
|
||||
if (depositValue === '0') {
|
||||
// 如果选择0元,禁用其他选项
|
||||
$depositRadios.not('[value="0"]').prop('disabled', true);
|
||||
} else {
|
||||
// 如果选择其他金额,启用所有选项
|
||||
$depositRadios.prop('disabled', false);
|
||||
}
|
||||
form.render('radio');
|
||||
}
|
||||
});
|
||||
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-SQReservations-createForm');
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,193 +1,196 @@
|
|||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<table class="layui-table layui-form" lay-filter="LAY-app-SQReservations-detailsForm" id="LAY-app-SQReservations-detailsForm">
|
||||
<colgroup>
|
||||
<col width="100">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="id">预约ID</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.id || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="title">组局名称</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.title || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="room_id">房间ID</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.room_id || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="room_name">房间名称(冗余存储,比如 304号-大包,30元/小时)</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.room_name || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="start_time">开始时间</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.start_time || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="end_time">结束时间</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.end_time || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="duration_minutes">时长(分钟)</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.duration_minutes || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="player_count">人数</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.player_count || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="game_type">玩法类型(如:补克)</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.game_type || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="game_rule">具体规则(如:斗地主)</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.game_rule || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="extra_info">其他补充</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.extra_info || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="is_smoking">是否禁烟:0=不限制,1=禁烟,2=不禁烟</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.is_smoking || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="gender_limit">性别限制:0=不限,1=男,2=女</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.gender_limit || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="credit_limit">最低信誉分</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.credit_limit || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="min_age">最小年龄限制</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.min_age || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="max_age">最大年龄限制,0=不限</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.max_age || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="deposit_fee">鸽子费(保证金)</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.deposit_fee || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="status">状态:0=待开始,1=进行中,2=已结束,3=取消</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.status || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="created_at">创建时间</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.created_at || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<label for="updated_at">更新时间</label>
|
||||
</td>
|
||||
<td>
|
||||
{{ d.params.data.updated_at || '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-SQReservations-detailsForm" id="LAY-app-SQReservations-detailsForm" style="overflow: auto;height: 100%;">
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="title" class="layui-form-label">组局名称</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.title || '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="room_name" class="layui-form-label">房间</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.room_name || '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="start_time" class="layui-form-label">开始时间</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.start_time || '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="end_time" class="layui-form-label">结束时间</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.end_time || '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="duration_minutes" class="layui-form-label">时长(分钟)</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.duration_minutes || 0 }} 分钟</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="player_count" class="layui-form-label">人数</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.player_count || '' }} 人</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="game_type" class="layui-form-label">玩法类型</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid" id="details-game-type">{{ d.params.data.game_type || '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="game_rule" class="layui-form-label">具体规则</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid" id="details-game-rule">{{ d.params.data.game_rule || '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="extra_info" class="layui-form-label">其他补充</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.extra_info || '' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="is_smoking" class="layui-form-label">是否禁烟</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">
|
||||
{{# if(d.params.data.is_smoking == '0') { }}
|
||||
不限制
|
||||
{{# } else if(d.params.data.is_smoking == '1') { }}
|
||||
禁烟
|
||||
{{# } else if(d.params.data.is_smoking == '2') { }}
|
||||
不禁烟
|
||||
{{# } else { }}
|
||||
{{ d.params.data.is_smoking || '' }}
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="gender_limit" class="layui-form-label">性别限制</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">
|
||||
{{# if(d.params.data.gender_limit == '0') { }}
|
||||
不限性别
|
||||
{{# } else if(d.params.data.gender_limit == '1') { }}
|
||||
男
|
||||
{{# } else if(d.params.data.gender_limit == '2') { }}
|
||||
女
|
||||
{{# } else { }}
|
||||
{{ d.params.data.gender_limit || '' }}
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="credit_limit" class="layui-form-label">最低信誉分</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.credit_limit || 0 }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="min_age" class="layui-form-label">最小年龄限制</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.min_age || 0 }} 岁</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="max_age" class="layui-form-label">最大年龄限制</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">
|
||||
{{# if(d.params.data.max_age == '0') { }}
|
||||
不限
|
||||
{{# } else { }}
|
||||
{{ d.params.data.max_age || 0 }} 岁
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="deposit_fee" class="layui-form-label">鸽子费</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">{{ d.params.data.deposit_fee || 0 }} 元</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="status" class="layui-form-label">状态</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-form-mid">
|
||||
{{# if(d.params.data.status == '0') { }}
|
||||
待开始
|
||||
{{# } else if(d.params.data.status == '1') { }}
|
||||
进行中
|
||||
{{# } else if(d.params.data.status == '2') { }}
|
||||
已结束
|
||||
{{# } else if(d.params.data.status == '3') { }}
|
||||
已取消
|
||||
{{# } else { }}
|
||||
{{ d.params.data.status || '' }}
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
var debug= layui.setter.debug;
|
||||
|
|
@ -201,6 +204,33 @@
|
|||
, admin = layui.admin
|
||||
, coreHelper = layui.coreHelper
|
||||
, form = layui.form;
|
||||
|
||||
// 获取数据源
|
||||
var dicOptions = d.params.data.dicOptions || [];
|
||||
var detailsData = d.params.data;
|
||||
|
||||
// 动态显示玩法类型和具体规则名称
|
||||
if (detailsData.game_type && Array.isArray(dicOptions)) {
|
||||
for (var i = 0; i < dicOptions.length; i++) {
|
||||
if (String(dicOptions[i].id) === String(detailsData.game_type)) {
|
||||
var gameTypeName = dicOptions[i].name || '';
|
||||
$('#details-game-type').text(gameTypeName);
|
||||
|
||||
// 查找具体规则名称
|
||||
if (detailsData.game_rule && Array.isArray(dicOptions[i].children)) {
|
||||
for (var j = 0; j < dicOptions[i].children.length; j++) {
|
||||
if (String(dicOptions[i].children[j].id) === String(detailsData.game_rule)) {
|
||||
var gameRuleName = dicOptions[i].children[j].name || '';
|
||||
$('#details-game-rule').text(gameRuleName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
form.render(null, 'LAY-app-SQReservations-detailsForm');
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,154 +1,191 @@
|
|||
<script type="text/html" template lay-done="layui.data.sendParams(d);">
|
||||
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-SQReservations-editForm" id="LAY-app-SQReservations-editForm">
|
||||
<input type="hidden" name="id" value="{{d.params.data.id || '' }}" />
|
||||
<div class="layui-form-item">
|
||||
<label for="id" class="layui-form-label layui-form-required">预约ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.id || '' }}" placeholder="请输入预约ID" lay-reqText="请输入预约ID并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="title" class="layui-form-label layui-form-required">组局名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="title" lay-verType="tips" lay-verify="required|verifytitle" class="layui-input" placeholder="请输入组局名称" lay-reqText="请输入组局名称" value="{{d.params.data.title || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="room_id" class="layui-form-label layui-form-required">房间ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="room_id" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.room_id || '' }}" placeholder="请输入房间ID" lay-reqText="请输入房间ID并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="room_name" class="layui-form-label layui-form-required">房间名称(冗余存储,比如 304号-大包,30元/小时)</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="room_name" lay-verType="tips" lay-verify="required|verifyroom_name" class="layui-input" placeholder="请输入房间名称(冗余存储,比如 304号-大包,30元/小时)" lay-reqText="请输入房间名称(冗余存储,比如 304号-大包,30元/小时)" value="{{d.params.data.room_name || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="start_time" class="layui-form-label layui-form-required">开始时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="start_time" id="editTime-SQReservations-start_time" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入开始时间" lay-reqText="请输入开始时间" value="{{d.params.data.start_time || '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="end_time" class="layui-form-label layui-form-required">结束时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="end_time" id="editTime-SQReservations-end_time" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入结束时间" lay-reqText="请输入结束时间" value="{{d.params.data.end_time || '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="duration_minutes" class="layui-form-label layui-form-required">时长(分钟)</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="duration_minutes" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.duration_minutes || '' }}" placeholder="请输入时长(分钟)" lay-reqText="请输入时长(分钟)并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="player_count" class="layui-form-label layui-form-required">人数</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="player_count" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.player_count || '' }}" placeholder="请输入人数" lay-reqText="请输入人数并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="game_type" class="layui-form-label layui-form-required">玩法类型(如:补克)</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="game_type" lay-verType="tips" lay-verify="required|verifygame_type" class="layui-input" placeholder="请输入玩法类型(如:补克)" lay-reqText="请输入玩法类型(如:补克)" value="{{d.params.data.game_type || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="game_rule" class="layui-form-label layui-form-required">具体规则(如:斗地主)</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="game_rule" lay-verType="tips" lay-verify="required|verifygame_rule" class="layui-input" placeholder="请输入具体规则(如:斗地主)" lay-reqText="请输入具体规则(如:斗地主)" value="{{d.params.data.game_rule || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="extra_info" class="layui-form-label layui-form-required">其他补充</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="extra_info" lay-verType="tips" lay-verify="required|verifyextra_info" class="layui-input" placeholder="请输入其他补充" lay-reqText="请输入其他补充" value="{{d.params.data.extra_info || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="is_smoking" class="layui-form-label layui-form-required">是否禁烟:0=不限制,1=禁烟,2=不禁烟</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="is_smoking" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.is_smoking || '' }}" placeholder="请输入是否禁烟:0=不限制,1=禁烟,2=不禁烟" lay-reqText="请输入是否禁烟:0=不限制,1=禁烟,2=不禁烟并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="gender_limit" class="layui-form-label layui-form-required">性别限制:0=不限,1=男,2=女</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="gender_limit" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.gender_limit || '' }}" placeholder="请输入性别限制:0=不限,1=男,2=女" lay-reqText="请输入性别限制:0=不限,1=男,2=女并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="credit_limit" class="layui-form-label layui-form-required">最低信誉分</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="credit_limit" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入最低信誉分" lay-reqText="请输入最低信誉分" value="{{d.params.data.credit_limit || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="min_age" class="layui-form-label layui-form-required">最小年龄限制</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="min_age" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.min_age || '' }}" placeholder="请输入最小年龄限制" lay-reqText="请输入最小年龄限制并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="max_age" class="layui-form-label layui-form-required">最大年龄限制,0=不限</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="max_age" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.max_age || '' }}" placeholder="请输入最大年龄限制,0=不限" lay-reqText="请输入最大年龄限制,0=不限并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="deposit_fee" class="layui-form-label layui-form-required">鸽子费(保证金)</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="deposit_fee" lay-verType="tips" lay-verify="required" class="layui-input" placeholder="请输入鸽子费(保证金)" lay-reqText="请输入鸽子费(保证金)" value="{{d.params.data.deposit_fee || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="status" class="layui-form-label layui-form-required">状态:0=待开始,1=进行中,2=已结束,3=取消</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="status" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.status || '' }}" placeholder="请输入状态:0=待开始,1=进行中,2=已结束,3=取消" lay-reqText="请输入状态:0=待开始,1=进行中,2=已结束,3=取消并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="created_at" class="layui-form-label layui-form-required">创建时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="created_at" id="editTime-SQReservations-created_at" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入创建时间" lay-reqText="请输入创建时间" value="{{d.params.data.created_at || '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label for="updated_at" class="layui-form-label layui-form-required">更新时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="updated_at" id="editTime-SQReservations-updated_at" type="text" lay-verType="tips" lay-verify="required|datetime" class="layui-input" placeholder="请输入更新时间" lay-reqText="请输入更新时间" value="{{d.params.data.updated_at || '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-SQReservations-editForm-submit" id="LAY-app-SQReservations-editForm-submit" value="确认编辑">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/html" template lay-done="layui.data.done(d);">
|
||||
<div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-SQReservations-editForm" id="LAY-app-SQReservations-editForm" style="overflow: auto;height: 100%;">
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="title" class="layui-form-label layui-form-required">组局名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="title" lay-verType="tips" lay-verify="required|verifytitle" class="layui-input" lay-reqText="请输入组局名称" placeholder="请输入组局名称" value="{{d.params.data.title || '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="room_id" class="layui-form-label layui-form-required">房间</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="room_id" id="edit-SQReservations-room_id" lay-verType="tips" lay-verify="required" lay-reqText="请选择房间" lay-filter="edit-room-select">
|
||||
<option value="">请选择房间</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 隐藏的房间名称字段,用于自动填充 -->
|
||||
<input type="hidden" name="room_name" id="edit-SQReservations-room_name" value="{{d.params.data.room_name || '' }}" />
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="start_time" class="layui-form-label layui-form-required">开始时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="start_time" id="editTime-SQReservations-start_time" type="text" lay-verType="tips" lay-verify="required|datetime|startTime" class="layui-input" placeholder="请输入开始时间" lay-reqText="请输入开始时间" value="{{d.params.data.start_time || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="end_time" class="layui-form-label layui-form-required">结束时间</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="end_time" id="editTime-SQReservations-end_time" type="text" lay-verType="tips" lay-verify="required|datetime|endTime" class="layui-input" placeholder="请输入结束时间" lay-reqText="请输入结束时间" value="{{d.params.data.end_time || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="duration_minutes" class="layui-form-label layui-form-required">时长(分钟)</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="999999" name="duration_minutes" id="edit-SQReservations-duration_minutes" lay-verType="tips" lay-verify="required|number" class="layui-input" value="{{d.params.data.duration_minutes || 0}}" placeholder="自动计算" lay-reqText="请输入时长(分钟)并为数字" readonly />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="player_count" class="layui-form-label layui-form-required">人数</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="player_count" lay-verType="tips" lay-verify="required" lay-reqText="请选择人数">
|
||||
<option value="1" {{d.params.data.player_count == '1' ? 'selected' : ''}}>1人</option>
|
||||
<option value="2" {{d.params.data.player_count == '2' ? 'selected' : ''}}>2人</option>
|
||||
<option value="3" {{d.params.data.player_count == '3' ? 'selected' : ''}}>3人</option>
|
||||
<option value="4" {{d.params.data.player_count == '4' ? 'selected' : ''}}>4人</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="game_type" class="layui-form-label layui-form-required">玩法类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="game_type" id="edit-SQReservations-game_type" lay-verType="tips" lay-verify="required" lay-reqText="请选择玩法类型" lay-filter="edit-game-type-select">
|
||||
<option value="">请选择玩法类型</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="game_rule" class="layui-form-label layui-form-required">具体规则</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="game_rule" id="edit-SQReservations-game_rule" lay-verType="tips" lay-verify="required" lay-reqText="请选择具体规则" lay-filter="edit-game-rule-select">
|
||||
<option value="">请选择具体规则</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="extra_info" class="layui-form-label layui-form-required">其他补充</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="extra_info" lay-verType="tips" lay-verify="verifyextra_info" class="layui-input" lay-reqText="请输入其他补充" placeholder="请输入其他补充" value="{{d.params.data.extra_info || '' }}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="is_smoking" class="layui-form-label layui-form-required">是否禁烟</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="is_smoking" value="0" title="不限制" {{d.params.data.is_smoking == '0' ? 'checked' : ''}}>
|
||||
<input type="radio" name="is_smoking" value="1" title="禁烟" {{d.params.data.is_smoking == '1' ? 'checked' : ''}}>
|
||||
<input type="radio" name="is_smoking" value="2" title="不禁烟" {{d.params.data.is_smoking == '2' ? 'checked' : ''}}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="gender_limit" class="layui-form-label layui-form-required">性别限制</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="gender_limit" value="0" title="不限性别" {{d.params.data.gender_limit == '0' ? 'checked' : ''}}>
|
||||
<input type="radio" name="gender_limit" value="1" title="男" {{d.params.data.gender_limit == '1' ? 'checked' : ''}}>
|
||||
<input type="radio" name="gender_limit" value="2" title="女" {{d.params.data.gender_limit == '2' ? 'checked' : ''}}>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="credit_limit" class="layui-form-label layui-form-required">最低信誉分</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="credit_limit" lay-verType="tips" lay-verify="required" class="layui-input" value="{{d.params.data.credit_limit || 0}}" placeholder="请输入最低信誉分" lay-reqText="请输入最低信誉分" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="min_age" class="layui-form-label layui-form-required">最小年龄限制</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="100" name="min_age" lay-verType="tips" lay-verify="required|number|minAge" class="layui-input" value="{{d.params.data.min_age || 0}}" placeholder="请输入最小年龄限制" lay-reqText="请输入最小年龄限制并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="max_age" class="layui-form-label layui-form-required">最大年龄限制</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" min="0" max="100" name="max_age" lay-verType="tips" lay-verify="required|number|maxAge" class="layui-input" value="{{d.params.data.max_age || 0}}" placeholder="0=不限" lay-reqText="请输入最大年龄限制,0=不限并为数字" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="deposit_fee" class="layui-form-label layui-form-required">鸽子费</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="deposit_fee" value="0" title="0元" {{d.params.data.deposit_fee == '0' ? 'checked' : ''}}>
|
||||
<input type="radio" name="deposit_fee" value="5" title="5元" {{d.params.data.deposit_fee == '5' ? 'checked' : ''}} disabled>
|
||||
<input type="radio" name="deposit_fee" value="10" title="10元" {{d.params.data.deposit_fee == '10' ? 'checked' : ''}} disabled>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label for="status" class="layui-form-label layui-form-required">状态</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="status" lay-verType="tips" lay-verify="required" lay-reqText="请选择状态">
|
||||
<option value="0" {{d.params.data.status == '0' ? 'selected' : ''}}>待开始</option>
|
||||
<option value="1" {{d.params.data.status == '1' ? 'selected' : ''}}>进行中</option>
|
||||
<option value="2" {{d.params.data.status == '2' ? 'selected' : ''}}>已结束</option>
|
||||
<option value="3" {{d.params.data.status == '3' ? 'selected' : ''}}>已取消</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="id" value="{{d.params.data.id || '' }}" />
|
||||
<div class="layui-form-item text-right core-hidden">
|
||||
<input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-SQReservations-editForm-submit" id="LAY-app-SQReservations-editForm-submit" value="确认编辑">
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
var debug= layui.setter.debug;
|
||||
layui.data.sendParams = function (d) {
|
||||
layui.data.done = function (d) {
|
||||
//开启调试情况下获取接口赋值数据
|
||||
if (debug) { console.log(d.params.data); }
|
||||
layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
|
||||
|
|
@ -160,31 +197,187 @@
|
|||
, upload = layui.upload
|
||||
, cropperImg = layui.cropperImg
|
||||
, coreHelper = layui.coreHelper;
|
||||
|
||||
|
||||
// 获取数据源
|
||||
var roomOptions = d.params.data.roomOptions || [];
|
||||
var dicOptions = d.params.data.dicOptions || [];
|
||||
var editData = d.params.data;
|
||||
|
||||
// 初始化房间选择下拉框
|
||||
var $roomSelect = $('#edit-SQReservations-room_id');
|
||||
if (Array.isArray(roomOptions) && roomOptions.length) {
|
||||
roomOptions.forEach(function (room) {
|
||||
if (room && (room.id !== undefined) && room.name) {
|
||||
var selected = String(room.id) === String(editData.room_id) ? 'selected' : '';
|
||||
$roomSelect.append('<option value="' + room.id + '" data-name="' + room.name + '" ' + selected + '>' + room.name + '</option>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 监听房间选择,自动填充房间名称
|
||||
form.on('select(edit-room-select)', function (data) {
|
||||
var selectedOption = $roomSelect.find('option:selected');
|
||||
var roomName = selectedOption.attr('data-name') || '';
|
||||
$('#edit-SQReservations-room_name').val(roomName);
|
||||
});
|
||||
|
||||
// 初始化玩法类型下拉框
|
||||
var $gameTypeSelect = $('#edit-SQReservations-game_type');
|
||||
var $gameRuleSelect = $('#edit-SQReservations-game_rule');
|
||||
if (Array.isArray(dicOptions) && dicOptions.length) {
|
||||
dicOptions.forEach(function (gameType) {
|
||||
if (gameType && (gameType.id !== undefined) && gameType.name) {
|
||||
var selected = String(gameType.name) === String(editData.game_type) ? 'selected' : '';
|
||||
$gameTypeSelect.append('<option value="' + gameType.name + '" ' + selected + '>' + gameType.name + '</option>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化具体规则下拉框
|
||||
if (editData.game_type && Array.isArray(dicOptions)) {
|
||||
for (var i = 0; i < dicOptions.length; i++) {
|
||||
if (String(dicOptions[i].name) === String(editData.game_type)) {
|
||||
var parent = dicOptions[i];
|
||||
if (parent && Array.isArray(parent.children) && parent.children.length) {
|
||||
parent.children.forEach(function (rule) {
|
||||
if (rule && (rule.id !== undefined) && rule.name) {
|
||||
var selected = String(rule.name) === String(editData.game_rule) ? 'selected' : '';
|
||||
$gameRuleSelect.append('<option value="' + rule.name + '" ' + selected + '>' + rule.name + '</option>');
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 监听玩法类型选择,联动具体规则
|
||||
form.on('select(edit-game-type-select)', function (data) {
|
||||
var selectedId = data.value;
|
||||
// 重置具体规则
|
||||
$gameRuleSelect.html('<option value="">请选择具体规则</option>');
|
||||
if (selectedId) {
|
||||
var parent = null;
|
||||
for (var i = 0; i < (dicOptions || []).length; i++) {
|
||||
if (String(dicOptions[i].id) === String(selectedId)) {
|
||||
parent = dicOptions[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (parent && Array.isArray(parent.children) && parent.children.length) {
|
||||
parent.children.forEach(function (rule) {
|
||||
if (rule && (rule.id !== undefined) && rule.name) {
|
||||
$gameRuleSelect.append('<option value="' + rule.id + '">' + rule.name + '</option>');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
form.render('select');
|
||||
});
|
||||
|
||||
// 时间选择器配置
|
||||
laydate.render({
|
||||
elem: '#editTime-SQReservations-start_time',
|
||||
type: 'datetime'
|
||||
type: 'datetime',
|
||||
fullPanel: true,
|
||||
min: new Date().getTime()-1000, // 开始时间不能小于当前时间
|
||||
done: function(value, date) {
|
||||
calculateDuration();
|
||||
// 更新结束时间的最小值
|
||||
var startTime = new Date(value);
|
||||
laydate.render({
|
||||
elem: '#editTime-SQReservations-end_time',
|
||||
type: 'datetime',
|
||||
fullPanel: true,
|
||||
min: startTime.getTime(),
|
||||
done: function(endValue, endDate) {
|
||||
calculateDuration();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#editTime-SQReservations-end_time',
|
||||
type: 'datetime'
|
||||
type: 'datetime',
|
||||
fullPanel: true,
|
||||
min: new Date().getTime()-1000, // 结束时间不能小于当前时间
|
||||
done: function(value, date) {
|
||||
calculateDuration();
|
||||
}
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#editTime-SQReservations-created_at',
|
||||
type: 'datetime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#editTime-SQReservations-updated_at',
|
||||
type: 'datetime'
|
||||
});
|
||||
form.verify({
|
||||
|
||||
// 计算时长函数
|
||||
function calculateDuration() {
|
||||
var startTime = $('#editTime-SQReservations-start_time').val();
|
||||
var endTime = $('#editTime-SQReservations-end_time').val();
|
||||
|
||||
if (startTime && endTime) {
|
||||
var start = new Date(startTime);
|
||||
var end = new Date(endTime);
|
||||
var diffMs = end - start;
|
||||
var diffMinutes = Math.floor(diffMs / (1000 * 60));
|
||||
|
||||
if (diffMinutes > 0) {
|
||||
$('#edit-SQReservations-duration_minutes').val(diffMinutes);
|
||||
} else {
|
||||
$('#edit-SQReservations-duration_minutes').val(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
form.verify({
|
||||
verifytitle: [/^.{0,100}$/,'组局名称最大只允许输入100位字符'],
|
||||
verifyroom_name: [/^.{0,100}$/,'房间名称(冗余存储,比如 304号-大包,30元/小时)最大只允许输入100位字符'],
|
||||
verifygame_type: [/^.{0,50}$/,'玩法类型(如:补克)最大只允许输入50位字符'],
|
||||
verifygame_rule: [/^.{0,50}$/,'具体规则(如:斗地主)最大只允许输入50位字符'],
|
||||
verifyroom_name: [/^.{0,100}$/,'房间名称最大只允许输入100位字符'],
|
||||
verifygame_type: [/^.{0,50}$/,'玩法类型最大只允许输入50位字符'],
|
||||
verifygame_rule: [/^.{0,50}$/,'具体规则最大只允许输入50位字符'],
|
||||
verifyextra_info: [/^.{0,255}$/,'其他补充最大只允许输入255位字符'],
|
||||
minAge: function(value) {
|
||||
if (value != 0 && value < 18) {
|
||||
return '最小年龄不能小于18岁';
|
||||
}
|
||||
},
|
||||
maxAge: function(value) {
|
||||
if (value > 100) {
|
||||
return '最大年龄不能超过100岁';
|
||||
}
|
||||
},
|
||||
startTime: function(value) {
|
||||
if (value) {
|
||||
var startTime = new Date(value);
|
||||
var now = new Date();
|
||||
// if (startTime < now) {
|
||||
// return '开始时间不能小于当前时间';
|
||||
// }
|
||||
}
|
||||
},
|
||||
endTime: function(value) {
|
||||
if (value) {
|
||||
var endTime = new Date(value);
|
||||
var startTime = new Date($('#editTime-SQReservations-start_time').val());
|
||||
if (endTime <= startTime) {
|
||||
return '结束时间必须大于开始时间';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 监听鸽子费选择
|
||||
form.on('radio', function(data) {
|
||||
if (data.elem.name === 'deposit_fee') {
|
||||
var depositValue = data.value;
|
||||
var $depositRadios = $('input[name="deposit_fee"]');
|
||||
|
||||
if (depositValue === '0') {
|
||||
// 如果选择0元,禁用其他选项
|
||||
$depositRadios.not('[value="0"]').prop('disabled', true);
|
||||
} else {
|
||||
// 如果选择其他金额,启用所有选项
|
||||
$depositRadios.prop('disabled', false);
|
||||
}
|
||||
form.render('radio');
|
||||
}
|
||||
});
|
||||
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-SQReservations-editForm');
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<title>预约表</title>
|
||||
|
||||
<!--当前位置开始-->
|
||||
<div class="layui-card layadmin-header">
|
||||
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
||||
|
|
@ -7,6 +8,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<!--当前位置结束-->
|
||||
<div style="font-size: 14px;color: #999;margin-left: 10px;">
|
||||
从后台添加预约记录不会处理房间的预约时间限制
|
||||
</div>
|
||||
<style>
|
||||
/* 重写样式 */
|
||||
</style>
|
||||
|
|
@ -71,6 +75,19 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="game_rule">预约状态</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="status" >
|
||||
<option value="">请选择状态</option>
|
||||
<option value="0">待开始</option>
|
||||
<option value="1">进行中</option>
|
||||
<option value="2">已结束</option>
|
||||
<option value="3">已取消</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-SQReservations-search"><i class="layui-icon layui-icon-search"></i>筛选</button>
|
||||
|
|
@ -148,65 +165,191 @@
|
|||
pagebar: '#LAY-app-SQReservations-pagebar',
|
||||
className: 'pagebarbox',
|
||||
defaultToolbar: ['filter', 'print', 'exports'],
|
||||
height: 'full-127',//面包屑142px,搜索框4行172,3行137,2行102,1行67
|
||||
height: 'full-157',//面包屑142px,搜索框4行172,3行137,2行102,1行67
|
||||
page: true,
|
||||
limit: 30,
|
||||
lineStyle: 'height: 150px;',
|
||||
limits: [10, 15, 20, 25, 30, 50, 100, 200],
|
||||
text: { none: '暂无相关数据' },
|
||||
cols: [
|
||||
[
|
||||
{ type: "checkbox", fixed: "left" },
|
||||
{ field: 'id', title: '预约ID', width: 60, sort: false },
|
||||
{
|
||||
title: '组局名称/房间', sort: false, width: 200, templet: function (d) {
|
||||
return (d.title || '') + ' / ' + (d.room_name || '');
|
||||
{
|
||||
title: '组局名称', sort: false, width: 200, templet: function (d) {
|
||||
return (d.title || '');
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '房间', sort: false, width: 200, templet: function (d) {
|
||||
return (d.room_name || '');
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '时间安排', sort: false, width: 200, templet: function (d) {
|
||||
var startTime = "开始时间:" + d.start_time || '';
|
||||
var endTime = "结束时间:" + d.end_time || '';
|
||||
var duration = "时长:" + d.duration_minutes || 0;
|
||||
return startTime + '<br/>' + endTime + '<br/>' + duration + '分钟';
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '玩法类型', sort: false, width: 200, templet: function (d) {
|
||||
var gameTypeName = "玩法:" + d.game_type;
|
||||
var gameRuleName = "类型:" + d.game_rule;
|
||||
var playerCount = "人数:" + d.player_count || '';
|
||||
return gameTypeName + '<br/>' + gameRuleName + '<br/>' + playerCount + '人' + '<br/>' + '补充:' + d.extra_info;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '参与人员', sort: false, width: 300, templet: function (d) {
|
||||
if (!d.participants || d.participants.length === 0) {
|
||||
return '<div style="color: #999; font-style: italic;">暂无参与人员</div>';
|
||||
}
|
||||
|
||||
var html = '<div style="line-height: 1.6;line-height: 1.6;overflow: auto;height: 100%;width: 100%;">';
|
||||
var initiator = null;
|
||||
var participants = [];
|
||||
|
||||
// 分离发起者和参与者
|
||||
d.participants.forEach(function(it) {
|
||||
if (it.role == 1) {
|
||||
initiator = it;
|
||||
} else {
|
||||
participants.push(it);
|
||||
}
|
||||
});
|
||||
|
||||
// 显示发起者
|
||||
if (initiator) {
|
||||
html += '<div style="margin-bottom: 8px; border-left: 2px solid #5FB878; padding-left: 8px;">';
|
||||
html += '<div style="margin-bottom: 3px;">';
|
||||
html += '<span style="background: #5FB878; color: white; padding: 2px 6px; border-radius: 3px; font-size: 12px; margin-right: 5px;">发起者</span>';
|
||||
html += '<span style="font-weight: bold;">' + (initiator.UserName || '用户' + initiator.user_id) + '</span>';
|
||||
html += '<span style="color: #999; font-size: 12px; margin-left: 5px;">(ID: ' + initiator.user_id + ')</span>';
|
||||
html += '</div>';
|
||||
|
||||
// 显示发起时间
|
||||
if (initiator.join_time) {
|
||||
html += '<div style="color: #666; font-size: 11px;">';
|
||||
html += '<span style="color: #999;">发起时间:</span>' + initiator.join_time;
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
// 显示参与者
|
||||
if (participants.length > 0) {
|
||||
// 统计正常状态的参与者数量
|
||||
var normalParticipantsCount = participants.filter(function(it) {
|
||||
return it.status == 0;
|
||||
}).length;
|
||||
|
||||
html += '<div style="margin-bottom: 5px;">';
|
||||
html += '<span style="background: #1E9FFF; color: white; padding: 2px 6px; border-radius: 3px; font-size: 12px; margin-right: 5px;">参与者</span>';
|
||||
html += '<span style="color: #666; font-size: 12px;">(' + normalParticipantsCount + '人)</span>';
|
||||
html += '</div>';
|
||||
|
||||
participants.forEach(function(it, index) {
|
||||
var statusText = '';
|
||||
var statusColor = '';
|
||||
if (it.status == 0) {
|
||||
statusText = '正常';
|
||||
statusColor = '#5FB878';
|
||||
} else if (it.status == 1) {
|
||||
statusText = '已退出';
|
||||
statusColor = '#FF5722';
|
||||
}
|
||||
|
||||
html += '<div style="margin-left: 15px; margin-bottom: 8px; font-size: 12px; border-left: 2px solid #E6E6E6; padding-left: 8px;">';
|
||||
html += '<div style="margin-bottom: 3px;">';
|
||||
html += '<span style="color: #333; font-weight: 500;">' + (it.UserName || '用户' + it.user_id) + '</span>';
|
||||
html += '<span style="color: #999; margin-left: 5px;">(ID: ' + it.user_id + ')</span>';
|
||||
if (statusText) {
|
||||
html += '<span style="background: ' + statusColor + '; color: white; padding: 1px 4px; border-radius: 2px; font-size: 10px; margin-left: 5px;">' + statusText + '</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
// 显示参与时间
|
||||
if (it.join_time) {
|
||||
html += '<div style="color: #666; font-size: 11px; margin-bottom: 2px;">';
|
||||
html += '<span style="color: #999;">参与时间:</span>' + it.join_time;
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
// 显示退出时间(仅当状态为已退出时)
|
||||
if (it.status == 1 && it.quit_time) {
|
||||
html += '<div style="color: #666; font-size: 11px;">';
|
||||
html += '<span style="color: #999;">退出时间:</span>' + it.quit_time;
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
});
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{ field: 'start_time', title: '开始时间', width: 130, sort: false },
|
||||
{ field: 'end_time', title: '结束时间', width: 130, sort: false },
|
||||
{ field: 'duration_minutes', title: '时长(分钟)', sort: false, width: 105 },
|
||||
{ field: 'player_count', title: '人数', sort: false, width: 105 },
|
||||
{ field: 'game_type', title: '玩法类型', sort: false, width: 105 },
|
||||
{ field: 'game_rule', title: '具体规则', sort: false, width: 105 },
|
||||
{ field: 'extra_info', title: '备注', sort: false, width: 105 },
|
||||
{
|
||||
title: '限制条件', sort: false, minWidth: 240, templet: function (d) {
|
||||
var parts = [];
|
||||
// 是否禁烟:0=不限制,1=禁烟,2=不禁烟
|
||||
var html = '<div style="line-height: 1.8;">';
|
||||
|
||||
// 是否禁烟
|
||||
var smokeMap = { '0': '不限烟', '1': '禁烟', '2': '不禁烟' };
|
||||
var smokeKey = d.is_smoking == null ? null : String(d.is_smoking);
|
||||
if (smokeKey && (smokeKey in smokeMap)) { parts.push(smokeMap[smokeKey]); }
|
||||
// 性别限制:0=不限,1=男,2=女
|
||||
var smokeText = smokeKey && (smokeKey in smokeMap) ? smokeMap[smokeKey] : '不限烟';
|
||||
html += '<div><strong>是否禁烟:</strong>' + smokeText + '</div>';
|
||||
|
||||
// 性别限制
|
||||
var genderMap = { '0': '不限性别', '1': '限男', '2': '限女' };
|
||||
var genderKey = d.gender_limit == null ? null : String(d.gender_limit);
|
||||
if (genderKey && (genderKey in genderMap)) { parts.push(genderMap[genderKey]); }
|
||||
var genderText = genderKey && (genderKey in genderMap) ? genderMap[genderKey] : '不限性别';
|
||||
html += '<div><strong>性别限制:</strong>' + genderText + '</div>';
|
||||
|
||||
// 最低信誉分
|
||||
if (d.credit_limit != null && d.credit_limit !== '') { parts.push('信誉≥' + d.credit_limit); }
|
||||
// 年龄范围(0表示不限)
|
||||
var minAge = (d.min_age == null ? '' : String(d.min_age));
|
||||
var maxAge = (d.max_age == null ? '' : String(d.max_age));
|
||||
var creditText = (d.credit_limit != null && d.credit_limit !== '') ? d.credit_limit : '0';
|
||||
html += '<div><strong>信誉限制:</strong>≥' + creditText + '</div>';
|
||||
|
||||
// 年龄范围
|
||||
var minAge = (d.min_age == null ? '0' : String(d.min_age));
|
||||
var maxAge = (d.max_age == null ? '0' : String(d.max_age));
|
||||
var ageText = '';
|
||||
if (minAge !== '' && minAge !== '0' && maxAge !== '' && maxAge !== '0') {
|
||||
ageText = minAge + '-' + maxAge + '岁';
|
||||
} else if (minAge !== '' && minAge !== '0') {
|
||||
if (minAge !== '0' && maxAge !== '0') {
|
||||
ageText = minAge + '岁-' + maxAge + '岁';
|
||||
} else if (minAge !== '0') {
|
||||
ageText = '≥' + minAge + '岁';
|
||||
} else if (maxAge !== '' && maxAge !== '0') {
|
||||
} else if (maxAge !== '0') {
|
||||
ageText = '≤' + maxAge + '岁';
|
||||
} else {
|
||||
ageText = '不限';
|
||||
}
|
||||
if (ageText) { parts.push(ageText); }
|
||||
return parts.join(' / ') || '不限';
|
||||
html += '<div><strong>年龄限制:</strong>' + ageText + '</div>';
|
||||
|
||||
// 鸽子费
|
||||
var depositText = (d.deposit_fee != null && d.deposit_fee !== '') ? d.deposit_fee + '元' : '0元';
|
||||
html += '<div><strong>鸽子费:</strong>' + depositText + '</div>';
|
||||
|
||||
html += '</div>';
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{ field: 'deposit_fee', title: '鸽子费(保证金)', sort: false, width: 105 },
|
||||
{
|
||||
{
|
||||
title: '状态', sort: false, width: 80, templet: function (d) {
|
||||
var statusMap = { '0': '待开始', '1': '进行中', '2': '已结束', '3': '已取消' };
|
||||
var statusKey = d.status == null ? null : String(d.status);
|
||||
return statusMap[statusKey] || '未知';
|
||||
}
|
||||
},
|
||||
{ field: 'created_at', title: '创建时间', width: 130, sort: false },
|
||||
{ field: 'updated_at', title: '更新时间', width: 130, sort: false },
|
||||
{
|
||||
title: '时间信息', sort: false, width: 200, templet: function (d) {
|
||||
var createdTime = d.created_at || '';
|
||||
var updatedTime = d.updated_at || '';
|
||||
return '创建:' + createdTime + '<br/>更新:' + updatedTime + "<br/>备注:" + d.remarks || '无';
|
||||
}
|
||||
},
|
||||
{ width: 162, align: 'center', title: '操作', fixed: 'right', toolbar: '#LAY-app-SQReservations-tableBox-bar' }
|
||||
]
|
||||
]
|
||||
|
|
@ -308,6 +451,11 @@
|
|||
function doEdit(obj) {
|
||||
coreHelper.Post("Api/SQReservations/GetEdit", { id: obj.data.id }, function (e) {
|
||||
if (e.code === 0) {
|
||||
if (e.data == null) {
|
||||
e.data = {};
|
||||
}
|
||||
e.data.roomOptions = roomOptions;
|
||||
e.data.dicOptions = dicOptions;
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '编辑数据',
|
||||
|
|
@ -352,6 +500,11 @@
|
|||
function doDetails(obj) {
|
||||
coreHelper.Post("Api/SQReservations/GetDetails", { id: obj.data.id }, function (e) {
|
||||
if (e.code === 0) {
|
||||
if (e.data == null) {
|
||||
e.data = {};
|
||||
}
|
||||
e.data.roomOptions = roomOptions;
|
||||
e.data.dicOptions = dicOptions;
|
||||
admin.popup({
|
||||
shadeClose: false,
|
||||
title: '查看详情',
|
||||
|
|
@ -478,7 +631,7 @@
|
|||
if (Array.isArray(dicOptions) && dicOptions.length) {
|
||||
dicOptions.forEach(function (p) {
|
||||
if (p && (p.id !== undefined) && p.name) {
|
||||
$gameType.append('<option value="' + p.id + '">' + p.name + '</option>');
|
||||
$gameType.append('<option value="' + p.name + '">' + p.name + '</option>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -490,12 +643,12 @@
|
|||
if (selectedId) {
|
||||
var parent = null;
|
||||
for (var i = 0; i < (dicOptions || []).length; i++) {
|
||||
if (String(dicOptions[i].id) === String(selectedId)) { parent = dicOptions[i]; break; }
|
||||
if (String(dicOptions[i].name) === String(selectedId)) { parent = dicOptions[i]; break; }
|
||||
}
|
||||
if (parent && Array.isArray(parent.children) && parent.children.length) {
|
||||
parent.children.forEach(function (c) {
|
||||
if (c && (c.id !== undefined) && c.name) {
|
||||
$gameRule.append('<option value="' + c.id + '">' + c.name + '</option>');
|
||||
$gameRule.append('<option value="' + c.name + '">' + c.name + '</option>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="name" class="layui-form-label layui-form-required">房间名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="name" lay-verType="tips" lay-verify="required|verifyname" class="layui-input" lay-reqText="请输入房间号(如:304号-大包)" placeholder="请输入房间号"/>
|
||||
<input name="name" lay-verType="tips" lay-verify="required|verifyname" class="layui-input" lay-reqText="请输入房间名称" placeholder="请输入房间名称"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
, coreHelper = layui.coreHelper;
|
||||
|
||||
form.verify({
|
||||
verifyname: [/^.{0,100}$/, '房间号最大只允许输入100位字符'],
|
||||
verifyname: [/^.{0,100}$/, '房间名称最大只允许输入100位字符'],
|
||||
});
|
||||
form.val('LAY-app-SQRooms-createForm', {
|
||||
status: 1,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<div class="layui-form-item">
|
||||
<label for="name" class="layui-form-label layui-form-required">房间名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="name" lay-verType="tips" lay-verify="required|verifyname" class="layui-input" placeholder="请输入房间号(如:304号-大包)" lay-reqText="请输入房间号(如:304号-大包)" value="{{d.params.data.name || '' }}" />
|
||||
<input name="name" lay-verType="tips" lay-verify="required|verifyname" class="layui-input" placeholder="请输入房间名称" lay-reqText="请输入房间名称" value="{{d.params.data.name || '' }}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
, coreHelper = layui.coreHelper;
|
||||
|
||||
form.verify({
|
||||
verifyname: [/^.{0,100}$/,'房间号(如:304号-大包)最大只允许输入100位字符'],
|
||||
verifyname: [/^.{0,100}$/,'房间名称最大只允许输入100位字符'],
|
||||
});
|
||||
//重载form
|
||||
form.render(null, 'LAY-app-SQRooms-editForm');
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" for="name">房间号</label>
|
||||
<label class="layui-form-label" for="name">房间名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="name" placeholder="请输入房间号(如:304号-大包)" class="layui-input">
|
||||
<input type="text" name="name" placeholder="请输入房间名称" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user