Jelajahi Sumber

运单管理-原路由问题优化

Zhouzhendong 5 tahun lalu
induk
melakukan
659bef0261

+ 10 - 15
app/Http/Controllers/WaybillFinancialExceptedController.php

@@ -27,21 +27,16 @@ class WaybillFinancialExceptedController extends Controller
     {
         if(!Gate::allows('财务报表-查询')){ return redirect(url('/'));  }
         $waybillFinancialSnapshots=WaybillFinancialExcepted::orderBy('id', 'DESC');
+        $type='';
+        if ($request->type=='ZF'){
+            $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('json_content','like','%直发车%');
+            $type='ZF';
+        }
+        if ($request->type=='ZX'){
+            $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('json_content','like','%专线%');
+            $type='ZX';
+        }
         $waybillFinancialSnapshots=$this->conditionQuery($request,$waybillFinancialSnapshots);
-        return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>'','excepted'=>true]);
-    }
-    public function indexZF(Request $request)
-    {
-        if(!Gate::allows('财务报表-查询')){ return redirect(url('/'));  }
-        $waybillFinancialSnapshots=WaybillFinancialExcepted::orderBy('id', 'DESC')->where('json_content','like','%直发车%');
-        $waybillFinancialSnapshots=$this->conditionQuery($request,$waybillFinancialSnapshots);
-        return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>'ZF','excepted'=>true]);
-    }
-    public function indexZX(Request $request)
-    {
-        if(!Gate::allows('财务报表-查询')){ return redirect(url('/'));  }
-        $waybillFinancialSnapshots=WaybillFinancialExcepted::orderBy('id', 'DESC')->where('json_content','like','%专线%');
-        $waybillFinancialSnapshots=$this->conditionQuery($request,$waybillFinancialSnapshots);
-        return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>'ZX','excepted'=>true]);
+        return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>$type,'excepted'=>true]);
     }
 }

+ 10 - 18
app/Http/Controllers/WaybillFinancialSnapshotsController.php

@@ -28,26 +28,18 @@ class WaybillFinancialSnapshotsController extends Controller
     {
         if(!Gate::allows('财务报表-查询')){ return redirect(url('/'));  }
         $waybillFinancialSnapshots=WaybillFinancialSnapshot::orderBy('id', 'DESC');
+        $type='';
+        if ($request->type=='ZF'){
+            $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('json_content','like','%直发车%');
+            $type='ZF';
+        }
+        if ($request->type=='ZX'){
+            $waybillFinancialSnapshots=$waybillFinancialSnapshots->where('json_content','like','%专线%');
+            $type='ZX';
+        }
         $waybillFinancialSnapshots=$this->conditionQuery($request,$waybillFinancialSnapshots);
-        return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>'']);
-    }
-
-    public function indexZF(Request $request)
-    {
-        if(!Gate::allows('财务报表-查询')){ return redirect(url('/'));  }
-        $waybillFinancialSnapshots=WaybillFinancialSnapshot::orderBy('id', 'DESC')->where('json_content','like','%直发车%');
-        $waybillFinancialSnapshots=$this->conditionQuery($request,$waybillFinancialSnapshots);
-        return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>'ZF']);
-    }
-
-    public function indexZX(Request $request)
-    {
-        if(!Gate::allows('财务报表-查询')){ return redirect(url('/'));  }
-        $waybillFinancialSnapshots=WaybillFinancialSnapshot::orderBy('id', 'DESC')->where('json_content','like','%专线%');
-        $waybillFinancialSnapshots=$this->conditionQuery($request,$waybillFinancialSnapshots);
-        return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>'ZX']);
+        return view('waybill.waybillFinancialSnapshot.index',['waybillFinancialSnapshots'=>$waybillFinancialSnapshots,'filterData'=>$request->input(),'type'=>$type]);
     }
