index.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. @extends('admin.public.base')
  2. @section('body_class')
  3. style="margin: 0 auto;width: 96%;padding: 30px 0px;"
  4. @endsection
  5. @section('content')
  6. @if( check_auth('admin/orders/import_execl') )
  7. <div class="page-header">
  8. @if( check_auth('admin/custom/import_execl') )
  9. <a href="javascript:;" class="btn btn-primary upload"> <span class="fa fa-upload"></span> 导入客户信息</a>
  10. <a href="/uploads/custom_tpl.xlsx" class="btn btn-primary" download="客户导入模版"> <span class="fa fa-download"></span> 客户模版</a>
  11. @endif
  12. @if( check_auth('admin/custom_score/import_execl') )
  13. <a href="javascript:;" class="btn btn-primary upload_score"> <span class="fa fa-upload"></span> 积分批量导入</a>
  14. <a href="/uploads/score_tpl.xlsx" class="btn btn-primary" download="积分批量导入模版"> <span class="fa fa-download"></span> 积分模版</a>
  15. @endif
  16. @if( check_auth('admin/custom_score/import_weiban') )
  17. <a href="javascript:;" class="btn btn-primary upload_weiban_score"> <span class="fa fa-upload"></span> 微伴积分导入</a>
  18. <a href="/uploads/weiban_score_tpl.xlsx" class="btn btn-primary" download="积分批量导入模版"> <span class="fa fa-download"></span> 微伴模版</a>
  19. @endif
  20. </div>
  21. @endif
  22. <form action="" method="get" name="thisform" class="form-horizontal form-line">
  23. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  24. <input type="text" class="form-control" name="custom_code" value="{{request('custom_code','')}}" placeholder="请输入客户编码查询" />
  25. </div>
  26. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  27. <input type="text" class="form-control" name="phone" value="{{request('phone','')}}" placeholder="请输入联系方式查询" />
  28. </div>
  29. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  30. <input type="text" class="form-control" name="weiban_extid" value="{{request('weiban_extid','')}}" placeholder="请输入微伴ID查询" />
  31. </div>
  32. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  33. <select name="status" class="form-control">
  34. <option value="" >客户状态</option>
  35. <option value="0" @if (request('status') === '0' ) selected="selected" @endif >正常</option>
  36. <option value="1" @if (request('status') === '1' ) selected="selected" @endif >禁用</option>
  37. </select>
  38. </div>
  39. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  40. <select name="city_id" class="form-control selectpicker" data-max-options="20" data-live-search="true" data-live-search-placeholder="搜索城市" data-none-results-text="未搜索到 {0}" title="选择城市">
  41. @foreach ($cityList as $group)
  42. <optgroup label="{{$group['name']}}">
  43. @foreach ($group['city'] as $city)
  44. <option value="{{$city['id']}}" @if( $city['id'] == request('city_id',0) ) selected @endif >{{$city['name']}}</option>
  45. @endforeach
  46. </optgroup>
  47. @endforeach
  48. </select>
  49. </div>
  50. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  51. <input type="date" class="form-control" name="start_time" value="{{request('start_time','')}}" placeholder="请输入创建时间查询" />
  52. </div>
  53. <div class="form-group col col-xs-4 col-md-2" style="margin-right: 2px;">
  54. <button type="button" onclick="alter_from_attr({'method':'get','action':''})" class="btn btn-sm btn-primary" style="margin-right: 20px;"> 查询</button>
  55. <a href="{{url('admin/custom/index')}}" class="btn btn-sm btn-default" style="margin-right: 20px;" >重置</a>
  56. @if( check_auth('admin/custom/down_excel') )
  57. <button type="button" onclick="alter_from_attr({'method':'get','action':`{{url('admin/custom/down_excel')}}`})" class="btn btn-sm btn-primary"> 下载表格</button>
  58. @endif
  59. </div>
  60. </form>
  61. <div class="row">
  62. <div class="col-xs-12">
  63. <div class="table-responsive">
  64. <table class="table table-striped table-bordered table-hover">
  65. <thead>
  66. <tr>
  67. <th>客户编码</th>
  68. <th>客户昵称</th>
  69. <th>联系方式</th>
  70. <th>客户积分</th>
  71. <th>微伴ID</th>
  72. <th>客户城市</th>
  73. <th>客户状态</th>
  74. <th>创建时间</th>
  75. <th>更新时间</th>
  76. <th>操作</th>
  77. </tr>
  78. </thead>
  79. <tbody>
  80. @foreach ($list as $a)
  81. <tr>
  82. <th> {{$a['custom_code']}} </th>
  83. <td> {{$a['username']}} </td>
  84. <td> {{$a['phone']}} </td>
  85. <td> {{$a['custom_score']['score']}} </td>
  86. <td> <a href="{{url('admin/weiban_external/index?'.http_build_query(['id'=>$a['weiban_extid']]))}}">{{$a['weiban_extid']}}</a></td>
  87. <td> {{$a['city_name']}} </td>
  88. <td> {{$a['status']?'禁用':'正常'}} </td>
  89. <td> {{date('Y/m/d H:i:s',$a['insert_time'])}}</td>
  90. <td> {{date('Y/m/d H:i:s',$a['update_time'])}}</td>
  91. <td>
  92. @if(check_auth('admin/custom/edit'))
  93. <a href="{{url('admin/custom/edit?'.http_build_query(['uid'=>$a['uid']]))}}" class="btn btn-sm btn-warning" >编辑</a>
  94. @endif
  95. @if(check_auth('admin/custom_score/incr'))
  96. <a href="{{url('admin/custom_score/incr?'.http_build_query(['custom_uid'=>$a['uid']]))}}" class="btn btn-sm btn-success" >增加积分</a>
  97. @endif
  98. @if(check_auth('admin/custom_score/decr'))
  99. <a href="{{url('admin/custom_score/decr?'.http_build_query(['custom_uid'=>$a['uid']]))}}" class="btn btn-sm btn-danger" >扣减积分</a>
  100. @endif
  101. @if(check_auth('admin/custom/set_status'))
  102. @if( $a['status'] )
  103. <a data-url="{{url('admin/custom/set_status?'.http_build_query(['uid'=>$a['uid'],'status'=>0]))}}" class="set_status btn btn-sm btn-success" >取消拉黑</a>
  104. @else
  105. <a data-url="{{url('admin/custom/set_status?'.http_build_query(['uid'=>$a['uid'],'status'=>1]))}}" class="set_status btn btn-sm btn-danger" >拉黑</a>
  106. @endif
  107. @endif
  108. </td>
  109. </tr>
  110. @endforeach
  111. <tr>
  112. <td colspan="20" class="page">{{$list->render()}}</td>
  113. </tr>
  114. <tr>
  115. <td colspan="20">总计 {{$list->total()}} 个客户</td>
  116. </tr>
  117. </tbody>
  118. </table>
  119. </div>
  120. </div>
  121. </div>
  122. @endsection
  123. @section('javascript')
  124. <script src="/static/fileupload/jquery.ui.widget.js"></script>
  125. <script src="/static/fileupload/jquery.fileupload.js"></script>
  126. <script type="text/javascript">
  127. $(function(){
  128. $('.upload').on('click', function() {
  129. $('#form-upload').remove();
  130. $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input osctype="btn_upload_file" type="file" name="custom_file" multiple="multiple" /></form>');
  131. $('#form-upload input[name=\'custom_file\']').trigger('click');
  132. $('[osctype="btn_upload_file"]').fileupload({
  133. dataType: 'json',
  134. url: "{{url('admin/custom/import_execl')}}",
  135. singleFileUploads: false,
  136. beforeSend: function() {
  137. art.dialog({
  138. id: 'loading',
  139. lock: true,
  140. title: '文件上传中'
  141. });
  142. },
  143. done: function(e, data) {
  144. art.dialog.list['loading'].close();
  145. var result = data.result;
  146. if (result.code == 'error') {
  147. art.dialog({
  148. content: result.msg,
  149. lock: true,
  150. ok: function() {}
  151. });
  152. }
  153. if (result.code == 'success') {
  154. art.dialog({
  155. content: result.msg,
  156. lock: true,
  157. ok: function() {
  158. location.reload();
  159. }
  160. });
  161. }
  162. },
  163. fail: function(e,c) {
  164. art.dialog.list['loading'].close();
  165. art.dialog({
  166. content: '<p>'+c.jqXHR.status+'=>'+c.jqXHR.statusText+'</p>',
  167. lock: true,
  168. ok: function() {}
  169. });
  170. }
  171. });
  172. });
  173. })
  174. </script>
  175. <script type="text/javascript">
  176. $(function(){
  177. $('.upload_score').on('click', function() {
  178. $('#form-upload').remove();
  179. $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input osctype="btn_upload_file" type="file" name="score_file" multiple="multiple" /></form>');
  180. $('#form-upload input[name=\'score_file\']').trigger('click');
  181. $('[osctype="btn_upload_file"]').fileupload({
  182. dataType: 'json',
  183. url: "{{url('admin/custom_score/import_execl')}}",
  184. singleFileUploads: false,
  185. beforeSend: function() {
  186. art.dialog({
  187. id: 'loading',
  188. lock: true,
  189. title: '文件上传中'
  190. });
  191. },
  192. done: function(e, data) {
  193. art.dialog.list['loading'].close();
  194. var result = data.result;
  195. if (result.code == 'error') {
  196. art.dialog({
  197. content: result.msg,
  198. lock: true,
  199. ok: function() {}
  200. });
  201. }
  202. if (result.code == 'success') {
  203. art.dialog({
  204. content: result.msg,
  205. lock: true,
  206. ok: function() {
  207. location.reload();
  208. }
  209. });
  210. }
  211. },
  212. fail: function(e,c) {
  213. art.dialog.list['loading'].close();
  214. art.dialog({
  215. content: '<p>'+c.jqXHR.status+'=>'+c.jqXHR.statusText+'</p>',
  216. lock: true,
  217. ok: function() {}
  218. });
  219. }
  220. });
  221. });
  222. })
  223. </script>
  224. <script type="text/javascript">
  225. $(function(){
  226. $('.upload_weiban_score').on('click', function() {
  227. $('#form-upload').remove();
  228. $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input osctype="btn_upload_file" type="file" name="score_file" multiple="multiple" /></form>');
  229. $('#form-upload input[name=\'score_file\']').trigger('click');
  230. $('[osctype="btn_upload_file"]').fileupload({
  231. dataType: 'json',
  232. url: "{{url('admin/custom_score/import_weiban')}}",
  233. singleFileUploads: false,
  234. beforeSend: function() {
  235. art.dialog({
  236. id: 'loading',
  237. lock: true,
  238. title: '文件上传中'
  239. });
  240. },
  241. done: function(e, data) {
  242. art.dialog.list['loading'].close();
  243. var result = data.result;
  244. if (result.code == 'error') {
  245. art.dialog({
  246. content: result.msg,
  247. lock: true,
  248. ok: function() {}
  249. });
  250. }
  251. if (result.code == 'success') {
  252. art.dialog({
  253. content: result.msg,
  254. lock: true,
  255. ok: function() {
  256. location.reload();
  257. }
  258. });
  259. }
  260. },
  261. fail: function(e,c) {
  262. art.dialog.list['loading'].close();
  263. art.dialog({
  264. content: '<p>'+c.jqXHR.status+'=>'+c.jqXHR.statusText+'</p>',
  265. lock: true,
  266. ok: function() {}
  267. });
  268. }
  269. });
  270. });
  271. })
  272. </script>
  273. @endsection