can('dcat.admin.after_sales.shipping'); } /** * Handle the form request. * * @param array $input * * @return mixed */ public function handle(array $input) { $afterSaleService = new AfterSaleService(); try { DB::beginTransaction(); $afterSale = AfterSale::where('state', AfterSale::STATE_SHIPPING)->findOrFail($this->payload['id']); $afterSaleService->shippingFill($afterSale, $input['remarks']); DB::commit(); } catch (Throwable $th) { DB::rollBack(); report($th); return $this->response()->error('操作失败:'.$th->getMessage()); } return $this->response() ->success(__('admin.update_succeeded')) ->refresh(); } /** * Build a form here. */ public function form() { $this->text('remarks', '填写补货物流单号')->required(); $this->confirm('是否确认补货完成', '该操作不可逆,确认后将完成该售后单。'); } }