H1-H10 优化OCR实时体验闭环
这个提交包含在:
@@ -29,19 +29,19 @@ export function formatInvoiceOcrFieldLabels(fields: string[]) {
|
||||
export function formatInvoiceOcrErrorMessage(rawError: string | null | undefined) {
|
||||
const missingFields = parseMissingInvoiceOcrFields(rawError);
|
||||
if (missingFields.length) {
|
||||
return `OCR 缺少关键字段:${formatInvoiceOcrFieldLabels(missingFields).join("、")}。`;
|
||||
return `票据识别缺少关键字段:${formatInvoiceOcrFieldLabels(missingFields).join("、")}。`;
|
||||
}
|
||||
|
||||
if (rawError === "duplicate_invoice_code_number") {
|
||||
return "OCR 识别到的发票代码/号码与已使用票据重复,请核对后再处理。";
|
||||
return "已识别出相同发票,不能重复添加。";
|
||||
}
|
||||
|
||||
if (rawError === "mock_ocr_failed") {
|
||||
return "OCR 识别失败,请重试或人工补齐关键信息。";
|
||||
return "票据识别失败,请重试或人工补齐关键信息。";
|
||||
}
|
||||
|
||||
if (!rawError) {
|
||||
return "OCR 识别失败,请稍后重试。";
|
||||
return "票据识别失败,请稍后重试。";
|
||||
}
|
||||
|
||||
return rawError;
|
||||
|
||||
在新工单中引用
屏蔽一个用户