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;