index.php 4.98 KB
<?php
use yii\helpers\Url;
use app\ht\widgets\LinkPager;
use common\helpers\ImageManager;
$this->title = '贴码预约申请';
$this->params['breadcrumbs'][] = '设备管理';
$this->params['breadcrumbs'][] = ['label' => '设备列表', 'url' => ['/device/device/index']];
$this->params['breadcrumbs'][] =  $this->title;
?>
<div class="panel panel-default">
    <div class="panel-body">
        <form action="" method="get" id="search-form" class="filter-form">
            <table width="100%">
                <tbody>
                <tr >
                    <td width="10%" class="text-right">联系人:</td>
                    <td width="40%"  class="text-left"><input type="text" class="form-control" name="connectName" value="<?=$gets['connectName'] ?>"></td>
                    <td width="10%" class="text-right">电话:</td>
                    <td width="40%"  class="text-left"><input type="number" class="form-control" name="mobile" value="<?=$gets['mobile'] ?>"></td>
                </tr>
                <tr>
                    <td width="10%" class="text-right">地址:</td>
                    <td width="40%"  class="text-left"><input type="text" class="form-control" id="address" name="address" value="<?=$gets['address'] ?>"></td>
                    <td width="10%" class="text-right">处理状态:</td>
                    <td width="40%"  class="text-left">
                        <select class="form-control" id="selstatus" name="selstatus">
                            <option value="0" >全部</option>
                            <option value="1" <?php if ($gets['selstatus']==1){ echo "selected='selected'"; } ?>>已处理</option>
                            <option value="2" <?php if ($gets['selstatus']==2){ echo "selected='selected'"; } ?>>未处理</option>
                        </select>
                    </td>
                </tr>
                <tr  class="search">
                    <td class="text-center" colspan="4">
                        <button type="submit" class="btn btn-primary" id="search"><i class="glyphicon glyphicon-search"></i> 查 询  </button>
                        <a class="btn btn-default" href="<?=Url::toRoute("/device/bind-device-appointment/index")?>">重&nbsp;&nbsp;&nbsp;&nbsp;置</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>
</div>
<div class="panel panel-default">
    <div  class="panel-body">
        <?php if (!empty($listdata)) : ?>
            <table class="table table-striped table-bordered"  id="brand-table">
                <thead>
                <tr>
                    <th style="width:5%;" class="text-center align-middle hqy-all-select">请求ID</th>
                    <th style="width:25%;">联系人</th>
                    <th style="width:20%;">联系电话</th>
                    <th style="width:10%;">地址</th>
                    <th style="width:10%;">状态</th>
                    <th style="width:15%;">创建时间</th>
                    <th style="width:10%;">操作</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach ($listdata as $item) : ?>
                    <tr>
                        <td class="text-center align-middle hqy-row-select"><?= $item['id'] ?></td>
                        <td >
                            <?= $item['connect_name'] ?>
                        </td>
                        <td >
                            <?= $item['mobile'] ?>
                        </td>
                        <td >
                            <?= $item['address'] ?>
                        </td>
                        <td >
                            <?= $item['status'] ?>
                        </td>
                        <td >
                            <?= $item['created_at'] ?>
                        </td>
                        <td >
                            <?php if ($item["status"] == "未处理"){ ?>
                                <a href="<?php echo Url::toRoute(['/device/bind-device-appointment/do-apply', 'id' => $item['id']])  ?>">处理</a> &nbsp;
                            <?php } ?>
                        </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>
    $(document).ready(function(){
        var filterUrl ='<?=Url::toRoute("/device/bind-device-appointment/index")?>';
        $(function(){
            $('#search').click(function(e){
                $('#search-form').attr('action',filterUrl);
                $('#search-form').submit();
                return false;
            })
        })
    });
</script>