From f011c1efda068943f11ac75464b6a126f4f60f9b Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Tue, 25 Mar 2025 15:00:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8A=A5=E5=91=8A=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quality_control/controllers/main.py | 6 +++++ quality_control/models/quality.py | 3 ++- .../data/insepection_report_template.xml | 25 +++++++++++++------ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/quality_control/controllers/main.py b/quality_control/controllers/main.py index 39d9457b..95b11f5c 100644 --- a/quality_control/controllers/main.py +++ b/quality_control/controllers/main.py @@ -112,3 +112,9 @@ class QualityReportController(http.Controller): ] ) return request.not_found() + + @http.route('/quality/report/not_published', type='http', auth='public') + def get_not_published_report(self, **kw): + """提供未发布报告的控制器""" + return "报告尚未发布" + diff --git a/quality_control/models/quality.py b/quality_control/models/quality.py index a3fe0460..412305b2 100644 --- a/quality_control/models/quality.py +++ b/quality_control/models/quality.py @@ -461,7 +461,8 @@ class QualityCheck(models.Model): if self.report_number_id: print(f"{base_url}/quality/report/{self.report_number_id.id}") return f"{base_url}/quality/report/{self.report_number_id.id}" - return False + else: + return f"{base_url}/quality/report/not_published" def upload_factory_report(self): """ diff --git a/sf_quality/data/insepection_report_template.xml b/sf_quality/data/insepection_report_template.xml index f605b3e4..8362a589 100644 --- a/sf_quality/data/insepection_report_template.xml +++ b/sf_quality/data/insepection_report_template.xml @@ -16,13 +16,24 @@
- -
- 报告编号:ceshi -
-
- 扫描二维码查看PDF报告 -
+ + +
+ 报告编号: +
+
+ 扫描二维码查看PDF报告 +
+
+ + +
+ 报告编号:ceshi +
+
+ 扫描二维码查看PDF报告 +
+