show_index.blade.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. @extends('admin/layout')
  2. @section('content')
  3. <style>
  4. @media screen and (max-width: 812px) {
  5. .table-responsive #table tbody tr td:nth-child(1), .table-responsive #table tbody tr td:nth-child(3), .table-responsive #table tbody tr td:nth-child(4), .table-responsive #table tbody tr td:nth-child(5), .table-responsive #table tbody tr td:nth-child(7) {
  6. display: none
  7. }
  8. .table-responsive #table thead tr th:nth-child(1), .table-responsive #table thead tr th:nth-child(3), .table-responsive #table thead tr th:nth-child(4), .table-responsive #table thead tr th:nth-child(5), .table-responsive #table thead tr th:nth-child(7) {
  9. display: none
  10. }
  11. }
  12. @media screen and (max-width: 768px) {
  13. .table-responsive #table thead {
  14. display: block !important;
  15. }
  16. }
  17. @media screen and (max-width: 480px) {
  18. .bootstrap-table .fixed-table-container .table tbody tr {
  19. display: block !important;
  20. }
  21. .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(1) {
  22. display: none;
  23. }
  24. .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(3) {
  25. display: none;
  26. }
  27. .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(4) {
  28. display: none;
  29. }
  30. .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(5) {
  31. display: none;
  32. }
  33. .bootstrap-table .fixed-table-container .table tbody tr .card-view:nth-child(7) {
  34. display: none;
  35. }
  36. }
  37. </style>
  38. <body class="gray-bg">
  39. <div class="wrapper wrapper-content animated fadeInRight">
  40. <div class="ibox float-e-margins">
  41. <div class="ibox-content">
  42. <div class="row">
  43. <form class="row" id="searchForm">
  44. <div class="col-md-4">
  45. <div class="input-group">
  46. 询盘总数:<span style="font-weight: 600" id="allInquire">0</span>
  47. 真实询盘:<span style="font-weight: 600;" id="realInquire">0</span>
  48. <button type="button" class="btn btn-warning btn-sm"
  49. onclick="units.exportExcel()" style="margin-left: 10px">下载
  50. </button>
  51. </div>
  52. </div>
  53. <div class="col-md-6 pull-right">
  54. <div class="input-group">
  55. <select data-placeholder="请选择状态..." class="form-control"
  56. style="width:150px;float: right" name="is_delete" id="is_delete"
  57. onchange="tips.selectPage();">
  58. <option value="" selected>是否真实询盘</option>
  59. <option value="0">真实询盘</option>
  60. <option value="1">虚假询盘</option>
  61. </select>
  62. <input type="hidden" value="all" name="time_range" id="time_range">
  63. <span class="input-group-btn">
  64. <button type="button" class="btn btn-md" onclick="units.search('week')"
  65. style="margin-right: 2px"> 最近七天</button>
  66. <button type="button" class="btn btn-md" onclick="units.search('month')"
  67. style="margin-right: 2px"> 最近30天</button>
  68. <button type="button" class="btn btn-md" onclick="units.search('year')"
  69. style="margin-right: 2px"> 最近一年</button>
  70. <button type="button" class="btn btn-md" onclick="units.search('all')"
  71. style="margin-right: 2px"> 全部</button>
  72. </span>
  73. <input type="text" placeholder="请选择日期范围" class="input-md form-control" id="date_range">
  74. </div>
  75. </div>
  76. </form>
  77. <hr>
  78. <div class="table-responsive">
  79. <table id="table" class="table table-condensed"
  80. data-mobile-responsive="true"></table>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </body>
  87. @endsection
  88. @section('footer')
  89. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  90. <script>
  91. laydate.render({
  92. elem: '#date_range',
  93. type: 'date',
  94. range: true,
  95. done: function (value, date, endDate) {
  96. units.search(value);
  97. }
  98. });
  99. var units = {
  100. exportExcel: function () {
  101. var time_range = $("#time_range").val();
  102. window.open('/admin/inquires/{{$siteId}}/export-excel?time_range=' + time_range);
  103. },
  104. search: function ($time_range) {
  105. $("#time_range").val($time_range);
  106. tips.selectPage();
  107. },
  108. detail: function (id) {
  109. layer.open({
  110. type: 2,
  111. content: ['/admin/inquires/' + id + '?siteId=' + "{{$siteId}}"],
  112. area: ['90%', '100%'],
  113. title: '',
  114. closeBtn: 0
  115. });
  116. },
  117. assignUser: function (inquireId) {
  118. var params = '?inquireIds[]=' + inquireId;
  119. layer.open({
  120. type: 2,
  121. content: '/admin/inquires/assign-user' + params,
  122. area: ['50%', '100%'],
  123. title: '详情'
  124. });
  125. }
  126. };
  127. var config = {};
  128. config.url = '/admin/site/' + "{{$siteId}}" + '/inquires?';
  129. config.pageSize = 50;
  130. config.columns = [ //字段
  131. // {checkbox: true},
  132. {
  133. title: '序号', align: 'center', formatter: function (value, item, index) {
  134. return index + 1;
  135. }
  136. },
  137. // {
  138. // title: '标题', field: 'title', align: 'center', width: '350px',
  139. // formatter: function (value, row) {
  140. // return '<a href="javascript:;" onclick="units.detail(' + row.id + ')">' + value + '</a>'
  141. // }
  142. // },
  143. {title: '姓名', field: 'sender_name', align: 'center'},
  144. {title: '邮箱', field: 'sender_email', align: 'center'},
  145. // {title: '平台链接', field: 'translate_words', align: 'center'},
  146. {title: '状态', field: 'is_read', align: 'center'},
  147. {
  148. title: '是否真实询盘', field: 'is_delete', align: 'center',
  149. formatter: function (value, row) {
  150. if(row.is_delete==1){
  151. return '否';
  152. }else{
  153. return '是';
  154. }
  155. }
  156. },
  157. {title: '询盘时间', field: 'created_at', align: 'center'},
  158. {
  159. title: '操作', field: 'id', align: 'center',
  160. formatter: function (value, row) {
  161. var str = '<button onclick="units.detail(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>查看</button>';
  162. if ("{{$nowRoleId}}" == 5) { //客户界面
  163. str += '<button onclick="units.assignUser(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>分配</button>';
  164. }
  165. return str;
  166. }
  167. }
  168. ];
  169. config.onLoadError = function (status, jqXHR) {
  170. $(".no-records-found td").text('数据请求异常,请检查分配的服务器是否正确');
  171. };
  172. config.onLoadSuccess = function (data) {
  173. var extra = data.extra;
  174. $("#allInquire").text(extra.allInquire);
  175. $("#realInquire").text(extra.realInquire);
  176. };
  177. tips.bootstrapTable(config);
  178. </script>
  179. @endsection