order-number.php 3.18 KB
<?php

use yii\helpers\Url;
use app\ht\widgets\LinkPager;
use domain\trade\RepairOrderStatus;


$this->title = '订单使用虚拟号';
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="panel panel-default">

    <div  class="panel-body">
        <?php if (!empty($rList)) : ?>
            <table class="table table-striped table-bordered"  id="brand-table">
                <thead>
                <tr>
                    <th>订单号</th>
                    <th style="width:10%;">订单状态</th>
                    <th >下单时间</th>
                    <th >虚拟号码</th>
                    <th >用户号码</th>
                    <th >工程师号</th>
                    <th>绑定时间</th>
                    <th >发起绑定</th>

                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach ($rList as $item) : ?>
                    <tr>
                        <td>
                            <?= $item['order_no'] ?>
                        </td>
                        <td>
                            <?= RepairOrderStatus::statusLabels($item['order_status']) ?>
                        </td>
                        <td>
                            <?= date('Y-m-d H:i:s', $item['created_at']) ?>
                        </td>
                        <td >
                            <?= $item['virtual_number'] ?>
                        </td>
                        <td >
                            <?= $item['a_party'] ?>
                        </td>
                        <td >
                            <?= $item['b_party'] ?>
                        </td>
                        <td>
                            <?= date('Y-m-d H:i:s', $item['bind_at']) ?>
                        </td>
                        <td>
                            <?= $item['bind_desc'] ?>
                        </td>
                        <td >
                            <a href="javascript:void(0)" data-id="<?= $item['id']  ?>" class="unbindBtn btn" role="button">解绑</a>

                        </td>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
        <?php else : ?>
            <p class="text-center">
                没有找到数据
            </p>
        <?php endif; ?>
    </div>

    <div class="panel-footer">
        <div class="hqy-panel-pager">
            <?= LinkPager::widget([
                'pagination' => $pages,
            ]); ?>
            <div class="clearfix"></div>
        </div>
    </div>
</div>

<script>
$(function(){
    var unBindURL = '<?= Url::toRoute(['/setting/private-number/unbind-number']); ?>';
    $('.unbindBtn').click(function(){
        if (!confirm('确定解绑?')) {
            return false;
        }
        $(this).addClass('disabled');

        var bind_id = $(this).attr('data-id');
        $.post(unBindURL, {
            id:bind_id
        }, function(res){
            $(this).removeClass('disabled');
            if (true == res.succes) {
                window.location.reload();
            } else {
                alert(res.error)
            }
        },'json' )
    })
})
</script>