diff --git a/App.jsx b/App.jsx
index 6f3c717..7a1d6b3 100644
--- a/App.jsx
+++ b/App.jsx
@@ -5,7 +5,7 @@ import {
Building2, Globe, Phone, Save, RefreshCw, LayoutDashboard, Users,
Package, Layers, Zap, Tag, Inbox, Paperclip,
Menu, LogOut, GripVertical, BookOpen, FileText, FolderTree, Lock, Sparkles, Printer, Image as ImageIcon,
- ShieldCheck, Settings2, Boxes, Download, Wifi, Radio, QrCode, Folder, FolderPlus, Factory, UploadCloud, ClipboardList, MessageCircle, CalendarDays, MapPin, Wrench, Hash, Send, Languages
+ ShieldCheck, Settings2, Boxes, Download, Wifi, Radio, QrCode, Folder, FolderPlus, Factory, UploadCloud, ClipboardList, MessageCircle, CalendarDays, MapPin, Wrench, Hash, Send, Languages, Landmark
} from 'lucide-react';
import { MicUploadPage } from './mic-upload/MicUploadPage';
import { ImageToolPage } from './mic-upload/ImageToolPage';
@@ -253,8 +253,8 @@ const COUNTRIES = [
const COUNTRY_BY_NAME = Object.fromEntries(COUNTRIES.map(c => [c.name, c]));
-const SAVE_KEY_LABEL = { 'crm:customers': '客户', 'crm:products': '产品', 'crm:quotes': '报价单', 'crm:sellerProfiles': '卖方信息', 'crm:certifications': '授权', 'crm:productCategories': '产品分组', 'crm:packingLists': '箱单', 'crm:catalogDocs': '产品目录', 'crm:jmsLines': 'Just My Socks', 'crm:backPanelTemplates': '后板图模板', 'crm:suppliers': '供应商', 'crm:webDetailTemplates': '模板', 'crm:webAssets': '网站图片', 'crm:webNews': '新闻 / 动态', 'crm:webPackSpecs': 'Packing List' };
-const STORAGE_KEYS = { customers: 'crm:customers', products: 'crm:products', quotes: 'crm:quotes', sellerProfiles: 'crm:sellerProfiles', certifications: 'crm:certifications', productCategories: 'crm:productCategories', packingLists: 'crm:packingLists', catalogDocs: 'crm:catalogDocs', jmsLines: 'crm:jmsLines', backPanelTemplates: 'crm:backPanelTemplates', suppliers: 'crm:suppliers', webDetailTemplates: 'crm:webDetailTemplates', webAssets: 'crm:webAssets', webNews: 'crm:webNews', webPackSpecs: 'crm:webPackSpecs', orders: 'crm:orders' };
+const SAVE_KEY_LABEL = { 'crm:customers': '客户', 'crm:products': '产品', 'crm:quotes': '报价单', 'crm:sellerProfiles': '卖方信息', 'crm:certifications': '授权', 'crm:productCategories': '产品分组', 'crm:packingLists': '箱单', 'crm:catalogDocs': '产品目录', 'crm:jmsLines': 'Just My Socks', 'crm:backPanelTemplates': '后板图模板', 'crm:suppliers': '供应商', 'crm:webDetailTemplates': '模板', 'crm:webAssets': '网站图片', 'crm:webNews': '新闻 / 动态', 'crm:webPackSpecs': 'Packing List', 'crm:customsDecls': '报关' };
+const STORAGE_KEYS = { customers: 'crm:customers', products: 'crm:products', quotes: 'crm:quotes', sellerProfiles: 'crm:sellerProfiles', certifications: 'crm:certifications', productCategories: 'crm:productCategories', packingLists: 'crm:packingLists', catalogDocs: 'crm:catalogDocs', jmsLines: 'crm:jmsLines', backPanelTemplates: 'crm:backPanelTemplates', suppliers: 'crm:suppliers', webDetailTemplates: 'crm:webDetailTemplates', webAssets: 'crm:webAssets', webNews: 'crm:webNews', webPackSpecs: 'crm:webPackSpecs', orders: 'crm:orders', customsDecls: 'crm:customsDecls' };
const blankCustomer = () => ({
id: 'c_' + Date.now() + '_' + Math.random().toString(36).slice(2, 7),
@@ -1692,8 +1692,13 @@ async function loadAll() {
const od = await storageGet(STORAGE_KEYS.orders);
if (od && od.value) orders = JSON.parse(od.value) || [];
} catch (e) { if (!e.notFound) failed.push(e.message); }
+ let customsDecls = [];
+ try {
+ const cdv = await storageGet(STORAGE_KEYS.customsDecls);
+ if (cdv && cdv.value) customsDecls = JSON.parse(cdv.value) || [];
+ } catch (e) { if (!e.notFound) failed.push(e.message); }
if (failed.length) { const err = new Error(failed[0]); err.loadFailed = true; throw err; }
- return { orders, customers, products, quotes, sellerProfiles, certifications, productCategories, packingLists, catalogDocs, jmsLines, backPanelTemplates, suppliers, webDetailTemplates, tplPendingIds: tplPending.map(x => x.id), webAssets, webNews, webPackSpecs };
+ return { orders, customsDecls, customers, products, quotes, sellerProfiles, certifications, productCategories, packingLists, catalogDocs, jmsLines, backPanelTemplates, suppliers, webDetailTemplates, tplPendingIds: tplPending.map(x => x.id), webAssets, webNews, webPackSpecs };
}
/* -------------------------------- styles -------------------------------- */
@@ -2221,6 +2226,24 @@ const Styles = () => (
.visit-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 150px; height: 120px; border: 1px solid #f5b5ac; border-radius: 8px; background: #fef1ef; color: #b42318; text-decoration: none; font-weight: 700; }
.visit-pdf small { font-weight: 500; color: #b42318; }
@media (max-width: 760px) { .visit-card { grid-template-columns: 1fr; } .visit-when { border-right: 0; border-bottom: 1px dashed var(--line); padding: 0 0 10px; } }
+ /* 报关 */
+ .cd-search { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--panel); color: var(--ink-soft); height: 34px; min-width: 300px; }
+ .cd-search input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 13px; color: var(--ink); }
+ .cd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; padding: 16px 18px; }
+ .cd-grid .field, .cd-item-body .field { margin: 0; }
+ .cd-span2 { grid-column: span 2; } .cd-span3 { grid-column: 1 / -1; }
+ .cd-check { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
+ .cd-sync { min-height: 38px; display: flex; align-items: center; padding: 0 12px; border: 1px dashed var(--line); border-radius: 8px; background: var(--bg); font-size: 13.5px; font-weight: 600; }
+ .cd-sync i { font-weight: 400; color: var(--ink-soft); }
+ .cd-row2 { display: flex; gap: 6px; } .cd-row2 .input { min-width: 0; }
+ .cd-hint { font-weight: 500; color: #b54708; margin-left: 6px; }
+ .cd-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
+ .cd-item-no { display: flex; flex-direction: column; align-items: center; gap: 2px; }
+ .cd-item-no b { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; margin-bottom: 4px; }
+ .cd-item-no .btn { padding: 2px 6px; min-height: 0; }
+ .cd-item-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
+ .cd-total { min-height: 38px; display: flex; align-items: center; font-weight: 700; font-size: 13.5px; }
+ @media (max-width: 860px) { .cd-grid, .cd-item-body { grid-template-columns: 1fr; } .cd-span2 { grid-column: auto; } }
/* 沟通记录 */
.cv-wrap { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); margin-top: 6px; }
.cv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
@@ -2649,6 +2672,7 @@ const STANDALONE_NAV = [
{ id: 'catalog', label: '产品目录', icon: BookOpen },
{ id: 'quotes', label: '报价单', icon: FileText },
{ id: 'packing', label: '箱单', icon: Boxes },
+ { id: 'customs', label: '报关', icon: Landmark },
{ id: 'settings', label: '设置', icon: SettingsIcon },
];
function viewTitle(view) {
@@ -2848,6 +2872,7 @@ function MainApp({ username, onLogout }) {
const [pdfExporting, setPdfExporting] = useState(false);
const [packingLists, setPackingLists] = useState([]);
const [orders, setOrders] = useState([]);
+ const [customsDecls, setCustomsDecls] = useState([]);
const [selectedOrderId, setSelectedOrderId] = useState(null);
const [packingSubView, setPackingSubView] = useState('list'); // 'list' | 'editor'
const [packingDraft, setPackingDraft] = useState(null);
@@ -2918,6 +2943,7 @@ function MainApp({ username, onLogout }) {
setCertifications(data.certifications);
setPackingLists(data.packingLists);
setOrders(Array.isArray(data.orders) ? data.orders : []);
+ setCustomsDecls(Array.isArray(data.customsDecls) ? data.customsDecls : []);
setCatalogDocs((data.catalogDocs || []).filter(d => d.fileName));
setJmsLines(data.jmsLines || []);
setBackPanelTemplates(data.backPanelTemplates || []);
@@ -2968,6 +2994,7 @@ function MainApp({ username, onLogout }) {
useEffect(() => { if (loaded) storageSet(STORAGE_KEYS.webAssets, JSON.stringify(webAssets)).then(() => clearSaveIssue(STORAGE_KEYS.webAssets)).catch(reportSaveError); }, [webAssets, loaded]);
useEffect(() => { if (loaded) storageSet(STORAGE_KEYS.webNews, JSON.stringify(webNews)).then(() => clearSaveIssue(STORAGE_KEYS.webNews)).catch(reportSaveError); }, [webNews, loaded]);
useEffect(() => { if (loaded) storageSet(STORAGE_KEYS.orders, JSON.stringify(orders)).then(() => clearSaveIssue(STORAGE_KEYS.orders)).catch(reportSaveError); }, [orders, loaded]);
+ useEffect(() => { if (loaded) storageSet(STORAGE_KEYS.customsDecls, JSON.stringify(customsDecls)).then(() => clearSaveIssue(STORAGE_KEYS.customsDecls)).catch(reportSaveError); }, [customsDecls, loaded]);
// 侧栏“订单管理”上的数字:到期未处理的订单提醒(每分钟刷新一次)
const [ordTick, setOrdTick] = useState(0);
useEffect(() => { const t = setInterval(() => setOrdTick(x => x + 1), 60000); return () => clearInterval(t); }, []);
@@ -4887,6 +4914,10 @@ function MainApp({ username, onLogout }) {
/>
)}
+ {view === 'customs' && (
+
标记唛码及备注 ${esc(d.notes)} |
| 项号 | 商品编号 | 商品名称及规格型号 | 数量及单位 | 单价/总价/币制 | 原产国(地区) | 最终目的国(地区) | 境内货源地 |
|---|