Zhouzhendong 6 лет назад
Родитель
Сommit
9c10a8c8b8

+ 1 - 0
app/Http/Controllers/InventoryController.php

@@ -14,6 +14,7 @@ class InventoryController extends Controller
     public function conditionQuery(Request $request,$page=null,$paginate=null){
         if(!Gate::allows("库存管理-动库报表")){ return redirect(url('/'));  }
 
+
         $date_start=$request->input('date_start');
         if ($request->input('range'))$date_start=date('Y-m-d',strtotime('-'.$request->input('range')." day"));
         $date_end=$request->input('date_end');

+ 12 - 4
resources/views/inventory/statement/changeInventory.blade.php

@@ -145,8 +145,9 @@
     </form>
     <div >
         <button type="button" @click="pageUp()" :readonly="page>1?false:true" class="btn btn-sm " :class="page>1?'btn-outline-info':''">上一页</button>
-        <button type="button" @click="pageDown()" class="btn btn-sm btn-outline-info ml-5">下一页</button>
-        <input  @keyup.enter="pageSkip($event)" class="form-control-sm ml-3 tooltipTarget" :placeholder="'当前页数:'+page" title="去往指定页">
+        <button type="button" @click="pageDown()" :readonly="page<maxPage?false:true" class="btn btn-sm m-3" :class="page<maxPage?'btn-outline-info':''">下一页</button>
+        <input  @keyup.enter="pageSkip($event)" class="form-control-sm ml-3 tooltipTarget" :placeholder="'当前页数:'+page+'/'+maxPage" title="去往指定页">
+        <span class="text-muted m-1">共 @{{ sum }} 条</span>
     </div>
 </div>
 @endsection
@@ -166,11 +167,17 @@
                     @endforeach
                 ],
                 checkData:[],
+                maxPage:1,
+                sum:0
             },
             mounted:function () {
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
                 this.initInputs();
                 $("#list").removeClass('d-none');
+                if (this.oracleActTransactingLogs.length>0){
+                    this.maxPage=Math.ceil(this.oracleActTransactingLogs[0].sum/50);
+                    this.sum=this.oracleActTransactingLogs[0].sum;
+                }
             },
             computed:{
                 isBeingFilterConditions:function(){
@@ -217,12 +224,13 @@
                      this.href();
                 },
                 pageDown(){
+                    if (this.page>=this.maxPage)return;
                     this.page=this.page+1;
                     this.href();
                 },
                 pageSkip(e){
-                    this.page=e.target.value;
-                  if (Number(this.page)<=0){
+                  this.page=e.target.value;
+                  if (Number(this.page)<=0 || Number(this.page)>this.maxPage){
                       tempTip.setDuration(2000);
                       tempTip.show('页数不存在! ');
                       return