diff --git a/src/app/(root)/batch/page.tsx b/src/app/(root)/batch/page.tsx index 7c3014e..7f683a2 100644 --- a/src/app/(root)/batch/page.tsx +++ b/src/app/(root)/batch/page.tsx @@ -275,9 +275,10 @@ export default function BatchPage() { accessorKey: "resource.resource_no", cell: ({ row }) => { const resourceNo = row.original.resource?.resource_no + const type = row.original.resource?.type return ( (loadData) + console.log(table, "table") const onFilter = handleSubmit(() => { table.pagination.onPageChange(1) @@ -353,24 +354,24 @@ export default function BillingPage() { header: "创建时间", accessorKey: "created_at", cell: ({ row }) => { - const createdAt = row.original.created_at; - if (!createdAt) return -; - - const date = new Date(createdAt); - if (isNaN(date.getTime())) return -; - - return format(date, "yyyy-MM-dd HH:mm:ss"); + const createdAt = row.original.created_at + if (!createdAt) return - + + const date = new Date(createdAt) + if (isNaN(date.getTime())) return - + + return format(date, "yyyy-MM-dd HH:mm:ss") }, }, { header: "套餐号", accessorKey: "resource.resource_no", - cell: ({ row }) => { const resource_no = row.original.resource?.resource_no + const type = row.original.resource?.type return resource_no ? ( { const resource_no = row.original.resource?.resource_no + const type = row.original.resource?.type return ( { - const createdAt = row.original.created_at; - if (!createdAt) return -; - - const date = new Date(createdAt); - if (isNaN(date.getTime())) return -; - - return format(date, "yyyy-MM-dd HH:mm:ss"); + const createdAt = row.original.created_at + if (!createdAt) return - + + const date = new Date(createdAt) + if (isNaN(date.getTime())) return - + + return format(date, "yyyy-MM-dd HH:mm:ss") }, }, { header: "过期时间", accessorKey: "expired_at", cell: ({ row }) => { - const expiredAt = row.original.expired_at; - if (!expiredAt) return -; - - const date = new Date(expiredAt); - if (isNaN(date.getTime())) return -; - - return format(date, "yyyy-MM-dd HH:mm:ss"); + const expiredAt = row.original.expired_at + if (!expiredAt) return - + + const date = new Date(expiredAt) + if (isNaN(date.getTime())) return - + + return format(date, "yyyy-MM-dd HH:mm:ss") }, }, ]} diff --git a/src/app/(root)/client/batch/page.tsx b/src/app/(root)/client/batch/page.tsx index 9f69969..02262cd 100644 --- a/src/app/(root)/client/batch/page.tsx +++ b/src/app/(root)/client/batch/page.tsx @@ -1,6 +1,7 @@ "use client" import { zodResolver } from "@hookform/resolvers/zod" import { format } from "date-fns" +import Link from "next/link" import { useRouter, useSearchParams } from "next/navigation" import { Suspense, useState } from "react" import { Controller, useForm } from "react-hook-form" @@ -250,7 +251,24 @@ export default function BatchPage() { header: "会员号", accessorFn: row => row.user?.phone || "", }, - { header: "套餐号", accessorKey: "resource.resource_no" }, + { + header: "套餐号", + accessorKey: "resource.resource_no", + cell: ({ row }) => { + const resourceNo = row.original.resource?.resource_no + const type = row.original.resource?.type + return ( + + {resourceNo} + + ) + }, + }, { header: "批次号", accessorKey: "batch_no" }, { header: "省份", accessorKey: "prov" }, { header: "城市", accessorKey: "city" }, diff --git a/src/app/(root)/client/billing/page.tsx b/src/app/(root)/client/billing/page.tsx index b870fa7..9e5b85d 100644 --- a/src/app/(root)/client/billing/page.tsx +++ b/src/app/(root)/client/billing/page.tsx @@ -2,6 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod" import { format } from "date-fns" import { CreditCard, Wallet } from "lucide-react" +import Link from "next/link" import { useRouter, useSearchParams } from "next/navigation" import { Suspense, useEffect, useState } from "react" import { Controller, useForm } from "react-hook-form" @@ -340,13 +341,31 @@ export default function BillingPage() { "yyyy-MM-dd HH:mm:ss", ), }, - { header: "套餐号", accessorKey: "resource.resource_no" }, + { + header: "套餐号", + accessorKey: "resource.resource_no", + cell: ({ row }) => { + const resource_no = row.original.resource?.resource_no + const type = row.original.resource?.type + return resource_no ? ( + + {resource_no} + + ) : ( + + ) + }, + }, { header: "账单详情", accessorKey: "info", cell: ({ row }) => { const bill = row.original - return (