ajun 5 سال پیش
والد
کامیت
26712b94a5

+ 29 - 83
app/Http/Controllers/WaybillsController.php

@@ -106,51 +106,13 @@ class WaybillsController extends Controller
         if(!Gate::allows('运输管理-查询')){ return redirect(url('/'));  }
         if(!Gate::allows('运输管理-查询')){ return redirect(url('/'));  }
         $data=$request->input();
         $data=$request->input();
         if ($data != null ) {
         if ($data != null ) {
-            $waybills=Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-                return $query->with('user');
-            }])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remake')
-                ->leftJoin('waybill_on_tops','waybill_on_tops.waybill_id','=','waybills.id')
-                ->orderBy('waybill_on_tops.waybill_id','desc')
-                ->orderBy('waybills.id','desc');
-//            $waybillsWithTops=Waybill::has('waybillOnTop')->with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            },'waybillOnTop'])->orderBy('id','DESC');
-//            $waybillsWithoutTops=Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            }])->orderBy('id','DESC');
-//            $waybills = $waybillsWithTops->union($waybillsWithoutTops)->paginate();
+            $waybills = $this->getWaybills();
             $waybills=$this->conditionQuery($request,$waybills);
             $waybills=$this->conditionQuery($request,$waybills);
             $carries = Carrier::get();
             $carries = Carrier::get();
             $owners = Owner::get();
             $owners = Owner::get();
