renew_add.blade.php 9.7 KB

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