Bladeren bron

refill tax stats

xiaoyu 2 jaren geleden
bovenliggende
commit
3035a4d225

+ 1 - 1
admin/control/refill_config.php

@@ -162,4 +162,4 @@ class refill_configControl extends SystemControl
             Tpl::showpage('card.add');
         }
     }
-}
+}

+ 160 - 0
admin/control/refill_tax_stats.php

@@ -0,0 +1,160 @@
+<?php
+
+class refill_tax_statsControl extends SystemControl
+{
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexOp()
+    {
+        $tax_type = $_GET['tax_type'] ?? 'provider';
+        $page = "refill_tax.stats.{$tax_type}";
+        $model_refill_order = Model('refill_order');
+        $_GET['query_start_time'] = $_GET['query_start_time'] ?? date("Y-m-d 00:00:00", strtotime("-1 day"));
+        $cond = $this->ct_cond($_GET, 'time_stamp');
+        if (!empty($_GET['order_time_type'])) {
+            $cond['order_time_type'] = $_GET['order_time_type'];
+        }
+        $stats_list = $model_refill_order->getOrderStatsList($cond, 50, '*', 'time_stamp desc, cname asc');
+
+        $total_stats = $this->stats($cond);
+        $order_time_type_text = ['notify_time' => '回调时间', 'order_time' => '下单时间'];
+        Tpl::output('total_stats', $total_stats);
+        Tpl::output('stats_list', $stats_list);
+        Tpl::output('order_time_type_text', $order_time_type_text);
+        Tpl::output('show_page', $model_refill_order->showpage());
+        Tpl::showpage($page);
+    }
+
+    private function ct_cond($input, $time_stamp)
+    {
+        $cond['type'] = $input['tax_type'] ?? 'provider';
+        $cache_cids = $this->cache_cids($input['tax_type']);
+        if (!empty($input['cid'])) {
+            $cond['cid'] = ['in', $input['cid']];
+        } else {
+            $cond['cid'] = ['in', $cache_cids];
+        }
+
+        $start_unixtime = intval(strtotime($input['query_start_time']));
+        $end_unixtime = intval(strtotime($input['query_end_time']));
+
+        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+            $cond[$time_stamp] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
+        } elseif ($start_unixtime > 0) {
+            $cond[$time_stamp] = ['egt', $start_unixtime];
+        } elseif ($end_unixtime > 0) {
+            $cond[$time_stamp] = ['lt', $end_unixtime];
+        }
+
+        return $cond;
+    }
+
+    private function stats($condition)
+    {
+        $order_time_type = ['notify_time','order_time'];
+        foreach ($order_time_type as $type){
+            $condition['order_time_type'] = $type;
+            $stats = Model('')->table('refill_stats')
+                ->field('sum(success_count) as success_count,sum(success_refill_amounts) as success_refill_amounts,sum(success_mch_amounts) as success_mch_amounts,
+                sum(success_channel_amounts) as success_channel_amounts,sum(profit_amounts) as profit_amounts,sum(send_count) as send_count')
+                ->where($condition)
+                ->find();
+            $total_stats[$type] = [
+                'success_count_total' => $stats['success_count'],
+                'success_refill_amounts_total' => ncPriceFormat($stats['success_refill_amounts']),
+                'success_mch_amounts_toatl' => ncPriceFormat($stats['success_mch_amounts']),
+                'success_channel_amounts_total' => ncPriceFormat($stats['success_channel_amounts']),
+                'profit_amounts_total' => ncPriceFormat($stats['profit_amounts']),
+                'send_count_total' => $stats['send_count'],
+            ];
+        }
+        return $total_stats;
+    }
+
+    public function refill_tax_subjectOp()
+    {
+        $tax_type = $_GET['tax_type'] ?? 'provider';
+        $page = "refill_tax.{$tax_type}";
+        $cids = $_GET['cids'] ?? '';
+        [$cache_cids, $cids] = $this->subject_cids($tax_type, $cids);
+        if ($tax_type == 'merchant') {
+            $mod = Model('merchant');
+            $list = $mod->getMerchantList(['mchid' => ['in', $cids]], 200, 'available_predeposit desc,merchant_state asc,mchid desc', true);
+        }
+        elseif ($tax_type == 'provider')
+        {
+            $mod = Model('refill_provider');
+            $list = $mod->table('refill_provider,store')->field('refill_provider.*,store.store_name,store.member_id')->join('inner')->on('store.store_id=refill_provider.store_id')
+                ->where(['store.store_id' => ['in', $cids]])->order('opened asc, name asc')->page(200)->select();
+        }
+        else{
+            return;
+        }
+        if(!empty($cids)) {
+            $_GET['cids'] = implode(',', $cids);
+        }
+        Tpl::output('list', $list);
+        Tpl::output('cache_cids', $cache_cids);
+        Tpl::output('show_page', $mod->showpage());
+        Tpl::showpage($page);
+    }
+
+    public function subject_setOp()
+    {
+        $tax_type = $_GET['tax_type'] ?? 'provider';
+        $cids = $_GET['cids'];
+        wkcache("refill-tax-{$tax_type}", $cids);
+        showMessage('操作成功');
+    }
+
+    private function subject_cids($tax_type, $cids)
+    {
+        $cache_cids = $this->cache_cids($tax_type);
+        if(empty($cids)) return [$cache_cids, $cache_cids];
+        $cids = explode(',', $cids);
+        return [$cache_cids, array_unique(array_merge($cache_cids, $cids))];
+    }
+
+    private function cache_cids($tax_type)
+    {
+        $cache_cids = rkcache("refill-tax-{$tax_type}");
+        if(empty($cache_cids)){
+            $cache_cids = [];
+        }else{
+            $cache_cids = explode(',', $cache_cids);
+        }
+        return $cache_cids;
+    }
+
+    public function merchant_dataOp()
+    {
+        $cache_cids = $this->cache_cids('merchant');
+        $merchant_list = $this->merchants(['mchid' => ['in', $cache_cids]]);
+        $result = [];
+        foreach ($merchant_list as $value) {
+            $data['name'] = $value['company_name'] ?? $value['name'];
+            $data['value'] = $value['mchid'];
+            $data['alpha'] = $value['alpha'];
+            $data['color'] = false;
+            $result[] = $data;
+        }
+        echo json_encode($result);
+    }
+
+    public function provider_dataOp()
+    {
+        $cache_cids = $this->cache_cids('provider');
+        $provider_list = $this->providers();
+        $result = [];
+        foreach ($provider_list as $value) {
+            if(!in_array($value['store_id'], $cache_cids)) continue;
+            $data['name'] = $value['store_name'] ?? $value['name'];
+            $data['value'] = $value['store_id'];
+            $result[] = $data;
+        }
+        echo json_encode($result);
+    }
+}

