dedsudiyu 1 day ago
parent
commit
f1f0551711
1 changed files with 10 additions and 10 deletions
  1. 10 10
      src/components/LabStats/ChemicalsStats.vue

+ 10 - 10
src/components/LabStats/ChemicalsStats.vue

@@ -106,18 +106,18 @@ export default {
     async loadData() {
       try {
         // const d = await getChemicalStats()
-        const d = await getChemicalsInventorySummary()
+        const res = await getChemicalsInventorySummary()
         this.stats = {
-          totalAmount: d.totalQuantityL || 0,
-          unit: d.totalUnit || 'L',
-          controlledAmount: d.controlledQuantityL || 0,
-          uncontrolledAmount: d.uncontrolledQuantityL || 0,
-          totalCategories: d.totalCategoryCount || 0,
-          controlledCategories: d.controlledSpeciesCount || 0,
-          uncontrolledCategories: d.uncontrolledSpeciesCount || 0
+          totalAmount: res.data.totalQuantityL || 0,
+          unit: res.data.totalUnit || 'L',
+          controlledAmount: res.data.controlledQuantityL || 0,
+          uncontrolledAmount: res.data.uncontrolledQuantityL || 0,
+          totalCategories: res.data.totalCategoryCount || 0,
+          controlledCategories: res.data.controlledSpeciesCount || 0,
+          uncontrolledCategories: res.data.uncontrolledSpeciesCount || 0
         }
-        this.controlledPct = d.controlledPercent || 0
-        this.uncontrolledPct = d.uncontrolledPercent || 0
+        this.controlledPct = res.data.controlledPercent || 0
+        this.uncontrolledPct = res.data.uncontrolledPercent || 0
       } catch (e) {
         console.error('ChemicalsStats:', e)
       }