Files
xin-procurement/resources/views/exports/purchase.blade.php
T
2026-07-23 20:41:25 +08:00

62 lines
1.8 KiB
PHP

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<style>
body { font-family: SimHei, sans-serif; font-size: 12px; color: #333; }
h2 { text-align: center; margin: 0 0 12px; }
.meta { margin-bottom: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #999; padding: 4px 6px; }
th { background: #f0f0f0; }
.text-right { text-align: right; }
tfoot td { font-weight: bold; background: #fafafa; }
</style>
</head>
<body>
<h2>采购单</h2>
<div class="meta">
采购单号:{{ $purchase->purchase_no }}
采购日期:{{ $purchase->purchase_date?->format('Y-m-d') }}
预估金额:¥{{ $purchase->estimate_amount }}
</div>
<table>
<thead>
<tr>
<th>序号</th>
<th>分类</th>
<th>品名</th>
<th>规格/包规</th>
<th>单价</th>
<th>数量</th>
<th>实际称重</th>
<th>金额</th>
<th>供应商</th>
</tr>
</thead>
<tbody>
@foreach ($items as $item)
<tr>
<td>{{ $item->sort }}</td>
<td>{{ $categoryNames[$item->product_id] ?? '' }}</td>
<td>{{ $item->product_name }}</td>
<td>{{ $item->product_spec }}</td>
<td class="text-right">{{ $item->price }}</td>
<td class="text-right">{{ $item->quantity }}</td>
<td class="text-right">{{ $item->weight }}</td>
<td class="text-right">{{ $item->amount }}</td>
<td>{{ $supplierNames[$item->supplier_id] ?? '' }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="7" class="text-right">合计金额</td>
<td class="text-right">¥{{ $items->sum('amount') }}</td>
<td></td>
</tr>
</tfoot>
</table>
</body>
</html>