Преглед изворни кода

货主筛选功能修改 (修改线上ownerService调用getSelection方法)

haozi пре 5 година
родитељ
комит
e40714fef8

+ 2 - 2
app/Http/Controllers/CommodityController.php

@@ -41,7 +41,7 @@ class CommodityController extends Controller
     {
         if(!Gate::allows('商品信息-录入')){ return redirect(url('denied'));  }
         $ownerService=app(OwnerService::class);
-        $owners = $ownerService->getSelection();
+        $owners = $ownerService->getIntersectPermitting();
         return view('maintenance.commodity.create',compact('owners'));
     }
 
@@ -101,7 +101,7 @@ class CommodityController extends Controller
     {
         if(!Gate::allows('商品信息-编辑')){ return redirect(url('denied'));  }
         $ownerService=app(OwnerService::class);
-        $owners = $ownerService->getSelection();
+        $owners = $ownerService->getIntersectPermitting();
         return view('maintenance.commodity.edit',['commodity'=>$commodity,'owners'=>$owners]);
     }
 

+ 4 - 4
app/Http/Controllers/CustomerController.php

@@ -34,7 +34,7 @@ class CustomerController extends Controller
         }];
         $ownerGroups = app('UserOwnerGroupService')->getSelection();
         $customers = app('CustomerService')->getSelection();
-        $owners = app('OwnerService')->getSelection();
+        $owners = app('OwnerService')->getIntersectPermitting();
         $reports = app("OwnerReportService")->paginate($request->input(),$withs);
         $params = $request->input();
         return response()->view('customer.project.report',compact("reports","ownerGroups","customers","owners","params"));
@@ -238,7 +238,7 @@ class CustomerController extends Controller
         $areas = app('OwnerAreaReportService')->paginate($request->input(),["owner"=>function($query){$query->with(["customer","ownerStoragePriceModels"]);}]);
         $ownerGroups = app('UserOwnerGroupService')->getSelection();
         $customers = app('CustomerService')->getSelection();
-        $owners = app('OwnerService')->getSelection();
+        $owners = app('OwnerService')->getIntersectPermitting();
         $params = $request->input();
         return response()->view('customer.project.area',compact("areas","ownerGroups","customers","owners","params"));
     }
@@ -306,7 +306,7 @@ class CustomerController extends Controller
         $params = $request->input();
         $shops = app('ShopService')->getSelection();
         $customers = app('CustomerService')->getSelection();
-        $owners = app('OwnerService')->getSelection();
+        $owners = app('OwnerService')->getIntersectPermitting();
         $details = app('OwnerFeeDetailService')->paginate($params,["owner"=>function($query){$query->with("customer");},"shop","processMethod","logistic"]);
         return response()->view('customer.finance.instantBill',compact("details","params","shops","customers","owners"));
     }
@@ -342,7 +342,7 @@ class CustomerController extends Controller
         $params = $request->input();
         $ownerGroups = app('UserOwnerGroupService')->getSelection();
         $customers = app('CustomerService')->getSelection();
