|
|
@@ -1,13 +1,19 @@
|
|
|
'use client';
|
|
|
|
|
|
import { useState, useEffect, useRef } from 'react';
|
|
|
-import { X, Send, User, Shield, Check, Ban, RefreshCw, Loader2, MessageSquare, Info, MessageCircle, Image as ImageIcon, ExternalLink } from 'lucide-react';
|
|
|
+import {
|
|
|
+ X, Send, User, Shield, Check, Ban, RefreshCw, Loader2, MessageSquare,
|
|
|
+ Info, MessageCircle, Image as ImageIcon, ExternalLink, Package, Copy,
|
|
|
+ Eye, AlertTriangle, Clock, ChevronDown, ChevronUp, FileText, Phone
|
|
|
+} from 'lucide-react';
|
|
|
import LocalTime from '@/components/common/LocalTime';
|
|
|
import { toast } from 'react-hot-toast';
|
|
|
import TicketActionModal from '@/components/admin/TicketActionModal';
|
|
|
-import { AdminTicket, TicketMessage, ActionType } from '@/types';
|
|
|
-import { ticketService } from '@/lib/services';
|
|
|
+import OrderDetailDrawer from '@/components/admin/orders/OrderDetailDrawer';
|
|
|
+import { AdminTicket, TicketMessage, ActionType, ExtendedOrderDetail } from '@/types';
|
|
|
+import { ticketService, orderService } from '@/lib/services';
|
|
|
import { storageService } from '@/lib/services/storageService';
|
|
|
+import { formatMoney } from '@/lib/currency';
|
|
|
|
|
|
interface TicketDetailModalProps {
|
|
|
isOpen: boolean;
|
|
|
@@ -22,6 +28,14 @@ export default function TicketDetailModal({ isOpen, onClose, ticket, onUpdate }:
|
|
|
const [loadingMsg, setLoadingMsg] = useState(false);
|
|
|
const [sending, setSending] = useState(false);
|
|
|
|
|
|
+ // 关联订单数据
|
|
|
+ const [orderData, setOrderData] = useState<ExtendedOrderDetail | null>(null);
|
|
|
+ const [loadingOrder, setLoadingOrder] = useState<boolean>(false);
|
|
|
+ const [orderError, setOrderError] = useState<string | null>(null);
|
|
|
+ const [isOrderDrawerOpen, setIsOrderDrawerOpen] = useState<boolean>(false);
|
|
|
+ const [copiedField, setCopiedField] = useState<string | null>(null);
|
|
|
+ const [showAllInputs, setShowAllInputs] = useState<boolean>(false);
|
|
|
+
|
|
|
// 图片附件状态
|
|
|
const [attachedImages, setAttachedImages] = useState<string[]>([]);
|
|
|
const [uploadingImage, setUploadingImage] = useState(false);
|
|
|
@@ -33,6 +47,32 @@ export default function TicketDetailModal({ isOpen, onClose, ticket, onUpdate }:
|
|
|
|
|
|
const [activeTab, setActiveTab] = useState<'detail' | 'chat'>('chat');
|
|
|
|
|
|
+ const fetchOrderDetails = async (orderId: string) => {
|
|
|
+ if (!orderId || !orderId.trim()) {
|
|
|
+ setOrderData(null);
|
|
|
+ setOrderError(null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ setLoadingOrder(true);
|
|
|
+ setOrderError(null);
|
|
|
+ try {
|
|
|
+ const res = await orderService.getDetail(orderId.trim());
|
|
|
+ if (res?.data) {
|
|
|
+ setOrderData(res.data);
|
|
|
+ } else {
|
|
|
+ setOrderData(null);
|
|
|
+ setOrderError('未检索到订单数据');
|
|
|
+ }
|
|
|
+ } catch (err: any) {
|
|
|
+ console.error('[Ticket Order Fetch Error]', err);
|
|
|
+ const msg = err.response?.data?.message || '订单读取失败或订单不存在';
|
|
|
+ setOrderError(msg);
|
|
|
+ setOrderData(null);
|
|
|
+ } finally {
|
|
|
+ setLoadingOrder(false);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
const fetchMessages = async (silent = false) => {
|
|
|
if (!ticket) return;
|
|
|
if (!silent) setLoadingMsg(true);
|
|
|
@@ -59,8 +99,18 @@ export default function TicketDetailModal({ isOpen, onClose, ticket, onUpdate }:
|
|
|
setReply('');
|
|
|
fetchMessages(false);
|
|
|
setActiveTab('chat');
|
|
|
+ setShowAllInputs(false);
|
|
|
+ if (ticket.order_id) {
|
|
|
+ fetchOrderDetails(ticket.order_id);
|
|
|
+ } else {
|
|
|
+ setOrderData(null);
|
|
|
+ setOrderError(null);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ setOrderData(null);
|
|
|
+ setOrderError(null);
|
|
|
}
|
|
|
- }, [isOpen, ticket?.id]);
|
|
|
+ }, [isOpen, ticket?.id, ticket?.order_id]);
|
|
|
|
|
|
const handleImageUpload = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
|
const file = e.target.files?.[0];
|
|
|
@@ -160,11 +210,141 @@ export default function TicketDetailModal({ isOpen, onClose, ticket, onUpdate }:
|
|
|
return imgs;
|
|
|
};
|
|
|
|
|
|
+ const copyText = (key: string, val?: string) => {
|
|
|
+ if (!val) return;
|
|
|
+ navigator.clipboard.writeText(val);
|
|
|
+ setCopiedField(key);
|
|
|
+ toast.success('已复制到剪贴板');
|
|
|
+ setTimeout(() => setCopiedField(null), 1500);
|
|
|
+ };
|
|
|
+
|
|
|
+ const copyAllApplicantInfo = () => {
|
|
|
+ if (!orderData) return;
|
|
|
+ const lines: string[] = [
|
|
|
+ `[订单号]: #${orderData.id}`,
|
|
|
+ `[服务项目]: ${orderData.product_name || '-'}`,
|
|
|
+ `[订单状态]: ${orderData.status || '-'}`,
|
|
|
+ `[订单金额]: ${formatMoney(orderData.final_amount ?? orderData.base_amount, orderData.base_currency || 'CNY')}`,
|
|
|
+ ];
|
|
|
+ if (orderData.user_inputs && typeof orderData.user_inputs === 'object') {
|
|
|
+ lines.push('--- 申请人提交资料 ---');
|
|
|
+ Object.entries(orderData.user_inputs).forEach(([k, v]) => {
|
|
|
+ if (k.startsWith('_')) return;
|
|
|
+ if (typeof v === 'object' && v !== null) {
|
|
|
+ lines.push(`${k}: ${JSON.stringify(v)}`);
|
|
|
+ } else {
|
|
|
+ lines.push(`${k}: ${v}`);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ navigator.clipboard.writeText(lines.join('\n'));
|
|
|
+ setCopiedField('all_applicant');
|
|
|
+ toast.success('已复制完整申报资料至剪贴板');
|
|
|
+ setTimeout(() => setCopiedField(null), 1500);
|
|
|
+ };
|
|
|
+
|
|
|
+ const getApplicantName = (order: ExtendedOrderDetail): string => {
|
|
|
+ const inputs = order.user_inputs || {};
|
|
|
+ if (inputs.name || inputs.surname) {
|
|
|
+ return `${inputs.surname || ''} ${inputs.name || ''}`.trim();
|
|
|
+ }
|
|
|
+ if (inputs.applicant_name) return String(inputs.applicant_name);
|
|
|
+ return order.user_name || order.user?.nickname || '-';
|
|
|
+ };
|
|
|
+
|
|
|
+ const getPassportNo = (order: ExtendedOrderDetail): string => {
|
|
|
+ const inputs = order.user_inputs || {};
|
|
|
+ return inputs.passport_no || inputs.passport || inputs.passport_number || '';
|
|
|
+ };
|
|
|
+
|
|
|
+ const getApplicantPhone = (order: ExtendedOrderDetail): string => {
|
|
|
+ const inputs = order.user_inputs || {};
|
|
|
+ const code = inputs.phone_code ? `${inputs.phone_code} ` : '';
|
|
|
+ const phone = inputs.phone || inputs.mobile || order.user?.phone || '';
|
|
|
+ return phone ? `${code}${phone}` : '';
|
|
|
+ };
|
|
|
+
|
|
|
+ const getTargetLocation = (order: ExtendedOrderDetail): string => {
|
|
|
+ const inputs = order.user_inputs || {};
|
|
|
+ const parts = [
|
|
|
+ inputs.country || inputs.country_code || inputs.nationality,
|
|
|
+ inputs.city || inputs.visa_center,
|
|
|
+ inputs.category || inputs.subcategory || inputs.visa_category,
|
|
|
+ ].filter(Boolean);
|
|
|
+ return parts.join(' / ');
|
|
|
+ };
|
|
|
+
|
|
|
+ const getOrderStatusBadge = (status?: string, order?: ExtendedOrderDetail) => {
|
|
|
+ const s = (status || '').toLowerCase();
|
|
|
+ const isPayLater = order?.user_inputs?._admin_bypass?.payment_timing === 'pay_later';
|
|
|
+ switch (s) {
|
|
|
+ case 'paid':
|
|
|
+ case 'succeeded':
|
|
|
+ return (
|
|
|
+ <span className="px-1.5 py-0.5 bg-amber-300 text-black border border-black font-mono font-black text-[9px] uppercase shadow-[1px_1px_0px_#000]">
|
|
|
+ ★ 已支付 // PAID
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ case 'completed':
|
|
|
+ return (
|
|
|
+ <span className="px-1.5 py-0.5 bg-emerald-300 text-black border border-black font-mono font-black text-[9px] uppercase shadow-[1px_1px_0px_#000]">
|
|
|
+ ✔ 已履约
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ case 'pending':
|
|
|
+ return (
|
|
|
+ <span className={`px-1.5 py-0.5 border border-black font-mono font-black text-[9px] uppercase shadow-[1px_1px_0px_#000] inline-flex items-center gap-0.5 ${
|
|
|
+ isPayLater ? 'bg-amber-100 text-amber-950 border-amber-900' : 'bg-neutral-100 text-black'
|
|
|
+ }`}>
|
|
|
+ <Clock size={9} />
|
|
|
+ {isPayLater ? '⏳ 待收款 (先办后付)' : '⏳ 待支付'}
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ case 'cancelled':
|
|
|
+ case 'closed':
|
|
|
+ return (
|
|
|
+ <span className="px-1.5 py-0.5 bg-neutral-200 text-neutral-600 border border-black font-mono text-[9px] uppercase">
|
|
|
+ ⊘ 已关闭
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ case 'refunded':
|
|
|
+ return (
|
|
|
+ <span className="px-1.5 py-0.5 bg-rose-200 text-rose-900 border border-black font-mono font-bold text-[9px] uppercase">
|
|
|
+ ↺ 已退款
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ default:
|
|
|
+ return (
|
|
|
+ <span className="px-1.5 py-0.5 bg-neutral-100 text-neutral-600 border border-black font-mono text-[9px] uppercase">
|
|
|
+ {status || '未知'}
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const renderExtraInputs = (order: ExtendedOrderDetail) => {
|
|
|
+ if (!order.user_inputs || typeof order.user_inputs !== 'object') return null;
|
|
|
+ const entries = Object.entries(order.user_inputs).filter(([k]) => !k.startsWith('_'));
|
|
|
+ if (entries.length === 0) return <div className="text-neutral-400">无额外用户输入</div>;
|
|
|
+ return (
|
|
|
+ <div className="space-y-1">
|
|
|
+ {entries.map(([key, val]) => (
|
|
|
+ <div key={key} className="flex justify-between items-start gap-2 border-b border-neutral-100 pb-0.5">
|
|
|
+ <span className="text-neutral-500 font-mono shrink-0">{key}:</span>
|
|
|
+ <span className="text-black font-mono text-right break-all">
|
|
|
+ {typeof val === 'object' && val !== null ? JSON.stringify(val) : String(val ?? '-')}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ };
|
|
|
+
|
|
|
if (!isOpen || !ticket) return null;
|
|
|
|
|
|
return (
|
|
|
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-grayscale p-0 md:p-4 font-mono">
|
|
|
- <div className="bg-neutral-50 w-full h-full md:w-full md:max-w-5xl md:h-[88vh] border-2 border-black shadow-[8px_8px_0px_#000] flex flex-col overflow-hidden animate-in zoom-in-95 duration-200">
|
|
|
+ <div className="bg-neutral-50 w-full h-full md:w-full md:max-w-6xl md:h-[88vh] border-2 border-black shadow-[8px_8px_0px_#000] flex flex-col overflow-hidden animate-in zoom-in-95 duration-200">
|
|
|
|
|
|
{/* Header */}
|
|
|
<div className="px-5 py-3.5 border-b-2 border-black flex justify-between items-center bg-neutral-200 text-black select-none shrink-0">
|
|
|
@@ -178,10 +358,25 @@ export default function TicketDetailModal({ isOpen, onClose, ticket, onUpdate }:
|
|
|
{ticket.type}
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div className="text-[10px] text-neutral-500 mt-0.5 hidden md:flex items-center gap-2">
|
|
|
- <span>用户: {ticket.user_id}</span>
|
|
|
- <span>| 订单: #{ticket.order_id}</span>
|
|
|
- <span>| 创建: <LocalTime date={ticket.created_at} /></span>
|
|
|
+ <div className="text-[10px] text-neutral-600 mt-1 flex flex-wrap items-center gap-2">
|
|
|
+ <span>用户: <strong className="text-black font-mono">{ticket.user_id}</strong></span>
|
|
|
+ <span>|</span>
|
|
|
+ {ticket.order_id ? (
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={() => setIsOrderDrawerOpen(true)}
|
|
|
+ className="inline-flex items-center gap-1 px-1.5 py-0.5 bg-amber-300 hover:bg-amber-400 border border-black text-black font-mono font-bold text-[10px] shadow-[1px_1px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition"
|
|
|
+ title="点击查看完整订单档案抽屉"
|
|
|
+ >
|
|
|
+ <Package size={11} />
|
|
|
+ <span>订单: #{ticket.order_id}</span>
|
|
|
+ <ExternalLink size={10} />
|
|
|
+ </button>
|
|
|
+ ) : (
|
|
|
+ <span className="text-neutral-400">无关联订单</span>
|
|
|
+ )}
|
|
|
+ <span className="hidden sm:inline">|</span>
|
|
|
+ <span className="hidden sm:inline">创建: <LocalTime date={ticket.created_at} /></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<button
|
|
|
@@ -215,8 +410,9 @@ export default function TicketDetailModal({ isOpen, onClose, ticket, onUpdate }:
|
|
|
<div className={`
|
|
|
border-r-2 border-black flex-col bg-white overflow-y-auto
|
|
|
${activeTab === 'detail' ? 'flex w-full' : 'hidden'}
|
|
|
- md:flex md:w-[380px] shrink-0
|
|
|
+ md:flex md:w-[410px] shrink-0
|
|
|
`}>
|
|
|
+ {/* 诉求与争议说明 */}
|
|
|
<div className="p-4 border-b border-black/10 bg-neutral-100">
|
|
|
<span className="text-[11px] font-black uppercase text-black">[ 诉求与争议说明 ]</span>
|
|
|
<p className="text-xs text-black font-sans mt-2 whitespace-pre-wrap leading-relaxed">
|
|
|
@@ -224,6 +420,173 @@ export default function TicketDetailModal({ isOpen, onClose, ticket, onUpdate }:
|
|
|
</p>
|
|
|
</div>
|
|
|
|
|
|
+ {/* 关联订单速览情报卡片 */}
|
|
|
+ <div className="p-4 border-b border-black/10 bg-neutral-50 space-y-3">
|
|
|
+ <div className="flex items-center justify-between">
|
|
|
+ <div className="flex items-center gap-1.5">
|
|
|
+ <Package size={13} className="text-black" />
|
|
|
+ <span className="text-[11px] font-black uppercase text-black">[ 关联订单档案 ]</span>
|
|
|
+ {ticket.order_id && (
|
|
|
+ <span className="text-[10px] font-mono text-neutral-500">#{ticket.order_id}</span>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ {ticket.order_id && (
|
|
|
+ <div className="flex items-center gap-1">
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={() => copyText('order_id', ticket.order_id)}
|
|
|
+ className="p-1 hover:bg-neutral-200 border border-black/40 text-[10px] transition bg-white"
|
|
|
+ title="复制订单号"
|
|
|
+ >
|
|
|
+ {copiedField === 'order_id' ? <Check size={11} className="text-emerald-600" /> : <Copy size={11} />}
|
|
|
+ </button>
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={() => setIsOrderDrawerOpen(true)}
|
|
|
+ className="flex items-center gap-1 px-1.5 py-0.5 bg-amber-300 hover:bg-amber-400 text-black border border-black text-[10px] font-black uppercase shadow-[1px_1px_0px_#000] active:translate-x-0.5 active:translate-y-0.5 transition"
|
|
|
+ title="展开完整订单侧栏抽屉"
|
|
|
+ >
|
|
|
+ <span>全量抽屉</span>
|
|
|
+ <ExternalLink size={10} />
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {loadingOrder ? (
|
|
|
+ <div className="py-4 flex flex-col items-center justify-center text-neutral-400 text-xs gap-1.5 bg-white border border-black/20">
|
|
|
+ <Loader2 size={16} className="animate-spin text-black" />
|
|
|
+ <span className="text-[10px] font-mono">[ 检索关联订单数据中... ]</span>
|
|
|
+ </div>
|
|
|
+ ) : orderError ? (
|
|
|
+ <div className="p-2.5 bg-rose-50 border border-rose-300 text-rose-800 text-[11px] flex items-start gap-1.5 font-sans">
|
|
|
+ <AlertTriangle size={14} className="shrink-0 mt-0.5 text-rose-600" />
|
|
|
+ <div>
|
|
|
+ <div className="font-bold font-mono">[ 订单检索失败 ]</div>
|
|
|
+ <div>{orderError}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ ) : orderData ? (
|
|
|
+ <div className="space-y-2.5">
|
|
|
+ {/* 订单基础摘要看板 */}
|
|
|
+ <div className="bg-white border-2 border-black p-2.5 shadow-[2px_2px_0px_#000] space-y-2">
|
|
|
+ <div className="flex items-start justify-between gap-2">
|
|
|
+ <div className="font-bold text-xs text-black font-sans line-clamp-2" title={orderData.product_name}>
|
|
|
+ {orderData.product_name || '未指定商品/服务'}
|
|
|
+ </div>
|
|
|
+ <div className="shrink-0">
|
|
|
+ {getOrderStatusBadge(orderData.status, orderData)}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="grid grid-cols-2 gap-2 pt-2 border-t border-dashed border-neutral-200 text-[11px]">
|
|
|
+ <div>
|
|
|
+ <span className="text-neutral-400 text-[10px] block">订单金额</span>
|
|
|
+ <span className="font-bold font-mono text-black text-xs">
|
|
|
+ {formatMoney(orderData.final_amount ?? orderData.base_amount, orderData.base_currency || 'CNY')}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <span className="text-neutral-400 text-[10px] block">下单渠道</span>
|
|
|
+ <span className="font-mono text-black font-semibold truncate block">
|
|
|
+ {orderData.channel_type === 'agency' ? `代理 (${orderData.agency_id || '-'})` :
|
|
|
+ orderData.channel_type === 'direct' ? '直客直销' :
|
|
|
+ orderData.channel_type || '官网'}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* 申报人/客户核心资料卡片 */}
|
|
|
+ <div className="bg-white border border-black p-2.5 space-y-1.5 text-[11px]">
|
|
|
+ <div className="flex items-center justify-between">
|
|
|
+ <span className="text-[10px] font-bold text-neutral-500 uppercase tracking-wider">
|
|
|
+ [ 申报人及签证核心信息 ]
|
|
|
+ </span>
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={copyAllApplicantInfo}
|
|
|
+ className="text-[10px] text-neutral-600 hover:text-black flex items-center gap-0.5 underline font-sans"
|
|
|
+ title="复制申报人资料"
|
|
|
+ >
|
|
|
+ {copiedField === 'all_applicant' ? <Check size={10} className="text-emerald-600" /> : <Copy size={10} />}
|
|
|
+ <span>复制</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="space-y-1 font-sans text-neutral-800">
|
|
|
+ <div className="flex justify-between items-center py-0.5 border-b border-neutral-100">
|
|
|
+ <span className="text-neutral-500 text-[10px]">申请人姓名:</span>
|
|
|
+ <span className="font-bold font-mono text-black select-all">
|
|
|
+ {getApplicantName(orderData)}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {getPassportNo(orderData) && (
|
|
|
+ <div className="flex justify-between items-center py-0.5 border-b border-neutral-100">
|
|
|
+ <span className="text-neutral-500 text-[10px]">护照号码:</span>
|
|
|
+ <span className="font-bold font-mono text-black select-all">
|
|
|
+ {getPassportNo(orderData)}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {getApplicantPhone(orderData) && (
|
|
|
+ <div className="flex justify-between items-center py-0.5 border-b border-neutral-100">
|
|
|
+ <span className="text-neutral-500 text-[10px]">联系手机:</span>
|
|
|
+ <span className="font-mono text-black select-all">
|
|
|
+ {getApplicantPhone(orderData)}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {getTargetLocation(orderData) && (
|
|
|
+ <div className="flex justify-between items-center py-0.5 border-b border-neutral-100">
|
|
|
+ <span className="text-neutral-500 text-[10px]">签证/中心:</span>
|
|
|
+ <span className="text-black font-mono text-right max-w-[200px] truncate">
|
|
|
+ {getTargetLocation(orderData)}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* 更多输入项可展开 */}
|
|
|
+ {orderData.user_inputs && Object.keys(orderData.user_inputs).filter(k => !k.startsWith('_')).length > 0 && (
|
|
|
+ <div className="pt-1">
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={() => setShowAllInputs(!showAllInputs)}
|
|
|
+ className="text-[10px] text-amber-700 hover:text-amber-900 font-bold flex items-center gap-1 transition"
|
|
|
+ >
|
|
|
+ <span>{showAllInputs ? '▲ 收起更多申报资料' : '▼ 展开全部申报资料明细'}</span>
|
|
|
+ </button>
|
|
|
+
|
|
|
+ {showAllInputs && (
|
|
|
+ <div className="mt-2 space-y-1 bg-neutral-50 p-2 border border-neutral-200 text-[10px] max-h-48 overflow-y-auto">
|
|
|
+ {renderExtraInputs(orderData)}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ {/* 快捷跳转与全量抽屉入口 */}
|
|
|
+ <button
|
|
|
+ type="button"
|
|
|
+ onClick={() => setIsOrderDrawerOpen(true)}
|
|
|
+ className="w-full py-2 bg-neutral-900 hover:bg-black text-amber-300 font-bold text-xs border border-black shadow-[2px_2px_0px_#000] flex items-center justify-center gap-1.5 transition active:translate-x-0.5 active:translate-y-0.5"
|
|
|
+ >
|
|
|
+ <Eye size={13} />
|
|
|
+ <span>[ 展开完整订单抽屉 (查看支付/日志/办理) ]</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ ) : (
|
|
|
+ <div className="p-3 bg-neutral-100 border border-dashed border-neutral-300 text-neutral-400 text-center text-xs">
|
|
|
+ [ 未关联任何订单编号 ]
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+
|
|
|
<div className="p-4 space-y-3 flex-1 text-xs">
|
|
|
<div className="space-y-1">
|
|
|
<span className="text-[10px] text-neutral-400 font-bold uppercase">当前处理状态</span>
|
|
|
@@ -440,6 +803,14 @@ export default function TicketDetailModal({ isOpen, onClose, ticket, onUpdate }:
|
|
|
actionType={actionType}
|
|
|
onSubmit={handleActionSubmit}
|
|
|
/>
|
|
|
+
|
|
|
+ {/* 订单全量档案右侧抽屉 */}
|
|
|
+ <OrderDetailDrawer
|
|
|
+ isOpen={isOrderDrawerOpen}
|
|
|
+ onClose={() => setIsOrderDrawerOpen(false)}
|
|
|
+ order={orderData}
|
|
|
+ zIndex="z-[70]"
|
|
|
+ />
|
|
|
</div>
|
|
|
);
|
|
|
}
|