|
@@ -31,76 +31,76 @@ layui.config({
|
|
|
//- 筛选条件-日期
|
|
//- 筛选条件-日期
|
|
|
var laydate = layui.laydate;
|
|
var laydate = layui.laydate;
|
|
|
var layCreateDate = laydate.render({
|
|
var layCreateDate = laydate.render({
|
|
|
-elem: '#CreateDate',
|
|
|
|
|
-type: 'date',
|
|
|
|
|
-range: true,
|
|
|
|
|
-trigger: 'click',
|
|
|
|
|
-change: function (value, date, endDate) {
|
|
|
|
|
-var op = true;
|
|
|
|
|
-if (date.year == endDate.year && endDate.month - date.month <= 1) {
|
|
|
|
|
-if (endDate.month - date.month == 1 && endDate.date > date.date) {
|
|
|
|
|
-op = false;
|
|
|
|
|
-layCreateDate.hint('日期范围请不要超过1个月');
|
|
|
|
|
-setTimeout(function () {
|
|
|
|
|
-$(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
|
|
-}, 1);
|
|
|
|
|
-}
|
|
|
|
|
-} else {
|
|
|
|
|
-op = false;
|
|
|
|
|
-layCreateDate.hint('日期范围请不要超过1个月');
|
|
|
|
|
-setTimeout(function () {
|
|
|
|
|
-$(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
|
|
-}, 1);
|
|
|
|
|
-}
|
|
|
|
|
-if (op) {
|
|
|
|
|
-$('#CreateDate').val(value);
|
|
|
|
|
-}
|
|
|
|
|
-}
|
|
|
|
|
-});
|
|
|
|
|
-var layBizTime = laydate.render({
|
|
|
|
|
-elem: '#BizTime',
|
|
|
|
|
-trigger: 'click',
|
|
|
|
|
-type: 'date',
|
|
|
|
|
-range: true,
|
|
|
|
|
-change: function (value, date, endDate) {
|
|
|
|
|
-var op = true;
|
|
|
|
|
-if (date.year == endDate.year && endDate.month - date.month <= 1) {
|
|
|
|
|
-if (endDate.month - date.month == 1 && endDate.date > date.date) {
|
|
|
|
|
-op = false;
|
|
|
|
|
-layBizTime.hint('日期范围请不要超过1个月');
|
|
|
|
|
-setTimeout(function () {
|
|
|
|
|
-$(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
|
|
-}, 1);
|
|
|
|
|
-}
|
|
|
|
|
-} else {
|
|
|
|
|
-op = false;
|
|
|
|
|
-layBizTime.hint('日期范围请不要超过1个月');
|
|
|
|
|
-setTimeout(function () {
|
|
|
|
|
-$(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
|
|
-}, 1);
|
|
|
|
|
-}
|
|
|
|
|
-if (op) {
|
|
|
|
|
-$('#BizTime').val(value);
|
|
|
|
|
-}
|
|
|
|
|
-}
|
|
|
|
|
-});
|
|
|
|
|
|
|
+ elem: '#CreateDate',
|
|
|
|
|
+ type: 'date',
|
|
|
|
|
+ range: true,
|
|
|
|
|
+ trigger: 'click',
|
|
|
|
|
+ change: function (value, date, endDate) {
|
|
|
|
|
+ var op = true;
|
|
|
|
|
+ if (date.year == endDate.year && endDate.month - date.month <= 1) {
|
|
|
|
|
+ if (endDate.month - date.month == 1 && endDate.date > date.date) {
|
|
|
|
|
+ op = false;
|
|
|
|
|
+ layCreateDate.hint('日期范围请不要超过1个月');
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ $(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
|
|
+ }, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ op = false;
|
|
|
|
|
+ layCreateDate.hint('日期范围请不要超过1个月');
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ $(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
|
|
+ }, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (op) {
|
|
|
|
|
+ $('#CreateDate').val(value);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ var layBizTime = laydate.render({
|
|
|
|
|
+ elem: '#BizTime',
|
|
|
|
|
+ trigger: 'click',
|
|
|
|
|
+ type: 'date',
|
|
|
|
|
+ range: true,
|
|
|
|
|
+ change: function (value, date, endDate) {
|
|
|
|
|
+ var op = true;
|
|
|
|
|
+ if (date.year == endDate.year && endDate.month - date.month <= 1) {
|
|
|
|
|
+ if (endDate.month - date.month == 1 && endDate.date > date.date) {
|
|
|
|
|
+ op = false;
|
|
|
|
|
+ layBizTime.hint('日期范围请不要超过1个月');
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ $(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
|
|
+ }, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ op = false;
|
|
|
|
|
+ layBizTime.hint('日期范围请不要超过1个月');
|
|
|
|
|
+ setTimeout(function () {
|
|
|
|
|
+ $(".laydate-btns-confirm").addClass("laydate-disabled");
|
|
|
|
|
+ }, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (op) {
|
|
|
|
|
+ $('#BizTime').val(value);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
|
|
|
|
|
//excel导入
|
|
//excel导入
|
|
|
- excel = layui.excel;
|
|
|
|
|
|
|
+ excel = layui.excel;
|
|
|
$('#ExcelFile').change(function (e) {
|
|
$('#ExcelFile').change(function (e) {
|
|
|
var files = e.target.files;
|
|
var files = e.target.files;
|
|
|
- excel.importExcel(files, { }, function (data) {
|
|
|
|
|
|
|
+ excel.importExcel(files, {}, function (data) {
|
|
|
ExcelData = data[0].Sheet1;
|
|
ExcelData = data[0].Sheet1;
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
//监听单元格编辑
|
|
//监听单元格编辑
|
|
|
- table.on('edit(LAY-list-manage)', function(obj){
|
|
|
|
|
|
|
+ table.on('edit(LAY-list-manage)', function (obj) {
|
|
|
var value = obj.value //得到修改后的值
|
|
var value = obj.value //得到修改后的值
|
|
|
- ,data = obj.data //得到所在行所有键值
|
|
|
|
|
- ,field = obj.field; //得到字段
|
|
|
|
|
- if(field == "Sort"){
|
|
|
|
|
|
|
+ , data = obj.data //得到所在行所有键值
|
|
|
|
|
+ , field = obj.field; //得到字段
|
|
|
|
|
+ if (field == "Sort") {
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
type: "POST",
|
|
type: "POST",
|
|
|
url: "/Admin/SysRechargeRecord/Sort?r=" + Math.random(1),
|
|
url: "/Admin/SysRechargeRecord/Sort?r=" + Math.random(1),
|
|
@@ -111,28 +111,28 @@ $('#BizTime').val(value);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
//列表数据
|
|
//列表数据
|
|
|
table.render({
|
|
table.render({
|
|
|
elem: '#LAY-list-manage'
|
|
elem: '#LAY-list-manage'
|
|
|
, url: '/Admin/SysRechargeRecord/IndexData' //模拟接口
|
|
, url: '/Admin/SysRechargeRecord/IndexData' //模拟接口
|
|
|
, cols: [[
|
|
, cols: [[
|
|
|
{ type: 'checkbox', fixed: 'left' }
|
|
{ type: 'checkbox', fixed: 'left' }
|
|
|
- ,{field:'RechargeRecNo', width: 200, title:'奖励单号', sort: true}
|
|
|
|
|
- ,{field:'BatchCode', width: 200, title:'批次号', sort: true}
|
|
|
|
|
- ,{field:'MakerCode', width: 200, title:'创客编号', sort: true}
|
|
|
|
|
- ,{field:'RealName', width: 200, title:'创客姓名', sort: true}
|
|
|
|
|
- ,{field:'BizType', width: 200, title:'业务类型', sort: true}
|
|
|
|
|
- ,{field:'ProductType', width: 200, title:'产品类型', sort: true}
|
|
|
|
|
- ,{field:'Amount', width: 200, title:'奖励金额(元)', sort: true}
|
|
|
|
|
- ,{field:'Status', width: 200, title:'状态', sort: true}
|
|
|
|
|
- ,{field:'SeoDescription', width: 200, title:'备注', sort: true}
|
|
|
|
|
- ,{field:'BizTime', width: 200, title:'奖励时间', sort: true}
|
|
|
|
|
- ,{field:'SyncStatus', width: 200, title:'同步状态', sort: true}
|
|
|
|
|
- ,{field:'CreateMan', width: 200, title:'操作员', sort: true}
|
|
|
|
|
|
|
+ , { field: 'RechargeRecNo', width: 200, title: '奖励单号', sort: true }
|
|
|
|
|
+ , { field: 'BatchCode', width: 200, title: '批次号', sort: true }
|
|
|
|
|
+ , { field: 'MakerCode', width: 200, title: '创客编号', sort: true }
|
|
|
|
|
+ , { field: 'RealName', width: 200, title: '创客姓名', sort: true }
|
|
|
|
|
+ , { field: 'BizType', width: 200, title: '业务类型', sort: true }
|
|
|
|
|
+ , { field: 'ProductType', width: 200, title: '产品类型', sort: true }
|
|
|
|
|
+ , { field: 'Amount', width: 200, title: '奖励金额(元)', sort: true }
|
|
|
|
|
+ , { field: 'Status', width: 200, title: '状态', sort: true }
|
|
|
|
|
+ , { field: 'SeoDescription', width: 200, title: '备注', sort: true }
|
|
|
|
|
+ , { field: 'BizTime', width: 200, title: '奖励时间', sort: true }
|
|
|
|
|
+ , { field: 'SyncStatus', width: 200, title: '同步状态', sort: true }
|
|
|
|
|
+ , { field: 'CreateMan', width: 200, title: '操作员', sort: true }
|
|
|
]]
|
|
]]
|
|
|
, where: {
|
|
, where: {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
, page: true
|
|
, page: true
|
|
|
, limit: 30
|
|
, limit: 30
|
|
@@ -141,6 +141,8 @@ $('#BizTime').val(value);
|
|
|
, done: function (res, curr, count) {
|
|
, done: function (res, curr, count) {
|
|
|
$("#BizAmount30").text(res.other.BizAmount30);
|
|
$("#BizAmount30").text(res.other.BizAmount30);
|
|
|
$("#BizAmount31").text(res.other.BizAmount31);
|
|
$("#BizAmount31").text(res.other.BizAmount31);
|
|
|
|
|
+ $("#BizAmount114").text(res.other.BizAmount114);
|
|
|
|
|
+ $("#BizAmount115").text(res.other.BizAmount115);
|
|
|
$(".layui-none").text("无数据");
|
|
$(".layui-none").text("无数据");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -156,7 +158,7 @@ $('#BizTime').val(value);
|
|
|
data: "Id=" + data.Id,
|
|
data: "Id=" + data.Id,
|
|
|
dataType: "text",
|
|
dataType: "text",
|
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
- if (data == "success") {
|
|
|
|
|
|
|
+ if (data == "success") {
|
|
|
obj.del();
|
|
obj.del();
|
|
|
layer.close(index);
|
|
layer.close(index);
|
|
|
} else {
|
|
} else {
|
|
@@ -179,20 +181,20 @@ $('#BizTime').val(value);
|
|
|
, submitID = 'LAY-list-front-submit'
|
|
, submitID = 'LAY-list-front-submit'
|
|
|
, submit = layero.find('iframe').contents().find('#' + submitID);
|
|
, submit = layero.find('iframe').contents().find('#' + submitID);
|
|
|
|
|
|
|
|
- setTimeout(function () {
|
|
|
|
|
|
|
+ setTimeout(function () {
|
|
|
layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
|
|
layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
|
|
|
var errObj = $(this).find('.layui-form-danger');
|
|
var errObj = $(this).find('.layui-form-danger');
|
|
|
if (errObj.length > 0) {
|
|
if (errObj.length > 0) {
|
|
|
iframeWindow.element.tabChange('mytabbar', String(i + 1));
|
|
iframeWindow.element.tabChange('mytabbar', String(i + 1));
|
|
|
submit.click();
|
|
submit.click();
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
}, 300);
|
|
}, 300);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//监听提交
|
|
//监听提交
|
|
|
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
|
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
|
@@ -203,7 +205,7 @@ $('#BizTime').val(value);
|
|
|
}
|
|
}
|
|
|
//提交 Ajax 成功后,静态更新表格中的数据
|
|
//提交 Ajax 成功后,静态更新表格中的数据
|
|
|
//$.ajax({});
|
|
//$.ajax({});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
type: "POST",
|
|
type: "POST",
|
|
|
url: "/Admin/SysRechargeRecord/Edit?r=" + Math.random(1),
|
|
url: "/Admin/SysRechargeRecord/Edit?r=" + Math.random(1),
|
|
@@ -296,20 +298,20 @@ $('#BizTime').val(value);
|
|
|
, submitID = 'LAY-list-front-submit'
|
|
, submitID = 'LAY-list-front-submit'
|
|
|
, submit = layero.find('iframe').contents().find('#' + submitID);
|
|
, submit = layero.find('iframe').contents().find('#' + submitID);
|
|
|
|
|
|
|
|
- setTimeout(function () {
|
|
|
|
|
|
|
+ setTimeout(function () {
|
|
|
layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
|
|
layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
|
|
|
var errObj = $(this).find('.layui-form-danger');
|
|
var errObj = $(this).find('.layui-form-danger');
|
|
|
if (errObj.length > 0) {
|
|
if (errObj.length > 0) {
|
|
|
iframeWindow.element.tabChange('mytabbar', String(i + 1));
|
|
iframeWindow.element.tabChange('mytabbar', String(i + 1));
|
|
|
submit.click();
|
|
submit.click();
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
}, 300);
|
|
}, 300);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//监听提交
|
|
//监听提交
|
|
|
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
|
iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
|
|
@@ -320,7 +322,7 @@ $('#BizTime').val(value);
|
|
|
}
|
|
}
|
|
|
//提交 Ajax 成功后,静态更新表格中的数据
|
|
//提交 Ajax 成功后,静态更新表格中的数据
|
|
|
//$.ajax({});
|
|
//$.ajax({});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
type: "POST",
|
|
type: "POST",
|
|
|
url: "/Admin/SysRechargeRecord/Add?r=" + Math.random(1),
|
|
url: "/Admin/SysRechargeRecord/Add?r=" + Math.random(1),
|
|
@@ -376,9 +378,9 @@ $('#BizTime').val(value);
|
|
|
, Open: function () {
|
|
, Open: function () {
|
|
|
var checkStatus = table.checkStatus('LAY-list-manage')
|
|
var checkStatus = table.checkStatus('LAY-list-manage')
|
|
|
, data = checkStatus.data; //得到选中的数据
|
|
, data = checkStatus.data; //得到选中的数据
|
|
|
- if(data.length < 1){
|
|
|
|
|
|
|
+ if (data.length < 1) {
|
|
|
parent.layer.msg("请选择要开启的项");
|
|
parent.layer.msg("请选择要开启的项");
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
var ids = "";
|
|
var ids = "";
|
|
|
$.each(data, function (index, value) {
|
|
$.each(data, function (index, value) {
|
|
|
ids += data[index].Id + ",";
|
|
ids += data[index].Id + ",";
|
|
@@ -405,9 +407,9 @@ $('#BizTime').val(value);
|
|
|
, Close: function () {
|
|
, Close: function () {
|
|
|
var checkStatus = table.checkStatus('LAY-list-manage')
|
|
var checkStatus = table.checkStatus('LAY-list-manage')
|
|
|
, data = checkStatus.data; //得到选中的数据
|
|
, data = checkStatus.data; //得到选中的数据
|
|
|
- if(data.length < 1){
|
|
|
|
|
|
|
+ if (data.length < 1) {
|
|
|
parent.layer.msg("请选择要关闭的项");
|
|
parent.layer.msg("请选择要关闭的项");
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
var ids = "";
|
|
var ids = "";
|
|
|
$.each(data, function (index, value) {
|
|
$.each(data, function (index, value) {
|
|
|
ids += data[index].Id + ",";
|
|
ids += data[index].Id + ",";
|
|
@@ -434,9 +436,9 @@ $('#BizTime').val(value);
|
|
|
, sycn: function () {
|
|
, sycn: function () {
|
|
|
var checkStatus = table.checkStatus('LAY-list-manage')
|
|
var checkStatus = table.checkStatus('LAY-list-manage')
|
|
|
, data = checkStatus.data; //得到选中的数据
|
|
, data = checkStatus.data; //得到选中的数据
|
|
|
- if(data.length < 1){
|
|
|
|
|
|
|
+ if (data.length < 1) {
|
|
|
parent.layer.msg("请选择要同步的项");
|
|
parent.layer.msg("请选择要同步的项");
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
var ids = "";
|
|
var ids = "";
|
|
|
$.each(data, function (index, value) {
|
|
$.each(data, function (index, value) {
|
|
|
ids += data[index].Id + ",";
|
|
ids += data[index].Id + ",";
|