diff --git a/src/views/bigpage/bigcomponents/AdverseBox.vue b/src/views/bigpage/bigcomponents/AdverseBox.vue index 5bcea7f..18e420e 100644 --- a/src/views/bigpage/bigcomponents/AdverseBox.vue +++ b/src/views/bigpage/bigcomponents/AdverseBox.vue @@ -8,12 +8,13 @@ 不良反应
-
12121111111111111111
+
{{ a1 || 0 }}
较去年
- + +
@@ -22,12 +23,13 @@ 严重不良反应
-
1212
+
{{ a2 || 0 }}
较去年
- + +
@@ -36,12 +38,13 @@ 发生死亡不良反应
-
1212
+
{{ a3 || 0 }}
较去年
- + +
@@ -66,6 +69,10 @@ export default { // echarts myChart1: {}, center: ["18%", "50%"], + blfxxx: {}, + a1: 0, + a2: 0, + a3: 0, }; }, created() {}, @@ -75,7 +82,6 @@ export default { methods: { getData() { let newRouter = this.$route.query; - console.log(newRouter.type); if (newRouter.type == 1) { //药品 getDrugBL({ name: newRouter.code }).then((res) => { @@ -89,8 +95,18 @@ export default { } if (newRouter.type != 1 && newRouter.type != 2) { //化妆品 - getCosmeticsBL({ name: newRouter.code }).then((res) => { - console.log(res); + getCosmeticsBL().then((res) => { + res.data.result.forEach((value, index) => { + if (value.reportType == "一般") { + this.a1 = value.reportCount; + } + if (value.reportType == "严重") { + this.a2 = value.reportCount; + } + if (value.reportType != "一般" && value.reportType != "严重") { + this.a3 = value.reportCount; + } + }); this.$nextTick(() => { let chartDom = this.$refs["bottom-box"]; this.myChart1 = echarts.init(chartDom);