cyy 3 лет назад
Родитель
Сommit
f888893075

+ 67 - 28
src/views/statistics/index.vue

@@ -4,7 +4,7 @@
     <!-- :style="{height:height}" -->
       <div class="statistics">
         <div class="editDate">
-          <div class="stitle">实验室看板大屏</div>
+          <div class="stitle">实验室管理看板</div>
           <div class="block" style="display:none">
             <span class="demonstration">开始:</span>
             <el-date-picker v-model="BeginDate" type="year" size="mini" value-format="yyyy" format="yyyy年"  style="width: 96px;"
@@ -14,9 +14,16 @@
 
           <div class="block">
             <span class="demonstration">查询年度:</span>
-            <el-date-picker v-model="endDate" type="year" size="mini" value-format="yyyy" format="yyyy年"  :clearable="false" style="width: 96px;"
-              @change="checkYear(endDate,'end')" placeholder="选择日期">
-            </el-date-picker>
+            <!-- <el-date-picker v-model="endDate" type="year" size="mini" value-format="yyyy" format="yyyy年"  :clearable="false" style="width: 96px;"
+              @change="checkYear(endDate,'end')" placeholder="选择日期"> -->
+                <el-date-picker
+                  v-model="endDate"
+                  type="year"
+                  value-format="yyyy"
+                  @change="checkYear(endDate,'end')"
+                  placeholder="选择年">
+                </el-date-picker>
+            <!-- </el-date-picker> -->
           </div>
 
           <div class="block">
@@ -84,11 +91,11 @@
         </div>
         <div class="ttitle">设备维保</div>
         <div class="componentsData" v-if="relOf">
-            <s7sheBeiJiaoZhun :width="'33%'"
+            <s7sheBeiJiaoZhun :width="static=='row' ? '33%': '100%'"
             v-if="showAll || showComponents[12]" :data = "getJiaoYanObjNum()"/>
-            <s8sheBeiHeCha :width="'33%'"
+            <s8sheBeiHeCha :width="static=='row' ? '33%': '100%'"
             v-if="showAll || showComponents[11]" :data = "gethechaObjNum()"/>
-            <s11biaoZhunWu :width="'33%'"
+            <s11biaoZhunWu :width="static=='row' ? '33%': '100%'"
             v-if="showAll || showComponents[15]" :data = "getbiaozhunObjNum()"/>
             <div class="clear"></div>
 
@@ -238,6 +245,7 @@
         repostCurd('sql', getJiaoYanObj(end)).then(response => {
           this.jiaoyanObj = response.variables.data //结果一定存在第0个,因为只有一条数据
           // this.getData(this.BeginDate, this.endDate, true, this.dataScope)
+          // console.log(end,this.jiaoyanObj,"nmnakak")
           this.gethechaObjData(this.endDate)
         })
       },
@@ -259,16 +267,23 @@
         repostCurd('sql', getbiaozhunObj(end)).then(response => {
           this.biaozhunObj = response.variables.data //结果一定存在第0个,因为只有一条数据
           // this.getData(this.BeginDate, this.endDate, true, this.dataScope)
-          console.log(this.biaozhunObj,'8888')
+          // console.log(this.biaozhunObj,'8888')
           this.getData(this.BeginDate, this.endDate, true, this.dataScope)
         })
       },
       /* 通过拼接的sql进行查询全部数据*/
       getData(beg, end, of, scope) {
+        // console.log(2222,DBData(beg, end, scope))
         repostCurd('sql', DBData(beg, end, scope)).then(response => {
-          this.relData = response.variables.data[0] //结果一定存在第0个,因为只有一条数据
+          if(typeof response.variables.data[0] === "undefined"){
+            this.relData = [0] //结果一定存在第0个,因为只有一条数据
+
+          }else{
+            this.relData = response.variables.data[0] //结果一定存在第0个,因为只有一条数据
+
+          }
           this.relOf = of
-          console.log(beg, end, of, response,'getdata')
+          // console.log(beg, end, of, response,this.relData,'getdata')
         })
       },
       /* 查询全部*/
