فهرست منبع

JS错误修复,运输增加必填项

Zhouzhendong 4 سال پیش
والد
کامیت
5954ff57c5
3فایلهای تغییر یافته به همراه5 افزوده شده و 7 حذف شده
  1. 4 5
      app/Http/Controllers/WaybillController.php
  2. 0 1
      resources/js/app.js
  3. 1 1
      resources/views/transport/waybill/edit.blade.php

+ 4 - 5
app/Http/Controllers/WaybillController.php

@@ -677,7 +677,7 @@ class WaybillController extends Controller
         $waybills->each(function ($waybill)use(&$list){
             $list[] = [
                 $waybill->type,
-                $waybill->order->owner->name ?? ($waybill->owner->name ?? ""),
+                $waybill->owner->name ?? ($waybill->order->owner->name ?? ""),
                 $waybill->source_bill,
                 $waybill->wms_bill_number,
                 $waybill->waybill_number,
@@ -685,7 +685,7 @@ class WaybillController extends Controller
                 $waybill->other_charge,
                 $waybill->other_charge_remark,
                 $waybill->origination,
-                $waybill->order->address ?? $waybill->destination,
+                $waybill->destination ?: ($waybill->order->address ?? ''),
                 $waybill->ordering_remark,
                 $waybill->logistic->name ?? "",
                 $waybill->carrier_bill,
@@ -808,7 +808,7 @@ class WaybillController extends Controller
     protected function validatorWaybillDispatch(Request $request,$id){
         $rule=[
             'logistic_id'=>'required_without:order_id|integer',
-            'carrier_bill'=>"sometimes|nullable|max:50|unique:waybills,carrier_bill,$id",
+            'carrier_bill'=>"sometimes|required|max:50|unique:waybills,carrier_bill,$id",
             'fee'=>'sometimes|nullable|min:0|numeric|max:999999',
             'other_fee'=>'sometimes|nullable|min:0|numeric|max:999999',
             'charge'=>'sometimes|nullable|min:0|numeric|max:999999',
@@ -832,7 +832,7 @@ class WaybillController extends Controller
             $rule['origination_city_id']='required|integer';
             $rule['destination_city_id']='required_without:order_id|integer';
         }
-        $validator=Validator::make($request->input(),$rule,[
+        return Validator::make($request->input(),$rule,[
             'required'=>':attribute 为必填项',
             'required_without'=>':attribute 为必填项',
             'alpha_num'=>':attribute 应为字母或数字',
@@ -863,7 +863,6 @@ class WaybillController extends Controller
             'carrier_weight_unit_id_other'=>'承运商计数单位二',
             'deliver_at_date'=>'发货日期',
         ]);
-        return $validator;
     }
     public function addCounty(){
         $name = app("RegionService")->formatName(request("name"),2);

+ 0 - 1
resources/js/app.js

@@ -8,6 +8,5 @@ window.tempTip=require('./utilities/tempTip');
 window.getGetVal=require('./utilities/getGetVal');
 window.scanner=require('./utilities/scanner');
 window.datetimeRelating=require('./utilities/datetimeRelating');
-window.Vue.use(window.ElementUI);
 require('bootstrap-select');
 window.Vue.use(require('http-vue-loader'));

+ 1 - 1
resources/views/transport/waybill/edit.blade.php

@@ -48,7 +48,7 @@
                                         <option v-for="logistic in logistics" :value="logistic.id" v-if="logistic.tag.indexOf(waybill.type)!==-1">@{{logistic.name}}</option>
                                     </select>
                                 </div>
-                                <label for="carrier_bill" class="col-2 col-form-label text-right">承运商单号</label>
+                                <label for="carrier_bill" class="col-2 col-form-label text-right text-primary">承运商单号 *</label>
                                 <div class="col-4">
                                     <input type="text" class="form-control @error('carrier_bill') is-invalid @enderror"
                                            name="carrier_bill" autocomplete="off" v-model="waybill.carrier_bill"  id="carrier_bill">