123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- @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">
- <style>
- .upload_img {
- height: 150px;
- }
- </style>
- @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="head">首付:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="head" name="head"
- value="{{$data->head??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">首付快照:</label>
- <div class="col-sm-2">
- <button type="button" class="btn btn-primary" name="file_upload">文件上传
- </button>
- <input type="file" value="" style="display: none" name="uploadFile"
- data-for="head_img">
- <input type="hidden" id="head_pic" name="head_pic" value="{{$data->head_pic??''}}">
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-8 col-sm-offset-2">
- <img id="head_img" class="upload_img" src="{{$data->head_pic??''}}">
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="done">交款:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="done" name="done"
- value="{{$data->done??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="done_pic">交款快照:</label>
- <div class="col-sm-2">
- <button type="button" class="btn btn-primary" name="file_upload">文件上传
- </button>
- <input type="file" value="" style="display: none" name="uploadFile"
- data-for="done_img">
- <input type="hidden" id="done_pic" name="done_pic"
- value="{{$data->done_pic??''}}">
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-8 col-sm-offset-2">
- <img id="done_img" class="upload_img" src="{{$data->done_pic??''}}">
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="reach">尾款:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="reach" name="reach"
- value="{{$data->reach??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="reach_pic">尾款快照:</label>
- <div class="col-sm-2">
- <button type="button" class="btn btn-primary" name="file_upload">文件上传
- </button>
- <input type="file" value="" style="display: none" name="uploadFile"
- data-for="reach_img">
- <input type="hidden" class="form-control" id="reach_pic" name="reach_pic"
- value="{{$data->reach_pic??''}}">
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-8 col-sm-offset-2">
- <img id="reach_img" class="upload_img" src="{{$data->reach_pic??''}}">
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="renewal">续费:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="renewal" name="renewal"
- value="{{$data->renewal??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="renewal_pic">续费快照:</label>
- <div class="col-sm-8">
- <button type="button" class="btn btn-primary" name="file_upload">文件上传
- </button>
- <input type="file" value="" style="display: none" name="uploadFile"
- data-for="renewal_img">
- <input type="hidden" id="renewal_pic" name="renewal_pic"
- value="{{$data->renewal_pic??''}}">
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-8 col-sm-offset-2">
- <img id="renewal_img" class="upload_img" src="{{$data->renewal_pic??''}}">
- </div>
- </div>
- <div class="hr-line-dashed"></div>
- <div class="form-group">
- <div class="col-sm-4 col-sm-offset-2">
- <button class="btn btn-primary" type="button" data-id="{{$data->id??$siteId}}"
- id="save">
- 保存
- </button>
- <button class="btn btn-white closeLayer" type="button">取消</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/layDate-v5.0.9/laydate/laydate.js')}}"></script>
- <script>
- $(document).on('click', '#save', function () {
- var id = $(this).data('id');
- var url = '/admin/sites/payment/' + id;
- var data = tips.getFormValues('#form');
- var ajaxConfig = {
- url: url,
- type: 'put',
- data: data,
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- tips.closeParentLayer();
- window.parent.tips.tableRefresh('#table');
- });
- }
- };
- tips.ajax(ajaxConfig);
- });
- $(document).on('click', '[name=file_upload]', function () {
- $(this).next().trigger('click');
- });
- $(document).on('change', '[name=uploadFile]', function () {
- var _this = this;
- if (!$(this)[0].files[0]) {
- return;
- }
- var formData = new FormData();
- formData.append('file', $(this)[0].files[0]);
- var ln;
- $.ajax({
- url: '/admin/tool/upload',
- type: 'POST',
- cache: false,
- data: formData,
- processData: false,
- contentType: false,
- beforeSend: function () {
- ln = layer.load();
- },
- complete: function () {
- layer.close(ln);
- },
- success: function (result) {
- var data = result.data;
- $('#' + $(_this).data('for')).attr('src', data.file_url);
- $(_this).next().val(data.file_url);
- },
- error: function (XMLHttpRequest) {
- if (XMLHttpRequest.status === 500) {
- layer.alert("异步请求失败", {icon: 5});
- return;
- }
- layer.alert(JSON.parse(XMLHttpRequest.responseText).message, {icon: 0});
- }
- });
- });
- </script>
- @endsection
|