indexl.blade.php 11 KB

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