Files
xin-procurement/resources/views/exports/purchase.blade.php
T
2026-08-12 14:38:20 +08:00

72 lines
2.3 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>
<th>实际称重</th>
<th>金额</th>
@foreach ($storeNames as $storeName)
<th>{{ $storeName }}(数量)</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($items as $item)
<tr>
<td>{{ $item['sort'] }}</td>
<td>{{ $categoryNames[$item['product_id']] ?? '' }}</td>
<td>{{ $item['product_name'] }}</td>
<td>{{ $supplierNames[$item['supplier_id']] ?? '' }}</td>
<td>{{ $item['product_spec'] }}</td>
<td>{{ $item['unit'] }}</td>
<td class="text-right">{{ $item['cost_price'] }}</td>
<td class="text-right">{{ $item['unit_cost'] }}</td>
<td class="text-right">{{ $item['quantity'] }}</td>
<td class="text-right">{{ $item['weight'] }}</td>
<td class="text-right">{{ $item['amount'] }}</td>
@foreach ($storeNames as $storeId => $storeName)
<td class="text-right">{{ $item['store_quantities'][$storeId] ?? 0 }}</td>
@endforeach
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<td colspan="10" class="text-right">合计金额</td>
<td class="text-right">¥{{ $items->sum('amount') }}</td>
<td colspan="{{ count($storeNames) }}"></td>
</tr>
</tfoot>
</table>
</body>
</html>