| | |
| | | import { ref } from 'vue'; |
| | | |
| | | import { IconifyIcon } from '@vben/icons'; |
| | | import { formatDate } from '@vben/utils'; |
| | | |
| | | import { Modal, Button, Upload, Descriptions, Table, Tag, message, Alert } from 'ant-design-vue'; |
| | | |
| | |
| | | onSuccess({ blobId }, file); |
| | | // 开始 OCR 识别 |
| | | step.value = 1; |
| | | processingTip.value = '正在进行 AI OCR 识别,请稍候...'; |
| | | processingTip.value = '正在进行报价单识别,请稍候...'; |
| | | const ocrData = await ocrSaleQuotation(blobId); |
| | | // 检查错误 |
| | | if (ocrData.rawText && !ocrData.name && !ocrData.customerName && ocrData.items?.length === 0) { |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <Modal v-model:open="open" title="AI 识别录入报价单" width="680px" :footer="null" @cancel="handleClose"> |
| | | <Modal v-model:open="open" title="识别录入报价单" width="680px" :footer="null" @cancel="handleClose"> |
| | | <!-- Step 0: 上传 --> |
| | | <template v-if="step === 0"> |
| | | <Upload.Dragger |
| | |
| | | <Tag color="orange">{{ ocrResult.customerName }}</Tag> |
| | | </Descriptions.Item> |
| | | <Descriptions.Item v-if="ocrResult.quotationTime" label="报价日期"> |
| | | {{ ocrResult.quotationTime }} |
| | | {{ formatDate(ocrResult.quotationTime) }} |
| | | </Descriptions.Item> |
| | | <Descriptions.Item v-if="ocrResult.validUntil" label="有效期至"> |
| | | {{ ocrResult.validUntil }} |