فهرست منبع

订单管理-快递获取标记增加条件(错误),即W
基础设置-快递公司维护时,编辑,如果改到库中已有同名没有校验,会报错
运输管理-运输,dispatch_remark字段出现过回车换行,前端回字符串报错,需要录入时转换
直发车增加重量(仓库计重)字段的输入

Zhouzhendong 5 سال پیش
والد
کامیت
9050b70e81

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

@@ -58,11 +58,11 @@ class LogisticController extends Controller
             'code' => ['nullable', 'string', 'max:50', 'unique:logistics,code'],
         ]);
     }
-    protected function validatorUpdate(array $data)
+    protected function validatorUpdate(array $data,$id)
     {
         return Validator::make($data, [
-            'name' => ['required', 'string', 'max:50'],
-            'code' => ['nullable', 'string', 'max:50'],
+            'name' => ['required', 'string', 'max:50',"unique:logistics,name,$id"],
+            'code' => ['nullable', 'string', 'max:50',"unique:logistics,code,$id"],
         ]);
     }
     /**
@@ -98,7 +98,7 @@ class LogisticController extends Controller
     public function update(Request $request, Logistic $logistic)
     {
         if(!Gate::allows('物流公司-编辑')){ return redirect(url('/'));  }
-        $this->validatorUpdate($request->all())->validate();
+        $this->validatorUpdate($request->all(),$logistic->id)->validate();
         $logistic->fill($request->all());
         $logistic->update();
         $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);

+ 6 - 1
app/Http/Controllers/WaybillsController.php

@@ -207,8 +207,11 @@ class WaybillsController extends Controller
             unset($waybill['carrier_weight_unit_id_other']);
         }
         $this->validatorWaybillDispatch($request,$id)->validate();
-
         $data=$request->input();
+        //替换换行符
+        if ($data['dispatch_remark']){
+            $data['dispatch_remark']=str_replace(PHP_EOL,' ',$data['dispatch_remark']);
+        }
         if (!isset($data['destination']))$data['destination']=$waybill->destination;
         if (isset($data['destination_city_id']) && $waybill->destination_city_id != $data['destination_city_id']){
             $city=City::find($data['destination_city_id']);
@@ -879,6 +882,8 @@ class WaybillsController extends Controller
                 'mileage'=>'nullable|numeric|min:0',
                 'amount'=>'nullable|numeric|min:0',
                 'amount_unit_id'=>'required',
+                'warehouse_weight_other'=>'nullable|min:0|numeric|max:999999',
+                'warehouse_weight_unit_id_other'=>'required_with:warehouse_weight_other|nullable|integer',
             ],[
                 'required'=>':attribute 为必填项',
                 'alpha_num'=>':attribute 应为字母或数字',

+ 0 - 1
resources/views/maintenance/tutorial/show.blade.php

@@ -23,7 +23,6 @@
                 content:{!! $tutorial !!},
             },
             mounted(){
-                console.log(this.content.trix_rich_text.content);
             }
         });
     </script>

+ 2 - 1
resources/views/order/index/delivering.blade.php

@@ -61,6 +61,7 @@
                                     <option value="">快递获取标记</option>
                                     <option value="Y">是</option>
                                     <option value="N">否</option>
+                                    <option value="W">错误</option>
                                 </select>
                             </td>
                         </tr>
@@ -189,7 +190,7 @@
                         <td class="text-muted">@{{ order.c_address1 }}</td>
                         <td class="text-nowrap">@{{ order.waveno }}</td>
                         <td class="text-nowrap"> @{{ order.warehouseid }}</td>
-                        <td class="text-nowrap"><span v-if="order.edisendflag2=='Y'">是</span><span v-else>否</span></td>
+                        <td class="text-nowrap"><span v-if="order.edisendflag2=='Y'">是</span><span v-if="order.edisendflag2=='N'">否</span><span v-if="order.edisendflag2=='W'">错误</span></td>
                         <td class="text-nowrap">@{{ order.edisendtime2 }}</td>
                         <td colspan="5" class="text-center">
                             <table v-if="commodities[order.orderno]&&commodities[order.orderno].length==1 || isBtn[order.orderno]" class="table text-nowrap table-sm">

+ 8 - 7
resources/views/waybill/edit.blade.php

@@ -147,9 +147,10 @@
                                 <button type="button" class="btn btn-outline-info btn-sm" @click="addCounty" style="transform: scale(0.9)">添加市/县</button>
                             </div>
                         </div>
+                    </div>
                         <div class="form-group row">
-                            <label for="warehouse_weight" class="col-2 col-form-label text-right ">仓库计抛</label>
-                            <div class="col-2">
+                            <label for="warehouse_weight" class="col-2 col-form-label text-right " v-if="type=='专线'">仓库计抛</label>
+                            <div class="col-2" v-if="type=='专线'">
                                 <input type="text"  class="form-control @error('warehouse_weight') is-invalid @enderror"
                                        name="warehouse_weight" autocomplete="off" value="@if(old('warehouse_weight')){{ old('warehouse_weight') }}@else{{$waybill->warehouse_weight}}@endif"  >
                                 @error('warehouse_weight')
@@ -158,15 +159,14 @@
                                     </span>
                                 @enderror
                             </div>
-                            <label for="warehouse_weight_unit_id" class=" col-form-label text-right ">单位:</label>
-                            <div class="col-1.5">
+                            <label for="warehouse_weight_unit_id" class=" col-form-label text-right " v-if="type=='专线'">单位:</label>
+                            <div class="col-1.5" v-if="type=='专线'">
                                 <select class="form-control @error('warehouse_weight_unit_id') is-invalid @enderror" name="warehouse_weight_unit_id" v-model="waybillPriceModel.warehouse_weight_unit_id">
                                     <option :value="unit.id" v-for="unit in units" >@{{ unit.name }}</option>
                                 </select>
                             </div>
-
-                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-                            <label for="warehouse_weight_other" class="col-form-label text-right ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;仓库重</label>
+                            <span v-if="type=='专线'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+                            <label for="warehouse_weight_other" class="col-form-label text-right " :class="type=='专线' ? '' : 'col-2'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;仓库重</label>
                             <div class="col-2">
                                 <input type="text" class="form-control @error('warehouse_weight_other') is-invalid @enderror"
                                        name="warehouse_weight_other" autocomplete="off" value="@if(old('warehouse_weight_other')){{ old('warehouse_weight_other') }}@else{{$waybill->warehouse_weight_other}}@endif"  >
@@ -183,6 +183,7 @@
                                 </select>
                             </div>
                         </div>
+                    <div v-if="type=='专线'">
                         <div class="form-group row">
                             <label for="carrier_weight" class="col-2 col-form-label text-right ">承运商计抛</label>
                             <div class="col-2">

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

@@ -299,7 +299,7 @@
                         <td class="td-helpful">@{{waybill.pick_up_fee}}</td>
                         <td class="td-helpful">@{{waybill.other_fee}}</td>
                     @endcan
-                    <td class="td-helpful">@{{waybill.dispatch_remark}}</td>
+                    <td class="td-helpful"><span v-html="waybill.dispatch_remark"></span>
                     @can('运输管理-删除')
                         <td class="td-operation">
                             <button type="button" class="btn btn-outline-danger btn-sm" @click="waybillDestroy(waybill.id,waybill.waybill_number)">删</button>
@@ -476,7 +476,7 @@
                         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,
+                        collect_fee:'{{$waybill->collect_fee}}', @endcan dispatch_remark:'{{ $waybill->dispatch_remark }}',isBtn:false,
                         waybillAuditLogs:{!! $waybill->waybillAuditLogs !!},
                         @if($waybill->remark)remark:'{{$waybill->remark}}', @else remark:'', @endif
                     },