feat(shipping-notice): 添加货代履约策略管理功能,支持策略创建、发布及版本控制,增强订单冻结和预约管理逻辑
This commit is contained in:
1 parent
abd8fc1e16
commit
d62f5107b2
82 files changed
+4914
-514
No files matched your search
@@ -10,6 +10,9 @@ import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import type {
|
||||
CreateOrderProfileFromSampleInput,
|
||||
OrderProfileSampleDocument,
|
||||
CoordinateReconstructionPreview,
|
||||
CoordinateReconstructionSuggestion,
|
||||
CoordinateReconstructionSettings,
|
||||
OrderProfileSampleIntake,
|
||||
OrderProfileSamplePreview,
|
||||
ShippingOrderDocumentProfile,
|
||||
@@ -39,12 +42,50 @@ export const getOrderProfileSampleStatus = (intakeNo: string) =>
|
||||
auth(),
|
||||
);
|
||||
|
||||
/** 删除可安全回收的专用模板样本;历史业务附件与盲测样本由服务端保护。 */
|
||||
export const deleteOrderProfileSample = (intakeNo: string) =>
|
||||
requestJson<void>(
|
||||
`/api/admin/shipping-notice/order-document-profile-samples/intakes/${encodeURIComponent(intakeNo)}`,
|
||||
{ method: 'DELETE', ...auth() },
|
||||
);
|
||||
|
||||
/** 读取一个样本文档的网格预览,不返回 HTML 或 bbox。 */
|
||||
export const getOrderProfileSampleTables = (documentId: number) =>
|
||||
requestJson<OrderProfileSamplePreview>(
|
||||
`/api/admin/shipping-notice/order-document-profile-samples/${documentId}/tables`, auth(),
|
||||
);
|
||||
|
||||
/** 以管理员确认的相对列边界生成坐标重建候选;结果始终待人工审核。 */
|
||||
export const previewOrderProfileCoordinateReconstruction = (
|
||||
documentId: number, tableId: string, coordinateReconstruction: CoordinateReconstructionSettings,
|
||||
) => requestJson<CoordinateReconstructionPreview>(
|
||||
'/api/admin/shipping-notice/order-document-profile-samples/coordinate-reconstruction-preview', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ document_id: documentId, table_id: tableId, coordinate_reconstruction: coordinateReconstruction }),
|
||||
...jsonAuth(),
|
||||
},
|
||||
);
|
||||
|
||||
/** 从冻结字符坐标建议全部或指定物理行;rowOffset 省略时保持原有全量识别。 */
|
||||
export const suggestOrderProfileCoordinateReconstruction = (
|
||||
documentId: number, tableId: string, rowOffset?: number,
|
||||
) =>
|
||||
requestJson<CoordinateReconstructionSuggestion>(
|
||||
'/api/admin/shipping-notice/order-document-profile-samples/coordinate-reconstruction-suggestion', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ document_id: documentId, table_id: tableId, row_offset: rowOffset }),
|
||||
...jsonAuth(),
|
||||
},
|
||||
);
|
||||
|
||||
/** 为扫描 PDF 生成 OCR 坐标证据;随后仍必须由管理员审核重建网格。 */
|
||||
export const generateOrderProfileOcrCoordinateEvidence = (documentId: number, tableId: string) =>
|
||||
requestJson<{ document_id: number; table_id: string; source: 'ocr' }>(
|
||||
'/api/admin/shipping-notice/order-document-profile-samples/ocr-coordinate-evidence', {
|
||||
method: 'POST', body: JSON.stringify({ document_id: documentId, table_id: tableId }), ...jsonAuth(),
|
||||
},
|
||||
);
|
||||
|
||||
/** 由真实样本和结构化列选择创建 Profile 草稿。 */
|
||||
export const createOrderProfileFromSample = (payload: CreateOrderProfileFromSampleInput) =>
|
||||
requestJson<ShippingOrderDocumentProfile>('/api/admin/shipping-notice/order-document-profiles/from-sample', {
|
||||
|
||||
@@ -16,6 +16,8 @@ import type {
|
||||
ShippingOrderSchemaVersionDiff,
|
||||
ShippingOrderSchemaVersionPage,
|
||||
ShippingOrderSchemaVersionUsage,
|
||||
ShippingFulfillmentPolicy,
|
||||
ShippingFulfillmentPolicyState,
|
||||
} from '../types/shipping-order-schema.types';
|
||||
|
||||
const auth = () => ({ headers: getAuthHeaders() });
|
||||
@@ -143,3 +145,21 @@ export const publishShippingOrderSchemaDraft = (versionId: number, expectedLockV
|
||||
`/api/admin/shipping-order-schema/versions/${versionId}/publish`,
|
||||
{ method: 'POST', body: JSON.stringify({ expected_lock_version: expectedLockVersion }), ...jsonAuth() },
|
||||
);
|
||||
|
||||
/** 读取受控履约能力目录及策略版本,页面不提供任意表达式配置。 */
|
||||
export const getShippingFulfillmentPolicyState = () =>
|
||||
requestJson<ShippingFulfillmentPolicyState>('/api/admin/shipping-fulfillment-policies', auth());
|
||||
|
||||
/** 创建按稳定字段 ID 绑定的下一履约策略草稿。 */
|
||||
export const createShippingFulfillmentPolicyDraft = (payload: {
|
||||
field_bindings: Array<{ capability_code: string; field_id: string }>;
|
||||
change_note?: string;
|
||||
}) => requestJson<ShippingFulfillmentPolicy>('/api/admin/shipping-fulfillment-policies', {
|
||||
method: 'POST', body: JSON.stringify(payload), ...jsonAuth(),
|
||||
});
|
||||
|
||||
/** 显式发布策略草稿;服务端原子退役上一发布版本。 */
|
||||
export const publishShippingFulfillmentPolicy = (policyId: number, expectedLockVersion: number) =>
|
||||
requestJson<ShippingFulfillmentPolicy>(`/api/admin/shipping-fulfillment-policies/${policyId}/publish`, {
|
||||
method: 'POST', body: JSON.stringify({ expected_lock_version: expectedLockVersion }), ...jsonAuth(),
|
||||
});
|
||||
Reference in new issue
Block a user