-
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'']);
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'']);
         } else {
         } else {
-            DB::enableQueryLog();
-//            $waybills = Waybill::with(['owner','waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            }],'waybillOnTop')->orderBy('id', 'DESC')->paginate(50);
-//
-//            $waybillsWithTops=Waybill::has('waybillOnTop')->with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            },'waybillOnTop'])->orderBy('id','DESC');
-
-//            $waybills=Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            }])->leftJoin('waybill_on_top','waybill_on_top.waybill_id','=','waybills.id')
-//                ->orderBy('waybill_on_top.waybill_id','DESC')
-//                ->orderBy('waybills.id','desc')->paginate(50);
-
-//
-//            $waybills = Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            }])->paginate(50);
-
-            $waybills = Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-                return $query->with('user');
-            }])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remake')
-                ->leftJoin('waybill_on_tops','waybill_on_tops.id','=','waybills.id')
-                ->orderBy('waybill_on_tops.id','desc')
-                ->orderBy('waybills.id','desc')->paginate(50);
+            $waybills = $this->getWaybills()->paginate(50);
             $carries = Carrier::get();
             $carries = Carrier::get();
             $owners = Owner::get();
             $owners = Owner::get();
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'']);
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'']);
@@ -161,28 +123,15 @@ class WaybillsController extends Controller
         if(!Gate::allows('运输管理-查询')){ return redirect(url('/'));  }
         if(!Gate::allows('运输管理-查询')){ return redirect(url('/'));  }
         $data=$request->input();
         $data=$request->input();
         if ($data != null ) {
         if ($data != null ) {
-//            $waybills=Waybill::with(['owner','wmsCommodities', 'waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            }],'waybillOnTop')->orderBy('id','DESC')->where('type','直发车');
 
 
-            $waybills=Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-                return $query->with('user');
-            }])->leftJoin('waybill_on_top','waybill_on_tops.id','=','waybills.id')
-                ->orderBy('waybill_on_tops.id','desc')
-                ->orderBy('waybills.id','desc')->where('type','直发车');
+            $waybills = $this->getWaybills()->where('type','直发车');
+
             $waybills=$this->conditionQuery($request,$waybills);
             $waybills=$this->conditionQuery($request,$waybills);
             $carries = Carrier::get();
             $carries = Carrier::get();
             $owners = Owner::get();
             $owners = Owner::get();
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'ZF']);
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'ZF']);
         } else {
         } else {
-            $waybills=Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-                return $query->with('user');
-            }])->leftJoin('waybill_on_top','waybill_on_tops.id','=','waybills.id')
-                ->orderBy('waybill_on_tops.id','desc')
-                ->orderBy('waybills.id','desc')->where('type','直发车')->paginate(50);
-//            $waybills = Waybill::with(['owner','wmsCommodities', 'waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            }],'waybillOnTop')->where('type','直发车')->orderBy('id', 'DESC')->paginate(50);
+            $waybills = $this->getWaybills()->where('type','直发车')->paginate(50);
             $carries = Carrier::get();
             $carries = Carrier::get();
             $owners = Owner::get();
             $owners = Owner::get();
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'ZF']);
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'ZF']);
@@ -194,28 +143,14 @@ class WaybillsController extends Controller
         if(!Gate::allows('运输管理-查询')){ return redirect(url('/'));  }
         if(!Gate::allows('运输管理-查询')){ return redirect(url('/'));  }
         $data=$request->input();
         $data=$request->input();
         if ($data != null ) {
         if ($data != null ) {
+            $waybills = $this->getWaybills()->where('type','专线');
 
 
-            $waybills=Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-                return $query->with('user');
-            }])->leftJoin('waybill_on_top','waybill_on_tops.id','=','waybills.id')
-                ->orderBy('waybill_on_tops.id',' DESC')
-                ->orderBy('waybills.id','desc')->where('type','专线');/*->orderBy('id', 'DESC');*/
-//            $waybills=Waybill::with(['owner','wmsCommodities', 'waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            }],'waybillOnTop')->orderBy('id','DESC')->where('type','专线');
             $waybills=$this->conditionQuery($request,$waybills);
             $waybills=$this->conditionQuery($request,$waybills);
             $carries = Carrier::get();
             $carries = Carrier::get();
             $owners = Owner::get();
             $owners = Owner::get();
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'ZX']);
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'ZX']);
         } else {
         } else {
-            $waybills=Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
-                return $query->with('user');
-            }])->leftJoin('waybill_on_top','waybill_on_tops.id','=','waybills.id')
-                ->orderBy('waybill_on_tops.id','desc')
-                ->orderBy('waybills.id','DESC')->where('type','专线')->paginate(50);
-//            $waybills = Waybill::with(['owner','wmsCommodities', 'waybillAuditLogs' => function ($query) {
-//                return $query->with('user');
-//            }],'waybillOnTop')->where('type','专线')->orderBy('id', 'DESC')->paginate(50);
+            $waybills = $this->getWaybills()->where('type','专线')->paginate(50);
             $carries = Carrier::get();
             $carries = Carrier::get();
             $owners = Owner::get();
             $owners = Owner::get();
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'ZX']);
             return view('waybill.index', ['waybills' => $waybills, 'carriers' => $carries, 'owners' => $owners,'filterData'=>$data,'uriType'=>'ZX']);
@@ -989,16 +924,19 @@ class WaybillsController extends Controller
         return view('waybill.recycle',compact('waybills','total','paginateParams'));
         return view('waybill.recycle',compact('waybills','total','paginateParams'));
     }
     }
 
 
