@chenchaolong/plugin-trade-compliance-workbench 1.0.5 → 1.0.6

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.
Files changed (33) hide show
  1. package/dist/lib/remote-components/trade-compliance-workbench/app.css +1 -1
  2. package/dist/lib/remote-components/trade-compliance-workbench/app.js +5 -5
  3. package/dist/lib/remote-ui/components/layout.d.ts.map +1 -1
  4. package/dist/lib/remote-ui/components/layout.js +3 -3
  5. package/dist/lib/remote-ui/components/layout.js.map +1 -1
  6. package/dist/lib/remote-ui/pages/catalogs.d.ts +2 -0
  7. package/dist/lib/remote-ui/pages/catalogs.d.ts.map +1 -1
  8. package/dist/lib/remote-ui/pages/catalogs.js +21 -10
  9. package/dist/lib/remote-ui/pages/catalogs.js.map +1 -1
  10. package/dist/lib/remote-ui/pages/contracts.d.ts +3 -1
  11. package/dist/lib/remote-ui/pages/contracts.d.ts.map +1 -1
  12. package/dist/lib/remote-ui/pages/contracts.js +28 -17
  13. package/dist/lib/remote-ui/pages/contracts.js.map +1 -1
  14. package/dist/lib/remote-ui/pages/files.d.ts +18 -0
  15. package/dist/lib/remote-ui/pages/files.d.ts.map +1 -1
  16. package/dist/lib/remote-ui/pages/files.js +13 -7
  17. package/dist/lib/remote-ui/pages/files.js.map +1 -1
  18. package/dist/lib/remote-ui/pages/home.d.ts.map +1 -1
  19. package/dist/lib/remote-ui/pages/home.js +18 -18
  20. package/dist/lib/remote-ui/pages/home.js.map +1 -1
  21. package/dist/lib/remote-ui/pages/procurement.d.ts +23 -0
  22. package/dist/lib/remote-ui/pages/procurement.d.ts.map +1 -1
  23. package/dist/lib/remote-ui/pages/procurement.js +17 -16
  24. package/dist/lib/remote-ui/pages/procurement.js.map +1 -1
  25. package/dist/lib/remote-ui/pages/sales.d.ts +42 -1
  26. package/dist/lib/remote-ui/pages/sales.d.ts.map +1 -1
  27. package/dist/lib/remote-ui/pages/sales.js +30 -9
  28. package/dist/lib/remote-ui/pages/sales.js.map +1 -1
  29. package/dist/lib/remote-ui/pages/settings.d.ts +32 -1
  30. package/dist/lib/remote-ui/pages/settings.d.ts.map +1 -1
  31. package/dist/lib/remote-ui/pages/settings.js +99 -55
  32. package/dist/lib/remote-ui/pages/settings.js.map +1 -1
  33. package/package.json +1 -1
@@ -1,30 +1,30 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  export const RISK_OPERATION_ITEMS = [
3
- { key: 'catalog-replace', title: '覆盖管控目录', description: '确认目录类型和被覆盖的历史文件。', icon: 'ri-file-warning-line' },
4
- { key: 'duplicate-contract', title: '重复上传合同', description: '采购合同和客户合同不允许覆盖已有记录。', icon: 'ri-file-copy-2-line' },
5
- { key: 'catalog-impact', title: '覆盖目录', description: '目录覆盖会立即影响商品和公司风险结果。', icon: 'ri-refresh-line' },
6
- { key: 'delete-data', title: '删除业务数据', description: '删除前请核对其下游影响,前端不提供恢复。', icon: 'ri-delete-bin-line' },
7
- { key: 'payments', title: '维护付款、收款和退税', description: '金额使用人民币,超过订单总额时禁止保存。', icon: 'ri-money-cny-circle-line' },
8
- { key: 'profit', title: '维护利润率', description: '客户默认利润率会影响派生销售订单。', icon: 'ri-percent-line' },
9
- { key: 'risk-review', title: '核对风险', description: '命中管控或制裁目录时必须人工复核。', icon: 'ri-shield-check-line' },
10
- { key: 'generate-file', title: '生成销售文件', description: '生成前确认公司、银行和利润率规则。', icon: 'ri-file-excel-2-line' },
11
- { key: 'edit-excel', title: '在线编辑 Excel', description: '保存会直接覆盖当前历史文件。', icon: 'ri-edit-box-line' },
12
- { key: 'confirm', title: '操作前请确认', description: '目录、合同、金额和文件操作会影响下游业务。', icon: 'ri-error-warning-line' }
3
+ { key: 'catalog-replace', title: '覆盖管控目录', description: '确认目录类型和被覆盖的历史文件。覆盖后新目录立即生效,原目录数据只在后台留痕,前端暂不支持恢复。', icon: 'ri-folder-warning-line' },
4
+ { key: 'duplicate-contract', title: '重复上传合同', description: '采购合同和客户合同均不允许覆盖;发现相同合同编码时系统会阻止上传。确需重传时必须先逻辑删除旧合同。', icon: 'ri-upload-cloud-2-line' },
5
+ { key: 'catalog-impact', title: '覆盖目录', description: '管控商品目录和公司制裁目录覆盖都会立即影响风险结果,请确认被覆盖文件和记录数量。', icon: 'ri-book-open-line' },
6
+ { key: 'delete-data', title: '删除业务数据', description: '删除供应商、客户、订单、商品、目录记录或历史文件前,请确认其下游影响。业务删除和目录覆盖均为逻辑删除。', icon: 'ri-delete-bin-line' },
7
+ { key: 'payments', title: '维护付款/收款/退税', description: '采购和销售金额统一使用人民币;金额超过订单总额或预计退税额时系统将禁止保存。', icon: 'ri-money-cny-circle-line' },
8
+ { key: 'profit', title: '维护利润率', description: '客户默认利润率会实时影响其全部未单独设置利润率的派生销售订单,历史生成文件不会自动更新。', icon: 'ri-line-chart-line' },
9
+ { key: 'risk-review', title: '核对风险', description: '系统会匹配管控商品目录和公司制裁目录;命中制裁公司只提示、不阻止保存,但必须人工核对风险明细。', icon: 'ri-shield-check-line' },
10
+ { key: 'generate-file', title: '生成销售文件', description: '生成前请确认公司信息、银行信息和利润率规则。模板辅助字段由用户在生成后的 Excel 中审核修改。', icon: 'ri-file-excel-2-line' },
11
+ { key: 'edit-excel', title: '在线编辑 Excel', description: '历史文件在线保存会直接覆盖当前文件,不保留旧版本,也不会反向更新采购合同、客户合同或数据分析数据。', icon: 'ri-edit-box-line' },
12
+ { key: 'confirm', title: '操作前请确认', description: '外贸合规数据会直接影响合同关联、利润校验、销售文件和经营报表。执行高风险操作前,请务必核对业务对象和数据内容。', icon: 'ri-error-warning-line' }
13
13
  ];
