gang.huang il y a 2 ans
Parent
commit
99627fd95a
1 fichiers modifiés avec 43 ajouts et 6 suppressions
  1. 43 6
      admin/templates/default/provider.refill.balance.php

+ 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>