-        $owners = app('OwnerService')->getSelection();
+        $owners = app('OwnerService')->getIntersectPermitting();
         $bills = app('OwnerBillReportService')->paginate($params,["owner"=>function($query){
             /** @var Builder $query */
             $query->with(["customer","userOwnerGroup"]);

+ 1 - 1
app/Http/Controllers/OrderController.php

@@ -24,7 +24,7 @@ class OrderController extends Controller
         /** @var OrderService $orderService */
         $orderService = app('OrderService');
         $request = $request->input();
-        $owners = app('OwnerService')->getSelection(['id','code']);
+        $owners = app('OwnerService')->getIntersectPermitting(['id','code']);
         $codes = array_column($owners->toArray(),'code');
         if ($request['customerid'] ?? false){
             $arr = explode(',',$request['customerid']);

+ 1 - 1
app/Http/Controllers/OwnerController.php

@@ -92,7 +92,7 @@ class OwnerController extends Controller
 
     public function getOwners()
     {
-        $owners = app('OwnerService')->getSelection(['id', 'code', 'name']);
+        $owners = app('OwnerService')->getIntersectPermitting(['id', 'code', 'name']);
         return $owners;
     }
 

+ 2 - 2
app/Http/Controllers/PackageController.php

@@ -143,7 +143,7 @@ class PackageController extends Controller
 
     public function statistics(Request $request){
         $packages = app('PackageStatisticsService')->get($request->input());
-        $owners=app('OwnerService')->getSelection();
+        $owners=app('OwnerService')->getIntersectPermitting();
         $logistics=app('LogisticService')->getSelection();
         $ownerTemp = [];
         foreach ($owners as $owner){
@@ -237,7 +237,7 @@ class PackageController extends Controller
             $data = $service->get(['owner_id'=>$request->data]);
         }
 
-        $owners=app('OwnerService')->getSelection();
+        $owners=app('OwnerService')->getIntersectPermitting();
         $ownerTemp = [];
         foreach ($owners as $owner){
             $ownerTemp[$owner->id] = $owner->name;

+ 9 - 9
app/Http/Controllers/PriceModelController.php

@@ -109,7 +109,7 @@ class PriceModelController extends Controller
         $features = app("FeatureService")->getMapArray();
         OwnerPriceOperation::$features = $features;
         $models = app('OwnerPriceOperationService')->paginate($request->input(),["ownerPriceOperationOwners","ownerInStorageRule"=>function($query){$query->with("unit");}])->append("featureFormat");
-        $owners = app("OwnerService")->getSelection();
+        $owners = app("OwnerService")->getIntersectPermitting();
         return response()->view('maintenance.priceModel.operation.index',compact("models","owners"));
     }
 
@@ -223,7 +223,7 @@ class PriceModelController extends Controller
 
     public function operationCreate(){
         if(!Gate::allows('计费模型-作业-录入')){ return redirect('denied');  }
-        $owners = app("OwnerService")->getSelection();
+        $owners = app("OwnerService")->getIntersectPermitting();
         $units = app('UnitService')->getSelection();
         return response()->view('maintenance.priceModel.operation.create',compact("owners","units"));
     }
@@ -279,7 +279,7 @@ class PriceModelController extends Controller
     {
         if(!Gate::allows('计费模型-作业-编辑')){ return redirect('denied');  }
         $model = app('OwnerPriceOperationService')->find($id,true,["ownerPriceOperationOwners"]);
-        $owners = app("OwnerService")->getSelection();
+        $owners = app("OwnerService")->getIntersectPermitting();
         $units = app('UnitService')->getSelection();
         return response()->view('maintenance.priceModel.operation.create',compact("owners","units","model"));
     }
@@ -441,7 +441,7 @@ class PriceModelController extends Controller
     public function expressCreate(){
         if(!Gate::allows('计费模型-快递-录入')){ return redirect('denied');  }
         $logistics = app("LogisticService")->getSelection();
-        $owners = app("OwnerService")->getSelection();
+        $owners = app("OwnerService")->getIntersectPermitting();
         return response()->view('maintenance.priceModel.express.create',compact("logistics","owners"));
     }
 
@@ -468,7 +468,7 @@ class PriceModelController extends Controller
         if(!Gate::allows('计费模型-快递-编辑')){ return redirect('denied');  }
         /** @var OwnerPriceExpress $model */
         $model = app('OwnerPriceExpressService')->find($id)->append(["owner_id","logistic_id"]);
-        $owners = app("OwnerService")->getSelection();
+        $owners = app("OwnerService")->getIntersectPermitting();
         $logistics = app('LogisticService')->getSelection();
         return response()->view('maintenance.priceModel.express.create',compact("owners","logistics","model"));
     }
@@ -535,7 +535,7 @@ class PriceModelController extends Controller
     public function logisticCreate()
     {
         if(!Gate::allows('计费模型-物流-录入')){ return redirect('denied');  }
-        $owners = app("OwnerService")->getSelection();
+        $owners = app("OwnerService")->getIntersectPermitting();
         $logistics = app('LogisticService')->getSelection();
         $units = app('UnitService')->getSelection();
         return response()->view('maintenance.priceModel.logistic.create',compact("owners","logistics","units"));
@@ -567,7 +567,7 @@ class PriceModelController extends Controller
     public function logisticEdit($id)
     {
         if(!Gate::allows('计费模型-物流-编辑')){ return redirect('denied');  }
-        $owners = app("OwnerService")->getSelection();
+        $owners = app("OwnerService")->getIntersectPermitting();
         $logistics = app('LogisticService')->getSelection();
         $units = app('UnitService')->getSelection();
         $model = app("OwnerPriceLogisticService")->find($id)->append(["owner_id","logistic_id"]);
@@ -796,7 +796,7 @@ class PriceModelController extends Controller
 
     public function directLogisticCreate(){
         if(!Gate::allows('计费模型-直发-录入')){ return redirect('denied');  }
-        $owners = app("OwnerService")->getSelection();
+        $owners = app("OwnerService")->getIntersectPermitting();
         return response()->view('maintenance.priceModel.directLogistic.create',compact("owners"));
     }
 
@@ -829,7 +829,7 @@ class PriceModelController extends Controller
     public function directLogisticEdit($id)
     {
         if(!Gate::allows('计费模型-直发-编辑')){ return redirect('denied');  }
-        $owners = app("OwnerService")->getSelection();
+        $owners = app("OwnerService")->getIntersectPermitting();
         $model = app("OwnerPriceDirectLogisticService")->find($id)->append("owner_id");
         return response()->view('maintenance.priceModel.directLogistic.create',compact("model","owners"));
     }

+ 1 - 1
app/Http/Controllers/ProcessStatisticController.php

@@ -15,7 +15,7 @@ class ProcessStatisticController extends Controller
         if(!Gate::allows('二次加工管理-查询')){ return redirect('denied');  }
         /** @var ProcessStatisticService $processStatistics */
         $processStatistics=app("ProcessStatisticService")->paginate($request->input());
-        $owners=app("OwnerService")->getSelection();
+        $owners=app("OwnerService")->getIntersectPermitting();
         $processMethods=app("ProcessMethodService")->getSelection();
         return view('process.statistic',['processStatistics'=>$processStatistics,'params'=>$request->input(),'owners'=>$owners,'processMethods'=>$processMethods]);
     }

+ 1 - 1
app/Http/Controllers/StoreCheckingReceiveController.php

@@ -24,7 +24,7 @@ class StoreCheckingReceiveController extends Controller
 
         $params = $request->input();
         $storeCheckingReceives = $service->paginate($params);
-        $owners = app('OwnerService')->getSelection();
+        $owners = app('OwnerService')->getIntersectPermitting();
         return view('store.checkingReceive.mission',compact('storeCheckingReceives','params','owners'));
     }
 

+ 2 - 8
app/Http/Controllers/TestController.php

@@ -111,14 +111,8 @@ class TestController extends Controller
         }
     }
     public function zui(){
-
-        $d = ["ada","超管","hospital_1","测试","hospital_5"];
-        $a = [];
-        foreach ($d as $item){
-            $arr = explode("_",$item);
-            if (count($arr) === 2 && $arr[0] == 'hospital' && is_numeric($arr[1]))$a[] = $arr[1];
-        }
-        dd($a);
+        $a = new \Illuminate\Support\Collection(["a"=>"b"]);
+        foreach ($a as $i=>$l)dump($i,$l);
     }
     public function zzd()
     {

+ 2 - 1
app/Imports/OwnerPriceDirectLogisticDetailImport.php

@@ -35,6 +35,7 @@ class OwnerPriceDirectLogisticDetailImport implements ToCollection,WithHeadingRo
         }
         $row = $collection->first();
         $additional = "续费";
+
         foreach ($row as $key => $str){
             if (mb_strpos($key,$additional) !== false){
                 $row["续费"] = $str;
@@ -42,6 +43,7 @@ class OwnerPriceDirectLogisticDetailImport implements ToCollection,WithHeadingRo
                 break;
             }
         }
+
         $header = [
             "车型","起步费","续费"
         ];
@@ -51,7 +53,6 @@ class OwnerPriceDirectLogisticDetailImport implements ToCollection,WithHeadingRo
                 return false;
             }
         }