14
14
  export const WORKFLOW_STEPS = [
15
15
  { key: 'catalogs', title: '维护管控商品与公司制裁目录', titleLines: ['维护管控商品与', '公司制裁目录'], description: '上传并维护管控商品目录和公司制裁目录', icon: 'ri-book-open-line', tone: 'blue', layout: { area: 'step-1', desktop: 'right', tablet: 'right', mobile: 'down' } },
16
16
  { key: 'contracts', title: '上传并审核采购合同和客户合同', titleLines: ['上传并审核采购', '合同和客户合同'], description: '上传采购合同和客户合同并进行审核入库', icon: 'ri-file-upload-line', tone: 'green', layout: { area: 'step-2', desktop: 'right', tablet: 'down', mobile: 'down' } },
17
17
  { key: 'risk-match', title: '商品及公司风险匹配', titleLines: ['商品及公司', '风险匹配'], description: '系统匹配目录进行商品和公司风险识别', icon: 'ri-shield-check-line', tone: 'violet', layout: { area: 'step-3', desktop: 'right', tablet: 'left', mobile: 'down' } },
18
- { key: 'derive-sales', title: '自动派生销售订单', titleLines: ['自动派生', '销售订单'], description: '根据客户合同自动关联采购合同并派生订单', icon: 'ri-shopping-cart-line', tone: 'orange', layout: { area: 'step-4', desktop: 'down', tablet: 'down', mobile: 'down' } },
19
- { key: 'profit-check', title: '利润率校验', titleLines: ['利润率校验'], description: '校验利润率是否符合企业规则和要求', icon: 'ri-percent-line', tone: 'blue', layout: { area: 'step-5', desktop: 'left', tablet: 'right', mobile: 'down' } },
20
- { key: 'bank', title: '选择银行信息(报关单跳过)', titleLines: ['选择银行信息', '(报关单跳过)'], description: '选择或确认银行信息用于相关单据', icon: 'ri-bank-line', tone: 'green', layout: { area: 'step-6', desktop: 'left', tablet: 'down', mobile: 'down' } },
21
- { key: 'review-files', title: '生成并在线审核销售文件', titleLines: ['生成并在线审核', '销售文件'], description: '生成销售文件并在 Excel 中审核修改', icon: 'ri-file-check-line', tone: 'violet', layout: { area: 'step-7', desktop: 'left', tablet: 'left', mobile: 'down' } },
18
+ { key: 'derive-sales', title: '自动派生销售订单', titleLines: ['自动派生', '销售订单'], description: '根据客户合同自动关联采购合同并派生订单', icon: 'ri-shopping-cart-line', tone: 'orange', layout: { area: 'step-4', desktop: 'right', tablet: 'down', mobile: 'down' } },
19
+ { key: 'profit-check', title: '利润率校验', titleLines: ['利润率校验'], description: '校验利润率是否符合企业规则和要求', icon: 'ri-percent-line', tone: 'blue', layout: { area: 'step-5', desktop: 'right', tablet: 'right', mobile: 'down' } },
20
+ { key: 'bank', title: '选择银行信息(报关单跳过)', titleLines: ['选择银行信息', '(报关单跳过)'], description: '选择或确认银行信息用于相关单据', icon: 'ri-bank-line', tone: 'green', layout: { area: 'step-6', desktop: 'right', tablet: 'down', mobile: 'down' } },
21
+ { key: 'review-files', title: '生成并在线审核销售文件', titleLines: ['生成并在线审核', '销售文件'], description: '生成销售文件并在 Excel 中审核修改', icon: 'ri-file-check-line', tone: 'violet', layout: { area: 'step-7', desktop: 'right', tablet: 'left', mobile: 'down' } },
22
22
  { key: 'analytics', title: '数据分析', titleLines: ['数据分析'], description: '查看业务数据和经营分析报表', icon: 'ri-bar-chart-line', tone: 'blue', layout: { area: 'step-8', desktop: null, tablet: null, mobile: null } }
23
23
  ];
24
24
  export function HomePage() {
25
- return _jsxs("div", { className: "tcw-home-page", children: [_jsxs("section", { className: "tcw-home-section", "aria-labelledby": "risk-operation-title", children: [_jsxs("h2", { id: "risk-operation-title", className: "tcw-home-section-title", children: [_jsx("i", { className: "ri-shield-flash-line", "aria-hidden": "true" }), "\u98CE\u9669\u64CD\u4F5C\u63D0\u793A"] }), _jsx("div", { className: "tcw-home-risk-matrix", children: RISK_OPERATION_ITEMS.map(item => _jsxs("article", { className: "tcw-home-risk-item", "data-risk-operation": item.key, children: [_jsxs("div", { className: "tcw-home-risk-heading", children: [_jsx("i", { className: item.icon, "aria-hidden": "true" }), _jsx("h3", { children: item.title })] }), _jsx("p", { children: item.description })] }, item.key)) })] }), _jsxs("section", { className: "tcw-home-section", "aria-labelledby": "workflow-title", children: [_jsxs("div", { className: "tcw-home-workflow-heading", children: [_jsx("h2", { id: "workflow-title", className: "tcw-home-section-title", children: "\u4E1A\u52A1\u6D41\u7A0B\u56FE" }), _jsx("p", { children: "\u8BF7\u6309\u7167\u4EE5\u4E0B\u4E1A\u52A1\u6D41\u7A0B\u8FDB\u884C\u64CD\u4F5C" })] }), _jsx("div", { className: "tcw-home-workflow", children: WORKFLOW_STEPS.map((step, index) => {
26
- const { layout } = step;
27
- return _jsxs("article", { className: `tcw-home-workflow-step tcw-home-workflow-step--${step.tone}`, style: { gridArea: layout.area }, "data-workflow-step": step.key, children: [_jsx("span", { className: "tcw-home-step-number", children: index + 1 }), _jsx("i", { className: step.icon, "aria-hidden": "true" }), _jsx("h3", { "aria-label": step.title, children: step.titleLines.map(line => _jsx("span", { className: "tcw-home-step-title-line", children: line }, line)) }), _jsx("p", { children: step.description }), layout.desktop && _jsx("i", { className: "ri-arrow-right-line tcw-home-workflow-connector", "data-workflow-connector": true, "data-desktop-direction": layout.desktop, "data-tablet-direction": layout.tablet ?? undefined, "data-mobile-direction": layout.mobile ?? undefined, "aria-hidden": "true" })] }, step.key);
28
- }) })] })] });
25
+ return _jsx("div", { className: "tcw-home-page", children: _jsxs("section", { className: "tcw-home-section", "aria-labelledby": "risk-operation-title", children: [_jsxs("h2", { id: "risk-operation-title", className: "tcw-home-section-title", children: [_jsx("i", { className: "ri-shield-flash-line", "aria-hidden": "true" }), "\u98CE\u9669\u64CD\u4F5C\u63D0\u793A"] }), _jsx("div", { className: "tcw-home-risk-matrix", children: RISK_OPERATION_ITEMS.map(item => _jsxs("article", { className: "tcw-home-risk-item", "data-risk-operation": item.key, children: [_jsxs("div", { className: "tcw-home-risk-heading", children: [_jsx("i", { className: item.icon, "aria-hidden": "true" }), _jsx("h3", { children: item.title })] }), _jsx("p", { children: item.description })] }, item.key)) }), _jsxs("div", { className: "tcw-home-workflow-heading", children: [_jsx("h2", { id: "workflow-title", className: "tcw-home-section-title", children: "\u4E1A\u52A1\u6D41\u7A0B\u56FE" }), _jsx("p", { children: "\u8BF7\u6309\u7167\u4EE5\u4E0B\u4E1A\u52A1\u6D41\u7A0B\u8FDB\u884C\u64CD\u4F5C" })] }), _jsx("div", { className: "tcw-home-workflow", children: WORKFLOW_STEPS.map((step, index) => {
26
+ const { layout } = step;
27
+ return _jsxs("article", { className: `tcw-home-workflow-step tcw-home-workflow-step--${step.tone}`, style: { gridArea: layout.area }, "data-workflow-step": step.key, children: [_jsx("span", { className: "tcw-home-step-number", children: index + 1 }), _jsx("i", { className: step.icon, "aria-hidden": "true" }), _jsx("h3", { "aria-label": step.title, children: step.titleLines.map(line => _jsx("span", { className: "tcw-home-step-title-line", children: line }, line)) }), _jsx("p", { children: step.description }), layout.desktop && _jsx("i", { className: "ri-arrow-right-line tcw-home-workflow-connector", "data-workflow-connector": true, "data-desktop-direction": layout.desktop, "data-tablet-direction": layout.tablet ?? undefined, "data-mobile-direction": layout.mobile ?? undefined, "aria-hidden": "true" })] }, step.key);
28
+ }) }), _jsxs("div", { className: "tcw-home-footer-notice", children: [_jsx("i", { className: "ri-information-line", "aria-hidden": "true" }), _jsx("span", { children: "\u6240\u6709\u4E1A\u52A1\u6570\u636E\u6309\u79DF\u6237 + \u7EC4\u7EC7\u9694\u79BB\uFF0C\u5171\u4EAB\u7EC4\u7EC7\u5185\u6570\u636E\u3002\u672C\u5DE5\u4F5C\u53F0\u4EC5\u63D0\u4F9B\u4E1A\u52A1\u64CD\u4F5C\u5165\u53E3\uFF0C\u5177\u4F53\u8868\u683C\u548C\u7EDF\u8BA1\u62A5\u8868\u8BF7\u524D\u5F80\u5404\u529F\u80FD\u6A21\u5757\u67E5\u770B\u3002" })] })] }) });
29
29
  }
