Browse Source

提交更新

837390164@qq.com 2 months ago
parent
commit
e5ce358b9f
4 changed files with 848 additions and 657 deletions
  1. 79 0
      src/api/request.ts
  2. 40 1
      src/api/warning.ts
  3. 385 256
      src/pages/Warning/Center.tsx
  4. 344 400
      src/pages/Warning/Records.tsx

+ 79 - 0
src/api/request.ts

@@ -182,6 +182,53 @@ export const invoke = (
 /**
  * 获取模拟响应数据(用于开发预览)
  */
+/** 模拟预警记录数据 */
+const mockWarningRecords = () => {
+  const records = [
+    { id: 1, warningNo: 'W202605131400001', ruleCode: 'WR001', ruleName: '费用超支预警(严重)', warningType: '01', warningLevel: 3, hisAdmId: 'ZY20260001', patientName: '张三', deptCode: 'D001', deptName: '心内科', doctorCode: 'DR001', doctorName: '王医生', drgCode: 'ES23', drgName: '呼吸系统肿瘤', totalFee: 15800, insuranceFee: 12000, drgPayStandard: 12000, diffAmount: -3800, diffRate: -31.67, warningMessage: '费用超支预警:患者费用总额15800.00元,DRG支付标准12000.00元,超出3800.00元(-31.67%)', warningStatus: '01', warningDate: '2026-05-13', warningTime: '14:30:00', fixmedinsCode: 'H001', fixmedinsName: '测试人民医院' },
+    { id: 2, warningNo: 'W202605131000002', ruleCode: 'WR003', ruleName: '高倍率预警', warningType: '03', warningLevel: 2, hisAdmId: 'ZY20260002', patientName: '李四', deptCode: 'D002', deptName: '骨科', doctorCode: 'DR002', doctorName: '张医生', drgCode: 'IC13', drgName: '关节置换', totalFee: 25000, insuranceFee: 18000, drgPayStandard: 18000, diffAmount: -7000, diffRate: -38.89, warningMessage: '高倍率预警:患者费用总额25000.00元,DRG支付标准18000.00元,超出7000.00元(-38.89%)', warningStatus: '01', warningDate: '2026-05-13', warningTime: '10:15:00', fixmedinsCode: 'H001', fixmedinsName: '测试人民医院' },
+    { id: 3, warningNo: 'W202605121600003', ruleCode: 'WR002', ruleName: '费用超支预警(警告)', warningType: '01', warningLevel: 2, hisAdmId: 'ZY20260003', patientName: '王五', deptCode: 'D001', deptName: '心内科', doctorCode: 'DR003', doctorName: '陈医生', drgCode: 'FB23', drgName: '心脏介入治疗', totalFee: 18500, insuranceFee: 15000, drgPayStandard: 15000, diffAmount: -3500, diffRate: -23.33, warningMessage: '费用超支预警:患者费用总额18500.00元,DRG支付标准15000.00元,超出3500.00元(-23.33%)', warningStatus: '03', warningDate: '2026-05-12', warningTime: '16:45:00', processUser: '赵医生', processDate: '2026-05-12', processTime: '17:30:00', processRemark: '患者合并多种基础疾病,费用在合理范围', fixmedinsCode: 'H001', fixmedinsName: '测试人民医院' },
+    { id: 4, warningNo: 'W202605120900004', ruleCode: 'WR004', ruleName: '低倍率预警', warningType: '02', warningLevel: 1, hisAdmId: 'ZY20260004', patientName: '赵六', deptCode: 'D003', deptName: '普外科', doctorCode: 'DR004', doctorName: '孙医生', drgCode: 'GC13', drgName: '消化系统其他手术', totalFee: 4500, insuranceFee: 8000, drgPayStandard: 8000, diffAmount: 3500, diffRate: 43.75, warningMessage: '低倍率预警:患者费用总额4500.00元,DRG支付标准8000.00元', warningStatus: '02', warningDate: '2026-05-12', warningTime: '09:30:00', processUser: '钱主任', processDate: '2026-05-12', processTime: '11:00:00', processRemark: '患者恢复良好提前出院', fixmedinsCode: 'H001', fixmedinsName: '测试人民医院' },
+    { id: 5, warningNo: 'W202605111100005', ruleCode: 'WR005', ruleName: '编码异常预警', warningType: '04', warningLevel: 2, hisAdmId: 'ZY20260005', patientName: '钱七', deptCode: 'D004', deptName: '神经内科', doctorCode: 'DR005', doctorName: '周医生', drgCode: 'BR23', drgName: '神经系统肿瘤', totalFee: 12000, insuranceFee: 12000, drgPayStandard: 12000, diffAmount: 0, diffRate: 0, warningMessage: '编码异常预警:主诊断编码可能存在问题,请核查', warningStatus: '01', warningDate: '2026-05-11', warningTime: '11:20:00', fixmedinsCode: 'H001', fixmedinsName: '测试人民医院' },
+    { id: 6, warningNo: 'W202605101500006', ruleCode: 'WR001', ruleName: '费用超支预警(严重)', warningType: '01', warningLevel: 3, hisAdmId: 'ZY20260006', patientName: '孙八', deptCode: 'D002', deptName: '骨科', doctorCode: 'DR006', doctorName: '吴医生', drgCode: 'IC13', drgName: '关节置换', totalFee: 32000, insuranceFee: 22000, drgPayStandard: 22000, diffAmount: -10000, diffRate: -45.45, warningMessage: '费用超支预警:患者费用总额32000.00元,DRG支付标准22000.00元,超出10000.00元(-45.45%)', warningStatus: '02', warningDate: '2026-05-10', warningTime: '15:00:00', processUser: '郑主任', processDate: '2026-05-10', processTime: '16:30:00', processRemark: '术后感染需长期抗感染治疗,费用合理', fixmedinsCode: 'H001', fixmedinsName: '测试人民医院' },
+  ];
+  return records.map((r, i) => ({ ...r, id: String(r.id) }));
+};
+
+/** 计算模拟统计数据 */
+const mockWarningStats = () => {
+  const records = mockWarningRecords();
+  const statusCounts: Record<string, number> = {};
+  const typeCounts: Record<string, number> = {};
+  const levelCounts: Record<number, number> = { 1: 0, 2: 0, 3: 0 };
+  let totalDiff = 0;
+  let totalFee = 0;
+
+  records.forEach(r => {
+    statusCounts[r.warningStatus] = (statusCounts[r.warningStatus] || 0) + 1;
+    typeCounts[r.warningType] = (typeCounts[r.warningType] || 0) + 1;
+    levelCounts[r.warningLevel] = (levelCounts[r.warningLevel] || 0) + 1;
+    totalDiff += (r.diffAmount || 0);
+    totalFee += (r.totalFee || 0);
+  });
+
+  return {
+    totalCount: records.length,
+    pendingCount: statusCounts['01'] || 0,
+    processedCount: (statusCounts['02'] || 0) + (statusCounts['03'] || 0) + (statusCounts['04'] || 0) + (statusCounts['05'] || 0),
+    typeStats: Object.entries(typeCounts).map(([type, count]) => {
+      const typeNames: Record<string, string> = { '01': '费用超支', '02': '低倍率', '03': '高倍率', '04': '编码异常', '05': '分解住院', '06': '费用过低' };
+      return { type: typeNames[type] || type, count };
+    }),
+    levelStats: Object.entries(levelCounts).map(([level, count]) => ({
+      level: level === '1' ? '低' : level === '2' ? '中' : level === '3' ? '高' : level,
+      count,
+    })),
+    totalDiff,
+    totalFee,
+  };
+};
+
 const getMockResponse = (code: string): any => {
   if (code === '02010001') {
     // DRG分组器模拟响应 - 最新结构
@@ -213,6 +260,38 @@ const getMockResponse = (code: string): any => {
       },
     };
   }
+
+  // 预警统计接口 02010106 - 开发模式模拟数据
+  if (code === '02010106') {
+    return {
+      errorCode: '0',
+      errorMessage: '(dev)',
+      result: mockWarningStats(),
+    };
+  }
+
+  // 预警记录查询接口 02010103 - 开发模式模拟数据
+  if (code === '02010103') {
+    const allRecords = mockWarningRecords();
+    return {
+      errorCode: '0',
+      errorMessage: '(dev)',
+      result: {
+        rows: allRecords,
+        total: allRecords.length,
+      },
+    };
+  }
+
+  // 预警处理接口 02010104 - 开发模式模拟响应
+  if (code === '02010104') {
+    return {
+      errorCode: '0',
+      errorMessage: '(dev) 处理成功',
+      result: {},
+    };
+  }
+
   return { errorCode: '-1', errorMessage: '未实现的接口' };
 };
 

+ 40 - 1
src/api/warning.ts

@@ -268,34 +268,73 @@ export interface WarningRule {
 }
 
 /**
- * 预警记录数据类型
+ * 预警记录数据类型(对应 BS_DRGWarningRecord 表)
  */
 export interface WarningRecord {
+  /** 记录ID */
   id: string;
+  /** 预警流水号 */
   warningNo: string;
+  /** 关联规则的引用ID */
+  ruleDr?: string;
+  /** 关联规则编码 */
   ruleCode: string;
+  /** 关联规则名称 */
   ruleName: string;
+  /** 预警类型:01=费用超支, 02=低倍率, 03=高倍率, 04=编码异常, 05=分解住院 */
   warningType: string;
+  /** 预警级别:1=低, 2=中, 3=高 */
   warningLevel: number;
+  /** 病案ID */
+  medicalRecordDr?: string;
+  /** HIS就诊ID */
   hisAdmId: string;
+  /** 患者姓名 */
   patientName: string;
+  /** 科室编码 */
   deptCode?: string;
+  /** 科室名称 */
   deptName?: string;
+  /** 医生编码 */
   doctorCode?: string;
+  /** 医生姓名 */
   doctorName?: string;
+  /** DRG编码 */
   drgCode: string;
+  /** DRG名称 */
   drgName?: string;
+  /** 医疗总费用 */
   totalFee: number;
+  /** 医保结算费用 */
   insuranceFee?: number;
+  /** DRG支付标准 */
   drgPayStandard?: number;
+  /** 费用差异金额 */
   diffAmount?: number;
+  /** 费用差异率(%) */
   diffRate?: number;
+  /** 预警消息 */
   warningMessage?: string;
+  /** 预警状态:01=待处理, 02=已确认, 03=已忽略, 04=已申诉, 05=已解决 */
   warningStatus: string;
+  /** 预警日期 */
   warningDate: string;
+  /** 预警时间 */
   warningTime: string;
+  /** 预警日期时间(组合) */
+  warningDateTime?: string;
+  /** 处理人 */
   processUser?: string;
+  /** 处理日期 */
   processDate?: string;
+  /** 处理时间 */
   processTime?: string;
+  /** 处理日期时间(组合) */
+  processDateTime?: string;
+  /** 处理备注 */
   processRemark?: string;
+  /** 医疗机构代码 */
+  fixmedinsCode?: string;
+  /** 医疗机构名称 */
+  fixmedinsName?: string;
 }

