|
@@ -106,18 +106,18 @@ export default {
|
|
|
async loadData() {
|
|
async loadData() {
|
|
|
try {
|
|
try {
|
|
|
// const d = await getChemicalStats()
|
|
// const d = await getChemicalStats()
|
|
|
- const d = await getChemicalsInventorySummary()
|
|
|
|
|
|
|
+ const res = await getChemicalsInventorySummary()
|
|
|
this.stats = {
|
|
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) {
|
|
} catch (e) {
|
|
|
console.error('ChemicalsStats:', e)
|
|
console.error('ChemicalsStats:', e)
|
|
|
}
|
|
}
|