30
30
  //# sourceMappingURL=home.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"home.js","sourceRoot":"","sources":["../../../../src/lib/remote-ui/pages/home.tsx"],"names":[],"mappings":";AAQA,MAAM,CAAC,MAAM,oBAAoB,GAAiC;IAChE,EAAE,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,sBAAsB,EAAE;IAC1G,EAAE,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC/G,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,WAA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G,CAAC,GAAQ,EAAA,YAAG,SAAS,EAAE,IAAI,CAAC,IAAI,iBAAc,MAAM,GAAG,EAAA,2BAAgB,IAAI,CAAC,KAAK,YAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,eAAM,SAAS,EAAC,0BAA0B,YAAa,IAAI,IAAX,IAAI,CAAe,CAAC,GAAM,EAAA,sBAAI,IAAI,CAAC,WAAW,GAAK,EAAC,MAAM,CAAC,OAAO,IAAI,YAAG,SAAS,EAAC,iDAAiD,6DAAiD,MAAM,CAAC,OAAO,2BAAyB,MAAM,CAAC,MAAM,IAAI,SAAS,2BAAyB,MAAM,CAAC,MAAM,IAAI,SAAS,iBAAc,MAAM,GAAG,KAAxjB,IAAI,CAAC,GAAG,CAA2jB,CAAA;oBACtsB,CAAC,CAAC,GAAO,EACT,eAAK,SAAS,EAAC,wBAAwB,aAAC,YAAG,SAAS,EAAC,qBAAqB,iBAAa,MAAM,GAAG,EAAA,iXAAwE,IAAM,IACtK,GACN,CAAA;AACR,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { FilterDefinition, FilterMapping, FilterState, WorkbenchRoute } from '../contracts.js';
2
2
  import type { ProcurementActionResult, ProcurementDeleteEntityType, ProcurementMetrics, ProcurementPageProps, PurchaseContractReviewDraft, PurchaseOrderLineDraft, PurchaseOrderLineRow, PurchaseOrderRow, SupplierRow } from '../procurement-contracts.js';
3
+ import './procurement-contracts.css';
3
4
  export type { ProcurementPageProps } from '../procurement-contracts.js';
