记得上下班打卡 | git大法好,push需谨慎

Commit 05b5881f authored by jiangxiulong's avatar jiangxiulong

banner delete

parent 280b081a
...@@ -2,98 +2,306 @@ ...@@ -2,98 +2,306 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org"> <html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head> <head>
<th:block th:include="include :: header('提交订单退款')"/> <th:block th:include="include :: header('提交订单退款')"/>
<th:block th:include="include :: select2-css"/>
<th:block th:include="include :: datetimepicker-css"/>
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-post-add"> <form class="form-horizontal m" id="form-post-add">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">订单id</label> <label class="col-sm-2 control-label is-required">标题</label>
<div class="col-sm-8"> <div class="col-sm-10">
<input class="form-control" type="text" name="orderTicketsId" id="orderTicketsId" required> <input class="form-control" type="text" name="bannersName" id="bannersName" required>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">快递费:</label> <label class="col-sm-2 control-label is-required">展示位置</label>
<div class="col-sm-8"> <div class="col-sm-10">
<input class="form-control" type="text" name="RefundPriceExpress"> <label th:each="type : ${BannersDisplayLocation}" class="checkbox-inline">
<input name="positionList" th:text="${type.name}" th:value="${type.id}" type="checkbox">
</label>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">入场人:</label> <label class="col-sm-2 control-label">请选择跳转类型</label>
<div class="col-sm-8"> <div class="col-sm-5">
<div class="col-sm-12 select-table table-bordered"> <select class="form-control" name="targetType" id="targetType">
<table id="bootstrap-table"></table> <option value="">--请选择跳转类型--</option>
<option th:each="type : ${BannersTargetType}" th:text="${type.name}" th:value="${type.id}"></option>
</select>
</div>
<div class="col-sm-5">
<input class="form-control" type="text" placeholder="请填写url" id="targetObjInput">
<div hidden="hidden" id="targetObjSelectShow">
<select class="form-control" id="targetObjSelect">
<option value="">--请选择--</option>
</select>
</div> </div>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label layui-required is-required">备注:</label> <label class="col-sm-2 control-label">推广省份</label>
<div class="col-sm-8"> <div class="col-sm-10">
<textarea name="reason" maxlength="500" class="form-control layui-required" rows="3"></textarea> <div class="radio check-box">
<label>
<input lay-filter="promotionType" type="radio" value="1" name="promotionType" checked=""> 全国
</label>
</div>
<div class="radio check-box">
<label>
<input lay-filter="promotionType" type="radio" value="2" name="promotionType"> 省份
</label>
</div>
</div>
</div>
<div class="form-group" id="provincesListSelect">
<label class="col-sm-2 control-label">请选择省份</label>
<div class="col-sm-5">
<select id="provincesList" class="form-control" name="provincesList">
</select>
</div>
<div class="col-sm-5">
<button type="button" class="btn btn-danger btn-sm">删除</button>
<button type="button" class="btn btn-success btn-sm">添加</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否上线</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input type="radio" value="1" name="isOnline" checked=""> <i></i> 上线
</label>
</div>
<div class="radio check-box">
<label>
<input type="radio" value="0" name="isOnline"> <i></i> 下线
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">上线开始/结束时间</label>
<div class="col-sm-10">
<div class="input-daterange input-group">
<input name="onlineStartTime" type="text" class="input-sm form-control" id="laydate-startTime"
placeholder="yyyy-MM-dd HH:mm:ss"/>
<span class="input-group-addon"></span>
<input name="onlineEndTime" type="text" class="input-sm form-control" id="laydate-endTime"
placeholder="yyyy-MM-dd HH:mm:ss"/>
</div>
</div> </div>
</div> </div>
</form> </form>
<div hidden="hidden">
<input type="text" th:value="${provinces}" id="provinces">
<input type="text" th:value="${url1}" id="url1">
<input type="text" th:value="${url2}" id="url2">
<input type="text" th:value="${url5}" id="url5">
<input type="text" th:value="${url6}" id="url6">
<input type="text" th:value="${url7}" id="url7">
<input type="text" th:value="${url8}" id="url8">
<input type="text" th:value="${url13}" id="url13">
<input type="text" th:value="${url14}" id="url14">
<input type="text" th:value="${url20}" id="url20">
<input type="text" th:value="${url21}" id="url21">
<input type="text" th:value="${url22}" id="url22">
<input type="text" th:value="${url23}" id="url23">
<input type="text" th:value="${url24}" id="url24">
<input type="text" th:value="${url26}" id="url26">
</div>
</div> </div>
<th:block th:include="include :: footer"/> <th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript"> <script type="text/javascript">
var prefix = ctx + "kylin/refund"; var prefix = ctx + "kylin/banners";
var provinces = $("#provinces").val();
$("#form-post-add").validate({ var url1 = $("#url1").val();
onkeyup: false, var url2 = $("#url2").val();
rules: { var url5 = $("#url5").val();
orderTicketsId: { var url6 = $("#url6").val();
submitHandler: function (form) { var url7 = $("#url7").val();
var config = { var url8 = $("#url8").val();
url: prefix + "/applyOrder", var url13 = $("#url13").val();
type: "post", var url14 = $("#url14").val();
dataType: "json", var url20 = $("#url20").val();
data: { var url21 = $("#url21").val();
"orderTicketsId": function () { var url22 = $("#url22").val();
return $.common.trim($("#orderTicketsId").val()); var url23 = $("#url23").val();
} var url24 = $("#url24").val();
}, var url26 = $("#url26").val();
beforeSend: function () {
$.modal.loading("正在查询订单,请稍后...");
},
success: function (result) {
var options = {
data: result.orderTicketEntitiesVo,
pagination: false,
columns: [{
checkbox: true
},
{
field: 'orderTicketEntitiesId',
title: '入场人id'
},
]
};
$.table.init(options);
$.modal.closeLoading();
}
};
$.ajax(config)
}
},
},
focusCleanup: true
});
function submitHandler() { function submitHandler() {
var reason = $('#form-post-add').find("[name='reason']").val(); var bannersName = $('#bannersName').val();
var orderTicketsId = $('#form-post-add').find("[name='orderTicketsId']").val(); if (!bannersName) {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); layer.msg("请填写banner标题");
if (!orderTicketsId || !reason || rows.length <= 0) { return false;
layer.msg("请完善数据"); }
return false; var positionList = $.form.selectCheckeds("positionList");
} if (!positionList) {
layer.msg("请选择展示位置");
return false;
}
var targetType = $('#targetType').select2('val');
if (!targetType) {
layer.msg("请选择跳转方式");
return false;
}
if ($.validate.form()) { if ($.validate.form()) {
var data = $('#form-post-add').serializeArray(); var data = $('#form-post-add').serializeArray();
data.push({"ticketEntityIds":rows.join()});
data.push({"name":"ticketEntityIds","value":rows}); var targetObj = '';
$.operate.save(prefix + "/apply", data); if (12 == targetType || 100 == targetType) { // 请填写url
targetObj = $("#targetObjInput").val();
if (!targetObj) {
layer.msg("请填写跳转的url");
return false;
}
} else if (0 == targetType || 201 == targetType) { // 无需跳转
targetObj = '';
} else {
targetObj = $("#targetObjSelect").val();
if (!targetObj) {
layer.msg("请选择跳转的目标");
return false;
}
}
data.push({"name": "targetObj", "value": targetObj});
/*data.push({"name": "positionList", "value": positionList});
var provincesList = $.form.selectSelects("provincesList");
data.push({"name": "provincesList", "value": provincesList});*/
$.operate.save(prefix + "/create", data);
} }
} }
$(function () {
layui.use(['laydate'], function () {
var laydate = layui.laydate;
var startDate = laydate.render({
elem: '#laydate-startTime',
type: 'datetime',
max: $('#laydate-endTime').val(),
theme: 'molv',
trigger: 'click',
done: function (value, date) {
// 结束时间大于开始时间
if (value !== '') {
endDate.config.min.year = date.year;
endDate.config.min.month = date.month - 1;
endDate.config.min.date = date.date;
} else {
endDate.config.min.year = '';
endDate.config.min.month = '';
endDate.config.min.date = '';
}
}
});
var endDate = laydate.render({
elem: '#laydate-endTime',
type: 'datetime',
min: $('#laydate-startTime').val(),
theme: 'molv',
trigger: 'click',
done: function (value, date) {
// 开始时间小于结束时间
if (value !== '') {
startDate.config.max.year = date.year;
startDate.config.max.month = date.month - 1;
startDate.config.max.date = date.date;
} else {
startDate.config.max.year = '';
startDate.config.max.month = '';
startDate.config.max.date = '';
}
}
});
// 全国/省份的选中事件
/*form.on('radio(promotionType)', function (data) {
console.log(data);
var value = data.value;
console.log(value);
if (2 == value) {
$("#provincesListSelect").show();
} else {
$("#provincesListSelect").hide();
}
});
form.render();*/
});
// 获取省份数据
var configProvinces = {
url: provinces,
type: "get",
dataType: "json",
data: {},
beforeSend: function () {
// $.modal.loading("正在处理中,请稍后...");
},
success: function (result) {
var html = '<option value="">--请选择省份--</option>';
for (var i = 0, l = result.length; i < l; i++) {
html += '<option value="' + result[i].adcode + '">' + result[i].name + '</option>';
}
;
$("#provincesList").html(html);
}
};
$.ajax(configProvinces)
// 全国/省份的选中事件
/*$("input[name=promotionType]").parent(".iradio-blue").click(function(){
var sex = $(this).val();
alert(sex);
});*/
// 跳转类型选择事件
$('#targetType').on('select2:select', function (e) {
// var cardTypeW = $("#cardType option:checked").text(); // 获取选中的名
// var targetType = $("#targetType option:checked").val();
var targetType = $('#targetType').select2('val');
if (12 == targetType || 100 == targetType) { // 请填写url
$("#targetObjSelectShow").hide();
$("#targetObjInput").show();
} else if (0 == targetType || 201 == targetType) { // 无需跳转
$("#targetObjSelectShow").hide();
$("#targetObjInput").hide();
} else {
var urlVarName = 'url' + targetType;
var url = eval(urlVarName);
console.log(url)
// 获取相关数据
var configUrl = {
url: url,
type: "get",
dataType: "json",
data: {},
beforeSend: function () {
// $.modal.loading("正在处理中,请稍后...");
},
success: function (result) {
var data = result.data;
var html = '<option value="">--请选择--</option>';
for (var i = 0, l = data.length; i < l; i++) {
html += '<option value="' + data[i].id + '">' + data[i].title + '</option>';
}
;
$("#targetObjSelectShow").show();
$("#targetObjInput").hide();
$("#targetObjSelect").html(html);
}
};
$.ajax(configUrl)
}
});
})
</script> </script>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment