|
@@ -86,7 +86,7 @@
|
|
|
<div class="form-group row">
|
|
<div class="form-group row">
|
|
|
<label for="carrier_id" class="col-2 col-form-label text-right text-primary">承运商 *</label>
|
|
<label for="carrier_id" class="col-2 col-form-label text-right text-primary">承运商 *</label>
|
|
|
<div class="col-8">
|
|
<div class="col-8">
|
|
|
- <select name="carrier_id" class="form-control @error('carrier_id') is-invalid @enderror" id="carrier_id" v-model="waybillPriceModel.carrier_id" style="width: 30%; ">
|
|
|
|
|
|
|
+ <select name="carrier_id" class="form-control @error('carrier_id') is-invalid @enderror" :class="errors['carrier_id'] ? 'is-invalid' :''" id="carrier_id" v-model="waybillPriceModel.carrier_id" style="width: 30%; ">
|
|
|
@foreach($carriers as $carrier)
|
|
@foreach($carriers as $carrier)
|
|
|
<option value="{{$carrier->id}}">{{$carrier->name}}</option>
|
|
<option value="{{$carrier->id}}">{{$carrier->name}}</option>
|
|
|
@endforeach
|
|
@endforeach
|
|
@@ -112,7 +112,7 @@
|
|
|
<div class="form-group row">
|
|
<div class="form-group row">
|
|
|
<label for="origination_city_id" class="col-2 col-form-label text-right text-primary">始发市 *</label>
|
|
<label for="origination_city_id" class="col-2 col-form-label text-right text-primary">始发市 *</label>
|
|
|
<div class="col-8 form-inline">
|
|
<div class="col-8 form-inline">
|
|
|
- <select class="form-control" name="origination_city_id" style="width: 30%; " v-model="waybillPriceModel.origination_city_id">
|
|
|
|
|
|
|
+ <select class="form-control @error('origination_city_id') is-invalid @enderror" name="origination_city_id" :class="errors['origination_city_id'] ? 'is-invalid' :''" style="width: 30%; " v-model="waybillPriceModel.origination_city_id">
|
|
|
<option v-for="city in cities" :value="city.id">@{{city.name}}</option>
|
|
<option v-for="city in cities" :value="city.id">@{{city.name}}</option>
|
|
|
</select>
|
|
</select>
|
|
|
<input class="form-control-sm" placeholder="输入关键字定位" @input="origination_city_name">
|
|
<input class="form-control-sm" placeholder="输入关键字定位" @input="origination_city_name">
|
|
@@ -121,15 +121,10 @@
|
|
|
<div class="form-group row">
|
|
<div class="form-group row">
|
|
|
<label for="destination_city_id" class="col-2 col-form-label text-right text-primary">目的市 *</label>
|
|
<label for="destination_city_id" class="col-2 col-form-label text-right text-primary">目的市 *</label>
|
|
|
<div class="col-8 form-inline">
|
|
<div class="col-8 form-inline">
|
|
|
- <select class="form-control" name="destination_city_id" id="destination_city_id" v-model="waybillPriceModel.destination_city_id" style="width: 30%; " >
|
|
|
|
|
|
|
+ <select class="form-control @error('destination_city_id') is-invalid @enderror" name="destination_city_id" :class="errors['destination_city_id'] ? 'is-invalid' :''" id="destination_city_id" v-model="waybillPriceModel.destination_city_id" style="width: 30%; " >
|
|
|
<option v-for="city in cities" :value="city.id">@{{city.name}}</option>
|
|
<option v-for="city in cities" :value="city.id">@{{city.name}}</option>
|
|
|
</select>
|
|
</select>
|
|
|
<input class="form-control-sm" placeholder="输入关键字定位" @input="destination_city_id">
|
|
<input class="form-control-sm" placeholder="输入关键字定位" @input="destination_city_id">
|
|
|
- @error('destination_city_id')
|
|
|
|
|
- <span class="invalid-feedback" role="alert">
|
|
|
|
|
- <strong>{{ $message }}</strong>
|
|
|
|
|
- </span>
|
|
|
|
|
- @enderror
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-group row">
|
|
<div class="form-group row">
|
|
@@ -155,7 +150,7 @@
|
|
|
|
|
|
|
|
<label for="warehouse_weight_other" class="col-form-label text-right "> 仓库计数二</label>
|
|
<label for="warehouse_weight_other" class="col-form-label text-right "> 仓库计数二</label>
|
|
|
<div class="col-2">
|
|
<div class="col-2">
|
|
|
- <input type="text" class="form-control @error('warehouse_weight_other') is-invalid @enderror"
|
|
|
|
|
|
|
+ <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" >
|
|
name="warehouse_weight_other" autocomplete="off" value="@if(old('warehouse_weight_other')){{ old('warehouse_weight_other') }}@else{{$waybill->warehouse_weight_other}}@endif" >
|
|
|
@error('warehouse_weight_other')
|
|
@error('warehouse_weight_other')
|
|
|
<span class="invalid-feedback" role="alert">
|
|
<span class="invalid-feedback" role="alert">
|
|
@@ -172,15 +167,10 @@
|
|
|
</select>
|
|
</select>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-{{-- <div class="form-group row">
|
|
|
|
|
- <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('warehouse_weight_unit_id') }}</p>
|
|
|
|
|
- <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('warehouse_weight_unit_id_other') }}</p>
|
|
|
|
|
- </div>--}}
|
|
|
|
|
- {{--计费模型阶段保留--}}
|
|
|
|
|
<div class="form-group row">
|
|
<div class="form-group row">
|
|
|
<label for="carrier_weight" class="col-2 col-form-label text-right ">承运商计数(抛)</label>
|
|
<label for="carrier_weight" class="col-2 col-form-label text-right ">承运商计数(抛)</label>
|
|
|
<div class="col-2">
|
|
<div class="col-2">
|
|
|
- <input type="text" id="carrier_weight" class="form-control @error('carrier_weight') is-invalid @enderror"
|
|
|
|
|
|
|
+ <input type="text" id="carrier_weight" :class="errors['carrier_weight'] ? 'is-invalid' :''" class="form-control @error('carrier_weight') is-invalid @enderror"
|
|
|
name="carrier_weight" autocomplete="off" value="@if(old('carrier_weight')){{ old('carrier_weight') }}@else{{$waybill->carrier_weight}}@endif" >
|
|
name="carrier_weight" autocomplete="off" value="@if(old('carrier_weight')){{ old('carrier_weight') }}@else{{$waybill->carrier_weight}}@endif" >
|
|
|
@error('carrier_weight')
|
|
@error('carrier_weight')
|
|
|
<span class="invalid-feedback" role="alert">
|
|
<span class="invalid-feedback" role="alert">
|
|
@@ -190,7 +180,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<label for="carrier_weight_unit_id" class=" col-form-label text-right ">单位:</label>
|
|
<label for="carrier_weight_unit_id" class=" col-form-label text-right ">单位:</label>
|
|
|
<div class="col-1.5">
|
|
<div class="col-1.5">
|
|
|
- <select id="carrier_weight_unit_id" class="form-control @error('carrier_weight_unit_id') is-invalid @enderror" name="carrier_weight_unit_id" v-model="waybillPriceModel.carrier_weight_unit_id">
|
|
|
|
|
|
|
+ <select id="carrier_weight_unit_id" :class="errors['carrier_weight_unit_id'] ? 'is-invalid' :''" class="form-control @error('carrier_weight_unit_id') is-invalid @enderror" name="carrier_weight_unit_id" v-model="waybillPriceModel.carrier_weight_unit_id">
|
|
|
@foreach($units as $unit)
|
|
@foreach($units as $unit)
|
|
|
<option value="{{$unit->id}}">{{$unit->name}}</option>
|
|
<option value="{{$unit->id}}">{{$unit->name}}</option>
|
|
|
@endforeach
|
|
@endforeach
|
|
@@ -200,7 +190,7 @@
|
|
|
|
|
|
|
|
<label for="carrier_weight_other" class="col-form-label text-right ">承运商计数二</label>
|
|
<label for="carrier_weight_other" class="col-form-label text-right ">承运商计数二</label>
|
|
|
<div class="col-2">
|
|
<div class="col-2">
|
|
|
- <input type="text" id="carrier_weight_other" class="form-control @error('carrier_weight_other') is-invalid @enderror"
|
|
|
|
|
|
|
+ <input type="text" id="carrier_weight_other" :class="errors['carrier_weight_other'] ? 'is-invalid' :''" class="form-control @error('carrier_weight_other') is-invalid @enderror"
|
|
|
name="carrier_weight_other" autocomplete="off" value="@if(old('carrier_weight_other')){{ old('carrier_weight_other') }}@else{{$waybill->carrier_weight_other}}@endif" >
|
|
name="carrier_weight_other" autocomplete="off" value="@if(old('carrier_weight_other')){{ old('carrier_weight_other') }}@else{{$waybill->carrier_weight_other}}@endif" >
|
|
|
@error('carrier_weight_other')
|
|
@error('carrier_weight_other')
|
|
|
<span class="invalid-feedback" role="alert">
|
|
<span class="invalid-feedback" role="alert">
|
|
@@ -210,7 +200,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<label for="carrier_weight_unit_id_other" class=" col-form-label text-right ">单位:</label>
|
|
<label for="carrier_weight_unit_id_other" class=" col-form-label text-right ">单位:</label>
|
|
|
<div class="col-1.5">
|
|
<div class="col-1.5">
|
|
|
- <select id="carrier_weight_unit_id_other" class="form-control @error('carrier_weight_unit_id_other') is-invalid @enderror" name="carrier_weight_unit_id_other" v-model="waybillPriceModel.carrier_weight_unit_id_other" >
|
|
|
|
|
|
|
+ <select id="carrier_weight_unit_id_other" :class="errors['carrier_weight_unit_id_other'] ? 'is-invalid' :''" class="form-control @error('carrier_weight_unit_id_other') is-invalid @enderror" name="carrier_weight_unit_id_other" v-model="waybillPriceModel.carrier_weight_unit_id_other" >
|
|
|
@foreach($units as $unit)
|
|
@foreach($units as $unit)
|
|
|
<option value="{{$unit->id}}">{{$unit->name}}</option>
|
|
<option value="{{$unit->id}}">{{$unit->name}}</option>
|
|
|
@endforeach
|
|
@endforeach
|
|
@@ -219,14 +209,6 @@
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
@endif
|
|
@endif
|
|
|
-{{-- <div class="form-group row">
|
|
|
|
|
- <div class="col-sm-5">
|
|
|
|
|
- <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('carrier_weight_unit_id') }}</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-sm-5">
|
|
|
|
|
- <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('carrier_weight_unit_id_other') }}</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>--}}
|
|
|
|
|
@if($waybill->type=="直发车")
|
|
@if($waybill->type=="直发车")
|
|
|
<div class="form-group row">
|
|
<div class="form-group row">
|
|
|
<label for="carType_id" class="col-2 col-form-label text-right text-primary">车型 *</label>
|
|
<label for="carType_id" class="col-2 col-form-label text-right text-primary">车型 *</label>
|
|
@@ -336,6 +318,7 @@
|
|
|
},
|
|
},
|
|
|
@endforeach
|
|
@endforeach
|
|
|
],
|
|
],
|
|
|
|
|
+ errors:[],
|
|
|
},
|
|
},
|
|
|
mounted:function(){
|
|
mounted:function(){
|
|
|
/*将地址转换为市区,赋给data*/
|
|
/*将地址转换为市区,赋给data*/
|
|
@@ -375,29 +358,26 @@
|
|
|
methods:{
|
|
methods:{
|
|
|
{{--计费模型阶段保留--}}
|
|
{{--计费模型阶段保留--}}
|
|
|
is_waybillPriceModel(carrier_id,carrier_weight,carrier_weight_unit_id,destination_city_id,carrier_weight_other,carrier_weight_unit_id_other){
|
|
is_waybillPriceModel(carrier_id,carrier_weight,carrier_weight_unit_id,destination_city_id,carrier_weight_other,carrier_weight_unit_id_other){
|
|
|
|
|
+ this.errors=[];
|
|
|
let url='{{url('waybill/is/waybillPriceModel')}}';
|
|
let url='{{url('waybill/is/waybillPriceModel')}}';
|
|
|
- let one=false;
|
|
|
|
|
- let two=false;
|
|
|
|
|
- if (carrier_id&&carrier_weight&&carrier_weight_unit_id&&destination_city_id){one=true;}
|
|
|
|
|
- if (carrier_id&&carrier_weight_other&&carrier_weight_unit_id_other&&destination_city_id){two=true;}
|
|
|
|
|
- if (one||two) {
|
|
|
|
|
- axios.post(url,{carrier_id:carrier_id,carrier_weight:[carrier_weight,carrier_weight_other],
|
|
|
|
|
- carrier_weight_unit_id:[carrier_weight_unit_id,carrier_weight_unit_id_other],destination_city_id:destination_city_id})
|
|
|
|
|
- .then(
|
|
|
|
|
- function (response) {
|
|
|
|
|
- if (!response.data.success) {
|
|
|
|
|
- document.getElementById('waybillPriceModel').value='';
|
|
|
|
|
- tempTip.confirm('该目的地与计量单位对应的计费模型不存在,如录入将会标为异常记录,请通知相关负责人添加计费模型,点击'+'<b class="text-primary">"确定"</b>'+'则确认提交 ',
|
|
|
|
|
- function () {
|
|
|
|
|
- document.getElementById('waybillForm').submit();
|
|
|
|
|
- });
|
|
|
|
|
- }else{
|
|
|
|
|
- document.getElementById('waybillPriceModel').value=response.data.success;
|
|
|
|
|
- document.getElementById('waybillForm').submit();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ let _this=this;
|
|
|
|
|
+ axios.post(url,{carrier_id:carrier_id,carrier_weight:[carrier_weight,carrier_weight_other],
|
|
|
|
|
+ carrier_weight_unit_id:[carrier_weight_unit_id,carrier_weight_unit_id_other],destination_city_id:destination_city_id})
|
|
|
|
|
+ .then(
|
|
|
|
|
+ function (response) {
|
|
|
|
|
+ if (response.data.error){_this.errors=response.data.error;return;}
|
|
|
|
|
+ if (!response.data.success) {
|
|
|
|
|
+ document.getElementById('waybillPriceModel').value='';
|
|
|
|
|
+ tempTip.confirm('该目的地与计量单位对应的计费模型不存在,如录入将会标为异常记录,请通知相关负责人添加计费模型,点击'+'<b class="text-primary">"确定"</b>'+'则确认提交 ',
|
|
|
|
|
+ function () {
|
|
|
|
|
+ document.getElementById('waybillForm').submit();
|
|
|
|
|
+ });
|
|
|
|
|
+ }else{
|
|
|
|
|
+ document.getElementById('waybillPriceModel').value=response.data.success;
|
|
|
|
|
+ document.getElementById('waybillForm').submit();
|
|
|
}
|
|
}
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
},
|
|
},
|
|
|
submitForm(){
|
|
submitForm(){
|
|
|
let type=document.getElementById('type').value;
|
|
let type=document.getElementById('type').value;
|