4
5
  export declare const procurementFilterMappings: {
5
6
  suppliers: Record<string, FilterMapping<SupplierRow>>;
@@ -33,4 +34,26 @@ export declare function ProcurementContextBar(props: {
33
34
  order: PurchaseOrderRow;
34
35
  onRouteChange: (route: WorkbenchRoute) => void;
35
36
  }): import("react/jsx-runtime").JSX.Element;
37
+ export declare function LineDialog({ state, order, busy, onAction, onClose, onSave }: {
38
+ state: {
39
+ mode: 'create' | 'review';
40
+ item: PurchaseOrderLineDraft;
41
+ } | null;
42
+ order: PurchaseOrderRow | null;
43
+ busy: boolean;
44
+ onAction: ProcurementPageProps['onAction'];
45
+ onClose: () => void;
46
+ onSave: (item: PurchaseOrderLineDraft) => Promise<void> | void;
47
+ }): import("react/jsx-runtime").JSX.Element | null;
48
+ type DeleteTarget = {
49
+ entityType: ProcurementDeleteEntityType;
50
+ item: SupplierRow | PurchaseOrderRow | PurchaseOrderLineRow;
51
+ };
52
+ export declare function DeleteDialog({ target, supplier, busy, onCancel, onConfirm }: {
53
+ target: DeleteTarget | null;
54
+ supplier: SupplierRow | null;
55
+ busy: boolean;
56
+ onCancel: () => void;
57
+ onConfirm: () => void;
58
+ }): import("react/jsx-runtime").JSX.Element;
36
59
  //# sourceMappingURL=procurement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"procurement.d.ts","sourceRoot":"","sources":["../../../../src/lib/remote-ui/pages/procurement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAoB,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAgC,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACnJ,OAAO,KAAK,EAGV,uBAAuB,EAEvB,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAGhB,WAAW,EACZ,MAAM,6BAA6B,CAAA;AAKpC,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAkCvE,eAAO,MAAM,yBAAyB,EAAE;IACtC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAA;IACrD,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAA;IAC/D,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC,CAAA;CAwBnE,CAAA;AAED,wBAAgB,+BAA+B,CAAC,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AAE,2CAKtM"}
@@ -3,6 +3,7 @@ import React from 'react';
3
3
  import { DataGrid, FilterPanel, InfoNotice, RiskNotice } from '../components/data-grid.js';
4
4
  import { ConfirmDialog, FieldGrid, FormField, Modal, ReviewSplit } from '../components/forms.js';
5
5
  import { HsCodeLookupDialog } from './catalogs.js';
6
+ import './procurement-contracts.css';
6
7
  const PAGE_SIZE = 20;
7
8
  const sanctionLabels = { UNCHECKED: '未检查', CLEAR: '无命中', HIT: '命中提醒' };
8
9
  const hsStatusLabels = { UNCONFIRMED: '待审核', AI_CONFIRMED: 'AI确认', MANUALLY_CONFIRMED: '人工确认' };
@@ -21,7 +22,7 @@ const orderFilters = [
21
22
  { type: 'amount-range', key: 'contractAmountCny', label: '采购金额', currency: 'CNY' },
22
23
  { type: 'select', key: 'hasUnpaid', label: '未付款', options: booleanOptions() },
23
24
  { type: 'select', key: 'hasUnrefunded', label: '未退税', options: booleanOptions() },
24
- { type: 'select', key: 'linkStatus', label: '关联状态', options: [{ value: 'LINKED', label: '已关联' }, { value: 'UNLINKED', label: '未关联' }] }
25
+ { type: 'select', key: 'linkStatus', label: '已匹配客户合同', options: [{ value: 'LINKED', label: '已关联' }, { value: 'UNLINKED', label: '未关联' }] }
25
26
  ];
26
27
  const lineFilters = [
27
28
  { type: 'text', key: 'productName', label: '商品名称' },
@@ -210,7 +211,7 @@ export function ProcurementPage(props) {
210
211
  return api.updatePurchaseLine({ ...item, id: item.id });
211
212
  };
212
213
  const reviewVisible = Boolean(props.importTask && (draft || props.importTask.duplicateContractError));
213
- return (_jsxs("section", { className: "tcw-procurement-page", "data-procurement-level": props.route.level, children: [message && _jsx("div", { className: "tcw-procurement-feedback", role: "status", children: message }), props.importTask && (props.importTask.status === 'FAILED' || props.importTask.status === 'TIMED_OUT') && _jsxs("div", { className: "tcw-procurement-feedback", role: "alert", children: [props.importTask.errorMessage || '采购合同解析失败', props.onRetryImport && _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => void props.onRetryImport?.(props.importTask.id), children: [_jsx("i", { className: "ri-restart-line", "aria-hidden": "true" }), "\u91CD\u65B0\u89E3\u6790"] })] }), props.route.level === 'suppliers' && _jsx(SupplierLevel, { props: props, filters: filters, definitions: definitions, onFilter: changeFilter, onSubmit: () => scheduler.flush(filters), onReset: reset, onPage: (page) => void query(page, filters), onSupplierDialog: setSupplierDialog, onDelete: (item) => setDeleteTarget({ entityType: 'supplier', item }) }), props.route.level === 'orders' && _jsx(OrderLevel, { props: props, filters: filters, definitions: definitions, onFilter: changeFilter, onSubmit: () => scheduler.flush(filters), onReset: reset, onPage: (page) => void query(page, filters), onOrderDialog: setOrderDialog, onDelete: (item) => setDeleteTarget({ entityType: 'purchaseOrder', item }) }), props.route.level === 'lines' && _jsx(LineLevel, { props: props, filters: filters, definitions: definitions, onFilter: changeFilter, onSubmit: () => scheduler.flush(filters), onReset: reset, onPage: (page) => void query(page, filters), onLineDialog: setLineDialog, onDelete: (item) => setDeleteTarget({ entityType: 'purchaseLine', item }) }), _jsx(SupplierDialog, { state: supplierDialog, busy: props.busy, onClose: () => setSupplierDialog(null), onSave: (item) => execute(() => api.updateSupplier(item), '供应商主档已保存').then((saved) => { if (saved)
214
+ return (_jsxs("section", { className: "tcw-procurement-page tcw-procurement-prototype-surface", "data-procurement-level": props.route.level, children: [message && _jsx("div", { className: "tcw-procurement-feedback", role: "status", children: message }), props.importTask && (props.importTask.status === 'FAILED' || props.importTask.status === 'TIMED_OUT') && _jsxs("div", { className: "tcw-procurement-feedback", role: "alert", children: [props.importTask.errorMessage || '采购合同解析失败', props.onRetryImport && _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => void props.onRetryImport?.(props.importTask.id), children: [_jsx("i", { className: "ri-restart-line", "aria-hidden": "true" }), "\u91CD\u65B0\u89E3\u6790"] })] }), props.route.level === 'suppliers' && _jsx(SupplierLevel, { props: props, filters: filters, definitions: definitions, onFilter: changeFilter, onSubmit: () => scheduler.flush(filters), onReset: reset, onPage: (page) => void query(page, filters), onSupplierDialog: setSupplierDialog, onDelete: (item) => setDeleteTarget({ entityType: 'supplier', item }) }), props.route.level === 'orders' && _jsx(OrderLevel, { props: props, filters: filters, definitions: definitions, onFilter: changeFilter, onSubmit: () => scheduler.flush(filters), onReset: reset, onPage: (page) => void query(page, filters), onOrderDialog: setOrderDialog, onDelete: (item) => setDeleteTarget({ entityType: 'purchaseOrder', item }) }), props.route.level === 'lines' && _jsx(LineLevel, { props: props, filters: filters, definitions: definitions, onFilter: changeFilter, onSubmit: () => scheduler.flush(filters), onReset: reset, onPage: (page) => void query(page, filters), onLineDialog: setLineDialog, onDelete: (item) => setDeleteTarget({ entityType: 'purchaseLine', item }) }), _jsx(SupplierDialog, { state: supplierDialog, busy: props.busy, onClose: () => setSupplierDialog(null), onSave: (item) => execute(() => api.updateSupplier(item), '供应商主档已保存').then((saved) => { if (saved)
214
215
  setSupplierDialog(null); }) }), _jsx(OrderDialog, { state: orderDialog, lines: props.purchaseLines.items, busy: props.busy, onClose: () => setOrderDialog(null), onSave: (item) => execute(() => api.updatePurchaseOrder(item), '采购订单已保存').then((saved) => { if (saved)
215
216
  setOrderDialog(null); }) }), _jsx(LineDialog, { state: lineDialog, order: props.order ?? null, busy: props.busy, onAction: props.onAction, onClose: () => setLineDialog(null), onSave: (item) => execute(() => saveLine(item), '采购商品已保存').then((saved) => { if (saved)
216
217
  setLineDialog(null); }) }), _jsx(PurchaseContractReviewDialog, { open: reviewVisible, task: props.importTask, draft: draft, busy: props.busy, onChange: setDraft, onClose: closeDraft, onSave: (nextDraft) => execute(() => api.savePurchaseReview(props.importTask.id, nextDraft), '采购合同审核已保存').then((saved) => { if (saved)
@@ -228,6 +229,7 @@ function SupplierLevel({ props, filters, definitions, onFilter, onSubmit, onRese
228
229
  { type: 'text', key: 'shortName', header: '简称', width: 140 },
229
230
  { type: 'text', key: 'contactName', header: '联系人', width: 130 },
230
231
  { type: 'text', key: 'phone', header: '联系电话', width: 160 },
232
+ { type: 'text', key: 'countryOrRegion', header: '国别/地区', width: 120, format: (value) => String(value || '—') },
231
233
  { type: 'custom', key: 'sanctionStatus', header: '制裁风险', width: 110, render: (_, row) => _jsx(StatusTag, { tone: row.sanctionStatus === 'HIT' ? 'danger' : row.sanctionStatus === 'CLEAR' ? 'success' : 'muted', children: sanctionLabels[row.sanctionStatus ?? 'UNCHECKED'] }) },
232
234
  { type: 'text', key: 'createdAt', header: '创建时间', width: 170 }
233
235
  ];
@@ -261,8 +263,7 @@ function LineLevel({ props, filters, definitions, onFilter, onSubmit, onReset, o
261
263
  { type: 'text', key: 'hsCode', header: '海关编码', width: 130 },
262
264
  { type: 'text', key: 'refundRate', header: '退税率', width: 90, align: 'right', format: percent },
263
265
  { type: 'custom', key: 'hsCodeStatus', header: '编码确认状态', width: 120, render: (_, row) => _jsx(StatusTag, { tone: row.hsCodeStatus === 'UNCONFIRMED' || !row.hsCodeStatus ? 'warning' : 'success', children: hsStatusLabels[row.hsCodeStatus ?? 'UNCONFIRMED'] }) },
264
- { type: 'text', key: 'complianceCategories', header: '命中合规分类', width: 150, format: (value) => Array.isArray(value) && value.length ? value.map((item) => complianceLabels[item]).join('、') : '无命中' },
265
- { type: 'text', key: 'sourceType', header: '来源类型', width: 110, format: (value) => sourceTypeLabels[value] }
266
+ { type: 'text', key: 'complianceCategories', header: '命中合规分类', width: 150, format: (value) => Array.isArray(value) && value.length ? value.map((item) => complianceLabels[item]).join('、') : '无命中' }
266
267
  ];
267
268
  const newLine = { purchaseOrderId: props.order?.id ?? '', sourceType: 'MANUAL_ENTRY', productName: '', quantity: '', unitPriceTaxIncluded: '', lineAmountTaxIncluded: '', hsCodeStatus: 'UNCONFIRMED' };
268
269
  return _jsxs(_Fragment, { children: [_jsx(ProcurementLevelHeading, { title: "\u91C7\u8D2D\u5546\u54C1\u5217\u8868", description: "\u4E09\u7EA7\u9875\u9762\uFF1A\u67E5\u770B\u5F53\u524D\u91C7\u8D2D\u8BA2\u5355\u7684\u5546\u54C1\u660E\u7EC6\uFF0C\u53EF\u65B0\u589E\u3001\u5BA1\u6838\u548C\u903B\u8F91\u5220\u9664\u5546\u54C1\u3002", commands: _jsxs("button", { type: "button", className: "tcw-button tcw-button--primary", disabled: props.busy || !props.order?.id, onClick: () => onLineDialog({ mode: 'create', item: newLine }), children: [_jsx("i", { className: "ri-add-line", "aria-hidden": "true" }), "\u65B0\u589E\u5546\u54C1"] }) }), props.supplier && props.order && _jsx(ProcurementContextBar, { level: "order", supplier: props.supplier, order: props.order, onRouteChange: props.onRouteChange }), _jsx(FilterPanel, { definitions: definitions, values: filters, onChange: onFilter, onQuery: onSubmit, onReset: onReset }), _jsx(InfoNotice, { children: "\u53EF\u901A\u8FC7\u5BA1\u6838\u5B8C\u5584\u82F1\u6587\u540D\u79F0\u3001\u6D77\u5173\u7F16\u7801\u3001\u9000\u7A0E\u7387\u548C\u98CE\u9669\u5339\u914D\u4FE1\u606F\u3002" }), _jsx(DataGrid, { columns: columns, rows: props.purchaseLines.items, rowKey: (row, index) => row.id ?? index, pagination: pagination(props.purchaseLines), onPageChange: onPage, emptyText: "\u6682\u65E0\u91C7\u8D2D\u5546\u54C1\u6570\u636E", actionWidth: 120, actions: (row) => _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", onClick: () => onLineDialog({ mode: 'review', item: row }), children: [_jsx("i", { className: "ri-edit-line", "aria-hidden": "true" }), "\u5BA1\u6838"] }), _jsxs("button", { type: "button", className: "is-danger", onClick: () => onDelete(row), children: [_jsx("i", { className: "ri-delete-bin-line", "aria-hidden": "true" }), "\u5220\u9664"] })] }) })] });
@@ -271,16 +272,16 @@ function ProcurementLevelHeading({ title, description, commands }) {
271
272
  return _jsxs("header", { className: "tcw-procurement-level-heading", children: [_jsxs("div", { children: [_jsx("h2", { children: title }), _jsx("p", { children: description })] }), commands && _jsx("div", { className: "tcw-procurement-toolbar", children: commands })] });
272
273
  }
273
274
  export function ProcurementContextBar(props) {
274
- return _jsxs("section", { className: "tcw-procurement-context", "aria-label": props.level === 'supplier' ? '供应商上下文' : '采购订单上下文', children: [_jsx(ContextValue, { label: "\u4F9B\u5E94\u5546\u4EE3\u7801", value: props.supplier.code }), _jsx(ContextValue, { label: "\u4F9B\u5E94\u5546\u540D\u79F0", value: props.supplier.name }), _jsx(ContextValue, { label: "\u8054\u7CFB\u4EBA", value: props.supplier.contactName }), _jsx(ContextValue, { label: "\u8054\u7CFB\u7535\u8BDD", value: props.supplier.phone }), props.level === 'order' && _jsxs(_Fragment, { children: [_jsx(ContextValue, { label: "\u91C7\u8D2D\u5408\u540C\u7F16\u53F7", value: props.order.contractNo }), _jsx(ContextValue, { label: "\u4E0B\u5355\u65E5\u671F", value: props.order.orderDate }), _jsx(ContextValue, { label: "\u91C7\u8D2D\u91D1\u989D", value: currency(props.order.contractAmountCny) })] }), _jsxs("div", { className: "tcw-procurement-context-actions", children: [_jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => props.onRouteChange({ type: 'procurement', level: 'suppliers' }), children: [_jsx("i", { className: "ri-arrow-left-line", "aria-hidden": "true" }), "\u8FD4\u56DE\u4F9B\u5E94\u5546\u5217\u8868"] }), props.level === 'order' && _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => props.onRouteChange({ type: 'procurement', level: 'orders', supplierId: props.supplier.id ?? props.order.supplierId }), children: [_jsx("i", { className: "ri-arrow-left-line", "aria-hidden": "true" }), "\u8FD4\u56DE\u8BA2\u5355\u5217\u8868"] })] })] });
275
+ return _jsxs("section", { className: `tcw-procurement-context tcw-procurement-context--${props.level}`, "aria-label": props.level === 'supplier' ? '供应商上下文' : '采购订单上下文', children: [props.level === 'supplier' ? _jsxs(_Fragment, { children: [_jsx(ContextValue, { label: "\u4F9B\u5E94\u5546\u4EE3\u7801", value: props.supplier.code }), _jsx(ContextValue, { label: "\u4F9B\u5E94\u5546\u540D\u79F0", value: props.supplier.name }), _jsx(ContextValue, { label: "\u8054\u7CFB\u4EBA", value: props.supplier.contactName }), _jsx(ContextValue, { label: "\u8054\u7CFB\u7535\u8BDD", value: props.supplier.phone })] }) : _jsxs(_Fragment, { children: [_jsx(ContextValue, { label: "\u4F9B\u5E94\u5546", value: props.supplier.name }), _jsx(ContextValue, { label: "\u91C7\u8D2D\u5408\u540C\u7F16\u53F7", value: props.order.contractNo }), _jsx(ContextValue, { label: "\u4E0B\u5355\u65E5\u671F", value: props.order.orderDate }), _jsx(ContextValue, { label: "\u91C7\u8D2D\u91D1\u989D", value: currency(props.order.contractAmountCny) })] }), _jsx("div", { className: "tcw-procurement-context-actions", children: props.level === 'supplier' ? _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => props.onRouteChange({ type: 'procurement', level: 'suppliers' }), children: [_jsx("i", { className: "ri-arrow-left-line", "aria-hidden": "true" }), "\u8FD4\u56DE\u4F9B\u5E94\u5546\u5217\u8868"] }) : _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => props.onRouteChange({ type: 'procurement', level: 'orders', supplierId: props.supplier.id ?? props.order.supplierId }), children: [_jsx("i", { className: "ri-arrow-left-line", "aria-hidden": "true" }), "\u8FD4\u56DE\u8BA2\u5355\u5217\u8868"] }) })] });
275
276
  }
276
277
  function MetricStrip({ metrics }) {
277
278
  const items = [
278
- ['订单总数', number(metrics.totalOrderCount)],
279
- ['采购订单总额', currency(metrics.totalPurchaseAmountCny)],
280
- ['本年订单数', number(metrics.currentYearOrderCount)],
281
- ['本年采购金额', currency(metrics.currentYearPurchaseAmountCny)]
279
+ ['订单总数', number(metrics.totalOrderCount), 'ri-clipboard-line', 'blue'],
280
+ ['采购总金额', currency(metrics.totalPurchaseAmountCny), 'ri-wallet-3-line', 'green'],
281
+ ['本年订单数', number(metrics.currentYearOrderCount), 'ri-calendar-check-line', 'orange'],
282
+ ['本年采购金额', currency(metrics.currentYearPurchaseAmountCny), 'ri-bar-chart-grouped-line', 'violet']
282
283
  ];
283
- return _jsxs("section", { className: "tcw-procurement-metrics", "aria-label": "\u91C7\u8D2D\u7EDF\u8BA1", children: [items.map(([label, value]) => _jsxs("div", { children: [_jsx("span", { children: label }), _jsx("strong", { children: value })] }, label)), _jsxs("div", { className: "tcw-procurement-top", children: [_jsx("span", { children: "\u91C7\u8D2D\u5546\u54C1TOP5" }), metrics.topProducts.length ? _jsx("ol", { children: metrics.topProducts.map((item) => _jsxs("li", { children: [_jsx("span", { children: item.productName }), _jsx("strong", { children: currency(item.amountCny) })] }, item.productName)) }) : _jsx("small", { children: "\u6682\u65E0\u5546\u54C1\u6570\u636E" })] })] });
284
+ return _jsxs("section", { className: "tcw-procurement-metrics", "aria-label": "\u91C7\u8D2D\u7EDF\u8BA1", children: [items.map(([label, value, icon, tone]) => _jsxs("div", { className: `tcw-procurement-metric tcw-procurement-metric--${tone}`, children: [_jsx("i", { className: `${icon} tcw-procurement-metric-icon`, "aria-hidden": "true" }), _jsx("span", { children: label }), _jsx("strong", { children: value })] }, label)), _jsxs("div", { className: "tcw-procurement-top", children: [_jsx("span", { children: "\u91C7\u8D2D\u5546\u54C1TOP5" }), metrics.topProducts.length ? _jsx("ol", { children: metrics.topProducts.map((item) => _jsxs("li", { children: [_jsx("span", { children: item.productName }), _jsx("strong", { children: currency(item.amountCny) })] }, item.productName)) }) : _jsx("small", { children: "\u6682\u65E0\u5546\u54C1\u6570\u636E" })] })] });
284
285
  }
285
286
  function SupplierDialog({ state, busy, onClose, onSave }) {
286
287
  const [value, setValue] = React.useState(state?.item ?? null);
@@ -291,7 +292,7 @@ function SupplierDialog({ state, busy, onClose, onSave }) {
291
292
  const fields = [
292
293
  ['code', '供应商代码'], ['name', '供应商名称', true], ['shortName', '简称'], ['countryOrRegion', '国别/地区'], ['contactName', '联系人'], ['phone', '联系电话'], ['wechat', '微信'], ['email', '邮箱'], ['address', '地址'], ['taxNumber', '税号'], ['paymentAccount', '收款账号'], ['bankName', '开户行'], ['taxpayerRating', '纳税等级'], ['website', '公司网站'], ['businessProducts', '经营产品']
293
294
  ];
294
- return _jsxs(Modal, { open: true, title: state.mode === 'detail' ? '供应商详情' : '供应商详情审核', size: "wide", onClose: onClose, footer: disabled ? _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u5173\u95ED"] }) : _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u53D6\u6D88"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--primary", disabled: busy || !value.name.trim(), onClick: () => void onSave(value), children: [_jsx("i", { className: "ri-save-line", "aria-hidden": "true" }), "\u4FDD\u5B58"] })] }), children: [_jsx(FieldGrid, { columns: 2, children: fields.map(([key, label, required]) => _jsx(FormField, { label: label, required: required, full: key === 'address' || key === 'businessProducts', children: _jsx("input", { disabled: disabled, value: String(value[key] ?? ''), onChange: (event) => setValue({ ...value, [key]: event.target.value }) }) }, key)) }), _jsxs("div", { className: "tcw-procurement-audit-meta", children: [_jsx(StatusTag, { tone: value.sanctionStatus === 'HIT' ? 'danger' : 'success', children: sanctionLabels[value.sanctionStatus ?? 'UNCHECKED'] }), _jsxs("span", { children: ["\u6700\u8FD1\u5236\u88C1\u68C0\u67E5\uFF1A", value.complianceCheckedAt || '尚未检查'] }), _jsxs("span", { children: ["\u6700\u540E\u7F16\u8F91\uFF1A", value.updatedByName || '—', " ", value.updatedAt || ''] })] })] });
295
+ return _jsxs(Modal, { open: true, title: state.mode === 'detail' ? '供应商详情' : '供应商详情审核', size: "wide", onClose: onClose, footer: disabled ? _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u5173\u95ED"] }) : _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u53D6\u6D88"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--primary", disabled: busy || !value.name.trim(), onClick: () => void onSave(value), children: [_jsx("i", { className: "ri-save-line", "aria-hidden": "true" }), "\u4FDD\u5B58"] })] }), children: [_jsxs("p", { className: "tcw-procurement-dialog-kicker", children: ["\u6765\u6E90\uFF1A\u91C7\u8D2D\u5408\u540C\u5F52\u5E76 ", _jsxs("span", { children: ["\u6700\u8FD1\u5236\u88C1\u68C0\u67E5\uFF1A", value.complianceCheckedAt || '尚未检查'] })] }), _jsxs("div", { className: "tcw-procurement-supplier-review", children: [_jsx(FieldGrid, { columns: 1, children: fields.map(([key, label, required]) => _jsx(FormField, { label: label, required: required, children: _jsx("input", { disabled: disabled || key === 'code', value: String(value[key] ?? ''), onChange: (event) => setValue({ ...value, [key]: event.target.value }) }) }, key)) }), _jsxs("aside", { children: [_jsx(FormField, { label: "\u5907\u6CE8", children: _jsx("textarea", { rows: 6, disabled: disabled, value: value.remarks ?? '', onChange: (event) => setValue({ ...value, remarks: event.target.value }) }) }), _jsxs("dl", { children: [_jsxs("div", { children: [_jsx("dt", { children: "\u5236\u88C1\u98CE\u9669" }), _jsx("dd", { children: _jsx(StatusTag, { tone: value.sanctionStatus === 'HIT' ? 'danger' : 'success', children: sanctionLabels[value.sanctionStatus ?? 'UNCHECKED'] }) })] }), _jsxs("div", { children: [_jsx("dt", { children: "\u521B\u5EFA\u4EBA" }), _jsx("dd", { children: value.createdByName || '—' })] }), _jsxs("div", { children: [_jsx("dt", { children: "\u521B\u5EFA\u65F6\u95F4" }), _jsx("dd", { children: value.createdAt || '' })] }), _jsxs("div", { children: [_jsx("dt", { children: "\u6700\u540E\u7F16\u8F91\u4EBA" }), _jsx("dd", { children: value.updatedByName || '—' })] }), _jsxs("div", { children: [_jsx("dt", { children: "\u6700\u540E\u7F16\u8F91\u65F6\u95F4" }), _jsx("dd", { children: value.updatedAt || '' })] })] }), _jsx(InfoNotice, { children: "\u5236\u88C1\u98CE\u9669\u4E3A\u7CFB\u7EDF\u6700\u8FD1\u4E00\u6B21\u68C0\u67E5\u7ED3\u679C\uFF0C\u4FDD\u5B58\u540E\u5C06\u89E6\u53D1\u65B0\u7684\u5236\u88C1\u68C0\u67E5\u3002" })] })] })] });
295
296
  }
296
297
  function OrderDialog({ state, lines, busy, onClose, onSave }) {
297
298
  const [value, setValue] = React.useState(state?.item ?? null);
@@ -303,7 +304,7 @@ function OrderDialog({ state, lines, busy, onClose, onSave }) {
303
304
  const error = amount(value.paidAmountCny) > amount(value.contractAmountCny) ? '已付款不能超过采购订单总额' : amount(value.refundedAmountCny) > amount(estimated) ? '已退税不能超过预计退税总额' : '';
304
305
  return _jsxs(Modal, { open: true, title: disabled ? '采购订单详情' : '采购订单审核', size: "wide", onClose: onClose, footer: disabled ? _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u5173\u95ED"] }) : _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u53D6\u6D88"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--primary", disabled: busy || Boolean(error) || !value.orderDate, onClick: () => void onSave(value), children: [_jsx("i", { className: "ri-save-line", "aria-hidden": "true" }), "\u4FDD\u5B58"] })] }), children: [error && _jsx(RiskNotice, { children: error }), _jsxs(FieldGrid, { columns: 2, children: [_jsx(FormField, { label: "\u91C7\u8D2D\u5408\u540C\u7F16\u53F7", required: true, children: _jsx("input", { disabled: true, value: value.contractNo }) }), _jsx(FormField, { label: "\u4E0B\u5355\u65E5\u671F", required: true, children: _jsx("input", { type: "date", disabled: disabled, value: value.orderDate, onChange: (event) => setValue({ ...value, orderDate: event.target.value }) }) }), _jsx(MoneyField, { label: "\u91C7\u8D2D\u8BA2\u5355\u603B\u989D", disabled: disabled, value: value.contractAmountCny, onChange: (next) => setValue({ ...value, contractAmountCny: next }) }), _jsx(MoneyField, { label: "\u5DF2\u4ED8\u6B3E", disabled: disabled, value: value.paidAmountCny, onChange: (next) => setValue({ ...value, paidAmountCny: next }) }), _jsx(MoneyField, { label: "\u672A\u4ED8\u6B3E", disabled: true, value: String(Math.max(amount(value.contractAmountCny) - amount(value.paidAmountCny), 0)) }), _jsx(MoneyField, { label: "\u5DF2\u9000\u7A0E", disabled: disabled, value: value.refundedAmountCny, onChange: (next) => setValue({ ...value, refundedAmountCny: next }) }), _jsx(MoneyField, { label: "\u9884\u8BA1\u9000\u7A0E\u603B\u989D", disabled: true, value: estimated }), _jsx(MoneyField, { label: "\u672A\u9000\u7A0E", disabled: true, value: String(Math.max(amount(estimated) - amount(value.refundedAmountCny), 0)) }), _jsx(FormField, { label: "\u5339\u914D\u5BA2\u6237\u5408\u540C", children: _jsx("input", { disabled: true, value: value.customerContractNo || '未关联' }) }), _jsx(FormField, { label: "\u6765\u6E90\u6587\u4EF6", children: _jsx("input", { disabled: true, value: value.sourceFileName || '—' }) })] })] });
305
306
  }
306
- function LineDialog({ state, order, busy, onAction, onClose, onSave }) {
307
+ export function LineDialog({ state, order, busy, onAction, onClose, onSave }) {
307
308
  const [value, setValue] = React.useState(state?.item ?? null);
308
309
  const [hsOpen, setHsOpen] = React.useState(false);
309
310
  React.useEffect(() => setValue(state?.item ?? null), [state]);
@@ -317,7 +318,7 @@ function LineDialog({ state, order, busy, onAction, onClose, onSave }) {
317
318
  return Promise.resolve({ success: false, message: '采购商品仅支持海关编码查询' });
318
319
  return onAction(actionKey, input);
319
320
  };
320
- return _jsxs(_Fragment, { children: [_jsxs(Modal, { open: true, title: state.mode === 'create' ? '新增商品' : '采购商品审核', size: "wide", onClose: onClose, footer: _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u53D6\u6D88"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--primary", disabled: busy || errors.length > 0, onClick: () => void onSave(value), children: [_jsx("i", { className: "ri-save-line", "aria-hidden": "true" }), "\u4FDD\u5B58"] })] }), children: [_jsxs("div", { className: "tcw-procurement-source-label", children: ["\u6765\u6E90\u7C7B\u578B\uFF1A", sourceTypeLabels[value.sourceType]] }), errors.length > 0 && _jsx(RiskNotice, { children: errors.join(';') }), _jsxs(FieldGrid, { columns: 2, children: [_jsx(TextField, { label: "\u5546\u54C1\u540D\u79F0", required: true, value: value.productName, onChange: (next) => setValue({ ...value, productName: next }) }), _jsx(TextField, { label: "\u5546\u54C1\u63CF\u8FF0", value: value.productDescription, onChange: (next) => setValue({ ...value, productDescription: next }) }), _jsx(TextField, { label: "\u89C4\u683C\u578B\u53F7", value: value.modelSpecification, onChange: (next) => setValue({ ...value, modelSpecification: next }) }), _jsx(TextField, { label: "\u5355\u4F4D", required: true, value: value.unit, onChange: (next) => setValue({ ...value, unit: next }) }), _jsx(TextField, { label: "\u6570\u91CF", required: true, type: "number", value: value.quantity, onChange: (next) => setValue({ ...value, quantity: next, lineAmountTaxIncluded: String(amount(next) * amount(value.unitPriceTaxIncluded)) }) }), _jsx(TextField, { label: "\u542B\u7A0E\u5355\u4EF7\uFF08\u4EBA\u6C11\u5E01\uFF09", required: true, type: "number", value: value.unitPriceTaxIncluded, onChange: (next) => setValue({ ...value, unitPriceTaxIncluded: next, lineAmountTaxIncluded: String(amount(value.quantity) * amount(next)) }) }), _jsx(TextField, { label: "\u542B\u7A0E\u91D1\u989D\uFF08\u4EBA\u6C11\u5E01\uFF09", required: true, type: "number", value: value.lineAmountTaxIncluded || String(computedAmount), onChange: (next) => setValue({ ...value, lineAmountTaxIncluded: next }) }), _jsx(TextField, { label: "\u589E\u503C\u7A0E\u7387", required: true, type: "number", value: value.vatRate, onChange: (next) => setValue({ ...value, vatRate: next }) }), _jsx(FormField, { label: "\u6D77\u5173\u7F16\u7801", children: _jsxs("div", { className: "tcw-procurement-inline-field", children: [_jsx("input", { value: value.hsCode ?? '', onChange: (event) => setValue({ ...value, hsCode: event.target.value }) }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => setHsOpen(true), children: [_jsx("i", { className: "ri-search-line", "aria-hidden": "true" }), "HS\u7F16\u7801\u67E5\u8BE2"] })] }) }), _jsx(FormField, { label: "\u7F16\u7801\u786E\u8BA4\u72B6\u6001", children: _jsx("select", { value: value.hsCodeStatus ?? 'UNCONFIRMED', onChange: (event) => setValue({ ...value, hsCodeStatus: event.target.value }), children: enumOptions(hsStatusLabels).map((item) => _jsx("option", { value: item.value, children: item.label }, item.value)) }) }), _jsx(TextField, { label: "\u9000\u7A0E\u7387", required: true, type: "number", value: value.refundRate, onChange: (next) => setValue({ ...value, refundRate: next }) }), _jsx(TextField, { label: "\u9000\u7A0E\u653F\u7B56\u4F9D\u636E", required: true, value: value.refundPolicyReference, onChange: (next) => setValue({ ...value, refundPolicyReference: next }) }), _jsx(TextField, { label: "\u653F\u7B56\u65E5\u671F", required: true, type: "date", value: value.refundPolicyDate, onChange: (next) => setValue({ ...value, refundPolicyDate: next, refundValidationMethod: 'REVIEW_CONFIRMED' }) }), _jsx(TextField, { label: "\u82F1\u6587\u540D\u79F0", value: value.englishName, onChange: (next) => setValue({ ...value, englishName: next }) })] })] }), _jsx(HsCodeLookupDialog, { open: hsOpen, initialQuery: value.hsCode || value.englishName || value.productName, onAction: hsAction, onClose: () => setHsOpen(false) })] });
321
+ return _jsxs(_Fragment, { children: [_jsx(Modal, { open: true, title: state.mode === 'create' ? '新增商品' : '采购商品审核', size: "wide", onClose: onClose, footer: _jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: onClose, children: [_jsx("i", { className: "ri-close-line", "aria-hidden": "true" }), "\u53D6\u6D88"] }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--primary", disabled: busy || errors.length > 0, onClick: () => void onSave(value), children: [_jsx("i", { className: "ri-save-line", "aria-hidden": "true" }), "\u4FDD\u5B58"] })] }), children: _jsxs("div", { className: "tcw-procurement-line-form", children: [_jsxs("div", { className: "tcw-procurement-source-label", children: ["\u6765\u6E90\u7C7B\u578B\uFF1A", sourceTypeLabels[value.sourceType]] }), state.mode === 'review' && errors.length > 0 && _jsx(RiskNotice, { children: errors.join(';') }), _jsxs(FieldGrid, { columns: 2, children: [_jsx(TextField, { label: "\u5546\u54C1\u540D\u79F0", required: true, value: value.productName, onChange: (next) => setValue({ ...value, productName: next }) }), _jsx(TextField, { label: "\u5546\u54C1\u63CF\u8FF0", value: value.productDescription, onChange: (next) => setValue({ ...value, productDescription: next }) }), _jsx(TextField, { label: "\u89C4\u683C\u578B\u53F7", value: value.modelSpecification, onChange: (next) => setValue({ ...value, modelSpecification: next }) }), _jsx(TextField, { label: "\u5355\u4F4D", required: true, value: value.unit, onChange: (next) => setValue({ ...value, unit: next }) }), _jsx(TextField, { label: "\u6570\u91CF", required: true, type: "number", value: value.quantity, onChange: (next) => setValue({ ...value, quantity: next, lineAmountTaxIncluded: String(amount(next) * amount(value.unitPriceTaxIncluded)) }) }), _jsx(TextField, { label: "\u542B\u7A0E\u5355\u4EF7\uFF08\u4EBA\u6C11\u5E01\uFF09", required: true, type: "number", value: value.unitPriceTaxIncluded, onChange: (next) => setValue({ ...value, unitPriceTaxIncluded: next, lineAmountTaxIncluded: String(amount(value.quantity) * amount(next)) }) }), _jsx(TextField, { label: "\u542B\u7A0E\u91D1\u989D\uFF08\u4EBA\u6C11\u5E01\uFF09", required: true, type: "number", value: value.lineAmountTaxIncluded || String(computedAmount), onChange: (next) => setValue({ ...value, lineAmountTaxIncluded: next }) }), _jsx(TextField, { label: "\u589E\u503C\u7A0E\u7387", required: true, type: "number", value: value.vatRate, onChange: (next) => setValue({ ...value, vatRate: next }) }), _jsx(FormField, { label: "\u6D77\u5173\u7F16\u7801", children: _jsxs("div", { className: "tcw-procurement-inline-field", children: [_jsx("input", { value: value.hsCode ?? '', onChange: (event) => setValue({ ...value, hsCode: event.target.value }) }), _jsxs("button", { type: "button", className: "tcw-button tcw-button--secondary", onClick: () => setHsOpen(true), children: [_jsx("i", { className: "ri-search-line", "aria-hidden": "true" }), "HS\u7F16\u7801\u67E5\u8BE2"] })] }) }), _jsx(FormField, { label: "\u7F16\u7801\u786E\u8BA4\u72B6\u6001", children: _jsx("div", { className: "tcw-procurement-line-status", children: enumOptions(hsStatusLabels).map((item) => _jsxs("label", { children: [_jsx("input", { type: "radio", name: "line-hs-code-status", value: item.value, checked: (value.hsCodeStatus ?? 'UNCONFIRMED') === item.value, onChange: () => setValue({ ...value, hsCodeStatus: item.value }) }), item.label] }, item.value)) }) }), _jsx(TextField, { label: "\u9000\u7A0E\u7387", required: true, type: "number", value: value.refundRate, onChange: (next) => setValue({ ...value, refundRate: next }) }), _jsx(TextField, { label: "\u9000\u7A0E\u653F\u7B56\u4F9D\u636E", required: true, value: value.refundPolicyReference, onChange: (next) => setValue({ ...value, refundPolicyReference: next }) }), _jsx(TextField, { label: "\u653F\u7B56\u65E5\u671F", required: true, type: "date", value: value.refundPolicyDate, onChange: (next) => setValue({ ...value, refundPolicyDate: next, refundValidationMethod: 'REVIEW_CONFIRMED' }) }), _jsx(TextField, { label: "\u82F1\u6587\u540D\u79F0", value: value.englishName, onChange: (next) => setValue({ ...value, englishName: next }) })] })] }) }), _jsx(HsCodeLookupDialog, { open: hsOpen, initialQuery: value.hsCode || value.englishName || value.productName, onAction: hsAction, onClose: () => setHsOpen(false) })] });
321
322
  }
322
323
  function PurchaseContractReviewDialog({ open, task, draft, busy, onChange, onClose, onSave }) {
323
324
  const errors = draft ? validatePurchaseContractReview(draft) : [];
@@ -338,11 +339,11 @@ function SourcePreview({ draft, task }) {
338
339
  const location = draft.lines.find(line => line.sourceContent)?.sourceLocation;
339
340
  return _jsxs("div", { className: "tcw-procurement-source", children: [_jsx("strong", { children: draft.sourceFileName || task?.sourceFileName || '采购合同源文件' }), draft.sourceFileUrl ? _jsx("iframe", { src: draft.sourceFileUrl, title: "\u91C7\u8D2D\u5408\u540C\u6E90\u6587\u4EF6" }) : explicit ? _jsxs(_Fragment, { children: [_jsx("small", { children: location || '来源位置未标注' }), _jsx("pre", { children: explicit })] }) : _jsx("pre", { children: "\u6E90\u6587\u4EF6\u6682\u65E0\u6CD5\u5728\u7EBF\u9884\u89C8" })] });
340
341
  }
341
- function DeleteDialog({ target, supplier, busy, onCancel, onConfirm }) {
342
+ export function DeleteDialog({ target, supplier, busy, onCancel, onConfirm }) {
342
343
  const isOrder = target?.entityType === 'purchaseOrder';
343
344
  const order = isOrder ? target.item : null;
344
345
  const name = target?.entityType === 'supplier' ? target.item.name : target?.entityType === 'purchaseOrder' ? target.item.contractNo : target?.item?.productName;
345
- return _jsx(ConfirmDialog, { open: Boolean(target), title: isOrder ? '确认删除采购订单?' : `确认删除${target?.entityType === 'supplier' ? '供应商' : '采购商品'}?`, danger: true, confirmText: "\u786E\u8BA4\u5220\u9664", confirmDisabled: busy, onCancel: onCancel, onConfirm: onConfirm, message: _jsxs("div", { className: "tcw-procurement-delete-summary", children: [_jsx("strong", { children: name || '当前记录' }), isOrder && _jsxs(_Fragment, { children: [_jsxs("span", { children: ["\u4F9B\u5E94\u5546\uFF1A", supplier?.name || '—'] }), _jsxs("span", { children: ["\u5546\u54C1\u6761\u6570\uFF1A", order?.lineCount ?? 0] }), _jsxs("span", { children: ["\u91C7\u8D2D\u91D1\u989D\uFF1A", currency(order?.contractAmountCny)] }), _jsxs("span", { children: ["\u5DF2\u4ED8\u6B3E\uFF1A", currency(order?.paidAmountCny)] }), _jsxs("span", { children: ["\u5DF2\u9000\u7A0E\uFF1A", currency(order?.refundedAmountCny)] }), _jsx("b", { children: "\u5220\u9664\u540E\u5C06\u540C\u65F6\u903B\u8F91\u5220\u9664\u8BE5\u8BA2\u5355\u53CA\u5168\u90E8\u5546\u54C1\u660E\u7EC6\uFF1B\u91CD\u65B0\u4E0A\u4F20\u540C\u7F16\u53F7\u5408\u540C\u4F1A\u4F5C\u4E3A\u5168\u65B0\u8BB0\u5F55\uFF0C\u4E0D\u8FC1\u79FB\u65E7\u8BA2\u5355\u4EBA\u5DE5\u6570\u636E\u3002" })] })] }) });
346
+ return _jsx(ConfirmDialog, { open: Boolean(target), title: isOrder ? '确认删除采购订单?' : `确认删除${target?.entityType === 'supplier' ? '供应商' : '采购商品'}?`, danger: true, confirmText: "\u786E\u8BA4\u5220\u9664", confirmDisabled: busy, onCancel: onCancel, onConfirm: onConfirm, message: isOrder ? _jsxs("div", { className: "tcw-procurement-delete-summary is-order", children: [_jsxs("strong", { className: "tcw-procurement-delete-warning", children: [_jsx("i", { className: "ri-error-warning-fill", "aria-hidden": "true" }), "\u5220\u9664\u540E\u5C06\u903B\u8F91\u5220\u9664\u8BE5\u91C7\u8D2D\u8BA2\u5355\u53CA\u5176\u5168\u90E8\u5546\u54C1\u660E\u7EC6\uFF0C\u8BF7\u8C28\u614E\u64CD\u4F5C\u3002"] }), _jsxs("dl", { className: "tcw-procurement-delete-details", children: [_jsxs("div", { children: [_jsx("dt", { children: "\u91C7\u8D2D\u5408\u540C\u7F16\u53F7" }), _jsx("dd", { children: name || '—' })] }), _jsxs("div", { children: [_jsx("dt", { children: "\u4F9B\u5E94\u5546" }), _jsx("dd", { children: supplier?.name || '—' })] }), _jsxs("div", { children: [_jsx("dt", { children: "\u5546\u54C1\u6761\u6570" }), _jsx("dd", { children: order?.lineCount ?? 0 })] }), _jsxs("div", { children: [_jsx("dt", { children: "\u91C7\u8D2D\u91D1\u989D" }), _jsx("dd", { children: currency(order?.contractAmountCny) })] }), _jsxs("div", { children: [_jsx("dt", { children: "\u5DF2\u4ED8\u6B3E / \u5DF2\u9000\u7A0E" }), _jsxs("dd", { children: [currency(order?.paidAmountCny), " / ", currency(order?.refundedAmountCny)] })] })] }), _jsxs("p", { className: "tcw-procurement-delete-info", children: [_jsx("i", { className: "ri-information-line", "aria-hidden": "true" }), "\u91CD\u65B0\u4E0A\u4F20\u540C\u7F16\u53F7\u5408\u540C\u4F1A\u4F5C\u4E3A\u5168\u65B0\u8BB0\u5F55\uFF0C\u4E0D\u8FC1\u79FB\u65E7\u8BA2\u5355\u4EBA\u5DE5\u6570\u636E\u3002"] })] }) : _jsx("div", { className: "tcw-procurement-delete-summary", children: _jsx("strong", { children: name || '当前记录' }) }) });
346
347
  }
347
348
  function ReviewSection({ title, children }) { return _jsxs("section", { className: "tcw-procurement-review-section", children: [_jsx("h3", { children: title }), children] }); }
348
349
  function ContextValue({ label, value }) { return _jsxs("div", { children: [_jsx("span", { children: label }), _jsx("strong", { children: String(value || '—') })] }); }
@@ -362,7 +363,7 @@ function currency(value) { return `¥${amount(value).toLocaleString('zh-CN', { m
362
363
  function number(value) { return amount(value).toLocaleString('zh-CN'); }
363
364
  function percent(value) { return `${(rate(value) * 100).toLocaleString('zh-CN', { maximumFractionDigits: 4 })}%`; }
364
365
  function booleanOptions() { return [{ value: 'true', label: '是' }, { value: 'false', label: '否' }]; }
365
- function enumOptions(labels) { return Object.entries(labels).map(([value, label]) => ({ value, label: String(label) })); }
366
+ function enumOptions(labels) { return Object.entries(labels).map(([value, label]) => ({ value, label })); }
366
367
  function pagination(collection) { const total = collection.total ?? collection.items.length; const pageSize = collection.pageSize ?? PAGE_SIZE; return { page: collection.page ?? 1, pageSize, total, pageCount: Math.max(1, Math.ceil(total / pageSize)) }; }
367
368
  function assertSucceeded(result) { if (result.success === false)
368
369
  throw new Error(result.message || '采购操作失败'); }