set_customer_service.php 2.51 KB
<?php
use yii\helpers\Url;
use app\ht\helpers\CssFiles;


$this->title =  "设置客服人员";
$this->params['breadcrumbs'][] = '系统管理';
$this->params['breadcrumbs'][] = $this->title;

CssFiles::register($this, 'exts/base/1.0.0/ui/select2/select2-1.0.0.css');
CssFiles::register($this, 'exts/base/1.0.0/ui/select2/select2-bootstrap-1.0.0.css');

?>



<form action="<?php echo Url::toRoute(['/system/config/do-set-customer-service']); ?>" name="customerForm" id="customerForm" method="post">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">设置客服人员</h3>
        </div>
        <div class="panel-body">
            <table  class="panel-box-tb">
                <thead>
                <tr>
                    <th width="20%"></th>
                    <th width="30%"></th>
                </tr>
                </thead>
                <tbody>

                <tr>
                    <td class="text-right">
                        <b>客服人员:</b>
                    </td>
                    <td>
                        <select name="customers[]" id="customer-select" class="form-control" multiple class="required">
                            <?php foreach ($customers as $customerId => $r) : ?>
                                <option value="<?= $r['sys_user_id'] ?>" <?php if (in_array($r['sys_user_id'], $selectedCustomers))  echo 'selected' ?> ><?=$r['realname'] . "(" . $r["username"] . ")" . $r['mobile'] ?></option>
                            <?php endforeach; ?>
                        </select>
                    </td>
                </tr>

                <tr>
                    <td colspan="2"></td>
                </tr>


                <tr>
                    <td></td>
                    <td>
                        <button type="submit" class="btn btn-primary" id="save">提&nbsp;&nbsp;交</button>&nbsp;&nbsp;&nbsp;&nbsp;
                        <a class="btn btn-default" href="<?php echo Url::toRoute('/system/config/set-config'); ?>">重&nbsp;&nbsp;&nbsp;&nbsp;置</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

    </div>

</form>


<script>
    seajs.use("base/1.0.0/ui/select2/select2-1.0.0",function  () {
        $( "#customer-select" ).select2({
            theme: "bootstrap"
        });
    });

    // 表单提交验证
    seajs.use("base/1.0.0/unit/validate/custom-1.0.0",function  () {
        var validator = $("#customerForm").validate({
        });
    });
</script>