Browse Source

按日输入装箱提货费调整

hu hao 4 years ago
parent
commit
fe2936c852

+ 3 - 3
app/Services/WaybillService.php

@@ -167,15 +167,15 @@ class WaybillService
             ->get();
             ->get();
         foreach ($waybills as $waybill){
         foreach ($waybills as $waybill){
             if (!$waybill['carrier_weight_other'] && !$waybill['carrier_weight']) return null;
             if (!$waybill['carrier_weight_other'] && !$waybill['carrier_weight']) return null;
-            if (!$waybill['carrier_weight_other']) $waybill['carrier_weight_other']=floor($waybill['carrier_weight']/0.4);
+            if (!$waybill['carrier_weight_other']) $waybill['carrier_weight_other']=($waybill['carrier_weight']/0.4);
         }
         }
         $daily_total_weight=$waybills->sum('carrier_weight_other');
         $daily_total_weight=$waybills->sum('carrier_weight_other');
         $updateParams = [['id','pick_up_fee','updated_at']];
         $updateParams = [['id','pick_up_fee','updated_at']];
         foreach ($waybills as $waybill){
         foreach ($waybills as $waybill){
-            $waybill['pick_up_fee']=floor(($waybill->carrier_weight_other/$daily_total_weight)*$param['billing']);
+            $waybill['pick_up_fee']=round(($waybill->carrier_weight_other/$daily_total_weight)*$param['billing']);
             $updateParams[] = [
             $updateParams[] = [
                 'id' => $waybill->id,
                 'id' => $waybill->id,
-                'pick_up_fee' => floor(($waybill->carrier_weight_other/$daily_total_weight)*$param['billing']),
+                'pick_up_fee' => (($waybill->carrier_weight_other/$daily_total_weight)*$param['billing']),
                 'updated_at' => Carbon::now()->toDateTimeString(),
                 'updated_at' => Carbon::now()->toDateTimeString(),
             ];
             ];
         }
         }

+ 2 - 2
resources/views/transport/waybill/index.blade.php

@@ -335,7 +335,8 @@
                         amount:'{{$waybill->amount}}',
                         amount:'{{$waybill->amount}}',
                         @if($waybill->carType)carType:{!! $waybill->carType !!},car_owner_info:'{{$waybill->car_owner_info}}',@endif
                         @if($waybill->carType)carType:{!! $waybill->carType !!},car_owner_info:'{{$waybill->car_owner_info}}',@endif
                             @can('运输管理-运单-可见费用项') fee:'{{$waybill->fee}}',
                             @can('运输管理-运单-可见费用项') fee:'{{$waybill->fee}}',
-                        pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
+                        pick_up_fee:'{{$waybill->pick_up_fee? round($waybill->pick_up_fee) :''}}',
+                        other_fee:'{{$waybill->other_fee}}',
                         collect_fee:'{{$waybill->collect_fee}}', @endcan
                         collect_fee:'{{$waybill->collect_fee}}', @endcan
                         deliver_at:'{{$waybill->deliver_at}}',
                         deliver_at:'{{$waybill->deliver_at}}',
                         dispatch_remark:'{{$waybill->dispatch_remark}}',
                         dispatch_remark:'{{$waybill->dispatch_remark}}',
@@ -430,7 +431,6 @@
                     param:param,
                     param:param,
                 });
                 });
                 this.form.init();
                 this.form.init();
-                console.log(this.form)
                 this.rendingHeader();
                 this.rendingHeader();
                 this.paginate = $("#paginate").val();
                 this.paginate = $("#paginate").val();
                 let waybill =  $('.table-header-layer-1')[1];
                 let waybill =  $('.table-header-layer-1')[1];