| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>运输计划类列表 · Excel 合并单元格 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;
- --text: #1e293b;
- --muted: #64748b;
- --border: #d9e8e2;
- --head: #f8fafc;
- --page: #eef2f6;
- --panel: #fff;
- --warn: #d97706;
- --danger: #dc2626;
- --alt: #f8fafc;
- --plan-end: #94a3b8;
- }
- * { box-sizing: border-box; }
- body {
- margin: 0;
- padding: 24px 20px 80px;
- font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
- font-size: 14px;
- color: var(--text);
- background: var(--page);
- }
- .page { max-width: 1680px; margin: 0 auto; }
- .hero {
- background: linear-gradient(135deg, #ecfdf5 0%, #fff 58%, #f8fafc 100%);
- border: 1px solid var(--border);
- border-radius: 10px;
- padding: 20px 22px;
- margin-bottom: 16px;
- }
- .hero h1 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
- .hero h1 em { font-style: normal; color: var(--primary-dark); }
- .hero p { margin: 0; color: var(--muted); line-height: 1.55; max-width: 1100px; }
- .pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
- .pill {
- font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
- background: var(--primary-bg); color: var(--primary-dark); border: 1px solid #a7f3d0;
- }
- .pill.muted { background: #f1f5f9; color: var(--muted); border-color: #e2e8f0; }
- .pill.warn { background: #fffbeb; color: var(--warn); border-color: #fde68a; }
- .tabs {
- display: flex; flex-wrap: wrap; gap: 6px;
- background: var(--panel); border: 1px solid var(--border);
- border-radius: 10px 10px 0 0; padding: 8px 10px 0;
- }
- .tab {
- border: none; background: transparent; cursor: pointer; font-family: inherit;
- padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--muted);
- border-bottom: 2px solid transparent;
- }
- .tab:hover { color: var(--primary-dark); }
- .tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
- .tab .rec {
- margin-left: 6px; font-size: 10px; padding: 1px 6px; border-radius: 999px;
- background: var(--primary-bg); color: var(--primary-dark); border: 1px solid #a7f3d0;
- }
- .panel {
- display: none;
- background: var(--panel);
- border: 1px solid var(--border);
- border-top: none;
- border-radius: 0 0 10px 10px;
- padding: 16px 18px 22px;
- }
- .panel.active { display: block; }
- .desc {
- margin: 0 0 12px; padding: 12px 14px; border-radius: 8px;
- background: #f0f9ff; border: 1px solid #bae6fd; color: #0369a1; font-size: 13px; line-height: 1.55;
- }
- .desc strong { color: var(--text); }
- .pain {
- margin: 0 0 14px; padding: 10px 12px; border-radius: 8px;
- background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: 12.5px; line-height: 1.5;
- }
- .ok {
- margin: 0 0 14px; padding: 10px 12px; border-radius: 8px;
- background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-size: 12.5px; line-height: 1.5;
- }
- .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
- table.list {
- width: 100%;
- border-collapse: collapse;
- min-width: 1280px;
- font-size: 13px;
- }
- table.list th, table.list td {
- border: 1px solid #e2e8f0;
- padding: 8px 10px;
- vertical-align: middle;
- text-align: left;
- }
- table.list th {
- background: var(--head);
- font-size: 12px;
- font-weight: 600;
- color: var(--muted);
- white-space: nowrap;
- text-align: center;
- }
- table.list th.left { text-align: left; }
- table.list td.center { text-align: center; }
- table.list td.right { text-align: right; }
- table.list td.merge {
- background: #fff;
- vertical-align: middle;
- }
- table.list tr.plan-alt td { background: #fafbfc; }
- table.list tr.plan-alt td.merge { background: #f8fafc; }
- table.list tr.plan-end td { border-bottom: 2px solid var(--plan-end); }
- a.plan-link { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
- a.plan-link:hover { text-decoration: underline; }
- .tag {
- display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 4px;
- font-size: 12px; font-weight: 600; color: #fff; background: #059669; white-space: nowrap;
- }
- .tag.warn { background: #d97706; }
- .tag.danger { background: #dc2626; }
- .tag.info { background: transparent; color: var(--text); border: 1px solid #cbd5e1; }
- .tag.inner { background: #059669; margin-left: 4px; font-size: 11px; }
- .sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
- /* 现状:格内虚线叠放 */
- .stack { display: flex; flex-direction: column; width: 100%; }
- .stack__row { padding: 2px 0; }
- .stack__row + .stack__row {
- margin-top: 6px; padding-top: 6px;
- border-top: 1px dashed #e2e8f0;
- }
- .group {
- width: 100%; overflow: hidden; border-radius: 8px; border: 1px solid #a7f3d0; background: #ecfdf5;
- }
- .group + .group { margin-top: 8px; }
- .group.tone-1 { background: #e0f2fe; border-color: #bae6fd; }
- .group.tone-1 .group-hd { background: #bae6fd; }
- .group-hd {
- padding: 5px 8px; background: #d1fae5; font-size: 11px; font-weight: 600; color: var(--primary-dark);
- }
- .group-chip {
- display: inline-block; padding: 1px 8px; border-radius: 8px;
- background: rgba(255,255,255,.72); border: 1px solid #a7f3d0;
- }
- .tone-1 .group-chip { border-color: #7dd3fc; color: #0369a1; }
- .group-bd { padding: 6px 8px; display: flex; flex-direction: column; gap: 6px; }
- .prod { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
- .prod + .prod { padding-top: 6px; border-top: 1px dashed rgba(15,23,42,.12); }
- .legend {
- margin-top: 14px;
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
- gap: 8px;
- font-size: 12.5px;
- color: var(--muted);
- }
- .legend div {
- padding: 8px 10px; border: 1px dashed #e2e8f0; border-radius: 8px; background: #fafbfc;
- }
- .legend b { color: var(--text); }
- .note { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
- </style>
- </head>
- <body>
- <div class="page">
- <header class="hero">
- <h1>运输计划 / 运输归档 / 危化品证 · <em>Excel 合并行</em> Demo</h1>
- <p>
- 对照同一组样例数据:一辆车、两个送货客户、两份合同、两个产品。
- 现状把「装/送」和「多产品」都塞进同一个单元格,靠虚线和色块区分;
- 下面方案改成真正的表格行:<strong>左边计划信息合并</strong>,<strong>右边一行一条子数据</strong>。
- </p>
- <div class="pills">
- <span class="pill">Fresh Mint</span>
- <span class="pill muted">计划编号 JH260330-001</span>
- <span class="pill muted">2 个送货客户</span>
- <span class="pill warn">痛点:格内虚线 + 合同色块</span>
- </div>
- </header>
- <nav class="tabs">
- <button class="tab active" data-tab="now">0. 现状</button>
- <button class="tab" data-tab="a">A. 一行一产品(两级合并)<span class="rec">推荐</span></button>
- <button class="tab" data-tab="b">B. 一行一装/送</button>
- <button class="tab" data-tab="c">C. 装/送拆成列,产品分行</button>
- </nav>
- <!-- 0 现状 -->
- <section id="now" class="panel active">
- <p class="desc">
- <strong>现在三个列表的读法:</strong>
- 一行 = 一个「装货 × 一个送货」。计划编号、车牌等已经跨行合并。
- 但地址、合同、数量仍在<strong>同一格里上下叠放</strong>(虚线分隔);
- 产品列还按合同涂了绿/蓝底。
- </p>
- <p class="pain">
- 同一格里既有装货又有送货、既有合同块又有产品行,横扫对不上。色块也不知道代表合同还是段次。
- </p>
- <div class="table-wrap">
- <table class="list">
- <thead>
- <tr>
- <th>计划编号</th>
- <th>状态</th>
- <th>车牌</th>
- <th class="left">装货客户</th>
- <th class="left">送货客户</th>
- <th class="left">地址 / 时间</th>
- <th class="left">产品名称</th>
- <th>包装</th>
- <th>计划数量</th>
- <th class="left">合同</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="merge" rowspan="2"><a class="plan-link" href="#">JH260330-001</a></td>
- <td class="merge center" rowspan="2"><span class="tag">已安排</span></td>
- <td class="merge center" rowspan="2">鄂E·A1234</td>
- <td rowspan="2">云栋化工 <span class="tag inner">内部</span></td>
- <td>宜昌磷肥厂</td>
- <td>
- <div class="stack">
- <div class="stack__row">枝江装货点<div class="sub">10-06 08:00</div></div>
- <div class="stack__row">宜昌卸货点<div class="sub">10-06 14:00</div></div>
- </div>
- </td>
- <td>
- <div class="group">
- <div class="group-hd"><span class="group-chip">HT-2026-001</span></div>
- <div class="group-bd">
- <div class="prod">尿素 <span class="tag warn">毒</span></div>
- <div class="prod">液氨</div>
- </div>
- </div>
- </td>
- <td class="center">
- <div class="stack">
- <div class="stack__row">50kg</div>
- <div class="stack__row">槽罐</div>
- </div>
- </td>
- <td class="right">
- <div class="stack">
- <div class="stack__row">
- <div class="group"><div class="group-bd"><div>30</div><div class="prod">10</div></div></div>
- </div>
- <div class="stack__row">
- <div class="group"><div class="group-bd"><div>20</div><div class="prod">8</div></div></div>
- </div>
- </div>
- </td>
- <td>
- <div class="stack">
- <div class="stack__row">供 HT-2026-001</div>
- <div class="stack__row">需 HT-2026-088</div>
- </div>
- </td>
- </tr>
- <tr class="plan-end">
- <td>荆州农资</td>
- <td>
- <div class="stack">
- <div class="stack__row">枝江装货点<div class="sub">10-06 08:00</div></div>
- <div class="stack__row">荆州卸货点<div class="sub">10-06 18:30</div></div>
- </div>
- </td>
- <td>
- <div class="group tone-1">
- <div class="group-hd"><span class="group-chip">HT-2026-088</span></div>
- <div class="group-bd">
- <div class="prod">尿素 <span class="tag warn">毒</span></div>
- </div>
- </div>
- </td>
- <td class="center">50kg</td>
- <td class="right">
- <div class="stack">
- <div class="stack__row"><div class="group tone-1"><div class="group-bd">12</div></div></div>
- <div class="stack__row"><div class="group tone-1"><div class="group-bd">12</div></div></div>
- </div>
- </td>
- <td>
- <div class="stack">
- <div class="stack__row">供 HT-2026-001</div>
- <div class="stack__row">需 HT-2026-088</div>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="legend">
- <div><b>计划区</b> 已经是合并单元格(编号/状态/车牌)。</div>
- <div><b>虚线</b> 出现在地址、数量、合同、包装等多列,表示「上=装、下=送」。</div>
- <div><b>绿/蓝色块</b> 表示不同合同,不是装/送,也不是产品本身。</div>
- </div>
- </section>
- <!-- A 推荐 -->
- <section id="a" class="panel">
- <p class="desc">
- <strong>方案 A(推荐):Excel 两级合并 + 一行一产品。</strong>
- 计划信息跨行合并;同一送货客户再合并;最右边产品、包装、数量各占一行。
- 去掉格内虚线和合同色块。合同号作为普通列文字。
- </p>
- <p class="ok">
- 横扫即可:这一行就是「这辆车 → 这个送货客户 → 这一票货」。装货数量 / 送货数量拆成两列,不再上下叠。
- </p>
- <div class="table-wrap">
- <table class="list">
- <thead>
- <tr>
- <th>计划编号</th>
- <th>状态</th>
- <th>车牌</th>
- <th class="left">装货客户</th>
- <th class="left">送货客户</th>
- <th class="left">装货地址 / 时间</th>
- <th class="left">送货地址 / 时间</th>
- <th class="left">产品</th>
- <th>包装</th>
- <th>装货量</th>
- <th>送货量</th>
- <th class="left">装货合同</th>
- <th class="left">送货合同</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="merge" rowspan="3"><a class="plan-link" href="#">JH260330-001</a></td>
- <td class="merge center" rowspan="3"><span class="tag">已安排</span></td>
- <td class="merge center" rowspan="3">鄂E·A1234</td>
- <td class="merge" rowspan="3">云栋化工 <span class="tag inner">内部</span></td>
- <td class="merge" rowspan="2">宜昌磷肥厂</td>
- <td class="merge" rowspan="3">枝江装货点<div class="sub">10-06 08:00</div></td>
- <td class="merge" rowspan="2">宜昌卸货点<div class="sub">10-06 14:00</div></td>
- <td>尿素 <span class="tag warn">毒</span></td>
- <td class="center">50kg</td>
- <td class="right">30</td>
- <td class="right">20</td>
- <td class="merge" rowspan="3">HT-2026-001</td>
- <td class="merge" rowspan="2">HT-2026-088</td>
- </tr>
- <tr>
- <td>液氨</td>
- <td class="center">槽罐</td>
- <td class="right">10</td>
- <td class="right">8</td>
- </tr>
- <tr class="plan-end">
- <td>荆州农资</td>
- <td>荆州卸货点<div class="sub">10-06 18:30</div></td>
- <td>尿素 <span class="tag warn">毒</span></td>
- <td class="center">50kg</td>
- <td class="right">12</td>
- <td class="right">12</td>
- <td>HT-2026-088</td>
- </tr>
- </tbody>
- </table>
- </div>
- <p class="note">
- 危化品证页可把「送货合同」换成证书列,仍按产品分行(一行一个产品的证)。
- 归档页可把装货量/送货量换成入库量/出库量。三页共用同一套行模型。
- </p>
- <div class="legend">
- <div><b>第 1 级合并</b> 计划编号、状态、车牌、装货客户、装货地址、装货合同。</div>
- <div><b>第 2 级合并</b> 同一送货客户的地址、送货合同跨该客户下的产品行。</div>
- <div><b>不合并</b> 产品、包装、装货量、送货量 — 一行一条货。</div>
- </div>
- </section>
- <!-- B -->
- <section id="b" class="panel">
- <p class="desc">
- <strong>方案 B:一行一个装/送段。</strong>
- 回到更早的「装一行、送一行」。计划列合并。产品如果一段有多件,仍可能在格内换行,但不再用装/送虚线。
- </p>
- <p class="pain">
- 去掉了装/送叠放,但产品多件时格内仍会挤在一起;装货行没有送货客户,筛选后对侧仍可能看不见(这正是当时改成配对行的原因)。
- </p>
- <div class="table-wrap">
- <table class="list">
- <thead>
- <tr>
- <th>计划编号</th>
- <th>状态</th>
- <th>车牌</th>
- <th>段次</th>
- <th class="left">客户</th>
- <th class="left">地址 / 时间</th>
- <th class="left">产品</th>
- <th>数量</th>
- <th class="left">合同</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="merge" rowspan="3"><a class="plan-link" href="#">JH260330-001</a></td>
- <td class="merge center" rowspan="3"><span class="tag">已安排</span></td>
- <td class="merge center" rowspan="3">鄂E·A1234</td>
- <td class="center">装</td>
- <td>云栋化工 <span class="tag inner">内部</span></td>
- <td>枝江装货点<div class="sub">10-06 08:00</div></td>
- <td>尿素 · 液氨</td>
- <td class="right">30 + 10</td>
- <td>HT-2026-001</td>
- </tr>
- <tr>
- <td class="center">送</td>
- <td>宜昌磷肥厂</td>
- <td>宜昌卸货点<div class="sub">10-06 14:00</div></td>
- <td>尿素 · 液氨</td>
- <td class="right">20 + 8</td>
- <td>HT-2026-088</td>
- </tr>
- <tr class="plan-end">
- <td class="center">送</td>
- <td>荆州农资</td>
- <td>荆州卸货点<div class="sub">10-06 18:30</div></td>
- <td>尿素</td>
- <td class="right">12</td>
- <td>HT-2026-088</td>
- </tr>
- </tbody>
- </table>
- </div>
- <p class="note">改动相对小(接近旧段次行),但「一行一个子数据」不够彻底,产品仍糊在一起。</p>
- </section>
- <!-- C -->
- <section id="c" class="panel">
- <p class="desc">
- <strong>方案 C:装/送全部拆列,产品仍分行,但客户/地址不再二级合并。</strong>
- 计划列合并;每一产品行把装货客户、送货客户、两边数量都摊开。
- 同一计划多送货时,装货侧会在多行重复(不合并),更像「拍扁的 Excel 明细表」。
- </p>
- <p class="ok">实现最简单:只需按产品展开行,计划字段 rowspan。复制到 Excel 也最直接。</p>
- <div class="table-wrap">
- <table class="list">
- <thead>
- <tr>
- <th>计划编号</th>
- <th>状态</th>
- <th>车牌</th>
- <th class="left">装货客户</th>
- <th class="left">送货客户</th>
- <th class="left">产品</th>
- <th>包装</th>
- <th>装货量</th>
- <th>送货量</th>
- <th class="left">装货合同</th>
- <th class="left">送货合同</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="merge" rowspan="3"><a class="plan-link" href="#">JH260330-001</a></td>
- <td class="merge center" rowspan="3"><span class="tag">已安排</span></td>
- <td class="merge center" rowspan="3">鄂E·A1234</td>
- <td>云栋化工</td>
- <td>宜昌磷肥厂</td>
- <td>尿素 <span class="tag warn">毒</span></td>
- <td class="center">50kg</td>
- <td class="right">30</td>
- <td class="right">20</td>
- <td>HT-2026-001</td>
- <td>HT-2026-088</td>
- </tr>
- <tr>
- <td>云栋化工</td>
- <td>宜昌磷肥厂</td>
- <td>液氨</td>
- <td class="center">槽罐</td>
- <td class="right">10</td>
- <td class="right">8</td>
- <td>HT-2026-001</td>
- <td>HT-2026-088</td>
- </tr>
- <tr class="plan-end">
- <td>云栋化工</td>
- <td>荆州农资</td>
- <td>尿素 <span class="tag warn">毒</span></td>
- <td class="center">50kg</td>
- <td class="right">12</td>
- <td class="right">12</td>
- <td>HT-2026-001</td>
- <td>HT-2026-088</td>
- </tr>
- </tbody>
- </table>
- </div>
- <p class="note">
- 装货客户会在每一行重复。看起来更「表」,但同一客户视觉上不如方案 A 干净。
- </p>
- </section>
- </div>
- <script>
- const tabs = document.querySelectorAll('.tab')
- const panels = document.querySelectorAll('.panel')
- tabs.forEach((tab) => {
- tab.addEventListener('click', () => {
- tabs.forEach((t) => t.classList.remove('active'))
- panels.forEach((p) => p.classList.remove('active'))
- tab.classList.add('active')
- document.getElementById(tab.dataset.tab).classList.add('active')
- })
- })
- </script>
- </body>
- </html>
|