@php($agreementTasks = $agreementTasks ?? collect()) @php($agreementQuoteSignatures = $agreementQuoteSignatures ?? collect()) @php($agreementSubjects = $agreementSubjects ?? collect()) @php($agreementCourierNames = collect($agreementCourierNames ?? [])) @php($agreementCourierAccounts = $agreementCourierAccounts ?? []) @php($agreementSupplierOptions = $agreementSupplierOptions ?? []) @php($supplierContractTemplates = \App\Support\SupplierCooperationTemplates::TEMPLATES) @php($supplierContractRequestKey = (string) \Illuminate\Support\Str::uuid()) @php($agreementQuoteVersions = $agreementQuoteVersions ?? collect()) @php($agreementCooperationSecondaryEsignAccount = '18052733960') @php($agreementDefaultSubject = $agreementSubjects->firstWhere('is_default', true) ?: $agreementSubjects->first()) @php($agreementCompanyName = $agreementDefaultSubject?->name ?: company()?->name ?: '当前公司') @php($agreementSubjectPayload = $agreementSubjects->map(fn ($subject) => ['id' => $subject->id, 'name' => $subject->name, 'unified_social_credit_code' => $subject->unified_social_credit_code, 'is_default' => (bool) $subject->is_default])->values()) @php($esignConfigured = \App\Services\Esign\EsignClient::configured()) @php($agreementSearch = trim((string) request('agreement_search', ''))) @php($agreementStatus = trim((string) request('agreement_status', ''))) @php($agreementType = trim((string) request('agreement_type', ''))) @php($agreementScope = trim((string) request('agreement_scope', $agreementStatus === 'archived' ? 'archived' : 'active'))) @php($agreementScope = in_array($agreementScope, ['active', 'archived', 'all'], true) ? $agreementScope : 'active') @php($agreementFiltersActive = $agreementSearch !== '' || $agreementStatus !== '' || $agreementType !== '')
{{ $esignConfigured ? 'E签宝已连接 · ' . (config('services.esign.environment', 'sandbox') === 'production' ? '正式' : '沙箱') : 'E签宝未连接' }}
@php($scopeQuery = request()->except(['agreement_scope', 'agreement_status', 'agreement_task_page', 'agreement_quote_page']))
@foreach ($agreementQuoteSignatures as $quoteSignature) @php($quoteVersion = $quoteSignature->version) @php($quoteError = $quoteSignature->lastErrorSummary()) @endforeach @foreach ($agreementTasks as $task) @php($taskError = $task->lastErrorSummary()) @php($taskFailed = $task->status === 'failed' || ($task->status === 'unknown' && $task->hasDefinitiveFailure())) @endforeach @if ($agreementTasks->isEmpty() && $agreementQuoteSignatures->isEmpty()) @endif
任务编号 合作方类型 合作方名称 业务类型 签署状态 发起人 更新时间 操作
{{ $quoteVersion?->version_code ?? ('报价版本 #' . $quoteSignature->quote_version_id) }} 快递公司 {{ $quoteVersion?->carrier_name ?? $quoteSignature->organization_name }} 报价确认单 {{ $quoteSignature->statusLabel() }} @if ($quoteSignature->status === 'archived') 归档时间{{ optional($quoteSignature->archived_at)->format('Y-m-d H:i') ?: '时间未知' }} 归档说明签署完成后自动归档 @endif @if ($quoteError) {{ $quoteError }} @endif {{ $agreementCompanyName }} {{ optional($quoteSignature->updated_at)->format('Y-m-d H:i') }} @if ($quoteSignature->esign_sign_flow_id && ! in_array($quoteSignature->status, ['archived', 'rejected', 'expired', 'revoked'], true))
@csrf
@endif @if ($quoteSignature->source_pdf_path) @endif @if ($quoteSignature->signed_pdf_path) @endif @if ($quoteSignature->certificate_path) @endif
@csrf @method('DELETE')
{{ $task->business_no }} {{ $task->partnerTypeLabel() }} {{ $task->courier_name }} {{ $task->documentLabel() }} {{ $task->statusLabel() }} @if ($task->status === 'archived') 归档时间{{ optional($task->archived_at)->format('Y-m-d H:i') ?: '时间未知' }} 归档说明{{ $task->archiveReason() ?: '未记录说明' }} @endif @if ($taskError) {{ $taskError }} @endif {{ $task->initiatorName() }} {{ optional($task->updated_at)->format('Y-m-d H:i') }} @if ($task->esign_sign_flow_id && ! in_array($task->status, ['archived', 'rejected', 'expired', 'revoked'], true))
@csrf
@endif @if ($task->status === 'completed' && $task->remote_status === '2' && $task->archiveMode() === 'manual')
@csrf
@endif @if ($task->source_pdf_path) @endif @if ($task->signed_pdf_path) @endif @if ($task->certificate_path) @endif
@csrf @method('DELETE')
@if ($agreementFiltersActive) 没有匹配的签署任务

请调整筛选条件后重新查询。

@else {{ $agreementScope === 'archived' ? '还没有已归档任务' : ($agreementScope === 'active' ? '暂无待处理任务' : '还没有协议签署任务') }}

{{ $agreementScope === 'archived' ? '完成归档后可在这里检索和下载签署文件。' : '可新建签署任务,或在“全部任务”和“已归档”中查找历史文件。' }}

@endif
@php($taskTotal = method_exists($agreementTasks, 'total') ? $agreementTasks->total() : $agreementTasks->count()) @php($quoteTotal = method_exists($agreementQuoteSignatures, 'total') ? $agreementQuoteSignatures->total() : $agreementQuoteSignatures->count()) @php($taskPages = method_exists($agreementTasks, 'lastPage') ? $agreementTasks->lastPage() : 0) @php($quotePages = method_exists($agreementQuoteSignatures, 'lastPage') ? $agreementQuoteSignatures->lastPage() : 0)
共 {{ $taskTotal + $quoteTotal }} 条 · 协议任务 {{ $taskTotal }} 条,报价确认单 {{ $quoteTotal }} 条 @if (method_exists($agreementTasks, 'links') && $taskPages > 1) 协议任务分页:{{ $agreementTasks->links() }} @endif @if (method_exists($agreementQuoteSignatures, 'links') && $quotePages > 1) 报价确认单分页:{{ $agreementQuoteSignatures->links() }} @endif
签署完成只生成可核验的电子协议,不会自动启用新收款账户;账户变更仍需独立财务复核和原档案电话核验。