docs: add payment-info 缴费明细 list-mode transfer design

Spec and interactive demo for replacing 缴费确认 with a sample-level
detail dialog that manages transfers in SamplePaymentPanel list mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-10-10 14:16:26 +08:00
1 parent da63c228f5
commit 34c8a1a62d
2 files changed
+1003

No files matched your search

@@ -0,0 +1,845 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>缴费信息 · 缴费明细(样本全量 + 列表模式转账)Demo</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<style>
:root {
--primary: #10b981;
--primary-dark: #059669;
--primary-bg: #ecfdf5;
--bg-page: #f8fafc;
--panel: #ffffff;
--text: #0f172a;
--text-secondary: #334155;
--text-muted: #64748b;
--border: #d9e8e2;
--table-head: #f8fafc;
--row-alt: #fafafa;
--row-hover: #f1f5f9;
--radius: 10px;
--radius-sm: 8px;
--shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
--warning: #d97706;
--warning-bg: #fffbeb;
--danger: #dc2626;
--info: #64748b;
--info-bg: #f1f5f9;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
font-size: 14px;
line-height: 1.5;
color: var(--text);
background: var(--bg-page);
}
.page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 100px; }
.hero { margin-bottom: 20px; }
.hero h1 {
margin: 0 0 8px;
font-size: 22px;
font-weight: 700;
letter-spacing: -0.02em;
}
.hero h1::before {
content: "";
display: inline-block;
width: 4px;
height: 1.1em;
margin-right: 10px;
vertical-align: -0.15em;
border-radius: 2px;
background: var(--primary);
}
.hero p { margin: 0 0 8px; color: var(--text-muted); }
.ref-chip {
display: inline-flex;
align-items: center;
gap: 6px;
margin-top: 8px;
padding: 6px 12px;
border-radius: 8px;
background: var(--primary-bg);
color: var(--primary-dark);
font-size: 12px;
font-weight: 600;
}
.flow {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 14px 0 0;
}
.flow-step {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
border-radius: 999px;
background: #fff;
border: 1px solid var(--border);
color: var(--text-secondary);
font-size: 12px;
font-weight: 600;
}
.flow-step span {
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--primary);
color: #fff;
font-size: 11px;
display: inline-flex;
align-items: center;
justify-content: center;
}
.panel {
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow);
overflow: hidden;
}
.panel-top {
padding: 16px 20px;
border-bottom: 1px solid var(--border);
}
.panel-top h2 {
margin: 0;
font-size: 16px;
font-weight: 700;
}
.panel-top h2::before {
content: "";
display: inline-block;
width: 3px;
height: 1em;
margin-right: 8px;
vertical-align: -0.12em;
border-radius: 2px;
background: var(--primary);
}
.hint {
margin: 0;
padding: 10px 20px;
font-size: 13px;
color: var(--text-muted);
background: #f8fafc;
border-bottom: 1px solid var(--border);
}
table.list {
width: 100%;
border-collapse: collapse;
}
table.list th, table.list td {
padding: 12px 14px;
text-align: center;
border-bottom: 1px solid var(--border);
font-size: 13px;
}
table.list th {
background: var(--table-head);
color: var(--text-secondary);
font-weight: 600;
white-space: nowrap;
}
table.list tbody tr:nth-child(even) { background: var(--row-alt); }
table.list tbody tr:hover { background: var(--row-hover); }
.tag {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: 500;
line-height: 1.4;
}
.tag.success { background: var(--primary-bg); color: var(--primary-dark); }
.tag.warning { background: var(--warning-bg); color: var(--warning); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.primary { background: #eff6ff; color: #2563eb; }
.btn {
display: inline-flex;
align-items: center;
gap: 4px;
height: 32px;
padding: 0 12px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: #fff;
color: var(--text-secondary);
font-size: 13px;
font-family: inherit;
cursor: pointer;
white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn.primary {
background: var(--primary);
border-color: var(--primary);
color: #fff;
}
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn.ghost { background: #fff; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.link {
height: auto;
padding: 0 6px;
border: none;
background: transparent;
color: var(--primary-dark);
}
.btn.link.danger { color: var(--danger); }
.btn.link.warn { color: var(--warning); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ops { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.amount { font-weight: 600; color: var(--primary-dark); }
.overlay {
position: fixed;
inset: 0;
background: rgba(15, 23, 42, 0.45);
display: none;
align-items: flex-start;
justify-content: center;
padding: 24px 16px;
z-index: 100;
overflow-y: auto;
}
.overlay.open { display: flex; }
.dialog {
width: min(1080px, 100%);
margin: 16px auto 40px;
background: #fff;
border-radius: var(--radius);
box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
display: flex;
flex-direction: column;
max-height: calc(100vh - 48px);
}
.dialog-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.dialog-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.dialog-close {
width: 32px;
height: 32px;
border: none;
background: transparent;
font-size: 20px;
color: var(--text-muted);
cursor: pointer;
border-radius: 6px;
}
.dialog-close:hover { background: var(--info-bg); color: var(--text); }
.dialog-body {
padding: 20px;
overflow-y: auto;
flex: 1;
}
.dialog-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
padding: 14px 20px;
border-top: 1px solid var(--border);
flex-shrink: 0;
}
.summary-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
margin-bottom: 18px;
}
@media (max-width: 720px) {
.summary-grid { grid-template-columns: 1fr 1fr; }
}
.summary-item {
padding: 10px 12px;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: #f8fafc;
}
.summary-item label {
display: block;
font-size: 11px;
color: var(--text-muted);
margin-bottom: 4px;
}
.summary-item strong { font-size: 14px; font-weight: 600; }
.summary-item .muted { color: var(--text-muted); font-weight: 400; font-size: 13px; }
.section-title {
margin: 0 0 10px;
font-size: 13px;
font-weight: 700;
color: var(--text-secondary);
}
.schedule-block {
border: 1px solid var(--border);
border-radius: var(--radius-sm);
margin-bottom: 14px;
overflow: hidden;
}
.schedule-block__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px 14px;
background: #f8fafc;
border-bottom: 1px solid var(--border);
flex-wrap: wrap;
}
.schedule-block__title {
font-size: 13px;
font-weight: 600;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 12px;
}
.schedule-arrears { color: var(--text-muted); font-weight: 500; }
.transfer-wrap { overflow-x: auto; }
table.transfer {
width: 100%;
border-collapse: collapse;
min-width: 980px;
}
table.transfer th, table.transfer td {
padding: 10px 8px;
border-bottom: 1px solid var(--border);
font-size: 13px;
text-align: center;
vertical-align: middle;
}
table.transfer th {
background: #fafafa;
color: var(--text-secondary);
font-weight: 600;
white-space: nowrap;
}
table.transfer tbody tr:nth-child(even) { background: #fcfcfc; }
table.transfer .empty {
padding: 18px;
color: var(--text-muted);
text-align: center;
}
.cell-input, .cell-select {
width: 100%;
height: 32px;
padding: 0 8px;
border: 1px solid var(--border);
border-radius: 6px;
font: inherit;
background: #fff;
}
.cell-input:disabled, .cell-select:disabled {
background: #f8fafc;
color: var(--text-muted);
}
.upload-mini {
width: 72px;
height: 52px;
border: 1px dashed #a7f3d0;
border-radius: 6px;
background: var(--primary-bg);
color: var(--primary-dark);
font-size: 11px;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.voucher-chip {
display: inline-flex;
align-items: center;
justify-content: center;
width: 56px;
height: 40px;
border-radius: 6px;
border: 1px solid #a7f3d0;
background: #fff;
font-size: 11px;
color: var(--primary-dark);
}
.row-ops {
display: flex;
flex-wrap: wrap;
gap: 4px;
justify-content: center;
}
.toast {
position: fixed;
top: 24px;
left: 50%;
transform: translateX(-50%) translateY(-20px);
background: #0f172a;
color: #fff;
padding: 10px 18px;
border-radius: 8px;
font-size: 13px;
opacity: 0;
pointer-events: none;
transition: all 0.25s ease;
z-index: 200;
}
.toast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
.compare {
margin-top: 28px;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 14px;
}
@media (max-width: 800px) {
.compare { grid-template-columns: 1fr; }
}
.compare-card {
padding: 16px;
border-radius: var(--radius);
border: 1px solid var(--border);
background: #fff;
}
.compare-card h4 { margin: 0 0 8px; font-size: 14px; }
.compare-card.new {
border-color: #a7f3d0;
background: linear-gradient(180deg, #ecfdf5 0%, #fff 48%);
}
.compare-card.new h4 { color: var(--primary-dark); }
.compare-card ul {
margin: 0;
padding-left: 18px;
color: var(--text-secondary);
font-size: 13px;
}
.compare-card li { margin-bottom: 4px; }
</style>
</head>
<body>
<div class="page">
<header class="hero">
<h1>缴费明细 · 样本全量 + 列表模式转账</h1>
<p>
列表「缴费明细」打开该样本全量应缴批次(应缴金额/时间只读);转账登记对齐<strong>采集协议单 · SamplePaymentPanel</strong>:
期次下表格行内编辑,支持添加 / 保存 / 提交财务确认 / 撤回 / 删除。改缴费方案仍走协议单。
</p>
<div class="ref-chip">参考:采集协议单新增/编辑弹窗 · 缴费方案 · 应缴批次列表模式(本页应缴字段只读)</div>
<div class="flow">
<div class="flow-step"><span>1</span> 列表点「缴费明细」</div>
<div class="flow-step"><span>2</span> 查看各期明细(应缴只读)</div>
<div class="flow-step"><span>3</span> 期次「添加转账」行内填写</div>
<div class="flow-step"><span>4</span> 行操作:保存 → 提交财务确认</div>
</div>
</header>
<section class="panel">
<div class="panel-top">
<h2>缴费信息(示意列表)</h2>
</div>
<p class="hint">点击「缴费明细」打开样本详情(有欠缴/可操作时主色;已缴清仍可查看,本 Demo 第二行示意「仅查看」)。</p>
<div style="overflow-x:auto">
<table class="list">
<thead>
<tr>
<th>姓名</th>
<th>合同编号</th>
<th>缴费方式</th>
<th>合同总额</th>
<th>累计实缴</th>
<th>待缴金额</th>
<th>缴费进度</th>
<th style="min-width:220px">操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>张敏</td>
<td>XY-2026-0318</td>
<td><span class="tag primary">分期</span></td>
<td>¥68,000</td>
<td class="amount">¥30,000</td>
<td>¥38,000</td>
<td><span class="tag primary">部分已缴</span></td>
<td>
<div class="ops">
<button class="btn" onclick="toast('打开协议单(现有)')">协议单</button>
<button class="btn primary" onclick="openDetail()">缴费明细</button>
</div>
</td>
</tr>
<tr>
<td>李婷</td>
<td>XY-2026-0281</td>
<td><span class="tag success">趸交</span></td>
<td>¥48,000</td>
<td class="amount">¥48,000</td>
<td>¥0</td>
<td><span class="tag success">已缴清</span></td>
<td>
<div class="ops">
<button class="btn" onclick="toast('打开协议单(现有)')">协议单</button>
<button class="btn" onclick="toast('已缴清:仍可打开明细查看(只读转账)')">缴费明细</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<div class="compare">
<div class="compare-card">
<h4>现状(待改)</h4>
<ul>
<li>按钮名「缴费确认」→ 直接弹单笔表单</li>
<li>看不到全期转账明细</li>
<li>与协议单编辑体验不一致</li>
</ul>
</div>
<div class="compare-card new">
<h4>本 Demo(目标)</h4>
<ul>
<li>按钮改名「缴费明细」→ 样本全量批次详情</li>
<li>应缴金额/时间只读;每期表格列表模式管转账</li>
<li>行操作:保存 / 提交财务确认 / 撤回 / 删除(对齐协议单)</li>
</ul>
</div>
</div>
</div>
<div class="overlay" id="detailOverlay" role="dialog" aria-modal="true">
<div class="dialog">
<div class="dialog-header">
<h3>样本缴费详情 · 张敏 / XY-2026-0318</h3>
<button class="dialog-close" onclick="closeDetail()" aria-label="关闭">×</button>
</div>
<div class="dialog-body">
<div class="summary-grid">
<div class="summary-item">
<label>客户</label>
<strong>张敏 <span class="muted">· 138****2618</span></strong>
</div>
<div class="summary-item">
<label>样本编码</label>
<strong>YB-2026-0318-A</strong>
</div>
<div class="summary-item">
<label>缴费方式</label>
<strong><span class="tag primary">分期</span></strong>
</div>
<div class="summary-item">
<label>合同额</label>
<strong class="amount">¥68,000.00</strong>
</div>
<div class="summary-item">
<label>已缴 / 待缴</label>
<strong class="amount">¥30,000.00 / ¥38,000.00</strong>
</div>
<div class="summary-item">
<label>缴费进度</label>
<strong><span class="tag primary">部分已缴</span> <span class="muted">· 1/2 期已缴清</span></strong>
</div>
</div>
<p class="section-title">应缴批次</p>
<!-- 第1期:已缴清,转账只读 -->
<div class="schedule-block">
<div class="schedule-block__head">
<div class="schedule-block__title">
<span>第 1 期</span>
<span class="schedule-arrears">应缴 ¥30,000.00 · 已缴 ¥30,000.00 · 欠缴 ¥0.00 · 2026-03-20</span>
<span class="tag success">已缴清</span>
</div>
</div>
<div class="transfer-wrap">
<table class="transfer">
<thead>
<tr>
<th style="width:48px">#</th>
<th>转账方式</th>
<th>转账金额(元)</th>
<th>转账时间</th>
<th>转账凭证</th>
<th>备注</th>
<th>财务备注</th>
<th>状态</th>
<th style="min-width:160px">操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>银行转账</td>
<td class="amount">30,000.00</td>
<td>2026-03-18 14:22</td>
<td><span class="voucher-chip">回单</span></td>
<td>—</td>
<td>到账匹配成功</td>
<td><span class="tag success">缴费成功</span></td>
<td><span style="color:var(--text-muted)">—</span></td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- 第2期:可编辑列表 -->
<div class="schedule-block" id="schedule2">
<div class="schedule-block__head">
<div class="schedule-block__title">
<span>第 2 期</span>
<span class="schedule-arrears" id="s2Arrears">应缴 ¥38,000.00 · 已缴 ¥0.00 · 欠缴 ¥38,000.00 · 2026-09-20</span>
<span class="tag warning" id="s2Status">待缴清</span>
</div>
<button class="btn primary sm" id="btnAdd" onclick="addTransfer()">
+ 添加转账
</button>
</div>
<div class="transfer-wrap">
<table class="transfer">
<thead>
<tr>
<th style="width:48px">#</th>
<th>转账方式</th>
<th>转账金额(元)</th>
<th>转账时间</th>
<th>转账凭证</th>
<th>备注</th>
<th>财务备注</th>
<th>状态</th>
<th style="min-width:260px">操作</th>
</tr>
</thead>
<tbody id="s2Body">
<tr>
<td colspan="9" class="empty">暂无转账记录,请点击上方按钮添加</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="dialog-footer">
<button class="btn ghost" onclick="closeDetail()">关闭</button>
</div>
</div>
</div>
<div class="toast" id="toast"></div>
<script>
/** @type {{id?:string, type:string, amount:string, time:string, remark:string, finance:string, status:'dfj'|'jfqrz'|'yjf', saved:boolean}[]} */
let transfers = []
const detailOverlay = document.getElementById('detailOverlay')
function toast(msg) {
const el = document.getElementById('toast')
el.textContent = msg
el.classList.add('show')
clearTimeout(toast._t)
toast._t = setTimeout(() => el.classList.remove('show'), 2200)
}
function openDetail() {
detailOverlay.classList.add('open')
document.body.style.overflow = 'hidden'
setTimeout(() => {
document.getElementById('schedule2').scrollIntoView({ behavior: 'smooth', block: 'nearest' })
}, 80)
}
function closeDetail() {
detailOverlay.classList.remove('open')
document.body.style.overflow = ''
}
function fmt(n) {
return Number(n || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
}
function paidSum() {
return transfers
.filter((t) => ['dfj', 'jfqrz', 'yjf'].includes(t.status))
.reduce((s, t) => s + (Number(t.amount) || 0), 0)
}
function updateHead() {
const paid = paidSum()
const due = 38000
const arrears = Math.max(due - paid, 0)
document.getElementById('s2Arrears').textContent =
`应缴 ¥${fmt(due)} · 已缴 ¥${fmt(paid)} · 欠缴 ¥${fmt(arrears)} · 2026-09-20`
const st = document.getElementById('s2Status')
const hasJfqrz = transfers.some((t) => t.status === 'jfqrz')
if (arrears <= 0 && transfers.some((t) => t.status === 'yjf')) {
st.className = 'tag success'
st.textContent = '已缴清'
} else if (hasJfqrz) {
st.className = 'tag warning'
st.textContent = '缴费确认中'
} else {
st.className = 'tag warning'
st.textContent = '待缴清'
}
// 存在 jfqrz 时仍可添加其它草稿(协议单可多笔);Demo 简化:始终可添加,除非已缴清
document.getElementById('btnAdd').disabled = arrears <= 0 && hasJfqrz === false && paid >= due
}
function statusTag(status) {
if (status === 'yjf') return '<span class="tag success">缴费成功</span>'
if (status === 'jfqrz') return '<span class="tag warning">缴费确认中</span>'
return '<span class="tag info">已缴费</span>'
}
function typeLabel(v) {
return { yhzz: '银行转账', wx: '微信', zfb: '支付宝', xj: '现金' }[v] || v || '—'
}
function render() {
const body = document.getElementById('s2Body')
if (!transfers.length) {
body.innerHTML = '<tr><td colspan="9" class="empty">暂无转账记录,请点击上方按钮添加</td></tr>'
updateHead()
return
}
body.innerHTML = transfers.map((t, idx) => {
const locked = t.status === 'yjf' || t.status === 'jfqrz'
const typeCell = locked
? typeLabel(t.type)
: `<select class="cell-select" onchange="patch(${idx},'type',this.value)">
<option value="yhzz" ${t.type==='yhzz'?'selected':''}>银行转账</option>
<option value="wx" ${t.type==='wx'?'selected':''}>微信</option>
<option value="zfb" ${t.type==='zfb'?'selected':''}>支付宝</option>
<option value="xj" ${t.type==='xj'?'selected':''}>现金</option>
</select>`
const amountCell = locked
? `<span class="amount">${fmt(t.amount)}</span>`
: `<input class="cell-input" value="${t.amount}" onchange="patch(${idx},'amount',this.value)" />`
const timeCell = locked
? (t.time || '—')
: `<input class="cell-input" value="${t.time}" onchange="patch(${idx},'time',this.value)" />`
const remarkCell = locked
? (t.remark || '—')
: `<input class="cell-input" value="${t.remark||''}" placeholder="选填" onchange="patch(${idx},'remark',this.value)" />`
const voucherCell = locked
? (t.voucher ? '<span class="voucher-chip">回单</span>' : '—')
: `<div class="upload-mini" onclick="attach(${idx})">${t.voucher ? '回单' : '+ 上传'}</div>`
let ops = ''
if (!locked) {
ops += `<button class="btn link" onclick="saveRow(${idx})">保存</button>`
}
if (t.saved && t.status === 'dfj') {
ops += `<button class="btn link" onclick="submitRow(${idx})">提交财务确认</button>`
}
if (t.status === 'jfqrz') {
ops += `<button class="btn link warn" onclick="withdrawRow(${idx})">撤回</button>`
}
if (!locked) {
ops += `<button class="btn link danger" onclick="removeRow(${idx})">删除</button>`
}
if (locked && t.status !== 'jfqrz') ops = '<span style="color:var(--text-muted)">—</span>'
return `<tr>
<td>${idx + 1}</td>
<td>${typeCell}</td>
<td>${amountCell}</td>
<td>${timeCell}</td>
<td>${voucherCell}</td>
<td>${remarkCell}</td>
<td>${t.finance || '—'}</td>
<td>${statusTag(t.status)}</td>
<td><div class="row-ops">${ops}</div></td>
</tr>`
}).join('')
updateHead()
}
function addTransfer() {
const arrears = Math.max(38000 - paidSum(), 0)
transfers.push({
type: 'yhzz',
amount: String(arrears > 0 ? arrears.toFixed(2) : '0.00'),
time: '2026-10-10 10:30:00',
remark: '',
finance: '',
status: 'dfj',
saved: false,
voucher: false
})
render()
toast('已添加转账行(未保存)')
}
function patch(idx, key, val) {
transfers[idx][key] = val
transfers[idx].saved = false
}
function attach(idx) {
transfers[idx].voucher = true
transfers[idx].saved = false
render()
toast('Demo:已挂上转账凭证')
}
function saveRow(idx) {
const t = transfers[idx]
if (!t.type) return toast('请选择转账方式')
if (!(Number(t.amount) > 0)) return toast('请填写转账金额')
t.saved = true
t.id = t.id || 'tr_' + Date.now()
render()
toast('转账草稿已保存(状态:已缴费 dfj)')
}
function submitRow(idx) {
const t = transfers[idx]
if (!t.saved) return toast('请先保存再提交')
t.status = 'jfqrz'
render()
toast('已提交财务确认 → 缴费确认中')
}
function withdrawRow(idx) {
transfers[idx].status = 'dfj'
render()
toast('已撤回 → 恢复为可编辑草稿')
}
function removeRow(idx) {
transfers.splice(idx, 1)
render()
toast('已删除转账行')
}
detailOverlay.addEventListener('click', (e) => {
if (e.target === detailOverlay) closeDetail()
})
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && detailOverlay.classList.contains('open')) closeDetail()
})
</script>
</body>
</html>
@@ -0,0 +1,158 @@
# 缴费信息 ·「缴费明细」弹窗(列表模式转账)设计
> 状态:已确认
> 日期:2026-10-10
> 界面模式:P02 复杂业务列表 + 详情弹窗内嵌可编辑表格
> Demo:`docs/demos/2026-10-10-payment-confirm-sample-detail-demo.html`
> 参考实现:`web-admin/src/views/cell-storage/protocol/SamplePaymentPanel.vue`(应缴批次下转账表格)
## 1. 背景与目标
### 1.1 现状
【缴费信息】Excel 宽表操作列「缴费确认」在 `canConfirm=true` 时显示;点击后跳过全量明细,直接定位最早一期待缴期并打开 `PaymentReceiptConfirmDialog` 单笔表单。用户无法在同屏查看该样本全部期次与历史转账,也与采集协议单中的「列表模式」转账体验不一致。
### 1.2 目标
1. 操作列按钮改名为 **「缴费明细」**。
2. 点击后打开 **样本级缴费详情弹窗**:展示该样本全部应缴批次与转账笔。
3. **应缴金额 / 应缴时间只读**;改缴费方案仍只在采集协议单新增/编辑中完成。
4. 转账登记对齐协议单列表模式:期次下表格行内编辑,支持添加 / 保存 / 提交财务确认 / 撤回 / 删除。
### 1.3 已确认决策
| 项 | 选择 |
|----|------|
| 入口文案 | 「缴费确认」→「缴费明细」 |
| 首屏 | 样本全量明细,不直接进单笔表单 |
| 应缴字段 | 只读 |
| 转账 UX | 对齐 `SamplePaymentPanel` 列表模式(非独立确认弹窗为主路径) |
| 已缴清样本 | 仍可打开明细查看(转账只读;无「添加转账」) |
| 单期「实缴金额」弹窗 | 保留只读查看能力(可选底部不再强推「缴费确认」进单笔表单,避免双路径;见 §3.4) |
| 后端 | 复用现有转账 API,不新增资源模型 |
## 2. 信息架构
```
缴费信息列表
├─ 协议单 → ProtocolViewDialog(现有)
└─ 缴费明细 → 样本缴费详情弹窗(本设计)
├─ 摘要(协议号、客户、样本、方式、合同额、已缴/待缴、进度)
└─ 应缴批次(只读应缴)
└─ 转账表格(列表模式,可写)
```
数据模型不变:
```
样本缴费方案 1 ──N 应缴批次(期) ──N 转账笔
```
## 3. 界面与交互
### 3.1 列表操作列
- 文案:**缴费明细**(图标可用 `List` / `Document` / `View`,与现有操作列风格一致;须带 `el-icon`)。
- **始终展示**(不再依赖 `canConfirm` 隐藏)。已缴清时仍可查看;无有效期或无方案时按钮禁用并提示。
- 点击:`fetchSamplePaymentDetail(id)` → 打开详情弹窗。
- 「协议单」按钮行为不变。
### 3.2 样本缴费详情弹窗
- 标题:`样本缴费详情` 或 `客户名 · 协议号`。
- 宽度约 1000~1080px;`dialog-form-layout` + `align-center` + `protocol-dialog-mask`;无 backdrop blur。
- **摘要区**(只读):协议号、客户(姓名·电话)、样本编码、缴费方式 Tag、合同额、已缴/待缴、整体进度(已缴清期数)、缴费进度 Tag、协议状态 Tag(可选)。
- **应缴批次**:按 `scheduleNo` 升序;每期卡片/区块:
- 标题:第 N 期 · 应缴 · 应缴日 · 已缴 · 欠缴 · 批次状态 Tag。
- **不提供**应缴金额/应缴时间编辑控件。
- 期头右侧:当 `arrearsAmount > 0` 且允许新增时显示 **「添加转账」**(`Plus` 图标);已缴清或无可写权限时不显示。
- Footer:仅 **关闭**。
### 3.3 转账表格(列表模式)
对齐 `SamplePaymentPanel` 列与行操作(本页不嵌整块 Panel,避免暴露改方案):
| 列 | 可编辑条件 |
|----|------------|
| # | — |
| 转账方式 | `pay_status` 非 `jfqrz`/`yjf`(及既有锁定规则) |
| 转账金额(元) | 同上 |
| 转账时间 | 同上 |
| 转账凭证 | 同上;卡片上传,对齐附件规范 |
| 备注 | 同上 |
| 财务备注 | 只读 |
| 状态 | Tag:`dfj`/`jfqrz`/`yjf` 等 |
| 操作 | 见下 |
**行操作**(与协议单一致):
| 条件 | 操作 |
|------|------|
| 未锁定 | **保存**(无 id → create;有 id → update) |
| `id` 且 `dfj` | **提交财务确认** → `jfqrz` |
| `id` 且 `jfqrz` | **撤回** → `dfj`(二次确认文案对齐协议单) |
| 未锁定 | **删除**(未落库行本地移除;已落库按现有 delete/soft API,若协议单仅本地删未保存行则对齐其行为) |
| `yjf` 等终态 | 操作列 `—` |
锁定规则复用协议单:`isTransferLocked`(财务已确认 `yjf` 锁定;`jfqrz` 不可改字段,仅可撤回)。
校验:转账方式必填、金额 > 0;上传中禁止保存。成功/失败 `ElMessage` 提示。保存或提交/撤回后刷新当前详情(或本地 patch 后与列表 `loadData` 同步)。
### 3.4 与单期「实缴金额」弹窗
- **保留**点击期次实缴金额打开的单期只读转账弹窗(摘要 + 凭证)。
- 该弹窗底部 **去掉「缴费确认」主按钮**(避免再进入 `PaymentReceiptConfirmDialog`);引导用户用操作列「缴费明细」管理转账。
- 列表操作列不再调用「最早一期 + 打开 ReceiptConfirm」的旧路径。
### 3.5 不再作为主路径的组件
- `PaymentReceiptConfirmDialog`:本页主路径不再打开;其它页面(流程看板等)可继续使用,本设计不强制删除组件。
## 4. API 与数据
复用 `web-admin/src/api/protocol-sample-payment.ts`:
| 动作 | API |
|------|-----|
| 详情 | `fetchSamplePaymentDetail` |
| 创建转账 | `fetchCreatePaymentTransfer` |
| 更新转账 | `fetchUpdatePaymentTransfer` |
| 提交财务 | `fetchSubmitPaymentTransferFinance` |
| 撤回 | `fetchWithdrawPaymentTransfer` |
| 列表刷新 | `fetchSamplePaymentList`(或现 Excel 列表接口) |
附件上传复用 `fetchUploadAttachment`(folder 与协议单转账一致,如 `protocol-transfer`)。
无需新表、新菜单、新权限码(沿用 `cellStorage:paymentInfo:list` 及既有写权限)。
## 5. 实现边界
### 5.1 前端
- 主改:`PaymentExcelList.vue`(按钮文案、打开详情、移除旧 `handleConfirm` 直达单笔表单逻辑、单期弹窗去确认按钮)。
- 建议抽组件(推荐):`components/business/sample-payment-transfer-table/` 或 `payment-info/SamplePaymentDetailDialog.vue`,内嵌只读期头 + 可编辑转账表;协议单后续可渐进复用,**本迭代不强制改造 SamplePaymentPanel**。
- 清理:本页对 `PaymentReceiptConfirmDialog` 的依赖可移除(若无其它引用则仅本页卸载)。
### 5.2 后端
- 无强制变更;若删除转账笔缺少接口且协议单亦仅本地删未保存行,则对齐「未保存行删除 / 已保存行需确认」的现有行为。
### 5.3 文档
- Demo 已存在;本 spec 为权威。
- 可选:更新 `2026-10-09-payment-info-excel-list-and-chase-design.md` 中「缴费确认」表述为「缴费明细」(交叉引用即可,不强制大改旧文)。
## 6. 验收标准
1. 列表操作列显示「缴费明细」,有/无欠缴均可打开(无方案时禁用)。
2. 详情展示全部期次;应缴金额/时间不可编辑。
3. 有欠缴期可「添加转账」;行内保存、提交财务确认、撤回、删除行为与协议单一致,状态流转 `dfj → jfqrz → yjf`(确认在财务侧)。
4. 不再从本页操作列直接打开旧「缴费确认」单笔弹窗。
5. 单期实缴弹窗仅只读查看,无「缴费确认」提交入口。
6. 关闭详情或转账变更后列表金额/进度刷新正确。
## 7. 非目标
- 不在本页改趸交/分期/分改趸或重算批次。
- 不改造财务「缴费确认」待办页。
- 不强制本迭代把协议单改为引用新抽组件(可后续跟进)。