保留各家工作表报价原文、公式、独立执行日期及签署原件;审核后按执行日期管理版本。33项测试、336项断言通过。生产业务迁移已获明确授权,服务器私有备份已完成并逐条校验。
147 lines
7.7 KiB
PHP
147 lines
7.7 KiB
PHP
<!doctype html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<title>报价确认单 {{ $version->version_code }}</title>
|
||
<style>
|
||
@font-face { font-family: "Droid Sans Fallback"; font-style: normal; font-weight: 400; src: url("file://{{ $fontPath }}") format("truetype"); }
|
||
@page { margin: 18mm 14mm 16mm; }
|
||
* { box-sizing: border-box; }
|
||
body { margin: 0; color: #171717; font-family: "Droid Sans Fallback", sans-serif; font-size: 9px; line-height: 1.45; }
|
||
.latin { font-family: "DejaVu Sans", sans-serif; }
|
||
h1, h2, p, dl, dd { margin: 0; }
|
||
h1 { font-size: 20px; font-weight: 400; }
|
||
h2 { margin: 16px 0 7px; border-bottom: 1px solid #9b7a3f; padding-bottom: 4px; color: #6f5426; font-size: 12px; font-weight: 400; }
|
||
.heading { display: table; width: 100%; border-bottom: 2px solid #171717; padding-bottom: 10px; }
|
||
.heading__title, .heading__mark { display: table-cell; vertical-align: bottom; }
|
||
.heading__mark { color: #6b6b6b; text-align: right; }
|
||
.meta { display: table; width: 100%; margin-top: 12px; table-layout: fixed; }
|
||
.meta__item { display: table-cell; border-left: 2px solid #b69455; padding: 2px 9px; }
|
||
.meta dt { color: #666; font-size: 8px; }
|
||
.meta dd { margin-top: 2px; font-size: 10px; }
|
||
.details { width: 100%; margin-top: 12px; border-collapse: collapse; table-layout: fixed; }
|
||
.details th, .details td { border: 1px solid #cfcfcf; padding: 5px 7px; vertical-align: middle; }
|
||
.details th { width: 11%; background: #eee8db; font-weight: 400; white-space: nowrap; }
|
||
.details td { width: 22%; }
|
||
.notice { margin-top: 12px; border: 1px solid #c9b27f; background: #faf6ea; padding: 7px 9px; color: #5c451e; }
|
||
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
|
||
th, td { overflow-wrap: anywhere; border: 1px solid #cfcfcf; padding: 4px 5px; text-align: left; vertical-align: top; }
|
||
th { background: #eee8db; font-weight: 400; }
|
||
.number { text-align: right; }
|
||
.matrix { font-size: 7.5px; table-layout: auto; }
|
||
.matrix th, .matrix td { max-width: 90px; padding: 3px 4px; }
|
||
.formula { color: #735c31; font-size: 7px; }
|
||
.summary { white-space: pre-wrap; }
|
||
.signature { page-break-before: always; }
|
||
.signature h2 { margin-top: 0; }
|
||
.signature__meta { margin-bottom: 18px; color: #555; }
|
||
.signature__box { width: 360px; margin-left: auto; padding: 14px 16px; color: #666; page-break-inside: avoid; }
|
||
.signature__blank { height: 240px; }
|
||
.document-control { margin-top: 22px; border-top: 1px solid #bbb; padding-top: 6px; color: #777; font-size: 7.5px; text-align: right; }
|
||
</style>
|
||
</head>
|
||
<body>
|
||
@php
|
||
$mixedText = static function ($value): string {
|
||
$parts = preg_split('/([\x20-\x7E]+)/', (string) $value, -1, PREG_SPLIT_DELIM_CAPTURE) ?: [];
|
||
|
||
return implode('', array_map(static function (string $part): string {
|
||
$escaped = e($part);
|
||
|
||
return preg_match('/^[\x20-\x7E]+$/', $part) === 1
|
||
? '<span class="latin">' . $escaped . '</span>'
|
||
: $escaped;
|
||
}, $parts));
|
||
};
|
||
@endphp
|
||
<header class="heading">
|
||
<div class="heading__title">
|
||
<h1>报价确认单</h1>
|
||
<p>{!! $mixedText($version->carrier_name) !!} · {!! $mixedText($version->quote_type) !!}</p>
|
||
</div>
|
||
<div class="heading__mark">不可覆盖版本:{!! $mixedText($version->version_code) !!}</div>
|
||
</header>
|
||
|
||
<dl class="meta">
|
||
<div class="meta__item"><dt>快递公司</dt><dd>{!! $mixedText($version->carrier_name) !!}</dd></div>
|
||
<div class="meta__item"><dt>报价版本</dt><dd>{!! $mixedText($version->version_code) !!}</dd></div>
|
||
<div class="meta__item"><dt>执行日期</dt><dd>{!! $mixedText($version->effective_date?->toDateString()) !!}</dd></div>
|
||
<div class="meta__item"><dt>审核日期</dt><dd>{!! $mixedText($change?->approved_at?->format('Y-m-d H:i') ?? $version->created_at?->format('Y-m-d H:i')) !!}</dd></div>
|
||
</dl>
|
||
|
||
<table class="details">
|
||
<tbody>
|
||
<tr>
|
||
<th>甲方</th><td>{!! $mixedText($partyA) !!}</td>
|
||
<th>乙方</th><td>{!! $mixedText($version->carrier_name) !!}</td>
|
||
<th>报价类型</th><td>{!! $mixedText($version->quote_type) !!}</td>
|
||
</tr>
|
||
<tr>
|
||
<th>生效日期</th><td>{!! $mixedText($version->effective_date?->toDateString()) !!}</td>
|
||
<th>失效日期</th><td>{!! $mixedText($expiryDate) !!}</td>
|
||
<th>报价编号</th><td>{!! $mixedText($version->version_code) !!}</td>
|
||
</tr>
|
||
<tr>
|
||
<th>面单费</th><td>{!! $mixedText($faceFee) !!}</td>
|
||
<th>计泡系数</th><td>{!! $mixedText($bubbleCoefficient) !!}</td>
|
||
<th>签署要求</th><td>仅乙方(快递方)签章</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
@if(! empty($temporaryNote))
|
||
<div class="notice">{!! $mixedText($temporaryNote) !!}</div>
|
||
@endif
|
||
<div class="notice">本文件由财务系统根据已审核报价版本自动生成。乙方签章后文件与完成证书将按本版本单独归档;后续变价须生成新版本并重新签章,旧确认单不会被覆盖。</div>
|
||
|
||
@if($change)
|
||
<h2>变价说明</h2>
|
||
<p class="summary">{!! $mixedText($change->summary) !!}</p>
|
||
<h2>新旧价格差异</h2>
|
||
<table>
|
||
<thead><tr><th>单元格</th><th>地区/规则</th><th>重量段/计费项</th><th class="number">原价格</th><th class="number">新价格</th><th>单位</th><th>备注</th></tr></thead>
|
||
<tbody>
|
||
@foreach($change->items as $item)
|
||
<tr>
|
||
<td>{!! $mixedText($item->source_cell) !!}</td>
|
||
<td>{!! $mixedText($item->region ?: '—') !!}</td>
|
||
<td>{!! $mixedText($item->weight_band ?: ($item->charge_item ?: '—')) !!}</td>
|
||
<td class="number">{!! $mixedText(rtrim(rtrim($item->original_amount, '0'), '.')) !!}</td>
|
||
<td class="number">{!! $mixedText(rtrim(rtrim($item->new_amount, '0'), '.')) !!}</td>
|
||
<td>{!! $mixedText($item->unit ?: '—') !!}</td>
|
||
<td>{!! $mixedText($item->note ?: '—') !!}</td>
|
||
</tr>
|
||
@endforeach
|
||
</tbody>
|
||
</table>
|
||
@endif
|
||
|
||
<h2>完整报价规则</h2>
|
||
@if(! empty($billingRules))<p class="summary">{!! $mixedText($billingRules) !!}</p>@endif
|
||
<table class="matrix">
|
||
<tbody>
|
||
@forelse($values as $rowIndex => $row)
|
||
<tr>
|
||
@foreach($row as $columnIndex => $cell)
|
||
@php($formula = $formulas[$rowIndex][$columnIndex] ?? null)
|
||
<{{ $rowIndex === 0 ? 'th' : 'td' }}>
|
||
{!! $mixedText(is_bool($cell) ? ($cell ? '是' : '否') : ($cell ?? '')) !!}
|
||
@if(is_string($formula) && trim($formula) !== '')<div class="formula">公式:{!! $mixedText($formula) !!}</div>@endif
|
||
</{{ $rowIndex === 0 ? 'th' : 'td' }}>
|
||
@endforeach
|
||
</tr>
|
||
@empty
|
||
<tr><td>该版本未保存可展示的报价矩阵。</td></tr>
|
||
@endforelse
|
||
</tbody>
|
||
</table>
|
||
|
||
<section class="signature">
|
||
<h2>签署确认</h2>
|
||
<div class="signature__meta">报价版本:{!! $mixedText($version->version_code) !!} 快递公司:{!! $mixedText($version->carrier_name) !!} 执行日期:{!! $mixedText($version->effective_date?->toDateString()) !!}</div>
|
||
<div class="signature__box"><div>乙方(快递方)签章:{!! $mixedText($version->carrier_name) !!}</div><div class="signature__blank"></div><div>签署日期:{!! $mixedText($signatureDate) !!}</div></div>
|
||
<div class="document-control">生成时间:{!! $mixedText($generatedAt->format('Y-m-d H:i:s')) !!} · 版本 {!! $mixedText($version->version_code) !!}</div>
|
||
</section>
|
||
</body>
|
||
</html>
|