@@ -276,16 +291,26 @@
         /* 上次查询时间不等于当次查询时间,    开始时间不能等于结束时间, 则开始查询。*/
         if (this.selectEnd != this.endDate) {
         // if ((this.selectEnd != this.endDate || this.selectBeg != this.BeginDate) && this.endDate != this.BeginDate && this.endDate > this.BeginDate) {
-          this.getData(this.BeginDate, this.endDate, false, this.dataScope)
-          this.selectEnd = this.endDate
-          this.selectBeg = this.BeginDate
+          // this.getData(this.BeginDate, this.endDate, false, this.dataScope)
+          this.getConfigData()
+          // this.$forceUpdate();
+
+          // this.selectEnd = this.endDate
+          // this.selectBeg = this.BeginDate
           /* 延迟刷新*/
-          this.timer = setInterval(() => {
-            if (!this.relOf) {
-              this.relOf = true
-              clearInterval(this.timer)
-            }
-          }, 100);
+
+          this.relOf = true;
+          this.timer = setTimeout(() => {
+            this.relOf = false
+            clearTimeout(this.timer)
+          }, 0)
+          
+          // this.timer = setInterval(() => {
+          //   if (!this.relOf) {
+          //     this.relOf = true
+          //     clearInterval(this.timer)
+          //   }
+          // }, 100);
         } 
         // else if (this.endDate == this.BeginDate) {
         //   this.$message({
@@ -303,16 +328,17 @@
       },
       /* 年份不得大于当前年份*/
       checkYear(year, data) {
-        let that = this
-        that.dataScope.length = 0
-        if(that.BeginDate != '' && that.endDate != ''){
-          let poor = Number(that.endDate) - Number(that.BeginDate)
-          for (let i = 0; i <= poor; i++) {
-            let element = Number(that.BeginDate) + i;
-            that.dataScope.push(element+'')
-          }
-        }
+        // let that = this
+        // that.dataScope.length = 0
+        // if(that.BeginDate != '' && that.endDate != ''){
+        //   let poor = Number(that.endDate) - Number(that.BeginDate)
+        //   for (let i = 0; i <= poor; i++) {
+        //     let element = Number(that.BeginDate) + i;
+        //     that.dataScope.push(element+'')
+        //   }
+        // }
         if (Number(year) > Number(this.getDate(0))) {
+          console.log(data,'3y87sdvfsdf')
           data == 'end' ?
             this.endDate = this.getDate(0) + '' :
             this.BeginDate = this.getDate(0) + ''
@@ -322,7 +348,13 @@
             message: '年份不得大于当前年份',
             type: 'warning'
           });
+          this.selectAll()
         }
+        // else(
+        //   this.endDate = Number(year)
+        // )
+        //   this.$forceUpdate();
+
       },
       /* 获取当前年份*/
       getDate(year) {
@@ -409,3 +441,10 @@
   }
   .clear{ clear: both; }
 </style>
+<style lang="scss">
+.el-year-table .today .cell {
+  color: #606266 !important;
+  font-weight: 100 !important;
+}
+ 
+</style>

+ 0 - 1
src/views/statistics/item/s1zhiLiangMuBiao.vue

@@ -78,7 +78,6 @@
           // barData.push(e)
         // }
         let e = 100 -this.data.t_jchzbNum.res[0]
