Просмотр исходного кода

德邦物流 创建订单号 和 物流轨迹查询

king 4 лет назад
Родитель
Сommit
fde8e875cd

+ 2 - 1
app/Http/Controllers/TestController.php

@@ -1337,6 +1337,7 @@ TEXT;
     public function getOrder()
     {
         $model = new DbOpenService();
-        dd($model->getDbOrderNo(['wms_bill_number' => 'SO190628002777']));
+        $res = $model->getOrderStatus(['mailNo' => '758510901']);
+        die(json_encode($res));
     }
 }

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

@@ -73,6 +73,7 @@ class WaybillController extends Controller
         $type=$request->type ?? "";
         if ($type==='ZF')$type='直发车';
         if ($type==='ZX')$type='专线';
+        if ($type==='DBWL')$type='德邦物流';
         return view('transport.waybill.create',['owners'=>$ownerService->getIntersectPermitting(),'type'=>$type]);
     }
 
@@ -107,7 +108,10 @@ class WaybillController extends Controller
         $units=$unitService->getSelection();
         $carTypes=$carTypeService->getSelection();
         $deliveryType = app('DeliveryTypeService')->getSelection();
-        return view('transport.waybill.edit',['waybill'=>$waybill,'logistics'=>$logisticService->getSelection(["id","name"],"物流"),'cities'=>$cities,'units'=>$units,'carTypes'=>$carTypes,'deliveryTypes'=>$deliveryType]);
+        return view('transport.waybill.edit',['waybill'=>$waybill,'logistics'=>$logisticService->getSelection(["id","name"],"物流"),'cities'=>$cities,'units'=>$units,'carTypes'=>$carTypes,
+            'deliveryTypes'=>$deliveryType,'orderTypes' =>collect(config('api_logistic.DB.prod.orderType')),'transportTypes' => collect(config('api_logistic.DB.prod.transportType'))
+            ,'payTypes' => collect(config('api_logistic.DB.prod.payType')),'backSignBills' => collect(config('api_logistic.DB.prod.backSignBill')),'packageServices' => collect(config('api_logistic.DB.prod.packageService'))
+        ]);
     }
 
     public function update(Request $request, $id,WaybillPriceModelService $waybillPriceModelService,
@@ -172,10 +176,10 @@ class WaybillController extends Controller
             'user_id'=>Auth::id(),
         ]);
         //todo 若是德邦物流 请求API创建快递单号
-        $logistic_ids = Logistic::query()->where('name','like', '德邦%')->pluck('id')->toArray();
+        $logistic_ids = Logistic::query()->where('name','like', '德邦%')->where('type','=','物流')->pluck('id')->toArray();
         if (in_array($request['logistic_id'], $logistic_ids)){
-            $row = app('DbOpenService')->getDbOrderNo(['id' => $id]);
-            if ($row == 'false') $msg = '-- 生成德邦快递单号失败,请核实参数重新调度';
+            $res = app('DbOpenService')->getDbOrderNo(['id' => $id]);
+            $msg =  $res['msg']? "【申请德邦物流单号:".$res['msg']."】"  :'';
         }
         return redirect('transport/waybill/index')->with('successTip','运单“'.$waybill->waybill_number.'”调度成功 '. ($msg??''));
     }
@@ -291,12 +295,17 @@ class WaybillController extends Controller
         $validatorData=["logistic_id"=>$logistic_id,"destination_city_id"=>$destination_city_id,
             'carrier_weight'=>$carrier_weight[0],"carrier_weight_unit_id"=>$carrier_weight_unit_id[0],
             "carrier_weight_other"=>$carrier_weight[1],"carrier_weight_unit_id_other"=>$carrier_weight_unit_id[1]];
