performance.blade.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. @extends('layouts.app')
  2. @section('title')订单管理-问题件-绩效统计@endsection
  3. @section('content')
  4. @component("order.issue.menu")@endcomponent
  5. <div class="container-fluid none" id="performance_div">
  6. <div style="min-width: 2000px;">
  7. <div id="form_div" style="min-width: 1950px;" class="bg-white"></div>
  8. <div class="form-inline mt-1 ">
  9. <span class="dropdown">
  10. <button type="button"
  11. class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
  12. :class="[checkData.length>0?'btn-dark text-light':'']"
  13. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">导出Excel
  14. </button>
  15. <div class="dropdown-menu">
  16. <a class="dropdown-item" @click="exportAll()" href="javascript:">导出所有页</a>
  17. </div>
  18. </span>
  19. </div>
  20. <table class="table table-sm table-striped table-bordered table-hover card-body mt-2 ">
  21. <tr>
  22. <th>
  23. <input type="checkbox" id="all" @click="checkAll($event)">
  24. </th>
  25. <th>序号</th>
  26. <th>客服</th>
  27. <th>客户</th>
  28. <th>创建数</th>
  29. <th>处理数</th>
  30. <th>完结数</th>
  31. <th>总数</th>
  32. </tr>
  33. <tr v-for="(performance,index) in performance.data">
  34. <td>
  35. <input type="checkbox" v-model="checkData" :value="index+1">
  36. </td>
  37. <td>@{{ Number(index)+1 }}</td>
  38. <td>@{{ performance.userName }}</td>
  39. <td>@{{ performance.ownerName }}</td>
  40. <td>@{{ performance.created }}</td>
  41. <td>@{{ performance.processed }}</td>
  42. <td>@{{ performance.end }}</td>
  43. <td>@{{ performance.sumNumber }}</td>
  44. </tr>
  45. </table>
  46. <button class="btn btn-sm" :class="performance.current_page <= 1 ?'':'btn-outline-primary'"
  47. @click="goPage(performance.current_page - 1)"
  48. :disabled="performance.from === 1">上一页
  49. </button>
  50. <button class="btn btn-sm"
  51. @click="goPage(performance.current_page + 1)"
  52. :class="performance.current_page === performance.last_page ?'':'btn-outline-primary'"
  53. :disabled="performance.current_page === performance.last_page">下一页
  54. </button>
  55. <input @keyup.enter="pageTurning($event)" class="form-control-sm ml-3 tooltipTarget"
  56. :placeholder="'当前页数:'+performance.current_page+'/'+performance.last_page" title="去往指定页">
  57. <span class="text-muted m-1">共 @{{performance.total}} 条 </span>
  58. </div>
  59. </div>
  60. @endsection
  61. @section('lastScript')
  62. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  63. <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
  64. <script>
  65. let performance_vue = new Vue({
  66. el:'#performance_div',
  67. data:{
  68. performance:{!! $performance->toJson() !!},
  69. option:{
  70. timeFrame:'{{$options['timeFrame']}}',
  71. create_start:'{{$options['create_start']}}',
  72. create_end:'{{$options['create_end']}}',
  73. },
  74. checkData:[],
  75. },
  76. mounted:function(){
  77. $('#performance_div').removeClass("d-none");
  78. console.log(this.performance);
  79. let data =[
  80. [{name:'create_start',type:'dateTime',tip:'统计时段开始',placeholder:'统计时段开始',killings:['timeFrame']},
  81. {name:'create_end',type:'dateTime',tip:'统计时段结束',placeholder:'统计时段结束',killings:['timeFrame']},
  82. {name:'timeFrame',type:'select',tip:'',placeholder:'选择时段',
  83. data:[{name:"day",value:'当天'},{name:'yesterday',value:'昨日'},{name:"week",value:'本周'},{name:"month",value:'本月'}],
  84. killings:['create_start','create_end'],
  85. }]
  86. ];
  87. let queryForm = new query({
  88. el:'#form_div',
  89. condition:data,
  90. })
  91. queryForm.init();
  92. },
  93. methods: {
  94. exportAll:function(){
  95. let search = '?timeFrame='+this.option.timeFrame+'&create_start='+this.option.create_start+'&create_end='+this.option.create_end;
  96. let url = '{{url('order/issue/orderIssuePerformance/export')}}'+search;
  97. let token='{{ csrf_token() }}';
  98. excelExport(false,'',url,null,token);
  99. },
  100. checkAll(e) {
  101. if (e.target.checked) {
  102. this.performance.data.forEach((el, i) => {
  103. if (this.checkData.indexOf(el.id) == '-1') {
  104. this.checkData.push(el.id);
  105. }
  106. });
  107. } else {
  108. this.checkData = [];
  109. }
  110. },
  111. pageTurning(e){
  112. let page = $(e.target).val();
  113. if (page > this.performance.last_page) {
  114. return;
  115. }
  116. this.goPage(page);
  117. },
  118. goPage(page){
  119. let href = window.location.href;
  120. if(href.indexOf('?')==-1){
  121. href+='?'
  122. }
  123. if(href.indexOf('page=')!==-1){
  124. href = href.replace('page='+this.performance.current_page,'page='+page);
  125. }else{
  126. href+='&page='+page;
  127. }
  128. window.location = href;
  129. }
  130. },
  131. });
  132. </script>
  133. @endsection