From d4bf7c5e995ab4933d5c3da0ce97f7b583701083 Mon Sep 17 00:00:00 2001 From: DXC Date: Tue, 12 May 2026 14:59:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(material):=20=E7=89=A9=E6=96=99=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E9=82=AE=E7=AE=B1=E5=AD=97=E6=AE=B5=EF=BC=8C=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=97=B6=E5=8F=AF=E6=AD=A3=E7=A1=AE=E5=9B=9E?= =?UTF-8?q?=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inventory-backend/app/services/inbound/base_service.py | 8 +++++++- inventory-web/src/views/material/list.vue | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/inventory-backend/app/services/inbound/base_service.py b/inventory-backend/app/services/inbound/base_service.py index c0b0af5..7ffe345 100644 --- a/inventory-backend/app/services/inbound/base_service.py +++ b/inventory-backend/app/services/inbound/base_service.py @@ -187,7 +187,9 @@ class MaterialBaseService: inner_sub.c.total_avail, MaterialWarningSetting.is_enabled.label('warning_enabled'), MaterialWarningSetting.yellow_threshold.label('warning_yellow'), - MaterialWarningSetting.red_threshold.label('warning_red') + MaterialWarningSetting.red_threshold.label('warning_red'), + MaterialWarningSetting.red_emails.label('warning_red_emails'), + MaterialWarningSetting.yellow_emails.label('warning_yellow_emails') ).outerjoin(inner_sub, MaterialBase.id == inner_sub.c.base_id) \ .outerjoin(MaterialWarningSetting, MaterialBase.id == MaterialWarningSetting.base_id) @@ -441,6 +443,8 @@ class MaterialBaseService: warning_enabled = row[3] if len(row) > 3 else False warning_yellow = row[4] if len(row) > 4 else 0 warning_red = row[5] if len(row) > 5 else 0 + warning_red_emails = row[6] if len(row) > 6 else None + warning_yellow_emails = row[7] if len(row) > 7 else None # 安全兜底 if not hasattr(item, 'to_dict'): @@ -455,6 +459,8 @@ class MaterialBaseService: item_dict['warningEnabled'] = bool(warning_enabled) if warning_enabled is not None else False item_dict['warningYellow'] = float(warning_yellow) if warning_yellow is not None else None item_dict['warningRed'] = float(warning_red) if warning_red is not None else None + item_dict['warningRedEmails'] = warning_red_emails or '' + item_dict['warningYellowEmails'] = warning_yellow_emails or '' # 计算预警状态 if warning_enabled: diff --git a/inventory-web/src/views/material/list.vue b/inventory-web/src/views/material/list.vue index 65d80fb..2f4bb5f 100644 --- a/inventory-web/src/views/material/list.vue +++ b/inventory-web/src/views/material/list.vue @@ -675,6 +675,8 @@ interface MaterialBaseVO { availableCount?: number; warningStatus?: number; warningOrdered?: boolean; + warningRedEmails?: string; + warningYellowEmails?: string; } interface QueryParams { @@ -1419,8 +1421,8 @@ const handleSetSingleWarning = (row: MaterialBaseVO) => { warningForm.isEnabled = row.warningEnabled || false; warningForm.redThreshold = row.warningRed; warningForm.yellowThreshold = row.warningYellow; - warningForm.redEmails = (row as any).redEmails || ''; - warningForm.yellowEmails = (row as any).yellowEmails || ''; + warningForm.redEmails = (row as any).warningRedEmails || (row as any).redEmails || ''; + warningForm.yellowEmails = (row as any).warningYellowEmails || (row as any).yellowEmails || ''; warningDialog.title = '设置预警'; warningDialog.visible = true;