From 2b723d88e6019f696dfec41de11fad16e9f4b863 Mon Sep 17 00:00:00 2001 From: limeng <1131177064@qq.com> Date: Fri, 28 Aug 2026 17:33:05 +0800 Subject: [PATCH] feat: add cooperation contract signing template --- .../Business/CourierAgreementSignatures.php | 8 +- .../Business/CourierAgreementSignature.php | 6 ++ app/Support/CourierAgreementPdf.php | 1 + .../CourierAgreementSignatureService.php | 17 ++++ .../agreement-signing.blade.php | 85 +++++++++++++++++-- .../business/pdf/courier-agreement.blade.php | 54 ++++++++++++ .../Business/AgreementSigningPageTest.php | 7 ++ .../CourierAgreementSignatureWorkflowTest.php | 46 ++++++++++ 8 files changed, 216 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Business/CourierAgreementSignatures.php b/app/Http/Controllers/Business/CourierAgreementSignatures.php index a7f382719..7f156c36f 100644 --- a/app/Http/Controllers/Business/CourierAgreementSignatures.php +++ b/app/Http/Controllers/Business/CourierAgreementSignatures.php @@ -182,7 +182,7 @@ class CourierAgreementSignatures extends Controller 'company_full_name' => ['required', 'string', 'min:2', 'max:255'], 'signing_deadline' => $date, 'esign_account' => ['required', 'string', 'max:255'], - 'secondary_esign_account' => ['required_if:document_type,entity-change,authorization', 'nullable', 'string', 'max:255'], + 'secondary_esign_account' => ['required_if:document_type,entity-change,cooperation-contract,authorization', 'nullable', 'string', 'max:255'], 'operator_name' => ['nullable', 'string', 'max:100'], 'archive_mode' => ['required', 'in:auto,manual'], 'account_proof_effective_date' => ['required_if:document_type,account-proof', 'date'], @@ -205,6 +205,12 @@ class CourierAgreementSignatures extends Controller 'contract_partner_name' => ['required_if:document_type,shared-contract', 'string', 'max:255'], 'shared_courier_name' => ['required_if:document_type,shared-contract', 'string', 'max:255'], 'shared_proof_date' => ['required_if:document_type,shared-contract', 'date'], + 'cooperation_party_a_name' => ['required_if:document_type,cooperation-contract', 'string', 'max:255'], + 'cooperation_party_a_phone' => ['required_if:document_type,cooperation-contract', 'string', 'max:64'], + 'cooperation_party_b_name' => ['required_if:document_type,cooperation-contract', 'string', 'max:255'], + 'cooperation_party_b_phone' => ['required_if:document_type,cooperation-contract', 'string', 'max:64'], + 'cooperation_start_date' => ['required_if:document_type,cooperation-contract', 'date'], + 'cooperation_end_date' => ['required_if:document_type,cooperation-contract', 'date', 'after_or_equal:cooperation_start_date'], 'principal_name' => ['required_if:document_type,authorization', 'string', 'max:100'], 'principal_id_number' => ['required_if:document_type,authorization', 'string', 'max:64'], 'trustee_name' => ['required_if:document_type,authorization', 'string', 'max:100'], diff --git a/app/Models/Business/CourierAgreementSignature.php b/app/Models/Business/CourierAgreementSignature.php index 3ee622405..285c760ed 100644 --- a/app/Models/Business/CourierAgreementSignature.php +++ b/app/Models/Business/CourierAgreementSignature.php @@ -42,6 +42,12 @@ class CourierAgreementSignature extends Model 'name' => '共用合同证明', 'file' => '共用合同证明.docx', ], + 'cooperation-contract' => [ + 'code' => 'TPL-COOPERATION-CONTRACT-V1', + 'version' => '1', + 'name' => '合作合同', + 'file' => '保丟不保损-合同发快递2024.8.doc', + ], 'authorization' => [ 'code' => 'TPL-AUTHORIZATION-V1', 'version' => '1', diff --git a/app/Support/CourierAgreementPdf.php b/app/Support/CourierAgreementPdf.php index 19d76f929..d64ae5029 100644 --- a/app/Support/CourierAgreementPdf.php +++ b/app/Support/CourierAgreementPdf.php @@ -36,6 +36,7 @@ final class CourierAgreementPdf 'account-change' => '收款帐户资料变更证明', 'entity-change' => '公司主体变更证明', 'shared-contract' => '证明', + 'cooperation-contract' => '服务协议', default => '授权委托书', }; } diff --git a/app/Support/CourierAgreementSignatureService.php b/app/Support/CourierAgreementSignatureService.php index e573a3f5d..967a28a40 100644 --- a/app/Support/CourierAgreementSignatureService.php +++ b/app/Support/CourierAgreementSignatureService.php @@ -278,6 +278,23 @@ final class CourierAgreementSignatureService 'operator_account' => $signature->operator_account, ]; + if ($signature->document_type === 'cooperation-contract') { + return [ + [ + 'signer_type' => 1, + 'organization_name' => $payload['cooperation_party_a_name'] ?? $signature->company_full_name, + 'operator_name' => $payload['cooperation_party_a_name'] ?? $signature->company_full_name, + 'operator_account' => $payload['secondary_esign_account'] ?? $signature->operator_account, + ], + [ + 'signer_type' => 1, + 'organization_name' => $payload['cooperation_party_b_name'] ?? $signature->courier_name, + 'operator_name' => $signature->operator_name ?: ($payload['cooperation_party_b_name'] ?? $signature->courier_name), + 'operator_account' => $signature->operator_account, + ], + ]; + } + if ($signature->document_type === 'entity-change') { return [ array_merge($primary, ['organization_name' => $payload['former_company_name'] ?? $signature->organization_name]), 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 c6812f983..5d489f5cd 100644 --- a/resources/views/business/pages/courier-payables/agreement-signing.blade.php +++ b/resources/views/business/pages/courier-payables/agreement-signing.blade.php @@ -918,6 +918,21 @@ gap: 0.5rem; } + .agreement-preview-parties { + display: grid; + gap: 0.45rem; + margin: 1.5rem 0; + padding: 0.85rem 1rem; + border: 1px solid #E3DED4; + border-radius: 8px; + background: #FAF9F6; + } + + .agreement-preview-party-phone { + display: inline-block; + margin-left: 2rem; + } + .agreement-preview-value { min-width: 2.5rem; padding: 0 0.2rem; @@ -1108,6 +1123,7 @@ + @@ -1221,6 +1237,7 @@ + @@ -1266,8 +1283,8 @@ @@ -1366,6 +1383,33 @@ + +