-
     public function export($id,Request $request){
         if(!Gate::allows('财务报表-查询')){ return '没有权限';  }
         if ($id==-1){

+ 1 - 1
database/migrations/2020_07_06_160500_create_operator_logs_table.php → database/migrations/2020_07_06_160500_create_operator_logs_table_and_add_authority_and_change_processes_column_status.php

@@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration;
 use Illuminate\Database\Schema\Blueprint;
 use Illuminate\Support\Facades\Schema;
 
-class CreateOperatorLogsTable extends Migration
+class CreateOperatorLogsTableAndAddAuthorityAndChangeProcessesColumnStatus extends Migration
 {
     protected $authNames=[
         '教程',

+ 8 - 10
resources/views/waybill/waybillFinancialSnapshot/index.blade.php

@@ -12,15 +12,13 @@
                     <ul class="nav nav-pills">
                         @can('财务报表-查询')
                             <li class="nav-item">
-                                <a class="nav-link" href="@if(!isset($excepted)) {{url('waybill/waybillFinancialSnapshot')}} @else {{url('waybill/waybillFinancialExcepted')}} @endif" :class="{active:isActive('',3)}">全部</a>
-                            </li> @endcan
-                        @can('财务报表-查询')
+                                <a class="nav-link @if($type=='') active @endif" href="@if(!isset($excepted)) {{url('waybill/waybillFinancialSnapshot')}} @else {{url('waybill/waybillFinancialExcepted')}} @endif">全部</a>
+                            </li>
                             <li class="nav-item">
-                                <a class="nav-link" href="@if(!isset($excepted)) {{url('waybill/waybillFinancialSnapshot/ZX')}} @else {{url('waybill/waybillFinancialExcepted/ZX')}} @endif" :class="{active:isActive('ZX',3)}">专线</a>
-                            </li> @endcan
-                        @can('财务报表-查询')
+                                <a class="nav-link @if($type=='ZX') active @endif" href="@if(!isset($excepted)) {{url('waybill/waybillFinancialSnapshot?type=ZX')}} @else {{url('waybill/waybillFinancialExcepted?type=ZX')}} @endif">专线</a>
+                            </li>
                             <li class="nav-item">
-                                <a class="nav-link" href="@if(!isset($excepted)) {{url('waybill/waybillFinancialSnapshot/ZF')}} @else {{url('waybill/waybillFinancialExcepted/ZF')}} @endif" :class="{active:isActive('ZF',3)}">直发车</a>
+                                <a class="nav-link @if($type=='ZF') active @endif" href="@if(!isset($excepted)) {{url('waybill/waybillFinancialSnapshot?type=ZF')}} @else {{url('waybill/waybillFinancialExcepted?type=ZF')}} @endif">直发车</a>
                             </li> @endcan
 
                     </ul>
@@ -29,9 +27,9 @@
     </div>
     <div class="card " style="width: 3500px">
     <form  method="get" action="@if(!isset($excepted))
-    @if($type=='ZF'){{url('waybill/waybillFinancialSnapshot/ZF')}}@elseif($type=='ZX'){{url('waybill/waybillFinancialSnapshot/ZX')}}@else{{url('waybill/waybillFinancialSnapshot')}}@endif
+    @if($type=='ZF'){{url('waybill/waybillFinancialSnapshot?type=ZF')}}@elseif($type=='ZX'){{url('waybill/waybillFinancialSnapshot?type=ZX')}}@else{{url('waybill/waybillFinancialSnapshot')}}@endif
     @else
-    @if($type=='ZF'){{url('waybill/waybillFinancialExcepted/ZF')}}@elseif($type=='ZX'){{url('waybill/waybillFinancialExcepted/ZX')}}@else{{url('waybill/waybillFinancialExcepted')}}@endif
+    @if($type=='ZF'){{url('waybill/waybillFinancialExcepted?type=ZF')}}@elseif($type=='ZX'){{url('waybill/waybillFinancialExcepted?type=ZX')}}@else{{url('waybill/waybillFinancialExcepted')}}@endif
     @endif ">
     <div class="card-header form-inline">
         <label style="margin-left: 1%"> 开始日期:</label><input style="max-width: 200px" type="date" name="created_at_start" class="form-control form-control-sm"  v-model="filterData.created_at_start">
@@ -180,7 +178,7 @@
             ],
             checkData:[],
             filterData:{
-                created_at_start:'',created_at_end:'',
+                created_at_start:'',created_at_end:'',type:'{{$type}}',
             },
         },
         watch:{