monthlyBillReport.blade.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. @extends('layouts.app')
  2. @section('title')采购管理-财务-月账单报表@endsection
  3. @section('content')
  4. @component('procurement.finance.menu')@endcomponent
  5. <div class="container-fluid" id="list">
  6. <div id="form_div" class="mt-1"></div>
  7. <div class="row mt-2">
  8. <span class="dropdown ml-3">
  9. <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
  10. :class="[checkData.length>0?'btn-dark text-light':'']"
  11. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
  12. 导出Excel
  13. </button>
  14. <div class="dropdown-menu">
  15. <a class="dropdown-item" @click="procurementTotalBillExport(false)" href="javascript:">导出勾选内容</a>
  16. <a class="dropdown-item" @click="procurementTotalBillExport(true)" href="javascript:">导出所有页</a>
  17. </div>
  18. </span>
  19. </div>
  20. <label for="all" id="cloneCheckAll" class="d-none">
  21. <input id="all" type="checkbox" @click="checkAll($event)">全选
  22. </label>
  23. <table class="table table-sm table-bordered text-nowrap d-none" id="headerRoll"></table>
  24. <table class="table table-sm table-striped table-bordered table-hover text-nowrap card-body mt-2"
  25. id="headerParent">
  26. <tr id="header"></tr>
  27. <tr v-for="(procurementTotalBill,i) in procurementTotalBills">
  28. <td>
  29. <input class="checkItem" type="checkbox" :value="procurementTotalBill.id" v-model="checkData">
  30. </td>
  31. <td >@{{ procurementTotalBill.id }}</td>
  32. <td class="text-muted">@{{ procurementTotalBill.counting_month }}</td>
  33. <td class="text-muted">@{{ procurementTotalBill.created_at.substr(0,10) }}</td>
  34. <td class="text-muted">@{{ procurementTotalBill.supplier_name }}</td>
  35. <td>@{{ procurementTotalBill.total_payable }}</td>
  36. <td><span>@{{ procurement_total_bill_status[procurementTotalBill.status] }}</span></td>
  37. </tr>
  38. </table>
  39. <div class="text-info h5 btn btn">{{$procurementTotalBills->count()}}/@{{ sum }}</div>
  40. <div>{{$procurementTotalBills->appends($paginateParams)->links()}}</div>
  41. </div>
  42. @endsection
  43. @section('lastScript')
  44. <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
  45. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  46. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
  47. <script>
  48. let vue = new Vue({
  49. el: '#list',
  50. data: {
  51. procurementTotalBills: [
  52. @foreach($procurementTotalBills as $procurementTotalBill)
  53. {
  54. id:'{{$procurementTotalBill->id}}',counting_month:'{{$procurementTotalBill->counting_month}}',
  55. created_at:'{{$procurementTotalBill->created_at}}',status:'{{$procurementTotalBill->status}}',total_payable:'{{$procurementTotalBill->total_payable}}',
  56. @if($procurementTotalBill->supplier)
  57. supplier_id:'{{$procurementTotalBill->supplier->id}}',supplier_name:'{{$procurementTotalBill->supplier->name}}',@endif
  58. },
  59. @endforeach
  60. ],
  61. suppliers:[
  62. @foreach($suppliers as $supplier)
  63. {name:'{{$supplier->id}}',value:'{{$supplier->name}}'},
  64. @endforeach
  65. ],
  66. checkData: [],
  67. sum:{!! $procurementTotalBills->total() !!},
  68. procurement_total_bill_status:{!! json_encode(\App\ProcurementTotalBill::status,JSON_UNESCAPED_UNICODE) !!},
  69. },
  70. mounted: function () {
  71. $(".tooltipTarget").tooltip({'trigger': 'hover'});
  72. $('#list').removeClass('d-none');
  73. let data = [
  74. [
  75. {name:'counting_month',type:'dateMonth',tip:'选择账单日期',placeholder: '----年--月'},
  76. {
  77. name: 'supplier_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的供应商'],
  78. placeholder: ['供应商', '定位或多选供应商'], data: this.suppliers
  79. },
  80. ],
  81. ];
  82. this.form = new query({
  83. el: "#form_div",
  84. condition: data,
  85. });
  86. this.form.init();
  87. let column = [
  88. {
  89. name: 'cloneCheckAll', customization: true, type: 'checkAll',column:'id',
  90. dom: $('#cloneCheckAll').removeClass('d-none'), neglect: true
  91. },
  92. {name: 'id', value: '对账编号', neglect: true},
  93. {name: 'counting_month', value: '账单日期', },
  94. {name: 'created_at', value: '提交日期',},
  95. {name: 'supplier', value: '供应商',},
  96. {name: 'total_payable', value: '总金额',},
  97. {name: 'status', value: '状态'},
  98. ];
  99. let _this = this;
  100. setTimeout(function () {
  101. let header = new Header({
  102. el: "#header",
  103. column: column,
  104. data: _this.procurementTotalBills,
  105. restorationColumn: 'id',
  106. fixedTop: ($('#form_div').height()) + 2,
  107. offset: 0.5,
  108. vue: vue
  109. });
  110. header.init();
  111. }, 0);
  112. },
  113. methods: {
  114. //全选事件
  115. checkAll(e) {
  116. if (e.target.checked) {
  117. this.procurementTotalBills.forEach((el, i) => {
  118. if (this.checkData.indexOf(el.id) == '-1') {
  119. this.checkData.push(el.id);
  120. }
  121. });
  122. } else {
  123. this.checkData = [];
  124. }
  125. },
  126. procurementTotalBillExport(selectAll){
  127. let url = '{{url('procurement/finance/procurementTotalBillExport')}}';
  128. let token='{{ csrf_token() }}';
  129. excelExport(selectAll,this.checkData,url,this.sum,token);
  130. },
  131. }
  132. });
  133. </script>
  134. @endsection