+ 385 - 256
src/pages/Warning/Center.tsx

@@ -21,202 +21,208 @@ import {
 } from 'antd';
 import {
   WarningOutlined,
-  CheckCircleOutlined,
   ClockCircleOutlined,
   ExclamationCircleOutlined,
   EyeOutlined,
   CheckOutlined,
-  CloseOutlined
+  CloseOutlined,
+  ReloadOutlined,
+  RiseOutlined,
+  DollarOutlined
 } from '@ant-design/icons';
 import CustomPagination from '../../components/CustomPagination';
 import type { ColumnsType } from 'antd/es/table';
+import type { WarningRecord } from '@/api/warning';
+import { queryWarningRecords, processWarning } from '@/api/warning';
 import dayjs from 'dayjs';
+import zhCN from 'antd/es/date-picker/locale/zh_CN';
 
-const { Title, Text } = Typography;
+const { Text } = Typography;
 const { RangePicker } = DatePicker;
 const { Option } = Select;
 const { TabPane } = Tabs;
 const { TextArea } = Input;
 
-// 预警级别
-const WARNING_LEVELS = {
-  1: { text: '提示', color: 'green', tagColor: 'success' },
-  2: { text: '警告', color: 'orange', tagColor: 'warning' },
-  3: { text: '严重', color: 'red', tagColor: 'error' },
+// 预警级别映射
+const WARNING_LEVELS: Record<number, { text: string; tagColor: string }> = {
+  1: { text: '', tagColor: 'success' },
+  2: { text: '', tagColor: 'warning' },
+  3: { text: '', tagColor: 'error' },
 };
 
-// 处理状态
-const PROCESS_STATUS = {
-  '待处理': { text: '待处理', color: 'default' },
-  '已处理': { text: '已处理', color: 'success' },
-  '已忽略': { text: '已忽略', color: 'warning' },
+// 预警类型映射(对应 BS_DRGWarningRecord.WarningType)
+const WARNING_TYPES: Record<string, string> = {
+  '01': '费用超支',
+  '02': '低倍率',
+  '03': '高倍率',
+  '04': '编码异常',
+  '05': '分解住院',
 };
 
-interface WarningRecord {
-  id: string;
-  admissionNo: string;
-  patientName: string;
-  ruleName: string;
-  warningLevel: 1 | 2 | 3;
-  totalCost: number;
-  drgPayment: number;
-  balanceAmount: number;
-  balancePercent: number;
-  deptName: string;
-  warningDate: string;
-  processStatus: '待处理' | '已处理' | '已忽略';
-  processUser?: string;
-  processRemarks?: string;
+// 预警状态映射(对应 BS_DRGWarningRecord.WarningStatus)
+const WARNING_STATUS: Record<string, { text: string; color: string }> = {
+  '01': { text: '待处理', color: 'default' },
+  '02': { text: '已确认', color: 'processing' },
+  '03': { text: '已忽略', color: 'warning' },
+  '04': { text: '已申诉', color: 'purple' },
+  '05': { text: '已解决', color: 'success' },
+};
+
+interface StatsData {
+  totalCount: number;
+  pendingCount: number;
+  processedCount: number;
+  totalDiff?: number;
+  totalProfit?: number;
+  totalPayStandard?: number;
 }
 
-// 模拟数据
-const mockData: WarningRecord[] = [
-  {
-    id: '1',
-    admissionNo: '20240001',
-    patientName: '张三',
-    ruleName: '费用超支预警',
-    warningLevel: 3,
-    totalCost: 15800,
-    drgPayment: 12000,
-    balanceAmount: -3800,
-    balancePercent: -31.67,
-    deptName: '心内科',
-    warningDate: '2026-03-28 14:30:00',
-    processStatus: '待处理',
-  },
-  {
-    id: '2',
-    admissionNo: '20240002',
-    patientName: '李四',
-    ruleName: '高倍率预警',
-    warningLevel: 2,
-    totalCost: 25000,
-    drgPayment: 18000,
-    balanceAmount: -7000,
-    balancePercent: -38.89,
-    deptName: '骨科',
-    warningDate: '2026-03-28 10:15:00',
-    processStatus: '待处理',
-  },
-  {
-    id: '3',
-    admissionNo: '20240003',
-    patientName: '王五',
-    ruleName: '费用超支预警',
-    warningLevel: 1,
-    totalCost: 8500,
-    drgPayment: 8000,
-    balanceAmount: -500,
-    balancePercent: -6.25,
-    deptName: '呼吸内科',
-    warningDate: '2026-03-27 16:45:00',
-    processStatus: '已处理',
-    processUser: '医生A',
-    processRemarks: '已核实,患者病情复杂,费用合理',
-  },
-  {
-    id: '4',
-    admissionNo: '20240004',
-    patientName: '赵六',
-    ruleName: '低倍率预警',
-    warningLevel: 1,
-    totalCost: 4500,
-    drgPayment: 8000,
-    balanceAmount: 3500,
-    balancePercent: 43.75,
-    deptName: '普外科',
-    warningDate: '2026-03-27 09:30:00',
-    processStatus: '已忽略',
-    processUser: '医生B',
-    processRemarks: '提前出院,费用正常',
-  },
-  {
-    id: '5',
-    admissionNo: '20240005',
-    patientName: '钱七',
-    ruleName: '编码异常预警',
-    warningLevel: 2,
-    totalCost: 12000,
-    drgPayment: 12000,
-    balanceAmount: 0,
-    balancePercent: 0,
-    deptName: '神经内科',
-    warningDate: '2026-03-26 11:20:00',
-    processStatus: '待处理',
-  },
-];
+/** 格式化预警日期(兼容时间戳和字符串) */
+const fmtDate = (val: any): string => {
+  if (!val && val !== 0) return '-';
+  const n = Number(val);
+  if (!isNaN(n) && n > 100000000) return dayjs(n).format('YYYY-MM-DD');
+  return String(val);
+};
 
 const Center: React.FC = () => {
-  const [data, setData] = useState<WarningRecord[]>(mockData);
+  const [data, setData] = useState<WarningRecord[]>([]);
   const [loading, setLoading] = useState(false);
+  const [statsLoading, setStatsLoading] = useState(false);
+  const [stats, setStats] = useState<StatsData>({
+    totalCount: 0,
+    pendingCount: 0,
+    processedCount: 0,
+    totalDiff: 0,
+    totalProfit: 0,
+    totalPayStandard: 0,
+  });
+
+  // 筛选条件
   const [filterLevel, setFilterLevel] = useState<string>('');
-  const [filterDept, setFilterDept] = useState<string>('');
+  const [filterStatus, setFilterStatus] = useState<string>('');
+  const [filterType, setFilterType] = useState<string>('');
+  const [dateRange, setDateRange] = useState<[dayjs.Dayjs, dayjs.Dayjs] | null>(null);
   const [activeTab, setActiveTab] = useState('all');
+
+  // 分页
+  const [currentPage, setCurrentPage] = useState(1);
+  const [pageSize, setPageSize] = useState(10);
+  const [total, setTotal] = useState(0);
+
+  // 处理弹窗
   const [processModalVisible, setProcessModalVisible] = useState(false);
   const [currentRecord, setCurrentRecord] = useState<WarningRecord | null>(null);
+  const [processType, setProcessType] = useState<'processed' | 'ignored'>('processed');
+  const [processing, setProcessing] = useState(false);
   const [form] = Form.useForm();
 
-  // 统计数据
-  const stats = {
-    total: data.length,
-    pending: data.filter(d => d.processStatus === '待处理').length,
-    highRisk: data.filter(d => d.warningLevel === 3 && d.processStatus === '待处理').length,
-    processed: data.filter(d => d.processStatus === '已处理').length,
-  };
+  // 加载全部数据(统计+记录)
+  const loadData = async () => {
+    setLoading(true);
+    setStatsLoading(true);
+    try {
+      // 一次性获取全部记录(用于统计计算和表格展示)
+      const res: any = await queryWarningRecords(
+        {
+          warningStatus: activeTab === 'pending' ? '01' : (activeTab === 'processed' ? '' : filterStatus),
+          warningType: filterType || undefined,
+          startDate: dateRange?.[0]?.format('YYYY-MM-DD') || '',
+          endDate: dateRange?.[1]?.format('YYYY-MM-DD') || '',
+        },
+        { pageSize: 99999, currentPage: 1 }
+      );
+      console.log('[Center] records response:', res);
 
-  // 筛选数据
-  const getFilteredData = () => {
-    let filtered = data;
-    
-    // 标签页筛选
-    if (activeTab === 'pending') {
-      filtered = filtered.filter(d => d.processStatus === '待处理');
-    } else if (activeTab === 'processed') {
-      filtered = filtered.filter(d => d.processStatus === '已处理' || d.processStatus === '已忽略');
-    }
-    
-    // 级别筛选
-    if (filterLevel) {
-      filtered = filtered.filter(d => d.warningLevel === parseInt(filterLevel));
-    }
-    
-    // 科室筛选
-    if (filterDept) {
-      filtered = filtered.filter(d => d.deptName === filterDept);
+      if (res.errorCode === '0' || res.errorCode === 0) {
+        const allRows: WarningRecord[] = (res.result.rows || []).map((item: any) => ({
+          ...item,
+          id: String(item.id || ''),
+        }));
+
+        // ====== 本地计算精确统计 ======
+        const pendingCount = allRows.filter(r => r.warningStatus === '01').length;
+        const processedAll = allRows.filter(r => r.warningStatus !== '01').length;
+        const totalDiff = allRows.reduce((sum, r) => sum + (Number(r.diffAmount) || 0), 0);
+        const totalProfit = allRows.reduce((sum, r) => {
+          const d = Number(r.diffAmount) || 0;
+          return sum + (d > 0 ? d : 0);
+        }, 0);
+        const totalPayStandard = allRows.reduce((sum, r) => sum + (Number(r.drgPayStandard) || 0), 0);
+
+        setStats({
+          totalCount: allRows.length,
+          pendingCount,
+          processedCount: processedAll,
+          totalDiff,
+          totalProfit,
+          totalPayStandard,
+        });
+        setStatsLoading(false);
+
+        // ====== 前端分页+筛选展示 ======
+        let filtered = allRows;
+        if (activeTab === 'processed') {
+          filtered = allRows.filter(r => r.warningStatus !== '01');
+        }
+        if (filterLevel) {
+          filtered = filtered.filter(r => Number(r.warningLevel) === Number(filterLevel));
+        }
+        // 更新total反映筛选后的数量
+        setTotal(filtered.length);
+        // 前端分页切片
+        const start = (currentPage - 1) * pageSize;
+        const paged = filtered.slice(start, start + pageSize);
+        setData(paged);
+      } else {
+        setStatsLoading(false);
+        console.warn('[Center] records API error:', res.errorCode, res.errorMessage);
+      }
+    } catch (error) {
+      console.error('[Center] 查询预警记录失败:', error);
+      setStatsLoading(false);
+    } finally {
+      setLoading(false);
     }
-    
-    return filtered;
   };
 
-  // 处理预警
-  const handleProcess = (record: WarningRecord, status: '已处理' | '已忽略') => {
-    setCurrentRecord({ ...record, processStatus: status });
+  // 当筛选条件变化时自动重新加载
+  useEffect(() => {
+    loadData();
+  }, [activeTab, filterStatus, filterType, filterLevel, dateRange, pageSize, currentPage]);
+
+  // 处理预警按钮
+  const handleProcess = (record: WarningRecord, type: 'processed' | 'ignored') => {
+    setCurrentRecord(record);
+    setProcessType(type);
     setProcessModalVisible(true);
     form.resetFields();
-    form.setFieldsValue({ processStatus: status });
   };
 
   // 提交处理
   const submitProcess = async () => {
     try {
       const values = await form.validateFields();
-      const updatedData = data.map(item => {
-        if (item.id === currentRecord?.id) {
-          return {
-            ...item,
-            processStatus: currentRecord.processStatus,
-            processUser: '当前用户',
-            processRemarks: values.processRemarks,
-          };
-        }
-        return item;
-      });
-      setData(updatedData);
-      setProcessModalVisible(false);
-      message.success('处理成功');
+      if (!currentRecord?.id) return;
+      setProcessing(true);
+
+      const res: any = await processWarning(
+        currentRecord.id,
+        processType,
+        values.processRemarks || ''
+      );
+
+      if (res.errorCode === '0') {
+        message.success(processType === 'processed' ? '已确认处理' : '已忽略该预警');
+        setProcessModalVisible(false);
+        loadData();
+      } else {
+        message.error(res.errorMessage || '处理失败');
+      }
     } catch (error) {
-      console.error(error);
+      console.error('处理预警失败:', error);
+    } finally {
+      setProcessing(false);
     }
   };
 
@@ -224,33 +230,67 @@ const Center: React.FC = () => {
   const handleView = (record: WarningRecord) => {
     Modal.info({
       title: '预警详情',
-      width: 600,
+      width: 680,
       content: (
         <div style={{ marginTop: 16 }}>
           <Row gutter={[16, 16]}>
-            <Col span={12}><Text strong>住院号:</Text> {record.admissionNo}</Col>
+            <Col span={12}><Text strong>预警流水号:</Text> {record.warningNo}</Col>
+            <Col span={12}><Text strong>就诊ID:</Text> {record.hisAdmId}</Col>
             <Col span={12}><Text strong>患者姓名:</Text> {record.patientName}</Col>
-            <Col span={12}><Text strong>科室:</Text> {record.deptName}</Col>
-            <Col span={12}><Text strong>预警时间:</Text> {record.warningDate}</Col>
+            <Col span={12}>
+              <Text strong>预警级别:</Text>
+              <Tag color={WARNING_LEVELS[record.warningLevel]?.tagColor}>
+                {WARNING_LEVELS[record.warningLevel]?.text || record.warningLevel}
+              </Tag>
+            </Col>
+            <Col span={12}><Text strong>科室:</Text> {record.deptName || '-'}</Col>
+            <Col span={12}><Text strong>医生:</Text> {record.doctorName || '-'}</Col>
+            <Col span={12}>
+              <Text strong>预警类型:</Text>
+              <Tag>{WARNING_TYPES[record.warningType] || record.warningType}</Tag>
+            </Col>
+            <Col span={12}>
+              <Text strong>预警状态:</Text>
+              <Tag color={WARNING_STATUS[record.warningStatus]?.color}>
+                {WARNING_STATUS[record.warningStatus]?.text || record.warningStatus}
+              </Tag>
+            </Col>
             <Col span={24}><Text strong>预警规则:</Text> {record.ruleName}</Col>
-            <Col span={12}><Text strong>费用总额:</Text> ¥{record.totalCost.toLocaleString()}</Col>
-            <Col span={12}><Text strong>DRG支付标准:</Text> ¥{record.drgPayment.toLocaleString()}</Col>
+            <Col span={12}><Text strong>DRG编码:</Text> {record.drgCode}</Col>
+            <Col span={12}><Text strong>DRG名称:</Text> {record.drgName || '-'}</Col>
+            <Col span={12}><Text strong>费用总额:</Text> ¥{(record.totalFee || 0).toLocaleString()}</Col>
+            <Col span={12}><Text strong>DRG支付标准:</Text> ¥{(record.drgPayStandard || 0).toLocaleString()}</Col>
             <Col span={12}>
-              <Text strong>超支/结余:</Text>
-              <Text type={record.balanceAmount < 0 ? 'danger' : 'success'}>
-                ¥{record.balanceAmount.toLocaleString()}
+              <Text strong>费用差异:</Text>
+              <Text type={(record.diffAmount || 0) < 0 ? 'danger' : 'success'}>
+                ¥{(record.diffAmount || 0).toLocaleString()}
               </Text>
             </Col>
             <Col span={12}>
-              <Text strong>比例:</Text>
-              <Text type={record.balancePercent < 0 ? 'danger' : 'success'}>
-                {record.balancePercent}%
+              <Text strong>差异率:</Text>
+              <Text type={(record.diffRate || 0) < 0 ? 'danger' : 'success'}>
+                {record.diffRate || 0}%
               </Text>
             </Col>
-            {record.processUser && (
+            <Col span={12}><Text strong>预警时间:</Text> {record.warningDateTime || `${fmtDate(record.warningDate)} ${record.warningTime || ''}`}</Col>
+            {record.warningMessage && (
+              <Col span={24}>
+                <Text strong>预警消息:</Text>
+                <div style={{ marginTop: 8, padding: 12, background: '#fff7e6', borderRadius: 4, whiteSpace: 'pre-wrap' }}>
+                  {record.warningMessage}
+                </div>
+              </Col>
+            )}
+            {record.processRemark && (
               <>
-                <Col span={12}><Text strong>处理人:</Text> {record.processUser}</Col>
-                <Col span={12}><Text strong>处理备注:</Text> {record.processRemarks}</Col>
+                <Col span={12}><Text strong>处理人:</Text> {record.processUser || '-'}</Col>
+                <Col span={12}><Text strong>处理时间:</Text> {record.processDateTime || `${fmtDate(record.processDate)} ${record.processTime || ''}`}</Col>
+                <Col span={24}>
+                  <Text strong>处理备注:</Text>
+                  <div style={{ marginTop: 8, padding: 12, background: '#f5f5f5', borderRadius: 4 }}>
+                    {record.processRemark}
+                  </div>
+                </Col>
               </>
             )}
           </Row>
@@ -259,22 +299,42 @@ const Center: React.FC = () => {
     });
   };
 
+  // 重置筛选
+  const handleReset = () => {
+    setFilterLevel('');
+    setFilterStatus('');
+    setFilterType('');
+    setDateRange(null);
+    setCurrentPage(1);
+    setActiveTab('all');
+  };
+
+  // 高危预警数量(level=3且待处理)
+  const highRiskCount = data.filter(d => d.warningLevel === 3 && d.warningStatus === '01').length;
+
   const columns: ColumnsType<WarningRecord> = [
     {
-      title: '预警级别',
+      title: '级别',
       dataIndex: 'warningLevel',
       key: 'warningLevel',
-      width: 90,
-      render: (level: 1 | 2 | 3) => (
-        <Tag color={WARNING_LEVELS[level].tagColor}>
-          {WARNING_LEVELS[level].text}
+      width: 65,
+      render: (level: number) => (
+        <Tag color={WARNING_LEVELS[level]?.tagColor || 'default'}>
+          {WARNING_LEVELS[level]?.text || level}
         </Tag>
       ),
     },
     {
-      title: '住院号',
-      dataIndex: 'admissionNo',
-      key: 'admissionNo',
+      title: '流水号',
+      dataIndex: 'warningNo',
+      key: 'warningNo',
+      width: 160,
+      ellipsis: true,
+    },
+    {
+      title: '就诊ID',
+      dataIndex: 'hisAdmId',
+      key: 'hisAdmId',
       width: 100,
     },
     {
@@ -283,61 +343,80 @@ const Center: React.FC = () => {
       key: 'patientName',
       width: 100,
     },
+    {
+      title: '预警类型',
+      dataIndex: 'warningType',
+      key: 'warningType',
+      width: 100,
+      render: (type: string) => (
+        <Tag>{WARNING_TYPES[type] || type}</Tag>
+      ),
+    },
     {
       title: '科室',
       dataIndex: 'deptName',
       key: 'deptName',
       width: 120,
+      render: (val: string) => val || '-',
     },
     {
-      title: '预警规则',
-      dataIndex: 'ruleName',
-      key: 'ruleName',
-      width: 140,
+      title: 'DRG编码',
+      dataIndex: 'drgCode',
+      key: 'drgCode',
+      width: 100,
     },
     {
       title: '费用总额',
-      dataIndex: 'totalCost',
-      key: 'totalCost',
+      dataIndex: 'totalFee',
+      key: 'totalFee',
       width: 120,
       align: 'right',
-      render: (val: number) => `¥${val.toLocaleString()}`,
+      render: (val: number) => `¥${(val || 0).toLocaleString()}`,
     },
     {
       title: 'DRG标准',
-      dataIndex: 'drgPayment',
-      key: 'drgPayment',
+      dataIndex: 'drgPayStandard',
+      key: 'drgPayStandard',
       width: 120,
       align: 'right',
-      render: (val: number) => `¥${val.toLocaleString()}`,
+      render: (val: number) => `¥${(val || 0).toLocaleString()}`,
     },
     {
       title: '超支/结余',
       key: 'balance',
       width: 120,
       align: 'right',
-      render: (_, record) => (
-        <Text type={record.balanceAmount < 0 ? 'danger' : 'success'}>
-          ¥{record.balanceAmount.toLocaleString()}
-          <br />
-          <small>({record.balancePercent}%)</small>
-        </Text>
-      ),
+      render: (_, record) => {
+        const diff = record.diffAmount || 0;
+        const diffRate = record.diffRate || 0;
+        return (
+          <Text type={diff < 0 ? 'danger' : 'success'}>
+            ¥{diff.toLocaleString()}
+            <br />
+            <small>({diffRate}%)</small>
+          </Text>
+        );
+      },
     },
     {
       title: '预警时间',
-      dataIndex: 'warningDate',
-      key: 'warningDate',
-      width: 160,
+      dataIndex: 'warningDateTime',
+      key: 'warningDateTime',
+      width: 110,
+      render: (val: string, record) => (
+        <span>
+          {val || `${fmtDate(record.warningDate)} ${record.warningTime || ''}`}
+        </span>
+      ),
     },
     {
       title: '状态',
-      dataIndex: 'processStatus',
-      key: 'processStatus',
-      width: 100,
+      dataIndex: 'warningStatus',
+      key: 'warningStatus',
+      width: 90,
       render: (status: string) => (
-        <Tag color={PROCESS_STATUS[status].color}>
-          {PROCESS_STATUS[status].text}
+        <Tag color={WARNING_STATUS[status]?.color || 'default'}>
+          {WARNING_STATUS[status]?.text || status}
         </Tag>
       ),
     },
@@ -356,23 +435,23 @@ const Center: React.FC = () => {
           >
             查看
           </Button>
-          {record.processStatus === '待处理' && (
+          {record.warningStatus === '01' && (
             <>
               <Button
                 type="link"
                 size="small"
                 style={{ color: '#52c41a' }}
                 icon={<CheckOutlined />}
-                onClick={() => handleProcess(record, '已处理')}
+                onClick={() => handleProcess(record, 'processed')}
               >
-                处理
+                确认
               </Button>
               <Button
                 type="link"
                 size="small"
                 danger
                 icon={<CloseOutlined />}
-                onClick={() => handleProcess(record, '已忽略')}
+                onClick={() => handleProcess(record, 'ignored')}
               >
                 忽略
               </Button>
@@ -387,90 +466,131 @@ const Center: React.FC = () => {
     <div style={{ padding: 16, height: '100%', display: 'flex', flexDirection: 'column' }}>
       {/* 统计卡片 */}
       <Row gutter={[16, 16]} style={{ marginBottom: 16 }}>
-        <Col xs={24} sm={12} md={6}>
-          <Card>
+        <Col xs={24} sm={12} md={8} lg={4}>
+          <Card loading={statsLoading}>
             <Statistic
               title="总预警数"
-              value={stats.total}
+              value={stats.totalCount}
               prefix={<WarningOutlined />}
               valueStyle={{ color: '#1890ff' }}
             />
           </Card>
         </Col>
-        <Col xs={24} sm={12} md={6}>
-          <Card>
+        <Col xs={24} sm={12} md={8} lg={4}>
+          <Card loading={statsLoading}>
             <Statistic
               title="待处理"
-              value={stats.pending}
+              value={stats.pendingCount}
               prefix={<ClockCircleOutlined />}
               valueStyle={{ color: '#faad14' }}
             />
           </Card>
         </Col>
-        <Col xs={24} sm={12} md={6}>
-          <Card>
+        <Col xs={24} sm={12} md={8} lg={4}>
+          <Card loading={statsLoading}>
             <Statistic
-              title="严重预警"
-              value={stats.highRisk}
+              title="严重预警(待处理)"
+              value={highRiskCount}
               prefix={<ExclamationCircleOutlined />}
               valueStyle={{ color: '#ff4d4f' }}
             />
           </Card>
         </Col>
-        <Col xs={24} sm={12} md={6}>
-          <Card>
+        <Col xs={24} sm={12} md={8} lg={4}>
+          <Card loading={statsLoading}>
             <Statistic
-              title="已处理"
-              value={stats.processed}
-              prefix={<CheckCircleOutlined />}
+              title="总结余金额"
+              value={stats.totalProfit || 0}
+              precision={2}
+              prefix={<RiseOutlined />}
+              suffix="元"
               valueStyle={{ color: '#52c41a' }}
             />
           </Card>
         </Col>
+        <Col xs={24} sm={12} md={8} lg={4}>
+          <Card loading={statsLoading}>
+            <Statistic
+              title="总标准费用"
+              value={stats.totalPayStandard || 0}
+              precision={2}
+              prefix={<DollarOutlined />}
+              suffix="元"
+              valueStyle={{ color: '#1890ff' }}
+            />
+          </Card>
+        </Col>
+        <Col xs={24} sm={12} md={8} lg={4}>
+          <Card loading={statsLoading}>
+            <Statistic
+              title="总超支金额"
+              value={Math.abs(stats.totalDiff || 0)}
+              precision={2}
+              prefix={<ExclamationCircleOutlined />}
+              suffix="元"
+              valueStyle={{ color: (stats.totalDiff || 0) < 0 ? '#ff4d4f' : '#52c41a' }}
+            />
+          </Card>
+        </Col>
       </Row>
 
       {/* 预警列表 */}
       <Card style={{ flex: 1, display: 'flex', flexDirection: 'column' }} bodyStyle={{ height: '100%', padding: '16px 24px' }}>
-        <Tabs activeKey={activeTab} onChange={setActiveTab} style={{ marginBottom: 16 }}>
-          <TabPane tab={<span>全部预警 <Badge count={stats.total} style={{ marginLeft: 8 }} /></span>} key="all" />
-          <TabPane tab={<span>待处理 <Badge count={stats.pending} style={{ marginLeft: 8 }} color="#faad14" /></span>} key="pending" />
-          <TabPane tab={<span>已处理 <Badge count={stats.processed} style={{ marginLeft: 8 }} color="#52c41a" /></span>} key="processed" />
+        <Tabs
+          activeKey={activeTab}
+          onChange={(key) => { setActiveTab(key); setCurrentPage(1); }}
+          style={{ marginBottom: 16 }}
+        >
+          <TabPane tab={<span>全部预警 <Badge count={stats.totalCount} style={{ marginLeft: 8 }} /></span>} key="all" />
+          <TabPane tab={<span>待处理 <Badge count={stats.pendingCount} style={{ marginLeft: 8 }} color="#faad14" /></span>} key="pending" />
+          <TabPane tab={<span>已处理 <Badge count={stats.processedCount} style={{ marginLeft: 8 }} color="#52c41a" /></span>} key="processed" />
         </Tabs>
 
         {/* 筛选栏 */}
         <Space style={{ marginBottom: 16 }} wrap>
-          <RangePicker style={{ width: 240 }} />
+          <RangePicker
+            locale={zhCN}
+            style={{ width: 240 }}
+            value={dateRange as any}
+            onChange={(dates) => {
+              setDateRange(dates as [dayjs.Dayjs, dayjs.Dayjs] | null);
+              setCurrentPage(1);
+            }}
+            placeholder={['开始日期', '结束日期']}
+          />
           <Select
-            placeholder="预警级别"
-            style={{ width: 120 }}
+            placeholder="预警类型"
+            style={{ width: 130 }}
             allowClear
-            value={filterLevel || undefined}
-            onChange={setFilterLevel}
+            value={filterType || undefined}
+            onChange={(val) => { setFilterType(val || ''); setCurrentPage(1); }}
           >
-            <Option value="1">提示</Option>
-            <Option value="2">警告</Option>
-            <Option value="3">严重</Option>
+            <Option value="01">费用超支</Option>
+            <Option value="02">低倍率</Option>
+            <Option value="03">高倍率</Option>
+            <Option value="04">编码异常</Option>
+            <Option value="05">分解住院</Option>
           </Select>
           <Select
-            placeholder="科室"
-            style={{ width: 140 }}
+            placeholder="预警级别"
+            style={{ width: 120 }}
             allowClear
-            value={filterDept || undefined}
-            onChange={setFilterDept}
+            value={filterLevel || undefined}
+            onChange={(val) => { setFilterLevel(val || ''); setCurrentPage(1); }}
           >
-            <Option value="心内科">心内科</Option>
-            <Option value="骨科">骨科</Option>
-            <Option value="呼吸内科">呼吸内科</Option>
-            <Option value="普外科">普外科</Option>
-            <Option value="神经内科">神经内科</Option>
+            <Option value="1">低</Option>
+            <Option value="2">中</Option>
+            <Option value="3">高</Option>
           </Select>
-          <Button type="primary">查询</Button>
-          <Button>重置</Button>
+          <Button type="primary" icon={<ReloadOutlined />} onClick={loadData}>
+            查询
+          </Button>
+          <Button onClick={handleReset}>重置</Button>
         </Space>
 
-        {stats.highRisk > 0 && (
+        {highRiskCount > 0 && (
           <Alert
-            message={`当前有 ${stats.highRisk} 条严重预警需要紧急处理`}
+            message={`当前有 ${highRiskCount} 条高级别预警需要紧急处理`}
             type="error"
             showIcon
             style={{ marginBottom: 16 }}
@@ -479,36 +599,45 @@ const Center: React.FC = () => {
 
         <Table
           columns={columns}
-          dataSource={getFilteredData()}
+          dataSource={data}
           rowKey="id"
           loading={loading}
-          scroll={{ x: 1200, y: 'calc(100vh - 450px)' }}
+          scroll={{ x: 1500, y: 'calc(100vh - 480px)' }}
           pagination={false}
         />
         <div style={{ marginTop: 12, display: 'flex', justifyContent: 'flex-end' }}>
           <CustomPagination
-            current={1}
-            pageSize={10}
-            total={getFilteredData().length}
-            onChange={() => {}}
+            current={currentPage}
+            pageSize={pageSize}
+            total={total}
+            onChange={(page: number, size: number) => {
+              setCurrentPage(page);
+              setPageSize(size || pageSize);
+            }}
           />
         </div>
       </Card>
 
       {/* 处理弹窗 */}
       <Modal
-        title={currentRecord?.processStatus === '已处理' ? '处理预警' : '忽略预警'}
+        title={processType === 'processed' ? '确认预警' : '忽略预警'}
         open={processModalVisible}
         onOk={submitProcess}
         onCancel={() => setProcessModalVisible(false)}
         okText="确定"
         cancelText="取消"
         width={500}
+        confirmLoading={processing}
       >
+        <div style={{ marginBottom: 16 }}>
+          <Text strong>预警流水号:</Text>{currentRecord?.warningNo}<br />
+          <Text strong>患者:</Text>{currentRecord?.patientName} &nbsp;|&nbsp;
+          <Text strong>规则:</Text>{currentRecord?.ruleName}
+        </div>
         <Form form={form} layout="vertical">
-          <Form.Item label="处理方式" name="processStatus">
-            <Tag color={currentRecord?.processStatus === '已处理' ? 'success' : 'warning'}>
-              {currentRecord?.processStatus === '已处理' ? '标记为已处理' : '标记为已忽略'}
+          <Form.Item label="处理方式" name="processType">
+            <Tag color={processType === 'processed' ? 'processing' : 'warning'}>
+              {processType === 'processed' ? '标记为已确认' : '标记为已忽略'}
             </Tag>
           </Form.Item>
           <Form.Item

+ 344 - 400
src/pages/Warning/Records.tsx

@@ -1,4 +1,4 @@
-import React, { useState } from 'react';
+import React, { useState, useEffect } from 'react';
 import {
   Card,
   Table,
@@ -13,9 +13,7 @@ import {
   Input,
   Modal,
   Descriptions,
-  Badge,
   Statistic,
-  Tooltip,
   message,
 } from 'antd';
 import {
@@ -23,361 +21,251 @@ import {
   ReloadOutlined,
   DownloadOutlined,
   EyeOutlined,
-  FileExcelOutlined,
   HistoryOutlined,
   CheckCircleOutlined,
   CloseCircleOutlined,
   ExclamationCircleOutlined,
+  RiseOutlined,
+  DollarOutlined,
 } from '@ant-design/icons';
 import CustomPagination from '../../components/CustomPagination';
 import type { ColumnsType } from 'antd/es/table';
+import type { WarningRecord } from '@/api/warning';
+import { queryWarningRecords } from '@/api/warning';
 import dayjs from 'dayjs';
+import zhCN from 'antd/es/date-picker/locale/zh_CN';
 
-const { Title, Text } = Typography;
+const { Text } = Typography;
 const { RangePicker } = DatePicker;
 const { Option } = Select;
 
-// 预警级别
-const WARNING_LEVELS = {
-  1: { text: '提示', color: 'green', tagColor: 'success' },
-  2: { text: '警告', color: 'orange', tagColor: 'warning' },
-  3: { text: '严重', color: 'red', tagColor: 'error' },
+// 预警级别映射
+const WARNING_LEVELS: Record<number, { text: string; tagColor: string }> = {
+  1: { text: '', tagColor: 'success' },
+  2: { text: '', tagColor: 'warning' },
+  3: { text: '', tagColor: 'error' },
 };
 
-// 处理状态
-const PROCESS_STATUS = {
-  '待处理': { text: '待处理', color: 'default' },
-  '已处理': { text: '已处理', color: 'success' },
-  '已忽略': { text: '已忽略', color: 'warning' },
+// 预警状态映射
+const WARNING_STATUS: Record<string, { text: string; color: string }> = {
+  '01': { text: '待处理', color: 'default' },
+  '02': { text: '已确认', color: 'processing' },
+  '03': { text: '已忽略', color: 'warning' },
+  '04': { text: '已申诉', color: 'purple' },
+  '05': { text: '已解决', color: 'success' },
 };
 
-// 规则类型
-const RULE_TYPES = {
+// 预警类型映射
+const WARNING_TYPES: Record<string, string> = {
   '01': '费用超支',
   '02': '低倍率',
   '03': '高倍率',
   '04': '编码异常',
   '05': '分解住院',
-  '06': '费用过低',
 };
 
-interface WarningRecord {
-  id: string;
-  admissionNo: string;
-  patientName: string;
-  patientGender: string;
-  patientAge: number;
-  ruleCode: string;
-  ruleName: string;
-  ruleType: string;
-  warningLevel: 1 | 2 | 3;
-  totalCost: number;
-  drgPayment: number;
-  balanceAmount: number;
-  balancePercent: number;
-  drgCode: string;
-  drgName: string;
-  deptCode: string;
-  deptName: string;
-  doctorName: string;
-  admissionDate: string;
-  dischargeDate: string;
-  warningDate: string;
-  processStatus: '待处理' | '已处理' | '已忽略';
-  processUser?: string;
-  processDate?: string;
-  processRemarks?: string;
+interface StatsData {
+  totalCount: number;
+  pendingCount: number;
+  processedCount: number;
+  totalDiff?: number;
+  totalProfit?: number;
+  totalPayStandard?: number;
 }
 
-// 模拟数据
-const mockRecords: WarningRecord[] = [
-  {
-    id: '1',
-    admissionNo: '20240001',
-    patientName: '张三',
-    patientGender: '男',
-    patientAge: 65,
-    ruleCode: 'WR001',
-    ruleName: '费用超支预警(严重)',
-    ruleType: '01',
-    warningLevel: 3,
-    totalCost: 15800,
-    drgPayment: 12000,
-    balanceAmount: -3800,
-    balancePercent: -31.67,
-    drgCode: 'ES23',
-    drgName: '呼吸系统肿瘤',
-    deptCode: '001',
-    deptName: '心内科',
-    doctorName: '王医生',
-    admissionDate: '2026-03-15',
-    dischargeDate: '2026-03-28',
-    warningDate: '2026-03-28 14:30:00',
-    processStatus: '已处理',
-    processUser: '李主任',
-    processDate: '2026-03-28 16:00:00',
-    processRemarks: '患者病情复杂,使用高价药品,费用合理',
-  },
-  {
-    id: '2',
-    admissionNo: '20240002',
-    patientName: '李四',
-    patientGender: '女',
-    patientAge: 58,
-    ruleCode: 'WR003',
-    ruleName: '高倍率预警',
-    ruleType: '03',
-    warningLevel: 2,
-    totalCost: 25000,
-    drgPayment: 18000,
-    balanceAmount: -7000,
-    balancePercent: -38.89,
-    drgCode: 'IC13',
-    drgName: '关节置换',
-    deptCode: '002',
-    deptName: '骨科',
-    doctorName: '张医生',
-    admissionDate: '2026-03-10',
-    dischargeDate: '2026-03-27',
-    warningDate: '2026-03-28 10:15:00',
-    processStatus: '已处理',
-    processUser: '刘主任',
-    processDate: '2026-03-28 14:30:00',
-    processRemarks: '手术中使用进口耗材,已核实',
-  },
-  {
-    id: '3',
-    admissionNo: '20240003',
-    patientName: '王五',
-    patientGender: '男',
-    patientAge: 72,
-    ruleCode: 'WR002',
-    ruleName: '费用超支预警(警告)',
-    ruleType: '01',
-    warningLevel: 2,
-    totalCost: 18500,
-    drgPayment: 15000,
-    balanceAmount: -3500,
-    balancePercent: -23.33,
-    drgCode: 'FB23',
-    drgName: '心脏介入治疗',
-    deptCode: '001',
-    deptName: '心内科',
-    doctorName: '陈医生',
-    admissionDate: '2026-03-12',
-    dischargeDate: '2026-03-26',
-    warningDate: '2026-03-26 09:00:00',
-    processStatus: '已忽略',
-    processUser: '赵医生',
-    processDate: '2026-03-26 11:00:00',
-    processRemarks: '患者合并多种基础疾病,费用在合理范围',
-  },
-  {
-    id: '4',
-    admissionNo: '20240004',
-    patientName: '赵六',
-    patientGender: '女',
-    patientAge: 45,
-    ruleCode: 'WR004',
-    ruleName: '低倍率预警',
-    ruleType: '02',
-    warningLevel: 1,
-    totalCost: 4500,
-    drgPayment: 8000,
-    balanceAmount: 3500,
-    balancePercent: 43.75,
-    drgCode: 'GC13',
-    drgName: '消化系统其他手术',
-    deptCode: '003',
-    deptName: '普外科',
-    doctorName: '孙医生',
-    admissionDate: '2026-03-20',
-    dischargeDate: '2026-03-25',
-    warningDate: '2026-03-25 16:00:00',
-    processStatus: '已处理',
-    processUser: '钱主任',
-    processDate: '2026-03-25 17:30:00',
-    processRemarks: '患者恢复良好提前出院',
-  },
-  {
-    id: '5',
-    admissionNo: '20240005',
-    patientName: '钱七',
-    patientGender: '男',
-    patientAge: 60,
-    ruleCode: 'WR005',
-    ruleName: '编码异常预警',
-    ruleType: '04',
-    warningLevel: 2,
-    totalCost: 12000,
-    drgPayment: 12000,
-    balanceAmount: 0,
-    balancePercent: 0,
-    drgCode: 'BR23',
-    drgName: '神经系统肿瘤',
-    deptCode: '004',
-    deptName: '神经内科',
-    doctorName: '周医生',
-    admissionDate: '2026-03-18',
-    dischargeDate: '2026-03-27',
-    warningDate: '2026-03-27 11:20:00',
-    processStatus: '待处理',
-  },
-  {
-    id: '6',
-    admissionNo: '20240006',
-    patientName: '孙八',
-    patientGender: '女',
-    patientAge: 55,
-    ruleCode: 'WR001',
-    ruleName: '费用超支预警(严重)',
-    ruleType: '01',
-    warningLevel: 3,
-    totalCost: 32000,
-    drgPayment: 22000,
-    balanceAmount: -10000,
-    balancePercent: -45.45,
-    drgCode: 'IC13',
-    drgName: '关节置换',
-    deptCode: '002',
-    deptName: '骨科',
-    doctorName: '吴医生',
-    admissionDate: '2026-03-08',
-    dischargeDate: '2026-03-27',
-    warningDate: '2026-03-27 15:00:00',
-    processStatus: '已处理',
-    processUser: '郑主任',
-    processDate: '2026-03-27 16:30:00',
-    processRemarks: '术后感染需长期抗感染治疗,费用合理',
-  },
-];
+/** 格式化预警日期(兼容时间戳和字符串) */
+const fmtDate = (val: any): string => {
+  if (!val && val !== 0) return '-';
+  const n = Number(val);
+  if (!isNaN(n) && n > 100000000) return dayjs(n).format('YYYY-MM-DD');
+  return String(val);
+};
 
 const Records: React.FC = () => {
-  const [data, setData] = useState<WarningRecord[]>(mockRecords);
+  const [data, setData] = useState<WarningRecord[]>([]);
   const [loading, setLoading] = useState(false);
   const [detailVisible, setDetailVisible] = useState(false);
   const [currentRecord, setCurrentRecord] = useState<WarningRecord | null>(null);
-  
+  const [stats, setStats] = useState<StatsData>({
+    totalCount: 0,
+    pendingCount: 0,
+    processedCount: 0,
+    totalDiff: 0,
+    totalProfit: 0,
+    totalPayStandard: 0,
+  });
+
   // 筛选条件
   const [filterStatus, setFilterStatus] = useState<string>('');
   const [filterLevel, setFilterLevel] = useState<string>('');
-  const [filterDept, setFilterDept] = useState<string>('');
-  const [filterRuleType, setFilterRuleType] = useState<string>('');
-  const [filterAdmissionNo, setFilterAdmissionNo] = useState<string>('');
-
-  // 统计数据
-  const stats = {
-    total: data.length,
-    processed: data.filter(d => d.processStatus === '已处理').length,
-    ignored: data.filter(d => d.processStatus === '已忽略').length,
-    pending: data.filter(d => d.processStatus === '待处理').length,
-    totalBalance: data.reduce((sum, d) => sum + d.balanceAmount, 0),
-  };
+  const [filterType, setFilterType] = useState<string>('');
+  const [filterKeyword, setFilterKeyword] = useState<string>('');
+  const [dateRange, setDateRange] = useState<[dayjs.Dayjs, dayjs.Dayjs] | null>(null);
 
-  // 筛选数据
-  const getFilteredData = () => {
-    let filtered = [...data];
-    
-    if (filterStatus) {
-      filtered = filtered.filter(d => d.processStatus === filterStatus);
-    }
-    if (filterLevel) {
-      filtered = filtered.filter(d => d.warningLevel === parseInt(filterLevel));
-    }
-    if (filterDept) {
-      filtered = filtered.filter(d => d.deptName === filterDept);
-    }
-    if (filterRuleType) {
-      filtered = filtered.filter(d => d.ruleType === filterRuleType);
-    }
-    if (filterAdmissionNo) {
-      filtered = filtered.filter(d => d.admissionNo.includes(filterAdmissionNo) || d.patientName.includes(filterAdmissionNo));
+  // 分页
+  const [currentPage, setCurrentPage] = useState(1);
+  const [pageSize, setPageSize] = useState(10);
+  const [total, setTotal] = useState(0);
+
+  // 加载全部数据(统计+记录)
+  const loadData = async () => {
+    setLoading(true);
+    try {
+      // 一次性获取全部记录(用于统计计算和表格展示)
+      const res: any = await queryWarningRecords(
+        {
+          warningStatus: filterStatus || undefined,
+          warningType: filterType || undefined,
+          patientName: filterKeyword || undefined,
+          hisAdmId: filterKeyword || undefined,
+          startDate: dateRange?.[0]?.format('YYYY-MM-DD') || '',
+          endDate: dateRange?.[1]?.format('YYYY-MM-DD') || '',
+        },
+        { pageSize: 99999, currentPage: 1 }
+      );
+      console.log('[Records] records response:', res);
+
+      if (res.errorCode === '0' || res.errorCode === 0) {
+        let allRows: WarningRecord[] = (res.result.rows || []).map((item: any) => ({
+          ...item,
+          id: String(item.id || ''),
+        }));
+        if (filterLevel) {
+          allRows = allRows.filter(r => Number(r.warningLevel) === Number(filterLevel));
+        }
+
+        // ====== 本地计算精确统计 ======
+        const pendingCount = allRows.filter(r => r.warningStatus === '01').length;
+        const processedAll = allRows.filter(r => r.warningStatus !== '01').length;
+        const totalDiff = allRows.reduce((sum, r) => sum + (Number(r.diffAmount) || 0), 0);
+        const totalProfit = allRows.reduce((sum, r) => {
+          const d = Number(r.diffAmount) || 0;
+          return sum + (d > 0 ? d : 0);
+        }, 0);
+        const totalPayStandard = allRows.reduce((sum, r) => sum + (Number(r.drgPayStandard) || 0), 0);
+
+        setStats({
+          totalCount: allRows.length,
+          pendingCount,
+          processedCount: processedAll,
+          totalDiff,
+          totalProfit,
+          totalPayStandard,
+        });
+
+        // ====== 前端分页展示 ======
+        setTotal(allRows.length);
+        const start = (currentPage - 1) * pageSize;
+        const paged = allRows.slice(start, start + pageSize);
+        setData(paged);
+      } else {
+        console.warn('[Records] records API error:', res.errorCode, res.errorMessage);
+      }
+    } catch (error) {
+      console.error('[Records] 查询预警记录失败:', error);
+    } finally {
+      setLoading(false);
     }
-    
-    return filtered;
   };
 
+  // 当筛选条件变化时自动重新加载
+  useEffect(() => {
+    loadData();
+  }, [filterStatus, filterType, filterKeyword, filterLevel, dateRange, pageSize, currentPage]);
+
   // 查看详情
   const handleView = (record: WarningRecord) => {
     setCurrentRecord(record);
     setDetailVisible(true);
   };
 
+  // 执行查询
+  const handleSearch = () => {
+    setCurrentPage(1);
+    loadData();
+  };
+
   // 导出数据
   const handleExport = () => {
-    message.success('数据导出成功');
+    message.success('数据导出功能开发中...');
   };
 
   // 重置筛选
   const handleReset = () => {
     setFilterStatus('');
     setFilterLevel('');
-    setFilterDept('');
-    setFilterRuleType('');
-    setFilterAdmissionNo('');
+    setFilterType('');
+    setFilterKeyword('');
+    setDateRange(null);
+    setCurrentPage(1);
     message.success('筛选条件已重置');
   };
 
   const columns: ColumnsType<WarningRecord> = [
     {
       title: '预警时间',
-      dataIndex: 'warningDate',
-      key: 'warningDate',
-      width: 160,
-      sorter: (a, b) => new Date(a.warningDate).getTime() - new Date(b.warningDate).getTime(),
+      dataIndex: 'warningDateTime',
+      key: 'warningDateTime',
+      width: 110,
+      sorter: (a, b) => (a.warningDate || '').localeCompare(b.warningDate || ''),
+      render: (val: string, record) => (
+        <span>{val || `${fmtDate(record.warningDate)} ${record.warningTime || ''}`}</span>
+      ),
     },
     {
       title: '级别',
       dataIndex: 'warningLevel',
       key: 'warningLevel',
-      width: 80,
-      render: (level: 1 | 2 | 3) => (
-        <Tag color={WARNING_LEVELS[level].tagColor}>
-          {WARNING_LEVELS[level].text}
+      width: 65,
+      render: (level: number) => (
+        <Tag color={WARNING_LEVELS[level]?.tagColor}>
+          {WARNING_LEVELS[level]?.text || level}
         </Tag>
       ),
     },
     {
-      title: '住院号',
-      dataIndex: 'admissionNo',
-      key: 'admissionNo',
+      title: '就诊ID',
+      dataIndex: 'hisAdmId',
+      key: 'hisAdmId',
       width: 100,
     },
     {
-      title: '患者信息',
-      key: 'patient',
-      width: 120,
-      render: (_, record) => (
-        <div>
-          <div>{record.patientName}</div>
-          <Text type="secondary" style={{ fontSize: 12 }}>
-            {record.patientGender} / {record.patientAge}岁
-          </Text>
-        </div>
-      ),
+      title: '患者姓名',
+      dataIndex: 'patientName',
+      key: 'patientName',
+      width: 90,
     },
     {
       title: '科室/医生',
       key: 'dept',
-      width: 140,
+      width: 130,
       render: (_, record) => (
         <div>
-          <div>{record.deptName}</div>
+          <div>{record.deptName || '-'}</div>
           <Text type="secondary" style={{ fontSize: 12 }}>
-            {record.doctorName}
+            {record.doctorName || '-'}
           </Text>
         </div>
       ),
     },
+    {
+      title: '预警类型',
+      dataIndex: 'warningType',
+      key: 'warningType',
+      width: 100,
+      render: (type: string) => (
+        <Tag>{WARNING_TYPES[type] || type}</Tag>
+      ),
+    },
     {
       title: '预警规则',
       key: 'rule',
-      width: 180,
+      width: 170,
       render: (_, record) => (
         <div>
           <div>{record.ruleName}</div>
           <Text type="secondary" style={{ fontSize: 12 }}>
-            {RULE_TYPES[record.ruleType]}
+            {record.ruleCode}
           </Text>
         </div>
       ),
@@ -385,12 +273,12 @@ const Records: React.FC = () => {
     {
       title: 'DRG信息',
       key: 'drg',
-      width: 140,
+      width: 130,
       render: (_, record) => (
         <div>
           <div>{record.drgCode}</div>
           <Text type="secondary" style={{ fontSize: 12 }}>
-            {record.drgName}
+            {record.drgName || '-'}
           </Text>
         </div>
       ),
@@ -398,13 +286,13 @@ const Records: React.FC = () => {
     {
       title: '费用/标准',
       key: 'cost',
-      width: 160,
+      width: 150,
       align: 'right',
       render: (_, record) => (
         <div>
-          <div>¥{record.totalCost.toLocaleString()}</div>
+          <div>¥{(record.totalFee || 0).toLocaleString()}</div>
           <Text type="secondary" style={{ fontSize: 12 }}>
-            标准: ¥{record.drgPayment.toLocaleString()}
+            标准: ¥{(record.drgPayStandard || 0).toLocaleString()}
           </Text>
         </div>
       ),
@@ -412,29 +300,33 @@ const Records: React.FC = () => {
     {
       title: '超支/结余',
       key: 'balance',
-      width: 140,
+      width: 130,
       align: 'right',
-      render: (_, record) => (
-        <div>
-          <Text type={record.balanceAmount < 0 ? 'danger' : 'success'} strong>
-            ¥{record.balanceAmount.toLocaleString()}
-          </Text>
+      render: (_, record) => {
+        const diff = record.diffAmount || 0;
+        const diffRate = record.diffRate || 0;
+        return (
           <div>
-            <Text type={record.balancePercent < 0 ? 'danger' : 'success'} style={{ fontSize: 12 }}>
-              {record.balancePercent > 0 ? '+' : ''}{record.balancePercent}%
+            <Text type={diff < 0 ? 'danger' : 'success'} strong>
+              ¥{diff.toLocaleString()}
             </Text>
+            <div>
+              <Text type={diffRate < 0 ? 'danger' : 'success'} style={{ fontSize: 12 }}>
+                {diffRate > 0 ? '+' : ''}{diffRate}%
+              </Text>
+            </div>
           </div>
-        </div>
-      ),
+        );
+      },
     },
     {
       title: '状态',
-      dataIndex: 'processStatus',
-      key: 'processStatus',
-      width: 100,
+      dataIndex: 'warningStatus',
+      key: 'warningStatus',
+      width: 90,
       render: (status: string) => (
-        <Tag color={PROCESS_STATUS[status].color}>
-          {PROCESS_STATUS[status].text}
+        <Tag color={WARNING_STATUS[status]?.color || 'default'}>
+          {WARNING_STATUS[status]?.text || status}
         </Tag>
       ),
     },
@@ -442,14 +334,14 @@ const Records: React.FC = () => {
       title: '处理人',
       dataIndex: 'processUser',
       key: 'processUser',
-      width: 100,
+      width: 90,
       render: (user: string) => user || '-',
     },
     {
       title: '操作',
       key: 'action',
       fixed: 'right',
-      width: 100,
+      width: 80,
       render: (_, record) => (
         <Button
           type="link"
@@ -467,44 +359,69 @@ const Records: React.FC = () => {
     <div style={{ padding: 16, height: '100%', display: 'flex', flexDirection: 'column' }}>
       {/* 统计卡片 */}
       <Row gutter={[16, 16]} style={{ marginBottom: 16 }}>
-        <Col xs={24} sm={12} md={6}>
+        <Col xs={24} sm={12} md={8} lg={4}>
           <Card size="small">
             <Statistic
               title="总记录数"
-              value={stats.total}
+              value={stats.totalCount}
               prefix={<HistoryOutlined />}
               valueStyle={{ color: '#1890ff' }}
             />
           </Card>
         </Col>
-        <Col xs={24} sm={12} md={6}>
+        <Col xs={24} sm={12} md={8} lg={4}>
+          <Card size="small">
+            <Statistic
+              title="待处理"
+              value={stats.pendingCount}
+              prefix={<ExclamationCircleOutlined />}
+              valueStyle={{ color: '#faad14' }}
+            />
+          </Card>
+        </Col>
+        <Col xs={24} sm={12} md={8} lg={4}>
           <Card size="small">
             <Statistic
               title="已处理"
-              value={stats.processed}
+              value={stats.processedCount}
               prefix={<CheckCircleOutlined />}
               valueStyle={{ color: '#52c41a' }}
             />
           </Card>
         </Col>
-        <Col xs={24} sm={12} md={6}>
+        <Col xs={24} sm={12} md={8} lg={4}>
           <Card size="small">
             <Statistic
-              title="已忽略"
-              value={stats.ignored}
-              prefix={<CloseCircleOutlined />}
-              valueStyle={{ color: '#faad14' }}
+              title="总结余金额"
+              value={stats.totalProfit || 0}
+              precision={2}
+              prefix={<RiseOutlined />}
+              suffix="元"
+              valueStyle={{ color: '#52c41a' }}
+            />
+          </Card>
+        </Col>
+        <Col xs={24} sm={12} md={8} lg={4}>
+          <Card size="small">
+            <Statistic
+              title="总标准费用"
+              value={stats.totalPayStandard || 0}
+              precision={2}
+              prefix={<DollarOutlined />}
+              suffix="元"
+              valueStyle={{ color: '#1890ff' }}
             />
           </Card>
         </Col>
-        <Col xs={24} sm={12} md={6}>
+        <Col xs={24} sm={12} md={8} lg={4}>
           <Card size="small">
             <Statistic
               title="总超支金额"
-              value={Math.abs(stats.totalBalance)}
-              prefix={<ExclamationCircleOutlined />}
+              value={Math.abs(stats.totalDiff || 0)}
+              precision={2}
+              prefix={<CloseCircleOutlined />}
               suffix="元"
-              valueStyle={{ color: stats.totalBalance < 0 ? '#ff4d4f' : '#52c41a' }}
+              valueStyle={{ color: (stats.totalDiff || 0) < 0 ? '#ff4d4f' : '#52c41a' }}
             />
           </Card>
         </Col>
@@ -532,15 +449,21 @@ const Records: React.FC = () => {
         <Row gutter={[16, 16]} style={{ marginBottom: 16 }}>
           <Col xs={24} sm={12} md={6} lg={4}>
             <Input
-              placeholder="住院号/患者姓名"
+              placeholder="就诊ID/患者姓名"
               prefix={<SearchOutlined />}
-              value={filterAdmissionNo}
-              onChange={(e) => setFilterAdmissionNo(e.target.value)}
+              value={filterKeyword}
+              onChange={(e) => setFilterKeyword(e.target.value)}
               allowClear
             />
           </Col>
           <Col xs={24} sm={12} md={6} lg={4}>
-            <RangePicker style={{ width: '100%' }} placeholder={['开始日期', '结束日期']} />
+            <RangePicker
+              locale={zhCN}
+              style={{ width: '100%' }}
+              value={dateRange as any}
+              onChange={(dates) => setDateRange(dates as [dayjs.Dayjs, dayjs.Dayjs] | null)}
+              placeholder={['开始日期', '结束日期']}
+            />
           </Col>
           <Col xs={24} sm={12} md={6} lg={3}>
             <Select
@@ -550,9 +473,11 @@ const Records: React.FC = () => {
               value={filterStatus || undefined}
               onChange={setFilterStatus}
             >
-              <Option value="待处理">待处理</Option>
-              <Option value="已处理">已处理</Option>
-              <Option value="已忽略">已忽略</Option>
+              <Option value="01">待处理</Option>
+              <Option value="02">已确认</Option>
+              <Option value="03">已忽略</Option>
+              <Option value="04">已申诉</Option>
+              <Option value="05">已解决</Option>
             </Select>
           </Col>
           <Col xs={24} sm={12} md={6} lg={3}>
@@ -563,44 +488,29 @@ const Records: React.FC = () => {
               value={filterLevel || undefined}
               onChange={setFilterLevel}
             >
-              <Option value="1">提示</Option>
-              <Option value="2">警告</Option>
-              <Option value="3">严重</Option>
-            </Select>
-          </Col>
-          <Col xs={24} sm={12} md={6} lg={3}>
-            <Select
-              placeholder="科室"
-              style={{ width: '100%' }}
-              allowClear
-              value={filterDept || undefined}
-              onChange={setFilterDept}
-            >
-              <Option value="心内科">心内科</Option>
-              <Option value="骨科">骨科</Option>
-              <Option value="普外科">普外科</Option>
-              <Option value="神经内科">神经内科</Option>
+              <Option value="1">低</Option>
+              <Option value="2">中</Option>
+              <Option value="3">高</Option>
             </Select>
           </Col>
           <Col xs={24} sm={12} md={6} lg={3}>
             <Select
-              placeholder="规则类型"
+              placeholder="预警类型"
               style={{ width: '100%' }}
               allowClear
-              value={filterRuleType || undefined}
-              onChange={setFilterRuleType}
+              value={filterType || undefined}
+              onChange={setFilterType}
             >
               <Option value="01">费用超支</Option>
               <Option value="02">低倍率</Option>
               <Option value="03">高倍率</Option>
               <Option value="04">编码异常</Option>
               <Option value="05">分解住院</Option>
-              <Option value="06">费用过低</Option>
             </Select>
           </Col>
           <Col xs={24} sm={12} md={12} lg={4}>
             <Space>
-              <Button type="primary" icon={<SearchOutlined />}>查询</Button>
+              <Button type="primary" icon={<SearchOutlined />} onClick={handleSearch}>查询</Button>
               <Button icon={<ReloadOutlined />} onClick={handleReset}>重置</Button>
             </Space>
           </Col>
@@ -608,7 +518,7 @@ const Records: React.FC = () => {
 
         <Table
           columns={columns}
-          dataSource={getFilteredData()}
+          dataSource={data}
           rowKey="id"
           loading={loading}
           scroll={{ x: 1600, y: 'calc(100vh - 400px)' }}
@@ -616,15 +526,18 @@ const Records: React.FC = () => {
         />
         <div style={{ marginTop: 12, display: 'flex', justifyContent: 'flex-end' }}>
           <CustomPagination
-            current={1}
-            pageSize={10}
-            total={getFilteredData().length}
-            onChange={() => {}}
+            current={currentPage}
+            pageSize={pageSize}
+            total={total}
+            onChange={(page: number, size: number) => {
+              setCurrentPage(page);
+              setPageSize(size || pageSize);
+            }}
           />
         </div>
       </Card>
 
-      {/* 详情弹窗 */}
+      {/* 详情弹窗 - 展示BS_DRGWarningRecord表全部字段 */}
       <Modal
         title="预警处理详情"
         open={detailVisible}
@@ -634,81 +547,112 @@ const Records: React.FC = () => {
             关闭
           </Button>,
         ]}
-        width={800}
+        width={850}
       >
         {currentRecord && (
           <div>
-            <Row gutter={[16, 16]}>
-              <Col span={24} style={{ textAlign: 'center', marginBottom: 16 }}>
-                <Badge
-                  count={WARNING_LEVELS[currentRecord.warningLevel].text}
-                  style={{
-                    backgroundColor:
-                      currentRecord.warningLevel === 3 ? '#ff4d4f' :
-                      currentRecord.warningLevel === 2 ? '#faad14' : '#52c41a',
-                    fontSize: 14,
-                    padding: '0 12px',
-                    height: 28,
-                    lineHeight: '28px',
-                  }}
-                />
-                <Title level={4} style={{ marginTop: 16, marginBottom: 0 }}>
+            {/* 标题区域 */}
+            <div style={{ textAlign: 'center', marginBottom: 16 }}>
+              <ExclamationCircleOutlined
+                style={{
+                  fontSize: 36,
+                  color: currentRecord.warningLevel === 3 ? '#ff4d4f' :
+                         currentRecord.warningLevel === 2 ? '#faad14' : '#52c41a',
+                }}
+              />
+              <div style={{ marginTop: 8 }}>
+                <Tag color={WARNING_LEVELS[currentRecord.warningLevel]?.tagColor}>
+                  {WARNING_LEVELS[currentRecord.warningLevel]?.text}级别
+                </Tag>
+                <Text strong style={{ fontSize: 16, display: 'block', marginTop: 8 }}>
                   {currentRecord.ruleName}
-                </Title>
-              </Col>
-            </Row>
-
-            <Descriptions title="患者信息" bordered column={3} size="small">
-              <Descriptions.Item label="住院号">{currentRecord.admissionNo}</Descriptions.Item>
-              <Descriptions.Item label="姓名">{currentRecord.patientName}</Descriptions.Item>
-              <Descriptions.Item label="性别">{currentRecord.patientGender}</Descriptions.Item>
-              <Descriptions.Item label="年龄">{currentRecord.patientAge}岁</Descriptions.Item>
-              <Descriptions.Item label="入院日期">{currentRecord.admissionDate}</Descriptions.Item>
-              <Descriptions.Item label="出院日期">{currentRecord.dischargeDate}</Descriptions.Item>
+                </Text>
+              </div>
+            </div>
+
+            {/* 预警标识信息 */}
+            <Descriptions title="预警标识" bordered column={2} size="small">
+              <Descriptions.Item label="预警流水号">{currentRecord.warningNo}</Descriptions.Item>
+              <Descriptions.Item label="关联规则编码">{currentRecord.ruleCode}</Descriptions.Item>
+              <Descriptions.Item label="预警类型">
+                <Tag>{WARNING_TYPES[currentRecord.warningType] || currentRecord.warningType}</Tag>
+              </Descriptions.Item>
+              <Descriptions.Item label="预警级别">
+                <Tag color={WARNING_LEVELS[currentRecord.warningLevel]?.tagColor}>
+                  {WARNING_LEVELS[currentRecord.warningLevel]?.text || currentRecord.warningLevel}
+                </Tag>
+              </Descriptions.Item>
+              <Descriptions.Item label="预警状态">
+                <Tag color={WARNING_STATUS[currentRecord.warningStatus]?.color}>
+                  {WARNING_STATUS[currentRecord.warningStatus]?.text || currentRecord.warningStatus}
+                </Tag>
+              </Descriptions.Item>
+              <Descriptions.Item label="预警时间">{currentRecord.warningDateTime || `${fmtDate(currentRecord.warningDate)} ${currentRecord.warningTime || ''}`}</Descriptions.Item>
+            </Descriptions>
+
+            {/* 病案与患者信息 */}
+            <Descriptions title="患者信息" bordered column={3} size="small" style={{ marginTop: 16 }}>
+              <Descriptions.Item label="就诊ID">{currentRecord.hisAdmId}</Descriptions.Item>
+              <Descriptions.Item label="患者姓名">{currentRecord.patientName}</Descriptions.Item>
+              <Descriptions.Item label="病案ID">{currentRecord.medicalRecordDr || '-'}</Descriptions.Item>
             </Descriptions>
 
-            <Descriptions title="DRG信息" bordered column={3} size="small" style={{ marginTop: 16 }}>
+            {/* 科室与医生信息 */}
+            <Descriptions title="科室医生" bordered column={2} size="small" style={{ marginTop: 16 }}>
+              <Descriptions.Item label="科室">{currentRecord.deptName || '-'}({currentRecord.deptCode || '-'})</Descriptions.Item>
+              <Descriptions.Item label="医生">{currentRecord.doctorName || '-'}({currentRecord.doctorCode || '-'})</Descriptions.Item>
+            </Descriptions>
+
+            {/* DRG分组信息 */}
+            <Descriptions title="DRG分组" bordered column={2} size="small" style={{ marginTop: 16 }}>
               <Descriptions.Item label="DRG编码">{currentRecord.drgCode}</Descriptions.Item>
-              <Descriptions.Item label="DRG名称" span={2}>{currentRecord.drgName}</Descriptions.Item>
-              <Descriptions.Item label="科室">{currentRecord.deptName}</Descriptions.Item>
-              <Descriptions.Item label="主管医生" span={2}>{currentRecord.doctorName}</Descriptions.Item>
+              <Descriptions.Item label="DRG名称">{currentRecord.drgName || '-'}</Descriptions.Item>
             </Descriptions>
 
+            {/* 费用信息 */}
             <Descriptions title="费用信息" bordered column={3} size="small" style={{ marginTop: 16 }}>
-              <Descriptions.Item label="费用总额">¥{currentRecord.totalCost.toLocaleString()}</Descriptions.Item>
-              <Descriptions.Item label="DRG支付标准">¥{currentRecord.drgPayment.toLocaleString()}</Descriptions.Item>
-              <Descriptions.Item label="超支/结余">
-                <Text type={currentRecord.balanceAmount < 0 ? 'danger' : 'success'} strong>
-                  ¥{currentRecord.balanceAmount.toLocaleString()} ({currentRecord.balancePercent}%)
+              <Descriptions.Item label="医疗总费用">¥{(currentRecord.totalFee || 0).toLocaleString()}</Descriptions.Item>
+              <Descriptions.Item label="医保结算费用">¥{(currentRecord.insuranceFee || 0).toLocaleString()}</Descriptions.Item>
+              <Descriptions.Item label="DRG支付标准">¥{(currentRecord.drgPayStandard || 0).toLocaleString()}</Descriptions.Item>
+              <Descriptions.Item label="费用差异">
+                <Text type={(currentRecord.diffAmount || 0) < 0 ? 'danger' : 'success'} strong>
+                  ¥{(currentRecord.diffAmount || 0).toLocaleString()}
+                </Text>
+              </Descriptions.Item>
+              <Descriptions.Item label="差异率(%)" span={2}>
+                <Text type={(currentRecord.diffRate || 0) < 0 ? 'danger' : 'success'} strong>
+                  {(currentRecord.diffRate || 0) > 0 ? '+' : ''}{currentRecord.diffRate || 0}%
                 </Text>
               </Descriptions.Item>
             </Descriptions>
 
-            <Descriptions title="预警信息" bordered column={2} size="small" style={{ marginTop: 16 }}>
-              <Descriptions.Item label="规则类型">{RULE_TYPES[currentRecord.ruleType]}</Descriptions.Item>
-              <Descriptions.Item label="预警级别">
-                <Tag color={WARNING_LEVELS[currentRecord.warningLevel].tagColor}>
-                  {WARNING_LEVELS[currentRecord.warningLevel].text}
-                </Tag>
-              </Descriptions.Item>
-              <Descriptions.Item label="预警时间">{currentRecord.warningDate}</Descriptions.Item>
-              <Descriptions.Item label="处理状态">
-                <Tag color={PROCESS_STATUS[currentRecord.processStatus].color}>
-                  {PROCESS_STATUS[currentRecord.processStatus].text}
-                </Tag>
-              </Descriptions.Item>
-              {currentRecord.processUser && (
-                <>
-                  <Descriptions.Item label="处理人">{currentRecord.processUser}</Descriptions.Item>
-                  <Descriptions.Item label="处理时间">{currentRecord.processDate}</Descriptions.Item>
-                </>
-              )}
-              {currentRecord.processRemarks && (
-                <Descriptions.Item label="处理备注" span={2}>
-                  {currentRecord.processRemarks}
+            {/* 预警消息 */}
+            {currentRecord.warningMessage && (
+              <Descriptions title="预警消息" bordered column={1} size="small" style={{ marginTop: 16 }}>
+                <Descriptions.Item label="消息内容">
+                  <div style={{ whiteSpace: 'pre-wrap' }}>{currentRecord.warningMessage}</div>
                 </Descriptions.Item>
-              )}
+              </Descriptions>
+            )}
+
+            {/* 机构信息 */}
+            <Descriptions title="机构信息" bordered column={2} size="small" style={{ marginTop: 16 }}>
+              <Descriptions.Item label="医疗机构名称">{currentRecord.fixmedinsName || '-'}</Descriptions.Item>
+              <Descriptions.Item label="医疗机构代码">{currentRecord.fixmedinsCode || '-'}</Descriptions.Item>
             </Descriptions>
+
+            {/* 处理信息 */}
+            {(currentRecord.processUser || currentRecord.processDate || currentRecord.processRemark) && (
+              <Descriptions title="处理信息" bordered column={2} size="small" style={{ marginTop: 16 }}>
+                <Descriptions.Item label="处理人">{currentRecord.processUser || '-'}</Descriptions.Item>
+                <Descriptions.Item label="处理时间">{currentRecord.processDateTime || `${fmtDate(currentRecord.processDate)} ${currentRecord.processTime || ''}`}</Descriptions.Item>
+                {currentRecord.processRemark && (
+                  <Descriptions.Item label="处理备注" span={2}>
+                    {currentRecord.processRemark}
+                  </Descriptions.Item>
+                )}
+              </Descriptions>
+            )}
           </div>
         )}
       </Modal>