info.php 3.38 KB
<?php

use yii\helpers\Url;
use domain\user\User as UserStatus;
$this->title = '维修厂详情';
$this->params['breadcrumbs'][] = '维修厂管理';
$this->params['breadcrumbs'][] = ['label' => '维修厂列表', 'url' => ['/maintainer/user/index']];
$this->params['breadcrumbs'][] =  $this->title;


?>
<style>
    .imgs-class{margin:0;padding:0;list-style: none}
    .imgs-class li{margin:0;padding:0;width:150px;list-style: none;float:left;padding-right:1rem;box-sizing: border-box}
    .imgs-class li img{width:100%;}
    textarea {border-radius: 4px;}

</style>
<div class="panel panel-default">
    <div id="warning"></div>

    <input type="hidden" value="<?=$user['uuid'] ?>" name="uuid" id="uuid" >

    <div class="panel-body">
        <table class="table table-bordered">
            <tr>
                <td colspan="4" class="bg-info">维修厂信息</td>
            </tr>
            <tr>
                <th width="100">维修厂名称</th>
                <td width="350">
                    <?=$user['name']; ?>
                </td>

                <th width="100">状态</th>
                <td >
                    <?=$user['status_label']?>
                    <?php
                    if (UserStatus::STATUS_APPROVE != $user['status']): ?>
                    <a href="javascript:void(0)" class="btn btn-primary approve-btn">审核通过</a>
                    <?php endif;?>
                </td>
            </tr>
            <tr>
                <th>维修厂电话</th>
                <td><?=$user['mobile']; ?></td>

                <th>注册时间</th>
                <td><?=date('Y-m-d H:i:s', $user['created_at']); ?></td>
            </tr>
            <tr>
                <th>紧急联系人</th>
                <td><?=$user['emergencyPerson']; ?></td>

                <th>紧急联系电话</th>
                <td><?=$user['emergencyContact']; ?></td>
            </tr>
            <tr>
                <th>维修厂地址</th>
                <td colspan="3"><?=$user['address']; ?></td>
            </tr>
            <tr>
                <th>营业执照</th>
                <td><a target="_blank" href="<?=$user['licensePic']; ?>"><img width="150" src='<?=$user["licensePicMin"]?>' /></a></td>

                <th>门头照</th>
                <td><a target="_blank" href="<?=$user['factoryHeadPic']; ?>"><img width="150" src='<?=$user["factoryHeadPic"]?>' /></a></td>
            </tr>

            <tr>
                <th>维修技术负责人证书</th>
                <td><a target="_blank" href="<?=$user['techChargePic']; ?>"><img width="150" src='<?=$user["techChargePic"]?>' /></a></td>

                <th>质检负责人证书</th>
                <td><a target="_blank" href="<?=$user['qaChargePic']; ?>"><img width="150" src='<?=$user["qaChargePic"]?>' /></a></td>
            </tr>
        </table>
    </div>

</div>
<script>
    var approveURL = '<?=Url::to("approve") ?>';
    $(function() {
        $('.approve-btn').click(function(e) {
            var uuid = $('#uuid').val();
            if(!confirm('确定审核通过该维修厂')) {
                return false;
            }
            $.post(approveURL,{id:uuid}, function(res) {
                if (res.success) {
                    alert(res.message);
                    window.parent.document.getElementById('x-iframe').contentWindow.location.reload(true);
                }
            }, 'json')
        })
    })
</script>