index.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. @extends('layouts.app')
  2. @section('title')订单操作日志@endsection
  3. @section('content')
  4. <div class="d-none" id="list">
  5. <!--查询 -->
  6. <div class="row m-3" style="background-color: #fff;">
  7. <div class="form-group m-2">
  8. <select class="form-control selectpicker" title="分页大小" v-model="size">
  9. <option value="50">50</option>
  10. <option value="100">100</option>
  11. <option value="200">200</option>
  12. <option value="500">500</option>
  13. <option value="1000">1000</option>
  14. </select>
  15. </div>
  16. <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="货主">
  17. <input v-model="search.customerName" class="form-control" type="text" step="01" placeholder="货主">
  18. </div>
  19. <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="起始日期">
  20. <input v-model="search.startTime" class="form-control" type="date" step="01">
  21. </div>
  22. <div class="form-group m-2" data-toggle="tooltip" data-placement="top" title="截止日期">
  23. <input v-model="search.endTime" class="form-control" type="date" step="01">
  24. </div>
  25. <div class="form-group m-2">
  26. <button class="form-control btn btn-sm btn-info" @click="searchData()">查询</button>
  27. </div>
  28. <div class="form-group m-2">
  29. <button class="form-control btn btn-sm btn-success" @click="downExcel()">导出EXCEL</button>
  30. </div>
  31. </div>
  32. <!-- 导出-->
  33. <span class="dropdown"></span>
  34. <!-- 表格-->
  35. <table class="table table-striped table-bordered table-hover text-nowrap waybill-table td-min-width-80"
  36. style="background: #fff;" id="table">
  37. <tr v-for="(item,i) in details.data" :key="i">
  38. <td class="td-warm text-muted"><span>@{{ i+1 }}</span></td>
  39. <td class="td-warm text-muted"><span>@{{ item.ownerName }}</span></td>
  40. <td class="td-warm text-muted"><span>@{{ item.erpOrderNo }}</span></td>
  41. <td class="td-warm text-muted"><span>@{{ item.logisticNumber }}</span></td>
  42. <td class="td-warm text-muted"><span>@{{ item.province }}</span></td>
  43. <td class="td-warm text-muted"><span>@{{ item.warehouseCode }}</span></td>
  44. <td class="td-warm text-muted"><span>@{{ item.payTime }}</span></td>
  45. <td class="td-warm text-muted"><span>@{{ item.issueTime }}</span></td>
  46. <td class="td-warm text-muted"><span>@{{ item.checkTime }}</span></td>
  47. <td class="td-warm text-muted"><span>@{{ item.logisticBranch }}</span></td>
  48. <td class="td-warm text-muted"><span>@{{ item.pickupTime }}</span></td>
  49. <td class="td-warm text-muted"><span>@{{ item.transferTime }}</span></td>
  50. <td class="td-warm text-muted"><span>@{{ item.receiveTime }}</span></td>
  51. </tr>
  52. </table>
  53. <nav aria-label="...">
  54. <ul class="pagination">
  55. <li class="page-item" :class="current===1?'disabled':''">
  56. <button class="page-link" @click="pagination('pre')">上一页</button>
  57. </li>
  58. <li class="page-item" :class="current===details.pages?'disabled':''">
  59. <button class="page-link" @click="pagination('next')">下一页</button>
  60. </li>
  61. </ul>
  62. </nav>
  63. </div>
  64. @endsection
  65. @section('lastScript')
  66. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
  67. <script>
  68. let vue = new Vue({
  69. el: "#list",
  70. data: {
  71. selectTr: null,
  72. details: {
  73. data: [],
  74. total: null,
  75. current: 1,
  76. pages: null,
  77. size: 50,
  78. },
  79. search: {
  80. startTime: null,
  81. endTime: null,
  82. customerName: null,
  83. ownerIdList: {!! $ownerIds !!}
  84. },
  85. size: 50,
  86. current: 1,
  87. },
  88. created() {
  89. let url = this.getBaseUrl() + `/api/report/orderOperationLog/list?size=${this.size}&current=${this.current}`
  90. this.initSearchDate();
  91. this.getPageResult(url);
  92. },
  93. mounted: function () {
  94. $('#list').removeClass('d-none');
  95. let column = [
  96. {name: 'ownerName', value: '货主'},
  97. {name: 'erpOrderNo', value: 'erp订单号'},
  98. {name: 'logisticNumber', value: '快递单号'},
  99. {name: 'province', value: '省份'},
  100. {name: 'warehouseCode', value: '仓库代码'},
  101. {name: 'payTime', value: '顾客付款时间'},
  102. {name: 'issueTime', value: '订单推送时间'},
  103. {name: 'checkTime', value: '订单复核时间'},
  104. {name: 'logisticBranch', value: ' 网点信息'},
  105. {name: 'pickupTime', value: '包裹揽收时间'},
  106. {name: 'transferTime', value: '包裹中转时间'},
  107. {name: 'receiveTime', value: '包裹签收时间'},
  108. ];
  109. new Header({
  110. el: "table",
  111. name: "details",
  112. column: column,
  113. data: this.details.data,
  114. restorationColumn: 'addtime',
  115. fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
  116. }).init();
  117. },
  118. methods: {
  119. getPageResult(url) {
  120. tempTip.showSuccess('开始查询,请稍后!');
  121. axios.post(url, this.getSearch()).then(res => {
  122. tempTip.showSuccess('查询成功!');
  123. if (res.data.data === undefined) {
  124. this.details.data = [];
  125. this.details.total = 0
  126. this.details.current = 1
  127. this.details.pages = 0
  128. this.details.size = 50;
  129. } else {
  130. this.details.data = res.data.data.list;
  131. this.details.total = res.data.data.page.total;
  132. this.details.current = res.data.data.page.pageNum;
  133. this.details.pages = res.data.data.page.pages
  134. this.details.size = res.data.data.page.pageSize;
  135. }
  136. });
  137. },
  138. getSearch() {
  139. let search = Object.assign({}, this.search);
  140. search.startTime += ' 00:00:00';
  141. search.endTime += ' 23:59:59';
  142. return search;
  143. },
  144. //初始化日期为今天和昨天
  145. initSearchDate() {
  146. let day1 = new Date();
  147. day1.setTime(day1.getTime() - 24 * 60 * 60 * 1000);
  148. let s1 = day1.getFullYear() + "-" + ((day1.getMonth() + 1) >= 10 ? (day1.getMonth() + 1) : ('0' + (day1.getMonth() + 1))) + "-" + (day1.getDate() >= 10 ? day1.getDate() : ('0' + day1.getDate()));
  149. //今天的时间
  150. let day2 = new Date();
  151. day2.setTime(day2.getTime());
  152. let s2 = day2.getFullYear() + "-" + ((day2.getMonth() + 1) >= 10 ? (day2.getMonth() + 1) : ('0' + (day2.getMonth() + 1))) + "-" + (day2.getDate() >= 10 ? day2.getDate() : ('0' + day2.getDate()));
  153. this.search.startTime = s1;
  154. this.search.endTime = s2;
  155. },
  156. searchData() {
  157. this.current = 1;
  158. this.pagination();
  159. },
  160. //根据环境获取不同的url
  161. getBaseUrl() {
  162. let url = null;
  163. let env = "{{ config('app.env') }}";
  164. if (env === 'local') {
  165. url = 'http://127.0.0.1:8111'
  166. } else if (env === 'production') {
  167. url = 'https://stat.baoshi56.com'
  168. }
  169. return url;
  170. },
  171. pagination(flag) {
  172. if (flag === 'pre' && this.current > 1) {
  173. this.current--;
  174. } else if (flag === 'next' && this.current < this.details.pages) {
  175. this.current++;
  176. }
  177. let url = this.getBaseUrl() + `/api/report/orderOperationLog/list?size=${this.size}&current=${this.current}`
  178. this.getPageResult(url);
  179. },
  180. downExcel() {
  181. let url = this.getBaseUrl();
  182. url += '/api/report/orderOperationLog/export';
  183. let search = Object.assign({}, this.search);
  184. search.startTime += ' 00:00:00';
  185. search.endTime += ' 23:59:59';
  186. axios.post(url, search).then(res => {
  187. if (res.data.code === 200) {
  188. let filename = res.data.data;
  189. let downUrl = this.getBaseUrl() + '/api/report/orderOperationLog/export/' + filename;
  190. let link = document.createElement('a');
  191. link.style.display = 'none';
  192. link.href = downUrl;
  193. link.download = `${filename}.xlsx`;
  194. document.body.appendChild(link);
  195. link.click();
  196. document.body.removeChild(link);
  197. tempTip.showSuccess('导出成功!');
  198. } else {
  199. tempTip.setDuration(3000);
  200. tempTip.show(res.data.data);
  201. }
  202. })
  203. }
  204. },
  205. });
  206. </script>
  207. @endsection