monthlyBillReport.blade.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 class="text-primary">@{{ procurementTotalBill.id }}</td>
  32. <td class="text-muted">@{{ procurementTotalBill.counting_month }}</td>
  33. <td class="text-muted">@{{ procurementTotalBill.created_at }}</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. <td>
  38. <span class="btn btn-sm btn-outline-success">查看对账单</span>
  39. </td>
  40. </tr>
  41. </table>
  42. <div class="text-info h5 btn btn">{{$procurementTotalBills->count()}}/@{{ sum }}</div>
  43. <div>{{$procurementTotalBills->appends($paginateParams)->links()}}</div>
  44. </div>
  45. @endsection
  46. @section('lastScript')
  47. <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
  48. <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
  49. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
  50. <script>
  51. let vue = new Vue({
  52. el: '#list',
  53. data: {
  54. procurementTotalBills: [
  55. @foreach($procurementTotalBills as $procurementTotalBill)
  56. {
  57. id:'{{$procurementTotalBill->id}}',counting_month:'{{$procurementTotalBill->counting_month}}',
  58. created_at:'{{$procurementTotalBill->created_at}}',status:'{{$procurementTotalBill->status}}',total_payable:'{{$procurementTotalBill->total_payable}}',
  59. @if($procurementTotalBill->supplier)
  60. supplier_id:'{{$procurementTotalBill->supplier->id}}',supplier_name:'{{$procurementTotalBill->supplier->name}}',@endif
  61. }
  62. @endforeach
  63. ],
  64. suppliers:[
  65. @foreach($suppliers as $supplier)
  66. {name:'{{$supplier->id}}',value:'{{$supplier->name}}'},
  67. @endforeach
  68. ],
  69. checkData: [],
  70. sum:{!! $procurementTotalBills->total() !!},
  71. procurement_total_bill_status:{!! json_encode(\App\ProcurementTotalBill::status,JSON_UNESCAPED_UNICODE) !!},
  72. },
  73. mounted: function () {
  74. $(".tooltipTarget").tooltip({'trigger': 'hover'});
  75. $('#list').removeClass('d-none');
  76. let data = [
  77. [
  78. {name:'counting_month',type:'dateMonth',tip:'选择账单日期',placeholder: '----年--月'},
  79. {
  80. name: 'supplier_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的供应商'],
  81. placeholder: ['供应商', '定位或多选供应商'], data: this.suppliers
  82. },
  83. ],
  84. ];
  85. this.form = new query({
  86. el: "#form_div",
  87. condition: data,
  88. });
  89. this.form.init();
  90. let column = [
  91. {
  92. name: 'cloneCheckAll', customization: true, type: 'checkAll',column:'id',
  93. dom: $('#cloneCheckAll').removeClass('d-none'), neglect: true
  94. },
  95. {name: 'id', value: '对账编号', neglect: true},
  96. {name: 'counting_month', value: '账单日期', },
  97. {name: 'created_at', value: '提交日期',},
  98. {name: 'supplier', value: '供应商',},
  99. {name: 'total_payable', value: '总金额',},
  100. {name: 'status', value: '状态'},
  101. {name: '', value: '操作', neglect: true},
  102. ];
  103. let _this = this;
  104. setTimeout(function () {
  105. let header = new Header({
  106. el: "#header",
  107. column: column,
  108. data: _this.procurementTotalBills,
  109. restorationColumn: 'id',
  110. fixedTop: ($('#form_div').height()) + 2,
  111. offset: 0.5,
  112. vue: vue
  113. });
  114. header.init();
  115. }, 0);
  116. },
  117. methods: {
  118. //全选事件
  119. checkAll(e) {
  120. if (e.target.checked) {
  121. this.procurementTotalBills.forEach((el, i) => {
  122. if (this.checkData.indexOf(el.id) == '-1') {
  123. this.checkData.push(el.id);
  124. }
  125. });
  126. } else {
  127. this.checkData = [];
  128. }
  129. },
  130. procurementTotalBillExport(selectAll){
  131. let url = '{{url('procurement/finance/procurementTotalBillExport')}}';
  132. let token='{{ csrf_token() }}';
  133. excelExport(selectAll,this.checkData,url,this.sum,token);
  134. },
  135. }
  136. });
  137. </script>
  138. @endsection