+ 1 - 0
admin/include/limit.php

@@ -40,6 +40,7 @@ $_limit =  array(
         array('name'=> '通道组管理', 'op'=> null, 'act'=>'provider_group'),
         array('name'=> '订单监控', 'op'=>null, 'act'=>'ordersendlist'),
         array('name'=> '对账管理', 'op'=>null, 'act'=>'orderstats'),
+        array('name'=> '带票对账统计', 'op'=>null, 'act'=>'refill_tax_stats'),
         array('name'=> '公司信息管理', 'op'=>null, 'act'=>'refill_company'),
         array('name'=> '充值拦截设置', 'op'=>null, 'act'=>'refill_config'),
         array('name'=> '卡密管理', 'op'=>null, 'act'=>'card_key'),

+ 1 - 0
admin/include/menu.php

@@ -121,6 +121,7 @@ $arr = array(
 					array('args'=>'index,provider_group,merchant',			'text'=>'通道组管理'),
 					array('args'=>'index,ordersendlist,merchant',			'text'=>'订单监控'),
 					array('args'=>'index,orderstats,merchant',				'text'=>'对账管理'),
+					array('args'=>'index,refill_tax_stats,merchant',	    'text'=>'带票对账统计'),
 					array('args'=>'index,refill_company,merchant',				'text'=>'公司信息管理'),
 					array('args'=>'intercept,refill_config,merchant',		'text'=>'充值拦截设置'),
 					array('args'=>'stats,card_key,merchant',				'text'=>'卡密管理'),

+ 214 - 0
admin/templates/default/refill_tax.merchant.php

@@ -0,0 +1,214 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .page .fixed-bar .item-title h3 {
+        margin-top:18px !important;
+        margin-bottom:10px !important;
+        font-weight:700 !important;
+    }
+    .tab-base li span {
+        font-size:12px !important;
+    }
+    .layui-form-select .layui-input {
+        height:26px;
+    }
+    input::placeholder{
+        color:#333;
+    }
+    .row_q ul li {
+        height: 30px;
+        line-height: 30px;
+    }
+    .row_w {
+        float: left;
+        margin-right: 40px;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>带票对账统计</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=refill_tax_stats&op=index&tax_type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=index&tax_type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_type=provider"><span>上游带票控制</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>下游带票控制</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch" class="layui-form">
+        <input type="hidden" value="refill_tax_stats" name="act">
+        <input type="hidden" value="refill_tax_subject" name="op">
+        <input type="hidden" value="merchant" name="tax_type">
+        <input type="hidden" name="cids" value=""/>
+        <input type="hidden" name="default_cids" value="<?php echo $_GET['cids']; ?>"/>
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label>机构名称</label></th>
+                <td>
+                 <div id="selest_nc"></div>
+                </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search" title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                </td>
+            </tr>
+            </tbody>
+        </table>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <td>
+                    <a href="#" class="btns"  id="hSet">
+                        <span><i class="icon-edit"></i>批量设置</span>
+                    </a>
+                </td>
+            </tr>
+        </table>
+    </form>
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th class="align-center" id="selectAll">
+                    <input type="checkbox" name="chbox" value="">
+                </th>
+                <th>机构编号</th>
+                <th>机构账号</th>
+                <th>机构公司名称</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                <?php foreach ($output['list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td class="align-center">
+                            <input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $v['mchid'];?>"
+                                <?php if(in_array($v['mchid'], $output['cache_cids'])) { echo 'checked'; }?>
+                            >
+                        </td>
+                        <td><?php echo $v['mchid']; ?></td>
+                        <td><?php echo $v['name']; ?></td>
+                        <td><?php echo $v['company_name']; ?></td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="19">
+                    <div class="pagination"><?php echo $output['show_page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
+<link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
+      id="cssfile2"/>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script>
+    $(function () {
+        $('#ncsubmit').click(function () {
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+            $('input[name="cids"]').val(selectStr);
+        }
+
+        //全选
+        $('#selectAll').click(function () {
+            if ($("input[name='chbox']").is(':checked')) {
+                $("input[name='checkbox']").each(function () {
+                    this.checked = true;
+                })
+            } else {
+                $("input[name='checkbox']").each(function () {
+                    this.checked = false;
+                })
+            }
+        })
+
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        //多选
+        let selest_nc
+        let default_cids = $('input[name="default_cids"]').val().split(',');
+        $.get('index.php?act=refill_order&op=merchant_data', function (data) {
+            data = JSON.parse(data)
+            if (default_cids) {
+                for (let index = 0; index < default_cids.length; index++) {
+                    for (let j = 0; j < data.length; j++) {
+                        if (default_cids[index] === data[j].value) {
+                            data[j].selected = true
+                        }
+                    }
+                }
+            }
+            selest_nc = xmSelect.render({
+                el: '#selest_nc',
+                size: 'mini',
+                filterable: true,
+                style: {
+                    minHeight: '27px',
+                    lineHeight: '27px',
+                    marginLeft: '4px',
+                    width: '500px'
+                },
+                language: 'zn',
+                data: data
+            })
+        })
+
+        let get_sel_id = function (){
+            let arr = [];
+            $("input:checkbox:checked").each(function () {
+                let sel_id = $(this).val();
+                if(sel_id !== '') {
+                    arr.push(sel_id);
+                }
+            })
+            if (arr.length <= 0) { return}
+            return arr.join(",")
+        }
+
+        //批量设置
+        $('#hSet').click(function () {
+            layer.confirm('您确定要设置为带票机构吗', {
+                btn: ['确定', '取消'],
+                title: '设置带票通道'
+            }, function () {
+                const cids = get_sel_id();
+                window.location.href = `index.php?act=refill_tax_stats&op=subject_set&tax_type=merchant&cids= ${cids ? cids : ''}`
+            }, function () {
+                layer.msg('取消成功')
+            });
+        })
+    });
+</script>

+ 214 - 0
admin/templates/default/refill_tax.provider.php

@@ -0,0 +1,214 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .page .fixed-bar .item-title h3 {
+        margin-top:18px !important;
+        margin-bottom:10px !important;
+        font-weight:700 !important;
+    }
+    .tab-base li span {
+        font-size:12px !important;
+    }
+    .layui-form-select .layui-input {
+        height:26px;
+    }
+    input::placeholder{
+        color:#333;
+    }
+    .row_q ul li {
+        height: 30px;
+        line-height: 30px;
+    }
+    .row_w {
+        float: left;
+        margin-right: 40px;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>带票对账统计</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=refill_tax_stats&op=index&tax_type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=index&tax_type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>上游带票控制</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_type=merchant"><span>下游带票控制</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch" class="layui-form">
+        <input type="hidden" value="refill_tax_stats" name="act">
+        <input type="hidden" value="refill_tax_subject" name="op">
+        <input type="hidden" value="provider" name="tax_type">
+        <input type="hidden" name="cids" value=""/>
+        <input type="hidden" name="default_cids" value="<?php echo $_GET['cids']; ?>"/>
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label>通道名称</label></th>
+                <td>
+                 <div id="selest_nc"></div>
+                </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search" title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                </td>
+            </tr>
+            </tbody>
+        </table>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <td>
+                    <a href="#" class="btns"  id="hSet">
+                        <span><i class="icon-edit"></i>批量设置</span>
+                    </a>
+                </td>
+            </tr>
+        </table>
+    </form>
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th class="align-center" id="selectAll">
+                    <input type="checkbox" name="chbox" value="">
+                </th>
+                <th>通道Id</th>
+                <th>通道名称</th>
+                <th>店铺ID</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['list']) && is_array($output['list'])) { ?>
+                <?php foreach ($output['list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td class="align-center">
+                            <input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $v['store_id'];?>"
+                                <?php if(in_array($v['store_id'], $output['cache_cids'])) { echo 'checked'; }?>
+                            >
+                        </td>
+                        <td><?php echo $v['provider_id']; ?></td>
+                        <td><?php echo $v['name']; ?> (<?php echo $v['store_name']; ?>)</td>
+                        <td><?php echo $v['store_id']; ?></td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="19">
+                    <div class="pagination"><?php echo $output['show_page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
+<link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
+      id="cssfile2"/>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script>
+    $(function () {
+        $('#ncsubmit').click(function () {
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+            $('input[name="cids"]').val(selectStr);
+        }
+
+        //全选
+        $('#selectAll').click(function () {
+            if ($("input[name='chbox']").is(':checked')) {
+                $("input[name='checkbox']").each(function () {
+                    this.checked = true;
+                })
+            } else {
+                $("input[name='checkbox']").each(function () {
+                    this.checked = false;
+                })
+            }
+        })
+
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        //多选
+        let selest_nc
+        let default_cids = $('input[name="default_cids"]').val().split(',');
+        $.get('index.php?act=refill_order&op=provider_data', function (data) {
+            data = JSON.parse(data)
+            if (default_cids) {
+                for (let index = 0; index < default_cids.length; index++) {
+                    for (let j = 0; j < data.length; j++) {
+                        if (default_cids[index] === data[j].value) {
+                            data[j].selected = true
+                        }
+                    }
+                }
+            }
+            selest_nc = xmSelect.render({
+                el: '#selest_nc',
+                size: 'mini',
+                filterable: true,
+                style: {
+                    minHeight: '27px',
+                    lineHeight: '27px',
+                    marginLeft: '4px',
+                    width: '500px'
+                },
+                language: 'zn',
+                data: data
+            })
+        })
+
+        let get_sel_id = function (){
+            let arr = [];
+            $("input:checkbox:checked").each(function () {
+                let sel_id = $(this).val();
+                if(sel_id !== '') {
+                    arr.push(sel_id);
+                }
+            })
+            if (arr.length <= 0) { return}
+            return arr.join(",")
+        }
+
+        //批量设置
+        $('#hSet').click(function () {
+            layer.confirm('您确定要设置为带票通道吗', {
+                btn: ['确定', '取消'],
+                title: '设置带票通道'
+            }, function () {
+                const cids = get_sel_id();
+                window.location.href = `index.php?act=refill_tax_stats&op=subject_set&tax_type=provider&cids= ${cids ? cids : ''}`
+            }, function () {
+                layer.msg('取消成功')
+            });
+        })
+    });
+</script>

+ 349 - 0
admin/templates/default/refill_tax.stats.merchant.php

@@ -0,0 +1,349 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .page .fixed-bar .item-title h3 {
+        margin-top:18px !important;
+        margin-bottom:10px !important;
+        font-weight:700 !important;
+    }
+    .tab-base li span {
+        font-size:12px !important;
+    }
+    .layui-form-select .layui-input {
+        height:26px;
+    }
+    input::placeholder{
+        color:#333;
+    }
+    .row_q ul li {
+        height: 30px;
+        line-height: 30px;
+    }
+    .row_w {
+        float: left;
+        margin-right: 40px;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>带票对账统计</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=refill_tax_stats&op=index&tax_type=provider"><span>上游对账记录</span></a></li>
+                <li><a href="JavaScript:void(0);" class="current"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_type=provider"><span>上游带票控制</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_type=merchant"><span>下游带票控制</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch" class="layui-form">
+        <input type="hidden" value="refill_tax_stats" name="act">
+        <input type="hidden" value="index" name="op">
+        <input type="hidden" value="merchant" name="tax_type">
+        <input type="hidden" name="cid" value=""/>
+        <input type="hidden" name="default_no_mch" value="<?php echo $_GET['cid']; ?>"/>
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label for="query_start_time">统计时间</label></th>
+                <td>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                    <label for="query_start_time">~</label>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
+                </td>
+                <th><label>统计日期类型</label></th>
+                <td>
+                    <select name="order_time_type" id="order_time_type">
+                        <option value="">请选择...</option>
+                        <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
+                        <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
+                    </select>
+                </td>
+                <th><label>商户名称</label></th>
+                <td>
+                    <div id="selest_nc"></div>
+                </td>
+                <td><a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                </td>
+
+            </tr>
+            </tbody>
+        </table>
+    </form>
+    <table class="table tb-type2" id="prompt">
+        <tbody>
+        <tr class="space odd">
+            <th colspan="12"><div class="title">
+                    <h5>总量统计</h5>
+                    <span class="arrow"></span></div></th>
+        </tr>
+        <tr>
+            <td class="row_q">
+                <ul class="row_w">
+                    <li>回调日期统计</li>
+                    <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['notify_time']['success_count_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计充值中订单量: <?php echo $output['total_stats']['notify_time']['send_count_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['notify_time']['success_refill_amounts_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['notify_time']['success_mch_amounts_toatl'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['notify_time']['success_channel_amounts_total'] ?? 0?></li>
+                </ul>
+                <ul>
+                    <li>下单日期统计</li>
+                    <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['order_time']['success_count_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计充值中订单量: <?php echo $output['total_stats']['order_time']['send_count_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['order_time']['success_refill_amounts_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['order_time']['success_mch_amounts_toatl'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['order_time']['success_channel_amounts_total'] ?? 0?></li>
+                </ul>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th>统计日期</th>
+                <th>主体名称</th>
+                <th>主体ID</th>
+                <th class="align-right">成功订单数</th>
+                <th class="align-right">成功金额</th>
+                <th class="align-right">下游金额</th>
+                <th class="align-right">充值中数量</th>
+                <th class="align-left">统计日期类型</th>
+                <th class="align-center">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
+                <?php foreach ($output['stats_list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td><?php echo $v['time_text']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <td><?php echo $v['cid']; ?></td>
+                        <td class="align-right"><?php echo $v['success_count']; ?></td>
+                        <td class="align-right"><?php echo $v['success_refill_amounts']; ?></td>
+                        <td class="align-right"><?php echo $v['success_mch_amounts']; ?></td>
+                        <td class="align-right">
+                            <?php if($v['send_count'] != 0){?>
+                            <span style="color: #f30707">
+                            <?php }?>
+                            <?php echo $v['send_count']; ?>
+                            </span>
+                        </td>
+                        <td class="align-left"><?php echo $output['order_time_type_text'][$v['order_time_type']]; ?></td>
+                        <td class="align-center w200">
+                        </td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="19">
+                    <div class="pagination"><?php echo $output['show_page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css"
+      href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script>
+    $(function () {
+        $("#ncreload").click(function () {
+            $('input[name="reload"]').val('1');
+            select_set()
+            $('#formSearch').submit();
+        })
+        $('#ncsubmit').click(function () {
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+            $('input[name="cid"]').val(selectStr);
+            console.log("selectStr", selectStr);
+        }
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+        function JSONToExcelConvertor(JSONData, FileName, ShowLabel, headData) {
+            //先转化json
+            let arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData;
+            let excel = '<table>';
+            // 标题
+            for (const key in headData) {
+                var head = "<tr>";
+                var td = "<td colspan='12' style='font-size:16px;'>"+ headData[key] + '</td>';
+                excel += td + "</tr>";
+            }
+            //设置表头
+            var row = "<tr>";
+            for (var i = 0, l = ShowLabel.length; i < l; i++) {
+                row += "<th style='font-size:14px;'>" + ShowLabel[i].value + '</th>';
+            }
+            //换行
+            excel += row + "</tr>";
+            //设置数据
+            for (var i = 0; i < arrData.length; i++) {
+                var row = "<tr>";
+                let code = i+1
+                row += "<td>" +code+ "</td>"
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].time_text + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cname + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cid + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_refill_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_mch_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_channel_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].profit_amounts + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].order_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].cancel_count + '</td>';
+                row += '<td style=font-size:14px;'+ 'mso-number-format:"\@"'+ '>' + arrData[i].success_ratio + '</td>';
+                excel += row + "</tr>";
+            }
+            excel += "</table>";
+                var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>";
+                excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel; charset=UTF-8">';
+                excelFile += '<meta http-equiv="content-type" content="application/vnd.ms-excel';
+                excelFile += '; charset=UTF-8">';
+                excelFile += "<head>";
+                excelFile += "<!--[if gte mso 9]>";
+                excelFile += "<xml>";
+                excelFile += "<x:ExcelWorkbook>";
+                excelFile += "<x:ExcelWorksheets>";
+                excelFile += "<x:ExcelWorksheet>";
+                excelFile += "<x:Name>";
+                excelFile += "{worksheet}";
+                excelFile += "</x:Name>";
+                excelFile += "<x:WorksheetOptions>";
+                excelFile += "<x:DisplayGridlines/>";
+                excelFile += "</x:WorksheetOptions>";
+                excelFile += "</x:ExcelWorksheet>";
+                excelFile += "</x:ExcelWorksheets>";
+                excelFile += "</x:ExcelWorkbook>";
+                excelFile += "</xml>";
+                excelFile += "<![endif]-->";
+                excelFile += "</head>";
+                excelFile += "<body>";
+                excelFile += excel;
+                excelFile += "</body>";
+                excelFile += "</html>";
+                var uri = 'data:application/vnd.ms-excel;charset=utf-8,' + encodeURIComponent(excelFile);
+                var link = document.createElement("a");
+                link.href = uri;
+                link.style = "visibility:hidden";
+                link.download = FileName + ".xls";
+                document.body.appendChild(link);
+                link.click();
+                document.body.removeChild(link);
+        }
+        $('#ncexport').click(function () {
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+
+            let starTime = new Date($('input[name="query_start_time"]').val()).getTime()/1000;
+            let endTime = new Date($('input[name="query_end_time"]').val()).getTime()/1000;
+            let cid = selectStr
+            let order_time_type = $('#order_time_type').val()
+            $.get('index.php?act=orderstats&op=ExportData&type=merchant', {
+                query_start_time: starTime,
+                query_end_time: endTime,
+                cid: cid,
+                order_time_type:order_time_type
+            }, function (data) {
+                data = JSON.parse(data)
+                if (data && data.data) {
+                    let time = ''
+                    let head = ''
+                    let admin_name = '<?php echo ADMIN_NAME;?>'
+                    if (admin_name === 'YEZI') {
+                        head = ['北京椰子电子商务有限责任公司']
+                    } else {
+                        head = ['北京椰林网络科技有限责任公司']
+                    }
+                    if (starTime && endTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()+' - '+$('input[name="query_end_time"]').val()
+                    } else if (starTime) {
+                        time = '统计时间:'+$('input[name="query_start_time"]').val()
+                    }
+                    if (time) {
+                        head.push(time)
+                    }
+                    head.push('总计成功订单数量:' + parseInt(data.total_stats.success_count_total))
+                    head.push('总计成功订单金额:' + parseFloat(data.total_stats.success_refill_amounts_total))
+                    head.push('总计下游扣款金额:' + parseFloat(data.total_stats.success_mch_amounts_toatl))
+                    head.push('总计上游扣款金额:' + parseFloat(data.total_stats.success_channel_amounts_total))
+                    head.push('总计利润金额:' + parseFloat(data.total_stats.profit_amounts_total))
+                    let title = [{value: "序号"},{value: "统计日期"},{value: "主体名称"},{value: "主体ID"},{value: "成功订单数"},{value: "成功金额"},{value: "下游金额"},{value: "上游金额"},{value: "利润"},{value: "订单总量"}, {value: "失败订单数量"},{value: "成功占比"}]
+                    JSONToExcelConvertor(data.data, '下游对账记录', title, head)
+                }
+            })
+        })
+        //多选
+    let selest_nc
+    let default_no_mch = $('input[name="default_no_mch"]').val().split(',');
+    $.get('index.php?act=refill_tax_stats&op=merchant_data', function (data) {
+        data = JSON.parse(data)
+        if (default_no_mch) {
+            for (let index = 0; index < default_no_mch.length; index++) {
+                for (let j = 0; j < data.length; j++) {
+                    if (default_no_mch[index] === data[j].value) {
+                        data[j].selected = true
+                    }
+                }
+            }
+        }
+        selest_nc = xmSelect.render({
+            el: '#selest_nc',
+            size: 'mini',
+            filterable: true,
+            style: {
+                minHeight: '27px',
+                lineHeight: '27px',
+                marginLeft: '4px',
+                width: '250px'
+            },
+            data: data
+        })
+    })
+    });
+</script>

+ 238 - 0
admin/templates/default/refill_tax.stats.provider.php

@@ -0,0 +1,238 @@
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<style>
+    .page .fixed-bar .item-title h3 {
+        margin-top:18px !important;
+        margin-bottom:10px !important;
+        font-weight:700 !important;
+    }
+    .tab-base li span {
+        font-size:12px !important;
+    }
+    .layui-form-select .layui-input {
+        height:26px;
+    }
+    input::placeholder{
+        color:#333;
+    }
+    .row_q ul li {
+        height: 30px;
+        line-height: 30px;
+    }
+    .row_w {
+        float: left;
+        margin-right: 40px;
+    }
+</style>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>带票对账统计</h3>
+            <ul class="tab-base">
+                <li><a href="JavaScript:void(0);" class="current"><span>上游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=index&tax_type=merchant"><span>下游对账记录</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_type=provider"><span>上游带票控制</span></a></li>
+                <li><a href="index.php?act=refill_tax_stats&op=refill_tax_subject&tax_type=merchant"><span>下游带票控制</span></a></li>
+            </ul>
+        </div>
+    </div>
+    <div class="fixed-empty"></div>
+    <form method="get" name="formSearch" id="formSearch" class="layui-form">
+        <input type="hidden" value="refill_tax_stats" name="act">
+        <input type="hidden" value="index" name="op">
+        <input type="hidden" value="provider" name="tax_type">
+        <input type="hidden" name="cid" value=""/>
+        <input type="hidden" name="default_no_mch" value="<?php echo $_GET['cid']; ?>"/>
+        <table class="tb-type1 noborder search">
+            <tbody>
+            <tr>
+                <th><label for="query_start_time">统计时间</label></th>
+                <td>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
+                           id="startTime" name="query_start_time" autocomplete="off" style="width:120px" />
+                    <label for="query_start_time">~</label>
+                    <input class="txt date" type="text" value="<?php echo $_GET['query_end_time']; ?>"
+                           id="endTime" name="query_end_time" autocomplete="off" style="width:120px" />
+                </td>
+                <th><label>统计日期类型</label></th>
+                <td>
+                    <select name="order_time_type" id="order_time_type">
+                        <option value="">请选择...</option>
+                        <option value="notify_time" <?php if($_GET['order_time_type'] == 'notify_time'){ echo 'selected';}?>>回调日期</option>
+                        <option value="order_time" <?php if($_GET['order_time_type'] == 'order_time'){ echo 'selected';}?>>下单日期</option>
+                    </select>
+                </td>
+                <th><label>通道名称</label></th>
+                <td>
+                 <div id="selest_nc"></div>
+                </td>
+                <td>
+                    <a href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;</a>
+                </td>
+            </tr>
+            </tbody>
+        </table>
+    </form>
+    <table class="table tb-type2" id="prompt">
+        <tbody>
+        <tr class="space odd">
+            <th colspan="12"><div class="title">
+                    <h5>总量统计</h5>
+                    <span class="arrow"></span></div></th>
+        </tr>
+        <tr>
+            <td class="row_q">
+                <ul class="row_w">
+                    <li>回调日期统计</li>
+                    <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['notify_time']['success_count_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计充值中订单量: <?php echo $output['total_stats']['notify_time']['send_count_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['notify_time']['success_refill_amounts_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['notify_time']['success_mch_amounts_toatl'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['notify_time']['success_channel_amounts_total'] ?? 0?></li>
+                </ul>
+                <ul>
+                    <li>下单日期统计</li>
+                    <li class="lineLi" style="color:#000;">总计成功订单量: <?php echo $output['total_stats']['order_time']['success_count_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计充值中订单量: <?php echo $output['total_stats']['order_time']['send_count_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['order_time']['success_refill_amounts_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['order_time']['success_mch_amounts_toatl'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['order_time']['success_channel_amounts_total'] ?? 0?></li>
+                </ul>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+    <form method="post" id="merchant_name_form">
+        <input type="hidden" name="form_submit" value="ok"/>
+        <table class="table tb-type2">
+            <thead>
+            <tr class="thead">
+                <th>统计日期</th>
+                <th>主体名称</th>
+                <th>主体ID</th>
+                <th class="align-right">成功订单数</th>
+                <th class="align-right">成功金额</th>
+                <th class="align-right">上游金额</th>
+                <th class="align-right">充值中数量</th>
+                <th class="align-left">统计日期类型</th>
+                <th class="align-center">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <?php if (!empty($output['stats_list']) && is_array($output['stats_list'])) { ?>
+                <?php foreach ($output['stats_list'] as $k => $v) { ?>
+                    <tr class="trFlex">
+                        <td><?php echo $v['time_text']; ?></td>
+                        <td><?php echo $v['cname']; ?></td>
+                        <td><?php echo $v['cid']; ?></td>
+                        <td class="align-right"><?php echo $v['success_count']; ?></td>
+                        <td class="align-right"><?php echo $v['success_refill_amounts']; ?></td>
+                        <td class="align-right"><?php echo $v['success_channel_amounts']; ?></td>
+                        <td class="align-right">
+                            <?php if($v['send_count'] != 0){?>
+                            <span style="color: #f30707">
+                            <?php }?>
+                            <?php echo $v['send_count']; ?>
+                            </span>
+                        </td>
+                        <td class="align-left"><?php echo $output['order_time_type_text'][$v['order_time_type']]; ?></td>
+                        <td class="align-center w200">
+                        </td>
+                    </tr>
+                <?php } ?>
+            <?php } else { ?>
+                <tr class="no_data">
+                    <td colspan="19"><?php echo $lang['nc_no_record']; ?></td>
+                </tr>
+            <?php } ?>
+            </tbody>
+            <tfoot>
+            <tr class="tfoot">
+                <td></td>
+                <td colspan="19">
+                    <div class="pagination"><?php echo $output['show_page']; ?></div>
+                </td>
+            </tr>
+            </tfoot>
+        </table>
+    </form>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
+<link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
+      id="cssfile2"/>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/js/xm-select.js"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.edit.js" charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></script>
+<script type="text/javascript" src="<?php echo ADMIN_TEMPLATES_URL;?>/layui/layui.js"></script>
+<link rel="stylesheet" type="text/css" href="<?php echo ADMIN_TEMPLATES_URL; ?>/layui/css/layui.css"/>
+<script>
+    $(function () {
+        $("#ncreload").click(function () {
+            $('input[name="reload"]').val('1');
+            select_set()
+            $('#formSearch').submit();
+        })
+        $('#ncsubmit').click(function () {
+            select_set()
+            $('#formSearch').submit();
+        });
+        function select_set(){
+            let selectArr = selest_nc.getValue();
+            let selectStr = ''
+            for (let i = 0; i < selectArr.length; i++) {
+                selectStr += selectArr[i].value+','
+            }
+            selectStr = selectStr.substr(0, selectStr.length-1)
+            $('input[name="cid"]').val(selectStr);
+        }
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            },function() {
+                $(this)[0].style.backgroundColor = '#fff'
+            })
+        })
+
+        //多选
+        let selest_nc
+        let default_no_mch = $('input[name="default_no_mch"]').val().split(',');
+        $.get('index.php?act=refill_tax_stats&op=provider_data', function (data) {
+            data = JSON.parse(data)
+            if (default_no_mch) {
+                for (let index = 0; index < default_no_mch.length; index++) {
+                    for (let j = 0; j < data.length; j++) {
+                        if (default_no_mch[index] === data[j].value) {
+                            data[j].selected = true
+                        }
+                    }
+                }
+            }
+            selest_nc = xmSelect.render({
+                el: '#selest_nc',
+                size: 'mini',
+                filterable: true,
+                style: {
+                    minHeight: '27px',
+                    lineHeight: '27px',
+                    marginLeft: '4px',
+                    width: '250px'
+                },
+                language: 'zn',
+                data: data
+            })
+        })
+    });
+</script>