Zhouzhendong 6 лет назад
Родитель
Сommit
cf15de1aae

+ 3 - 3
app/Http/Controllers/WaybillsController.php

@@ -199,7 +199,7 @@ class WaybillsController extends Controller
             $waybill->update();
         }
         $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
-        return redirect('waybill')->with('successTip','新运单“'.$waybill_number.'”录入成功');
+        return redirect('waybill/index')->with('successTip','新运单“'.$waybill_number.'”录入成功');
     }
 
     public function edit($id)
@@ -268,7 +268,7 @@ class WaybillsController extends Controller
                 };
             }
             $this->log(__METHOD__,__FUNCTION__,json_encode($request->toArray()),Auth::user()['id']);
-            return redirect('waybill')->with('successTip','运单“'.$waybill->waybill_number.'”调度成功');
+            return redirect('waybill/index')->with('successTip','运单“'.$waybill->waybill_number.'”调度成功');
         }
     }
 
@@ -449,7 +449,7 @@ class WaybillsController extends Controller
         $waybill->fill($data);
         if ($waybill->save()){
             $this->log(__METHOD__,__FUNCTION__,json_encode($waybill),Auth::user()['id']);
-            return redirect('waybill')->with('successTip','运单“'.$waybill->waybill_number.'”修改成功');
+            return redirect('waybill/index')->with('successTip','运单“'.$waybill->waybill_number.'”修改成功');
         }
     }
 

+ 3 - 2
resources/views/waybill/create.blade.php

@@ -54,8 +54,9 @@
                         </div>
                     </div>
                     <div class="col-8" style="margin-left: 15%">
-                        <button class="btn btn-outline-primary btn-sm" @click="origination='上海市松江区泗砖路351号宝时松江仓'" style="transform: scale(0.9)">松江仓库</button>
-                        <button class="btn btn-outline-primary btn-sm" @click="origination='上海市嘉定区武乡路9号宝时嘉定仓'" style="transform: scale(0.9)">嘉定仓库</button>
+                        <button type="button" class="btn btn-outline-primary btn-sm" @click="origination='上海市松江区泗砖仓'" style="transform: scale(0.9)">松江泗砖仓</button>
+                        <button type="button" class="btn btn-outline-primary btn-sm" @click="origination='上海市松江区九干仓'" style="transform: scale(0.9)">松江九干仓</button>
+                        <button type="button" class="btn btn-outline-primary btn-sm" @click="origination='上海市嘉定区武乡仓'" style="transform: scale(0.9)">嘉定武乡仓</button>
                     </div>
                     <div class="form-group row">
                         <label for="origination" class="col-2 col-form-label text-right text-primary">始发地址 *</label>

+ 32 - 15
resources/views/waybill/edit.blade.php

@@ -38,10 +38,23 @@
                             <input type="text" class="form-control" disabled="disabled" value="{{$waybill->wms_bill_number}}" >
                         </div>
                     </div>
-                    <div class="form-group row">
-                        <label class="col-2 col-form-label text-right text-secondary">始发地</label>
-                        <div class="col-8">
-                            <input id="origination_seek" type="text" class="form-control" disabled="disabled" value="{{$waybill->origination}}" >
+                    <div id="origination">
+                        <div class="col-8" style="margin-left: 15%" id="btn" hidden>
+                            <button type="button" class="btn btn-outline-primary btn-sm" @click="origination='上海市松江区泗砖仓'" style="transform: scale(0.9)">松江泗砖仓</button>
+                            <button type="button" class="btn btn-outline-primary btn-sm" @click="origination='上海市松江区九干仓'" style="transform: scale(0.9)">松江九干仓</button>
+                            <button type="button" class="btn btn-outline-primary btn-sm" @click="origination='上海市嘉定区武乡仓'" style="transform: scale(0.9)">嘉定武乡仓</button>
+                        </div>
+                        <div class="form-group row">
+                            <label  class="col-2 col-form-label text-right text-secondary">始发地</label>
+                            <div class="col-8">
+                                <input type="text" class="form-control @error('origination') is-invalid @enderror"
+                                       id="origination_seek" name="origination" disabled="disabled" @if(old('origination'))value="{{old('origination')}}" @else :value="origination"@endif>
+                            </div>
+                            @error('origination')
+                            <span class="invalid-feedback" role="alert">
+                                    <strong>{{ $message }}</strong>
+                            </span>
+                            @enderror
                         </div>
                     </div>
                     <div class="form-group row">
