refactor(webapp): 更新项目配置和功能
- 修改基础 URL为本地开发环境 - 更新数据库文件路径 - 调整发票报销流程,增加"完成"按钮 - 优化发票列表页面,添加搜索功能 - 新增发票复核页面 - 更新文件上传逻辑,使用动态 URL
This commit is contained in:
parent
0c4e94b5af
commit
cc867c471e
@ -25,6 +25,7 @@ Requires-Dist: alibabacloud_tea_openapi<1.0.0,>=0.3.15
|
||||
Requires-Dist: alibabacloud_tea_console<1.0.0,>=0.0.1
|
||||
Requires-Dist: alibabacloud_tea_util<1.0.0,>=0.3.13
|
||||
Requires-Dist: alibabacloud_credentials<2.0.0,>=1.0.2
|
||||
Requires-Dist: flask
|
||||
Dynamic: classifier
|
||||
Dynamic: description
|
||||
Dynamic: description-content-type
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
README.md
|
||||
setup.py
|
||||
alibabacloud_sample/__init__.py
|
||||
alibabacloud_sample/sample.py
|
||||
alibabacloud_sample/dataservice.py
|
||||
alibabacloud_sample/dbservice.py
|
||||
alibabacloud_sample/fileservice.py
|
||||
alibabacloud_sample/main.py
|
||||
alibabacloud_sample/service.py
|
||||
alibabacloud_sample.egg-info/PKG-INFO
|
||||
alibabacloud_sample.egg-info/SOURCES.txt
|
||||
alibabacloud_sample.egg-info/dependency_links.txt
|
||||
|
||||
@ -3,3 +3,4 @@ alibabacloud_tea_openapi<1.0.0,>=0.3.15
|
||||
alibabacloud_tea_console<1.0.0,>=0.0.1
|
||||
alibabacloud_tea_util<1.0.0,>=0.3.13
|
||||
alibabacloud_credentials<2.0.0,>=1.0.2
|
||||
flask
|
||||
|
||||
Binary file not shown.
@ -3,7 +3,7 @@ from sqlite3 import Error
|
||||
|
||||
|
||||
class DBService:
|
||||
db_file = "data/verify.db"
|
||||
db_file = "verify.db"
|
||||
conn = None
|
||||
def __init__(self):
|
||||
"""
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
from flask import Flask, request, render_template, send_from_directory
|
||||
from flask_cors import CORS
|
||||
from alibabacloud_sample.dataservice import DataService
|
||||
@ -35,7 +37,8 @@ def recognize():
|
||||
service = Service()
|
||||
dataservice = DataService()
|
||||
data = dataservice.get_invoice(file_path=file_path)
|
||||
if data is not None:
|
||||
print(data)
|
||||
if data is not None and data.get('file_path') is not None:
|
||||
return data
|
||||
return service.recognize(file_path=file_path)
|
||||
# 发票验证
|
||||
@ -48,7 +51,12 @@ def verify():
|
||||
dataservice = DataService()
|
||||
data = dataservice.get_invoice(file_path=file_path)
|
||||
return service.verify(data=data,file_path=file_path)
|
||||
@app.route('/list',methods=['POST'])
|
||||
def list():
|
||||
data = []
|
||||
|
||||
return data
|
||||
if __name__ == '__main__':
|
||||
# Service.verify(sys.argv[1:])
|
||||
# Service.recognize(file_path="/home/jayus/图片/wechat_2025-07-31_131911_822.png")
|
||||
app.run(host='0.0.0.0', port=5000, debug=True)
|
||||
app.run(host='0.0.0.0', port=5555, debug=True)
|
||||
@ -1,14 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Vue + TS</title>
|
||||
<script type="module" crossorigin src="/assets/index-B04iHocP.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Qtc4pW4p.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Vue + TS</title>
|
||||
<script type="module" crossorigin src="/assets/index-BqD2iBBB.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BtAwStV2.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -59,7 +59,8 @@ 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="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>
|
||||
</a-row>
|
||||
|
||||
@ -4,6 +4,7 @@ import {ref} from "vue";
|
||||
import {
|
||||
UploadOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import {baseURL} from "../../utils/baseurl.ts";
|
||||
const fileList1 = ref<UploadProps['fileList']>([]);
|
||||
const props = defineProps({ filePath: String });
|
||||
const emit= defineEmits(['update:filePath'])
|
||||
@ -45,7 +46,7 @@ const handleUpload = (options: any) => {
|
||||
};
|
||||
|
||||
// 发送请求到服务器
|
||||
xhr.open('POST', 'http://192.168.8.146:5000/upload');
|
||||
xhr.open('POST', baseURL+'/upload');
|
||||
xhr.send(formData);
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {ref} from "vue";
|
||||
|
||||
import {h,ref} from "vue";
|
||||
import {
|
||||
SearchOutlined
|
||||
} from '@ant-design/icons-vue'
|
||||
const columns = [
|
||||
// {
|
||||
// title: '发票代码',
|
||||
@ -60,14 +62,53 @@ const columns = [
|
||||
}
|
||||
|
||||
]
|
||||
// 数据
|
||||
let data = ref( [])
|
||||
|
||||
let searchParams = ref({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
data: {
|
||||
status: '1'
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="table-operations">
|
||||
<a-row :gutter="20" >
|
||||
<a-col :span="22" :align="'end'" offset="2">
|
||||
<a-form v-model:value="searchParams" layout="inline">
|
||||
<a-form-item label="开票时间">
|
||||
<a-range-picker></a-range-picker>
|
||||
</a-form-item>
|
||||
<a-form-item label="销售方">
|
||||
<a-input></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>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary" :icon="h(SearchOutlined)">搜索</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<a-table :columns="columns" :data-source="data">
|
||||
</a-table>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.table-operations {
|
||||
margin-bottom: 16px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.table-operations > button {
|
||||
margin-right: 8px;
|
||||
}
|
||||
</style>
|
||||
11
webapp/vite-project/src/pages/recheck.vue
Normal file
11
webapp/vite-project/src/pages/recheck.vue
Normal file
@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -1 +1 @@
|
||||
export const baseURL = "http://192.168.8.146:5000"
|
||||
export const baseURL = "http://127.0.0.1:5555"
|
||||
Loading…
Reference in New Issue
Block a user