-        if (in_array($logistic_id,[14,15,28,29])){
+        if ($logistic_id == 15){
             $flag = 1;
             $validatorData['cargo_name'] = $request->input('cargo_name');
             $validatorData['total_number'] = $request->input('total_number');
             $validatorData['total_weight'] = $request->input('total_weight');
             $validatorData['deliveryType_id'] = $request->input('deliveryType_id');
+            $validatorData['order_type'] = $request->input('order_type');
+            $validatorData['transport_type'] = $request->input('transport_type');
+            $validatorData['pay_type'] = $request->input('pay_type');
+            $validatorData['back_sign_bill'] = $request->input('back_sign_bill');
+            $validatorData['package_service'] = $request->input('package_service');
         }else $flag = 0;
         $errors=Validator::make($validatorData,[
             'logistic_id'=>'required|integer',
@@ -309,6 +318,11 @@ class WaybillController extends Controller
             'total_number' => $flag ? 'required|min:0|numeric|max:999999' : '',
             'total_weight' => $flag ? 'required|min:0|numeric|max:999999' : '',
             'deliveryType_id' => $flag ? 'required' : '',
+            'order_type' => $flag ? 'required' : '',
+            'transport_type' => $flag ? 'required' : '',
+            'pay_type' => $flag ? 'required' : '',
+            'back_sign_bill' => $flag ? 'required' : '',
+            'package_service' => $flag ? 'required' : '',
         ],[
             'required'=>':attribute 为必填项',
             'max'=>':attribute 字符过多或输入值过大',
@@ -328,6 +342,10 @@ class WaybillController extends Controller
             'total_number' =>  '总包裹数',
             'total_weight' =>  '总重量',
             'deliveryType_id' => '送货方式',
+            'order_type' => '下单模式',
+            'transport_type' => '运输方式/产品类型',
+            'pay_type' => '支付方式',
+            'back_sign_bill' => '签收回单',
         ])->errors();
         if (count($errors)>0)return ['error'=>$errors];
         $result=$this->checkWaybillPriceModel($logistic_id,$destination_city_id,$carrier_weight,$carrier_weight_unit_id);

+ 77 - 36
app/Services/DbOpenService.php

@@ -2,6 +2,7 @@
 
 namespace App\Services;
 
+use App\Log;
 use App\OracleDOCOrderHeader;
 use App\OrderLogistic;
 use App\Traits\ServiceAppAop;
@@ -24,10 +25,10 @@ class DbOpenService
     {
         //获取系统无快递单号订单信息
         $order_info = Waybill::query()
-            ->with(['owner:id,name,phone_number', 'orderByCode', 'orderByCode.shop:id,name',
-                'orderByCode.warehouse:id,province_id,city_id,county_id,address',
-                'orderByCode.warehouse.province:id,name', 'orderByCode.warehouse.city:id,name',
-                'orderByCode.warehouse.county:id,name', 'deliveryType:id,name'])
+            ->with(['owner:id,name,phone_number', 'order', 'order.shop:id,name',
+                'order.warehouse:id,province_id,city_id,county_id,address',
+                'order.warehouse.province:id,name', 'order.warehouse.city:id,name',
+                'order.warehouse.county:id,name', 'deliveryType:id,name'])
             ->where('id', '=', $params['id'])
             ->first();
         //请求德邦API 生成新订单
@@ -38,40 +39,40 @@ class DbOpenService
             "Accept" => "application/json"
         ];
         if ($order_info) {
-            if (empty($order_info->orderByCode)) return false;
-            $res = $model->isExist($order_info->orderByCode->id);
+            if (empty($order_info->order) || empty($order_info->owner) || empty($order_info->order->shop)) return ['code' => 0, 'msg' => '订单关联信息错误,请核实'];
+            $res = $model->isExist($order_info->order->id);
             if (!$res || $res->status == 0 ?? 0) {
                 $data = [
-                    'logisticID' => config('api_logistic.DB.prod.sign') . date("YmdHis") . mt_rand(1000, 9999) . $order_info->orderByCode->id,
-                    'custOrderNo' => $order_info->orderByCode->client_code ?? '',
+                    'logisticID' => config('api_logistic.DB.prod.sign') . date("YmdHis") . mt_rand(1000, 9999) . $order_info->order->id,
+                    'custOrderNo' => $order_info->order->client_code ?? '',
                     // 'mailNo' => '',  // 不传会创建新的 运单号
                     'needTraceInfo' => config('api_logistic.DB.prod.needTraceInfo'),
                     'companyCode' => config('api_logistic.DB.prod.company_code'),
-                    'orderType' => config('api_logistic.DB.prod.orderType'),
-                    'transportType' => config('api_logistic.DB.prod.transportType'),
+                    'orderType' => $order_info->order_type,
+                    'transportType' => $order_info->transport_type,
                     'customerCode' => config('api_logistic.DB.prod.customer_Code'),
                     'sender' => [
-                        'companyName' => $order_info->orderByCode->shop->name ?? '',
+                        'companyName' => $order_info->order->shop->name ?? '',
                         'businessNetworkNo' => '',
                         'name' => $order_info->owner->name ?? '',
                         'mobile' => $order_info->owner->phone_number ?? '',
                         'phone' => $order_info->owner->phone_number ?? '',
-                        'province' => $order_info->orderByCode->warehouse->province->name ?? '',
-                        'city' => $order_info->orderByCode->warehouse->city->name ?? '',
-                        'country' => $order_info->orderByCode->warehouse->county->name ?? '',
+                        'province' => $order_info->order->warehouse->province->name ?? '',
+                        'city' => $order_info->order->warehouse->city->name ?? '',
+                        'country' => $order_info->order->warehouse->county->name ?? '',
                         'town' => '',
-                        'address' => $order_info->orderByCode->warehouse->address ?? '',
+                        'address' => $order_info->order->warehouse->address ?? '',
                     ],
                     'receiver' => [
                         'toNetworkNo' => '',
-                        'name' => $order_info->orderByCode->consignee_name ?? '',
-                        'phone' => $order_info->orderByCode->consignee_phone ?? '',
-                        'mobile' => $order_info->orderByCode->consignee_phone ?? '',
-                        'province' => $order_info->orderByCode->province ?? '',
-                        'city' => $order_info->orderByCode->city ?? "",
-                        'county' => $order_info->orderByCode->district ?? '',
+                        'name' => $order_info->order->consignee_name ?? '',
+                        'phone' => $order_info->order->consignee_phone ?? '',
+                        'mobile' => $order_info->order->consignee_phone ?? '',
+                        'province' => $order_info->order->province ?? '',
+                        'city' => $order_info->order->city ?? "",
+                        'county' => $order_info->order->district ?? '',
                         'town' => '',
-                        'address' => $order_info->orderByCode->address ?? '',
+                        'address' => $order_info->order->address ?? '',
                         'companyName' => ''
                     ],
                     'packageInfo' => [
@@ -79,25 +80,25 @@ class DbOpenService
                         'totalNumber' => $order_info->total_number ?? '',
                         'totalWeight' => $order_info->total_weight ?? '',
                         'totalVolume' => '',
-                        'packageService' => '',
+                        'packageService' => $order_info->package_service ?? '',
                         'deliveryType' => $order_info->deliveryType->name ?? '',
                     ],
                     'gmtCommit' => date('Y-m-d H:i:s'),
-                    'payType' => config('api_logistic.DB.prod.payType'),
+                    'payType' => $order_info->pay_type,
                     'addServices' => [
                         'insuranceValue' => '',
                         'codType' => '',
                         'reciveLoanAccount' => '',
                         'accountName' => '',
                         'codValue' => '',
-                        'backSignBill' => config('api_logistic.DB.prod.backSignBill')
+                        'backSignBill' => $order_info->back_sign_bill
                     ],
                     'smsNotify' => config('api_logistic.DB.prod.smsNotify'),
                     'sendStartTime' => date("Y-m-d H:i:s"),
                     'sendEndTime' => $order_info->deliver_at ?? date("Y-m-d H:i:s", strtotime('+1 day')),
                     'originalWaybillNumber' => $order_info->wms_bill_number ?? '',
                     'remark' => $order_info->dispatch_remark ?? '',
-                    'isOut' => '',
+                    'isOut' => 'N',
                     'passwordSigning' => config('api_logistic.DB.prod.passwordSigning'),
                     'isdispatched' => '',
                     'ispresaleorder' => '',
@@ -116,28 +117,68 @@ class DbOpenService
                 unset($data);
                 if (array_key_exists('result', $return)) {
                     //请求成功  快递单号 $return['mailNo']   请求编号 $return['uniquerRequestNumber']
+                    //返回日志记录
+                    $id = $params['id'];
+                    $order_no = $order_info->wms_bill_number;
+                    $mail_no = $return['mailNo']??'';
                     $add_data = [
-                        'order_id' => $order_info->orderByCode->id,
+                        'order_id' => $order_info->order->id,
                         'status' => $return['result'] == 'true' ? 1 : 0,
-                        'code' => $return['mailNo'] ?? '',
+                        'code' => $mail_no ?? '',
                         'uniquer_request_number' => $return['uniquerRequestNumber'],
                         'reason' => $return['reason'] ?? '',
                         'created_at' => date('Y-m-d H:i:s')
                     ];
                     $roe = OrderLogistic::query()->insertGetId($add_data);
-                    //成功
-                    if ($return['result'] == 'true' && $roe) {
-                        $order_no = $order_info->wms_bill_number;
-                        $mail_no = $return['mailNo'];
-                        $row = DB::connection('oracle')->transaction(function () use ($order_no, $mail_no) {
-                            OracleDOCOrderHeader::query()->where('orderno', $order_no)->update(['edittime' => Carbon::now(), 'soreference5' => $mail_no]);
+                    if ($roe && $return['result'] == 'true') {
+                        DB::connection('mysql')->transaction(function () use ($id, $order_no, $mail_no) {
+                            $update_data = [
+                                'type' => '德邦物流',
+                                'waybill_number' => $mail_no,
+                                'updated_at' => date('Y-m-d H:i:s')
+                            ];
+                            Waybill::query()->where('id', '=', $id)->update($update_data);
+                            DB::connection('oracle')->transaction(function () use ($order_no, $mail_no) {
+                                OracleDOCOrderHeader::query()->where('orderno', $order_no)->update(['edittime' => Carbon::now(), 'soreference5' => $mail_no]);
+                            });
                             LogService::log(__METHOD__, "申请快递单号回传WMS", ['orderno' => $order_no, 'soreference5' => $mail_no, 'edittime' => date('Y-m-d H:i:s')]);
                         });
-                        if ($row) return true;
+                        return ['code' => 1, 'msg' => '申请德邦物流单号成功'];
                     }
                 }
+                LogService::log(__METHOD__, "申请快递单号回传WMS", ['orderno' => $order_no, 'content'=> $return]);
+                return ['code' => 0, 'msg' => $return['reason']];
             }
+            elseif($res->status == 1 ?? 0 ) return ['code' => 1, 'msg'=> '德邦快递单号已存在'];
         }
-        return false;
+        return ['code' => 0, 'msg' => '订单信息错误,请核实'];
+    }
+
+    /**
+     * 根据 德邦运单号 获取 订单物流轨迹
+     * @param array $params
+     * @return array
+     */
+    public function getOrderStatus($params = [])
+    {
+        if ( ($params['mailNo']??'') == '') return ['code' => 0 , 'msg' => '德邦运单号不能为空'];
+        $uri = "http://dpsanbox.deppon.com/sandbox-web/standard-order/newTraceQuery.action";
+        $header = [
+            'Content-Type' => 'application/x-www-form-urlencoded;charset=utf-8',
+            "Accept" => "application/json"
+        ];
+        $data = [
+            'mailNo' => $params['mailNo']??''
+        ];
+        $param = json_encode($data, true);
+        $dd["params"] = $param;
+        $dd["timestamp"] = (integer)getMillisecond();
+        $dd["digest"] = base64_encode(md5($param . config('api_logistic.DB.prod.app_key') . $dd['timestamp']));
+        $dd["companyCode"] = config('api_logistic.DB.prod.company_code');
+        $return = httpPost($uri, $dd, $header);
+        if (array_key_exists('result', $return) && $return['result'] == 'true' && array_key_exists('resultCode', $return) && $return['resultCode'] == '1000'){
+           return ['code'=> 1, 'msg'=> '正在加载中。。。', 'data' => $return['responseParam']];
+        }
+        return ['code' => 0, 'msg' => '暂无物流信息'];
     }
 }

+ 10 - 8
config/api_logistic.php

@@ -174,10 +174,11 @@ return [
             'customer_Code' => 'F2015082279473065',
             'sign' => 'IYKO',
             'needTraceInfo' => 0, //是否需要订阅轨迹 1:是 2:否
-            'orderType' => 2, //下单模式 1:散客模式 2:大客户模式 3:同步筛单下单
-            'transportType' => 'JJDJ', //运输方式/产品类型 快递运输方式 : RCP:大件快递360; NZBRH:重包入户; ZBTH:重包特惠; WXJTH:微小件特惠; JJDJ:经济大件; PACKAGE:标准快递; DEAP:特准快件;HKDJC:航空大件次日达; HKDJG:航空大件隔日达; TZKJC:特快专递; 零担运输方式: JZKY:精准空运(仅散客模式支持该运输方式); JZQY_LONG:精准汽运; JZKH:精准卡航; 整车运输方式 1.整车配送 ZCPS 2.精准专车 JZZHC
-            'payType' => 2, //支付方式  0、发货人付款(现付)(大客户模式不支持寄付) 1、收货人付款(到付) 2、发货人付款(月结)
-            'backSignBill' => 2, //运输方式/产品类型 1:散客模式 2:大客户模式 3:同步筛单下单
+            'orderType' => [1 => '散客模式',2 => '大客户模式',3 => '同步筛单下单'], //下单模式 1:散客模式 2:大客户模式 3:同步筛单下单
+            'transportType' => ['JZQY_LONG' => '精准汽运', 'JZKH' => '精准卡航'], //运输方式/产品类型 快递运输方式 : RCP:大件快递360; NZBRH:重包入户; ZBTH:重包特惠; WXJTH:微小件特惠; JJDJ:经济大件; PACKAGE:标准快递; DEAP:特准快件;HKDJC:航空大件次日达; HKDJG:航空大件隔日达; TZKJC:特快专递; 零担运输方式: JZKY:精准空运(仅散客模式支持该运输方式); JZQY_LONG:精准汽运; JZKH:精准卡航; 整车运输方式 1.整车配送 ZCPS 2.精准专车 JZZHC
+            'payType' => [0 => '发货人付款(现付)(大客户模式不支持寄付)',1 => '收货人付款(到付)',2 => '发货人付款(月结)'], //支付方式  0、发货人付款(现付)(大客户模式不支持寄付) 1、收货人付款(到付) 2、发货人付款(月结)
+            'backSignBill' => [0 =>'无需返单',1 => '签收单原件返回',2 => '电子签收单'], //签收回单  0:无需返单 1:签收单原件返回 2:电子签收单(电子签名图片需要另外对接查询接口)
+            'packageService' => ['纸','纤','木箱','木架','托膜','托木'],  //包装(直接用中文) : 纸、纤、木箱、木架、托膜、托木(大客户模式下运输方式为零担时必填)
             'smsNotify' => 'N', //短信通知  Y:需要 N: 不需要
             'passwordSigning' => 'N', //是否口令签收 仅适用于快递,Y:需要 N: 不需要;若为Y,必须收货人提供验证码给快递员才能签收,该服务是有偿的,具体费用请让我司收货营业部联系张宁(491407),请慎重使用!
             'uri' => [
@@ -190,10 +191,11 @@ return [
             'customer_Code' => 'F2015082279473065',
             'sign' => 'IYKO',
             'needTraceInfo' => 0, //是否需要订阅轨迹 1:是 2:否
-            'orderType' => 2, //下单模式 1:散客模式 2:大客户模式 3:同步筛单下单
-            'transportType' => 'JJDJ', //运输方式/产品类型 快递运输方式 : RCP:大件快递360; NZBRH:重包入户; ZBTH:重包特惠; WXJTH:微小件特惠; JJDJ:经济大件; PACKAGE:标准快递; DEAP:特准快件;HKDJC:航空大件次日达; HKDJG:航空大件隔日达; TZKJC:特快专递; 零担运输方式: JZKY:精准空运(仅散客模式支持该运输方式); JZQY_LONG:精准汽运; JZKH:精准卡航; 整车运输方式 1.整车配送 ZCPS 2.精准专车 JZZHC
-            'payType' => 2, //支付方式  0、发货人付款(现付)(大客户模式不支持寄付) 1、收货人付款(到付) 2、发货人付款(月结)
-            'backSignBill' => 2, //运输方式/产品类型 1:散客模式 2:大客户模式 3:同步筛单下单
+            'orderType' => [1 => '散客模式',2 => '大客户模式',3 => '同步筛单下单'], //下单模式 1:散客模式 2:大客户模式 3:同步筛单下单
+            'transportType' => ['JZQY_LONG' => '精准汽运', 'JZKH' => '精准卡航'], //运输方式/产品类型 快递运输方式 : RCP:大件快递360; NZBRH:重包入户; ZBTH:重包特惠; WXJTH:微小件特惠; JJDJ:经济大件; PACKAGE:标准快递; DEAP:特准快件;HKDJC:航空大件次日达; HKDJG:航空大件隔日达; TZKJC:特快专递; 零担运输方式: JZKY:精准空运(仅散客模式支持该运输方式); JZQY_LONG:精准汽运; JZKH:精准卡航; 整车运输方式 1.整车配送 ZCPS 2.精准专车 JZZHC
+            'payType' => [0 => '发货人付款(现付)(大客户模式不支持寄付)',1 => '收货人付款(到付)',2 => '发货人付款(月结)'], //支付方式  0、发货人付款(现付)(大客户模式不支持寄付) 1、收货人付款(到付) 2、发货人付款(月结)
+            'backSignBill' => [0 =>'无需返单',1 => '签收单原件返回',2 => '电子签收单'], //签收回单  0:无需返单 1:签收单原件返回 2:电子签收单(电子签名图片需要另外对接查询接口)
+            'packageService' => ['纸','纤','木箱','木架','托膜','托木'],  //包装(直接用中文) : 纸、纤、木箱、木架、托膜、托木(大客户模式下运输方式为零担时必填)
             'smsNotify' => 'N', //短信通知  Y:需要 N: 不需要
             'passwordSigning' => 'N', //是否口令签收 仅适用于快递,Y:需要 N: 不需要;若为Y,必须收货人提供验证码给快递员才能签收,该服务是有偿的,具体费用请让我司收货营业部联系张宁(491407),请慎重使用!
             'uri' => [

+ 39 - 0
database/migrations/2021_07_15_173811_alert_order_type_column_in_waybills_table.php

@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AlertOrderTypeColumnInWaybillsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('waybills', function (Blueprint $table) {
+            $table->unsignedTinyInteger('order_type')->default('2')->nullable()->comment('下单模式 1:散客模式 2:大客户模式 3:同步筛单下单');
+            $table->string('transport_type')->default('JZQY_LONG')->nullable()->comment('运输方式/产品类型 JZQY_LONG:精准汽运  JZKH: 精准卡航 ');
+            $table->unsignedTinyInteger('pay_type')->default('2')->nullable()->comment('支付方式  0、发货人付款(现付)(大客户模式不支持寄付) 1、收货人付款(到付) 2、发货人付款(月结)');
+            $table->unsignedTinyInteger('back_sign_bill')->default('2')->nullable()->comment('签收回单  0:无需返单 1:签收单原件返回 2:电子签收单(电子签名图片需要另外对接查询接口)');
+            $table->string('package_service',10)->default('木箱')->nullable()->comment('包装(直接用中文) : 纸、纤、木箱、木架、托膜、托木(大客户模式下运输方式为零担时必填)');
+            $table->integer('total_number')->default(1)->change();
+            $table->unsignedInteger('deliveryType_id')->default(3)->change();
+        });
+        \Illuminate\Support\Facades\DB::statement("ALTER TABLE waybills MODIFY COLUMN type ENUM('直发车','专线','德邦物流') not null");
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('waybills', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 5 - 1
resources/views/transport/waybill/create.blade.php

@@ -12,6 +12,9 @@
                     <li class="nav-item">
                         <a class="nav-link @if($type=='直发车') active @endif" href="{{url('transport/waybill/create?type=ZF')}}">直发车</a>
                     </li>
+                    <li class="nav-item">
+                        <a class="nav-link @if($type=='德邦物流') active @endif" href="{{url('transport/waybill/create?type=DBWL')}}">德邦物流</a>
+                    </li>
                 </ul>
             </div>
         </div>
@@ -26,7 +29,8 @@
                     <div class="h5 text-center mb-3">
                         <ul class="nav nav-tabs">
                             <li class="nav-item offset-5"><a class="nav-link @if($type=='专线') active @endif" href="{{url('transport/waybill/create?type=ZX')}}">专线</a></li>
-                            <li class="nav-item"><a class="nav-link @if($type!='专线') active @endif" href="{{url('transport/waybill/create?type=ZF')}}">直发车</a></li>
+                            <li class="nav-item"><a class="nav-link @if($type=='直发车') active @endif" href="{{url('transport/waybill/create?type=ZF')}}">直发车</a></li>
+                            <li class="nav-item"><a class="nav-link @if($type=='德邦物流') active @endif" href="{{url('transport/waybill/create?type=DBWL')}}">德邦物流</a></li>
                         </ul>
                     </div>
                     <div class="form-group row">

+ 434 - 381
resources/views/transport/waybill/edit.blade.php

@@ -11,8 +11,8 @@
                     </div>
                     <div class="modal-body row">
                         <label class="col-8 offset-2"><select class="form-control" v-model="waybill.province">
-                            <option v-for="province in provinces" :value="province.id">@{{ province.name }}</option>
-                        </select></label>
+                                <option v-for="province in provinces" :value="province.id">@{{ province.name }}</option>
+                            </select></label>
                     </div>
                     <div class="modal-footer">
                         <button type="button" class="btn btn-success pull-right" @click="addCounty()">录入</button>
@@ -25,401 +25,432 @@
                 <form method="POST" id="waybillForm" action='{{url("transport/waybill/".$waybill->id)}}'>
                     @csrf
                     @method('PUT')
-                    <div class="form-group row">
-                        <label for="type" class="col-2 col-form-label text-right text-secondary">运单类型</label>
-                        <div class="col-8">
-                            <div class="h5 mb-3 col-8">
-                                <button type="button" @click="waybill.type='专线'" class="btn" :class="waybill.type=='专线'?'btn-primary':'btn-outline-primary'">专线</button>
-                                <button type="button" @click="waybill.type='直发车'" class="btn ml-2" :class="waybill.type!='专线'?'btn-primary':'btn-outline-primary'">直发车</button>
+                    <div class="row">
+                        <div class="col-6">
+                            {{--编辑区--}}
+                            <div class="form-group row">
+                                <label for="type" class="col-2 col-form-label text-right text-secondary">运单类型</label>
+                                <div class="col-8">
+                                    <div class="h5 mb-3 col-8">
+                                        <button type="button" @click="waybill.type='专线'" class="btn" :class="waybill.type=='专线'?'btn-primary':'btn-outline-primary'">专线</button>
+                                        <button type="button" @click="waybill.type='直发车'" class="btn ml-2" :class="waybill.type=='直发车'?'btn-primary':'btn-outline-primary'">直发车</button>
+                                        <button type="button" @click="waybill.type='德邦物流'" class="btn ml-2" :class="waybill.type=='德邦物流'?'btn-primary':'btn-outline-primary'">德邦物流</button>
+                                    </div>
+                                    <input name="type" id="type" :value="waybill.type" hidden>
+                                </div>
                             </div>
-                            <input name="type" id="type" :value="waybill.type" hidden>
-                        </div>
-                    </div>
-                    <div class="form-group row">
-                        <label for="waybill_number" class="col-2 col-form-label text-right text-secondary">运单号</label>
-                        <div class="col-8">
-                            <input id="waybill_number" type="text" class="form-control" disabled="disabled" :value="waybill.waybill_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 type="text" class="form-control" disabled="disabled" :value="waybill.owner_name" >
-                        </div>
-                    </div>
-                    <div class="form-group row">
-                        <label class="col-2 col-form-label text-right text-secondary">WMS单号</label>
-                        <div class="col-8">
-                            <input type="text" class="form-control" disabled="disabled" :value="waybill.wms_bill_number" >
-                        </div>
-                    </div>
-                    <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="waybill.origination='上海市松江区泗砖仓'" style="transform: scale(0.9)">松江泗砖仓</button>
-                            <button type="button" class="btn btn-outline-primary btn-sm" @click="waybill.origination='上海市松江区九干仓'" style="transform: scale(0.9)">松江九干仓</button>
-                            <button type="button" class="btn btn-outline-primary btn-sm" @click="waybill.origination='上海市嘉定区武乡仓'" style="transform: scale(0.9)">嘉定武乡仓</button>
-                        </div>
-                        <div class="form-group row">
-                            <label  class="col-2 col-form-label text-right text-secondary" for="origination_seek">始发地</label>
-                            <div class="col-8">
-                                <input type="text" class="form-control @error('origination') is-invalid @enderror"
-                                       id="origination_seek" name="origination" disabled="disabled" v-model="waybill.origination">
-                            </div>
-                            @error('origination')
-                            <span class="invalid-feedback" role="alert">
-                                    <strong>{{ $message }}</strong>
-                            </span>
-                            @enderror
-                        </div>
-                    </div>
-                    <div class="form-group row">
-                        <label class="col-2 col-form-label text-right text-secondary" for="destination_seek">目的地</label>
-                        <div class="col-8">
-                            <input id="destination_seek" type="text" class="form-control" disabled="disabled" :value="waybill.destination" >
-                        </div>
-                    </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" disabled="disabled" :value="waybill.recipient" >
-                        </div>
-                    </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" 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="other_charge_remark" class="col-2 col-form-label text-right text-muted">其他收费备注</label>
-                        <div class="col-8">
-                            <input type="text" class="form-control" id="other_charge_remark"
-                                   name="other_charge_remark" autocomplete="off" value="@if(old('other_charge_remark')){{ old('other_charge_remark') }}@else{{$waybill->other_charge_remark}}@endif"  >
-                        </div>
-                    </div>
-                    <div class="form-group row">
-                        <label for="charge" class="col-2 col-form-label text-right text-secondary">运输收费(元)</label>
-                        <div class="col-3">
-                            <input type="number" step="0.01" min="0" class="form-control @error('charge') is-invalid @enderror"
-                                   id="charge" name="charge" v-model="waybill.charge" >
-                        </div>
-                        <label for="other_charge" class="col-2 col-form-label text-right text-muted">其他收费(元)</label>
-                        <div class="col-3">
-                            <input id="other_charge" type="number" step="0.01" class="form-control @error('other_charge') is-invalid @enderror"
-                                   name="other_charge" autocomplete="off" value="@if(old('other_charge')){{ old('other_charge') }}@else{{$waybill->other_charge}}@endif"  >
-                        </div>
-                        @error('charge')
-                        <span class="invalid-feedback" role="alert">
-                            <strong>{{ $message }}</strong>
-                        </span>
-                        @enderror
-                        @error('other_charge')
-                        <span class="invalid-feedback" role="alert">
-                            <strong>{{ $message }}</strong>
-                        </span>
-                        @enderror
-                    </div>
-
-                    <div class="form-group row" style="margin-bottom: 20px">
-                        <label for="logistic_id" class="col-2 col-form-label text-right text-primary">承运商 *</label>
-                        <div class="col-3" style="position: relative">
-                            <select class="form-control @error('logistic_id') is-invalid @enderror" id="logistic_id" style="width: 30%; " name="logistic_id"
-                                    :class="errors['logistic_id'] ? 'is-invalid' :''"  v-model="waybill.logistic_id">
-                                <option v-for="logistic in logistics" :value="logistic.id">@{{logistic.name}}</option>
-                            </select>
-                        </div>
-                        <label for="carrier_bill" class="col-2 col-form-label text-right">承运商单号</label>
-                        <div class="col-3">
-                            <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">
-                        </div>
-                        <div v-if="errors['logistic_id'] && errors['logistic_id'].length>0" class="invalid-feedback" role="alert" style="position: relative">
-                            <strong class="">@{{ errors['logistic_id'][0] }}</strong>
-                        </div>
-                    </div>
-                    <div  v-if="waybill.logistic_id == 14 ||  waybill.logistic_id == 15 || waybill.logistic_id == 28 || waybill.logistic_id == 29">
-                        <div class="form-group row">
-                            <label for="" class="col-2 col-form-label text-right text-primary">货物名称 *</label>
-                            <div class="col-2">
-                                <input type="text" class="form-control @error('cargo_name') is-invalid @enderror "
-                                       :class="errors['cargo_name'] ? 'is-invalid' :''"
-                                name="cargo_name" autocomplete="off" v-model="waybill.cargo_name" id="cargo_name">
-                                @error('cargo_name')
+                            <div class="form-group row">
+                                <label for="charge" class="col-2 col-form-label text-right text-secondary">运输收费(元)</label>
+                                <div class="col-3">
+                                    <input type="number" step="0.01" min="0" class="form-control @error('charge') is-invalid @enderror"
+                                           id="charge" name="charge" v-model="waybill.charge" >
+                                </div>
+                                <label for="mileage" class="col-2 col-form-label text-right text-muted">里程数</label>
+                                <div class="input-group col-4">
+                                    <input type="number" step="0.01" class="form-control @error('mileage') is-invalid @enderror"
+                                           name="mileage" autocomplete="off" v-model="waybill.mileage" id="mileage" >
+                                    <div class="input-group-append">
+                                        <span class="input-group-text">KM</span>
+                                    </div>
+                                </div>
+                                @error('charge')
                                 <span class="invalid-feedback" role="alert">
                                     <strong>{{ $message }}</strong>
                                 </span>
                                 @enderror
                             </div>
-                            <label for="" class="col-2 col-form-label text-right text-primary">总包裹数(件) *</label>
-                            <div class="col-2">
-                                <input type="number" class="form-control @error('total_number') is-invalid @enderror "
-                                       :class="errors['total_number'] ? 'is-invalid' :''"
-                                       name="total_number" autocomplete="off" v-model="waybill.total_number" id="total_number">
-                                @error('total_number')
+                            <div class="form-group row">
+                                <label for="other_charge" class="col-2 col-form-label text-right text-muted">其他收费(元)</label>
+                                <div class="col-3">
+                                    <input id="other_charge" type="number" step="0.01" class="form-control @error('other_charge') is-invalid @enderror"
+                                           name="other_charge" autocomplete="off" value="@if(old('other_charge')){{ old('other_charge') }}@else{{$waybill->other_charge}}@endif"  >
+                                </div>
+                                <label for="other_charge_remark" class="col-2 col-form-label text-right text-muted">其他收费备注</label>
+                                <div class="col-4">
+                                    <input type="text" class="form-control" id="other_charge_remark"
+                                           name="other_charge_remark" autocomplete="off" value="@if(old('other_charge_remark')){{ old('other_charge_remark') }}@else{{$waybill->other_charge_remark}}@endif"  >
+                                </div>
+                                @error('other_charge')
                                 <span class="invalid-feedback" role="alert">
                                     <strong>{{ $message }}</strong>
                                 </span>
                                 @enderror
                             </div>
-                        </div>
-                        <div class="form-group row">
-                            <label for="" class="col-2 col-form-label text-right text-primary">总重量(kg) *</label>
-                            <div class="col-2">
-                                <input type="number" class="form-control @error('total_weight') is-invalid @enderror "
-                                       :class="errors['total_weight'] ? 'is-invalid' :''"
-                                       name="total_weight" autocomplete="off" v-model="waybill.total_weight" id="total_weight">
-                                @error('total_weight')
-                                <span class="invalid-feedback" role="alert">
-                                    <strong>{{ $message }}</strong>
-                                </span>
-                                @enderror
+                            <div class="form-group row" style="margin-bottom: 20px">
+                                <label for="logistic_id" class="col-2 col-form-label text-right text-primary">承运商 *</label>
+                                <div class="col-3" style="position: relative">
+                                    <select class="form-control @error('logistic_id') is-invalid @enderror" id="logistic_id" name="logistic_id"
+                                            :class="errors['logistic_id'] ? 'is-invalid' :''"  v-model="waybill.logistic_id">
+                                        <option v-for="logistic in logistics" :value="logistic.id">@{{logistic.name}}</option>
+                                    </select>
+                                </div>
+                                <label for="carrier_bill" class="col-2 col-form-label text-right">承运商单号</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">
+                                </div>
+                                <div v-if="errors['logistic_id'] && errors['logistic_id'].length>0" class="invalid-feedback" role="alert" style="position: relative">
+                                    <strong class="">@{{ errors['logistic_id'][0] }}</strong>
+                                </div>
                             </div>
-                            <label for="" class="col-2 col-form-label text-right text-primary">送货方式 *</label>
-                            <div class="col-6">
-                                <select class="form-control col-4 @error('deliveryType_id') is-invalid @enderror" name="deliveryType_id"
-                                        :class="errors['deliveryType_id'] ? 'is-invalid' :''"
-                                        style="width: 30%;"   v-model="waybill.deliveryType_id" id="deliveryType_id">
-                                    <option v-for="deliveryType in deliveryTypes" :value="deliveryType.id">@{{ deliveryType.name }}</option>
-                                </select>
-                                @error('deliveryType_id')
-                                <span class="invalid-feedback" role="alert">
-                                    <strong>{{ $message }}</strong>
-                                </span>
-                                @enderror
-                            </div>
-                        </div>
-                    </div>
-                    <div v-if="waybill.type=='专线'">
-                        <div class="form-group row">
-                            <label for="origination_city_id" class="col-2 col-form-label text-right text-primary">始发市 *</label>
-                            <div class="col-8 form-inline">
-                                <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="waybill.origination_city_id" id="origination_city_id">
-                                    <option v-for="city in cities" :value="city.id">@{{city.name}}</option>
-                                </select>
-                                <input class="form-control-sm form-control" placeholder="输入关键字定位" @input="origination_city_name">
+                            <div v-if="waybill.logistic_id == 15 || waybill.type=='德邦物流'" style="background: black">
+                                <div class="form-group row">
+                                    <label for="cargo_name" class="col-2 col-form-label text-right text-primary">货物名称 *</label>
+                                    <div class="col-3">
+                                        <input type="text" class="form-control @error('cargo_name') is-invalid @enderror "
+                                               :class="errors['cargo_name'] ? 'is-invalid' :''"
+                                               name="cargo_name" autocomplete="off" v-model="waybill.cargo_name" id="cargo_name">
+                                    </div>
+                                    <label for="total_number" class="col-2 col-form-label text-right text-primary">总包裹数 *</label>
+                                    <div class="input-group col-4">
+                                        <input type="number" class="form-control @error('total_number') is-invalid @enderror "
+                                               :class="errors['total_number'] ? 'is-invalid' :''"
+                                               name="total_number" autocomplete="off" v-model="waybill.total_number" id="total_number">
+                                        <div class="input-group-append">
+                                            <span class="input-group-text">件</span>
+                                        </div>
+                                    </div>
+                                    @error('cargo_name')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                    @error('total_number')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                </div>
+                                <div class="form-group row">
+                                    <label for="total_weight" class="col-2 col-form-label text-right text-primary">总重量(kg) *</label>
+                                    <div class="col-3">
+                                        <input type="number" class="form-control @error('total_weight') is-invalid @enderror "
+                                               :class="errors['total_weight'] ? 'is-invalid' :''"
+                                               name="total_weight" autocomplete="off" v-model="waybill.total_weight" id="total_weight">
+                                    </div>
+                                    <label for="deliveryType_id" class="col-2 col-form-label text-right text-primary">送货方式 *</label>
+                                    <div class="col-5">
+                                        <select class="form-control @error('deliveryType_id') is-invalid @enderror" name="deliveryType_id"
+                                                :class="errors['deliveryType_id'] ? 'is-invalid' :''"
+                                                style="width: 30%;"   v-model="waybill.deliveryType_id" id="deliveryType_id">
+                                            <option v-for="deliveryType in deliveryTypes" :value="deliveryType.id">@{{ deliveryType.name }}</option>
+                                        </select>
+                                    </div>
+                                    @error('total_weight')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                    @error('deliveryType_id')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                </div>
+
+                                <div class="form-group row">
+                                    <label for="" class="col-2 col-form-label text-right text-primary">下单模式 *</label>
+                                    <div class="col-3">
+                                        <select class="form-control @error('order_type') is-invalid @enderror" name="order_type"
+                                                :class="errors['pay_type'] ? 'is-invalid' :''"
+                                                style="width: 100%;"   v-model="waybill.order_type" id="order_type">
+                                            <option v-for="(v,k) in orderTypes" :value="k">@{{ v }}</option>
+                                        </select>
+                                        @error('order_type')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                    </div>
+                                    <label for="" class="col-2 col-form-label text-right text-primary">运输方式/产品类型 *</label>
+                                    <div class="col-3">
+                                        <select class="form-control @error('transport_type') is-invalid @enderror" name="transport_type"
+                                                :class="errors['transport_type'] ? 'is-invalid' :''"
+                                                style="width: 100%;"   v-model="waybill.transport_type" id="transport_type">
+                                            <option v-for="(v,k) in transportTypes" :value="k">@{{ v }}</option>
+                                        </select>
+                                        @error('transport_type')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                    </div>
+                                </div>
+
+                                <div class="form-group row">
+                                    <label for="" class="col-2 col-form-label text-right text-primary">支付方式 *</label>
+                                    <div class="col-3">
+                                        <select class="form-control @error('pay_type') is-invalid @enderror" name="pay_type"
+                                                :class="errors['pay_type'] ? 'is-invalid' :''"
+                                                style="width: 100%;"   v-model="waybill.pay_type" id="pay_type">
+                                            <option v-for="(v,k) in payTypes" :value="k">@{{ v }}</option>
+                                        </select>
+                                        @error('pay_type')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                    </div>
+                                    <label for="" class="col-2 col-form-label text-right text-primary">签收回单 *</label>
+                                    <div class="col-3">
+                                        <select class="form-control @error('back_sign_bill') is-invalid @enderror" name="back_sign_bill"
+                                                :class="errors['back_sign_bill'] ? 'is-invalid' :''"
+                                                style="width: 100%;"   v-model="waybill.back_sign_bill" id="back_sign_bill">
+                                            <option v-for="(v,k) in backSignBills" :value="k">@{{ v }}</option>
+                                        </select>
+                                        @error('back_sign_bill')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                    </div>
+                                </div>
+                                <div class="form-group row">
+                                    <label for="" class="col-2 col-form-label text-right text-primary">包装方式 *</label>
+                                    <div class="col-3">
+                                        <select class="form-control  @error('package_service') is-invalid @enderror" name="package_service"
+                                                :class="errors['package_service'] ? 'is-invalid' :''"
+                                                style="width: 100%;"   v-model="waybill.package_service" id="package_service">
+                                            <option v-for="(v,k) in packageServices" :value="v">@{{ v }}</option>
+                                        </select>
+                                        @error('package_service')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                    </div>
+                                </div>
                             </div>
-                        </div>
-                        <div class="form-group row">
-                            <label for="destination_city_id" class="col-2 col-form-label text-right text-primary">目的市 *</label>
-                            <div class="col-8 form-inline">
-                                <select class="form-control @error('destination_city_id') is-invalid @enderror" id="destination_city_id" style="width: 30%; "
-                                        :name="waybill.order_id ? '' : 'destination_city_id'" :disabled="!!waybill.order_id"
-                                        :class="errors['destination_city_id'] ? 'is-invalid' :''"  v-model="waybill.destination_city_id">
-                                    <option v-for="city in cities" :value="city.id">@{{city.name}}</option>
-                                </select>
-                                <input v-if="!waybill.order_id" type="text" class="form-control-sm  form-control tooltipTarget" style="vertical-align: middle"
-                                       placeholder="输入关键字定位" @input="destination_city_id" v-model="waybill.destination_city" id="destination_city" title="若无法显示区/县级市,可点击后方按钮手动添加" >
-                                <button v-if="!waybill.order_id" type="button" class="btn btn-outline-info btn-sm" @click="selectedProvince()" style="transform: scale(0.9)">添加城市</button>
+
+                            <div v-if="waybill.type=='专线'">
+                                <div class="form-group row">
+                                    <label for="origination_city_id" class="col-2 col-form-label text-right text-primary">始发市 *</label>
+                                    <div class="col-9 form-inline">
+                                        <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="waybill.origination_city_id" id="origination_city_id">
+                                            <option v-for="city in cities" :value="city.id">@{{city.name}}</option>
+                                        </select>
+                                        <input class="form-control-sm form-control rounded-pill" placeholder="输入关键字定位" @input="origination_city_name">
+                                    </div>
+                                </div>
+                                <div class="form-group row">
+                                    <label for="destination_city_id" class="col-2 col-form-label text-right text-primary">目的市 *</label>
+                                    <div class="col-9 form-inline">
+                                        <select class="form-control @error('destination_city_id') is-invalid @enderror" id="destination_city_id" style="width: 30%; "
+                                                :name="waybill.order_id ? '' : 'destination_city_id'" :disabled="!!waybill.order_id"
+                                                :class="errors['destination_city_id'] ? 'is-invalid' :''"  v-model="waybill.destination_city_id">
+                                            <option v-for="city in cities" :value="city.id">@{{city.name}}</option>
+                                        </select>
+                                        <input v-if="!waybill.order_id" type="text" class="form-control-sm  form-control tooltipTarget rounded-pill" style="vertical-align: middle"
+                                               placeholder="输入关键字定位" @input="destination_city_id" v-model="waybill.destination_city" id="destination_city" title="若无法显示区/县级市,可点击后方按钮手动添加" >
+                                        <button v-if="!waybill.order_id" type="button" class="btn btn-outline-info btn-sm" @click="selectedProvince()" style="transform: scale(0.9)">添加城市</button>
+                                    </div>
+                                </div>
                             </div>
-                        </div>
-                    </div>
-                        <div class="form-group row">
-                            <label for="warehouse_weight" class="col-2 col-form-label text-right " v-if="waybill.type=='专线'">仓库计抛</label>
-                            <div class="col-2" v-if="waybill.type=='专线'">
-                                <input type="text"  class="form-control @error('warehouse_weight') is-invalid @enderror"
-                                       name="warehouse_weight" autocomplete="off" v-model="waybill.warehouse_weight" id="warehouse_weight" >
-                                @error('warehouse_weight')
-                                <span class="invalid-feedback" role="alert">
+                            <div class="form-group row">
+                                <label for="warehouse_weight" class="col-2 col-form-label text-right " v-if="waybill.type=='专线'">仓库计抛</label>
+                                <div class="col-2" v-if="waybill.type=='专线'">
+                                    <input type="text"  class="form-control @error('warehouse_weight') is-invalid @enderror"
+                                           name="warehouse_weight" autocomplete="off" v-model="waybill.warehouse_weight" id="warehouse_weight" >
+                                    @error('warehouse_weight')
+                                    <span class="invalid-feedback" role="alert">
                                     <strong>{{ $message }}</strong>
                                 </span>
-                                @enderror
-                            </div>
-                            <label for="warehouse_weight_unit_id" class=" col-form-label text-right " v-if="waybill.type=='专线'">单位:</label>
-                            <div class="col-1.5" v-if="waybill.type=='专线'">
-                                <select class="form-control @error('warehouse_weight_unit_id') is-invalid @enderror"
-                                        name="warehouse_weight_unit_id" v-model="waybill.warehouse_weight_unit_id" id="warehouse_weight_unit_id">
-                                    <option :value="unit.id" v-for="unit in units" >@{{ unit.name }}</option>
-                                </select>
-                            </div>
-                            <span v-if="waybill.type=='专线'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
-                            <label for="warehouse_weight_other" class="col-form-label text-right " :class="waybill.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" v-model="waybill.warehouse_weight_other"  id="warehouse_weight_other">
-                                @error('warehouse_weight_other')
-                                <span class="invalid-feedback" role="alert">
+                                    @enderror
+                                </div>
+                                <label for="warehouse_weight_unit_id" class=" col-form-label text-right " v-if="waybill.type=='专线'">单位:</label>
+                                <div class="col-1.5" v-if="waybill.type=='专线'">
+                                    <select class="form-control @error('warehouse_weight_unit_id') is-invalid @enderror"
+                                            name="warehouse_weight_unit_id" v-model="waybill.warehouse_weight_unit_id" id="warehouse_weight_unit_id">
+                                        <option :value="unit.id" v-for="unit in units" >@{{ unit.name }}</option>
+                                    </select>
+                                </div>
+                                <span v-if="waybill.type=='专线'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
+                                <label for="warehouse_weight_other" class="col-form-label text-right " :class="waybill.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" v-model="waybill.warehouse_weight_other"  id="warehouse_weight_other">
+                                    @error('warehouse_weight_other')
+                                    <span class="invalid-feedback" role="alert">
                                     <strong>{{ $message }}</strong>
                                 </span>
-                                @enderror
+                                    @enderror
+                                </div>
+                                <label for="warehouse_weight_unit_id_other" class=" col-form-label text-right ">单位:</label>
+                                <div class="col-1.5">
+                                    <select class="form-control @error('warehouse_weight_unit_id_other') is-invalid @enderror"
+                                            name="warehouse_weight_unit_id_other" v-model="waybill.warehouse_weight_unit_id_other" id="warehouse_weight_unit_id_other">
+                                        <option :value="unit.id" v-for="unit in units" >@{{ unit.name }}</option>
+                                    </select>
+                                </div>
                             </div>
-                            <label for="warehouse_weight_unit_id_other" class=" col-form-label text-right ">单位:</label>
-                            <div class="col-1.5">
-                                <select class="form-control @error('warehouse_weight_unit_id_other') is-invalid @enderror"
-                                        name="warehouse_weight_unit_id_other" v-model="waybill.warehouse_weight_unit_id_other" id="warehouse_weight_unit_id_other">
-                                    <option :value="unit.id" v-for="unit in units" >@{{ unit.name }}</option>
-                                </select>
-                            </div>
-                        </div>
-                    <div v-if="waybill.type=='专线'">
-                        <div class="form-group row">
-                            <label for="carrier_weight" class="col-2 col-form-label text-right ">承运商计抛</label>
-                            <div class="col-2">
-                                <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" v-model="waybill.carrier_weight"  >
-                                @error('carrier_weight')
-                                <span class="invalid-feedback" role="alert">
+                            <div v-if="waybill.type=='专线'">
+                                <div class="form-group row">
+                                    <label for="carrier_weight" class="col-2 col-form-label text-right ">承运商计抛</label>
+                                    <div class="col-2">
+                                        <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" v-model="waybill.carrier_weight"  >
+                                        @error('carrier_weight')
+                                        <span class="invalid-feedback" role="alert">
                                     <strong>{{ $message }}</strong>
                                 </span>
-                                @enderror
-                            </div>
-                            <label for="carrier_weight_unit_id" class="col-form-label text-right ">单位:</label>
-                            <div class="col-1.5">
-                                <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="waybill.carrier_weight_unit_id" >
-                                    <option :value="unit.id" v-for="unit in units" >@{{ unit.name }}</option>
-                                </select>
-                            </div>
+                                        @enderror
+                                    </div>
+                                    <label for="carrier_weight_unit_id" class="col-form-label text-right ">单位:</label>
+                                    <div class="col-1.5">
+                                        <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="waybill.carrier_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="carrier_weight_other" class="col-form-label text-right ">承运商计重</label>
-                            <div class="col-2">
-                                <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" v-model="waybill.carrier_weight_other" >
-                                @error('carrier_weight_other')
-                                <span class="invalid-feedback" role="alert">
+                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                                    <label for="carrier_weight_other" class="col-form-label text-right ">承运商计重</label>
+                                    <div class="col-2">
+                                        <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" v-model="waybill.carrier_weight_other" >
+                                        @error('carrier_weight_other')
+                                        <span class="invalid-feedback" role="alert">
                                     <strong>{{ $message }}</strong>
                                 </span>
+                                        @enderror
+                                    </div>
+                                    <label for="carrier_weight_unit_id_other" class=" col-form-label text-right ">单位:</label>
+                                    <div class="col-1.5">
+                                        <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="waybill.carrier_weight_unit_id_other" >
+                                            <option :value="unit.id" v-for="unit in units" >@{{ unit.name }}</option>
+                                        </select>
+                                    </div>
+
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label for="amount" class="col-2 col-form-label text-right text-primary">计数</label>
+                                <div class="col-5">
+                                    <input type="number" class="form-control @error('amount') is-invalid @enderror"
+                                           name="amount" autocomplete="off" v-model="waybill.amount" id="amount">
+                                    @error('amount')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                </div>
+                                <label for="amount_unit_id" class=" col-form-label text-right ">单位:</label>
+                                <div class="col-1.5 form-inline">
+                                    <label for="amount_unit_id" class="ml-1  @error('amount_unit_id') text-danger @enderror"  >件</label>
+                                    <input id="amount_unit_id" type="radio" value="4" class="form-control form-control-sm ml-1"
+                                           name="amount_unit_id" v-model="waybill.amount_unit_id">
+                                    <label for="amount_unit_id1" class="ml-1 @error('amount_unit_id') text-danger @enderror"  >托</label>
+                                    <input id="amount_unit_id1" type="radio" value="5" class="form-control form-control-sm ml-1"
+                                           :class="errors['amount_unit_id'] ? 'is-invalid' :''" name="amount_unit_id" v-model="waybill.amount_unit_id">
+                                </div>
+                                @error('amount_unit_id')
+                                <div class="col-2 form-inline">
+                                    <label class="form-control-static text-danger small font-weight-bold">{{$message}}</label>
+                                </div>
                                 @enderror
                             </div>
-                            <label for="carrier_weight_unit_id_other" class=" col-form-label text-right ">单位:</label>
-                            <div class="col-1.5">
-                                <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="waybill.carrier_weight_unit_id_other" >
-                                    <option :value="unit.id" v-for="unit in units" >@{{ unit.name }}</option>
-                                </select>
+                            <div v-if="waybill.type=='直发车'">
+                                <div class="form-group row">
+                                    <label for="carType_id" class="col-2 col-form-label text-right">车型</label>
+                                    <div class="col-3">
+                                        <select class="form-control" name="carType_id" v-model="waybill.carType_id" id="carType_id">
+                                            <option v-for="carType in carTypes" :value="carType.id">@{{ carType.name }}</option>
+                                        </select>
+                                    </div>
+                                    <label for="car_owner_info" class="col-2 col-form-label text-right">车辆信息</label>
+                                    <div class="col-3">
+                                        <input type="text" class="form-control"
+                                               name="car_owner_info" autocomplete="off" v-model="waybill.car_owner_info" id="car_owner_info" >
+                                    </div>
+                                </div>
+                                @can('运输管理-运单-运费')
+                                    <div class="form-group row">
+                                        <label for="fee" class="col-2 col-form-label text-right text-primary">运费(元) </label>
+                                        <div class="col-8">
+                                            <input type="text" class="form-control @error('fee') is-invalid @enderror"
+                                                   name="fee" autocomplete="off" v-model="waybill.fee" id="fee" >
+                                            @error('fee')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                        </div>
+                                    </div>
+                                @endcan
                             </div>
-
-                        </div>
-                    </div>
-                    <div class="form-group row">
-                        <label for="amount" class="col-2 col-form-label text-right text-primary">计数</label>
-                        <div class="col-5">
-                            <input type="number" class="form-control @error('amount') is-invalid @enderror"
-                                   name="amount" autocomplete="off" v-model="waybill.amount" id="amount">
-                            @error('amount')
-                            <span class="invalid-feedback" role="alert">
-                                <strong>{{ $message }}</strong>
-                            </span>
-                            @enderror
-                        </div>
-                        <label for="amount_unit_id" class=" col-form-label text-right ">单位:</label>
-                        <div class="col-1.5 form-inline">
-                            <label for="amount_unit_id" class="ml-1  @error('amount_unit_id') text-danger @enderror"  >件</label>
-                            <input id="amount_unit_id" type="radio" value="4" class="form-control form-control-sm ml-1"
-                                                         name="amount_unit_id" v-model="waybill.amount_unit_id">
-                            <label for="amount_unit_id1" class="ml-1 @error('amount_unit_id') text-danger @enderror"  >托</label>
-                            <input id="amount_unit_id1" type="radio" value="5" class="form-control form-control-sm ml-1"
-                                                         :class="errors['amount_unit_id'] ? 'is-invalid' :''" name="amount_unit_id" v-model="waybill.amount_unit_id">
-                        </div>
-                        @error('amount_unit_id')
-                        <div class="col-2 form-inline">
-                            <label class="form-control-static text-danger small font-weight-bold">{{$message}}</label>
-                        </div>
-                        @enderror
-
-                    </div>
-                    <div class="form-group row">
-                        <label for="mileage" class="col-2 col-form-label text-right text-dark">里程数</label>
-                        <div class="col-3">
-                            <input type="number" step="0.01" class="form-control @error('mileage') is-invalid @enderror"
-                                   name="mileage" autocomplete="off" v-model="waybill.mileage" id="mileage" >
-                        </div>
-                    </div>
-                    <div v-if="waybill.type=='直发车'">
-                        <div class="form-group row">
-                            <label for="carType_id" class="col-2 col-form-label text-right">车型</label>
-                            <div class="col-3">
-                                <select class="form-control" name="carType_id" style="width: 30%;" v-model="waybill.carType_id" id="carType_id">
-                                    <option v-for="carType in carTypes" :value="carType.id">@{{ carType.name }}</option>
-                                </select>
+                            <div v-if="waybill.type=='专线'">
+                                <div class="form-group row">
+                                    <label for="pick_up_fee" class="col-2 col-form-label text-right">提货费</label>
+                                    <div class="input-group col-3">
+                                        <input type="number" step="0.01" min="0" class="form-control @error('pick_up_fee') is-invalid @enderror"
+                                               name="pick_up_fee" autocomplete="off" v-model="waybill.pick_up_fee"  id="pick_up_fee">
+                                        <div class="input-group-append">
+                                            <span class="input-group-text">元</span>
+                                        </div>
+                                        @error('pick_up_fee')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                    </div>
+                                    <label for="other_fee" class="col-2 col-form-label text-right text-muted">其他支出(元)</label>
+                                    <div class="input-group col-4">
+                                        <input type="number" step="0.01" min="0" class="form-control @error('other_fee') is-invalid @enderror"
+                                               name="other_fee" autocomplete="off" v-model="waybill.other_fee"  id="other_fee">
+                                        <div class="input-group-append">
+                                            <span class="input-group-text">元</span>
+                                        </div>
+                                        @error('other_fee')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                    </div>
+                                </div>
                             </div>
-                            <label for="car_owner_info" class="col-2 col-form-label text-right">车辆信息</label>
-                            <div class="col-3">
-                                <input type="text" class="form-control"
-                                       name="car_owner_info" autocomplete="off" v-model="waybill.car_owner_info" id="car_owner_info" >
+                            <div class="form-group row">
+                                <label for="deliver_at" class="col-2 col-form-label text-right text-muted">发货时间</label>
+                                <div class="col-8 form-inline">
+                                    <input  id="deliver_at_date" @input="spliceDeliverAt" name="deliver_at_date" type="date" class="form-control col-4"
+                                            value="@if(old('deliver_at_date')){{ old('deliver_at_date') }}@else{{$waybill->deliver_at_date}}@endif">
+                                    <input  id="deliver_at_time" @input="spliceDeliverAt" name="deliver_at_time" type="time" class="form-control col-4"
+                                            value="@if(old('deliver_at_time')){{ old('deliver_at_time') }}@else{{$waybill->deliver_at_time}}@endif">
+                                    <input hidden id="deliver_at"  name="deliver_at" type="text" class="form-control col-4">
+                                </div>
                             </div>
-                        </div>
-                        @can('运输管理-运单-运费')
-                        <div class="form-group row">
-                            <label for="fee" class="col-2 col-form-label text-right text-primary">运费(元) </label>
-                            <div class="col-8">
-                                <input type="text" class="form-control @error('fee') is-invalid @enderror"
-                                       name="fee" autocomplete="off" v-model="waybill.fee" id="fee" >
-                                @error('fee')
-                                <span class="invalid-feedback" role="alert">
-                                    <strong>{{ $message }}</strong>
-                                </span>
-                                @enderror
+                            <div class="form-group row">
+                                <label for="dispatch_remark" class="col-2 col-form-label text-right text-muted">调度备注</label>
+                                <div class="col-8">
+                            <textarea class="form-control @error('dispatch_remark') is-invalid @enderror"
+                                      name="dispatch_remark" autocomplete="off"  v-model="waybill.dispatch_remark" id="dispatch_remark"></textarea>
+                                    @error('dispatch_remark')<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>@enderror
+                                </div>
                             </div>
-                        </div>
-                        @endcan
-                    </div>
-                    <div v-if="waybill.type=='专线'">
-                        <div class="form-group row">
-                            <label for="pick_up_fee" class="col-2 col-form-label text-right">提货费(元)</label>
-                            <div class="col-8">
-                                <input type="text" class="form-control @error('pick_up_fee') is-invalid @enderror"
-                                       name="pick_up_fee" autocomplete="off" v-model="waybill.pick_up_fee"  id="pick_up_fee">
-                                @error('pick_up_fee')
-                                <span class="invalid-feedback" role="alert">
-                                    <strong>{{ $message }}</strong>
-                                </span>
-                                @enderror
+                            <div class="form-group row">
+                                <div class="col-8 offset-2">
+                                    <input type="button" @click="submitForm" class="btn btn-success form-control" value="提交">
+                                </div>
                             </div>
                         </div>
-                    </div>
-                    <div class="form-group row">
-                        <label for="other_fee" class="col-2 col-form-label text-right text-muted">其他支出(元)</label>
-                        <div class="col-8">
-                            <input type="text" class="form-control @error('other_fee') is-invalid @enderror"
-                                   name="other_fee" autocomplete="off" v-model="waybill.other_fee"  id="other_fee">
-                            @error('other_fee')
-                            <span class="invalid-feedback" role="alert">
-                                <strong>{{ $message }}</strong>
-                            </span>
-                            @enderror
-                        </div>
-                    </div>
-                    <div class="form-group row">
-                        <label for="deliver_at" class="col-2 col-form-label text-right text-muted">发货时间</label>
-                        <div class="col-8 form-inline">
-                            <input  id="deliver_at_date" @input="spliceDeliverAt" name="deliver_at_date" type="date" class="form-control col-4"
-                                    value="@if(old('deliver_at_date')){{ old('deliver_at_date') }}@else{{$waybill->deliver_at_date}}@endif">
-                            <input  id="deliver_at_time" @input="spliceDeliverAt" name="deliver_at_time" type="time" class="form-control col-4"
-                                    value="@if(old('deliver_at_time')){{ old('deliver_at_time') }}@else{{$waybill->deliver_at_time}}@endif">
-                            <input hidden id="deliver_at"  name="deliver_at" type="text" class="form-control col-4">
-                        </div>
-                    </div>
-                    <div class="form-group row">
-                        <label for="dispatch_remark" class="col-2 col-form-label text-right text-muted">调度备注</label>
-                        <div class="col-8">
-                            <textarea class="form-control @error('dispatch_remark') is-invalid @enderror"
-                                      name="dispatch_remark" autocomplete="off"  v-model="waybill.dispatch_remark" id="dispatch_remark"></textarea>
-                            @error('dispatch_remark')
-                            <span class="invalid-feedback" role="alert">
-                                <strong>{{ $message }}</strong>
+                        <div class="col-6">
+                            <div class="form-group row">
+                                <label for="waybill_number" class="col-2 col-form-label text-right text-secondary">运单号</label>
+                                <div class="col-8">
+                                    <input id="waybill_number" type="text" class="form-control" disabled="disabled" :value="waybill.waybill_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 type="text" class="form-control" disabled="disabled" :value="waybill.owner_name" >
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-2 col-form-label text-right text-secondary">WMS单号</label>
+                                <div class="col-8">
+                                    <input type="text" class="form-control" disabled="disabled" :value="waybill.wms_bill_number" >
+                                </div>
+                            </div>
+                            <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="waybill.origination='上海市松江区泗砖仓'" style="transform: scale(0.9)">松江泗砖仓</button>
+                                    <button type="button" class="btn btn-outline-primary btn-sm" @click="waybill.origination='上海市松江区九干仓'" style="transform: scale(0.9)">松江九干仓</button>
+                                    <button type="button" class="btn btn-outline-primary btn-sm" @click="waybill.origination='上海市嘉定区武乡仓'" style="transform: scale(0.9)">嘉定武乡仓</button>
+                                </div>
+                                <div class="form-group row">
+                                    <label  class="col-2 col-form-label text-right text-secondary" for="origination_seek">始发地</label>
+                                    <div class="col-8">
+                                        <input type="text" class="form-control @error('origination') is-invalid @enderror"
+                                               id="origination_seek" name="origination" disabled="disabled" v-model="waybill.origination">
+                                    </div>
+                                    @error('origination')
+                                    <span class="invalid-feedback" role="alert">
+                                    <strong>{{ $message }}</strong>
                             </span>
-                            @enderror
+                                    @enderror
+                                </div>
+                            </div>
+                            <div class="form-group row">
+                                <label class="col-2 col-form-label text-right text-secondary" for="destination_seek">目的地</label>
+                                <div class="col-8">
+                                    <input id="destination_seek" type="text" class="form-control" disabled="disabled" :value="waybill.destination" >
+                                </div>
+                            </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" disabled="disabled" :value="waybill.recipient" >
+                                </div>
+                            </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" 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>
                     </div>
                     <input type="hidden" name="status" value="待终审">
                     <input type="hidden" name="waybillPriceModel" id="waybillPriceModel">
                     <input type="hidden" name="order_id" :value="waybill.order_id">
-                    <div class="form-group row">
-                        <div class="col-8 offset-2">
-                            <input type="button" @click="submitForm" class="btn btn-outline-dark form-control" value="提交">
-                        </div>
-                    </div>
                 </form>
             </div>
         </div>
@@ -441,7 +472,7 @@
                     id:'{{$waybill->id}}',
                     waybill_number:'{{$waybill->waybill_number}}',
                     order_id:'{{$waybill->order_id}}',
-                    owner_name:'{{$waybill->order->owner->name ?? $waybill->owner->name}}',
+                    owner_name:'{{ $waybill->merge_owner ?: ($waybill->order->owner->name ?? $waybill->owner->name)}}',
                     wms_bill_number:'{{$waybill->wms_bill_number}}',origination:'{{$waybill->origination}}',
                     destination:'{{$waybill->order->address ?? $waybill->destination}}',
                     recipient:'{{$waybill->order->consignee_name ?? $waybill->recipient}}',
@@ -449,7 +480,7 @@
 
                     charge:'{{ old("charge") ?? $waybill->charge}}',
                     logistic_id:'{{old("logistic_id") ?? $waybill->logistic_id}}',
-                    carrier_bill:'{{ old("carrier_bill") ?? $waybill->carrier_bill}}',
+                    carrier_bill:'{{old("carrier_bill") ?? $waybill->carrier_bill}}',
                     type:'{{ old("type") ?? $waybill->type}}',
                     warehouse_weight_other:'{{ old("warehouse_weight_other") ?? $waybill->warehouse_weight_other}}',
                     warehouse_weight_unit_id_other:'{{ old("warehouse_weight_unit_id_other") ?? $waybill->warehouse_weight_unit_id_other }}',
@@ -477,10 +508,20 @@
                     total_number: '{{ old("total_number") ?? $waybill->total_number}}',
                     total_weight: '{{ old("total_weight") ?? $waybill->total_weight}}',
                     deliveryType_id: '{{ old("deliveryType_id") ?? $waybill->deliveryType_id}}',
+                    order_type: '{{ old("order_type") ?? $waybill->order_type}}',
+                    transport_type: '{{ old("transport_type") ?? $waybill->transport_type}}',
+                    pay_type: '{{ old("pay_type") ?? $waybill->pay_type}}',
+                    back_sign_bill: '{{ old("back_sign_bill") ?? $waybill->back_sign_bill}}',
+                    package_service: '{{ old("package_service") ?? $waybill->package_service}}',
                 },
                 order:{!! $waybill->order ?? '{}' !!},
                 waybillTemp:{!! $waybill !!},
                 provinces : [],
+                orderTypes:{!! $orderTypes !!},
+                transportTypes:{!! $transportTypes !!},
+                payTypes:{!! $payTypes !!},
+                backSignBills:{!! $backSignBills !!},
+                packageServices:{!! $packageServices !!}
             },
             mounted:function(){
                 let _this=this;
@@ -579,15 +620,16 @@
             },
             methods:{
                 {{--计费模型阶段保留--}}
-                is_waybillPriceModel(logistic_id,carrier_weight,carrier_weight_unit_id,destination_city_id,carrier_weight_other,carrier_weight_unit_id_other,cargo_name,total_number,total_weight,deliveryType_id){
+                is_waybillPriceModel(logistic_id,carrier_weight,carrier_weight_unit_id,destination_city_id,carrier_weight_other,carrier_weight_unit_id_other,cargo_name,total_number,total_weight,deliveryType_id,order_type,transport_type,pay_type,back_sign_bill,package_service){
                     this.errors=[];
                     let url='{{url('transport/waybill/is/waybillPriceModel')}}';
 
                     let _this=this;
                     axios.post(url,{logistic_id:logistic_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,
-                        cargo_name:cargo_name, total_number:total_number,total_weight:total_weight, deliveryType_id:deliveryType_id})
-                        .then(
+                        cargo_name:cargo_name, total_number:total_number,total_weight:total_weight, deliveryType_id:deliveryType_id
+                        ,order_type:order_type, transport_type: transport_type, pay_type:pay_type, back_sign_bill:back_sign_bill,package_service:package_service
+                    }).then(
                             function (response) {
 
                                 if (response.data.error){
@@ -612,18 +654,23 @@
                     document.getElementById('waybillForm').submit();
                 },
                 spliceDeliverAt:function () {
-                        document.getElementById('deliver_at').value= document.getElementById('deliver_at_date').value+' '+ document.getElementById('deliver_at_time').value;
+                    document.getElementById('deliver_at').value= document.getElementById('deliver_at_date').value+' '+ document.getElementById('deliver_at_time').value;
                 },
                 submitForm(){
                     let type=this.waybill.type;
                     let  logistic_id=document.getElementById('logistic_id').value;
                     let carrier_weight = '',carrier_weight_unit_id='',destination_city_id='',carrier_weight_other='',carrier_weight_unit_id_other='',
-                        cargo_name = '',total_number='',total_weight='',deliveryType_id='';
-                    if ( $.inArray(logistic_id, ['14','15','28','29']) >= 0 ){
+                        cargo_name = '',total_number='',total_weight='',deliveryType_id='',order_type='',transport_type='',pay_type='',back_sign_bill='',package_service='';
+                    if ( logistic_id == 15 ){
                         cargo_name=document.getElementById('cargo_name').value;
                         total_number=document.getElementById('total_number').value;
                         total_weight=document.getElementById('total_weight').value;
                         deliveryType_id=document.getElementById('deliveryType_id').value;
+                        order_type=document.getElementById('order_type').value;
+                        transport_type=document.getElementById('transport_type').value;
+                        pay_type=document.getElementById('pay_type').value;
+                        back_sign_bill=document.getElementById('back_sign_bill').value;
+                        package_service=document.getElementById('package_service').value;
                     }
                     if (type==='专线'){
                         carrier_weight=document.getElementById('carrier_weight').value;
@@ -631,9 +678,15 @@
                         destination_city_id=document.getElementById('destination_city_id').value;
                         carrier_weight_other=document.getElementById('carrier_weight_other').value;
                         carrier_weight_unit_id_other=document.getElementById('carrier_weight_unit_id_other').value;
-                        this.is_waybillPriceModel(logistic_id,carrier_weight,carrier_weight_unit_id,destination_city_id,carrier_weight_other,carrier_weight_unit_id_other,cargo_name,total_number,total_weight,deliveryType_id);
+                        this.is_waybillPriceModel(logistic_id,carrier_weight,carrier_weight_unit_id,destination_city_id,
+                            carrier_weight_other,carrier_weight_unit_id_other,cargo_name,total_number,total_weight,
+                            deliveryType_id,order_type,transport_type,pay_type,back_sign_bill,package_service
+                        );
                     } else {
-                        this.is_waybillPriceModel(logistic_id,carrier_weight,carrier_weight_unit_id,destination_city_id,carrier_weight_other,carrier_weight_unit_id_other,cargo_name,total_number,total_weight,deliveryType_id);
+                        this.is_waybillPriceModel(logistic_id,carrier_weight,carrier_weight_unit_id,destination_city_id,
+                            carrier_weight_other,carrier_weight_unit_id_other,cargo_name,total_number,total_weight,
+                            deliveryType_id,order_type,transport_type,pay_type,back_sign_bill,package_service
+                        );
                         document.getElementById('deliver_at').value= document.getElementById('deliver_at_date').value+' '+ document.getElementById('deliver_at_time').value;
                         this.executeSubmit();
                     }
@@ -654,11 +707,11 @@
                     let val=e.target.value;
                     if (!val)this. waybill.destination_city_id='';
                     else this.cities.some((city)=> {
-                            if (city.name.includes(val)){
-                                this.waybill.destination_city_id=city.id;
-                                return true;
-                            }
-                        });
+                        if (city.name.includes(val)){
+                            this.waybill.destination_city_id=city.id;
+                            return true;
+                        }
+                    });
                 },
                 selectedProvince(){
                     if (this.waybill.order_id)return;
@@ -668,20 +721,20 @@
                         return;
                     }
                     window.tempTip.postBasicRequest("{{url('maintenance/region/getProvinces')}}",{},res=>{
-                       this.provinces = res;
+                        this.provinces = res;
                         $("#selectedProvince").modal("show");
                     });
                 },
                 addCounty:function () {
                     window.tempTip.postBasicRequest("{{url('transport/waybill/addCounty')}}",
                         {name:this.waybill.destination_city,province:this.waybill.province},res=>{
-                        this.cities.push({
-                            id:res.id,
-                            name:res.name,
+                            this.cities.push({
+                                id:res.id,
+                                name:res.name,
+                            });
+                            this.waybill.destination_city_id = res.id;
+                            $("#selectedProvince").modal("hide");
                         });
-                        this.waybill.destination_city_id = res.id;
-                        $("#selectedProvince").modal("hide");
-                    });
                 }
             },
         });

+ 3 - 0
resources/views/transport/waybill/index.blade.php

@@ -18,6 +18,9 @@
                         <li class="nav-item">
                             <a target="transport/waybill/index" class="nav-link @if($uriType=='直发车') active @endif" href="{{url('transport/waybill/index?uriType=直发车')}}">直发车</a>
                         </li>
+                        <li class="nav-item">
+                            <a target="transport/waybill/index" class="nav-link @if($uriType=='德邦物流') active @endif" href="{{url('transport/waybill/index?uriType=德邦物流')}}">德邦物流</a>
+                        </li>
                     </ul>
                 </div>
             </div>