-
         let option = {
           title: {
             text: this.title,

+ 13 - 48
src/views/statistics/js/selectDB.js

@@ -51,9 +51,9 @@ export const DBData = (begin,end,scope)=>{
   " join "+s5renYuanJianDu(begin,end,scope)+
   " join "+s9neiBu(begin,end,scope)+
   " join "+s12fengXian(begin,end,scope)+
-  " join "+s6sheBeiWeiHu(begin,end)+
+  // " join "+s6sheBeiWeiHu(begin,end)+
   " join "+s7sheBeiJiaoZhun(begin,end)+
-  " join "+s8sheBeiHeCha(begin,end)+
+  // " join "+s8sheBeiHeCha(begin,end)+
   ") tt"
 }
 /* 拼接通用条件,选用 */
@@ -123,26 +123,15 @@ function toolSame(val,tableName,where,join){
 function s1renwu(begin,end,scope){
   return "( SELECT COUNT( id_ ) AS t_jchzb"+end+" FROM t_jchzb "+ "WHERE shi_fou_guo_shen_ = '1' AND YEAR( create_time_ ) = "+end+" AND DATE(update_time_) BETWEEN DATE( create_time_ ) and DATE( qi_wang_wan_cheng ) ) s1renwu1  JOIN"+
   "( SELECT COUNT( id_ ) AS t_jchzbS"+end+" FROM t_jchzb WHERE shi_fou_guo_shen_ = '1' AND YEAR ( create_time_ ) = "+end+" ) s1renwu2  "
-  // let sql = "( SELECT COUNT( id_ ) AS t_jchzb"+begin+" FROM t_jchzb "+ "WHERE shi_fou_guo_shen_ = '1' AND YEAR( create_time_ ) = "+begin+" AND DATE(update_time_) BETWEEN DATE( create_time_ ) and DATE( qi_wang_wan_cheng ) ) s1renwu1  JOIN"
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql = sql + tool(scope[i],"t_jchzb",PAT_TASK(scope[i],true),1)
-  //   }else{
-  //     sql = sql + tool(scope[i],"t_jchzb",PAT_TASK(scope[i],true),0)
-  //   }
-  // }
-  // let sql1 = " JOIN ( SELECT COUNT( id_ ) AS t_jchzbS"+begin+" FROM t_jchzb WHERE shi_fou_guo_shen_ = '1' AND YEAR ( create_time_ ) = "+begin+" ) s1renwu2  JOIN "
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql1 = sql1 + toolSame(scope[i],"t_jchzb",PAT_TASK(scope[i],false),1)
-  //   }else{
-  //     sql1 = sql1 + toolSame(scope[i],"t_jchzb",PAT_TASK(scope[i],false),0)
-  //   }
-  // }
-  // let sqlAll = sql + sql1
-  // return sqlAll
-  //委托检测数
-  // return "SELECT *  FROM (select COUNT( id_ ) AS t_gdyrqcwt"+begin+" from t_gdyrgpjc WHERE YEAR( create_time_ ) = "+begin+" union all select id_ from t_gdyrqcjc WHERE YEAR( create_time_ ) = "+begin+") s1jianCe1  JOIN "+
+ 
+  }
+/* 检测 */
+function s1jianCe(begin,end){
+  // //v3
+  // return "( SELECT COUNT( id_ ) AS t_mjjcbg"+end+" FROM t_mjjcbg "+ "WHERE shi_fou_guo_shen_ = '已退回' AND YEAR( create_time_ ) = "+end+" ) s1jianCe1 JOIN"+
+  // "( SELECT COUNT( id_ ) AS t_mjjcbgS"+end+" FROM t_mjjcbg WHERE  YEAR ( create_time_ ) = "+end+" ) s1jianCe2 "
+  // 委托检测数
+  return "SELECT *  FROM (select COUNT( id_ ) AS t_gdyrqcwt"+end+" from t_gdyrgpjc WHERE YEAR( create_time_ ) = "+end+" union all select id_ from t_gdyrqcjc WHERE YEAR( create_time_ ) = "+end+") s1jianCe1  JOIN "+
   // "(SELECT COUNT( id_ ) AS t_gdyrqcwt"+end+" FROM (select id_ from t_gdyrgpjc WHERE YEAR( create_time_ ) = '"+end+"' union all select id_ from t_gdyrqcjc WHERE YEAR( create_time_ ) = '"+end+"') a0) s1jianCe2 on 1=1 join "+
   // //按期完成检测件数
   // "(select count(id_) as t_gdyrqcwt2"+begin+" from(select id_   from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe3 on 1=1 JOIN "+
@@ -156,32 +145,8 @@ function s1renwu(begin,end,scope){
   // //检测结果准确率
   // "(select count(wei_tuo_id_) as t_gdyrqcwt50"+begin+" from(select wei_tuo_id_   from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+" ) group by wei_tuo_id_ having count(1)=1 union all select wei_tuo_id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")  group by wei_tuo_id_ having count(1)=1 ) a) s1jianCe9 on 1=1 JOIN "+
   // "(select count(wei_tuo_id_) as t_gdyrqcwt50"+end+" from(select wei_tuo_id_  from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+" ) group by wei_tuo_id_ having count(1)=1 union all select wei_tuo_id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+"  ) group by wei_tuo_id_ having count(1)=1 ) a) s1jianCe10 on 1=1 "
-  //按时完成率
-  //"( select select count(id_) AS t_gdyrqcwt6"+begin+" from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+"))) s1jianCe11 on 1=1 JOIN "+
-  //"( select count(id_) AS t_gdyrqcwt6"+end+" from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = '"+end+"')  ) s1jianCe12 on 1=1"
-  }
-/* 检测 */
-function s1jianCe(begin,end){
-  // //v3
-  // return "( SELECT COUNT( id_ ) AS t_mjjcbg"+end+" FROM t_mjjcbg "+ "WHERE shi_fou_guo_shen_ = '已退回' AND YEAR( create_time_ ) = "+end+" ) s1jianCe1 JOIN"+
-  // "( SELECT COUNT( id_ ) AS t_mjjcbgS"+end+" FROM t_mjjcbg WHERE  YEAR ( create_time_ ) = "+end+" ) s1jianCe2 "
-  // 委托检测数
-  return "SELECT *  FROM (select COUNT( id_ ) AS t_gdyrqcwt"+begin+" from t_gdyrgpjc WHERE YEAR( create_time_ ) = "+begin+" union all select id_ from t_gdyrqcjc WHERE YEAR( create_time_ ) = "+begin+") s1jianCe1  JOIN "+
-  "(SELECT COUNT( id_ ) AS t_gdyrqcwt"+end+" FROM (select id_ from t_gdyrgpjc WHERE YEAR( create_time_ ) = '"+end+"' union all select id_ from t_gdyrqcjc WHERE YEAR( create_time_ ) = '"+end+"') a0) s1jianCe2 on 1=1 join "+
-  //按期完成检测件数
-  "(select count(id_) as t_gdyrqcwt2"+begin+" from(select id_   from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe3 on 1=1 JOIN "+
-  "(select count(id_) as t_gdyrqcwt2"+end+" from(select id_  from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+") union all select id_ from t_gdyrqcjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+")) a) s1jianCe4 on 1=1 join "+
-  //出具报告数
-  "(select count(id_) as t_gdyrqcwt3"+begin+" from(select id_   from t_gdyrgpjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe5 on 1=1 JOIN "+
-  "(select count(id_) as t_gdyrqcwt3"+end+" from(select id_  from t_gdyrgpjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+") union all select id_ from t_gdyrqcjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+")) a) s1jianCe6 on 1=1 join "+
-  //逾期未完成数
-  "(select count(id_) as t_gdyrqcwt4"+begin+" from(select id_   from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe7 on 1=1 JOIN "+
-  "(select count(id_) as t_gdyrqcwt4"+end+" from(select id_  from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+") union all select id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+")) a) s1jianCe8 on 1=1 JOIN " +
-  //检测结果准确率
-  "(select count(wei_tuo_id_) as t_gdyrqcwt50"+begin+" from(select wei_tuo_id_   from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+" ) group by wei_tuo_id_ having count(1)=1 union all select wei_tuo_id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")  group by wei_tuo_id_ having count(1)=1 ) a) s1jianCe9 on 1=1 JOIN "+
-  "(select count(wei_tuo_id_) as t_gdyrqcwt50"+end+" from(select wei_tuo_id_  from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+" ) group by wei_tuo_id_ having count(1)=1 union all select wei_tuo_id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+"  ) group by wei_tuo_id_ having count(1)=1 ) a) s1jianCe10 on 1=1 "
-  // 按时完成率
-  "( select select count(id_) AS t_gdyrqcwt6"+begin+" from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+"))) s1jianCe11 on 1=1 JOIN "+
+  // // 按时完成率
+  // "( select select count(id_) AS t_gdyrqcwt6"+begin+" from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+"))) s1jianCe11 on 1=1 JOIN "+
   "( select count(id_) AS t_gdyrqcwt6"+end+" from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = '"+end+"')  ) s1jianCe12 on 1=1"
   }
   /* 检测 */

