活动管理-抽奖活动管理修改

This commit is contained in:
xu0625 2021-03-31 17:48:27 +08:00
parent bf6ca95d16
commit a43f406d4a
4 changed files with 103 additions and 32 deletions

View File

@ -34,12 +34,10 @@ public class DrawRule extends BaseEntity
private String DAILYFLAG; private String DAILYFLAG;
/** 日抽奖限制开始时间 */ /** 日抽奖限制开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd") private String DAILYSTARTTIME;
private Date DAILYSTARTTIME;
/** 日抽奖限制结束时间 */ /** 日抽奖限制结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd") private String DAILYENDTIME;
private Date DAILYENDTIME;
/** 日抽奖限制次数 */ /** 日抽奖限制次数 */
private Long DAILYNUMBER; private Long DAILYNUMBER;
@ -90,19 +88,19 @@ public class DrawRule extends BaseEntity
this.DRAWRULEID = DRAWRULEID; this.DRAWRULEID = DRAWRULEID;
} }
public Date getDAILYSTARTTIME() { public String getDAILYSTARTTIME() {
return DAILYSTARTTIME; return DAILYSTARTTIME;
} }
public void setDAILYSTARTTIME(Date DAILYSTARTTIME) { public void setDAILYSTARTTIME(String DAILYSTARTTIME) {
this.DAILYSTARTTIME = DAILYSTARTTIME; this.DAILYSTARTTIME = DAILYSTARTTIME;
} }
public Date getDAILYENDTIME() { public String getDAILYENDTIME() {
return DAILYENDTIME; return DAILYENDTIME;
} }
public void setDAILYENDTIME(Date DAILYENDTIME) { public void setDAILYENDTIME(String DAILYENDTIME) {
this.DAILYENDTIME = DAILYENDTIME; this.DAILYENDTIME = DAILYENDTIME;
} }

View File

@ -78,7 +78,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">首次中奖配置:</label> <label class="col-sm-4 control-label is-required">首次中奖配置:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="FIRSTFLAG" class="form-control" th:with="type=${@dict.getType('is_boolean')}"> <select name="FIRSTFLAG" id="FIRSTFLAG" onchange="firstflag()" class="form-control" th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
@ -88,7 +88,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">首次中奖奖品:</label> <label class="col-sm-4 control-label is-required">首次中奖奖品:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="FIRSTAWARDPRIZE" class="form-control" id="firstawardprize"> <select name="FIRSTAWARDPRIZE" class="form-control" id="firstawardprize" disabled >
</select> </select>
</div> </div>
</div> </div>
@ -100,7 +100,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">时间段抽奖配置:</label> <label class="col-sm-4 control-label is-required">时间段抽奖配置:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="DAILYFLAG" class="form-control" th:with="type=${@dict.getType('is_boolean')}"> <select name="DAILYFLAG" id="DAILYFLAG" onchange="dailyflag()" class="form-control" th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
@ -110,7 +110,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">时间段限制次数:</label> <label class="col-sm-4 control-label is-required">时间段限制次数:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="DAILYNUMBER" placeholder="时间段限制次数" class="form-control" type="text" maxlength="30"> <input name="DAILYNUMBER" id="dailynumber" placeholder="时间段限制次数" class="form-control" type="text" maxlength="30" readonly>
</div> </div>
</div> </div>
</div> </div>
@ -121,7 +121,7 @@
<label class="col-sm-4 control-label is-required">抽奖限制开始时间:</label> <label class="col-sm-4 control-label is-required">抽奖限制开始时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="DAILYSTARTTIME" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text"> <input name="DAILYSTARTTIME" class="form-control" placeholder="HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
@ -132,7 +132,7 @@
<label class="col-sm-4 control-label is-required">抽奖限制结束时间:</label> <label class="col-sm-4 control-label is-required">抽奖限制结束时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="DAILYENDTIME" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text"> <input name="DAILYENDTIME" id="DAILYENDTIME" class="form-control" placeholder="HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
@ -147,7 +147,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中配置:</label> <label class="col-sm-4 control-label is-required">抽奖必中配置:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="WILLDRAWFLAG" class="form-control" th:with="type=${@dict.getType('is_boolean')}"> <select name="WILLDRAWFLAG" id="WILLDRAWFLAG" onchange="willdrawflag()" class="form-control" th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select> </select>
</div> </div>
@ -157,7 +157,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中计数:</label> <label class="col-sm-4 control-label is-required">抽奖必中计数:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="WILLDRAWAWARDNUMBER" placeholder="抽奖必中计数" class="form-control" type="text" maxlength="30"> <input name="WILLDRAWAWARDNUMBER" id="willdrawawardnumber" placeholder="抽奖必中计数" class="form-control" type="text" maxlength="30" readonly>
</div> </div>
</div> </div>
</div> </div>
@ -219,6 +219,35 @@
$.operate.saveModal(prefix+"/add", data); $.operate.saveModal(prefix+"/add", data);
} }
//时间段抽奖配置
function dailyflag(){
var DAILYFLAG = $("#DAILYFLAG").val();
if (DAILYFLAG==1){
$('#dailynumber').removeAttr('readonly');
}else if(DAILYFLAG==0){
$("#dailynumber").attr('readonly','true');
}
}
//抽奖必中配置
function willdrawflag(){
var WILLDRAWFLAG = $("#WILLDRAWFLAG").val();
if (WILLDRAWFLAG==1){
$('#willdrawawardnumber').removeAttr('readonly');
}else if(WILLDRAWFLAG==0){
$("#willdrawawardnumber").attr('readonly','true');
}
}
//首次中奖配置
function firstflag(){
var FIRSTFLAG = $("#FIRSTFLAG").val();
if (FIRSTFLAG==1){
$('#firstawardprize').removeAttr('disabled');
}else if(FIRSTFLAG==0){
$("#firstawardprize").attr('disabled','true');
}
}
$("input[name='STARTTIME']").datetimepicker({ $("input[name='STARTTIME']").datetimepicker({
weekStart: 1, weekStart: 1,
@ -250,7 +279,7 @@
startView: 2, startView: 2,
forceParse: 0, forceParse: 0,
showMeridian: 1, showMeridian: 1,
format: 'yyyy-mm-dd hh:ii:ss' format: 'hh:ii:ss'
}); });
$("input[name='DAILYENDTIME']").datetimepicker({ $("input[name='DAILYENDTIME']").datetimepicker({
@ -261,7 +290,7 @@
startView: 2, startView: 2,
forceParse: 0, forceParse: 0,
showMeridian: 1, showMeridian: 1,
format: 'yyyy-mm-dd hh:ii:ss' format: 'hh:ii:ss'
}); });
</script> </script>
</body> </body>

