From e7ecb0a9a6c3f5d301ec4423d9f6eb2e6ad9b035 Mon Sep 17 00:00:00 2001 From: "zhonghua.li" Date: Thu, 21 May 2026 16:07:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E7=84=B6=E8=AF=AD=E8=A8=80=E6=8A=B5?= =?UTF-8?q?=E6=89=A3=E9=87=91=E4=BF=A1=E6=81=AF=E8=A7=A3=E6=9E=90=E4=B8=BA?= =?UTF-8?q?=E6=8A=B5=E6=89=A3=E9=87=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/lb-deduction-amount.js | 10 +++++ .../lb-business/deduction-manage/index.vue | 44 ++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/api/lb-deduction-amount.js b/src/api/lb-deduction-amount.js index c22629f..3c05cde 100644 --- a/src/api/lb-deduction-amount.js +++ b/src/api/lb-deduction-amount.js @@ -30,3 +30,13 @@ export function deleteLbDeductionAmount(id) { method: 'delete' }) } + +/** 大模型解析抵扣金文本并保存,请求可能较慢 */ +export function parseLbDeductionAmountFromText(data) { + return request({ + url: '/lbDeductionAmount/parseFromText', + method: 'post', + data, + timeout: 120000 + }) +} diff --git a/src/views/lb-business/deduction-manage/index.vue b/src/views/lb-business/deduction-manage/index.vue index 4690f87..cd651ff 100644 --- a/src/views/lb-business/deduction-manage/index.vue +++ b/src/views/lb-business/deduction-manage/index.vue @@ -70,8 +70,23 @@ /> - + + @@ -111,6 +126,7 @@ import { addLbDeductionAmount, deleteLbDeductionAmount, getLbDeductionAmountList, + parseLbDeductionAmountFromText, updateLbDeductionAmount } from '@/api/lb-deduction-amount' import { getBusinessHeaders } from '@/utils/business-headers' @@ -121,6 +137,8 @@ export default { return { loading: false, submitLoading: false, + parseAiLoading: false, + deductionParseText: '', list: [], total: 0, createTimeRange: [], @@ -156,6 +174,29 @@ export default { const value = headers && headers['X-Tenant-Id'] return value ? String(value).trim() : '' }, + handleParseFromDeductionText() { + const text = (this.deductionParseText || '').trim() + if (!text) { + this.$message.warning('请先填写抵扣金文本') + return + } + const tenantId = this.getTenantIdFromBusinessHeaders() + if (!tenantId) { + this.$message.error('未获取到租户ID,请先登录或配置业务请求头中的租户') + return + } + this.parseAiLoading = true + parseLbDeductionAmountFromText({ text, tenantId }) + .then((res) => { + const payload = res && typeof res === 'object' ? res : {} + this.$message.success((payload.message) || '解析成功') + this.dialogVisible = false + this.fetchList() + }) + .finally(() => { + this.parseAiLoading = false + }) + }, fetchList() { this.loading = true getLbDeductionAmountList(this.buildListParams()) @@ -291,6 +332,7 @@ export default { this.resetFormData() }, resetFormData() { + this.deductionParseText = '' this.form = { id: '', userName: '',