East před 4 roky
rodič
revize
ee215b4e21

+ 3 - 3
src/views/modules/pigbasic/pbadopt-charts/in-and-out.vue

@@ -69,7 +69,7 @@
             var option = {
               backgroundColor: '#2c343c',
               title: {
-                text: '育肥出栏比例饼状图',
+                text: '认养比例饼状图',
                 left: 'center',
                 top: 20,
                 textStyle: {
@@ -95,8 +95,8 @@
                   radius: '65%',
                   center: ['50%', '55%'],
                   data: [
-                    { value: this.proportion['inFenct'], name: '育肥' },
-                    { value: this.proportion['outFenct'], name: '出栏' },
+                    { value: this.proportion['notAdopted'], name: '未认养 ' + this.proportion['notAdopted'] + '头 ' + this.proportion['notAdoptedPercent'] },
+                    { value: this.proportion['adopted'], name: '已认养 ' + this.proportion['adopted'] + '头 ' + this.proportion['adoptedPercent'] },
                     // { value: 274, name: '联盟广告' },
                     // { value: 235, name: '视频广告' },
                     // { value: 400, name: '搜索引擎' }

+ 22 - 12
src/views/modules/pigbasic/pbadopt-charts/statistics.vue

@@ -62,7 +62,8 @@
         ifMonth: true,
         form: {
           time: []
-        }
+        },
+        subtext: ''
       }
     },
     mounted () {
@@ -90,18 +91,27 @@
               this.date.push(item.date)
               this.total.push(item.total)
             })
+            if (data.data.length === 0) {
+              this.subtext = '暂无数据'
+              this.$notify.error({
+                title: '注意',
+                message: '这段时间内没有猪只出栏',
+                duration: 0
+              })
+            }
             var option = {
               // backgroundColor: '#2c343c',
               'title': {
                 'text': '出栏统计折线图',
                 'x': 'center',
-                'subtext': '暂无数据'
+                'subtext': this.subtext
               },
               'tooltip': {
                 'trigger': 'axis'
               },
               'legend': {
                 'data': [ '出栏猪只数量'],
+                'x': '100',
                 'y': '30px'
               },
               'grid': {
@@ -145,16 +155,16 @@
       },
       // 获取起始与结束时间
       timeChange (val) {
-        console.log(val);
-        let start = new Date(val[0])
-        let end = new Date(val[1])
-        let now = new Date()
-        console.log(start);
-        if (start > now || end > now) {
-          this.form.time = []
-          this.$message.error('请勿选择超出现在的时刻')
-          return
-        }
+        // console.log(val);
+        // let start = new Date(val[0])
+        // let end = new Date(val[1])
+        // let now = new Date()
+        // console.log(start);
+        // if (start > now || end > now) {
+        //   this.form.time = []
+        //   this.$message.error('请勿选择超出现在的时刻')
+        //   return
+        // }
         this.initChartLine()
       },
       clickChange () {

+ 1 - 1
src/views/modules/pigbasic/pbadopt.vue

@@ -8,7 +8,7 @@
             type="danger"
             @click="inOut = !inOut"
             :disabled="inOut">
-            育肥 / 出栏
+            未认养 / 已认养
           </el-button>
         </el-form-item>
         <el-form-item>