-    // 恢复被删除
+    // 软删除恢复
     public function apiRestoreSelected(Request $request){
     public function apiRestoreSelected(Request $request){
+        DB::enableQueryLog();
         if(!Gate::allows('运输管理-删除')){return ['success'=>'false','fail_info'=>'没有权限'];}
         if(!Gate::allows('运输管理-删除')){return ['success'=>'false','fail_info'=>'没有权限'];}
         $ids = $request->input('ids')??'';
         $ids = $request->input('ids')??'';
+        if($ids == ''){return ['success'=>'false','fail_info'=>'没有可恢复对象'];}
         $waybills =  Waybill::withTrashed()->whereIn('id',$ids)->get();
         $waybills =  Waybill::withTrashed()->whereIn('id',$ids)->get();
+        $result = '';
         $waybills->each(function (Waybill $waybill){
         $waybills->each(function (Waybill $waybill){
             $waybill->restore();
             $waybill->restore();
         });
         });
         $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
         $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
-        return ['success'=>'true','waybills'=>$waybills];
+        return ['success'=>$result,'waybills'=>$waybills];
     }
     }
     // 修改运费
     // 修改运费
     public function changeFee(Request $request){
     public function changeFee(Request $request){
@@ -1020,30 +958,38 @@ class WaybillsController extends Controller
         if(is_null($id)){
         if(is_null($id)){
             return  ['success'=>'false','fail_info'=>'传参错误'];
             return  ['success'=>'false','fail_info'=>'传参错误'];
         }
         }
-        DB::enableQueryLog();
-        $count = WaybillOnTop::withTrashed()->where('waybill_id',$id)->count();;
+        $wayontop = WaybillOnTop::withTrashed()->where('waybill_id',$id);
         $result = '';
         $result = '';
-        if($count == 0 ){
+        if(count($wayontop->get()) == 0){
             $wayontop = WaybillOnTop::create(['waybill_id'=>$id,'remark'=>$detail]);
             $wayontop = WaybillOnTop::create(['waybill_id'=>$id,'remark'=>$detail]);
-            dd($wayontop->get(0));
             $result = $wayontop->save();
             $result = $wayontop->save();
         }else{
         }else{
-            $wayontop = WaybillOnTop::withTrashed()->where('id',$id);
-            $result = $wayontop->restore();
+            $wayontop = WaybillOnTop::withTrashed()->where('waybill_id',$id);
+            $result = WaybillOnTop::withTrashed()->where('waybill_id',$id)->restore();
         }
         }
         return ['success'=>$result,'status'=>$result];
         return ['success'=>$result,'status'=>$result];
     }
     }
     // 取消置顶
     // 取消置顶
     public function cancelOnTop(Request $request){
     public function cancelOnTop(Request $request){
-
         $id =  $request->input('id');
         $id =  $request->input('id');
         if(!Gate::allows('运输管理-置顶')){return ['success'=>'false','fail_info'=>'没有权限'];}
         if(!Gate::allows('运输管理-置顶')){return ['success'=>'false','fail_info'=>'没有权限'];}
         if(is_null($id)){
         if(is_null($id)){
             return  ['success'=>'false','fail_info'=>'传参错误'];
             return  ['success'=>'false','fail_info'=>'传参错误'];
         }
         }
-        WaybillOnTop::where('waybill_id',$id)->update(['remark'=>null]);
-        $result = WaybillOnTop::where('id',$id)->delete();
+        $result = WaybillOnTop::where('waybill_id',$id)->forceDelete();
         return ['success'=>$result,'status'=>$result];
         return ['success'=>$result,'status'=>$result];
     }
     }
 
 
+    // 获取所有运单信息
+    public function getWaybills(){
+        $waybills = Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
+            return $query->with('user');
+        }])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
+            ->leftJoin('waybill_on_tops','waybill_on_tops.waybill_id','=','waybills.id')
+            ->whereNull('waybill_on_tops.deleted_at')
+            ->orderBy('waybill_on_tops.updated_at','desc')
+            ->orderBy('waybills.id','desc');
+        return $waybills;
+    }
+
 }
 }

+ 1 - 1
app/Waybill.php

@@ -25,7 +25,7 @@ class Waybill extends Model
         'carrier_weight_unit_name',
         'carrier_weight_unit_name',
         'warehouse_weight_unit_other_name',
         'warehouse_weight_unit_other_name',
         'carrier_weight_unit_other_name',
         'carrier_weight_unit_other_name',