@@ -62,8 +75,15 @@
                             <input type="text" class="form-control" disabled="disabled" value="{{$waybill->recipient_mobile}}" >
                         </div>
                     </div>
+                    <div class="form-group row" id="ordering_remark">
+                        <label class="col-2 col-form-label text-right text-secondary">下单备注</label>
+                        <div class="col-8">
+                            <textarea class="form-control" disabled="disabled" >{{$waybill->ordering_remark}}</textarea>
+                        </div>
+                    </div>
+                    {{--编辑区--}}
                     <div class="form-group row">
-                        <label for="charge" class="col-2 col-form-label text-right text-secondary">收费(元)</label>
+                        <label  class="col-2 col-form-label text-right text-secondary">收费(元)</label>
                         <div class="col-8">
                             <input type="text" class="form-control @error('charge') is-invalid @enderror"
                                    id="charge" name="charge" value="@if(old('charge')){{ old('charge') }}@else{{$waybill->charge}}@endif " >
@@ -74,15 +94,6 @@
                                     </span>
                         @enderror
                     </div>
-                    <div class="form-group row">
-                        <label class="col-2 col-form-label text-right text-secondary">下单备注</label>
-                        <div class="col-8">
-                            <textarea class="form-control" disabled="disabled" >{{$waybill->ordering_remark}}</textarea>
-                        </div>
-                    </div>
-
-
-                    {{--编辑区--}}
                     <div class="form-group row">
                         <label for="carrier_id" class="col-2 col-form-label text-right text-primary">承运商 *</label>
                         <div class="col-8">
@@ -97,7 +108,7 @@
                         </div>
                     </div>
                     <div class="form-group row">
-                        <label for="carrier_bill" class="col-2 col-form-label text-right">承运商单号</label>
+                        <label class="col-2 col-form-label text-right">承运商单号</label>
                         <div class="col-8">
                             <input type="text" class="form-control @error('carrier_bill') is-invalid @enderror"
                                    name="carrier_bill" autocomplete="off" value="@if(old('carrier_bill')){{ old('carrier_bill') }}@else{{$waybill->carrier_bill}}@endif"  >
@@ -319,8 +330,14 @@
                     @endforeach
                 ],
                 errors:[],