+ 113 - 71
src/views/statistics/sendDatas.js

@@ -12,7 +12,13 @@ export default {
                         //         matchArr.push(this.relData[matching+this.dataScope[i]])
                         // }
                         // for (let i = 0; i < this.dataScope.length; i++) {
-                                matchArr.push(this.relData[matching+this.endDate])
+                                if(typeof this.relData[matching+this.endDate] === "undefined"){
+                                        matchArr.push(0)
+                                        // console.log(matchArr,'1hiuhkj')
+                                }else{
+                                        matchArr.push(this.relData[matching+this.endDate])
+                                        // console.log('2nhkjhiuhkj')
+                                }
                         // }
                         return matchArr
                 },
@@ -22,7 +28,13 @@ export default {
                         //         matchArr.push(this.relData[matching+'S'+this.dataScope[i]])
                         // }
                         // for (let i = 0; i < this.dataScope.length; i++) {
-                                matchArr.push(this.relData[matching+'S'+this.endDate])
+                                if(typeof this.relData[matching+'S'+this.endDate] === "undefined"){
+                                        matchArr.push(0)
+                                        // console.log(matchArr,'1hiuhkj')
+                                }else{
+                                        matchArr.push(this.relData[matching+'S'+this.endDate])
+                                        // console.log('2nhkjhiuhkj')
+                                }
                         // }
                         return matchArr
                 },
