فهرست منبع

fix: 修改查询Bug

Tong 2 سال پیش
والد
کامیت
cddab55b84

+ 11 - 7
src/views/biz/stats/supplies/pharmaceuticalsStats/index.vue

@@ -127,13 +127,17 @@
   }
   // 点击表格中数字
   async function handleDetail(record) {
-    const params = {
-      statsTime: patrolTime.value,
-      drugType: record.type,
-    };
-    const res = await getDrugStats(params); // 请求药品统计接口
-    detailName.value = formatDictValue(durgTypeOptions.value, record.type);
-    await setDetailTableData(res.data);
+    if (record) {
+      const params = {
+        statsTime: patrolTime.value,
+        drugType: record.type,
+      };
+      const res = await getDrugStats(params); // 请求药品统计接口
+      detailName.value = formatDictValue(durgTypeOptions.value, record.type);
+      await setDetailTableData(res.data);
+    } else {
+      await setDetailTableData([]);
+    }
   }
 </script>
 

+ 15 - 9
src/views/biz/stats/supplies/suppliesStats/index.vue

@@ -190,15 +190,19 @@
 
   // 点击表格中数字
   async function handleDetail(record) {
-    const params = {
-      statsTime: patrolTime.value,
-      makers: record.type,
-    };
-    const res = await getSuppliesTypeStats(params); // 请求药品统计接口
-    detailName.value = record.type;
-    await setDetailTableData(res.data);
+    if (record) {
+      const params = {
+        statsTime: patrolTime.value,
+        makers: record.type,
+      };
+      const res = await getSuppliesTypeStats(params); // 请求药品统计接口
+      detailName.value = record.type;
+      await setDetailTableData(res.data);
+    } else {
+      await setDetailTableData([]);
+    }
   }
-
+  // 合计行加载方法
   function handleSummary(tableData: any[]) {
     console.log(tableData);
     let totalT5 = 0;
@@ -209,7 +213,7 @@
     });
     return [
       {
-        type: '计',
+        type: '计',
         sum: totalT5,
         proportion: totalT6 + '%',
       },
@@ -241,6 +245,8 @@
 
     .ant-table-tbody {
       background-color: #f6f8fa !important;
+      font-weight: 600 !important;
+      color: #000a18 !important;
     }
   }
 </style>