|
|
@@ -18,18 +18,84 @@
|
|
|
</span>
|
|
|
</div>
|
|
|
<table class="table table-sm table-striped table-bordered table-hover text-nowrap card-body mt-2 td-min-width-80" id="table">
|
|
|
- <tr v-for="(procurementTotalBill,i) in procurementTotalBills">
|
|
|
- <td>
|
|
|
+ <template v-for="(procurementTotalBill,i) in procurementTotalBills">
|
|
|
+ <tr>
|
|
|
+ <td >
|
|
|
<input class="checkItem" type="checkbox" :value="procurementTotalBill.id">
|
|
|
</td>
|
|
|
- <td><span>@{{ procurementTotalBill.id }}</span></td>
|
|
|
- <td class="text-muted"><span>@{{ procurementTotalBill.counting_month }}</span></td>
|
|
|
- <td class="text-muted"><span>@{{ procurementTotalBill.created_at.substr(0,10) }}</span></td>
|
|
|
- <td class="text-muted"><span>@{{ procurementTotalBill.supplier_name }}</span></td>
|
|
|
- <td><span>@{{ procurementTotalBill.total_payable }}</span></td>
|
|
|
- <td><span>@{{ procurement_total_bill_status[procurementTotalBill.status] }}</span></td>
|
|
|
+ <td class="text-center"><span>@{{ procurementTotalBill.id }}</span></td>
|
|
|
+ <td class="text-muted text-center"><span>@{{ procurementTotalBill.counting_month }}</span></td>
|
|
|
+ <td class="text-muted text-center"><span>@{{ procurementTotalBill.created_at.substr(0,10) }}</span></td>
|
|
|
+ <td class="text-muted text-center"><span>@{{ procurementTotalBill.supplier_name }}</span></td>
|
|
|
+ <td class="text-center"><span>@{{ procurementTotalBill.total_payable }}</span></td>
|
|
|
+ <td class="text-center"><span>@{{ procurement_total_bill_status[procurementTotalBill.status] }}</span></td>
|
|
|
+ <td class="text-center">
|
|
|
+ <button class="btn btn-sm btn-outline-info" @click="getCheckBill(procurementTotalBill,i,$event)">点击展开</button>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr v-if="procurementTotalBill.showSubject" class="p-0 up" >
|
|
|
+ <td></td>
|
|
|
+ <td colspan="7" class="p-0 m-0">
|
|
|
+ <div class="p-0 " :id="'Statement' + i">
|
|
|
+ <table class="table table-bordered m-0">
|
|
|
+ <thead class="thead-light">
|
|
|
+ <tr>
|
|
|
+ <th>采购编号</th>
|
|
|
+ <th>采购日期</th>
|
|
|
+ <th>送货日期</th>
|
|
|
+ <th>供应商</th>
|
|
|
+ <th>耗材编号</th>
|
|
|
+ <th>耗材</th>
|
|
|
+ <th>采购数量</th>
|
|
|
+ <th>送货数量</th>
|
|
|
+ <th>签收人</th>
|
|
|
+ <th>签收日期</th>
|
|
|
+ <th>应付金额</th>
|
|
|
+ <th>发票号</th>
|
|
|
+ <th>状态</th>
|
|
|
+ <th>填写发票号</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr v-for="(procurementCheckSheet,i) in procurementTotalBill.procurementCheckSheets">
|
|
|
+ <td>
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery.procurement">@{{ procurementCheckSheet.procurement_delivery.procurement.code }}</span></td>
|
|
|
+ <td class="text-muted">
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery.procurement">@{{ procurementCheckSheet.procurement_delivery.procurement.created_at }}</span></td>
|
|
|
+ <td class="text-muted">
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery">@{{ procurementCheckSheet.procurement_delivery.created_at }}</span></td>
|
|
|
+ <td class="text-muted">
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery.procurement.supplier">@{{ procurementCheckSheet.procurement_delivery.procurement.supplier.name }}</span></td>
|
|
|
+ <td class="tooltipTarget" style="max-width: 200px;overflow:hidden">
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery.procurement.owner_material">@{{ procurementCheckSheet.procurement_delivery.procurement.owner_material.material_code }}</span></td>
|
|
|
+ <td class="text-muted">
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery.procurement.owner_material">@{{ procurementCheckSheet.procurement_delivery.procurement.owner_material.material.name }}</span></td>
|
|
|
+ <td class="text-muted">
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery.procurement">@{{ procurementCheckSheet.procurement_delivery.procurement.quantity }}</span></td>
|
|
|
+ <td class="text-muted">
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery">@{{ procurementCheckSheet.procurement_delivery.amount }}</span></td>
|
|
|
+ <td class="text-muted">
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery.receiver">@{{ procurementCheckSheet.procurement_delivery.receiver.name }}</span></td>
|
|
|
+ <td class="text-muted">
|
|
|
+ <span v-if="procurementCheckSheet.procurement_delivery">@{{ procurementCheckSheet.procurement_delivery.signed_at }}</span></td>
|
|
|
+ <td class="text-muted"><span >@{{ procurementCheckSheet.account_payable }}</span></td>
|
|
|
+ <td><span>@{{ procurementCheckSheet.invoice_number }}</span></td>
|
|
|
+ <td><span>@{{ procurement_check_sheet_status[procurementCheckSheet.status] }}</span></td>
|
|
|
+ <td class="text-center">
|
|
|
+ <a class="text-primary" @click="fillInvoiceNumber(procurementCheckSheet.id)" v-if="!procurementCheckSheet.invoice_number">填写发票号</a>
|
|
|
+ <span v-else>-</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
+ </template>
|
|
|
</table>
|
|
|
+ @can('采购管理-财务-对账单')
|
|
|
+ @include('procurement.finance._fillInvoiceNumber')
|
|
|
+ @endcan
|
|
|
<div class="text-info h5 btn btn">{{$procurementTotalBills->count()}}/@{{ sum }}</div>
|
|
|
<div>{{$procurementTotalBills->appends($paginateParams)->links()}}</div>
|
|
|
</div>
|
|
|
@@ -46,6 +112,7 @@
|
|
|
@foreach($procurementTotalBills as $procurementTotalBill)
|
|
|
{
|
|
|
id:'{{$procurementTotalBill->id ?? ''}}',counting_month:'{{$procurementTotalBill->counting_month ?? ''}}',
|
|
|
+ showSubject:false,procurementCheckSheets:[],
|
|
|
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
|
|
|
@@ -59,9 +126,12 @@
|
|
|
],
|
|
|
sum:{!! $procurementTotalBills->total() !!},
|
|
|
procurement_total_bill_status:{!! json_encode(\App\ProcurementTotalBill::status,JSON_UNESCAPED_UNICODE) !!},
|
|
|
+ procurement_check_sheet_status:{!! json_encode(\App\ProcurementCheckSheet::status,JSON_UNESCAPED_UNICODE) !!},
|
|
|
+ invoice_number:'',procurementCheckSheetId:null,index:'',
|
|
|
|
|
|
},
|
|
|
mounted: function () {
|
|
|
+ $(".up").slideUp();
|
|
|
$(".tooltipTarget").tooltip({'trigger': 'hover'});
|
|
|
$('#list').removeClass('d-none');
|
|
|
let data = [
|
|
|
@@ -85,6 +155,7 @@
|
|
|
{name: 'supplier', value: '供应商',class: 'text-center'},
|
|
|
{name: 'total_payable', value: '总金额',class: 'text-center'},
|
|
|
{name: 'status', value: '状态',class: 'text-center'},
|
|
|
+ {name: 'detail', value: '月账单详情',class: 'text-center'},
|
|
|
];
|
|
|
new Header({
|
|
|
el: "table",
|
|
|
@@ -100,6 +171,68 @@
|
|
|
let token='{{ csrf_token() }}';
|
|
|
excelExport(selectAll,checkData,url,this.sum,token);
|
|
|
},
|
|
|
+ getCheckBill(procurementTotalBill,index,$e){
|
|
|
+ this.index=index;
|
|
|
+ if(procurementTotalBill.showSubject){
|
|
|
+ procurementTotalBill.showSubject=false;
|
|
|
+ $($e.target).html('点击展开');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $($e.target).html('加载中...');
|
|
|
+ let url = '{{url('procurement/finance/getCheckBillMonth')}}'
|
|
|
+ let data = {
|
|
|
+ 'procurement_total_bill_id':procurementTotalBill['id'],
|
|
|
+ };
|
|
|
+ window.axios.post(url,data).then(res=>{
|
|
|
+ if(res.data.success){
|
|
|
+ // this.$set(this.procurementTotalBills[index],'subjection',res.data.data);
|
|
|
+ this.procurementTotalBills[index].procurementCheckSheets=res.data.data;
|
|
|
+ procurementTotalBill['showSubject'] = true;
|
|
|
+ $("#Statement"+index).slideToggle();
|
|
|
+ $($e.target).html('点击收起');
|
|
|
+ this.$forceUpdate();
|
|
|
+ }
|
|
|
+ }).catch(err=>{
|
|
|
+ $($e.target).html('点击展开');
|
|
|
+ window.tempTip.show(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 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('发票号不可为空!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ 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.procurementTotalBills[_this.index].procurementCheckSheets.forEach(function (procurementCheckSheet) {
|
|
|
+ if (procurementCheckSheet.id===_this.procurementCheckSheetId){
|
|
|
+ procurementCheckSheet.invoice_number=res.data.data;
|
|
|
+ procurementCheckSheet.status=res.data.status;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (res.data.totalStatus) _this.procurementTotalBills[_this.index].status=res.data.totalStatus;
|
|
|
+ $("#fill-invoice-number").modal('hide');
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.showSuccess('添加发票号成功!');
|
|
|
+ }
|
|
|
+ }).catch(function (err) {
|
|
|
+ tempTip.setDuration(3000);
|
|
|
+ tempTip.show('添加发票号失败!网络错误:'+err);
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
});
|
|
|
</script>
|