123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- @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="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" id="siteAssign"--}}
- {{--style="@if(($user->role_id??null)!=\App\Http\Models\Role::TYPE_CUSTOMER) display:none @endif">--}}
- {{--<label class="col-sm-2 control-label" for="site_id">站点分配:</label>--}}
- {{--<div class="col-sm-8">--}}
- {{--<select data-placeholder="选择站点..." class="chosen-select" style="width:350px;"--}}
- {{--id="site_id" name="site_id">--}}
- {{--<option value="">请选择站点</option>--}}
- {{--@foreach ($sites as $site)--}}
- {{--<option value="{{$site->id}}"--}}
- {{--@if(($site->site_id??null)==$site->id) 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/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>--}}
- <!-- Latest compiled and minified JavaScript -->
- <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js"></script>
- <!-- (Optional) Latest compiled and minified JavaScript translation files -->
- <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/i18n/defaults-*.min.js"></script>
- <script>
- // 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 = {
- {{--selectRole: function (_this) {--}}
- {{--// var type = $(_this).find("option:selected").data('type');--}}
- {{--var type = $(_this).val();--}}
- {{--if (type === "{{\App\Http\Models\Role::TYPE_CUSTOMER}}") {--}}
- {{--$("#siteAssign").css('display', '');--}}
- {{--// var selectConfig = {".chosen-select": {}};--}}
- {{--// for (var selectorItem in selectConfig) {--}}
- {{--// $(selectorItem).chosen(selectConfig[selectorItem]);--}}
- {{--// }--}}
- {{--} else {--}}
- {{--$("#siteAssign").css('display', 'none');--}}
- {{--}--}}
- {{--}--}}
- };
- $(document).on('click', '#cancel', function () {
- tips.closeParentLayer();
- });
- $(document).on('click', '#save', function () {
- var id = $(this).data('id');
- var url = '/admin/customer/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
|