@@ -35,32 +47,41 @@ export default {
                         let a=0
                         let b=0
                         let c=0
-                        for (let i = 0; i < that.jiaoyanObj.length; i++) {
-                                let num=0
-                                let nameMid =''
-                                if (that.jiaoyanObj[i].t_mjsbjdxzjhzb===0) {
-                                        num =0
-                                } else {
-                                        num =Math.floor(that.jiaoyanObj[i].t_mjsbjdxzjhzbS/that.jiaoyanObj[i].t_mjsbjdxzjhzb * 10000) / 100
-                                }
-                                if (!that.jiaoyanObj[i].t_mjsbjdxzjhzbName) {
-                                        name.push(that.jiaoyanObj[i].t_mjsbjdxzjhzbZhName)
-                                } else {
-                                        nameMid=that.jiaoyanObj[i].t_mjsbjdxzjhzbZhName.split("—")
-                                        if(nameMid.length===2){
-                                                name.push(nameMid[1]+that.jiaoyanObj[i].t_mjsbjdxzjhzbName)
-                                        }else{
-                                                name.push(nameMid[0]+that.jiaoyanObj[i].t_mjsbjdxzjhzbName)
+                        // console.log('3423sdfsd',that.jiaoyanObj)
+                        if(that.jiaoyanObj.length === 0){
+                                val = [0]
+                                valAll = [0]
+                                e = [0]
+                                name = [0]
+                        }else{
+                                for (let i = 0; i < that.jiaoyanObj.length; i++) {
+                                        let num=0
+                                        let nameMid =''
+                                        if (that.jiaoyanObj[i].t_mjsbjdxzjhzb===0) {
+                                                num =0
+                                        } else {
+                                                num =Math.floor(that.jiaoyanObj[i].t_mjsbjdxzjhzbS/that.jiaoyanObj[i].t_mjsbjdxzjhzb * 10000) / 100
                                         }
+                                        if (!that.jiaoyanObj[i].t_mjsbjdxzjhzbName) {
+                                                name.push(that.jiaoyanObj[i].t_mjsbjdxzjhzbZhName)
+                                        } else {
+                                                nameMid=that.jiaoyanObj[i].t_mjsbjdxzjhzbZhName.split("—")
+                                                if(nameMid.length===2){
+                                                        name.push(nameMid[1]+that.jiaoyanObj[i].t_mjsbjdxzjhzbName)
+                                                }else{
+                                                        name.push(nameMid[0]+that.jiaoyanObj[i].t_mjsbjdxzjhzbName)
+                                                }
+                                        }
+                                        valAll.push(that.jiaoyanObj[i].t_mjsbjdxzjhzb)
+                                        val.push(that.jiaoyanObj[i].t_mjsbjdxzjhzbS)
+                                        e.push(num)
+        
+                                        // name.push(that.jiaoyanObj[i].t_mjsbjdxzjhzbName)
+                                        
+        
                                 }
-                                valAll.push(that.jiaoyanObj[i].t_mjsbjdxzjhzb)
-                                val.push(that.jiaoyanObj[i].t_mjsbjdxzjhzbS)
-                                e.push(num)
-
-                                // name.push(that.jiaoyanObj[i].t_mjsbjdxzjhzbName)
-                                
-
                         }
+                        
                         val.forEach( function(item){
                                 a += item ;
                         });
@@ -72,6 +93,7 @@ export default {
                         }else{
                                 c= Math.floor(a/b * 10000) / 100
                         }
+                        // console.log(val,valAll,e,name,a,b,c,"jsoi39")
                         return {
                                 "t_mjsbjdxzjhzbNum" :{"date": this.endDate,"number": val, "numberAll": valAll, "val": e, "name": name, "valnum":a,"valAll":b,"valna":c},
                                 "config":this.getMyConfig("检测") //返回需要的对应参数
@@ -86,25 +108,32 @@ export default {
                         let a=0
                         let b=0
                         let c=0
-                        for (let i = 0; i < that.hechaObj.length; i++) {
-                                let nameMid = ''
-                                // let num=0
-                                if (!that.hechaObj[i].t_sbhcjlbZhname) {
-                                        name.push(that.hechaObj[i].t_sbhcjlbName)
-                                } else {
-                                        nameMid=that.hechaObj[i].t_sbhcjlbName.split("—")
-                                        if(nameMid.length===2){
-                                                name.push(nameMid[1]+that.hechaObj[i].t_sbhcjlbZhname)
-                                        }else{
-                                                name.push(nameMid[0]+that.hechaObj[i].t_sbhcjlbZhname)
+                        if(that.hechaObj.length === 0){
+                                val = [0]
+                                valAll = [0]
+                                e = [0]
+                                name = [0]
+                        }else{
+                                for (let i = 0; i < that.hechaObj.length; i++) {
+                                        let nameMid = ''
+                                        // let num=0
+                                        if (!that.hechaObj[i].t_sbhcjlbZhname) {
+                                                name.push(that.hechaObj[i].t_sbhcjlbName)
+                                        } else {
+                                                nameMid=that.hechaObj[i].t_sbhcjlbName.split("—")
+                                                if(nameMid.length===2){
+                                                        name.push(nameMid[1]+that.hechaObj[i].t_sbhcjlbZhname)
+                                                }else{
+                                                        name.push(nameMid[0]+that.hechaObj[i].t_sbhcjlbZhname)
+                                                }
                                         }
-                                }
-                                valAll.push(that.hechaObj[i].t_sbhcjlb)
-                                val.push(that.hechaObj[i].t_sbhcjlbS)
-                                // e.push(num)
+                                        valAll.push(that.hechaObj[i].t_sbhcjlb)
+                                        val.push(that.hechaObj[i].t_sbhcjlbS)
+                                        // e.push(num)
 
-                                
+                                        
 
+                                }
                         }
                         val.forEach( function(item){
                                 a += item ;
@@ -132,24 +161,31 @@ export default {
                         let a=0
                         let b=0
                         let c=0
-                        for (let i = 0; i < that.nengliObj.length; i++) {
-                                // let num=0
-                                // if (that.hechaObj[i].t_sbhcjlb===0) {
-                                //         num =0
-                                // } else {
-                                //         num =Math.floor(that.hechaObj[i].t_sbhcjlbS/that.hechaObj[i].t_sbhcjlb * 10000) / 100
-                                // }
-                                // valAll.push(that.hechaObj[i].t_sbhcjlb)
-                                val.push(that.nengliObj[i].num)
-                                valAll.push(that.nengliObj[i].numS)
-                                // e.push(num)
-                                let nameMid = that.nengliObj[i].enname.split("—")
-                                if(nameMid.length===2){
-                                        name.push(nameMid[1]+that.nengliObj[i].zhname)
-                                }else{
-                                        name.push(nameMid[0]+that.nengliObj[i].zhname)
-                                }
+                        if(that.nengliObj.length === 0){
+                                val = [0]
+                                valAll = [0]
+                                e = [0]
+                                name = [0]
+                        }else{
+                                for (let i = 0; i < that.nengliObj.length; i++) {
+                                        // let num=0
+                                        // if (that.hechaObj[i].t_sbhcjlb===0) {
+                                        //         num =0
+                                        // } else {
+                                        //         num =Math.floor(that.hechaObj[i].t_sbhcjlbS/that.hechaObj[i].t_sbhcjlb * 10000) / 100
+                                        // }
+                                        // valAll.push(that.hechaObj[i].t_sbhcjlb)
+                                        val.push(that.nengliObj[i].num)
+                                        valAll.push(that.nengliObj[i].numS)
+                                        // e.push(num)
+                                        let nameMid = that.nengliObj[i].enname.split("—")
+                                        if(nameMid.length===2){
+                                                name.push(nameMid[1]+that.nengliObj[i].zhname)
+                                        }else{
+                                                name.push(nameMid[0]+that.nengliObj[i].zhname)
+                                        }
 
+                        }
                         }
                         val.forEach( function(item){
                                 a += item ;
@@ -176,19 +212,26 @@ export default {
                         let b=0
                         let c=0
                         let that = this
-                        for (let i = 0; i < that.biaozhunObj.length; i++) {
-                                // let num=0
-                                // if (that.hechaObj[i].t_sbhcjlb===0) {
-                                //         num =0
-                                // } else {
-                                //         num =Math.floor(that.hechaObj[i].t_sbhcjlbS/that.hechaObj[i].t_sbhcjlb * 10000) / 100
-                                // }
-                                // valAll.push(that.hechaObj[i].t_sbhcjlb)
-                                val.push(that.biaozhunObj[i].num)
-                                valAll.push(that.biaozhunObj[i].numS)
-                                // e.push(num)
-                                name.push(that.biaozhunObj[i].name)
+                        if(that.biaozhunObj.length === 0){
+                                val = [0]
+                                valAll = [0]
+                                e = [0]
+                                name = [0]
+                        }else{
+                                for (let i = 0; i < that.biaozhunObj.length; i++) {
+                                        // let num=0
+                                        // if (that.hechaObj[i].t_sbhcjlb===0) {
+                                        //         num =0
+                                        // } else {
+                                        //         num =Math.floor(that.hechaObj[i].t_sbhcjlbS/that.hechaObj[i].t_sbhcjlb * 10000) / 100
+                                        // }
+                                        // valAll.push(that.hechaObj[i].t_sbhcjlb)
+                                        val.push(that.biaozhunObj[i].num)
+                                        valAll.push(that.biaozhunObj[i].numS)
+                                        // e.push(num)
+                                        name.push(that.biaozhunObj[i].name)
 
+                                }
                         }
                         val.forEach( function(item){
                                 a += item ;
@@ -468,7 +511,6 @@ export default {
                         numData.push(mjsyshdfxsbykzjhxbNum[0])
                         barData.push(e)
                         // }
-                        // console.log(numData,'sddsddwqwww')
                         return {
                                 "t_mjsyshdfxsbykzjhxbNum" :{"date": this.endDate,"number": mjsyshdfxsbykzjhxbSNum, "numberAll":mjsyshdfxsbykzjhxbNum, "res":barData},
                                 "config":this.getMyConfig("内部质量") //返回需要的对应参数