123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- @extends('admin/layout')
- @section('header')
- <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
- <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
- <link href="{{asset('js/plugins/bootstrap-select-1.13.5/css/bootstrap-select.min.css')}}" rel="stylesheet">
- @endsection
- @section('content')
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <form method="get" class="form-horizontal" id="form">
- <div class="form-group">
- <label class="col-sm-2 control-label" for="nickname"><span class="red">*</span> 昵称:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="nickname" name="nickname"
- value="{{$user->nickname ?? ''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="username"><span class="red">*</span>用户名:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="username" name="username"
- value="{{$user->username ?? ''}}" autocomplete="off">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="password"><span class="red">*</span> 密码:</label>
- <div class="col-sm-8">
- <input type="password" class="form-control" id="password" name="password"
- autocomplete="off">
- @if($user) <span class="help-block m-b-none">如果不需要修改密码请设为空</span> @endif
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="phone"><span class="red">*</span> 手机号:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="phone" name="phone"
- value="{{$user->phone??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="telephone">座机:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="telephone" name="telephone"
- value="{{$user->telephone??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="email">邮箱:</label>
- <div class="col-sm-8">
- <input type="email" class="form-control" id="email" name="email"
- value="{{$user->email??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="role_id"><span class="red">*</span> 角色:</label>
- <div class="col-sm-8">
- <select class="form-control" style="width:350px;"
- id="role_id" name="role_id">
- <option value="">请选择角色</option>
- @foreach($roles as $role)
- <option value="{{$role->id}}" @if(($user->role_id??0)==$role->id) selected @endif>{{$role->name}}</option>
- @endforeach
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="agent_id"><span class="red">*</span> 代理商:</label>
- <div class="col-sm-8">
- <select class="form-control" style="width:350px;"
- id="role_id" name="agent_id">
- <option value="">请选择代理商</option>
- @foreach($agents as $agent)
- <option value="{{$agent->id}}" @if(($user->agent_id??0)==$agent->id) selected @endif>{{$agent->company_name}}</option>
- @endforeach
- </select>
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-4 col-sm-offset-2">
- <button class="btn btn-primary" type="button" onclick="units.save()">
- 保存
- </button>
- <button class="btn btn-white" type="button" id="cancel">取消</button>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- @endsection
- @section('footer')
- <script src="{{asset('js/plugins/chosen/chosen.jquery.js')}}"></script>
- <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
- <script src="{{asset('js/plugins/bootstrap-select-1.13.5/js/bootstrap-select.min.js')}}"></script>
- <script src="{{asset('js/plugins/bootstrap-select-1.13.5/js/i18n/defaults-zh_CN.min.js')}}"></script>
- <script>
- // $(function () {
- // var config = {".chosen-select": {}};
- // for (var selector in config) $(selector).chosen(config[selector]);
- // });
- var config = {".chosen-select": {}};
- for (var selector in config) $(selector).chosen(config[selector]);
- var jsSwitch = document.querySelector(".js-switch");
- new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
- var units = {
- save: function () {
- var url = '/admin/agents/users/{{$user->id??0}}';
- var data = tips.getFormValues('#form');
- var ajaxConfig = {
- url: url,
- type: 'put',
- data: data,
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1500}, function () {
- tips.closeParentLayer();
- window.parent.tips.tableRefresh('#table');
- });
- }
- };
- tips.ajax(ajaxConfig);
- }
- };
- $(document).on('click', '#cancel', function () {
- tips.closeParentLayer();
- });
- </script>
- @endsection
|