@chenchaolong/plugin-trade-compliance-workbench 1.0.220 → 1.0.222
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/remote-components/trade-compliance-workbench/app.css +1 -1
- package/dist/lib/remote-components/trade-compliance-workbench/app.js +5 -5
- package/dist/lib/remote-ui/app-source.d.ts +2 -0
- package/dist/lib/remote-ui/app-source.d.ts.map +1 -1
- package/dist/lib/remote-ui/app-source.js +11 -4
- package/dist/lib/remote-ui/app-source.js.map +1 -1
- package/dist/lib/remote-ui/components/data-grid.d.ts.map +1 -1
- package/dist/lib/remote-ui/components/data-grid.js +16 -1
- package/dist/lib/remote-ui/components/data-grid.js.map +1 -1
- package/dist/lib/remote-ui/components/generation-navigation.d.ts +6 -0
- package/dist/lib/remote-ui/components/generation-navigation.d.ts.map +1 -0
- package/dist/lib/remote-ui/components/generation-navigation.js +47 -0
- package/dist/lib/remote-ui/components/generation-navigation.js.map +1 -0
- package/dist/lib/remote-ui/components/packing-batches.css +16 -0
- package/dist/lib/remote-ui/components/packing-batches.d.ts.map +1 -1
- package/dist/lib/remote-ui/components/packing-batches.js +4 -1
- package/dist/lib/remote-ui/components/packing-batches.js.map +1 -1
- package/dist/lib/remote-ui/components/supplier-materials.css +15 -0
- package/dist/lib/remote-ui/components/supplier-materials.d.ts.map +1 -1
- package/dist/lib/remote-ui/components/supplier-materials.js +3 -3
- package/dist/lib/remote-ui/components/supplier-materials.js.map +1 -1
- package/dist/lib/remote-ui/pages/analytics-dashboard.d.ts +1 -0
- package/dist/lib/remote-ui/pages/analytics-dashboard.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/analytics-dashboard.js +7 -2
- package/dist/lib/remote-ui/pages/analytics-dashboard.js.map +1 -1
- package/dist/lib/remote-ui/pages/analytics-followup.css +62 -0
- package/dist/lib/remote-ui/pages/catalogs.css +8 -0
- package/dist/lib/remote-ui/pages/catalogs.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/catalogs.js +6 -3
- package/dist/lib/remote-ui/pages/catalogs.js.map +1 -1
- package/dist/lib/remote-ui/pages/contracts.css +18 -1
- package/dist/lib/remote-ui/pages/contracts.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/contracts.js +3 -3
- package/dist/lib/remote-ui/pages/contracts.js.map +1 -1
- package/dist/lib/remote-ui/pages/files.d.ts +2 -0
- package/dist/lib/remote-ui/pages/files.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/files.js +2 -2
- package/dist/lib/remote-ui/pages/files.js.map +1 -1
- package/dist/lib/remote-ui/pages/home-guide.css +36 -0
- package/dist/lib/remote-ui/pages/home.d.ts +0 -13
- package/dist/lib/remote-ui/pages/home.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/home.js +32 -20
- package/dist/lib/remote-ui/pages/home.js.map +1 -1
- package/dist/lib/remote-ui/pages/procurement.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/procurement.js +7 -6
- package/dist/lib/remote-ui/pages/procurement.js.map +1 -1
- package/dist/lib/remote-ui/pages/sales.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/sales.js +11 -8
- package/dist/lib/remote-ui/pages/sales.js.map +1 -1
- package/dist/lib/remote-ui/pages/settings.css +16 -0
- package/dist/lib/remote-ui/pages/settings.d.ts.map +1 -1
- package/dist/lib/remote-ui/pages/settings.js +4 -4
- package/dist/lib/remote-ui/pages/settings.js.map +1 -1
- package/dist/lib/remote-ui/styles.css +1 -1
- package/dist/lib/remote-ui/ui-followup.css +42 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-source.d.ts","sourceRoot":"","sources":["../../../src/lib/remote-ui/app-source.tsx"],"names":[],"mappings":"AA0CA,OAAO,cAAc,CAAA;AACrB,OAAO,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"app-source.d.ts","sourceRoot":"","sources":["../../../src/lib/remote-ui/app-source.tsx"],"names":[],"mappings":"AA0CA,OAAO,cAAc,CAAA;AACrB,OAAO,sBAAsB,CAAA;AAC7B,OAAO,wBAAwB,CAAA;AAC/B,OAAO,mBAAmB,CAAA"}
|
|
@@ -38,6 +38,8 @@ import { createMutationCoordinator, executeWorkbenchAction } from './action-exec
|
|
|
38
38
|
import { createDeferredBulkReconcileCoordinator, runBulkDelete } from './bulk-delete.js';
|
|
39
39
|
import './styles.css';
|
|
40
40
|
import './ui-consistency.css';
|
|
41
|
+
import './pages/home-guide.css';
|
|
42
|
+
import './ui-followup.css';
|
|
41
43
|
const pageMeta = {
|
|
42
44
|
home: { title: '首页', subtitle: '查看系统操作提醒与外贸合规业务流程。' },
|
|
43
45
|
'controlled-goods': { title: '管控商品目录', subtitle: '维护军民两用物资和海外制裁商品目录。' },
|
|
@@ -173,6 +175,7 @@ function App() {
|
|
|
173
175
|
const [customerImportState, setCustomerImportState] = React.useState({ status: 'IDLE' });
|
|
174
176
|
const [customerReanalysisState, setCustomerReanalysisState] = React.useState({ status: 'IDLE' });
|
|
175
177
|
const [activeSalesFileOrder, setActiveSalesFileOrder] = React.useState(null);
|
|
178
|
+
const [historyState, setHistoryState] = React.useState({ key: '', loading: false });
|
|
176
179
|
const [editingSalesFile, setEditingSalesFile] = React.useState(null);
|
|
177
180
|
const [toasts, setToasts] = React.useState([]);
|
|
178
181
|
const [toastTimers] = React.useState(() => createToastTimerRegistry((id) => setToasts((items) => removeToast(items, id))));
|
|
@@ -1427,9 +1430,9 @@ function App() {
|
|
|
1427
1430
|
key,
|
|
1428
1431
|
request: async () => asRecord(unwrapResponse(await bridge.requestData({ page: query.page, pageSize: requestedPageSize, parameters: { collection, ...query.parameters, filters: encodeViewFilters(query.filters) } }))),
|
|
1429
1432
|
isCurrent: () => activeGeneratedFilesKeyRef.current === key,
|
|
1430
|
-
commit: payload => setData(current => ({ ...current, generatedFiles: { ...payload, items: Array.isArray(payload.items) ? payload.items : [], total: numberValue(payload.total, 0), page: numberValue(payload.page, query.page), pageSize: requestedPageSize } })),
|
|
1431
|
-
onError: error =>
|
|
1432
|
-
onStart: () => setBusy(true),
|
|
1433
|
+
commit: payload => { setData(current => ({ ...current, generatedFiles: { ...payload, items: Array.isArray(payload.items) ? payload.items : [], total: numberValue(payload.total, 0), page: numberValue(payload.page, query.page), pageSize: requestedPageSize } })); setHistoryState({ key, loading: false }); },
|
|
1434
|
+
onError: error => { const message = error instanceof Error ? `历史生成文件加载失败:${error.message}` : '历史生成文件加载失败'; setHistoryState({ key, loading: false, error: message }); setToast({ message, tone: 'error' }); },
|
|
1435
|
+
onStart: () => { setHistoryState({ key, loading: true }); setBusy(true); },
|
|
1433
1436
|
onFinish: () => setBusy(generatedFilesRequestGateRef.current.activeCount() + requestGateRef.current.activeCount() + routeRequestGateRef.current.activeCount() + analyticsRequestsRef.current.activeCount() > 0)
|
|
1434
1437
|
});
|
|
1435
1438
|
}, [loadRoute]);
|
|
@@ -1600,6 +1603,8 @@ function App() {
|
|
|
1600
1603
|
const loadSalesFileBanks = React.useCallback(() => requestBankAccounts(query => bridge.requestData(query)), []);
|
|
1601
1604
|
const openSalesFiles = React.useCallback((order) => {
|
|
1602
1605
|
setActiveSalesFileOrder(order);
|
|
1606
|
+
if (order)
|
|
1607
|
+
setHistoryState({ key: generatedFileHistoryKey(order), loading: true });
|
|
1603
1608
|
if (!order)
|
|
1604
1609
|
return;
|
|
1605
1610
|
changeRouteRef.current({ type: 'page', page: 'sales-files' });
|
|
@@ -1616,6 +1621,8 @@ function App() {
|
|
|
1616
1621
|
generatedFilesRequestGateRef.current.invalidate(previousKey);
|
|
1617
1622
|
activeGeneratedFilesKeyRef.current = generatedFileHistoryKey(order ?? undefined);
|
|
1618
1623
|
setActiveSalesFileOrder(order);
|
|
1624
|
+
if (order)
|
|
1625
|
+
setHistoryState({ key: generatedFileHistoryKey(order), loading: true });
|
|
1619
1626
|
}, []);
|
|
1620
1627
|
const changeRoute = React.useCallback((nextRoute) => {
|
|
1621
1628
|
routeRevisionRef.current += 1;
|
|
@@ -1658,7 +1665,7 @@ function App() {
|
|
|
1658
1665
|
: page === 'customer-contract-review'
|
|
1659
1666
|
? _jsx(ContractUploadCommand, { label: "\u4E0A\u4F20\u5BA2\u6237\u5408\u540C", busy: busy || actionBusy || customerContractBulkBusy, onFile: file => executeFileAction('upload_customer_contract', file, { documentType: 'CUSTOMER_CONTRACT' }) })
|
|
1660
1667
|
: undefined;
|
|
1661
|
-
return (_jsxs(_Fragment, { children: [_jsxs(WorkbenchShell, { route: route, breadcrumbs: buildBreadcrumbs(route), title: meta.title, subtitle: page === 'home' ? undefined : meta.subtitle, topbarActions: _jsx(TaskStatusMenu, { items: taskStatusItems, busy: busy || actionBusy, onBulkDelete: bulkDeleteImportTasks, onActionError: notifyTaskStatusActionError }), commands: (page === 'controlled-goods' || page === 'sanctioned-companies') ? _jsx(CatalogCommands, { busy: busy || actionBusy, onUpload: () => setCatalogCommand('upload'), onCreate: () => setCatalogCommand('create'), onHistory: () => setCatalogCommand('history'), onClear: page === 'controlled-goods' ? () => setClearControlledCatalogOpen(true) : () => setClearSanctionCatalogOpen(true) }) : contractCommands, busy: busy || actionBusy, contentLoading: routeLoading, onRouteChange: changeRoute, onRefresh: () => void load(), children: [routeLoading && _jsxs("section", { className: "tcw-page-skeleton", role: "status", "aria-label": "\u9875\u9762\u52A0\u8F7D\u4E2D", children: [_jsx("span", {}), _jsx("span", {}), _jsx("span", {}), _jsx("p", { children: "\u6B63\u5728\u52A0\u8F7D\u9875\u9762\u6570\u636E\u2026" })] }), _jsxs("div", { className: "tcw-route-content", hidden: routeLoading, children: [page === 'home' && _jsx(HomePage, {}), page === 'controlled-goods' && _jsx(ControlledGoodsPage, { collection: data.controlledGoods, batches: data.controlledBatches.items, busy: busy || actionBusy, onAction: executeAction, onFileAction: executeCatalogFileAction, onRefresh: load, onQuery: (query) => queryCatalog('controlledGoods', query), onIssueQuery: queryImportIssues, onHistoryQuery: queryCatalogHistory, tasks: data.importTasks.items, onResolveStalledImport: resolveStalledCatalogImport, onRefreshTasks: loadTaskState, importCompletion: importCompletions.CONTROLLED_CATALOG, importFailure: importFailures.CONTROLLED_CATALOG, onRetryImport: retryImport, command: catalogCommand, onCommandHandled: () => setCatalogCommand(null), onNotify: setToast }), page === 'sanctioned-companies' && _jsx(SanctionedCompaniesPage, { collection: data.sanctionedCompanies, batches: data.sanctionBatches.items, busy: busy || actionBusy, onAction: executeAction, onFileAction: executeCatalogFileAction, onRefresh: load, onQuery: (query) => queryCatalog('sanctionedCompanies', query), onIssueQuery: queryImportIssues, onHistoryQuery: queryCatalogHistory, tasks: data.importTasks.items, onResolveStalledImport: resolveStalledCatalogImport, onRefreshTasks: loadTaskState, importCompletion: importCompletions.SANCTION_CATALOG, importFailure: importFailures.SANCTION_CATALOG, onRetryImport: retryImport, command: catalogCommand, onCommandHandled: () => setCatalogCommand(null), onNotify: setToast }), (['procurement', 'sales', 'customer-contract-review'].includes(page) && (catalogAvailabilityRef.current.controlled === false || catalogAvailabilityRef.current.sanction === false)) && _jsxs("div", { className: "tcw-notice tcw-notice--info", role: "status", children: [catalogAvailabilityRef.current.controlled === false ? '管控商品:无有效目录。' : '', catalogAvailabilityRef.current.sanction === false ? '公司制裁:无有效目录。' : '', "\u76F8\u5173\u7ED3\u679C\u4E3A\u5F85\u6838\u9A8C\uFF0C\u8BF7\u5148\u7EF4\u62A4\u6709\u6548\u76EE\u5F55\u540E\u91CD\u65B0\u68C0\u67E5\u3002"] }), page === 'procurement' && route.type === 'procurement' && _jsx(ProcurementPage, { route: route, suppliers: ({ ...data.suppliers, items: data.suppliers.items.map(row => withCatalogAvailability(row, catalogAvailabilityRef.current)) }), purchaseOrders: data.purchaseOrders, purchaseLines: ({ ...data.purchaseLines, items: data.purchaseLines.items.map(row => withCatalogAvailability(row, catalogAvailabilityRef.current)) }), supplier: procurementContext.supplier, order: procurementContext.order, metrics: procurementContext.metrics, importTask: purchaseImportTask, reviewDraft: purchaseReviewDraft, busy: reviewInteractionBusy(Boolean(purchaseReviewDraft), busy, actionBusy), onQuery: queryProcurement, onAction: executeAction, onFileAction: executeFileAction, onRouteChange: changeRoute, onRetryImport: retryContractImport, onReviewClose: closePurchaseReview, onNotify: setToast }), page === 'customer-contract-review' && _jsx(CustomerContractsPage, { collection: ({ ...data.customerContracts, items: data.customerContracts.items.map(row => withCatalogAvailability(row, catalogAvailabilityRef.current)) }), busy: reviewInteractionBusy(customerImportState.status === 'AWAITING_REVIEW', busy, actionBusy || customerContractBulkBusy), importReviewState: customerImportState, onQuery: queryCustomerContracts, onAction: executeAction, onFileAction: executeFileAction, onReanalyze: reanalyzeCustomerContract, onLoadReview: loadCustomerContractReview, onReviewClose: closeCustomerReview, reanalysisState: customerReanalysisState, onRetryImport: retryContractImport, onQueryRequested: rememberCustomerContractQuery, onQueryCancelRegistration: registerCustomerContractQueryCancel, onBulkReconcile: reconcileCustomerContractsAfterBulk, onBulkBusyChange: setCustomerContractBulkBusy, onNotify: setToast }), page === 'sales' && route.type === 'sales' && _jsx(SalesPage, { route: route, customers: ({ ...data.salesCustomers, items: data.salesCustomers.items.map(row => withCatalogAvailability(row, catalogAvailabilityRef.current)) }), orders: data.salesOrders, lines: data.salesLines, busy: busy || actionBusy, onQuery: querySales, onAction: executeAction, onRouteChange: changeRoute, onOpenFiles: openSalesFiles, onNotify: setToast, onImportSupplierMaterial: (type, file, target) => executeFileAction(type === 'ENGLISH_QUOTATION' ? 'import_english_quotation' : 'import_customs_info', file, target, false), onImportSupplierPacking: (file, target) => executeFileAction('import_supplier_packing', file, target, false) }), page === 'sales-files' && _jsx(SalesFilesPage, { orders: data.salesFileOrders, history: data.generatedFiles, activeOrder: activeSalesFileOrder, banks: data.settings.banks, loadBanks: loadSalesFileBanks, busy: busy || actionBusy, externalBulkBusy: salesFileBulkBusy || salesFileBulkReconcileBusy, onQuery: querySalesFiles, onBulkReconcile: reconcileGeneratedFilesAfterBulk, onBulkBusyChange: setSalesFileBulkBusy, onBulkViewActiveChange: setGeneratedFilesBulkViewActive, onAction: executeSalesFileAction, onOpenSalesOrder: selectSalesFileOrder, onDownload: file => executeAction('download_sales_file', { id: file.id }).then(() => undefined), onEdit: async (file) => setEditingSalesFile(file), onNotify: setToast, onImportSupplierMaterial: (type, file, target) => executeFileAction(type === 'ENGLISH_QUOTATION' ? 'import_english_quotation' : 'import_customs_info', file, target, false), onImportSupplierPacking: (file, target) => executeFileAction('import_supplier_packing', file, target, false) }), page === 'analytics' && _jsx(AnalyticsPage, { data: data.analytics, customerOptions: uniqueNames([...data.customers.items, ...data.analytics.dashboard.customerValueTop5, ...data.analytics.dashboard.receivableRiskTop5]), supplierOptions: uniqueNames([...data.suppliers.items, ...data.analytics.dashboard.supplierRiskTop5]), committedQuery: analyticsCommittedQuery, detailRefreshKey: analyticsDetailRefreshKey, busy: busy || actionBusy, error: analyticsError, onQuery: queryAnalytics, onDetailQuery: queryAnalyticsDetails, onDetailAction: openAnalyticsDetailAction, onExportXlsx: exportAnalytics }), page === 'settings' && _jsx(SettingsPage, { data: data.settings, busy: busy || actionBusy, externalBulkBusy: settingsRateBulkBusy || settingsRateBulkReconcileBusy, onSave: saveSettings, onRestoreDefault: restoreSettings, onDeleteRate: deleteSettingsRate, onRateQuery: queryMonthlyRates, onBulkReconcile: reconcileSettingsRatesAfterBulk, onBulkBusyChange: setSettingsRateBulkBusy, onBulkViewActiveChange: setSettingsRatesBulkViewActive, onUploadLogo: uploadCompanyLogo, onDiscardLogo: discardCompanyLogo, onClearBusinessData: clearBusinessData, onNotify: setToast }), !['home', 'controlled-goods', 'sanctioned-companies', 'procurement', 'customer-contract-review', 'sales', 'sales-files', 'analytics', 'settings'].includes(page) && _jsxs("section", { className: "tcw-page-placeholder", "data-page": page, children: [_jsx(InfoNotice, { children: "\u9875\u9762\u57FA\u7840\u7ED3\u6784\u5DF2\u5C31\u7EEA\uFF0C\u4E1A\u52A1\u5185\u5BB9\u5C06\u5728\u5BF9\u5E94\u9875\u9762\u6A21\u5757\u4E2D\u52A0\u8F7D\u3002" }), _jsx("div", { className: "tcw-placeholder-body", "aria-label": `${meta.title}页面内容` })] })] })] }), _jsx(LoadingBlocker, { visible: !routeLoading && reviewInteractionBusy(Boolean(purchaseReviewDraft) || customerImportState.status === 'AWAITING_REVIEW', busy, actionBusy || customerContractBulkBusy), label: actionBusy || customerContractBulkBusy ? '操作处理中' : '数据加载中' }), _jsx(ToastStack, { items: toasts, onClose: closeToast, onHoverChange: hoverToast }), editingSalesFile && _jsx(SalesFileEditor, { file: editingSalesFile, runMutation: runMutation, onNotify: setToast, onClose: () => setEditingSalesFile(null), onSaved: () => {
|
|
1668
|
+
return (_jsxs(_Fragment, { children: [_jsxs(WorkbenchShell, { route: route, breadcrumbs: buildBreadcrumbs(route), title: meta.title, subtitle: page === 'home' ? undefined : meta.subtitle, topbarActions: _jsx(TaskStatusMenu, { items: taskStatusItems, busy: busy || actionBusy, onBulkDelete: bulkDeleteImportTasks, onActionError: notifyTaskStatusActionError }), commands: (page === 'controlled-goods' || page === 'sanctioned-companies') ? _jsx(CatalogCommands, { busy: busy || actionBusy, onUpload: () => setCatalogCommand('upload'), onCreate: () => setCatalogCommand('create'), onHistory: () => setCatalogCommand('history'), onClear: page === 'controlled-goods' ? () => setClearControlledCatalogOpen(true) : () => setClearSanctionCatalogOpen(true) }) : contractCommands, busy: busy || actionBusy, contentLoading: routeLoading, onRouteChange: changeRoute, onRefresh: () => void load(), children: [routeLoading && _jsxs("section", { className: "tcw-page-skeleton", role: "status", "aria-label": "\u9875\u9762\u52A0\u8F7D\u4E2D", children: [_jsx("span", {}), _jsx("span", {}), _jsx("span", {}), _jsx("p", { children: "\u6B63\u5728\u52A0\u8F7D\u9875\u9762\u6570\u636E\u2026" })] }), _jsxs("div", { className: "tcw-route-content", hidden: routeLoading, children: [page === 'home' && _jsx(HomePage, {}), page === 'controlled-goods' && _jsx(ControlledGoodsPage, { collection: data.controlledGoods, batches: data.controlledBatches.items, busy: busy || actionBusy, onAction: executeAction, onFileAction: executeCatalogFileAction, onRefresh: load, onQuery: (query) => queryCatalog('controlledGoods', query), onIssueQuery: queryImportIssues, onHistoryQuery: queryCatalogHistory, tasks: data.importTasks.items, onResolveStalledImport: resolveStalledCatalogImport, onRefreshTasks: loadTaskState, importCompletion: importCompletions.CONTROLLED_CATALOG, importFailure: importFailures.CONTROLLED_CATALOG, onRetryImport: retryImport, command: catalogCommand, onCommandHandled: () => setCatalogCommand(null), onNotify: setToast }), page === 'sanctioned-companies' && _jsx(SanctionedCompaniesPage, { collection: data.sanctionedCompanies, batches: data.sanctionBatches.items, busy: busy || actionBusy, onAction: executeAction, onFileAction: executeCatalogFileAction, onRefresh: load, onQuery: (query) => queryCatalog('sanctionedCompanies', query), onIssueQuery: queryImportIssues, onHistoryQuery: queryCatalogHistory, tasks: data.importTasks.items, onResolveStalledImport: resolveStalledCatalogImport, onRefreshTasks: loadTaskState, importCompletion: importCompletions.SANCTION_CATALOG, importFailure: importFailures.SANCTION_CATALOG, onRetryImport: retryImport, command: catalogCommand, onCommandHandled: () => setCatalogCommand(null), onNotify: setToast }), (['procurement', 'sales', 'customer-contract-review'].includes(page) && (catalogAvailabilityRef.current.controlled === false || catalogAvailabilityRef.current.sanction === false)) && _jsxs("div", { className: "tcw-notice tcw-notice--info", role: "status", children: [catalogAvailabilityRef.current.controlled === false ? '管控商品:无有效目录。' : '', catalogAvailabilityRef.current.sanction === false ? '公司制裁:无有效目录。' : '', "\u76F8\u5173\u7ED3\u679C\u4E3A\u5F85\u6838\u9A8C\uFF0C\u8BF7\u5148\u7EF4\u62A4\u6709\u6548\u76EE\u5F55\u540E\u91CD\u65B0\u68C0\u67E5\u3002"] }), page === 'procurement' && route.type === 'procurement' && _jsx(ProcurementPage, { route: route, suppliers: ({ ...data.suppliers, items: data.suppliers.items.map(row => withCatalogAvailability(row, catalogAvailabilityRef.current)) }), purchaseOrders: data.purchaseOrders, purchaseLines: ({ ...data.purchaseLines, items: data.purchaseLines.items.map(row => withCatalogAvailability(row, catalogAvailabilityRef.current)) }), supplier: procurementContext.supplier, order: procurementContext.order, metrics: procurementContext.metrics, importTask: purchaseImportTask, reviewDraft: purchaseReviewDraft, busy: reviewInteractionBusy(Boolean(purchaseReviewDraft), busy, actionBusy), onQuery: queryProcurement, onAction: executeAction, onFileAction: executeFileAction, onRouteChange: changeRoute, onRetryImport: retryContractImport, onReviewClose: closePurchaseReview, onNotify: setToast }), page === 'customer-contract-review' && _jsx(CustomerContractsPage, { collection: ({ ...data.customerContracts, items: data.customerContracts.items.map(row => withCatalogAvailability(row, catalogAvailabilityRef.current)) }), busy: reviewInteractionBusy(customerImportState.status === 'AWAITING_REVIEW', busy, actionBusy || customerContractBulkBusy), importReviewState: customerImportState, onQuery: queryCustomerContracts, onAction: executeAction, onFileAction: executeFileAction, onReanalyze: reanalyzeCustomerContract, onLoadReview: loadCustomerContractReview, onReviewClose: closeCustomerReview, reanalysisState: customerReanalysisState, onRetryImport: retryContractImport, onQueryRequested: rememberCustomerContractQuery, onQueryCancelRegistration: registerCustomerContractQueryCancel, onBulkReconcile: reconcileCustomerContractsAfterBulk, onBulkBusyChange: setCustomerContractBulkBusy, onNotify: setToast }), page === 'sales' && route.type === 'sales' && _jsx(SalesPage, { route: route, customers: ({ ...data.salesCustomers, items: data.salesCustomers.items.map(row => withCatalogAvailability(row, catalogAvailabilityRef.current)) }), orders: data.salesOrders, lines: data.salesLines, busy: busy || actionBusy, onQuery: querySales, onAction: executeAction, onRouteChange: changeRoute, onOpenFiles: openSalesFiles, onNotify: setToast, onImportSupplierMaterial: (type, file, target) => executeFileAction(type === 'ENGLISH_QUOTATION' ? 'import_english_quotation' : 'import_customs_info', file, target, false), onImportSupplierPacking: (file, target) => executeFileAction('import_supplier_packing', file, target, false) }), page === 'sales-files' && _jsx(SalesFilesPage, { orders: data.salesFileOrders, history: data.generatedFiles, activeOrder: activeSalesFileOrder, historyLoading: Boolean(activeSalesFileOrder && (historyState.key !== generatedFileHistoryKey(activeSalesFileOrder) || historyState.loading)), historyError: historyState.key === generatedFileHistoryKey(activeSalesFileOrder ?? undefined) ? historyState.error : undefined, banks: data.settings.banks, loadBanks: loadSalesFileBanks, busy: busy || actionBusy, externalBulkBusy: salesFileBulkBusy || salesFileBulkReconcileBusy, onQuery: querySalesFiles, onBulkReconcile: reconcileGeneratedFilesAfterBulk, onBulkBusyChange: setSalesFileBulkBusy, onBulkViewActiveChange: setGeneratedFilesBulkViewActive, onAction: executeSalesFileAction, onOpenSalesOrder: selectSalesFileOrder, onDownload: file => executeAction('download_sales_file', { id: file.id }).then(() => undefined), onEdit: async (file) => setEditingSalesFile(file), onNotify: setToast, onImportSupplierMaterial: (type, file, target) => executeFileAction(type === 'ENGLISH_QUOTATION' ? 'import_english_quotation' : 'import_customs_info', file, target, false), onImportSupplierPacking: (file, target) => executeFileAction('import_supplier_packing', file, target, false) }), page === 'analytics' && _jsx(AnalyticsPage, { data: data.analytics, customerOptions: uniqueNames([...data.customers.items, ...data.analytics.dashboard.customerValueTop5, ...data.analytics.dashboard.receivableRiskTop5]), supplierOptions: uniqueNames([...data.suppliers.items, ...data.analytics.dashboard.supplierRiskTop5]), committedQuery: analyticsCommittedQuery, detailRefreshKey: analyticsDetailRefreshKey, busy: busy || actionBusy, error: analyticsError, onQuery: queryAnalytics, onDetailQuery: queryAnalyticsDetails, onDetailAction: openAnalyticsDetailAction, onExportXlsx: exportAnalytics }), page === 'settings' && _jsx(SettingsPage, { data: data.settings, busy: busy || actionBusy, externalBulkBusy: settingsRateBulkBusy || settingsRateBulkReconcileBusy, onSave: saveSettings, onRestoreDefault: restoreSettings, onDeleteRate: deleteSettingsRate, onRateQuery: queryMonthlyRates, onBulkReconcile: reconcileSettingsRatesAfterBulk, onBulkBusyChange: setSettingsRateBulkBusy, onBulkViewActiveChange: setSettingsRatesBulkViewActive, onUploadLogo: uploadCompanyLogo, onDiscardLogo: discardCompanyLogo, onClearBusinessData: clearBusinessData, onNotify: setToast }), !['home', 'controlled-goods', 'sanctioned-companies', 'procurement', 'customer-contract-review', 'sales', 'sales-files', 'analytics', 'settings'].includes(page) && _jsxs("section", { className: "tcw-page-placeholder", "data-page": page, children: [_jsx(InfoNotice, { children: "\u9875\u9762\u57FA\u7840\u7ED3\u6784\u5DF2\u5C31\u7EEA\uFF0C\u4E1A\u52A1\u5185\u5BB9\u5C06\u5728\u5BF9\u5E94\u9875\u9762\u6A21\u5757\u4E2D\u52A0\u8F7D\u3002" }), _jsx("div", { className: "tcw-placeholder-body", "aria-label": `${meta.title}页面内容` })] })] })] }), _jsx(LoadingBlocker, { visible: !routeLoading && reviewInteractionBusy(Boolean(purchaseReviewDraft) || customerImportState.status === 'AWAITING_REVIEW', busy, actionBusy || customerContractBulkBusy), label: actionBusy || customerContractBulkBusy ? '操作处理中' : '数据加载中' }), _jsx(ToastStack, { items: toasts, onClose: closeToast, onHoverChange: hoverToast }), editingSalesFile && _jsx(SalesFileEditor, { file: editingSalesFile, runMutation: runMutation, onNotify: setToast, onClose: () => setEditingSalesFile(null), onSaved: () => {
|
|
1662
1669
|
setEditingSalesFile(null);
|
|
1663
1670
|
if (page === 'analytics') {
|
|
1664
1671
|
setAnalyticsDetailRefreshKey(current => current + 1);
|