indexp.blade.php 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. @extends('layouts.admin.app')
  2. @section('plug-css')
  3. <link href="{{ asset('js/bootstrap-table/dist/bootstrap-table.css') }}" rel="stylesheet">
  4. @endsection
  5. @section('crumbs')
  6. <ol class="breadcrumb crumbs">
  7. <li><a href="{{ route('admin.index') }}#">后台导航</a></li>
  8. <li class="active">批发商列表</li>
  9. </ol>
  10. @endsection
  11. @section('content')
  12. <form id="searchForm" class="form-inline">
  13. <div class="">
  14. <div class="form-group">
  15. <label for="mobile" class="label-css"> 批发商账户号:</label>
  16. <input class="form-control" type="text" name="mobile">
  17. </div>
  18. <div class="form-group">
  19. <label for="member_sn" class="label-css"> 批发商编号:</label>
  20. <input class="form-control" type="text" name="member_sn">
  21. </div>
  22. <div class="form-group">
  23. <label for="shop_name" class="label-css"> 店铺名称:</label>
  24. <input class="form-control" type="text" name="shop_name">
  25. </div>
  26. <div class="form-group">
  27. <label for="status" class="label-css"> 统计省份:</label>
  28. <select class="form-control" name="province_id" v-model="province_id" id="province_id"
  29. style="margin-top: -8px;">
  30. <option value="0">所有省份</option>
  31. <option v-bind:value="province.id" v-for="province in provinces">@{{province.name}}</option>
  32. </select>
  33. </div>
  34. <div class="form-group">
  35. <label for="status" class="label-css"> 统计城市:</label>
  36. <select class="form-control" name="city_id" id="city_id" v-model="city_id" style="margin-top: -8px;">
  37. <option value="0">所有城市</option>
  38. <option v-bind:value="city.id" v-for="city in citys">@{{city.name}}</option>
  39. </select>
  40. </div>
  41. <div class="form-group">
  42. <label for="status" class="label-css"> 统计区域:</label>
  43. <select class="form-control" name="district_id" id="district_id" style="margin-top: -8px;">
  44. <option value="0">所有区域</option>
  45. <option v-bind:value="district.id" v-for="district in districts">@{{district.name}}</option>
  46. </select>
  47. </div>
  48. <input type="hidden" name="level_id" value="3">
  49. &ensp;&ensp;
  50. <button type="button" class="btn btn-primary">查询</button>
  51. </div>
  52. </form>
  53. <hr class="hr-css">
  54. <div>
  55. <div id="toolbar">
  56. <div class="columns columns-left btn-group pull-left">
  57. <a href="javascript:;">
  58. <button class="btn btn-default" type="button" id="excel-jys">
  59. <span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span>&ensp;批发商导出
  60. </button>
  61. </a>
  62. </div>
  63. </div>
  64. <table id="ContentTable"></table>
  65. </div>
  66. @endsection
  67. @section('plug-js')
  68. <script src="{{ asset('js/bootstrap-table/dist/bootstrap-table.js') }}"></script>
  69. <script src="{{ asset('js/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js') }}"></script>
  70. <script src="{{ asset('js/jquery-validation1.16/dist/jquery.validate.min.js') }}"></script>
  71. <script src="{{ asset('js/jquery-validation1.16/dist/additional-methods.min.js') }}"></script>
  72. <script src="{{ asset('js/jquery-validation1.16/src/localization/messages_zh.js') }}"></script>
  73. @endsection
  74. @section('scripts')
  75. <script>
  76. $(function(){
  77. var vm = new Vue({
  78. el: '#searchForm',
  79. data: {
  80. 'province_id': 0,
  81. 'city_id': 0,
  82. 'provinces': [],
  83. 'citys': [],
  84. 'districts': [],
  85. },
  86. methods: {
  87. selectcity: function () {
  88. }
  89. },
  90. watch: {
  91. 'province_id': function () {
  92. if (this.province_id * 1 == 0) {
  93. this.citys = [];
  94. this.city_id = 0;
  95. } else {
  96. $.ajax({
  97. type: 'post',
  98. url: "{{ route('admin.good.city') }}",
  99. data: {'p_id': this.province_id},
  100. dataType: 'json',
  101. success: function (data) {
  102. if (data.code * 1 == 1) {
  103. vm.citys = data.data;
  104. }
  105. }
  106. });
  107. }
  108. },
  109. 'city_id': function () {
  110. if (this.city_id * 1 == 0) {
  111. this.districts = [];
  112. } else {
  113. $.ajax({
  114. type: 'post',
  115. url: "{{ route('admin.good.city') }}",
  116. data: {'p_id': this.city_id},
  117. dataType: 'json',
  118. success: function (data) {
  119. if (data.code * 1 == 1) {
  120. vm.districts = data.data;
  121. }
  122. }
  123. });
  124. }
  125. }
  126. },
  127. created: function () {
  128. $.ajax({
  129. type: 'post',
  130. url: "{{ route('admin.good.city') }}",
  131. data: {'p_id': 0},
  132. dataType: 'json',
  133. success: function (data) {
  134. if (data.code * 1 == 1) {
  135. vm.provinces = data.data;
  136. }
  137. }
  138. });
  139. }
  140. });
  141. BootStrapInit.init('tableMember','ContentTable',{
  142. searchForm: 'searchForm', // 表单搜索id 省略默认 'searchForm'
  143. url: "{{ route('admin.member.ajax.list',['level_id'=>$level_id]) }}",
  144. method: 'post',
  145. toolbar: '#toolbar',
  146. idField: '', // 指定主键列
  147. uniqueId: "id", // 这里需要指定当前查询表唯一主键字段
  148. columns: [
  149. {
  150. checkbox: true,
  151. align: 'center',
  152. valign: 'middle'
  153. },
  154. {
  155. field: 'id',
  156. title: 'ID',
  157. align: 'center',
  158. valign: 'middle',
  159. },
  160. {
  161. field: 'member_sn',
  162. title: '批发商编号',
  163. align: 'center',
  164. valign: 'middle',
  165. },
  166. {
  167. field: 'nickname',
  168. title: '批发商昵称',
  169. align: 'center',
  170. valign: 'middle',
  171. },
  172. {
  173. field: 'mobile',
  174. title: '批发商账户',
  175. align: 'center',
  176. valign: 'middle',
  177. },
  178. {
  179. field: 'recom_mobile',
  180. title: '推荐人账号',
  181. align: 'center',
  182. valign: 'middle',
  183. },
  184. {
  185. field: 'shop_name',
  186. title: '店铺名称',
  187. align: 'center',
  188. valign: 'middle'
  189. },
  190. {
  191. field: 'admin_name',
  192. title: '管理员',
  193. align: 'center',
  194. valign: 'middle'
  195. },
  196. {
  197. field: 'admin_mobile',
  198. title: '管理员电话',
  199. align: 'center',
  200. valign: 'middle'
  201. },
  202. {
  203. field: 'city_name',
  204. title: '城市',
  205. align: 'center',
  206. valign: 'middle'
  207. },
  208. {
  209. field: 'address',
  210. title: '地址',
  211. align: 'center',
  212. valign: 'middle'
  213. },
  214. {
  215. field: 'goods_num',
  216. title: '商品总库存',
  217. align: 'center',
  218. valign: 'middle'
  219. },
  220. {
  221. field: 'order_goods_num',
  222. title: '总批发量',
  223. align: 'center',
  224. valign: 'middle'
  225. },
  226. {
  227. field: 'created_at',
  228. title: '创建时间',
  229. align: 'center',
  230. valign: 'middle',
  231. },
  232. ]
  233. });
  234. $(document).on('click', '#excel-jys', function () {
  235. $('#searchForm').prop('action', "{{ route('admin.member.excel') }}");
  236. $('#searchForm').prop('method', 'get');
  237. $('#searchForm').submit();
  238. return false;
  239. });
  240. });
  241. </script>
  242. @endsection