2026-10-08-payment-info-excel-list-demo.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <title>缴费信息 · 单列表(Excel 表头)Demo</title>
  7. <link rel="preconnect" href="https://fonts.googleapis.com" />
  8. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
  9. <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
  10. <style>
  11. :root {
  12. --primary: #10b981;
  13. --primary-dark: #059669;
  14. --primary-bg: #ecfdf5;
  15. --bg-page: #f8fafc;
  16. --panel: #ffffff;
  17. --text: #0f172a;
  18. --text-secondary: #334155;
  19. --text-muted: #64748b;
  20. --border: #d9e8e2;
  21. --table-head: #f8fafc;
  22. --row-alt: #fafafa;
  23. --row-hover: #f1f5f9;
  24. --radius: 10px;
  25. --radius-sm: 8px;
  26. --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  27. --warning: #d97706;
  28. --warning-bg: #fffbeb;
  29. --danger: #dc2626;
  30. --p1: #dbeafe;
  31. --p2: #ffedd5;
  32. --p3: #fef9c3;
  33. --p4: #dcfce7;
  34. --p5: #ffedd5;
  35. --p6: #d1fae5;
  36. }
  37. * { box-sizing: border-box; }
  38. body {
  39. margin: 0;
  40. font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  41. font-size: 14px;
  42. line-height: 1.5;
  43. color: var(--text);
  44. background: var(--bg-page);
  45. }
  46. .page {
  47. max-width: 100%;
  48. margin: 0 auto;
  49. padding: 24px 20px 80px;
  50. }
  51. .hero {
  52. max-width: 960px;
  53. margin-bottom: 20px;
  54. }
  55. .hero h1 {
  56. margin: 0 0 8px;
  57. font-size: 22px;
  58. font-weight: 700;
  59. letter-spacing: -0.02em;
  60. }
  61. .hero h1::before {
  62. content: "";
  63. display: inline-block;
  64. width: 4px;
  65. height: 1.1em;
  66. margin-right: 10px;
  67. vertical-align: -0.15em;
  68. border-radius: 2px;
  69. background: var(--primary);
  70. }
  71. .hero p {
  72. margin: 0 0 10px;
  73. color: var(--text-muted);
  74. }
  75. .context-bar {
  76. display: flex;
  77. flex-wrap: wrap;
  78. gap: 8px;
  79. margin-top: 12px;
  80. }
  81. .pill {
  82. display: inline-flex;
  83. align-items: center;
  84. padding: 4px 10px;
  85. border-radius: 999px;
  86. font-size: 12px;
  87. background: var(--primary-bg);
  88. color: var(--primary-dark);
  89. border: 1px solid #a7f3d0;
  90. }
  91. .pill.warn {
  92. background: var(--warning-bg);
  93. color: var(--warning);
  94. border-color: rgba(217, 119, 6, 0.25);
  95. }
  96. .legend {
  97. display: flex;
  98. flex-wrap: wrap;
  99. gap: 10px 16px;
  100. margin: 16px 0 0;
  101. font-size: 12px;
  102. color: var(--text-muted);
  103. }
  104. .legend-item {
  105. display: inline-flex;
  106. align-items: center;
  107. gap: 6px;
  108. }
  109. .swatch {
  110. width: 14px;
  111. height: 14px;
  112. border-radius: 3px;
  113. border: 1px solid rgba(15, 23, 42, 0.08);
  114. }
  115. .panel {
  116. background: var(--panel);
  117. border: 1px solid var(--border);
  118. border-radius: var(--radius);
  119. box-shadow: var(--shadow);
  120. overflow: hidden;
  121. }
  122. .panel-top {
  123. display: flex;
  124. align-items: center;
  125. justify-content: space-between;
  126. gap: 12px;
  127. padding: 14px 18px;
  128. border-bottom: 1px solid var(--border);
  129. background: #fff;
  130. }
  131. .panel-top h2 {
  132. margin: 0;
  133. font-size: 16px;
  134. font-weight: 600;
  135. }
  136. .panel-top h2::before {
  137. content: "";
  138. display: inline-block;
  139. width: 3px;
  140. height: 1em;
  141. margin-right: 8px;
  142. vertical-align: -0.1em;
  143. border-radius: 2px;
  144. background: var(--primary);
  145. }
  146. .hint {
  147. font-size: 12px;
  148. color: var(--text-muted);
  149. }
  150. .filter-block {
  151. padding: 14px 18px 8px;
  152. border-bottom: 1px solid var(--border);
  153. }
  154. .filter-grid {
  155. display: grid;
  156. grid-template-columns: repeat(4, minmax(160px, 1fr));
  157. gap: 12px;
  158. }
  159. .filter-item label {
  160. display: block;
  161. font-size: 11px;
  162. color: var(--text-muted);
  163. margin-bottom: 4px;
  164. }
  165. .filter-item input,
  166. .filter-item select {
  167. width: 100%;
  168. height: 36px;
  169. padding: 0 10px;
  170. border: 1px solid var(--border);
  171. border-radius: var(--radius-sm);
  172. background: #fff;
  173. font: inherit;
  174. color: var(--text);
  175. }
  176. .filter-actions {
  177. display: flex;
  178. justify-content: flex-end;
  179. gap: 8px;
  180. margin-top: 12px;
  181. padding-bottom: 6px;
  182. }
  183. .btn {
  184. display: inline-flex;
  185. align-items: center;
  186. gap: 6px;
  187. height: 36px;
  188. padding: 0 14px;
  189. border-radius: var(--radius-sm);
  190. border: 1px solid var(--border);
  191. background: #fff;
  192. color: var(--text-secondary);
  193. font: inherit;
  194. font-weight: 500;
  195. cursor: pointer;
  196. }
  197. .btn:hover { background: var(--row-hover); }
  198. .btn-main {
  199. background: var(--primary);
  200. border-color: var(--primary);
  201. color: #fff;
  202. }
  203. .btn-main:hover { background: var(--primary-dark); }
  204. .table-scroll {
  205. overflow: auto;
  206. max-height: calc(100vh - 280px);
  207. }
  208. table.list-table {
  209. border-collapse: separate;
  210. border-spacing: 0;
  211. width: max-content;
  212. min-width: 100%;
  213. font-size: 13px;
  214. }
  215. .list-table th,
  216. .list-table td {
  217. border-bottom: 1px solid var(--border);
  218. border-right: 1px solid #eef2f0;
  219. padding: 8px 10px;
  220. text-align: center;
  221. white-space: nowrap;
  222. vertical-align: middle;
  223. }
  224. .list-table th {
  225. position: sticky;
  226. top: 0;
  227. z-index: 3;
  228. background: var(--table-head);
  229. color: var(--text-muted);
  230. font-weight: 600;
  231. font-size: 12px;
  232. }
  233. .list-table thead tr.group-row th {
  234. top: 0;
  235. z-index: 4;
  236. font-size: 12px;
  237. letter-spacing: 0.02em;
  238. }
  239. .list-table thead tr.sub-row th {
  240. top: 34px;
  241. z-index: 3;
  242. }
  243. .list-table tbody tr:nth-child(even) td { background: var(--row-alt); }
  244. .list-table tbody tr:hover td { background: var(--row-hover); }
  245. .sticky-left {
  246. position: sticky;
  247. left: 0;
  248. z-index: 2;
  249. background: #fff !important;
  250. box-shadow: 2px 0 0 rgba(15, 23, 42, 0.04);
  251. }
  252. .list-table tbody tr:nth-child(even) .sticky-left { background: var(--row-alt) !important; }
  253. .list-table tbody tr:hover .sticky-left { background: var(--row-hover) !important; }
  254. .list-table thead .sticky-left {
  255. z-index: 5;
  256. background: var(--table-head) !important;
  257. }
  258. .g-base { background: #f1f5f9 !important; color: var(--text-secondary); }
  259. .g-sum { background: #ecfdf5 !important; color: var(--primary-dark); }
  260. .g-p1 { background: var(--p1) !important; color: #1e40af; }
  261. .g-p2 { background: var(--p2) !important; color: #9a3412; }
  262. .g-p3 { background: var(--p3) !important; color: #854d0e; }
  263. .g-p4 { background: var(--p4) !important; color: #166534; }
  264. .g-p5 { background: var(--p5) !important; color: #9a3412; }
  265. .g-p6 { background: var(--p6) !important; color: #065f46; }
  266. .sub-p1 { background: #eff6ff !important; }
  267. .sub-p2 { background: #fff7ed !important; }
  268. .sub-p3 { background: #fefce8 !important; }
  269. .sub-p4 { background: #f0fdf4 !important; }
  270. .sub-p5 { background: #fff7ed !important; }
  271. .sub-p6 { background: #ecfdf5 !important; }
  272. .empty-period {
  273. color: #cbd5e1;
  274. }
  275. .amount-link {
  276. color: var(--primary-dark);
  277. font-weight: 600;
  278. text-decoration: none;
  279. border-bottom: 1px dashed rgba(5, 150, 105, 0.45);
  280. cursor: pointer;
  281. }
  282. .amount-link:hover {
  283. color: var(--primary);
  284. border-bottom-color: var(--primary);
  285. }
  286. .tag {
  287. display: inline-flex;
  288. align-items: center;
  289. height: 22px;
  290. padding: 0 8px;
  291. border-radius: 999px;
  292. font-size: 12px;
  293. font-weight: 500;
  294. }
  295. .tag-success { background: var(--primary-bg); color: var(--primary-dark); }
  296. .tag-warning { background: var(--warning-bg); color: var(--warning); }
  297. .tag-info { background: #f1f5f9; color: #64748b; }
  298. .tag-primary { background: #eff6ff; color: #1d4ed8; }
  299. .tag-danger { background: #fef2f2; color: var(--danger); }
  300. .muted { color: var(--text-muted); }
  301. .customer-cell { text-align: left; min-width: 100px; }
  302. .customer-cell .sub { font-size: 12px; color: var(--text-muted); }
  303. .pager {
  304. display: flex;
  305. align-items: center;
  306. justify-content: flex-end;
  307. gap: 8px;
  308. padding: 12px 18px;
  309. border-top: 1px solid var(--border);
  310. color: var(--text-muted);
  311. font-size: 13px;
  312. }
  313. .notes {
  314. max-width: 960px;
  315. margin-top: 20px;
  316. padding: 16px 18px;
  317. background: #fff;
  318. border: 1px solid var(--border);
  319. border-radius: var(--radius);
  320. }
  321. .notes h3 {
  322. margin: 0 0 8px;
  323. font-size: 14px;
  324. }
  325. .notes ul {
  326. margin: 0;
  327. padding-left: 18px;
  328. color: var(--text-muted);
  329. font-size: 13px;
  330. }
  331. .notes li { margin: 4px 0; }
  332. /* Modal */
  333. .backdrop {
  334. position: fixed;
  335. inset: 0;
  336. background: rgba(15, 23, 42, 0.35);
  337. display: none;
  338. align-items: center;
  339. justify-content: center;
  340. z-index: 50;
  341. padding: 24px;
  342. backdrop-filter: none;
  343. }
  344. .backdrop.is-open { display: flex; }
  345. .dialog {
  346. width: min(720px, 100%);
  347. max-height: calc(100vh - 48px);
  348. background: #fff;
  349. border-radius: var(--radius);
  350. box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  351. display: flex;
  352. flex-direction: column;
  353. overflow: hidden;
  354. }
  355. .dialog-header {
  356. display: flex;
  357. align-items: center;
  358. justify-content: space-between;
  359. padding: 14px 18px;
  360. border-bottom: 1px solid var(--border);
  361. }
  362. .dialog-header h3 {
  363. margin: 0;
  364. font-size: 16px;
  365. }
  366. .dialog-close {
  367. border: none;
  368. background: transparent;
  369. font-size: 20px;
  370. line-height: 1;
  371. color: var(--text-muted);
  372. cursor: pointer;
  373. }
  374. .dialog-body {
  375. padding: 16px 18px;
  376. overflow: auto;
  377. }
  378. .summary-grid {
  379. display: grid;
  380. grid-template-columns: repeat(3, 1fr);
  381. gap: 10px;
  382. margin-bottom: 16px;
  383. }
  384. .summary-item {
  385. background: var(--table-head);
  386. border: 1px solid var(--border);
  387. border-radius: var(--radius-sm);
  388. padding: 10px 12px;
  389. }
  390. .summary-item label {
  391. display: block;
  392. font-size: 11px;
  393. color: var(--text-muted);
  394. margin-bottom: 2px;
  395. }
  396. .summary-item strong {
  397. font-size: 14px;
  398. font-weight: 600;
  399. }
  400. .section-title {
  401. margin: 0 0 10px;
  402. font-size: 13px;
  403. font-weight: 600;
  404. color: var(--text-secondary);
  405. }
  406. .transfer-card {
  407. border: 1px solid var(--border);
  408. border-radius: var(--radius-sm);
  409. padding: 12px;
  410. margin-bottom: 10px;
  411. background: #fff;
  412. }
  413. .transfer-card:last-child { margin-bottom: 0; }
  414. .transfer-top {
  415. display: flex;
  416. flex-wrap: wrap;
  417. align-items: center;
  418. gap: 8px 12px;
  419. margin-bottom: 8px;
  420. }
  421. .transfer-meta {
  422. display: grid;
  423. grid-template-columns: repeat(2, 1fr);
  424. gap: 6px 12px;
  425. font-size: 13px;
  426. color: var(--text-secondary);
  427. }
  428. .transfer-meta span { color: var(--text-muted); }
  429. .attach-row {
  430. margin-top: 8px;
  431. display: flex;
  432. gap: 8px;
  433. flex-wrap: wrap;
  434. }
  435. .attach-chip {
  436. display: inline-flex;
  437. align-items: center;
  438. height: 26px;
  439. padding: 0 10px;
  440. border-radius: 6px;
  441. background: var(--primary-bg);
  442. color: var(--primary-dark);
  443. font-size: 12px;
  444. border: 1px dashed #a7f3d0;
  445. }
  446. .dialog-footer {
  447. display: flex;
  448. justify-content: flex-end;
  449. gap: 8px;
  450. padding: 12px 18px;
  451. border-top: 1px solid var(--border);
  452. background: var(--table-head);
  453. }
  454. .audit-timeline {
  455. margin-top: 8px;
  456. padding-top: 8px;
  457. border-top: 1px dashed var(--border);
  458. font-size: 12px;
  459. color: var(--text-muted);
  460. }
  461. .audit-timeline div { margin: 2px 0; }
  462. </style>
  463. </head>
  464. <body>
  465. <div class="page">
  466. <div class="hero">
  467. <h1>缴费信息 · 单列表 Demo(对齐 Excel 表头)</h1>
  468. <p>
  469. 去掉「已缴费 / 确认中 / 成功 / 按样本」四个 Tab,改为一行一样本:左侧基础信息 + 右侧第 1~6 期缴费块。
  470. 趸交 / 分改趸仅第 1 期有值;分期填满 1~6 期(无数据期显示 —)。
  471. <strong>点击各期「实缴金额」</strong>打开弹窗,查看该期单笔/多笔转账与财务审核。
  472. </p>
  473. <div class="context-bar">
  474. <span class="pill">一行 = 一个样本缴费方案</span>
  475. <span class="pill">期块固定 6 列组(对齐 Excel)</span>
  476. <span class="pill warn">实缴金额可点击 → 转账明细弹窗</span>
  477. </div>
  478. <div class="legend">
  479. <span class="legend-item"><i class="swatch" style="background:var(--p1)"></i>第1期</span>
  480. <span class="legend-item"><i class="swatch" style="background:var(--p2)"></i>第2期</span>
  481. <span class="legend-item"><i class="swatch" style="background:var(--p3)"></i>第3期</span>
  482. <span class="legend-item"><i class="swatch" style="background:var(--p4)"></i>第4期</span>
  483. <span class="legend-item"><i class="swatch" style="background:var(--p5)"></i>第5期</span>
  484. <span class="legend-item"><i class="swatch" style="background:var(--p6)"></i>第6期</span>
  485. </div>
  486. </div>
  487. <section class="panel">
  488. <div class="panel-top">
  489. <h2>缴费信息</h2>
  490. <div class="hint">横向滚动查看各期 · 姓名列左侧冻结</div>
  491. </div>
  492. <div class="filter-block">
  493. <div class="filter-grid">
  494. <div class="filter-item">
  495. <label>关键词</label>
  496. <input placeholder="姓名 / 手机 / 合同编号" />
  497. </div>
  498. <div class="filter-item">
  499. <label>缴费方式</label>
  500. <select>
  501. <option>全部</option>
  502. <option>趸交</option>
  503. <option>分期</option>
  504. <option>分改趸</option>
  505. </select>
  506. </div>
  507. <div class="filter-item">
  508. <label>到款状态</label>
  509. <select>
  510. <option>全部</option>
  511. <option>待缴费</option>
  512. <option>部分已缴</option>
  513. <option>缴费确认中</option>
  514. <option>已缴清</option>
  515. </select>
  516. </div>
  517. <div class="filter-item">
  518. <label>签署日期</label>
  519. <input placeholder="开始 — 结束" />
  520. </div>
  521. </div>
  522. <div class="filter-actions">
  523. <button type="button" class="btn">重置</button>
  524. <button type="button" class="btn btn-main">搜索</button>
  525. </div>
  526. </div>
  527. <div class="table-scroll">
  528. <table class="list-table" id="mainTable">
  529. <thead>
  530. <tr class="group-row">
  531. <th class="g-base sticky-left" colspan="11">基础信息</th>
  532. <th class="g-p1" colspan="5">第一期</th>
  533. <th class="g-p2" colspan="5">第二期</th>
  534. <th class="g-p3" colspan="5">第三期</th>
  535. <th class="g-p4" colspan="5">第四期</th>
  536. <th class="g-p5" colspan="5">第五期</th>
  537. <th class="g-p6" colspan="5">第六期</th>
  538. <th class="g-sum" colspan="3">汇总</th>
  539. </tr>
  540. <tr class="sub-row">
  541. <th class="sticky-left">序号</th>
  542. <th>姓名</th>
  543. <th>手机号</th>
  544. <th>合同编号</th>
  545. <th>合同签署日期</th>
  546. <th>存储年限</th>
  547. <th>存储项目</th>
  548. <th>合同总额</th>
  549. <th>缴费方式</th>
  550. <th>优惠金额</th>
  551. <th>应收总额</th>
  552. <!-- period headers x6 -->
  553. <th class="sub-p1">应缴金额</th>
  554. <th class="sub-p1">实缴金额</th>
  555. <th class="sub-p1">缴费日期</th>
  556. <th class="sub-p1">支付方式</th>
  557. <th class="sub-p1">财务审核</th>
  558. <th class="sub-p2">应缴金额</th>
  559. <th class="sub-p2">实缴金额</th>
  560. <th class="sub-p2">缴费日期</th>
  561. <th class="sub-p2">支付方式</th>
  562. <th class="sub-p2">财务审核</th>
  563. <th class="sub-p3">应缴金额</th>
  564. <th class="sub-p3">实缴金额</th>
  565. <th class="sub-p3">缴费日期</th>
  566. <th class="sub-p3">支付方式</th>
  567. <th class="sub-p3">财务审核</th>
  568. <th class="sub-p4">应缴金额</th>
  569. <th class="sub-p4">实缴金额</th>
  570. <th class="sub-p4">缴费日期</th>
  571. <th class="sub-p4">支付方式</th>
  572. <th class="sub-p4">财务审核</th>
  573. <th class="sub-p5">应缴金额</th>
  574. <th class="sub-p5">实缴金额</th>
  575. <th class="sub-p5">缴费日期</th>
  576. <th class="sub-p5">支付方式</th>
  577. <th class="sub-p5">财务审核</th>
  578. <th class="sub-p6">应缴金额</th>
  579. <th class="sub-p6">实缴金额</th>
  580. <th class="sub-p6">缴费日期</th>
  581. <th class="sub-p6">支付方式</th>
  582. <th class="sub-p6">财务审核</th>
  583. <th>累计实缴</th>
  584. <th>待缴金额</th>
  585. <th>备注</th>
  586. </tr>
  587. </thead>
  588. <tbody id="tbody"></tbody>
  589. </table>
  590. </div>
  591. <div class="pager">共 3 条 · 演示数据</div>
  592. </section>
  593. <div class="notes">
  594. <h3>与现有系统字段映射(Demo 说明)</h3>
  595. <ul>
  596. <li><strong>一行粒度</strong>:样本缴费方案(与现「按样本」一致),不是按转账笔、也不是按协议整单。</li>
  597. <li><strong>趸交 / 分改趸</strong>:仅第 1 期有 schedule;第 2~6 期显示 —。</li>
  598. <li><strong>分期</strong>:按实际期数填 1~N;本 Demo 固定展示 6 列组,未用到的期显示 —(产品若确认最多 6 期则与 Excel 一致)。</li>
  599. <li><strong>期块「实缴金额」</strong>:该期全部转账金额合计(含确认中);点击后弹窗列出每笔转账与 pay_status / 财务审核时间线。</li>
  600. <li><strong>期块「缴费日期 / 支付方式 / 财务审核」</strong>:多笔时 Demo 取「最近一笔成功/确认中」摘要;完整明细以弹窗为准。</li>
  601. <li><strong>原流程三 Tab</strong>:待缴费/确认中/成功可由筛选「到款状态」或行内 Tag 替代,不再分 Tab。</li>
  602. </ul>
  603. </div>
  604. </div>
  605. <div class="backdrop" id="backdrop" role="dialog" aria-modal="true">
  606. <div class="dialog">
  607. <div class="dialog-header">
  608. <h3 id="dlgTitle">第 N 期 · 转账记录</h3>
  609. <button type="button" class="dialog-close" id="dlgClose" aria-label="关闭">×</button>
  610. </div>
  611. <div class="dialog-body" id="dlgBody"></div>
  612. <div class="dialog-footer">
  613. <button type="button" class="btn" id="dlgCloseBtn">关闭</button>
  614. <button type="button" class="btn btn-main" id="dlgConfirmBtn">缴费确认</button>
  615. </div>
  616. </div>
  617. </div>
  618. <script>
  619. const money = (n) =>
  620. n == null || n === '' || Number.isNaN(Number(n))
  621. ? '—'
  622. : Number(n).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
  623. const payModeTag = (m) => {
  624. if (m === 'dj') return '<span class="tag tag-success">趸交</span>'
  625. if (m === 'fgd') return '<span class="tag tag-warning">分改趸</span>'
  626. if (m === 'fq') return '<span class="tag tag-primary">分期</span>'
  627. return '<span class="tag tag-info">—</span>'
  628. }
  629. const auditTag = (s) => {
  630. const map = {
  631. yjf: ['tag-success', '已通过'],
  632. jfqrz: ['tag-warning', '确认中'],
  633. dfj: ['tag-info', '待缴费'],
  634. partial: ['tag-primary', '部分到账'],
  635. none: ['tag-info', '—']
  636. }
  637. const [cls, label] = map[s] || map.none
  638. return `<span class="tag ${cls}">${label}</span>`
  639. }
  640. /** Demo rows: base + schedules[0..5] each with transfers[] */
  641. const rows = [
  642. {
  643. id: 'r1',
  644. name: '张敏',
  645. phone: '138****6210',
  646. protocolNo: 'XY-2026-0312',
  647. signDate: '2026-03-12',
  648. years: '20年',
  649. project: '脐带血干细胞',
  650. contractAmount: 22880,
  651. payMode: 'dj',
  652. discount: 880,
  653. receivable: 22000,
  654. remark: '趸交一次结清',
  655. schedules: [
  656. {
  657. due: 22000,
  658. paid: 22000,
  659. payDate: '2026-03-15',
  660. payType: '银行转账',
  661. audit: 'yjf',
  662. transfers: [
  663. {
  664. id: 't1',
  665. amount: 22000,
  666. type: '银行转账',
  667. time: '2026-03-15 14:22',
  668. status: 'yjf',
  669. voucher: '回单-0315.pdf',
  670. auditLog: [
  671. '03-15 14:30 提交财务确认',
  672. '03-15 16:02 财务审核通过'
  673. ]
  674. }
  675. ]
  676. },
  677. null, null, null, null, null
  678. ]
  679. },
  680. {
  681. id: 'r2',
  682. name: '李芳',
  683. phone: '159****8831',
  684. protocolNo: 'XY-2026-0418',
  685. signDate: '2026-04-18',
  686. years: '20年',
  687. project: '脐带间充质',
  688. contractAmount: 29800,
  689. payMode: 'fq',
  690. discount: 0,
  691. receivable: 29800,
  692. remark: '六期分期;第1期有两笔转账',
  693. schedules: [
  694. {
  695. due: 5000,
  696. paid: 5000,
  697. payDate: '2026-04-20',
  698. payType: '多笔',
  699. audit: 'yjf',
  700. transfers: [
  701. {
  702. id: 't2a',
  703. amount: 3000,
  704. type: '微信',
  705. time: '2026-04-19 10:11',
  706. status: 'yjf',
  707. voucher: 'wx-0419.jpg',
  708. auditLog: ['04-19 提交', '04-19 财务通过']
  709. },
  710. {
  711. id: 't2b',
  712. amount: 2000,
  713. type: '银行转账',
  714. time: '2026-04-20 09:40',
  715. status: 'yjf',
  716. voucher: '银行回单.pdf',
  717. auditLog: ['04-20 提交', '04-20 财务通过']
  718. }
  719. ]
  720. },
  721. {
  722. due: 4960,
  723. paid: 4960,
  724. payDate: '2026-05-18',
  725. payType: '银行转账',
  726. audit: 'yjf',
  727. transfers: [
  728. {
  729. id: 't3',
  730. amount: 4960,
  731. type: '银行转账',
  732. time: '2026-05-18 11:05',
  733. status: 'yjf',
  734. voucher: '回单-0518.pdf',
  735. auditLog: ['05-18 提交', '05-18 财务通过']
  736. }
  737. ]
  738. },
  739. {
  740. due: 4960,
  741. paid: 2000,
  742. payDate: '2026-06-18',
  743. payType: 'POS',
  744. audit: 'jfqrz',
  745. transfers: [
  746. {
  747. id: 't4',
  748. amount: 2000,
  749. type: 'POS',
  750. time: '2026-06-18 15:20',
  751. status: 'jfqrz',
  752. voucher: 'pos小票.jpg',
  753. auditLog: ['06-18 16:01 已提交财务,待审核']
  754. }
  755. ]
  756. },
  757. {
  758. due: 4960,
  759. paid: 0,
  760. payDate: null,
  761. payType: null,
  762. audit: 'dfj',
  763. transfers: []
  764. },
  765. {
  766. due: 4960,
  767. paid: 0,
  768. payDate: null,
  769. payType: null,
  770. audit: 'dfj',
  771. transfers: []
  772. },
  773. {
  774. due: 4960,
  775. paid: 0,
  776. payDate: null,
  777. payType: null,
  778. audit: 'dfj',
  779. transfers: []
  780. }
  781. ]
  782. },
  783. {
  784. id: 'r3',
  785. name: '王丽',
  786. phone: '186****2209',
  787. protocolNo: 'XY-2025-1120',
  788. signDate: '2025-11-20',
  789. years: '20年',
  790. project: '脐带血干细胞',
  791. contractAmount: 26800,
  792. payMode: 'fgd',
  793. discount: 800,
  794. receivable: 26000,
  795. remark: '原分期后改为趸交结清',
  796. schedules: [
  797. {
  798. due: 26000,
  799. paid: 26000,
  800. payDate: '2026-01-08',
  801. payType: '银行转账',
  802. audit: 'yjf',
  803. transfers: [
  804. {
  805. id: 't5',
  806. amount: 10000,
  807. type: '银行转账',
  808. time: '2025-12-01 09:00',
  809. status: 'yjf',
  810. voucher: '分期首付.pdf',
  811. auditLog: ['已通过(历史分期首付)']
  812. },
  813. {
  814. id: 't6',
  815. amount: 16000,
  816. type: '银行转账',
  817. time: '2026-01-08 13:40',
  818. status: 'yjf',
  819. voucher: '分改趸补缴.pdf',
  820. auditLog: ['01-08 提交分改趸补缴', '01-08 财务通过']
  821. }
  822. ]
  823. },
  824. null, null, null, null, null
  825. ]
  826. }
  827. ]
  828. function periodCells(row, sch, periodIndex) {
  829. if (!sch) {
  830. return Array(5)
  831. .fill('<td class="empty-period">—</td>')
  832. .join('')
  833. }
  834. const paidClickable =
  835. (sch.transfers && sch.transfers.length > 0) || Number(sch.paid) > 0
  836. const paidHtml = paidClickable
  837. ? `<a class="amount-link" href="javascript:void(0)" data-row="${row.id}" data-period="${periodIndex}">${money(sch.paid)}</a>`
  838. : `<span class="muted">${money(sch.paid)}</span>`
  839. return [
  840. `<td>${money(sch.due)}</td>`,
  841. `<td>${paidHtml}</td>`,
  842. `<td>${sch.payDate || '—'}</td>`,
  843. `<td>${sch.payType || '—'}</td>`,
  844. `<td>${auditTag(sch.audit)}</td>`
  845. ].join('')
  846. }
  847. function renderRows() {
  848. const tbody = document.getElementById('tbody')
  849. tbody.innerHTML = rows
  850. .map((row, idx) => {
  851. const paidSum = row.schedules.reduce(
  852. (s, sch) => s + (sch && sch.paid ? Number(sch.paid) : 0),
  853. 0
  854. )
  855. const dueRemain = Math.max(0, Number(row.receivable) - paidSum)
  856. const periods = row.schedules
  857. .map((sch, i) => periodCells(row, sch, i))
  858. .join('')
  859. return `<tr>
  860. <td class="sticky-left">${idx + 1}</td>
  861. <td class="customer-cell"><div>${row.name}</div></td>
  862. <td>${row.phone}</td>
  863. <td>${row.protocolNo}</td>
  864. <td>${row.signDate}</td>
  865. <td>${row.years}</td>
  866. <td>${row.project}</td>
  867. <td>${money(row.contractAmount)}</td>
  868. <td>${payModeTag(row.payMode)}</td>
  869. <td>${money(row.discount)}</td>
  870. <td>${money(row.receivable)}</td>
  871. ${periods}
  872. <td><strong style="color:var(--primary-dark)">${money(paidSum)}</strong></td>
  873. <td>${money(dueRemain)}</td>
  874. <td class="muted">${row.remark || '—'}</td>
  875. </tr>`
  876. })
  877. .join('')
  878. }
  879. function openDialog(rowId, periodIndex) {
  880. const row = rows.find((r) => r.id === rowId)
  881. if (!row) return
  882. const sch = row.schedules[periodIndex]
  883. if (!sch) return
  884. const title = document.getElementById('dlgTitle')
  885. title.textContent = `${row.name} · ${row.protocolNo} · 第 ${periodIndex + 1} 期转账记录`
  886. const transfers = sch.transfers || []
  887. const body = document.getElementById('dlgBody')
  888. body.innerHTML = `
  889. <div class="summary-grid">
  890. <div class="summary-item"><label>应缴金额</label><strong>${money(sch.due)}</strong></div>
  891. <div class="summary-item"><label>实缴合计</label><strong style="color:var(--primary-dark)">${money(sch.paid)}</strong></div>
  892. <div class="summary-item"><label>欠缴</label><strong>${money(Math.max(0, Number(sch.due) - Number(sch.paid)))}</strong></div>
  893. <div class="summary-item"><label>缴费方式</label><strong>${row.payMode === 'dj' ? '趸交' : row.payMode === 'fgd' ? '分改趸' : '分期'}</strong></div>
  894. <div class="summary-item"><label>本期财务审核</label><strong>${auditTag(sch.audit)}</strong></div>
  895. <div class="summary-item"><label>转账笔数</label><strong>${transfers.length} 笔</strong></div>
  896. </div>
  897. <div class="section-title">转账明细(含财务审核)</div>
  898. ${
  899. transfers.length
  900. ? transfers
  901. .map(
  902. (tr, i) => `
  903. <div class="transfer-card">
  904. <div class="transfer-top">
  905. <strong>第 ${i + 1} 笔</strong>
  906. ${auditTag(tr.status)}
  907. <span style="color:var(--primary-dark);font-weight:600">${money(tr.amount)}</span>
  908. </div>
  909. <div class="transfer-meta">
  910. <div><span>支付方式</span> · ${tr.type}</div>
  911. <div><span>转账时间</span> · ${tr.time}</div>
  912. </div>
  913. <div class="attach-row"><span class="attach-chip">${tr.voucher || '无凭证'}</span></div>
  914. <div class="audit-timeline">
  915. ${(tr.auditLog || []).map((line) => `<div>• ${line}</div>`).join('') || '<div>• 暂无审核记录</div>'}
  916. </div>
  917. </div>`
  918. )
  919. .join('')
  920. : '<div class="muted">暂无转账笔。可在此发起「缴费确认」创建第一笔。</div>'
  921. }
  922. `
  923. const confirmBtn = document.getElementById('dlgConfirmBtn')
  924. confirmBtn.style.display =
  925. sch.audit === 'dfj' || (Number(sch.due) > Number(sch.paid) && sch.audit !== 'jfqrz')
  926. ? 'inline-flex'
  927. : 'none'
  928. document.getElementById('backdrop').classList.add('is-open')
  929. }
  930. function closeDialog() {
  931. document.getElementById('backdrop').classList.remove('is-open')
  932. }
  933. document.getElementById('tbody').addEventListener('click', (e) => {
  934. const a = e.target.closest('.amount-link')
  935. if (!a) return
  936. openDialog(a.dataset.row, Number(a.dataset.period))
  937. })
  938. document.getElementById('dlgClose').addEventListener('click', closeDialog)
  939. document.getElementById('dlgCloseBtn').addEventListener('click', closeDialog)
  940. document.getElementById('backdrop').addEventListener('click', (e) => {
  941. if (e.target.id === 'backdrop') closeDialog()
  942. })
  943. document.getElementById('dlgConfirmBtn').addEventListener('click', () => {
  944. alert('Demo:此处复用现有 PaymentReceiptConfirmDialog(上传凭证 / 仅保存 / 提交财务确认)')
  945. })
  946. renderRows()
  947. </script>
  948. </body>
  949. </html>