refactor(webapp): 重构发票验证功能

- 修改基础 URL为本地地址
- 优化发票验证和列表查询逻辑
- 更新数据库结构和查询语句
- 改进前端发票管理页面,增加验证结果展示
- 修复后端发票列表接口,支持 JSON 请求
This commit is contained in:
liuxiaoqing
2025-08-19 13:52:25 +08:00
parent c22a509633
commit 1e24287327
10 changed files with 59 additions and 71 deletions
@@ -107,7 +107,7 @@ const emit= defineEmits(['update:formState'])
const fileType = ref<string>('img')
onMounted(() => {
alert(props.filePath)
// alert(props.filePath)
if(props.filePath){
fileType.value = props.filePath.split('.').pop() ==='pdf'?'pdf':'img'
request.get('/recognize?filePath='+encodeURIComponent(props.filePath)).then((res) => {
@@ -7,7 +7,7 @@ import {
// SmileOutlined,
} from '@ant-design/icons-vue'
import type {StepProps} from "ant-design-vue"
import Check from './Check.vue'
import Check from './Check.vue'
import upload from './upload.vue'
import Report from "./report.vue"
// 步骤
@@ -35,7 +35,8 @@ const handleUpload = (options: any) => {
if (xhr.status === 200 || xhr.status === 201) {
console.log(xhr.responseText);
onSuccess(xhr.responseText, file);
emit('update:filePath', xhr.responseText)
let res = JSON.parse(xhr.responseText)
emit('update:filePath', res.file_path)
} else {
onError(new Error(`Upload failed with status ${xhr.status}`));
}
+24 -13
View File
@@ -1,10 +1,10 @@
<script setup lang="ts">
import {h,ref} from "vue";
import {h, onMounted, ref} from "vue";
import {
SearchOutlined
} from '@ant-design/icons-vue'
import request from "#/utils/request.ts";
import request from '#/utils/request.ts';
const columns = [
// {
// title: '发票代码',
@@ -49,8 +49,8 @@ const columns = [
{
title: '查验结果',
dataIndex: 'cyjgxx',
key: 'cyjgxx',
dataIndex: 'verify_status',
key: 'verify_status',
},
{
title: '查验次数',
@@ -69,20 +69,25 @@ let data = ref( [])
let searchParams = ref({
page: 1,
pageSize: 10,
data: {
status: '1'
pageSize: 100,
current: 1,
params: {
verify_status: 'success',
value: null,
}
});
const getList = () => {
request.post("/listInvoice", {
verify_status : 'yes'
verify_status : 'success'
}).then(( res ) => {
console.log(res)
data.value = res.data
})
}
getList()
onMounted(() => {
getList()
})
</script>
<template>
@@ -94,12 +99,12 @@ getList()
<a-range-picker></a-range-picker>
</a-form-item>
<a-form-item label="销售方">
<a-input></a-input>
<a-input v-model="searchParams.params.value"></a-input>
</a-form-item>
<a-form-item label="验证结果">
<a-radio-group v-model:value="searchParams.data.status">
<a-radio-button value="1">正常</a-radio-button>
<a-radio-button value="2">异常</a-radio-button>
<a-radio-group v-model:value="searchParams.params.verify_status">
<a-radio-button value="success">正常</a-radio-button>
<a-radio-button value="faild">异常</a-radio-button>
</a-radio-group>
</a-form-item>
<a-form-item>
@@ -110,6 +115,12 @@ getList()
</a-row>
</div>
<a-table :columns="columns" :data-source="data">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'verify_status'">
<a-tag v-if="record.verify_status === 'success'" color="green">正常</a-tag>
<a-tag v-if="record.verify_status === 'fail'" color="red">异常</a-tag>
</template>
</template>
</a-table>
</template>
+1 -1
View File
@@ -1,2 +1,2 @@
export const baseURL = "http://192.168.1.100:5555"
export const baseURL = "http://127.0.0.1:5555"
// export const baseURL = "http://101.200.148.149:8555"