introduce_add.blade.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
  5. <link rel="stylesheet"
  6. href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css">
  7. @endsection
  8. @section('content')
  9. <body class="gray-bg">
  10. <div class="wrapper wrapper-content animated fadeInRight">
  11. <div class="row">
  12. <div class="col-sm-12">
  13. <div class="ibox float-e-margins">
  14. <div class="ibox-content">
  15. <form method="get" class="form-horizontal" id="form">
  16. <input type="hidden" name="site_id" id="site_id" value="{{$siteId}}">
  17. <div class="form-group">
  18. <label class="col-sm-2 control-label" for="customer_name"><span
  19. class="red">* </span>客户姓名 :</label>
  20. <div class="col-sm-6">
  21. <input type="text" class="form-control" id="customer_name" name="customer_name"
  22. autocomplete="off" value="{{$info->customer_name??''}}">
  23. </div>
  24. </div>
  25. <div class="form-group">
  26. <label class="col-sm-2 control-label" for="tel"><span class="red">* </span>电话:</label>
  27. <div class="col-sm-6">
  28. <input type="text" class="form-control" id="tel" name="tel"
  29. value="{{$info->tel??''}}" autocomplete="off">
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. <label class="col-sm-2 control-label" for="position"><span class="red">* </span>
  34. 职位:</label>
  35. <div class="col-sm-6">
  36. <select class="form-control" id="position" name="position">
  37. @foreach($roleList as $key=>$item)
  38. <option value="{{$key}}"
  39. @if (!empty($info->position) && $info->position==$key) selected @endif>{{$item}}</option>
  40. @endforeach
  41. </select>
  42. </div>
  43. </div>
  44. <div class="form-group">
  45. <label class="col-sm-2 control-label" for="order_volume"><span
  46. class="red">* </span>订单成交量:</label>
  47. <div class="col-sm-6">
  48. <select class="form-control"
  49. id="order_volume" name="order_volume">
  50. @foreach($orderVolumeList as $key=>$item)
  51. <option value="{{$key}}"
  52. @if (!empty($info->order_volume) && $info->order_volume==$key) selected @endif>{{$item}}</option>
  53. @endforeach
  54. </select>
  55. </div>
  56. </div>
  57. <div class="form-group">
  58. <label class="col-sm-2 control-label" for="gift_name"><span
  59. class="red">* </span>礼品名称:</label>
  60. <div class="col-sm-6">
  61. <select class="form-control"
  62. id="gift_name" name="gift_name">
  63. @foreach($giftList as $key=>$item)
  64. @if(in_array($key,[3,4]))
  65. <option value="{{$key}}"
  66. @if (!empty($info->gift_name) && $info->gift_name==$key) selected @endif>{{$item}}</option>
  67. @endif
  68. @endforeach
  69. </select>
  70. </div>
  71. </div>
  72. <div class="form-group">
  73. <label class="col-sm-2 control-label" for="gift_amount"><span class="red">* </span>礼品金额(元):</label>
  74. <div class="col-sm-6">
  75. <input type="text" class="form-control" id="gift_amount" name="gift_amount"
  76. value="{{$info->gift_amount??''}}" autocomplete="off">
  77. </div>
  78. </div>
  79. <div class="form-group">
  80. <label class="col-sm-2 control-label" for="gift_time"><span
  81. class="red">* </span>送礼时间:</label>
  82. <div class="col-sm-6">
  83. <input type="text" class="form-control my-date deadline"
  84. name="gift_time" id="gift_time"
  85. value="{{$info->gift_time??''}}" autocomplete="off">
  86. </div>
  87. </div>
  88. <div class="form-group">
  89. <label class="col-sm-2 control-label" for="transaction_customer"><span
  90. class="red">* </span>
  91. 成交客户:</label>
  92. <div class="col-sm-6">
  93. <input type="text" class="form-control" id="transaction_customer"
  94. name="transaction_customer"
  95. value="{{$info->transaction_customer??''}}" autocomplete="off">
  96. </div>
  97. </div>
  98. <div class="form-group">
  99. <label class="col-sm-2 control-label" for="remark">
  100. 备注:</label>
  101. <div class="col-sm-6">
  102. <textarea name="remark" id="remark"
  103. style="width: 100%;height: 100px ;border: 1px solid #e5e6e7;">{{$info->remark??''}}</textarea>
  104. </div>
  105. </div>
  106. <div class="form-group">
  107. <div class="col-sm-4 col-sm-offset-2">
  108. <button class="btn btn-primary" type="button" data-id="{{$info->id??0}}"
  109. id="save">
  110. 保存
  111. </button>
  112. <button class="btn btn-white" type="button" id="cancel">取消</button>
  113. </div>
  114. </div>
  115. </form>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </body>
  122. @endsection
  123. @section('footer')
  124. <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
  125. <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js"></script>
  126. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  127. <script>
  128. //同时绑定多个
  129. lay('.deadline').each(function () {
  130. laydate.render({
  131. elem: this
  132. , trigger: 'click'
  133. , type: 'datetime'
  134. });
  135. });
  136. $(document).on('click', '#cancel', function () {
  137. tips.closeParentLayer();
  138. });
  139. $(document).on('click', '#save', function () {
  140. var data = tips.getFormValues('#form');
  141. if(!data.customer_name){
  142. layer.alert('请输入姓名', {icon: 0});
  143. return;
  144. }
  145. if(!data.tel){
  146. layer.alert('请输入电话', {icon: 0});
  147. return;
  148. }
  149. if(!data.gift_amount){
  150. layer.alert('请输入礼品金额', {icon: 0});
  151. return;
  152. }
  153. if(!data.gift_time){
  154. layer.alert('请输入送礼时间', {icon: 0});
  155. return;
  156. }
  157. var id = $(this).data('id');
  158. var url = '/admin/witness-project/introduce-add/' + id + '/{{$siteId}}';
  159. var type = 'post';
  160. var ajaxConfig = {
  161. url: url,
  162. type: type,
  163. data: data,
  164. success: function (result) {
  165. layer.msg(result.message, {icon: 6, time: 1500}, function () {
  166. tips.closeParentLayer();
  167. window.parent.tips.tableRefresh('#table');
  168. });
  169. }
  170. };
  171. tips.ajax(ajaxConfig);
  172. });
  173. </script>
  174. @endsection