feat: 客户列表展示全部字段并加斑马纹/网格线

- 列表补齐结算人、产品明细、押金、买断、备注,按业务顺序排列
- 长文本列(产品明细/备注)换行完整显示
- Table 组件新增可选 striped/bordered,仅客户列表启用

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 23:19:59 +08:00
co-authored by Claude Opus 4.8
parent 2c337c7d62
commit 689c0de91d
2 changed files with 37 additions and 10 deletions
+18 -8
View File
@@ -54,22 +54,27 @@ export default async function CustomersPage({
/> />
<Card className="overflow-hidden"> <Card className="overflow-hidden">
<Table> <Table striped bordered>
<THead> <THead>
<tr> <tr>
<TH>客户名称</TH> <TH>商户名称</TH>
<TH>联系人</TH> <TH>联系人</TH>
<TH>电话</TH> <TH>结算人</TH>
<TH>业务员</TH> <TH>联系电话</TH>
<TH>报单时间</TH> <TH>产品明细</TH>
<TH>押金</TH>
<TH>买断</TH>
<TH>生日</TH> <TH>生日</TH>
<TH>业务员</TH>
<TH>报单日期</TH>
<TH>备注</TH>
<TH className="text-right">操作</TH> <TH className="text-right">操作</TH>
</tr> </tr>
</THead> </THead>
<tbody> <tbody>
{rows.length === 0 && ( {rows.length === 0 && (
<tr> <tr>
<TD colSpan={7} className="py-14 text-center text-[var(--color-muted-foreground)]"> <TD colSpan={12} className="py-14 text-center text-[var(--color-muted-foreground)]">
暂无数据 暂无数据
</TD> </TD>
</tr> </tr>
@@ -78,9 +83,11 @@ export default async function CustomersPage({
<TR key={c.id}> <TR key={c.id}>
<TD className="font-medium">{c.customerName}</TD> <TD className="font-medium">{c.customerName}</TD>
<TD>{c.contacts}</TD> <TD>{c.contacts}</TD>
<TD>{c.balanceUser}</TD>
<TD className="tabular-nums">{c.phone}</TD> <TD className="tabular-nums">{c.phone}</TD>
<TD>{c.salesman}</TD> <TD className="max-w-[280px] whitespace-normal break-words">{c.detail}</TD>
<TD className="tabular-nums">{fmtDate(c.reportDate)}</TD> <TD>{c.deposit}</TD>
<TD>{c.buy}</TD>
<TD> <TD>
<span className="tabular-nums">{fmtDate(c.birthday)}</span> <span className="tabular-nums">{fmtDate(c.birthday)}</span>
{c.birthday && ( {c.birthday && (
@@ -89,6 +96,9 @@ export default async function CustomersPage({
</Badge> </Badge>
)} )}
</TD> </TD>
<TD>{c.salesman}</TD>
<TD className="tabular-nums">{fmtDate(c.reportDate)}</TD>
<TD className="max-w-[280px] whitespace-normal break-words">{c.remark}</TD>
<TD> <TD>
<div className="flex justify-end gap-1.5"> <div className="flex justify-end gap-1.5">
<Link href={`/customers/${c.id}/edit`}> <Link href={`/customers/${c.id}/edit`}>
+19 -2
View File
@@ -2,10 +2,27 @@ import * as React from "react";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
/** 统一表格外观:外层 Card 内使用 */ /** 统一表格外观:外层 Card 内使用 */
export function Table({ className, ...props }: React.TableHTMLAttributes<HTMLTableElement>) { export function Table({
className,
striped,
bordered,
...props
}: React.TableHTMLAttributes<HTMLTableElement> & {
striped?: boolean;
bordered?: boolean;
}) {
return ( return (
<div className="w-full overflow-x-auto"> <div className="w-full overflow-x-auto">
<table className={cn("w-full text-sm", className)} {...props} /> <table
className={cn(
"w-full text-sm",
bordered &&
"border border-[var(--color-border)] [&_tr]:divide-x [&_tr]:divide-[var(--color-border)]",
striped && "[&_tbody_tr:nth-child(even)]:bg-[var(--color-muted)]/50",
className
)}
{...props}
/>
</div> </div>
); );
} }