stanley-king 2 月之前
父节点
当前提交
4a9d8c4a65

+ 143 - 1
admin/control/ordersendlist.php

@@ -35,7 +35,7 @@ class ordersendlistControl extends SystemControl
         };
 
         $period = 20;
-        $start_day = $mintime_getter();//strtotime("-5 days",$cur_time);
+        $start_day = $mintime_getter(); //strtotime("-5 days",$cur_time);
 
         $time_cond = [];
         $mch_cond = [];
@@ -185,6 +185,8 @@ class ordersendlistControl extends SystemControl
         if(!empty($order_list)) {
             $order_list = $this->orderFormat($order_list, $merchant_list);
         }
+
+
         Tpl::output('stat', $order_stat);
         Tpl::output('count', $special_stat);
         Tpl::output('merchant_stat', $merchant_stat);
@@ -193,9 +195,149 @@ class ordersendlistControl extends SystemControl
         Tpl::output('provider_list', $provider_list);
         Tpl::output('except_stat', $this->except_stat());
         Tpl::output('show_page', $model_refill_order->showpage());
+
         Tpl::showpage('refill.order.send.index');
     }
 
+    public function monitor_transferOp()
+    {
+        $merchants_getter = function ($mchids)
+        {
+            $mches = Model('')->table('merchant')
+                ->field('mchid, company_name, name')
+                ->where(['mchid' => ['in',$mchids] ])
+                ->select();
+            return $mches;
+        };
+
+        $model_refill_order = Model('refill_order');
+
+        $base_cond['refill_order.inner_status'] = 0;
+
+        if(empty($_GET['order_state'])) {
+            $base_cond['vr_order.order_state'] = ['in', [ORDER_STATE_CANCEL, ORDER_STATE_SEND]];
+        } else {
+            $base_cond['vr_order.order_state'] = intval($_GET['order_state']);
+
+        }
+
+        $all_mchids = $this->getAllTransferMchid();
+        if (!empty($_GET['mchid'])) {
+            $base_cond['refill_order.mchid'] = $_GET['mchid'];
+        } else {
+            $base_cond['refill_order.mchid'] = ['in', $all_mchids];
+        }
+
+        $card_type = $_GET['card_type'];
+        if (!empty($card_type))
+        {
+            if (in_array($card_type, ['1', '2', '4', '5', '6', '7'])) {
+                $base_cond['refill_order.card_type'] = $card_type;
+            }
+            if ($card_type == 'oil') {
+                $base_cond['refill_order.card_type'] = ['in', ['1', '2']];
+            }
+            if ($card_type == 'phone') {
+                $base_cond['refill_order.card_type'] = ['in', ['4', '5', '6']];
+            }
+        }
+
+        $cur_time = time();
+        $start_unixtime = intval(strtotime($_GET['query_start_time']));
+        $end_unixtime = intval(strtotime($_GET['query_end_time']));
+        if(!empty($_GET['time'])) {
+            $end_unixtime = $cur_time + $_GET['time'];
+        }
+
+        if ($start_unixtime > 0 && $end_unixtime > $start_unixtime) {
+            $base_cond['refill_order.order_time'] = [['egt', $start_unixtime], ['lt', $end_unixtime], 'and'];
+        } elseif ($start_unixtime > 0) {
+            $base_cond['refill_order.order_time'] = ['egt', $start_unixtime];
+        } elseif ($end_unixtime > 0) {
+            $base_cond['refill_order.order_time'] = ['lt', $end_unixtime];
+        } else {
+            $_GET['query_start_time'] = date('Y-m-d 00:00:00', time());
+            $start = strtotime($_GET['query_start_time']);
+            $base_cond['refill_order.order_time'] = ['egt', $start];
+        }
+
+        [$merchant_stat, $order_stat] = $this->merchant_timeout_stats($base_cond);
+
+        if (empty($_GET['mchid'])) {
+            $order_count = $order_stat['order_count'];
+        }else{
+            $order_count = $merchant_stat[$_GET['mchid']]['order_count'];
+        }
+
+        $fields = "refill_order.*,vr_order.order_state,( {$cur_time} - refill_order.order_time - merchant.time_out ) as mtime_out";
+        $order_by = "mtime_out desc";
+        $order_list = $model_refill_order->getMerchantTimeOut($base_cond, 200, $order_count, $fields, $order_by);
+
+        $merchant_list = $merchants_getter($all_mchids);
+
+        Tpl::output('order_list', $order_list);
+        Tpl::output('merchant_list', $merchant_list);
+        Tpl::output('except_stat', $this->except_stat());
+        Tpl::output('show_page', $model_refill_order->showpage());
+
+
+        Tpl::showpage('monitor_transfer');
+    }
+
+    private function getAllTransferMchid()
+    {
+        $mchid_parser = function ($mchid, $cfg)
+        {
+            $cfg = unserialize($cfg);
+            if ($cfg === false) {
+                return false;
+            }
+
+            $opened = intval($cfg['transfer_opened']);
+            $tmchid = intval($cfg['transfer_mchid']);
+
+            if ($opened == 1 && $tmchid > 0 && $tmchid != $mchid) {
+                return $tmchid;
+            } else {
+                return false;
+            }
+        };
+
+        $mchids = [];
+
+        $i = 0;
+        while (true)
+        {
+            $start = $i * 1000;
+            $items = Model()->table('merchant')->field('mchid,transfer_cfg,timeout_transfer_cfg')->order('mchid asc')->limit("{$start},1000")->select();
+            if (empty($items)) {
+                return $mchids;
+            }
+            $i++;
+
+            foreach ($items as $item)
+            {
+                $cfg_rt = $item['transfer_cfg'];
+                $cfg_tm = $item['timeout_transfer_cfg'];
+                $mchid = intval($item['mchid']);
+
+                if (empty($cfg_rt) and empty($cfg_tm)) {
+                    continue;
+                }
+
+                $rt_mchid = $mchid_parser($mchid,$cfg_rt);
+                $tm_mchid = $mchid_parser($mchid,$cfg_tm);
+
+                if($rt_mchid !== false) {
+                    $mchids[] = $rt_mchid;
+                }
+                if($tm_mchid !== false) {
+                    $mchids[] = $tm_mchid;
+                }
+            }
+        }
+    }
+
     private function extra_stats($base_cond, $timeout_type,$cur_time): array
     {
         $stat_order = function ($cond)

+ 650 - 0
admin/templates/default/monitor_transfer.php

@@ -0,0 +1,650 @@
+<style>
+    th label {
+        display: inline-block;
+        width: 60px;
+    }
+    .lineLi {
+        display: inline-block;
+        min-width: 120px;
+        font-size: 14px;
+    }
+    .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:23px;
+        padding-left: 11px;
+        padding-right: 0!important;
+    }
+    input::placeholder{
+        color:#333;
+    }
+    .layui-form-selected dl {
+        display: flex!important;
+        flex-wrap: wrap!important;
+    }
+    .layui-form-select dl {
+        top: 29px !important;
+        left: 4px!important;
+        min-width: 802%!important;
+        max-height: 280px!important;
+        padding: 14px 0!important;
+    }
+    .layui-form-select dl dd.layui-this{
+        display: none;
+    }
+    .layui-form-select dl dd {
+        cursor: pointer;
+        width: 130px;
+    }
+    .lefto {
+        margin-left: 6px;
+    }
+    .db-right {
+        padding-right: 134px!important;
+        border-bottom: 1px solid #ccc;
+    }
+    .db-center {
+        padding: 9px 0;
+        border-bottom: 1px solid #ccc;
+    }
+    .db-top {
+        padding: 0 30px;
+    }
+    #selest_nc {
+        width: 220px
+    }
+    .tab-base{
+        overflow: visible;
+    }
+    .tab-base a {
+        position: relative;
+    }
+</style>
+
+<?php defined('InShopNC') or exit('Access Invalid!'); ?>
+<div class="page">
+    <div class="fixed-bar">
+        <div class="item-title">
+            <h3>问题订单监控</h3>
+            <ul class="tab-base">
+                <li><a href="index.php?act=ordersendlist&op=index"><span>商户超时订单监控</span></a></li>
+                <li><a href="index.php?act=ordersendlist&op=monitor_notify"><span>渠道回调超时监控</span></a></li>
+                <li><a href="index.php?act=ordersendlist&op=neterr_order"><span>网络错误订单监控</span></a></li>
+                <li><a href="index.php?act=ordersendlist&op=notify_err_order"><span>未回调订单监控</span></a></li>
+                <li><a href="index.php?act=ordersendlist&op=refill_detail_monitor"><span>接单记录监控</span></a></li>
+                <li><a href="index.php?act=ordersendlist&op=query_err"><span>机构查单错误列表</span></a></li>
+                <li>
+                    <a href="index.php?act=ordersendlist&op=order_exception"><span>异常订单监控</span>
+                        <?php if($output['except_stat'] > 0){?>
+                            <span class="badge"><?php echo $output['except_stat'];?></span>
+                        <?php }?>
+                    </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" action="index.php" name="formSearch" id="formSearch">
+        <input type="hidden" name="act" value="OrderSendList"/>
+        <input type="hidden" name="op" value="index"/>
+        <input type="hidden" name="order_query" value=""/>
+        <input type="hidden" name="no_mchid" value=""/>
+        <input type="hidden" name="export" value=""/>
+        <input type="hidden" name="default_no_mch" value="<?php echo $_GET['no_mchid']; ?>"/>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <th><label>客户名称</label></th>
+                <td class="layui-form">
+                    <select name="mchid" class="querySelect" lay-verify="" lay-search>
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <?php foreach ($output['merchant_list'] as $merchant) { ?>
+                            <option value="<?php echo $merchant['mchid'] ?>"<?php if ($_GET['mchid'] == $merchant['mchid']){ ?>selected<?php } ?>><?php echo $merchant['company_name'] == '' ? $merchant['name'] : $merchant['company_name']; ?></option>
+                        <?php } ?>
+                    </select>
+                </td>
+
+                <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_state" class="querySelect order_state">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="10" <?php if ($_GET['order_state'] == '10') { ?>selected<?php } ?>><?php echo $lang['order_state_new']; ?></option>
+                        <option value="20" <?php if ($_GET['order_state'] == '20') { ?>selected<?php } ?>><?php echo $lang['order_state_pay']; ?></option>
+                        <option value="30" <?php if ($_GET['order_state'] == '30') { ?>selected<?php } ?>><?php echo $lang['order_state_send']; ?></option>
+                        <option value="40" <?php if ($_GET['order_state'] == '40') { ?>selected<?php } ?>><?php echo $lang['order_state_success']; ?></option>
+                        <option value="0" <?php if ($_GET['order_state'] == '0') { ?>selected<?php } ?>><?php echo $lang['order_state_cancel']; ?></option>
+                    </select>
+                </td>
+
+                <th><label>充值类型</label></th>
+                <td>
+                    <select name="card_type" class="querySelect">
+                        <option value=""><?php echo $lang['nc_please_choose']; ?></option>
+                        <option value="1"
+                                <?php if ($_GET['card_type'] == '1'){ ?>selected<?php } ?>>中石油
+                        </option>
+                        <option value="2"
+                                <?php if ($_GET['card_type'] == '2'){ ?>selected<?php } ?>>中石化
+                        </option>
+                        <option value="4"
+                                <?php if ($_GET['card_type'] == '4'){ ?>selected<?php } ?>>中国移动
+                        </option>
+                        <option value="5"
+                                <?php if ($_GET['card_type'] == '5'){ ?>selected<?php } ?>>中国联通
+                        </option>
+                        <option value="6"
+                                <?php if ($_GET['card_type'] == '6'){ ?>selected<?php } ?>>中国电信
+                        </option>
+                        <option value="7"
+                                <?php if ($_GET['card_type'] == '7'){ ?>selected<?php } ?>>增值业务
+                        </option>
+                        <option value="oil"
+                                <?php if ($_GET['card_type'] == 'oil'){ ?>selected<?php } ?>>油费
+                        </option>
+                        <option value="phone"
+                                <?php if ($_GET['card_type'] == 'phone'){ ?>selected<?php } ?>>手机费
+                        </option>
+                    </select>
+                </td>
+                <td>
+                    <a style="margin-left:15px;" href="javascript:void(0);" id="ncsubmit" class="btn-search "
+                       title="<?php echo $lang['nc_query']; ?>">&nbsp;
+                    </a>
+                </td>
+            </tr>
+        </table>
+        <table class="tb-type1 noborder search">
+            <tr>
+                <td>
+                     <a href="javascript:void(0);" id="order_query" class="btns" style="margin-right: 60px;">
+                        <span><i class="icon-edit"></i>更新待收货订单状态</span>
+                    </a>
+                    <a href="#" class="btns" onclick="hCopyOrder(event)">
+                        <span><i class="icon-edit"></i>拷贝我方订单号</span>
+                    </a>
+                    <a href="#" class="btns" onclick="hCopyMchOrder(event)">
+                        <span><i class="icon-edit"></i>拷贝商家单号</span>
+                    </a>
+                    <a href="#" class="btns" onclick="hCopyChannel(event)">
+                        <span><i class="icon-edit"></i>拷贝渠道单号</span>
+                    </a>
+                    <a href="#" class="btns" onclick="hCopyCardNo(event)">
+                        <span><i class="icon-edit"></i>拷贝充值卡号</span>
+                    </a>
+                    <a href="javascript:void(0);" id="ncexport" class="btns" style="margin: 0 60px;">
+                        <span><i class="icon-edit"></i>导出Excel</span>
+                    </a>
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    <a href="#" class="btns fail">
+                        <span><i class="icon-edit"></i>批量失败</span>
+                    </a>
+                </td>
+            </tr>
+        </table>
+    </form>
+    <table class="table tb-type2" id="prompt">
+        <tbody>
+        <tr class="space odd" id="autoClick">
+            <th colspan="12">
+                <div class="title" style="margin-top: 4px;"><h5>
+                        金额统计</h5><span class="arrow"></span>
+                </div>
+                <ul>
+                    <li class="lineLi" style="color:#000;">总计订单数量:<?php echo $output['stat']['order_count'] ?? 0 ?></li>
+                    <li class="lineLi" style="color:#000;">总计充值金额:<?php echo $output['stat']['refill_amounts'] ?? 0 ?></li>
+                    <li class="lineLi" style="color:#000;">超过30分钟订单数量:<?php echo $output['count'][0] ?? 0 ?></li>
+                    <li class="lineLi" style="color:#000;">超过1小时订单数量:<?php echo $output['count'][1] ?? 0 ?></li>
+                    <?php if ($_GET['time'] == 3) { ?>
+                        <li class="lineLi" style="color:#000;">超过3分钟订单数量:<?php echo $output['count'][2] ?? 0 ?></li>
+                    <?php } elseif ($_GET['time'] == 4) { ?>
+                        <li class="lineLi" style="color:#000;">超过5分钟订单数量:<?php echo $output['count'][2] ?? 0 ?></li>
+                    <?php } elseif ($_GET['time'] == 5) { ?>
+                        <li class="lineLi" style="color:#000;">超过10分钟订单数量:<?php echo $output['count'][2] ?? 0 ?></li>
+                    <?php } elseif ($_GET['time'] == 6) { ?>
+                    <li class="lineLi" style="color:#000;">超过15分钟订单数量:<?php echo $output['count'][2] ?? 0 ?></li>
+                    <?php } elseif ($_GET['time'] == 7) { ?>
+                        <li class="lineLi" style="color:#000;">超过两小时订单数量:<?php echo $output['count'][2] ?? 0 ?></li>
+                    <?php } ?>
+                </ul>
+            </th>
+        </tr>
+        <tr>
+            <td>
+                <ul id="merchant_stat">
+                    <?php if(!empty($output['merchant_stat'])) {
+                        foreach ($output['merchant_stat'] as $stat){
+                            ?>
+                            <li class="lineLi" style="color:#000;"><?php
+                                $name = $stat['company_name'] ??$stat['name'];
+                                echo "{$name} :{$stat['order_count']}";
+                                ?></li>
+                        <?php }}?>
+                </ul>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+    <table class="table tb-type2 nobdb">
+        <thead>
+            <tr class="thead">
+            <th class="align-center" id="selectAll"><input type="checkbox" name="chbox" value=""></th>
+            <th class="align-center">编号</th>
+            <th class="align-left">机构编号</th>
+            <th class="align-left">机构名称</th>
+            <th class="align-center">订单号</th>
+            <th class="align-left">充值卡号</th>
+            <th class="align-center">充值卡类型</th>
+            <th class="align-center">充值额度</th>
+            <th class="align-center">下单日期</th>
+            <th class="align-center">超时</th>
+            <th class="align-center">当前耗时</th>
+            <th class="align-center">总耗时</th>
+            <th class="align-center">订单状态</th>
+            <th class="align-center">通道质量</th>
+            <th class="align-left">失败原因</th>
+            <th class="align-left">商家单号</th>
+            <th class="align-left">扣款金额</th>
+            <th class="align-left">渠道单号</th>
+            <th class="align-left">渠道名称</th>
+            <th class="align-center"><?php echo $lang['nc_handle']; ?></th>
+        </tr>
+        </thead>
+        <tbody id="tbody">
+        <?php if (count($output['order_list']) > 0) { ?>
+            <?php
+            foreach ($output['order_list'] as $key => $order) { ?>
+                <tr class="hover trFlex" id="dataColor" data-timeout_State="<?php echo $order['time_out_state'];?>">
+                    <td class="align-center"><input type="checkbox" id="checkBoxList" name="checkbox" value="<?php echo $order['order_id'];?>"></td>
+                    <td class="align-center"><?php echo $key + 1; ?></td>
+                    <td class="align-left"><?php echo $order['mchid']; ?></td>
+                    <td class="align-left"><?php echo $order['mch_name']; ?></td>
+                    <td class="align-center"><?php echo $order['order_sn']; ?></td>
+                    <td class="align-left"><?php echo $order['card_no']; ?></td>
+                    <td class="align-center"><?php echo $order['card_type_text']; ?></td>
+                    <td class="align-center"><?php echo $order['refill_amount']; ?></td>
+                    <td class="align-center">
+                    <span class="doubleclick"  data-order="<?php echo $order['order_sn'];?>">
+                            <?php echo date('Y-m-d H:i:s', $order['order_time']); ?>
+                        </span>
+                    </td>
+                    <td class="align-center">
+                        <?php if (empty($order['notify_time'])) {
+                            if ($order['mtime_out'] > 180) {
+                                ?>
+                                <span style="color: #f30707"><?php echo $order['mtime_out_text'] ?></span>
+
+                            <?php } else { ?>
+                                <?php echo $order['mtime_out_text'] ?>
+                            <?php } ?>
+                        <?php } else { ?>
+                            <?php echo $order['mtime_out_text'] ?>
+                        <?php } ?>
+                    </td>
+                    <td class="align-center">
+                        <?php if (empty($order['notify_time'])) {
+                            if ($order['diff_time'] > 180) {
+                                ?>
+                                <span style="color: #f30707"><?php echo $order['diff_time_text'] ?></span>
+
+                            <?php } else { ?>
+                                <?php echo $order['diff_time_text'] ?>
+                            <?php } ?>
+                        <?php } else { ?>
+                            <?php echo $order['diff_time_text'] ?>
+                        <?php } ?>
+                    </td>
+                    <td class="align-center">
+                        <?php if (empty($order['notify_time'])) {
+                            if ($order['total_diff_time'] > 180) {
+                                ?>
+                                <span style="color: #f30707"><?php echo $order['total_diff_time_text'] ?></span>
+                            <?php } else {
+                                ?>
+                                <?php echo $order['total_diff_time_text'] ?>
+                            <?php } ?>
+                        <?php } else { ?>
+                            <?php echo $order['total_diff_time_text'] ?>
+                        <?php } ?>
+                    </td>
+                    <td class="align-center"><?php echo orderState($order); ?></td>
+                    <td class="align-center"><?php echo $order['quality_text']; ?></td>
+                    <td class="align-left"><?php echo $order['err_msg']; ?></td>
+                    <td class="align-left"><?php echo $order['mch_order']; ?></td>
+                    <td class="align-left"><?php echo $order['mch_amount']; ?></td>
+                    <td class="align-left" class="ch_trade_no"><?php echo $order['ch_trade_no']; ?></td>
+                    <td class="align-left"><?php echo $order['channel_name']; ?></td>
+                    <td class="w144 align-center">
+                        <a href="index.php?act=merchant&op=notify_merchant&order_id=<?php echo $order['order_id']; ?>">
+                            回调</a>
+                    </td>
+                </tr>
+            <?php } ?>
+        <?php } else { ?>
+            <tr class="no_data">
+                <td colspan="20"><?php echo $lang['nc_no_record']; ?></td>
+            </tr>
+        <?php } ?>
+        </tbody>
+        <tfoot>
+        <tr class="tfoot">
+            <td colspan="20" id="dataFuncs">
+                <div class="pagination"> <?php echo $output['show_page']; ?> </div>
+            </td>
+        </tr>
+        </tfoot>
+    </table>
+    <!-- 预警提示 -->
+    <audio id="auto" src="<?php echo RESOURCE_SITE_URL; ?>/warning.mp3"></audio>
+</div>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/laydate/laydate.js"></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/jquery-ui/i18n/zh-CN.js"
+        charset="utf-8"></script>
+<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.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"/>
+<link rel="stylesheet" type="text/css"
+      href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"/>
+<script type="text/javascript">
+    $(function () {
+        $('#ncsubmit').click(function () {
+            $('#formSearch').submit();
+        });
+        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
+        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
+        // 日期选择器
+        laydate.render({
+            elem: '#startTime',
+            type: 'datetime'
+        });
+        laydate.render({
+            elem: '#endTime',
+            type: 'datetime'
+        });
+
+        //双击
+        $('.doubleclick').dblclick(function() {
+            let order_sn = $(this).attr('data-order')
+            $.get('index.php?act=refill_order&op=showOrders', {
+                order_sn:order_sn
+            }, function(data) {
+                data = JSON.parse(data)
+                if (data.state == 1) {
+                let order_item = data.data
+                let html = '';
+                for (let i = 0; i < order_item.length; i++) {
+                    var item = order_item[i];
+                    html += `
+                    <tr>
+                        <td class="db-center">${item.order_sn}</td>
+                        <td class="db-center">${item.commit_time_text}</td>
+                        <td class="db-center">${item.notify_time_text}</td>
+                        <td class="db-center">${item.diff_time_text}</td>
+                        <td class="db-center">${item.order_state_text}</td>
+                        <td class="db-center">${item.channel_name}</td>
+                        <td class="db-center">${item.err_msg}</td>
+                        <td class="db-center">${item.close_reason}</td>
+                        <td class="db-center">${item.quality_text}</td>
+                    <tr>`
+                }
+
+                let content = `<table>
+                                <thead>
+                                    <tr>
+                                        <th class="db-right">订单号</th>
+                                        <th class="db-right">下单日期</th>
+                                        <th class="db-right">回调日期</th>
+                                        <th class="db-right">耗时</th>
+                                        <th class="db-right">订单状态</th>
+                                        <th class="db-right">供方名称</th>
+                                        <th class="db-right">错误原因(充值)</th>
+                                        <th class="db-right">错误原因(订单)</th>
+                                        <th class="db-right">订单质量</th>
+                                    </tr>
+                                </thead>
+                                <tbody>${html}</tbody>
+                                </table>`
+                layer.open({
+                title: `<span>共${data.count}单</span> <span class="db-top">回调状态:${data.mch_notify_state}</span> <span>回调次数:${data.mch_notify_times}</span>`,
+                content: content
+            });
+                } else {
+                    alert("没有此订单");
+                }
+            })
+        })
+         //全选
+        $('#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;
+                })
+            }
+        })
+        //批量失败
+        $('.fail').click(function() {
+            layer.confirm('您确定要批量失败', {
+                btn: ['确定', '取消'],
+                title: '批量失败'
+            }, function () {
+                let arr = [];
+                $("input:checkbox:checked").each(function (i) {
+                    arr[i] = $(this).val();
+                })
+                let str = arr.join(",");
+                let strr = str.substring(0, 1);
+                let number = Number(strr);
+                if (isNaN(number)) {
+                    let strrr = str.substring(1, str.length);
+                    window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=cancel&order_id= ${strrr ? strrr : ''}`
+                } else if(!isNaN(number) && str !== '') {
+                    window.location.href = `index.php?act=refill_order_manual&op=refill_order_batch_dispose&type=cancel&order_id= ${str ? str : ''}`
+                } else {
+                    layer.msg('请还没有任何操作,请先选择');
+                }
+            }, function () {layer.msg('取消成功');});
+        })
+
+        // 获取不包含客户
+        let selest_nc
+        let default_no_mch = $('input[name="default_no_mch"]').val().split(',');
+        $.get('index.php?act=refill_order&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,
+           autoRow: true,
+           height: '500px',
+           style: {
+             minHeight: '27px',
+             lineHeight: '27px',
+             marginLeft: '4px'
+           },
+           language: 'zn',
+           data: data
+         })
+        })
+        let isWring = '<?php echo $output['count'][1];?>';
+        let setTimer
+        let num
+        //if (Number(isWring) > 0) {
+        //    window.clearTimeout(setTimer)
+        //    setTimer = setTimeout(function () {
+        //        $("#auto")[0].play();
+        //        // $("#auto").attr("src", '<?php //echo RESOURCE_SITE_URL; ?>///warning.mp3');
+        //    }, 1000);
+        //    window.clearTimeout(num)
+        //    num = setTimeout(function () {
+        //        window.location.reload();
+        //    }, 60000);
+        //}
+        // 表格hover时背景
+        $('.trFlex').each(function () {
+            let data_color = $(this).attr('data-timeout_State');
+            if (data_color == 1) {
+                $(this).css('background', '#f1dde6')
+            } else if (data_color == 2) {
+                $(this).css('background', '#f2f3c6')
+            } else if (data_color == 3) {
+                $(this).css('background', '#ff7575')
+            } else if (data_color == 4) {
+                $(this).css('background', '#81C0C0')
+            } else {
+                $(this).css('background', '#fff')
+            }
+            $(this).hover(function () {
+                $(this)[0].style.backgroundColor = '#cbe9f3'
+            }, function () {
+                let data_color = $(this).attr('data-timeout_State');
+                if (data_color == 1) {
+                    $(this).css('background', '#f1dde6')
+                } else if (data_color == 2) {
+                    $(this).css('background', '#f2f3c6')
+                } else if (data_color == 3) {
+                    $(this).css('background', '#ff7575')
+                } else if (data_color == 4) {
+                    $(this).css('background', '#81C0C0')
+                } else {
+                    $(this).css('background', '#fff')
+                }
+            })
+        })
+        // 供方名称颜色
+        $('.textColor').each(function () {
+            let color = $(this).attr('data-color')
+            if (color == '1') {
+                $(this).css('color', 'green')
+            } else {
+                $(this).css('color', 'red')
+            }
+        })
+
+        // 更新待收货状态
+        $('#order_query').click(function () {
+
+            $('input[name="order_query"]').val('1');
+            $('input[name="op"]').val('index');
+            $('#formSearch').submit();
+            $('input[name="order_query"]').val('');
+            var ii = layer.load();
+            setTimeout(function(){
+                layer.close(ii);
+            }, 800);
+        });
+            // 导出
+    $('#ncexport').click(function () {
+        $('input[name="export"]').val('1');
+        $('input[name="op"]').val('index');
+        // 不包含客户
+        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="no_mchid"]').val(selectStr);
+        $('#formSearch').submit();
+        $('input[name="export"]').val('');
+        let ii = layer.load();
+        setTimeout(function(){
+            layer.close(ii);
+        }, 800);
+    })
+    });
+    function hCopyOrder(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(4).text()
+            str += res + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
+
+    function hCopyChannel(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(17).text()
+            str += res + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
+
+    function hCopyCardNo(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(5).text()
+            str += res + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
+
+    function hCopyMchOrder(e) {
+        let str = ''
+        $('#tbody tr').each(function () {
+            let res = $(this).find('td').eq(15).text()
+            str += res + '\n'
+        })
+        let oInput = document.createElement("textarea");
+        oInput.style.border = "0 none";
+        oInput.style.color = "transparent";
+        oInput.value = str;
+        document.body.appendChild(oInput);
+        oInput.select(); // 选择对象
+        document.execCommand("Copy"); // 执行浏览器复制命令
+        oInput.parentNode.removeChild(oInput)
+    }
+</script>

+ 1 - 0
admin/templates/default/refill.detail.monitor.php

@@ -78,6 +78,7 @@
                 <li><a href="JavaScript:void(0);" class="current"><span>接单记录监控</span></a></li>
                 <li><a href="index.php?act=ordersendlist&op=query_err"><span>机构查单错误列表</span></a></li>
                 <li><a href="index.php?act=ordersendlist&op=order_exception"><span>异常订单监控</span></a></li>
+                <li><a href="index.php?act=ordersendlist&op=monitor_transfer"><span>预回调订单列表</span></a></li>
             </ul>
         </div>
     </div>

+ 1 - 0
admin/templates/default/refill.order.exception.php

@@ -107,6 +107,7 @@
                         <?php }?>
                     </a>
                 </li>
+                <li><a href="index.php?act=ordersendlist&op=monitor_transfer"><span>预回调订单列表</span></a></li>
             </ul>
         </div>
     </div>

+ 1 - 0
admin/templates/default/refill.order.monitor.notify.php

@@ -86,6 +86,7 @@
                         <?php }?>
                     </a>
                 </li>
+                <li><a href="index.php?act=ordersendlist&op=monitor_transfer"><span>预回调订单列表</span></a></li>
             </ul>
         </div>
     </div>

+ 1 - 0
admin/templates/default/refill.order.neterr.index.php

@@ -74,6 +74,7 @@
                 <li><a href="index.php?act=ordersendlist&op=refill_detail_monitor"><span>接单记录监控</span></a></li>
                 <li><a href="index.php?act=ordersendlist&op=query_err"><span>机构查单错误列表</span></a></li>
                 <li><a href="index.php?act=ordersendlist&op=order_exception"><span>异常订单监控</span></a></li>
+                <li><a href="index.php?act=ordersendlist&op=monitor_transfer"><span>预回调订单列表</span></a></li>
             </ul>
         </div>
     </div>

+ 1 - 0
admin/templates/default/refill.order.notify.err.index.php

@@ -75,6 +75,7 @@
                 <li><a href="index.php?act=ordersendlist&op=refill_detail_monitor"><span>接单记录监控</span></a></li>
                 <li><a href="index.php?act=ordersendlist&op=query_err"><span>机构查单错误列表</span></a></li>
                 <li><a href="index.php?act=ordersendlist&op=order_exception"><span>异常订单监控</span></a></li>
+                <li><a href="index.php?act=ordersendlist&op=monitor_transfer"><span>预回调订单列表</span></a></li>
             </ul>
         </div>
     </div>

+ 1 - 0
admin/templates/default/refill.order.send.index.php

@@ -86,6 +86,7 @@
                         <?php }?>
                     </a>
                 </li>
+                <li><a href="index.php?act=ordersendlist&op=monitor_transfer"><span>预回调订单列表</span></a></li>
             </ul>
         </div>
     </div>

+ 1 - 0
admin/templates/default/refill.query.err.php

@@ -84,6 +84,7 @@
                         <?php }?>
                     </a>
                 </li>
+                <li><a href="index.php?act=ordersendlist&op=monitor_transfer"><span>预回调订单列表</span></a></li>
             </ul>
         </div>
     </div>