新增生成pdf
This commit is contained in:
@@ -0,0 +1,172 @@
|
||||
<!-- app/view/pdf/delivery_template.php -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>出货单 - <?php echo htmlspecialchars($data['delivery_id'] ?? 'N/A'); ?></title>
|
||||
<style>
|
||||
/* styles.css */
|
||||
body {
|
||||
font-family: "DejaVu Sans", sans-serif; /* TCPDF 支持的字体 */
|
||||
font-size: 10pt;
|
||||
color: #333;
|
||||
margin: 20mm 15mm 20mm 15mm; /* 页边距 */
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
border-bottom: 2px solid #000;
|
||||
padding-bottom: 5mm;
|
||||
margin-bottom: 8mm;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
margin: 0;
|
||||
font-size: 16pt;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.header p {
|
||||
margin: 2mm 0;
|
||||
}
|
||||
|
||||
.company-info {
|
||||
font-size: 9pt;
|
||||
text-align: right;
|
||||
margin-bottom: 10mm;
|
||||
}
|
||||
|
||||
.document-details {
|
||||
margin-bottom: 10mm;
|
||||
}
|
||||
|
||||
.document-details table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.document-details th, .document-details td {
|
||||
border: 1px solid #999;
|
||||
padding: 2mm;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.document-details th {
|
||||
background-color: #f0f0f0;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.items-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 10mm;
|
||||
}
|
||||
|
||||
.items-table th, .items-table td {
|
||||
border: 1px solid #999;
|
||||
padding: 2mm;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.items-table th {
|
||||
background-color: #eaeaea;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.items-table tfoot td {
|
||||
font-weight: bold;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.footer {
|
||||
border-top: 1px solid #ccc;
|
||||
padding-top: 5mm;
|
||||
font-size: 9pt;
|
||||
text-align: center;
|
||||
}
|
||||
/* 特定于出货单的样式 */
|
||||
.delivery-address {
|
||||
margin-bottom: 10mm;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>商品出货单</h1>
|
||||
<p>出货编号: <?php echo htmlspecialchars($data['delivery_id'] ?? 'N/A'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="company-info">
|
||||
<p>发货方: Your Company Ltd.</p>
|
||||
<p>地址: 123 Main Street, City</p>
|
||||
<p>电话: (123) 456-7890</p>
|
||||
</div>
|
||||
|
||||
<div class="document-details">
|
||||
<table>
|
||||
<tr>
|
||||
<th width="20%">客户名称</th>
|
||||
<td width="30%"><?php echo htmlspecialchars($data['customer_name'] ?? ''); ?></td>
|
||||
<th width="20%">出货日期</th>
|
||||
<td width="30%"><?php echo htmlspecialchars($data['delivery_date'] ?? ''); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>订单编号</th>
|
||||
<td><?php echo htmlspecialchars($data['order_id'] ?? ''); ?></td>
|
||||
<th>运输方式</th>
|
||||
<td><?php echo htmlspecialchars($data['shipping_method'] ?? ''); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="delivery-address">
|
||||
<h3>收货地址</h3>
|
||||
<p><?php echo nl2br(htmlspecialchars($data['recipient_address'] ?? '')); ?></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3>出货明细</h3>
|
||||
<table class="items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="5%">序号</th>
|
||||
<th width="15%">产品编码</th>
|
||||
<th width="30%">产品名称</th>
|
||||
<th width="10%">规格</th>
|
||||
<th width="10%">单位</th>
|
||||
<th width="15%">数量</th>
|
||||
<th width="15%">备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (!empty($data['items'])): ?>
|
||||
<?php foreach ($data['items'] as $index => $item): ?>
|
||||
<tr>
|
||||
<td><?php echo $index + 1; ?></td>
|
||||
<td><?php echo htmlspecialchars($item['product_code'] ?? ''); ?></td>
|
||||
<td><?php echo htmlspecialchars($item['product_name'] ?? ''); ?></td>
|
||||
<td><?php echo htmlspecialchars($item['specification'] ?? ''); ?></td>
|
||||
<td><?php echo htmlspecialchars($item['unit'] ?? ''); ?></td>
|
||||
<td style="text-align: right;"><?php echo number_format($item['quantity'] ?? 0, 2); ?></td>
|
||||
<td><?php echo htmlspecialchars($item['remark'] ?? ''); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<td colspan="7" style="text-align: center;">无出货明细</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p>仓库经办人: _________________ 司机签名: _________________ 客户签收: _________________</p>
|
||||
<p>签收日期: _________</p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user