+                origination:'{{$waybill->origination}}',
             },
             mounted:function(){
+                    if (!this.origination){
+                        $("#btn").removeAttr("hidden");
+                        $("#ordering_remark").after($("#origination"));
+                        $("#origination_seek").attr("disabled",false);
+                    }
                     if (!this.waybillPriceModel.origination_city_id){
                         let _this=this;
                         this.cities.every(function (city) {

+ 43 - 37
resources/views/waybill/index.blade.php

@@ -111,19 +111,31 @@
             </div>
             <table class="table table-striped table-sm table-bordered table-hover text-nowrap" style="background: #fff;">
                 <tr>
-                    <th>
+                    <th class="waybill_1">
                         <label for="all">
                             <input id="all" type="checkbox" @click="checkAll($event)">全选
                         </label>
                     </th>
-                    <th>ID</th>
-                    <th>运单类型</th>
-                    <th>当前状态</th>
-                    <th>运单号</th>
-                    <th>货主</th>
+                    <th class="waybill_1">ID</th>
+                    <th class="waybill_1">创建时间</th>
+                    <th class="waybill_1">运单类型</th>
+                    <th class="waybill_1">货主</th>
+                    <th class="waybill_1">运单号</th>
+                    <th class="waybill_1">当前状态</th>
+                    <th class="waybill_1">始发地</th>
+                    <th class="waybill_1">目的地</th>
+                    <th class="waybill_2">承运商</th>
+                    <th class="waybill_2">承运商单号</th>
+                    <th class="waybill_2">车型</th>
+                    <th class="waybill_2">仓库计数(抛)</th>
+                    <th class="waybill_2">承运商计数(抛)</th>
+                    <th class="waybill_2">仓库计数二</th>
+                    <th class="waybill_2">承运商计数二</th>
+                    <th class="waybill_3">运费(元)</th>
+                    <th class="waybill_3">提货费(元)</th>
+                    <th class="waybill_3">其他费用(元)</th>
+                    <th class="waybill_3">调度备注</th>
                     <th>WMS单号</th>
-                    <th>始发地</th>
-                    <th>目的地</th>
                     <th>收件人</th>
                     <th>收件人电话</th>
                     <th>收费(元)</th>
@@ -134,21 +146,9 @@
                     @can('运输管理-编辑','运输管理-运单审核','运输管理-调度','运输管理-编辑','运输管理-删除')
                         <th>操作</th>
                     @endcan
-                    <th>承运商</th>
-                    <th>承运商单号</th>
                     <th>始发市</th>
                     <th>目的市</th>
-                    <th>仓库计数(抛)</th>
-                    <th>仓库计数二</th>
-                    <th>承运商计数(抛)</th>
-                    <th>承运商计数二</th>
-                    <th>车型</th>
                     <th>车辆信息</th>
-                    <th>运费(元)</th>
-                    <th>提货费(元)</th>
-                    <th>其他费用(元)</th>
-                    <th>调度备注</th>
-                    <th>创建时间</th>
                     <th>调度审核人</th>
                 </tr>
 
@@ -157,13 +157,28 @@
                         <input class="checkItem" type="checkbox" :value="waybill.id" v-model="checkData">
                     </td>
                     <td>@{{waybill.id}}</td>
+                    <td>@{{waybill.created_at}}</td>
                     <td>@{{waybill.type}}</td>
-                    <td :style="{color:waybill.status=='已审核'?'blue':''}">@{{waybill.status}}</td>
-                    <td>@{{waybill.waybill_number}}</td>
                     <td>@{{waybill.owner}}</td>
-                    <td>@{{waybill.wms_bill_number}}</td>
+                    <td>@{{waybill.waybill_number}}</td>
                     <td>@{{waybill.origination}}</td>
                     <td>@{{waybill.destination}}</td>
+                    <td>@{{waybill.carrier}}</td>
+                    <td>@{{waybill.carrier_bill}}</td>
+                    <td><p v-if="waybill.carType">@{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i></p></td>
+                    <td>@{{waybill.warehouse_weight}}  @{{waybill.warehouse_weight_unit}}</td>
+                    <td>@{{waybill.carrier_weight}}  @{{waybill.carrier_weight_unit}}</td>
+                    <td>@{{waybill.warehouse_weight_other}}  @{{waybill.warehouse_weight_unit_other}}</td>
+                    <td>@{{waybill.carrier_weight_other}}  @{{waybill.carrier_weight_unit_other}}</td>
+                    @can('运输管理-可见费用项')
+                        <td><p v-if="waybill.type=='专线'"></p><p v-else>@{{waybill.fee}}</p></td>
+                        <td>@{{waybill.pick_up_fee}}</td>
+                        <td>@{{waybill.other_fee}}</td>
+                    @endcan
+                    <td>@{{waybill.dispatch_remark}}</td>
+
+                    <td :style="{color:waybill.status=='已审核'?'blue':''}">@{{waybill.status}}</td>
+                    <td>@{{waybill.wms_bill_number}}</td>
                     <td>@{{waybill.recipient}}</td>
                     <td>@{{waybill.recipient_mobile}}</td>
                     <td>@{{waybill.charge}}</td>
@@ -199,23 +214,9 @@
                             @endcan
                         </div>
                     </td>
-                    <td><p>@{{waybill.carrier}}</p></td>
-                    <td>@{{waybill.carrier_bill}}</td>
                     <td>@{{waybill.origination_city}}</td>
                     <td>@{{waybill.destination_city}}</td>
-                    <td>@{{waybill.warehouse_weight}}  @{{waybill.warehouse_weight_unit}}</td>
-                    <td>@{{waybill.warehouse_weight_other}}  @{{waybill.warehouse_weight_unit_other}}</td>
-                    <td>@{{waybill.carrier_weight}}  @{{waybill.carrier_weight_unit}}</td>
-                    <td>@{{waybill.carrier_weight_other}}  @{{waybill.carrier_weight_unit_other}}</td>
-                    <td><p v-if="waybill.carType">@{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i></p></td>
                     <td>@{{waybill.car_owner_info}}</td>
-                    @can('运输管理-可见费用项')
-                        <td><p v-if="waybill.type=='专线'"></p><p v-else>@{{waybill.fee}}</p></td>
-                        <td>@{{waybill.pick_up_fee}}</td>
-                        <td>@{{waybill.other_fee}}</td>
-                    @endcan
-                    <td>@{{waybill.dispatch_remark}}</td>
-                    <td>@{{waybill.created_at}}</td>
                     <td><p v-for="waybillAuditLog in waybill.waybillAuditLogs" v-if=waybillAuditLog.audit_stage==="调度阶段">@{{waybillAuditLog.user.name}}</p></td>
                 </tr>
                 <tr v-show="wmsCommodities&&wmsCommodities.length>0" id="wmsCommodities">
@@ -252,6 +253,11 @@
 
 
 @section('lastScript')
+    <style>
+        .waybill_1{background-color: #FFA07A}
+        .waybill_2{background-color: cornflowerblue}
+        .waybill_3{background-color: #00FFFF}
+    </style>
     <script>
         let vueList=new Vue({
             el:'#list',

+ 16 - 12
resources/views/waybill/waybillEdit.blade.php

@@ -8,26 +8,19 @@
             </li>
         @endcomponent
     </div>
-    <div class="container-fluid mt-3">
+    <div class="container-fluid mt-3" id="update">
         <div class="card">
             <div class="card-body">
                 <form method="POST" action='{{url("waybill/waybillUpdate/{$waybill->id}")}}'>
                     @csrf
                     <div class="form-group row">
                         <label for="type" class="col-2 col-form-label text-right text-primary">运单类型 *</label>
-                            @if($waybill->type=="直发车")
-                                <div class="col-8" style="padding-top: 1%">
-                                    <label class="radio-inline"><input type="radio" name="type" value="直发车" checked>直发车</label>
-                                    <label class="radio-inline" style="margin-left: 5%"><input type="radio" name="type" value="专线">专线</label>
-                                </div>
-                            @else
-                                <div class="col-8" style="padding-top: 1%">
-                                    <label class="radio-inline"><input type="radio" name="type" value="直发车" >直发车</label>
-                                    <label class="radio-inline" style="margin-left: 5%"><input type="radio" name="type" value="专线" checked>专线</label>
-                                </div>
-                            @endif
+                        <div class="h5 mb-3 col-8">
+                            <button type="button" @click="type='专线'" class="btn" :class="type=='专线'?'btn-primary':'btn-outline-primary'">专线</button>
+                            <button type="button" @click="type='直发车'" class="btn ml-2" :class="type!='专线'?'btn-primary':'btn-outline-primary'">直发车</button>
                         </div>
                     </div>
+                    <input hidden type="text" name="type" :value="type">
                     <div class="form-group row">
                         <label for="province_id" class="col-2 col-form-label text-right text-primary">货主 *</label>
                         <div class="col-8">
@@ -148,3 +141,14 @@
         </div>
     </div>
 @endsection
+
+@section('lastScript')
+<script>
+    new Vue({
+        el:"#update",
+        data:{
+            type:"{{$waybill->type}}",
+        },
+    });
+</script>
+@endsection

+ 1 - 1
tests/webApi/test.http

@@ -35,7 +35,7 @@ Content-Type: application/json
 {"name":"zhouzhendong","password":"zhou1792524653"}
 ###
 
-GET http://bswas/api/thirdPart/weixin/waybill?api_token=ss
+GET https://was.baoshi56.com/api/thirdPart/weixin/waybill?api_token=fb7efc3
 
 ###