| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- @extends('layouts.app')
- @section('title')采购管理-财务-月账单报表@endsection
- @section('content')
- @component('procurement.finance.menu')@endcomponent
- <div class="container-fluid" id="list">
- <div id="form_div" class="mt-1"></div>
- <div class="row mt-2">
- <span class="dropdown ml-3">
- <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
- :class="[checkData.length>0?'btn-dark text-light':'']"
- data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
- 导出Excel
- </button>
- <div class="dropdown-menu">
- <a class="dropdown-item" @click="procurementTotalBillExport(false)" href="javascript:">导出勾选内容</a>
- <a class="dropdown-item" @click="procurementTotalBillExport(true)" href="javascript:">导出所有页</a>
- </div>
- </span>
- </div>
- <label for="all" id="cloneCheckAll" class="d-none">
- <input id="all" type="checkbox" @click="checkAll($event)">全选
- </label>
- <table class="table table-sm table-bordered text-nowrap d-none" id="headerRoll"></table>
- <table class="table table-sm table-striped table-bordered table-hover text-nowrap card-body mt-2"
- id="headerParent">
- <tr id="header"></tr>
- <tr v-for="(procurementTotalBill,i) in procurementTotalBills">
- <td>
- <input class="checkItem" type="checkbox" :value="procurementTotalBill.id" v-model="checkData">
- </td>
- <td class="text-primary">@{{ procurementTotalBill.id }}</td>
- <td class="text-muted">@{{ procurementTotalBill.counting_month }}</td>
- <td class="text-muted">@{{ procurementTotalBill.created_at }}</td>
- <td class="text-muted">@{{ procurementTotalBill.supplier_name }}</td>
- <td>@{{ procurementTotalBill.total_payable }}</td>
- <td><span>@{{ procurement_total_bill_status[procurementTotalBill.status] }}</span></td>
- <td>
- <span class="btn btn-sm btn-outline-success">查看对账单</span>
- </td>
- </tr>
- </table>
- <div class="text-info h5 btn btn">{{$procurementTotalBills->count()}}/@{{ sum }}</div>
- <div>{{$procurementTotalBills->appends($paginateParams)->links()}}</div>
- </div>
- @endsection
- @section('lastScript')
- <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
- <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
- <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
- <script>
- let vue = new Vue({
- el: '#list',
- data: {
- procurementTotalBills: [
- @foreach($procurementTotalBills as $procurementTotalBill)
- {
- id:'{{$procurementTotalBill->id}}',counting_month:'{{$procurementTotalBill->counting_month}}',
- created_at:'{{$procurementTotalBill->created_at}}',status:'{{$procurementTotalBill->status}}',total_payable:'{{$procurementTotalBill->total_payable}}',
- @if($procurementTotalBill->supplier)
- supplier_id:'{{$procurementTotalBill->supplier->id}}',supplier_name:'{{$procurementTotalBill->supplier->name}}',@endif
- }
- @endforeach
- ],
- suppliers:[
- @foreach($suppliers as $supplier)
- {name:'{{$supplier->id}}',value:'{{$supplier->name}}'},
- @endforeach
- ],
- checkData: [],
- sum:{!! $procurementTotalBills->total() !!},
- procurement_total_bill_status:{!! json_encode(\App\ProcurementTotalBill::status,JSON_UNESCAPED_UNICODE) !!},
- },
- mounted: function () {
- $(".tooltipTarget").tooltip({'trigger': 'hover'});
- $('#list').removeClass('d-none');
- let data = [
- [
- {name:'counting_month',type:'dateMonth',tip:'选择账单日期',placeholder: '----年--月'},
- {
- name: 'supplier_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的供应商'],
- placeholder: ['供应商', '定位或多选供应商'], data: this.suppliers
- },
- ],
- ];
- this.form = new query({
- el: "#form_div",
- condition: data,
- });
- this.form.init();
- let column = [
- {
- name: 'cloneCheckAll', customization: true, type: 'checkAll',column:'id',
- dom: $('#cloneCheckAll').removeClass('d-none'), neglect: true
- },
- {name: 'id', value: '对账编号', neglect: true},
- {name: 'counting_month', value: '账单日期', },
- {name: 'created_at', value: '提交日期',},
- {name: 'supplier', value: '供应商',},
- {name: 'total_payable', value: '总金额',},
- {name: 'status', value: '状态'},
- {name: '', value: '操作', neglect: true},
- ];
- let _this = this;
- setTimeout(function () {
- let header = new Header({
- el: "#header",
- column: column,
- data: _this.procurementTotalBills,
- restorationColumn: 'id',
- fixedTop: ($('#form_div').height()) + 2,
- offset: 0.5,
- vue: vue
- });
- header.init();
- }, 0);
- },
- methods: {
- //全选事件
- checkAll(e) {
- if (e.target.checked) {
- this.procurementTotalBills.forEach((el, i) => {
- if (this.checkData.indexOf(el.id) == '-1') {
- this.checkData.push(el.id);
- }
- });
- } else {
- this.checkData = [];
- }
- },
- procurementTotalBillExport(selectAll){
- let url = '{{url('procurement/finance/procurementTotalBillExport')}}';
- let token='{{ csrf_token() }}';
- excelExport(selectAll,this.checkData,url,this.sum,token);
- },
- }
- });
- </script>
- @endsection
|