salesman_list.html 4.8 KB
<include file="public@header"/>
</head>
<body>
<style>
    .pagination{text-align:center;margin-top:20px;margin-bottom: 20px;}
    .pagination li{margin:0px 10px; border:1px solid #e6e6e6;padding: 3px 8px;display: inline-block;}
    .pagination .active{background-color: #dd1a20;color: #fff;}
    .pagination .disabled{color:#aaa;}
</style>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#">业务员列表</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('Salesman/salesman_list')}">
<!--        时间:-->
<!--        <input type="text" class="form-control js-bootstrap-datetime" name="start_time"-->
<!--               value="{$start_time|default=''}"-->
<!--               style="width: 140px;" autocomplete="off">- -->
<!--        <input type="text" class="form-control js-bootstrap-datetime" name="end_time"-->
<!--               value="{$end_time|default=''}"-->
<!--               style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;-->
        序号:
        <input type="text" class="form-control" name="id" style="width: 200px;"
               value="{$id|default=''}" placeholder="请输入序号">
        关键字:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入手机号/微信昵称">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('Salesman/salesman_list')}">清空</a>
    </form>
    <table class="table table-hover table-bordered table-list">
        <thead>
        <tr>
            <th>序号</th>
            <th>微信昵称</th>
            <th>手机号</th>
            <th>历史总收入</th>
            <th>已提金额</th>
            <th>余额</th>
            <th>平台佣金比例</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <volist name="data_arr" id="vo">
            <tr>
                <td>{$vo.id}</td>
                <td>{$vo.name}</td>
                <td>{$vo.phone}</td>
                <td>{$vo.all_count}</td>
                <td>{$vo.ti_count}</td>
                <td>{$vo.balance}</td>
                <td>{$vo.money}</td>
                <td>{$vo.audit_time|date="Y-m-d H:i:s",###}</td>
                <td style="width: 440px;">
                    <a href="{:url('Salesman/salesman_edit',array('uid'=>$vo.uid))}"><button type="button" class="btn btn-default bianji{$vo.id}">编辑查看</button></a>
                    <if condition="$vo.is_pro eq 1">
                        <button type="button" class="btn btn-default pro{$vo.id}" onclick="is_pro({$vo.id})">取消推广</button>
                        <else/>
                        <button type="button" style="background-color: red;" class="btn btn-default pro{$vo.id}" onclick="re_pro({$vo.id})">恢复推广</button>
                    </if>

                    <a href="{:url('Salesman/salesman_goods_list',array('uid'=>$vo.uid))}"><button type="button" class="btn btn-default">商品管理</button></a>
                    <a href="{:url('Salesman/teacher_list',array('id'=>$vo.id))}"><button type="button" class="btn btn-default">下线名单</button></a>
                    <a href="{:url('Salesman/salesman_money',array('uid'=>$vo.uid))}">
                        <button type="button" class="btn btn-default">余额明细</button>
                    </a>
                </td>
            </tr>
        </volist>
        </tbody>
    </table>
</div>
<div class="pagination">
    {$data->render()}
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    /**
     *取消推广
     */
    function is_pro(id){
        ccc = window.confirm('确定取消推广?');
        if(ccc){
            $.post("{:url('Salesman/salesman_list_no_pro')}",{id:id},function(data){
                if(data){
                    $('.pro'+id).remove();
                    $('.bianji'+id).parent().after("<button type='button' style='background-color: red;' class='btn btn-default pro"+id+"' onclick='re_pro("+id+")'>恢复推广</button>");
                }else{
                    alert('取消推广失败!');
                }
            });
        }
    }

    /**
     *恢复推广
     */
    function re_pro(id){
        ccc = window.confirm('确定恢复推广?');
        if(ccc){
            $.post("{:url('Salesman/salesman_list_yes_pro')}",{id:id},function(data){
                if(data){
                    $('.pro'+id).remove();
                    $('.bianji'+id).parent().after("<button type='button' class='btn btn-default pro"+id+"' onclick='is_pro("+id+")'>取消推广</button>");
                }else{
                    alert('恢复推广失败!');
                }
            });
        }
    }

</script>
</body>
</html>