save.blade.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <body class="gray-bg">
  7. <div class="wrapper wrapper-content animated fadeInRight">
  8. <div class="row">
  9. <div class="col-sm-12">
  10. <div class="ibox float-e-margins">
  11. <div class="ibox-content">
  12. <form class="form-horizontal" id="form">
  13. <div class="form-group">
  14. <label class="col-sm-2 control-label" for="agent_type">代理商类型:</label>
  15. <div class="col-sm-4">
  16. <select class="form-control" id="agent_type" name="agent_type">
  17. <option value="">请选择代理商</option>
  18. @foreach(\App\Http\Models\Agent::AGENT_TYPE as $inx=>$val)
  19. <option value="{{$inx}}"
  20. @if($data->agent_type??null==$inx) selected @endif>{{$val}}</option>
  21. @endforeach
  22. </select>
  23. </div>
  24. </div>
  25. {{--<div class="form-group">--}}
  26. {{--<label class="col-sm-2 control-label" for="user_id">人员:</label>--}}
  27. {{--<div class="col-sm-8 ">--}}
  28. {{--<select data-placeholder="选择人员..." style="width:350px;"--}}
  29. {{--class="chosen-select" id="user_id" name="user_id">--}}
  30. {{--<option value="">请选择人员</option>--}}
  31. {{--@foreach ($agentUsers as $item)--}}
  32. {{--<option value="{{$item->id}}"--}}
  33. {{--@if($item->id==($data->user_id??null)) selected @endif>{{$item->username}}</option>--}}
  34. {{--@endforeach--}}
  35. {{--</select>--}}
  36. {{--</div>--}}
  37. {{--</div>--}}
  38. <div class="form-group">
  39. <label class="col-sm-2 control-label" for="company_name">公司名称:</label>
  40. <div class="col-sm-8">
  41. <input type="text" class="form-control" id="company_name" name="company_name"
  42. value="{{$data->company_name ?? ''}}">
  43. </div>
  44. </div>
  45. <div class="form-group">
  46. <label class="col-sm-2 control-label" for="area">所在区域:</label>
  47. <div class="col-sm-8">
  48. <input type="text" class="form-control" id="area" name="area"
  49. value="{{$data->area??''}}">
  50. </div>
  51. </div>
  52. <div class="form-group">
  53. <label class="col-sm-2 control-label" for="channel_ids">渠道人员:</label>
  54. <div class="col-sm-8 ">
  55. <select data-placeholder="选择渠道人员..." style="width:350px;" multiple
  56. class="chosen-select" id="channel_ids" name="channel_ids">
  57. @foreach ($channels as $item)
  58. <option value="{{$item->id}}"
  59. @if(in_array($item->id,$hasChannels)) selected @endif>{{$item->username}}</option>
  60. @endforeach
  61. </select>
  62. </div>
  63. </div>
  64. <div class="form-group">
  65. <label class="col-sm-2 control-label" for="sign_at">签约时间:</label>
  66. <div class="col-sm-8">
  67. <input type="text" class="form-control" id="sign_at" name="sign_at"
  68. value="{{$data->sign_at??''}}">
  69. </div>
  70. </div>
  71. <div class="form-group">
  72. <label class="col-sm-2 control-label" for="contact_name">联系人:</label>
  73. <div class="col-sm-8">
  74. <input type="text" class="form-control" id="contact_name" name="contact_name"
  75. value="{{$data->contact_name??''}}">
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. <label class="col-sm-2 control-label" for="mobile">手机号:</label>
  80. <div class="col-sm-8">
  81. <input type="text" class="form-control" id="mobile" name="mobile"
  82. value="{{$data->mobile??''}}">
  83. </div>
  84. </div>
  85. <div class="form-group">
  86. <label class="col-sm-2 control-label" for="tencent">微信号/QQ号:</label>
  87. <div class="col-sm-8">
  88. <input type="text" class="form-control" id="tencent" name="tencent"
  89. value="{{$data->tencent??''}}">
  90. </div>
  91. </div>
  92. <div class="form-group">
  93. <label class="col-sm-2 control-label" for="discount">折扣:</label>
  94. <div class="col-sm-2">
  95. <input type="text" class="form-control" id="discount" name="discount"
  96. value="{{$data->discount??''}}" style="width: 100px;display: inline-block"> %
  97. </div>
  98. </div>
  99. <div class="form-group">
  100. <label class="col-sm-2 control-label" for="cash_deposit">保证金/预充值:</label>
  101. <div class="col-sm-8">
  102. <input type="text" class="form-control" id="cash_deposit" name="cash_deposit"
  103. value="{{$data->cash_deposit??''}}">
  104. </div>
  105. </div>
  106. <div class="hr-line-dashed"></div>
  107. <div class="form-group">
  108. <div class="col-sm-4 col-sm-offset-2">
  109. <button class="btn btn-primary" type="button"
  110. onclick="units.save({{$data->id??0}})">
  111. 保存
  112. </button>
  113. <button class="btn btn-white closeLayer" type="button" id="cancel">取消</button>
  114. </div>
  115. </div>
  116. </form>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </body>
  123. @endsection
  124. @section('footer')
  125. <script src="{{asset('js/plugins/chosen/chosen.jquery.js')}}"></script>
  126. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  127. <script>
  128. laydate.render({
  129. elem: '#sign_at', //指定元素
  130. type: 'datetime'
  131. });
  132. var config = {".chosen-select": {}};
  133. for (var selector in config) $(selector).chosen(config[selector]);
  134. var units = {
  135. save: function (id) {
  136. var data = tips.getFormValues('#form');
  137. data.channel_ids = $("#channel_ids").val();
  138. var ajaxConfig = {
  139. url: '/admin/agents/' + id,
  140. type: 'put',
  141. data: data,
  142. success: function (result) {
  143. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  144. window.parent.tips.tableRefresh('#table');
  145. tips.closeParentLayer();
  146. });
  147. }
  148. };
  149. tips.ajax(ajaxConfig);
  150. }
  151. };
  152. </script>
  153. @endsection