-        'waybillOnTop',
+        'waybillOnTop','remake',
     ];
     ];
 
 
     public function owner(){
     public function owner(){

+ 20 - 0
app/WaybillOnTop.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace App;
+
+use App\Traits\ModelTimeFormat;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\SoftDeletes;
+
+class WaybillOnTop extends Model
+{
+    //
+    use ModelTimeFormat;
+    use SoftDeletes;
+
+    protected $fillable = ['remark','waybill_id'];
+
+    public function waybill(){
+        return $this->hasOne('App/Waybill','id','waybill_id');
+    }
+}

+ 12 - 0
database/factories/WaybillOnTopFactory.php

@@ -0,0 +1,12 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\WaybillOnTop;
+use Faker\Generator as Faker;
+
+$factory->define(WaybillOnTop::class, function (Faker $faker) {
+    return [
+        //
+    ];
+});

+ 34 - 0
database/migrations/2020_06_19_114513_create_waybill_on_tops_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateWaybillOnTopsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('waybill_on_tops', function (Blueprint $table) {
+            $table->id();
+            $table->timestamps();
+            $table->integer('waybill_id')->index();
+            $table->string('remark');
+            $table->softDeletes()->index();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('waybill_on_tops');
+    }
+}

+ 17 - 16
resources/views/waybill/index.blade.php

@@ -221,9 +221,9 @@
                     </td>
                     </td>
                     @can('运输管理-置顶')
                     @can('运输管理-置顶')
                     <td class=" text-muted toptd" >
                     <td class=" text-muted toptd" >
-                        <div v-if="waybill.is_on_top" class="bg-dark  text-warning top"  data-toggle="tooltip" style="opacity: 0.1"
-                        >@{{  waybill.is_on_top }}</div>
-                        <a v-if="waybill.is_on_top" class="text-muted" @click="cancelOnTop($event)" :data_id="waybill.id" href="javascript:0">取消<br>置顶</a>
+                        <div v-if="waybill.remark" class="bg-dark  text-warning top"  data-toggle="tooltip" style="opacity: 0.1"
+                        >@{{  waybill.remark }}</div>
+                        <a v-if="waybill.remark" class="text-muted" @click="cancelOnTop($event)" :data_id="waybill.id" href="javascript:0">取消<br>置顶</a>
                         <a v-else @click="waybillOnTop($event)" :data_id="waybill.id" class="text-danger" href="javascript:0">置顶</a>
                         <a v-else @click="waybillOnTop($event)" :data_id="waybill.id" class="text-danger" href="javascript:0">置顶</a>
                     </td>
                     </td>
                     @endcan
                     @endcan
@@ -347,12 +347,6 @@
             60%{opacity:0.4}
             60%{opacity:0.4}
             80%{opacity:0.6}
             80%{opacity:0.6}
             100%{opacity:0.75}
             100%{opacity:0.75}
-            /*from {*/
-            /*     opacity:0.75;*/
-            /*}*/
-            /*to{*/
-            /*    opacity:0.1;*/
-            /*}*/
         }
         }
         @-webkit-keyframes anima
         @-webkit-keyframes anima
         {
         {
@@ -363,7 +357,6 @@
                 opacity:0.1;
                 opacity:0.1;
             }
             }
         }
         }
-
         .top{
         .top{
             padding-top: 0px;
             padding-top: 0px;
             margin-left: 88px;
             margin-left: 88px;
@@ -386,7 +379,6 @@
             -webkit-animation-iteration-count: infinite;
             -webkit-animation-iteration-count: infinite;
             -webkit-animation-direction: alternate;
             -webkit-animation-direction: alternate;
             -webkit-animation-play-state: running;
             -webkit-animation-play-state: running;
-
         }
         }
     </style>
     </style>
     <script>
     <script>
@@ -413,7 +405,7 @@
                         pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
                         pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
                         collect_fee:'{{$waybill->collect_fee}}', @endcan dispatch_remark:'{{$waybill->dispatch_remark}}',isBtn:false,
                         collect_fee:'{{$waybill->collect_fee}}', @endcan dispatch_remark:'{{$waybill->dispatch_remark}}',isBtn:false,
                         waybillAuditLogs:{!! $waybill->waybillAuditLogs !!},
                         waybillAuditLogs:{!! $waybill->waybillAuditLogs !!},
-                        @if($waybill->waybillOnTop)is_on_top:'{{$waybill->waybillOnTop->remark}}', @else is_on_top:'', @endif
+                        @if($waybill->remark)remark:'{{$waybill->remark}}', @else remark:'', @endif
                     },
                     },
                     @endforeach
                     @endforeach
                 ],
                 ],
