|
|
@@ -843,10 +843,16 @@ SQL;
|
|
|
if (count($errors)>0)return ["errors"=>$errors];
|
|
|
$waybill=Waybill::query()->find($request->input('id'));
|
|
|
if (!$waybill)return ["error"=>"未找到该运单!"];
|
|
|
- $request->offsetSet("carrier_weight_unit_id",$unit2);
|
|
|
- $request->offsetSet("carrier_weight_unit_id_other",$unit);
|
|
|
- $request->offsetSet("amount_unit_id",$unit1);
|
|
|
+ $request->offsetSet("carrier_weight_unit_id",$unit2->id);
|
|
|
+ $request->offsetSet("carrier_weight_unit_id_other",$unit->id);
|
|
|
+ $request->offsetSet("amount_unit_id",$unit1->id);
|
|
|
+ $request->offsetSet("status","待终审");
|
|
|
$waybill->fill($request->input());
|
|
|
+ WaybillAuditLog::query()->create([
|
|
|
+ 'waybill_id'=>$waybill->id,
|
|
|
+ 'audit_stage'=>'调度阶段',
|
|
|
+ 'user_id'=>Auth::id(),
|
|
|
+ ]);
|
|
|
$waybill->update();
|
|
|
return $waybill;
|
|
|
}
|
|
|
@@ -1253,7 +1259,6 @@ SQL;
|
|
|
$logistics = app("LogisticService")->getSelection(['id','name','tag'],"物流");
|
|
|
return view("transport.waybill.android.shipment",compact("logistics"));
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
* 发货与合并
|
|
|
*/
|
|
|
@@ -1280,8 +1285,7 @@ SQL;
|
|
|
|| $item->order->consignee_phone!=$waybill->order->consignee_phone
|
|
|
|| $item->order->address!=$waybill->order->address)) ||
|
|
|
(!$waybill->order && ($item->recipient!=$waybill->recipient
|
|
|
- || $item->recipient_mobile!=$waybill->recipient_mobile
|
|
|
- || $item->destination!=$waybill->destination));
|
|
|
+ || $item->recipient_mobile!=$waybill->recipient_mobile));
|
|
|
if ($identical)$this->error("订单信息不一致,无法统一发货");
|
|
|
$destroys[] = $item->id;
|
|
|
$waybill->source_bill .= $item->source_bill ? ",".$item->source_bill : '';
|
|
|
@@ -1298,6 +1302,7 @@ SQL;
|
|
|
$owner = array_unique($owner);
|
|
|
if (count($owner)>1)$waybill->merge_owner = implode(',',$owner);
|
|
|
$waybill->deliver_at = date("Y-m-d H:i:s");
|
|
|
+ $waybill->logistic_id = \request("logistic");
|
|
|
if ($waybill->status=='未审核')$waybill->status = '已审核';
|
|
|
$waybill->update();
|
|
|
Waybill::destroy($destroys);
|