瀏覽代碼

Merge branch 'rbalance' of 39.97.239.116:gyfl/xyzshop into rbalance

stanley-king 2 年之前
父節點
當前提交
e630698590
共有 2 個文件被更改,包括 91 次插入27 次删除
  1. 48 21
      admin/templates/default/merchant.refill.balance.php
  2. 43 6
      admin/templates/default/provider.refill.balance.php

+ 48 - 21
admin/templates/default/merchant.refill.balance.php

@@ -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() {

+ 43 - 6
admin/templates/default/provider.refill.balance.php

@@ -568,22 +568,22 @@
                     <div style="width:500px;">
                     <table class="editStatTypeTable">
                         <input type="hidden" value="provider" name="type">
-                    <thead>
+                        <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"/>
+                                    <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 ${item.order_time_type.indexOf('notify_time') >= 0 ? 'checked':''} type="checkbox" name="statType[${item.value}][]" value="notify_time"/>
+                                    <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 +596,27 @@
                         layer.open({
                             btn: ['确定', '取消'],
                             yes: function() {
-                                $('#editStatTypeForm').submit();
+                                // $('#editStatTypeForm').submit();
+
+                                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,6 +630,23 @@
             })
         })
 
+
+        $(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);
+            }
+        })
+
         // <div class="layui-form-item">
         //                        <div class="layui-inline">
         //                             <label class="layui-form-label">统计开始日期:</label>