diff --git a/app.py b/app.py index 35c083be..70270e7a 100755 --- a/app.py +++ b/app.py @@ -3733,6 +3733,7 @@ def get_invoice_available_orders(): """获取可开票订单列表(已支付且未申请开票的订单)""" try: user_id = session['user_id'] + print(f"[发票API] 获取可开票订单 - 用户ID: {user_id}") # 查询已支付的订单 paid_orders = PaymentOrder.query.filter_by( @@ -3740,6 +3741,10 @@ def get_invoice_available_orders(): status='paid' ).order_by(PaymentOrder.paid_at.desc()).all() + print(f"[发票API] 查询到已支付订单数: {len(paid_orders)}") + for po in paid_orders: + print(f"[发票API] 订单ID={po.id}, 订单号={po.order_no}, 金额={po.amount}, 支付时间={po.paid_at}") + available_orders = [] for order in paid_orders: # 检查该订单是否已申请过发票 diff --git a/public/img/customer-service.jpg b/public/img/customer-service.jpg index 509c9556..595c629d 100644 Binary files a/public/img/customer-service.jpg and b/public/img/customer-service.jpg differ diff --git a/public/img/微信图片_20260203123246_154_6.png b/public/img/微信图片_20260203123246_154_6.png new file mode 100644 index 00000000..230bf2d3 Binary files /dev/null and b/public/img/微信图片_20260203123246_154_6.png differ diff --git a/src/components/Invoice/InvoiceCard.tsx b/src/components/Invoice/InvoiceCard.tsx index e0f1c6e5..dc751432 100644 --- a/src/components/Invoice/InvoiceCard.tsx +++ b/src/components/Invoice/InvoiceCard.tsx @@ -10,7 +10,6 @@ import { Text, Button, Icon, - useColorModeValue, Divider, } from '@chakra-ui/react'; import { Download, Eye, X, FileText } from 'lucide-react'; @@ -40,32 +39,29 @@ function InvoiceCard({ onDownload, onCancel, }: InvoiceCardProps) { - const bgCard = useColorModeValue('white', 'gray.800'); - const borderColor = useColorModeValue('gray.200', 'gray.600'); - const headerBg = useColorModeValue('gray.50', 'gray.700'); - const canDownload = invoice.status === 'completed' && invoice.invoiceType === 'electronic'; const canCancel = invoice.status === 'pending'; return ( {/* 头部 */} - + - + - + {invoice.title} - + {invoiceTypeMap[invoice.invoiceType]} · {titleTypeMap[invoice.titleType]} @@ -73,74 +69,76 @@ function InvoiceCard({ - + {/* 内容 */} - + 订单号 - {invoice.orderNo} + {invoice.orderNo} - + 开票金额 - + ¥{invoice.amount.toFixed(2)} {invoice.invoiceNo && ( - + 发票号码 - {invoice.invoiceNo} + {invoice.invoiceNo} )} - + 申请时间 - + {new Date(invoice.createdAt).toLocaleString('zh-CN')} {invoice.completedAt && ( - + 开具时间 - + {new Date(invoice.completedAt).toLocaleString('zh-CN')} )} {invoice.rejectReason && ( - - + + 拒绝原因: {invoice.rejectReason} )} - + {/* 操作按钮 */} - + {onView && ( @@ -148,10 +146,12 @@ function InvoiceCard({ {canDownload && onDownload && ( @@ -159,10 +159,11 @@ function InvoiceCard({ {canCancel && onCancel && ( diff --git a/src/views/Pages/Account/Invoice/index.tsx b/src/views/Pages/Account/Invoice/index.tsx index 8e1b3b6e..26b02022 100644 --- a/src/views/Pages/Account/Invoice/index.tsx +++ b/src/views/Pages/Account/Invoice/index.tsx @@ -18,7 +18,6 @@ import { SimpleGrid, Spinner, Center, - useColorModeValue, useToast, useDisclosure, AlertDialog, @@ -72,8 +71,6 @@ export default function InvoicePage({ embedded = false }: InvoicePageProps) { const [cancelingId, setCancelingId] = useState(null); const toast = useToast(); - const textColor = useColorModeValue("gray.700", "white"); - const bgCard = useColorModeValue("white", "gray.800"); const cancelDialogRef = React.useRef(null); const { @@ -210,7 +207,7 @@ export default function InvoicePage({ embedded = false }: InvoicePageProps) { > 全部申请 - {stats.total} + {stats.total} 累计 @@ -278,8 +275,8 @@ export default function InvoicePage({ embedded = false }: InvoicePageProps) { - - + + 发票管理 @@ -287,20 +284,25 @@ export default function InvoicePage({ embedded = false }: InvoicePageProps) { @@ -311,33 +313,53 @@ export default function InvoicePage({ embedded = false }: InvoicePageProps) { t.key === activeTab)} onChange={(index) => setActiveTab(tabConfig[index].key)} + variant="unstyled" > - + {tabConfig.map((tab) => ( - {tab.label} + + {tab.label} + ))} {tabConfig.map((tab) => ( - + {loading ? (
- - 加载中... + + 加载中...
) : invoices.length === 0 ? (
- - 暂无发票记录 + + 暂无发票记录