123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- @extends('admin/layout')
- @section('header')
- <link href="{{asset('css/plugins/chosen/chosen.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 class="form-horizontal" id="form">
- {{--<div class="form-group">--}}
- {{--<label class="col-sm-2 control-label" for="agent_type">代理商类型:</label>--}}
- {{--<div class="col-sm-4">--}}
- {{--<select class="form-control" id="agent_type" name="agent_type">--}}
- {{--<option value="">请选择代理商</option>--}}
- {{--@foreach(\App\Http\Models\AgentSeller::AGENT_TYPE as $inx=>$val)--}}
- {{--<option value="{{$inx}}"--}}
- {{--@if($data->agent_type??null==$inx) selected @endif>{{$val}}</option>--}}
- {{--@endforeach--}}
- {{--</select>--}}
- {{--</div>--}}
- {{--</div>--}}
- <div class="form-group">
- <label class="col-sm-2 control-label" for="title"><span class="red">* </span>名称:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="title" name="title"
- value="{{$data->title ?? ''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="site_id"><span class="red">* </span>关联站点:</label>
- <div class="col-sm-8 ">
- <select data-placeholder="选择关联站点..." style="width:350px;"
- class="chosen-select" id="site_id" name="site_id">
- <option value="">请选择关联站点</option>
- @foreach ($sites as $item)
- <option value="{{$item->id}}"
- @if($item->id==($data->site_id??null)) selected @endif>{{$item->cn_title}}</option>
- @endforeach
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="amount"><span class="red">* </span>金额:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="amount" name="amount"
- value="{{$data->amount??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label"><span class="red">* </span>合同文件:</label>
- <div class="col-sm-8">
- <button type="button" class="btn btn-primary" onclick="units.triggerFile(this)">
- 文件上传
- </button>
- <input type="file" value="" style="display: none" onchange="units.fileUpload(this)">
- <a href="{{$data->contract_file['url']??''}}"
- id="contract_file" download="{{$data->contract_file['origin']??''}}">{{$data->contract_file['origin']??''}}</a>
- {{--<input type="hidden" id="contract_file" name="contract_file" value="{{$data->contract_file??''}}" onchange="units.fileUpload(this)">--}}
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="remark">备注:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="remark" name="remark"
- value="{{$data->remark??''}}">
- </div>
- </div>
- {{--<div class="form-group">--}}
- {{--<label class="col-sm-2 control-label" for="sign_at">签约时间:</label>--}}
- {{--<div class="col-sm-8">--}}
- {{--<input type="text" class="form-control" id="sign_at" name="sign_at"--}}
- {{--value="{{$data->sign_at??''}}">--}}
- {{--</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"
- onclick="units.save({{$data->id??0}})">
- 保存
- </button>
- <button class="btn btn-white closeLayer" 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/layDate-v5.0.9/laydate/laydate.js')}}"></script>
- <script>
- // laydate.render({
- // elem: '#sign_at', //指定元素
- // type: 'datetime'
- // });
- var config = {".chosen-select": {}};
- for (var selector in config) $(selector).chosen(config[selector]);
- var units = {
- save: function (id) {
- var data = tips.getFormValues('#form');
- var contract_file = $("#contract_file");
- data.contract_file = {origin: contract_file.text(), url: contract_file.data('val')};
- var ajaxConfig = {
- url: '/admin/lading-bills/' + id,
- type: 'put',
- data: data,
- success: function (result) {
- layer.msg(result.message, {icon: 6, time: 1000}, function () {
- window.parent.tips.tableRefresh('#table');
- tips.closeParentLayer();
- });
- }
- };
- tips.ajax(ajaxConfig);
- },
- triggerFile: function (_this) { //文件上传
- $(_this).next().trigger('click');
- },
- fileUpload: function (_this) {
- var config = {
- url: '/admin/tool/upload'
- };
- config.success = function (result) {
- console.log(result);
- layer.msg(result.message, {icon: 6, time: 1500});
- $("#contract_file").attr('href', result.data.file_url)
- .text(result.data.original_name).attr('download',result.data.original_name);
- };
- tips.fileUpload(_this, config);
- }
- };
- </script>
- @endsection
|