-        if ($row)
 
         //车型map
         $map = [];

+ 1 - 2
app/Imports/OwnerPriceLogisticDetailImport.php

@@ -19,7 +19,7 @@ HeadingRowFormatter::default('none');
 class OwnerPriceLogisticDetailImport implements ToCollection,WithHeadingRow
 {
     protected $logistic;
-    public function __construct(OwnerPriceLogistic $logistic = null)
+    public function __construct(OwnerPriceLogistic $logistic)
     {
         $this->logistic = $logistic;
     }
@@ -30,7 +30,6 @@ class OwnerPriceLogisticDetailImport implements ToCollection,WithHeadingRow
     */
     public function collection(Collection $collection)
     {
-
         if (!$this->logistic){
             Cache::put("logistic",["success"=>false, "data"=>"不存在父级"],86400);
             return false;

+ 1 - 1
package-lock.json

@@ -6259,7 +6259,7 @@
         },
         "minimist": {
             "version": "1.2.0",
-            "resolved": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.0.tgz",
+            "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
             "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
             "dev": true
         },

+ 2 - 2
resources/views/maintenance/priceModel/logistic/index.blade.php

@@ -191,7 +191,7 @@
                     }
                     let formData = new FormData();
                     formData.append("file",file);
-                    formData.append("id",this.id);
+                    formData.append("id",this.models[this.index]["id"]);
                     window.tempTip.setIndex(1099);
                     window.tempTip.setDuration(9999);
                     window.tempTip.waitingTip("执行中,请耐心等候......");
@@ -304,4 +304,4 @@
             },
         });
     </script>
-@stop
+@stop