|
@@ -572,20 +572,21 @@
|
|
|
|
|
|
if (res) {
|
|
|
const datas = JSON.parse(res);
|
|
|
- let tableHTML = `<form id="editStatTypeForm" method="post" action="index.php?act=OrderStats&op=refill_balance_stat_cfg">
|
|
|
+ let tableHTML = `
|
|
|
+ <form id="editStatTypeForm" method="post" action="index.php?act=OrderStats&op=refill_balance_stat_cfg">
|
|
|
<div style="width:500px;">
|
|
|
<table class="editStatTypeTable">
|
|
|
<input type="hidden" value="merchant" name="type">
|
|
|
<thead>
|
|
|
<th style="width:300px;">主体名称</th>
|
|
|
- <th style="width:100px;">回调时间</th>
|
|
|
- <th style="width:100px;">下单时间</th>
|
|
|
+ <th style="width:100px;">下单时间 <input type="checkbox" class="allCheckOrderTime" /></th>
|
|
|
+ <th style="width:100px;">回调时间 <input type="checkbox" class="allCheckNotifyTime" /></th>
|
|
|
</thead>`;
|
|
|
datas.map((item, index) => {
|
|
|
tableHTML += `<tr>
|
|
|
<td style="width:300px;">${item.name}</td>
|
|
|
- <td style="width:100px;"><label><input ${item.order_time_type.indexOf('order_time') >= 0 ? 'checked':''} type="checkbox" name="statType[${item.value}][]" value="order_time" /></label></td>
|
|
|
- <td style="width:100px;"><label><input ${item.order_time_type.indexOf('notify_time') >= 0 ? 'checked':''} type="checkbox" name="statType[${item.value}][]" value="notify_time"/></label></td>
|
|
|
+ <td style="width:100px;"><label><input class="statOrderCheckbox" ${item.order_time_type.indexOf('order_time') >= 0 ? 'checked':''} type="checkbox" name="statType[${item.value}][]" value="order_time" /></label></td>
|
|
|
+ <td style="width:100px;"><label><input class="statNotifyCheckbox" ${item.order_time_type.indexOf('notify_time') >= 0 ? 'checked':''} type="checkbox" name="statType[${item.value}][]" value="notify_time"/></label></td>
|
|
|
</tr>`
|
|
|
})
|
|
|
|
|
@@ -596,7 +597,31 @@
|
|
|
layer.open({
|
|
|
btn: ['确定', '取消'],
|
|
|
yes: function() {
|
|
|
- $('#editStatTypeForm').submit();
|
|
|
+ // $('#editStatTypeForm').submit()
|
|
|
+ // function(e) {
|
|
|
+ // // console.log(123);
|
|
|
+ // // e.preventDefault();
|
|
|
+ var formData = $('#editStatTypeForm').serialize();
|
|
|
+ console.log('formData', formData);
|
|
|
+ $.ajax({
|
|
|
+ url: 'index.php?act=OrderStats&op=refill_balance_stat_cfg',
|
|
|
+ type: 'post',
|
|
|
+ data: formData,
|
|
|
+ success: function(res) {
|
|
|
+ console.log('editStatTypeForm', res);
|
|
|
+ const data = JSON.parse(res);
|
|
|
+ if (data.status == 'success') {
|
|
|
+ layer.msg('提交成功');
|
|
|
+ } else {
|
|
|
+ layer.msg(data.message)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail: function() {
|
|
|
+ layer.msg('网络连接错误');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // });
|
|
|
+
|
|
|
},
|
|
|
btn2: function() {
|
|
|
console.log('取消');
|
|
@@ -610,21 +635,23 @@
|
|
|
})
|
|
|
})
|
|
|
|
|
|
- // <div class="layui-form-item">
|
|
|
- // <div class="layui-inline">
|
|
|
- // <label class="layui-form-label">统计开始日期:</label>
|
|
|
- // <div class="layui-input-inline">
|
|
|
- // <input type="text" value="${data.start_stamp}" style="height:38px;" name="start_stamp" required lay-verify="required" placeholder="统计开始日期" autocomplete="off" class="layui-input" id="editItemStartDate">
|
|
|
- // </div>
|
|
|
- // </div>
|
|
|
-
|
|
|
- // <div class="layui-inline">
|
|
|
- // <label class="layui-form-label">统计结束日期:</label>
|
|
|
- // <div class="layui-input-inline">
|
|
|
- // <input type="text" value="${data.end_text}" style="height:38px;" name="end_text" required lay-verify="required" placeholder="统计结束日期" autocomplete="off" class="layui-input" id="editItemEndDate">
|
|
|
- // </div>
|
|
|
- // </div>
|
|
|
- // </div>
|
|
|
+
|
|
|
+ $(document).on('click', '.allCheckNotifyTime', function() {
|
|
|
+ if ($(this).is(':checked')) {
|
|
|
+ $('.statNotifyCheckbox').attr('checked', true);
|
|
|
+ } else {
|
|
|
+ $('.statNotifyCheckbox').attr('checked', false);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ $(document).on('click', '.allCheckOrderTime', function() {
|
|
|
+ if ($(this).is(':checked')) {
|
|
|
+ $('.statOrderCheckbox').attr('checked', true);
|
|
|
+ } else {
|
|
|
+ $('.statOrderCheckbox').attr('checked', false);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
|
|
|
$('.handleBtn').on('click', function() {
|