123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- @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">--}}
- <link rel="stylesheet"
- href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css">
- @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" autocomplete="off"
- value="{{$user->nickname ?? ''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="username_new"><span class="red">* </span>
- 用户名:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="username_new" name="username_new"
- value="{{$user->username ?? ''}}" autocomplete="off">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="password_new"><span class="red">* </span> 密码:</label>
- <div class="col-sm-8">
- <input type="password" class="form-control" id="password_new" name="password_new"
- 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="entry_time">入职时间:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control deadline" id="entry_time" name="entry_time" autocomplete="off"
- value="{{$user->entry_time??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="phone">手机号:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="phone" name="phone" autocomplete="off"
- 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" autocomplete="off"
- 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" autocomplete="off"
- value="{{$user->email??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="qq">qq号:</label>
- <div class="col-sm-8">
- <input type="email" class="form-control" id="qq" name="qq" autocomplete="off" value="{{$user->qq??''}}">
- </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" autocomplete="off">
- <option value="">请选择角色</option>
- @foreach ($roles as $role)
- <option data-type="{{$role->id}}" value="{{$role->id}}"
- @if(($user->role_id??null)==$role->id) selected @endif>{{$role->name}}</option>
- @endforeach
- </select>
- </div>
- </div>
- <div class="form-group" id="siteAssign">
- <label class="col-sm-2 control-label" for="site_ids">站点分配:</label>
- <div class="col-sm-8">
- <select class="selectpicker form-control"
- id="site_ids" name="site_ids" data-live-search="true" multiple
- title="请选择站点" autocomplete="off">
- <option value="">请选择站点</option>
- @foreach ($sites as $site)
- <option value="{{$site->id}}"
- @if(in_array($site->id,$hasSiteIds)) selected @endif>{{$site->cn_title}}</option>
- @endforeach
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="status">状态:</label>
- <div class="col-sm-8">
- <input type="checkbox" id="status" name="status" class="js-switch"
- @if(!$user || $user->status) checked @endif>
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-4 col-sm-offset-2">
- <button class="btn btn-primary" type="button" data-id="{{$user->id??0}}" id="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/switchery/switchery.js')}}"></script>
- <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
- <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js"></script>
- <script>
- //时间插件
- lay('.deadline').each(function () {
- laydate.render({
- elem: this
- , trigger: 'click'
- });
- });
- var jsSwitch = document.querySelector(".js-switch");
- new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
- $(document).on('click', '#cancel', function () {
- tips.closeParentLayer();
- });
- $(document).on('click', '#save', function () {
- var id = $(this).data('id');
- var url = '/admin/system/user';
- var type = 'post';
- if (id > 0) { //编辑
- url += '/' + id;
- type = 'put';
- }
- var data = tips.getFormValues('#form');
- data.status = jsSwitch.checked ? 1 : 0;
- data.site_ids = $("#site_ids").val();
- data.username = $("#username_new").val();
- data.password = $("#password_new").val();
- var ajaxConfig = {
- url: url,
- type: type,
- data: data,
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1500}, function () {
- tips.closeParentLayer();
- window.parent.tips.tableRefresh('#table');
- });
- }
- };
- tips.ajax(ajaxConfig);
- });
- </script>
- @endsection
|