analyze.blade.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. @extends('layouts.app')
  2. @section('title')退货管理@endsection
  3. @section('content')
  4. <div id="nav2">
  5. @component('rejected.menu')@endcomponent
  6. @component('rejected.search.menu')@endcomponent
  7. </div>
  8. <div class="container-fluid" id="list">
  9. <div id="form_div"></div>
  10. <span class="dropdown m-1">
  11. <button
  12. class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
  13. :class="[rejectedBills_checkBoxes.length>0?'btn-dark text-light':'']"
  14. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
  15. 导出Excel
  16. </button>
  17. <div class="dropdown-menu">
  18. <a class="dropdown-item" @click="exportExcel(false)"
  19. href="javascript:">导出勾选内容</a>
  20. <a class="dropdown-item" @click="exportExcel(true)"
  21. href="javascript:">导出所有页</a>
  22. </div>
  23. </span>
  24. <label id="cloneCheckAll" class="d-none">
  25. <input type="checkbox" class="form-control-sm tooltipTarget" title="全选"
  26. id="checkSelectingAll" @click="checkBoxAllToggle($event)">
  27. </label>
  28. <table class="table table-striped table-sm table-bordered table-hover d-none" id="headerRoll"></table>
  29. <table class="table table-striped table-sm table-bordered table-hover" style="background: #fff;" id="headerParent">
  30. <tr id="header"></tr>
  31. <tr v-for="(rejectedBill,index) in rejectedBills " :data-id="rejectedBill.id">
  32. <td>
  33. <input type="checkbox" v-model="rejectedBills_checkBoxes" :value="rejectedBill.id_owner">
  34. </td>
  35. <td class="text-muted" style="opacity:0.7">
  36. @{{ index+1 }}
  37. </td>
  38. <td>
  39. @{{ rejectedBill.owner_name }}
  40. </td>
  41. <td class="text-muted">
  42. @{{ rejectedBill.bounce_amount }}
  43. </td>
  44. <td class="text-success font-weight-bold">
  45. @{{ rejectedBill.check_amount }}
  46. </td>
  47. <td>
  48. @{{ rejectedBill.bounce_amount-rejectedBill.check_amount }}
  49. </td>
  50. <td class="text-success font-weight-bold">
  51. @{{ rejectedBill.in_storage_count }}
  52. </td>
  53. <td>
  54. @{{ rejectedBill.not_in_storage_count }}
  55. </td>
  56. </tr>
  57. </table>
  58. </div>
  59. @endsection
  60. @section('lastScript')
  61. <script src="{{asset('js/queryForm/export200818a.js')}}"></script>
  62. <script src="{{asset('js/queryForm/queryForm200803a.js')}}"></script>
  63. <script type="text/javascript" src="{{asset('js/queryForm/header200818a.js')}}"></script>
  64. <script>
  65. let vue = new Vue({
  66. el:"#list",
  67. data:{
  68. rejectedBills : {!! $rejectedBills !!},
  69. checkBoxAll:[],
  70. sum : '{{count($rejectedBills)}}',
  71. rejectedBills_checkBoxes:[],
  72. owners:[
  73. @foreach($owners as $owner)
  74. {name:'{{$owner->id}}',value:'{{$owner->name}}'},
  75. @endforeach
  76. ],
  77. },
  78. mounted:function(){
  79. $(".tooltipTarget").tooltip({'trigger':'hover'});
  80. $('#list').removeClass('d-none');
  81. let data=[
  82. [
  83. {name:'created_at_start',type:'dateTime',tip:'选择显示指定日期的起始时间'},
  84. {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的客户'],
  85. placeholder:['货主','定位或多选货主'],data:this.owners},
  86. ],[
  87. {name:'created_at_end',type:'dateTime',tip:'选择显示指定日期的结束时间'},
  88. ]
  89. ];
  90. this.form=new query({
  91. el:"#form_div",
  92. condition:data,
  93. isPaginations:false,
  94. });
  95. this.form.init();
  96. let column = [
  97. {name:'cloneCheckAll',customization:true,type:'checkAll',column:'id_owner',
  98. dom:$('#cloneCheckAll').removeClass('d-none'), neglect: true},
  99. {name:'index',value: '序号', neglect: true},
  100. {name:'owner_name',value: '货主', neglect: true},
  101. {name:'bounce_amount',value: '退件数', neglect: true, class:'text-muted'},
  102. {name:'check_amount',value: '审核数', neglect: true, class:'text-success font-weight-bold'},
  103. {name:'bounce_amount_check_amount',value: '未审核数', neglect: true},
  104. {name:'in_storage_count',value: '入库数', neglect: true, class:'text-success font-weight-bold'},
  105. {name:'not_in_storage_count',value: '未入库数', neglect: true},
  106. ];
  107. let _this = this;
  108. setTimeout(function () {
  109. let header = new Header({
  110. el: "#header",
  111. column: column,
  112. data: _this.rejectedBills,
  113. restorationColumn: 'id',
  114. fixedTop:($('#form_div').height())+2,
  115. offset:0.5,
  116. vue:vue,
  117. checkbox:'rejectedBills_checkBoxes',
  118. });
  119. header.init();
  120. },0);
  121. },
  122. watch:{
  123. rejectedBills_checkBoxes:{
  124. handler(){
  125. if (this.rejectedBills_checkBoxes.length === this.rejectedBills.length){
  126. document.querySelector('#checkSelectingAll').checked = true;
  127. document.querySelector('#checkSelectingAll_temp').checked = true;
  128. }else {
  129. document.querySelector('#checkSelectingAll').checked = false;
  130. document.querySelector('#checkSelectingAll_temp').checked = false;
  131. }
  132. },
  133. deep:true
  134. }
  135. },
  136. methods:{
  137. checkBoxAllToggle:function(e){
  138. if (e.target.checked) {
  139. this.rejectedBills.forEach((el) => {
  140. if (!el.id) this.rejectedBills_checkBoxes.push(el.id);
  141. if (el.id && this.rejectedBills_checkBoxes.indexOf(el.id) == '-1') {
  142. this.rejectedBills_checkBoxes.push(el.id);
  143. }
  144. });
  145. } else {
  146. this.rejectedBills_checkBoxes = [];
  147. }
  148. },
  149. exportExcel:function(checkAllSign){
  150. let url = '{{url('rejected/exportAnalyze')}}';
  151. let token='{{ csrf_token() }}';
  152. excelExport(checkAllSign,this.rejectedBills_checkBoxes,url,this.sum,token);
  153. },
  154. },
  155. });
  156. </script>
  157. @endsection