| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- @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="checkBillExport(false)" href="javascript:">导出勾选内容</a>
- <a class="dropdown-item" @click="checkBillExport(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="(procurementCheckSheet,i) in procurementCheckSheets">
- <td>
- <input class="checkItem" type="checkbox" :value="procurementCheckSheet.id" v-model="checkData">
- </td>
- <td class="">@{{ procurementCheckSheet.procurement_code }}</td>
- <td class="text-muted">@{{ procurementCheckSheet.procurement_at }}</td>
- <td class="text-muted">@{{ procurementCheckSheet.procurement_delivery_at }}</td>
- <td class="text-muted">@{{ procurementCheckSheet.supplier_name }}</td>
- <td class="tooltipTarget" style="max-width: 200px;overflow:hidden">@{{ procurementCheckSheet.material_code }}</td>
- <td class="text-muted">@{{ procurementCheckSheet.material_name }}</td>
- <td class="text-muted">@{{ procurementCheckSheet.procurement_quantity }}</td>
- <td class="text-muted">@{{ procurementCheckSheet.amount }}</td>
- <td class="text-muted">@{{ procurementCheckSheet.signer_name }}</td>
- <td class="text-muted">@{{ procurementCheckSheet.signed_at }}</td>
- <td class="text-muted">@{{ procurementCheckSheet.account_payable }}</td>
- <td><span>@{{ procurementCheckSheet.invoice_number }}</span></td>
- <td><span>@{{ procurement_check_sheet_status[procurementCheckSheet.status] }}</span></td>
- <td><a class="text-primary" @click="fillInvoiceNumber(procurementCheckSheet.id)" v-if="!procurementCheckSheet.invoice_number">填写发票号</a></td>
- </tr>
- </table>
- @can('采购管理-财务-对账单')
- @include('procurement.finance._fillInvoiceNumber')
- @endcan
- <div class="text-info h5 btn btn">{{$procurementCheckSheets->count()}}/@{{ sum }}</div>
- <div>{{$procurementCheckSheets->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: {
- procurementCheckSheets: [
- @foreach($procurementCheckSheets as $procurementCheckSheet)
- {
- id:'{{$procurementCheckSheet->id}}',invoice_number:'{{$procurementCheckSheet->invoice_number}}',account_payable:'{{$procurementCheckSheet->account_payable}}',
- created_at:'{{$procurementCheckSheet->created_at}}',auditor:'{{$procurementCheckSheet->auditor}}',status:'{{$procurementCheckSheet->status}}',
- @if($procurementCheckSheet->procurementDelivery)
- amount:'{{$procurementCheckSheet->procurementDelivery->amount}}',initiator:'{{$procurementCheckSheet->procurementDelivery->initiator}}',
- signer:'{{$procurementCheckSheet->procurementDelivery->signer}}',signed_at:'{{$procurementCheckSheet->procurementDelivery->signed_at}}',
- procurement_delivery_at:'{{$procurementCheckSheet->procurementDelivery->created_at}}',@endif
- @if($procurementCheckSheet->procurementDelivery->procurement)
- procurement_quantity:'{{$procurementCheckSheet->procurementDelivery->procurement->quantity}}',
- procurement_code:'{{$procurementCheckSheet->procurementDelivery->procurement->code}}',
- procurement_at:'{{$procurementCheckSheet->procurementDelivery->procurement->created_at}}',@endif
- @if($procurementCheckSheet->procurementDelivery->receiver)
- signer_name:'{{$procurementCheckSheet->procurementDelivery->receiver->name}}',@endif
- @if($procurementCheckSheet->procurementDelivery->procurement->supplier)
- supplier_id:'{{$procurementCheckSheet->procurementDelivery->procurement->supplier->id}}',supplier_name:'{{$procurementCheckSheet->procurementDelivery->procurement->supplier->name}}',@endif
- @if($procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material)
- material_id:'{{$procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material->id}}',
- material_name:'{{$procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material->name}}',
- material_code:'{{$procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material->code}}',@endif
- }
- @endforeach
- ],
- suppliers:[
- @foreach($suppliers as $supplier)
- {name:'{{$supplier->id}}',value:'{{$supplier->name}}'},
- @endforeach
- ],
- materials: [
- @foreach($materials as $material)
- {name:'{{$material->id}}',value:'{{$material->name}}'},
- @endforeach
- ],
- checkData: [],
- sum:{!! $procurementCheckSheets->total() !!},
- procurement_check_sheet_status:{!! json_encode(\App\ProcurementCheckSheet::status,JSON_UNESCAPED_UNICODE) !!},
- invoice_number:'',procurementCheckSheetId:null,
- },
- mounted: function () {
- $(".tooltipTarget").tooltip({'trigger': 'hover'});
- $('#list').removeClass('d-none');
- let data = [
- [
- {name: 'signed_at', type: 'dateTime', tip: '选择显示指定的签收日期'},
- {
- name: 'supplier_id', type: 'select_multiple_select', tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的供应商'],
- placeholder: ['供应商', '定位或多选供应商'], data: this.suppliers
- },
- {
- name: 'status', type: 'select',
- tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的耗材'],
- placeholder: '对账单状态',
- data: [{name:0,value:'未出账'},{name:1,value:'已出账'},{name:2,value:'已完结'},],
- },
- ],
- ];
- 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: 'code', value: '采购编号', neglect: true},
- {name: 'procurement_at', value: '采购日期', class: ''},
- {name: '', value: '送货日期', class: 'text-muted'},
- {name: 'company_name', value: '供应商名称', class: 'text-muted'},
- {name: 'material_code', value: '耗材编号', class: 'text-muted'},
- {name: 'material_name', value: '耗材'},
- {name: 'quantity', value: '采购数量', class: 'text-muted'},
- {name: 'amount', value: '送货数量', class: 'text-muted'},
- {name: 'signer', value: '签收人', class: 'text-muted'},
- {name: 'signed_at', value: '签收日期', class: 'text-muted'},
- {name: '', value: '应付金额', neglect: true},
- {name: '', value: '发票号', neglect: true},
- {name: '', value: '状态', neglect: true},
- {name: '', value: '填写发票号', neglect: true},
- ];
- let _this = this;
- setTimeout(function () {
- let header = new Header({
- el: "#header",
- column: column,
- data: _this.procurementCheckSheets,
- restorationColumn: 'id',
- fixedTop: ($('#form_div').height()) + 2,
- offset: 0.5,
- vue: vue
- });
- header.init();
- }, 0);
- },
- methods: {
- //全选事件
- checkAll(e) {
- if (e.target.checked) {
- this.procurementCheckSheets.forEach((el, i) => {
- if (this.checkData.indexOf(el.id) == '-1') {
- this.checkData.push(el.id);
- }
- });
- } else {
- this.checkData = [];
- }
- },
- fillInvoiceNumber(id){
- let _this=this;
- _this.procurementCheckSheetId=id;
- $('#fill-invoice-number').modal('show');
- },
- fillInvoice(){
- let _this=this;
- if (!_this.procurementCheckSheetId)return;
- if (!_this.invoice_number){
- tempTip.setDuration(3000);
- tempTip.show('发票号不可为空!');
- }
- let url = '{{url('procurement/finance/fillInvoice')}}';
- let params = {invoice_number:_this.invoice_number,procurementCheckSheetId:_this.procurementCheckSheetId};
- window.axios.post(url,params).then(function (res) {
- if (!res.data.success){
- tempTip.setDuration(3000);
- tempTip.show(res.data.message);
- }else {
- _this.procurementCheckSheets.forEach(function (procurementCheckSheet) {
- if (procurementCheckSheet.id===_this.procurementCheckSheetId){
- procurementCheckSheet.invoice_number=_this.invoice_number;
- }
- });
- $("#fill-invoice-number").modal('hide');
- tempTip.setDuration(3000);
- tempTip.showSuccess('添加发票号成功!');
- }
- }).catch(function (err) {
- tempTip.setDuration(3000);
- tempTip.show('添加发票号失败!网络错误:'+err);
- });
- },
- checkBillExport(selectAll){
- let url = '{{url('procurement/finance/checkBillExport')}}';
- let token='{{ csrf_token() }}';
- excelExport(selectAll,this.checkData,url,this.sum,token);
- },
- }
- });
- </script>
- @endsection
|