diff --git a/ticket/detail.html b/ticket/detail.html index e272160..fc74a99 100644 --- a/ticket/detail.html +++ b/ticket/detail.html @@ -193,10 +193,17 @@ ${item('开具人', ticket.issuer)} ${item('日期', formatDate(ticket.created_at))} ${item('状态', ` - - ${ticket.processed ? '已处理' : '未处理'} + + ${ticket.status ? '已处理' : '未处理'} `, true)} + ${item('办结否', ` + + ${ticket.processed ? '已办结' : '未办结'} + + `, true)} + ${item('办结日期', formatDate(ticket.processed_at) || '暂无')} + ${item('备注', ticket.remarks || '无')}
diff --git a/ticket/print.html b/ticket/print.html index bf0ecd5..4faf7cc 100644 --- a/ticket/print.html +++ b/ticket/print.html @@ -23,14 +23,15 @@ body { /* ===== 水印 ===== */ .watermark { position: absolute; - top: 40%; + top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-30deg); - font-size: 60px; - color: rgba(0,0,0,0.08); + font-size: 50px; + color: rgba(0, 0, 0, 0.08); white-space: nowrap; pointer-events: none; z-index: 0; + text-align: center; } /* ===== 标题 ===== */ @@ -95,17 +96,20 @@ body {
-
BISS · OFFICIAL
+
单据详情
- +
+ + +
编号
姓名
事由
金额
开具人
日期
办结否
办结日期
备注
@@ -127,6 +131,14 @@ function formatDate(d){ return new Date(d).toLocaleString('zh-CN'); } +function updateWatermark(customerName) { + const now = new Date().toLocaleString('zh-CN'); + + const watermarkText = `BISS · ${customerName || 'Unknown'} · ${now}`; + + document.getElementById('watermark').innerText = watermarkText; +} + async function load() { const id = new URLSearchParams(location.search).get('id'); @@ -140,11 +152,17 @@ async function load() { document.getElementById('amount').innerText = '¥' + (data.amount || 0).toFixed(2); document.getElementById('issuer').innerText = data.issuer || ''; document.getElementById('created_at').innerText = formatDate(data.created_at); + document.getElementById('processed').innerText = data.processed ? '已办结' : '未办结'; + document.getElementById('processed_at').innerText = data.processed_at ? formatDate(data.processed_at) : '暂无'; + document.getElementById('remarks').innerText = data.remarks || '无'; - // 打印时间(核心你要的) - document.getElementById('print_time').innerText = new Date().toLocaleString('zh-CN'); + // 打印时间 + document.getElementById('print_time').innerText = + new Date().toLocaleString('zh-CN'); - // 自动打印(稳定延迟) + updateWatermark(data.customer_name); + + // 自动打印 setTimeout(() => { window.print(); }, 300);