浏览代码

运输字段与异常判断调整

LD 5 年之前
父节点
当前提交
35bce1a504
共有 2 个文件被更改,包括 15 次插入8 次删除
  1. 2 2
      app/Exceptions/Handler.php
  2. 13 6
      resources/views/waybill/index.blade.php

+ 2 - 2
app/Exceptions/Handler.php

@@ -54,14 +54,14 @@ class Handler extends ExceptionHandler
      */
     public function render($request, Throwable $exception)
     {
-        if ($exception instanceof HttpException) {
+//        if ($exception instanceof HttpException) {
             $code = $exception->getStatusCode();
             switch ($code){
                 case 419:return response()->view('exception.login');
                 case 404:return response()->view('exception.404');
                 default: return response()->view('exception.default',compact('code'));
             }
-        }
+//        }
         return parent::render($request, $exception);
     }
 }

+ 13 - 6
resources/views/waybill/index.blade.php

@@ -169,7 +169,9 @@
                     <th class="td-transit">承运商计重</th>
                     <th class="td-transit">计数</th>
                     <th class="td-transit">里程</th>
+                    @can('运输管理-运费')
                     <th class="td-fee">运费</th>
+                    @endcan
                     <th class="td-fee">提货费</th>
                     <th class="td-fee">其他费用</th>
                     <th class="td-fee">调度备注</th>
@@ -239,7 +241,7 @@
                         <div align="center" @mouseleave="removeCommonImg('common_img_'+waybill.id)" @mouseenter="commonImg('img_'+waybill.id,waybill.url,waybill.suffix)">
                             <img v-if="waybill.url" :id="'img_'+waybill.id"  :data-src="waybill.url+'-thumbnail.'+waybill.suffix" src="{{url('icon/img404-thumbnail.jpg')}}">
                             @can('运输管理-图片上传')<div v-if="!waybill.url">
-                                <input class="btn  btn-sm btn-outline-secondary" type="button" @click="certiimg(waybill.waybill_number)" value="上传图片"/>
+                                <input class="btn  btn-sm btn-outline-secondary" type="button" @click="certiimg(waybill.waybill_number)" value="上传照片 "/>
                                 <input type="file" @change="submitFile($event,waybill.waybill_number)" :id="waybill.waybill_number"
                                        style="display: none" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg"/>
                             </div>@endcan
@@ -253,11 +255,11 @@
                     <td class="td-transit"><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 class="td-transit"><span v-if="waybill.warehouse_weight">@{{waybill.warehouse_weight}}  @{{waybill.warehouse_weight_unit}}</span></td>
-                    <td class="td-transit"><span v-if="waybill.carrier_weight">@{{waybill.carrier_weight}}  @{{waybill.carrier_weight_unit}}</span></td>
-                    <td class="td-transit"><span v-if="waybill.warehouse_weight_other">@{{waybill.warehouse_weight_other}}  @{{waybill.warehouse_weight_unit_other}}</span></td>
-                    <td class="td-transit"><span v-if="waybill.carrier_weight_other">@{{waybill.carrier_weight_other}}  @{{waybill.carrier_weight_unit_other}}</span></td>
-                    <td class="td-transit">@{{waybill.amount}} </td>
+                    <td class="td-transit"><span v-if="waybill.warehouse_weight">@{{waybill.warehouse_weight|filterZero}}  @{{waybill.warehouse_weight_unit}}</span></td>
+                    <td class="td-transit"><span v-if="waybill.carrier_weight">@{{waybill.carrier_weight|filterZero}}  @{{waybill.carrier_weight_unit}}</span></td>
+                    <td class="td-transit"><span v-if="waybill.warehouse_weight_other">@{{waybill.warehouse_weight_other|filterZero}}  @{{waybill.warehouse_weight_unit_other}}</span></td>
+                    <td class="td-transit"><span v-if="waybill.carrier_weight_other">@{{waybill.carrier_weight_other|filterZero}}  @{{waybill.carrier_weight_unit_other}}</span></td>
+                    <td class="td-transit">@{{waybill.amount}}</td>
                     <td class="td-transit">@{{waybill.mileage|km}} </td>
                     @can('运输管理-可见费用项')
                         {{--zengjun start--}}
@@ -942,6 +944,11 @@
                     if(!value)return '';
                     return value + ' km';
                 },
+                filterZero:function(value){
+                    value=value.replace(/\.00$/,'');
+                    value=value.replace(/(\.[1-9])0$/,'$1');
+                    return value;
+                },
             }
         });
     </script>