123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- @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\Agent::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="user_id">人员:</label>--}}
- {{--<div class="col-sm-8 ">--}}
- {{--<select data-placeholder="选择人员..." style="width:350px;"--}}
- {{--class="chosen-select" id="user_id" name="user_id">--}}
- {{--<option value="">请选择人员</option>--}}
- {{--@foreach ($agentUsers as $item)--}}
- {{--<option value="{{$item->id}}"--}}
- {{--@if($item->id==($data->user_id??null)) selected @endif>{{$item->username}}</option>--}}
- {{--@endforeach--}}
- {{--</select>--}}
- {{--</div>--}}
- {{--</div>--}}
- <div class="form-group">
- <label class="col-sm-2 control-label" for="company_name">公司名称:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="company_name" name="company_name"
- value="{{$data->company_name ?? ''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="area">所在区域:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="area" name="area"
- value="{{$data->area??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="channel_ids">渠道人员:</label>
- <div class="col-sm-8 ">
- <select data-placeholder="选择渠道人员..." style="width:350px;" multiple
- class="chosen-select" id="channel_ids" name="channel_ids">
- @foreach ($channels as $item)
- <option value="{{$item->id}}"
- @if(in_array($item->id,$hasChannels)) selected @endif>{{$item->username}}</option>
- @endforeach
- </select>
- </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="form-group">
- <label class="col-sm-2 control-label" for="contact_name">联系人:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="contact_name" name="contact_name"
- value="{{$data->contact_name??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="mobile">手机号:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="mobile" name="mobile"
- value="{{$data->mobile??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="tencent">微信号/QQ号:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="tencent" name="tencent"
- value="{{$data->tencent??''}}">
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="discount">折扣:</label>
- <div class="col-sm-2">
- <input type="text" class="form-control" id="discount" name="discount"
- value="{{$data->discount??''}}" style="width: 100px;display: inline-block"> %
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label" for="cash_deposit">保证金/预充值:</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="cash_deposit" name="cash_deposit"
- value="{{$data->cash_deposit??''}}">
- </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');
- data.channel_ids = $("#channel_ids").val();
- var ajaxConfig = {
- url: '/admin/agents/' + 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);
- }
- };
- </script>
- @endsection
|