performance.blade.php 6.3 KB

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