@@ -743,15 +735,20 @@
                     let target = $(e.target);
                     let target = $(e.target);
                     let id = target.attr('data_id');
                     let id = target.attr('data_id');
                     let ajaxUrl = '{{url('waybill/ontop/top')}}';
                     let ajaxUrl = '{{url('waybill/ontop/top')}}';
+                    alert(ajaxUrl);
                     let detail = '';
                     let detail = '';
                     tempTip.inputVal('输入置顶备注',function (detail) {
                     tempTip.inputVal('输入置顶备注',function (detail) {
                         if(id !== null && detail!=null){
                         if(id !== null && detail!=null){
                             axios.post(ajaxUrl,{'id':id,'detail':detail}).then(function (response) {
                             axios.post(ajaxUrl,{'id':id,'detail':detail}).then(function (response) {
                                 if(response.data.success){
                                 if(response.data.success){
-                                    tempTip.setDuration(30000);
+                                    tempTip.setDuration(3000);
                                     tempTip.showSuccess('置顶成功');
                                     tempTip.showSuccess('置顶成功');
+                                    setTimeout(function(){
+                                        window.location.reload();
+                                        }
+                                    ,1000);
                                 }else{
                                 }else{
-                                    tempTip.setDuration(30000);
+                                    tempTip.setDuration(3000);
                                     tempTip.show('置顶失败!'+response.fail_info);
                                     tempTip.show('置顶失败!'+response.fail_info);
                                 }
                                 }
                             }).catch(function (err) {
                             }).catch(function (err) {
@@ -770,12 +767,16 @@
                             if(response.data.success){
                             if(response.data.success){
                                 tempTip.setDuration(30000);
                                 tempTip.setDuration(30000);
                                 tempTip.showSuccess('取消置顶成功');
                                 tempTip.showSuccess('取消置顶成功');
+                                setTimeout(function(){
+                                        window.location.reload();
+                                    }
+                                    ,1000);
                             }else{
                             }else{
-                                tempTip.setDuration(30000);
+                                tempTip.setDuration(3000);
                                 tempTip.show('取消置顶失败!'+response.fail_info);
                                 tempTip.show('取消置顶失败!'+response.fail_info);
                             }
                             }
                         }).catch(function (err) {
                         }).catch(function (err) {
-                            tempTip.setDuration(30000);
+                            tempTip.setDuration(3000);
                             tempTip.show('取消置顶失败,网络连接错误!'+err);
                             tempTip.show('取消置顶失败,网络连接错误!'+err);
                         });
                         });
                     }
                     }

+ 210 - 0
resources/views/waybill/recycle.blade.php

@@ -0,0 +1,210 @@
+@extends('layouts.app')
+@section('title')已删除@endsection
+
+@section('content')
+    <div id="nav2">
+    @component('waybill.menu')@endcomponent
+    </div>
+
+    <div class=container-fluid">
+        <div class="card" style="min-width: 2000px;">
+            <div class="card-body" id="list">
+                <div class="card">
+                    <div class="card-body">
+                        <div class="row">
+                            <table class="table mb-n3 table-sm table-bordered">
+                                <tr>
+                                    <td>
+                                        <span class="text-muted">每页显示记录:</span>
+                                    </td>
+                                    <td colspan="9">
+                                        <select name="" id="setPaginate" class="tooltipTarget form-control-sm" v-model="filterParams.paginate" >
+                                            <option value="50">50条</option>
+                                            <option value="100">100条</option>
+                                            <option value="200">200条</option>
+                                            <option value="500">500条</option>
+                                            <option value="1000">1000条</option>
+                                        </select>
+                                    </td>
+                                    <td width="80%"></td>
+                                </tr>
+                                <tr>
+                                    <td class="text-muted">选定操作记录:</td>
+                                    <td colspan="9">
+                                        @can('运输管理-删除')
+                                            <span class="btn btn-sm" @click="restoreSelected" style="cursor: pointer"
+                                                     :class="[waybills_checkBoxes.length > 0?'btn-danger':'btn-outline-danger']">
+                                            恢复
+                                        </span>
+                                        @endcan
+                                    </td>
+                                </tr>
+                            </table>
+
+                        </div>
+                    </div>
+                </div>
+
+                <table class="table table-striped table-sm table-bordered table-hover"  style="background: #fff;">
+                    <tr>
+                        <th class="td-operation">
+                            <label for="all">
+                                <input id="all" type="checkbox" @click="checkAll($event)">
+                            </label>
+                        </th>
+                        <th class="td-operation">状态</th>
+                        <th >ID</th>
+                        <th >创建时间</th>
+                        <th >运单类型</th>
+                        <th >货主</th>
+                        <th >上游单号</th>
+                        <th >WMS订单号</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 >运费</th>
+                        <th >提货费</th>
+                        <th >其他费用</th>
+                        <th >调度备注</th>
+                    </tr>
+                    <tr v-for="waybill in waybills" :id="'waybill'+waybill.id">
+                        <td>
+                            <input class="checkItem" type="checkbox" :value="waybill.id" v-model="waybills_checkBoxes" >
+                        </td>
+                        <td :class="[waybill.status=='已审核'?'text-success':'']">@{{waybill.status}}</td>
+                        <td class="text-muted">@{{waybill.id}}</td>
+                        <td class="text-muted">@{{waybill.created_at}}
+                        <td >@{{waybill.type}} </td>
+                        <td >@{{waybill.owner}}</td>
+                        <td >@{{waybill.source_bill}}</td>
+                        <td class="">@{{waybill.wms_bill_number}}</td>
+                        <td class="">@{{waybill.waybill_number}}</td>
+                        <td class="">@{{waybill.recipient}}</td>
+                        <td class="">@{{waybill.recipient_mobile}}</td>
+                        <td class="text-muted">@{{waybill.origination}}</td>
+                        <td class="text-muted">@{{waybill.destination}}</td>
+                        <td >@{{waybill.carrier}}</td>
+                        <td ><span v-if="waybill.type=='专线'">@{{waybill.carrier_bill}}</span>
+                            <span v-if="waybill.type=='直发车'">
+                            <span v-if="waybill.carType">@{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i></span></span></td>
+                        <td ><span v-if="waybill.warehouse_weight">@{{waybill.warehouse_weight}}  @{{waybill.warehouse_weight_unit}}</span></td>
+                        <td ><span v-if="waybill.carrier_weight">@{{waybill.carrier_weight}}  @{{waybill.carrier_weight_unit}}</span></td>
+                        <td ><span v-if="waybill.warehouse_weight_other">@{{waybill.warehouse_weight_other}}  @{{waybill.warehouse_weight_unit_other}}</span></td>
+                        <td ><span v-if="waybill.carrier_weight_other">@{{waybill.carrier_weight_other}}  @{{waybill.carrier_weight_unit_other}}</span></td>
+                        <td >@{{waybill.amount}} </td>
+                        <td >@{{waybill.mileage}} |km</td>
+                        @can('运输管理-可见费用项')
+                            <td ><span v-if="waybill.type=='专线'"></span><span v-else>@{{waybill.fee}}</span></td>
+                            <td >@{{waybill.pick_up_fee}}</td>
+                            <td >@{{waybill.other_fee}}</td>
+                        @endcan
+                        <td >@{{waybill.dispatch_remark}}</td>
+                    </tr>
+                </table>
+                <div class="text-info h5 btn btn">{{$waybills->count()}}/{{$total}}</div>
+                {{$waybills->appends($paginateParams)->links()}}
+            </div>
+
+        </div>
+
+
+    </div>
+@endsection
+@section('lastScript')
+    <script>
+        let vueList = new Vue({
+            el:'#list',
+            data:{
+                filterParams:{
+                    paginate:'{{$paginateParams['paginate']}}',
+                },
+                waybills_checkBoxes:[],
+                waybills:[
+                        @foreach($waybills as $waybill)
+                    {
+                        id:'{{$waybill->id}}',created_at:'{{$waybill->created_at}}',updated_at:'{{$waybill->updated_at}}',
+                        status:'{{$waybill->status}}',type:'{{$waybill->type}}',waybill_number:'{{$waybill->waybill_number}}',
+                        owner:'{{$waybill->owner_name}}',source_bill:'{{$waybill->source_bill}}',wms_bill_number:'{{$waybill->wms_bill_number}}',origination:'{{$waybill->origination}}',
+                        destination:'{{$waybill->destination}}',recipient:'{{$waybill->recipient}}',recipient_mobile:'{{$waybill->recipient_mobile}}',
+                        charge:'{{$waybill->charge}}',ordering_remark:'{{$waybill->ordering_remark}}',carrier:'{{$waybill->carrier_name}}',
+                        carrier_bill:'{{$waybill->carrier_bill}}',origination_city:'{{$waybill->origination_city_name}}',
+                        destination_city:'{{$waybill->destination_city_name}}',warehouse_weight:'{{$waybill->warehouse_weight}}',
+                        warehouse_weight_unit:'{{$waybill->warehouse_weight_unit_name}}',carrier_weight:'{{$waybill->carrier_weight}}',
+                        carrier_weight_unit:'{{$waybill->carrier_weight_unit_name}}',
+                        warehouse_weight_other:'{{$waybill->warehouse_weight_other}}',
+                        warehouse_weight_unit_other:'{{$waybill->warehouse_weight_unit_other_name}}',carrier_weight_other:'{{$waybill->carrier_weight_other}}',
+                        carrier_weight_unit_other:'{{$waybill->carrier_weight_unit_other_name}}',
+                        mileage:'{{$waybill->mileage}}',amount:'{{$waybill->amount}}',
+                        @if($waybill->carType)carType:{!! $waybill->carType !!},car_owner_info:'{{$waybill->car_owner_info}}',@endif @can('运输管理-可见费用项') fee:'{{$waybill->fee}}',
+                        pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
+                        collect_fee:'{{$waybill->collect_fee}}', @endcan dispatch_remark:'{{$waybill->dispatch_remark}}',isBtn:false,
+                        waybillAuditLogs:{!! $waybill->waybillAuditLogs !!}
+                    },
+                    @endforeach
+                ],
+            },
+            watch:{
+                waybills_checkBoxes:{
+                    handler(){
+                        if (this.waybills_checkBoxes.length === this.waybills.length){
+                            document.querySelector('#all').checked = true;
+                        }else {
+                            document.querySelector('#all').checked = false;
+                        }
+                    },
+                    deep:true
+                },
+            },
+            mounted:function(){
+            },
+            methods:{
+                restoreSelected:function(){
+                    let _this = this;
+                    if(_this.waybills_checkBoxes.length === 0){
+                        tempTip.show("没有勾选记录");
+                        return;
+                    }
+                    if(!confirm("确定要恢复所有勾选的内容为'未删除'吗?")){return;}
+                    let ajaxUrl = '{{url('apiLocal/waybill/recoverSelected')}}';
+                    axios.post(ajaxUrl,{ids:_this.waybills_checkBoxes}).then(function (response) {
+                        if(response.data.success){
+                            tempTip.setDuration(2000);
+                            tempTip.showSuccess('恢复勾选内容成功!');
+                            window.setTimeout(function () {
+                                window.location.href='{{url('waybill/recycle')}}';
+                            },2000);
+                        }else{
+                            tempTip.setDuration(2500);
+                            tempTip.show('恢复勾选内容失败,错误:'+response.data.fail_info);
+                        }
+                    }).catch(function (err) {
+                        tempTip.setDuration(2500);
+                        tempTip.show('恢复勾选内容失败,错误:'+response.data.fail_info);
+                    });
+                },
+                checkAll(e){
+                    if (e.target.checked){
+                        this.waybills.forEach((el,i)=>{
+                            if (this.waybills_checkBoxes.indexOf(el.id) == '-1'){
+                                this.waybills_checkBoxes.push(el.id);
+                            }
+                        });
+                    }else {
+                        this.waybills_checkBoxes = [];
+                    }
+
+                },
+            }
+        })
+    </script>
+@endsection