From ad6d70a0a274dd3c99c2d70dba693dcd0f6bae5a Mon Sep 17 00:00:00 2001 From: limeng <1131177064@qq.com> Date: Sun, 11 Oct 2026 11:55:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E7=AD=BE=E7=BD=B2=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=88=E4=BD=9C=E6=96=B9=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=8E=E4=BE=9B=E5=BA=94=E5=95=86=E5=BE=85=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 合作方类型与供应商待接入展示;53 项测试、825 条断言通过。 --- .../Business/CourierAgreementSignatures.php | 8 ++ .../Business/CourierAgreementSignature.php | 14 +++ .../agreement-signing.blade.php | 109 ++++++++++++++++-- .../Business/AgreementSigningPageTest.php | 7 ++ .../CourierAgreementSignatureWorkflowTest.php | 30 +++++ 5 files changed, 158 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/Business/CourierAgreementSignatures.php b/app/Http/Controllers/Business/CourierAgreementSignatures.php index 054150b9..41c30f6d 100644 --- a/app/Http/Controllers/Business/CourierAgreementSignatures.php +++ b/app/Http/Controllers/Business/CourierAgreementSignatures.php @@ -37,6 +37,13 @@ class CourierAgreementSignatures extends Controller public function store(Request $request): RedirectResponse { $this->ensureCanManage(); + $request->merge(['partner_type' => $request->input('partner_type', 'courier')]); + $request->validate(['partner_type' => ['required', 'in:courier,supplier']]); + if ($request->input('partner_type') === 'supplier') { + throw ValidationException::withMessages([ + 'partner_type' => '供应商资料尚未接入,暂不能发起供应商签署。请在资料接入后选择供应商。', + ]); + } abort_unless(EsignClient::configured(), 422, 'E 签宝沙箱尚未配置 App ID 或 AppSecret。'); $requestedType = (string) $request->input('document_type'); if ($requestedType === 'quote-confirmation') { @@ -405,6 +412,7 @@ class CourierAgreementSignatures extends Controller $date = ['required', 'date', 'after_or_equal:today', 'before_or_equal:' . now()->addDays(90)->toDateString()]; return [ + 'partner_type' => ['required', 'in:courier,supplier'], 'idempotency_key' => ['required', 'string', 'max:80', 'regex:/^[A-Za-z0-9_-]+$/'], 'courier_name' => ['required', 'string', 'max:255'], 'document_type' => ['required', 'in:' . implode(',', array_keys(CourierAgreementSignature::DOCUMENTS))], diff --git a/app/Models/Business/CourierAgreementSignature.php b/app/Models/Business/CourierAgreementSignature.php index ce9b63a8..b99823fe 100644 --- a/app/Models/Business/CourierAgreementSignature.php +++ b/app/Models/Business/CourierAgreementSignature.php @@ -4,6 +4,7 @@ namespace App\Models\Business; use App\Abstracts\Model; use App\Support\EsignErrorMessage; +use Illuminate\Contracts\Encryption\DecryptException; class CourierAgreementSignature extends Model { @@ -86,6 +87,19 @@ class CourierAgreementSignature extends Model 'operator_account' => 'encrypted', ]; + public function partnerTypeLabel(): string + { + // Records created before partner types were introduced are courier tasks. + try { + $partnerType = $this->payload['partner_type'] ?? 'courier'; + } catch (DecryptException) { + // Keep legacy rows with unreadable encrypted payloads renderable. + $partnerType = 'courier'; + } + + return $partnerType === 'supplier' ? '供应商' : '快递公司'; + } + public function statusLabel(): string { return match ($this->status) { diff --git a/resources/views/business/pages/courier-payables/agreement-signing.blade.php b/resources/views/business/pages/courier-payables/agreement-signing.blade.php index 20d2449b..d9a6bf50 100644 --- a/resources/views/business/pages/courier-payables/agreement-signing.blade.php +++ b/resources/views/business/pages/courier-payables/agreement-signing.blade.php @@ -937,6 +937,17 @@ font-size: 17px; } + .agreement-partner-types { + margin: 0; + padding: 0; + border: 0; + min-width: 0; + } + + .agreement-partner-types legend { + margin-bottom: 0.5rem; + } + .agreement-archive-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); @@ -1334,7 +1345,7 @@
供应商资料尚未接入,暂不能选择或发起签署。接入后显示供应商简称,并在下方展示企业全称和编码供核对。
+