refactor(webapp): 优化发票验证流程和界面

- 修改验证流程初始步骤为第3步- 更新验证结果展示方式,使用 Ant Design Result 组件
-优化上传页面样式,增加顶部间距
- 调整验证接口返回格式,统一错误处理
This commit is contained in:
2025-08-19 22:42:38 +08:00
parent 8c7422dc68
commit 31404cf225
6 changed files with 18 additions and 22 deletions
@@ -27,7 +27,7 @@ const items = [
] as StepProps[];
// 文件路径
const filePath = ref('');
const current = ref<number>(0);
const current = ref<number>(3);
// 下一步
const nextPage = () => {
current.value ++;
@@ -59,7 +59,6 @@ const formState = ref<string>('');
<a-space>
<a-button type="default" v-if="current > 0" @click="previousPage">上一步</a-button>
<a-button type="primary" v-if="current < items.length-1 " @click="nextPage">下一步</a-button>
<a-button type="primary" v-if="current == items.length-1" @click="saveReport">报销</a-button>
<a-button type="dashed" v-if="current == items.length-1" @click="saveReport">完成</a-button>
</a-space>
</a-col>
@@ -1,16 +1,14 @@
<template>
<a-layout-content>
<a-row >
<a-col :span="8">
查验结果{{formState.cyjgxx}}
</a-col>
<a-col :span="8">
查验次数{{formState.inspectionAmount}}
</a-col>
<a-col :span="8">
查验时间{{formState.verify_time}}
</a-col>
</a-row>
<a-result
:status="formState.status"
:title="formState.cyjgxx"
>
<template #subTitle >
<p v-if="formState.status === 'success'">查验次数: {{formState.inspectionAmount}}</p>
<p v-if="formState.status === 'success'">已存入发票库</p>
</template>
</a-result>
</a-layout-content>
</template>
<script lang="ts" setup>
@@ -26,11 +24,7 @@ onMounted(() => {
fileType.value = props.filePath.split('.').pop() ==='pdf'?'pdf':'img'
request.get('/verify?filePath='+encodeURIComponent(props.filePath)).then((res) => {
console.log(res)
if(res.data){
formState.value = res.data
}else{
formState.value.cyjgxx ="失败"
}
formState.value = res.data
})
fileUrl.value = baseURL+"/"+props.filePath
}
@@ -40,6 +34,7 @@ onMounted(() => {
const fileUrl = ref('')
let formState = ref({
status:"",
inspectionAmount: "",
cyjgxx: "",
verify_time: "",
@@ -74,6 +74,7 @@ const handleUpload = (options: any) => {
<style scoped>
.container {
margin-top: 50px;
height: 100%;
}
</style>