From 31404cf2259bf651e0fe7e38bddfbd1e613040a0 Mon Sep 17 00:00:00 2001 From: liuxiaoqing Date: Tue, 19 Aug 2025 22:42:38 +0800 Subject: [PATCH] =?UTF-8?q?refactor(webapp):=20=E4=BC=98=E5=8C=96=E5=8F=91?= =?UTF-8?q?=E7=A5=A8=E9=AA=8C=E8=AF=81=E6=B5=81=E7=A8=8B=E5=92=8C=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改验证流程初始步骤为第3步- 更新验证结果展示方式,使用 Ant Design Result 组件 -优化上传页面样式,增加顶部间距 - 调整验证接口返回格式,统一错误处理 --- alibabacloud_sample/main.py | 6 ++-- alibabacloud_sample/service.py | 3 +- alibabacloud_sample/verify.db | Bin 36864 -> 36864 bytes .../src/components/check/index.vue | 3 +- .../src/components/check/report.vue | 27 +++++++----------- .../src/components/check/upload.vue | 1 + 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/alibabacloud_sample/main.py b/alibabacloud_sample/main.py index 0235c6f..104cbd9 100644 --- a/alibabacloud_sample/main.py +++ b/alibabacloud_sample/main.py @@ -44,15 +44,15 @@ def verify(): file_path = request.args.get('filePath') invoice_id = request.args.get('invoiceId') if file_path is None: - return "请选择文件" + return {"msg":"请选择文件","status":'fail'} service = Service() data = dataservice.get_invoice(file_path=file_path,invice_id=invoice_id) if data is not None: if data.get('status') == 'yes': - return "已报销发票!!" + return {"msg":"请勿重复验证","status":'fail'} return service.verify(data=data,file_path=file_path) else: - return "请选择文件" + return {"msg":"请先识别发票","status":'fail'} # 发票复验 @app.route('/reverify', methods=['GET']) def reverify(): diff --git a/alibabacloud_sample/service.py b/alibabacloud_sample/service.py index 108f9dd..bac14b6 100644 --- a/alibabacloud_sample/service.py +++ b/alibabacloud_sample/service.py @@ -105,13 +105,14 @@ class Service: resdata = {'cyjgxx': "未查询到发票信息", 'inspectionAmount': -1,'status': 'fail'} else: resdata.update({'status': 'success'}) + resdata['status'] = 'success' dataservice.insert_verify_log(resdata.get('inspectionAmount'), resdata.get('cyjgxx'), file_path) dataservice.update_invoice_status(data.get('id'), resdata.get('status'), resdata.get('inspectionAmount')) return resdata except Exception as error: # 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。 # 错误 message - print(error.message) + print(error) # 诊断地址 print(error.data.get("Recommend")) UtilClient.assert_as_string(error.message) diff --git a/alibabacloud_sample/verify.db b/alibabacloud_sample/verify.db index 73a6f901405f065111b8a83bd471a96bb7bf3610..57dfaae7b21aa753b5c5a9c01d7042152fea8cf5 100644 GIT binary patch delta 873 zcmZ`%OH30{6rC23w9RB7aRo7GG!YV!_vX{DM3!h`)Ck5UJGZiN+bOYSpp|Kz^3xVt zq0kr$g%;b=782L)S)0s#Gn2S=$HG@C3HZ5rFS$AI-E;0w&e-LQJ>K6dG7RIO_uQ@} z?g;%NbN6+$s|EF(;STnyOLjeQ^||`?rZdh`UzBw2_vj-wmj?H5bWSkr#NPBnHW(hV z-DcPUwwoQ1x-olZp)SmZZPa~<*=HS(C)+}xtdLa=4kKgVe|#JK`Bmi+FF~!0ydXYth9H^=hyHn>(<%ZDyCT2x=ujlQehJek6L(uvZX8 zBnbgZ-QsP?M5$QX7c(34pC#XfN)8qyZRnDW5}}_iDv|w?nL8%QU5W?V0cLp%)L_Mr z+_VY-@yLgG9%Jf=0V^s0N3nir?i~Fln91t(=A~|F3N4J(^OhE}LfYSQ6+bT^guQML zmN1f#6r?TmN&z?zByUs*M~R#^=4!@vg3QabY&x%tDn3j}FcLgoEC_C|$Nh*l4GQu0 zSO?+b8psVJzi@HbL(GZ|)R11CC2wPTecf1C(wjxtU~43LL?0j(A&X^gZQz#EN!QKB zoif~MsrShVmyr8AJ33g${*=YtWF^PHmW-t#c5a;EGTivy^gT{|Zok5ea>688&sm>h mM2W-v`uWz$=4_d+DK8Bp?=bdV=Xt;2_DjB&cqtQ{>iGqq!mOkK delta 859 zcma)5O;1xn6nzB^DWPd=7f1*~7YMw^^Ub{PNow&YxM3v=46-+AG;!4yC?FrUP@op7 zv_hdM)k2FDP>A{?+_~y~A3wmoQw#)+3vV)$o0Bu=-kEzQl5L1&8xrl_9)@9@bX|mR zpyYOhcb2^<;okSu1P7CZ0sl2W#imDKVby1X5*&17c$j-gn z8{eDnKHfy46h=tI2w{vxn!r&7DMn@*OGYY>WTHs2t_;A}_)zc9Z|2eg6ca}Jy&YMF z_=1@)$b=w5G%O=sLXyT(l>m}tN#KYQeQ?qF}ZRxQHWc<&#ieA$R>o13S#Ppjt1gn2R*HZt=tll#r>!}O65 z4Ox^C(luQrF#Xb4nKBM`tWwcldt2wNeTKt4EKl0Wk5+CDlG9LHGENFm9fQR=h*gZG z4-}V_a~+HcLiIsltY4+tTWNST19RbHBUP+bGccdBaw)7p{LtLp#j25=MY4i*>HJh#&ci0wkWN-*snW2DI{Av7i0e$jE3Yq&^HiG8PwMa~n2FkSQhmZ}qsIjfR@3 zwHAuH~3HazV41qHTL AkpKVy diff --git a/webapp/vite-project/src/components/check/index.vue b/webapp/vite-project/src/components/check/index.vue index 4a7220f..980ea40 100644 --- a/webapp/vite-project/src/components/check/index.vue +++ b/webapp/vite-project/src/components/check/index.vue @@ -27,7 +27,7 @@ const items = [ ] as StepProps[]; // 文件路径 const filePath = ref(''); -const current = ref(0); +const current = ref(3); // 下一步 const nextPage = () => { current.value ++; @@ -59,7 +59,6 @@ const formState = ref(''); 上一步 下一步 - 报销 完成 diff --git a/webapp/vite-project/src/components/check/report.vue b/webapp/vite-project/src/components/check/report.vue index 201729c..1058c6e 100644 --- a/webapp/vite-project/src/components/check/report.vue +++ b/webapp/vite-project/src/components/check/report.vue @@ -1,16 +1,14 @@