diff --git a/package-lock.json b/package-lock.json index df6c581..7bdb10a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "crm-new", "version": "0.1.0", + "hasInstallScript": true, "dependencies": { "@prisma/client": "^6.11.0", "bcryptjs": "^2.4.3", diff --git a/src/app/(dashboard)/customers/birthday/birthday-control.tsx b/src/app/(dashboard)/customers/birthday/birthday-control.tsx index a08827f..0e0a67a 100644 --- a/src/app/(dashboard)/customers/birthday/birthday-control.tsx +++ b/src/app/(dashboard)/customers/birthday/birthday-control.tsx @@ -22,17 +22,19 @@ export function BirthdayControl({ } return ( -
+
@@ -41,7 +43,7 @@ export function BirthdayControl({ type="date" defaultValue={date} onChange={(e) => go({ date: e.target.value })} - className="w-40" + className="w-full sm:w-40" /> (不填默认今天) diff --git a/src/app/(dashboard)/customers/birthday/page.tsx b/src/app/(dashboard)/customers/birthday/page.tsx index 0c0d5fd..1ac25af 100644 --- a/src/app/(dashboard)/customers/birthday/page.tsx +++ b/src/app/(dashboard)/customers/birthday/page.tsx @@ -76,14 +76,14 @@ export default async function BirthdayPage({ return (
- + -
+
命中 {rows.length} 位商户
- + @@ -131,6 +131,50 @@ export default async function BirthdayPage({
+ +
+ {rows.length === 0 && ( + + 该时段暂无生日商户 + + )} + {rows.map((c) => { + const ownerName = c.birthdayOwner === 1 ? c.balanceUser : c.contacts; + const ownerPhone = + (c.birthdayOwner === 1 ? c.balanceUserPhone : c.contactsPhone) || c.phone; + return ( + +
+
+
{c.customerName}
+
+ {c.salesman || "—"} +
+
+ + {c.birthdayType === 2 ? "农历" : "阳历"} + +
+
+
+
归属人
+
{ownerName || "—"}
+
+ {superAdmin ? ownerPhone : maskPhone(ownerPhone)} +
+
+
+
生日
+
{fmtDate(c.birthday)}
+
+ {c.birthdayOwner === 1 ? "结算人" : "联系人"} +
+
+
+
+ ); + })} +
); } diff --git a/src/app/(dashboard)/customers/customer-form.tsx b/src/app/(dashboard)/customers/customer-form.tsx index f573200..dd11918 100644 --- a/src/app/(dashboard)/customers/customer-form.tsx +++ b/src/app/(dashboard)/customers/customer-form.tsx @@ -202,7 +202,7 @@ export function CustomerForm({

)} -
+
diff --git a/src/app/(dashboard)/customers/customer-toolbar.tsx b/src/app/(dashboard)/customers/customer-toolbar.tsx index e5647a0..71f9c1d 100644 --- a/src/app/(dashboard)/customers/customer-toolbar.tsx +++ b/src/app/(dashboard)/customers/customer-toolbar.tsx @@ -1,6 +1,6 @@ "use client"; -import { useRef, useState, useTransition } from "react"; +import { useRef, useTransition } from "react"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { Plus, Upload, Download, Search, RotateCcw } from "lucide-react"; @@ -78,50 +78,54 @@ export function CustomerToolbar({ } return ( - -
-
+ + +
- - ~ - - - +
+ + ~ + +
+
+ + +
-
+
- - {canExport && ( - - )} - - diff --git a/src/app/(dashboard)/customers/customer-view.tsx b/src/app/(dashboard)/customers/customer-view.tsx index 3314c50..8276ea5 100644 --- a/src/app/(dashboard)/customers/customer-view.tsx +++ b/src/app/(dashboard)/customers/customer-view.tsx @@ -4,7 +4,7 @@ import { useEffect, useState, type ReactNode } from "react"; import { Eye, X } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { fmtDate } from "@/lib/utils"; +import { fmtDate, cn } from "@/lib/utils"; type CustomerViewProps = { customer: { @@ -35,7 +35,12 @@ export function CustomerView({ customer }: CustomerViewProps) { if (e.key === "Escape") setOpen(false); }; window.addEventListener("keydown", handleEsc); - return () => window.removeEventListener("keydown", handleEsc); + const prev = document.body.style.overflow; + document.body.style.overflow = "hidden"; + return () => { + window.removeEventListener("keydown", handleEsc); + document.body.style.overflow = prev; + }; }, [open]); const birthdayLabel = customer.birthdayType === 2 ? "阴历" : "阳历"; @@ -56,11 +61,11 @@ export function CustomerView({ customer }: CustomerViewProps) { {open && (
setOpen(false)} > e.stopPropagation()} > @@ -69,7 +74,7 @@ export function CustomerView({ customer }: CustomerViewProps) {