View File

@ -56,7 +56,7 @@
<label class="col-sm-4 control-label is-required">开始时间:</label> <label class="col-sm-4 control-label is-required">开始时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="STARTTIME" th:value="${#dates.format(drawInfo.STARTTIME, 'yyyy-MM-dd HH:mm:ss HH:mm:ss')}" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text"> <input name="STARTTIME" th:value="${#dates.format(drawInfo.STARTTIME, 'yyyy-MM-dd HH:mm:ss')}" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
@ -67,7 +67,7 @@
<label class="col-sm-4 control-label is-required">结束时间:</label> <label class="col-sm-4 control-label is-required">结束时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="ENDTIME" th:value="${#dates.format(drawInfo.ENDTIME, 'yyyy-MM-dd HH:mm:ss HH:mm:ss')}" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text"> <input name="ENDTIME" th:value="${#dates.format(drawInfo.ENDTIME, 'yyyy-MM-dd HH:mm:ss')}" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
@ -80,7 +80,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">首次中奖配置:</label> <label class="col-sm-4 control-label is-required">首次中奖配置:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="FIRSTFLAG" class="form-control" th:with="type=${@dict.getType('is_boolean')}"> <select name="FIRSTFLAG" id="FIRSTFLAG" onchange="firstflag()" class="form-control" th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{FIRSTFLAG}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{FIRSTFLAG}"></option>
</select> </select>
</div> </div>
@ -102,7 +102,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">时间段抽奖配置:</label> <label class="col-sm-4 control-label is-required">时间段抽奖配置:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="DAILYFLAG" class="form-control" th:with="type=${@dict.getType('is_boolean')}"> <select name="DAILYFLAG" id="DAILYFLAG" onchange="dailyflag()" class="form-control" th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{DAILYFLAG}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{DAILYFLAG}"></option>
</select> </select>
</div> </div>
@ -112,7 +112,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">时间段限制次数:</label> <label class="col-sm-4 control-label is-required">时间段限制次数:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="DAILYNUMBER" th:field="*{DAILYNUMBER}" placeholder="时间段限制次数" class="form-control" type="text" maxlength="30"> <input name="DAILYNUMBER" id="dailynumber" th:field="*{DAILYNUMBER}" placeholder="时间段限制次数" class="form-control" type="text" maxlength="30" >
</div> </div>
</div> </div>
</div> </div>
@ -123,7 +123,7 @@
<label class="col-sm-4 control-label is-required">抽奖限制开始时间:</label> <label class="col-sm-4 control-label is-required">抽奖限制开始时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="DAILYSTARTTIME" th:value="${#dates.format(drawInfo.DAILYSTARTTIME, 'yyyy-MM-dd HH:mm:ss HH:mm:ss')}" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text"> <input name="DAILYSTARTTIME" th:field="*{DAILYSTARTTIME}" class="form-control" placeholder="HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
@ -134,7 +134,7 @@
<label class="col-sm-4 control-label is-required">抽奖限制结束时间:</label> <label class="col-sm-4 control-label is-required">抽奖限制结束时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="DAILYENDTIME" th:value="${#dates.format(drawInfo.DAILYENDTIME, 'yyyy-MM-dd HH:mm:ss HH:mm:ss')}" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text"> <input name="DAILYENDTIME" th:field="*{DAILYENDTIME}" class="form-control" placeholder="HH:mm:ss" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
@ -149,7 +149,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中配置:</label> <label class="col-sm-4 control-label is-required">抽奖必中配置:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="WILLDRAWFLAG" class="form-control" th:with="type=${@dict.getType('is_boolean')}"> <select name="WILLDRAWFLAG" id="WILLDRAWFLAG" onchange="willdrawflag()" class="form-control" th:with="type=${@dict.getType('is_boolean')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{WILLDRAWFLAG}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{WILLDRAWFLAG}"></option>
</select> </select>
</div> </div>
@ -159,7 +159,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label is-required">抽奖必中计数:</label> <label class="col-sm-4 control-label is-required">抽奖必中计数:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="WILLDRAWAWARDNUMBER" th:field="*{WILLDRAWAWARDNUMBER}" placeholder="抽奖必中计数" class="form-control" type="text" maxlength="30"> <input name="WILLDRAWAWARDNUMBER" id="willdrawawardnumber" th:field="*{WILLDRAWAWARDNUMBER}" placeholder="抽奖必中计数" class="form-control" type="text" maxlength="30" >
</div> </div>
</div> </div>
</div> </div>
@ -193,9 +193,21 @@
} }
/**获取奖品及信息列表*/ /**获取奖品及信息列表*/
$(document).ready(function() { $(document).ready(function() {
var DAILYFLAG = $("#DAILYFLAG").val();
if(DAILYFLAG==0){
$("#dailynumber").attr('readonly','true');
}
var WILLDRAWFLAG = $("#WILLDRAWFLAG").val();
if(WILLDRAWFLAG==0){
$("#willdrawawardnumber").attr('readonly','true');
}
var FIRSTFLAG = $("#FIRSTFLAG").val();
if(FIRSTFLAG==0){
$("#firstawardprize").attr('disabled','true');
}
var WILLDRAWAWARDPRIZE = [[${drawInfo.WILLDRAWAWARDPRIZE}]]; var WILLDRAWAWARDPRIZE = [[${drawInfo.WILLDRAWAWARDPRIZE}]];
var FIRSTAWARDPRIZE = [[${drawInfo.FIRSTAWARDPRIZE}]]; var FIRSTAWARDPRIZE = [[${drawInfo.FIRSTAWARDPRIZE}]];
var job= ""; var job= "";
var jobj= ""; var jobj= "";
$.ajax({ $.ajax({
@ -246,6 +258,38 @@
); );
}); });
//时间段抽奖配置
function dailyflag(){
var DAILYFLAG = $("#DAILYFLAG").val();
if (DAILYFLAG==1){
$('#dailynumber').removeAttr('readonly');
}else if(DAILYFLAG==0){
$("#dailynumber").attr('readonly','true');
}
}
//抽奖必中配置
function willdrawflag(){
var WILLDRAWFLAG = $("#WILLDRAWFLAG").val();
if (WILLDRAWFLAG==1){
$('#willdrawawardnumber').removeAttr('readonly');
}else if(WILLDRAWFLAG==0){
$("#willdrawawardnumber").attr('readonly','true');
}
}
//首次中奖配置
function firstflag(){
var FIRSTFLAG = $("#FIRSTFLAG").val();
if (FIRSTFLAG==1){
$('#firstawardprize').removeAttr('disabled');
}else if(FIRSTFLAG==0){
$("#firstawardprize").attr('disabled','true');
}
}
$("input[name='STARTTIME']").datetimepicker({ $("input[name='STARTTIME']").datetimepicker({
weekStart: 1, weekStart: 1,
todayBtn: 1, todayBtn: 1,
@ -276,7 +320,7 @@
startView: 2, startView: 2,
forceParse: 0, forceParse: 0,
showMeridian: 1, showMeridian: 1,
format: 'yyyy-mm-dd hh:ii:ss' format: 'hh:ii:ss'
}); });
$("input[name='DAILYENDTIME']").datetimepicker({ $("input[name='DAILYENDTIME']").datetimepicker({
@ -287,7 +331,7 @@
startView: 2, startView: 2,
forceParse: 0, forceParse: 0,
showMeridian: 1, showMeridian: 1,
format: 'yyyy-mm-dd hh:ii:ss' format: 'hh:ii:ss'
}); });
</script> </script>
</body> </body>