Przeglądaj źródła

实验室看板修改自动换页,新增目标值

cyy 3 lat temu
rodzic
commit
46f416e96c

+ 85 - 80
src/views/statistics/index.vue

@@ -37,89 +37,62 @@
           </div>
 
         </div>
-        <div class="ttitle">质量目标统计</div>
-        <div class="componentsData" v-if="relOf">
-            <s1zhiLiangMuBiao :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[1]" :data = "getS1renwu()"/>
-            <s1jianCe :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[5]" :data = "getS2jianCe()" />
-            <s2manYiDu :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[7]"  :data = "getS2manYiDu()"/>
-            <s3tousu :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[6]" :data = "getS3tousu()"/>
-            <s13shengwuCol :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[17]"/>
-            <!-- <s1zhiLiang1 :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[2]"    />
-            <s1zhiLiang2 :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[3]"   />
-            <s1zhiLiang3 :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[4]"  /> -->
-
-            
-            <!-- <s4renYuanPeiXun :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[8]" :data = "getS4renYuanPeiXun()"/> -->
-
-            <!-- <none :width="static=='row' ? '20%': '100%'"
-            /> -->
-            <!-- <s6sheBeiWeiHu :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[10]" :data = "getS6sheBeiWeiHu()"/> -->
-            <!-- <s7sheBeiJiaoZhun :width="'50%'"
-            v-if="showAll || showComponents[12]" :data = "getJiaoYanObjNum()"/>
-            <s8sheBeiHeCha :width="'50%'"
-            v-if="showAll || showComponents[11]" :data = "gethechaObjNum()"/> -->
-            <!-- <s10waiBuNengLi :width="'50%'"
-            v-if="showAll || showComponents[14]" :data = "getnengtliObjNum()"/> -->
-            <!-- <s11biaoZhunWu :width="'50%'"
-            v-if="showAll || showComponents[15]" :data = "getbiaozhunObjNum()"/> -->
-            <!-- <s5renYuanJianDu :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[9]" :data = "getS5renYuanJianDu()"/> -->
-            <!-- <s9neiBuZhiLiang :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[13]" :data = "getS9neiBuZhiLiang()"/> -->
-            <!-- <s12fengXian :width="static=='row' ? '20%': '100%'"
-            v-if="showAll || showComponents[13]" :data = "getS12fengXian()"/> -->
-            <div class="clear"></div>
+        <div v-if="pageOT">
+          <div class="ttitle">质量目标统计</div>
+          <div class="componentsData"  v-if="relOf">
+              <s1zhiLiangMuBiao :width="static=='row' ? '20%': '100%'" :mubiao = "quality[0].val"
+              v-if="showAll || showComponents[1]" :data = "getS1renwu()"/> 
+              <s1jianCe :width="static=='row' ? '20%': '100%'" :mubiao = "quality[1].val"
+              v-if="showAll || showComponents[5]" :data = "getS2jianCe()" />
+              <s2manYiDu :width="static=='row' ? '20%': '100%'" :mubiao = "quality[2].val"
+              v-if="showAll || showComponents[7]"  :data = "getS2manYiDu()"/>
+              <s3tousu :width="static=='row' ? '20%': '100%'" :mubiao = "quality[3].val"
+              v-if="showAll || showComponents[6]" :data = "getS3tousu()"/>
+              <s13shengwuCol :width="static=='row' ? '20%': '100%'" :mubiao = "quality[4].val"
+              v-if="showAll || showComponents[17]"/>
+              <div class="clear"></div>
+          </div>
         </div>
-        <div class="ttitle">人员培训与管理</div>
-        <div class="componentsData" v-if="relOf">
-            <s4renYuanPeiXun :width="static=='row' ? '25%': '100%'"
-            v-if="showAll || showComponents[8]" :data = "getS4renYuanPeiXun()"/>
-            <s5renYuanJianDu :width="static=='row' ? '25%': '100%'"
-            v-if="showAll || showComponents[9]" :data = "getS5renYuanJianDu()"/>
-            <div class="clear"></div>
-
+        <div v-if="pageOT">
+          <div class="ttitle"  >人员培训与管理</div>
+          <div class="componentsData"  v-if="relOf">
+              <s4renYuanPeiXun :width="static=='row' ? '25%': '100%'"
+              v-if="showAll || showComponents[8]" :data = "getS4renYuanPeiXun()"/>
+              <s5renYuanJianDu :width="static=='row' ? '25%': '100%'"
+              v-if="showAll || showComponents[9]" :data = "getS5renYuanJianDu()"/>
+              <div class="clear"></div>
+          </div>
         </div>
-        <div class="ttitle">设备维保</div>
-        <div class="componentsData" v-if="relOf">
-            <s7sheBeiJiaoZhun :width="static=='row' ? '33%': '100%'"
-            v-if="showAll || showComponents[12]" :data = "getJiaoYanObjNum()"/>
-            <s8sheBeiHeCha :width="static=='row' ? '33%': '100%'"
-            v-if="showAll || showComponents[11]" :data = "gethechaObjNum()"/>
-            <s11biaoZhunWu :width="static=='row' ? '33%': '100%'"
-            v-if="showAll || showComponents[15]" :data = "getbiaozhunObjNum()"/>
-            <div class="clear"></div>
-
+        <div v-if="pageOT">
+          <div class="ttitle">设备维保</div>
+          <div class="componentsData" v-if="relOf">
+              <s7sheBeiJiaoZhun :width="static=='row' ? '33%': '100%'"
+              v-if="showAll || showComponents[12]" :data = "getJiaoYanObjNum()"/>
+              <s8sheBeiHeCha :width="static=='row' ? '33%': '100%'"
+              v-if="showAll || showComponents[11]" :data = "gethechaObjNum()"/>
+              <s11biaoZhunWu :width="static=='row' ? '33%': '100%'"
+              v-if="showAll || showComponents[15]" :data = "getbiaozhunObjNum()"/>
+              <div class="clear"></div>
+          </div>
         </div>
-        <div class="ttitle">质量控制</div>
-        <div class="componentsData" v-if="relOf">
-            <s9neiBuZhiLiang :width="static=='row' ? '25%': '100%'"
-            v-if="showAll || showComponents[13]" :data = "getS9neiBuZhiLiang()"/>
-            <s10waiBuNengLi :width="static=='row' ? '25%': '100%'"
-            v-if="showAll || showComponents[14]" :data = "getnengtliObjNum()"/>
-            <div class="clear"></div>
-
+        <div v-if="!pageOT">
+          <div class="ttitle">质量控制</div>
+          <div class="componentsData" v-if="relOf">
+              <s9neiBuZhiLiang :width="static=='row' ? '25%': '100%'"
+              v-if="showAll || showComponents[13]" :data = "getS9neiBuZhiLiang()"/>
+              <s10waiBuNengLi :width="static=='row' ? '25%': '100%'"
+              v-if="showAll || showComponents[14]" :data = "getnengtliObjNum()"/>
+              <div class="clear"></div>
+          </div>
         </div>
-        <div class="ttitle">风险控制</div>
-        <div class="componentsData" v-if="relOf">
-            <s12fengXian :width="static=='row' ? '25%': '100%'"
-            v-if="showAll || showComponents[16]" :data = "getS12fengXian()"/>
-            <div class="clear"></div>
-
+        <div v-if="!pageOT">
+          <div class="ttitle">风险控制</div>
+          <div class="componentsData" v-if="relOf">
+              <s12fengXian :width="static=='row' ? '25%': '100%'"
+              v-if="showAll || showComponents[16]" :data = "getS12fengXian()"/>
+              <div class="clear"></div>
+          </div>
         </div>
-       
-
-
-
       </div>
     </el-scrollbar>
   </dv-full-screen-container>
@@ -202,6 +175,12 @@
         this.dataScope.push(this.endDate)
       }
       this.getConfigData() //获取统计的配置
+      this.getqualityData()
+
+      this.timer1 = setInterval(()=>{
+        this.pageOT = !this.pageOT
+        console.log(this.pageOT)
+      },300000)
     },
     data() {
       return {
@@ -218,8 +197,17 @@
         selectBeg: '',
         showAll:true,
         timer: '',
+        timer1: '',
         showComponents:{},//显示全部统计子组件 , 若有新增,往后累计。 供动态表单进行查阅使用。
-        dataScope: []
+        dataScope: [],
+        pageOT: true,
+        quality:[
+          {name: '任务完成及时率' ,val: ''},
+          {name: '报告差错率' ,val: ''},
+          {name: '客户满意度' ,val: ''},
+          {name: '客户投诉率' ,val: ''},
+          {name: '安全事故' ,val: ''}
+        ]
       }
     },
      beforeDestroy() {
@@ -233,6 +221,20 @@
             this.showComponents[this.shows[i]] = true
           }
       },
+      getqualityData() {
+        let sql='select xiang_mu_ming_,mu_biao_zhi_ from t_zlmbz'
+        repostCurd('sql', sql).then(response => {
+          let a = response.variables.data //结果一定存在第0个,因为只有一条数据
+           this.quality.forEach((t,i)=>{
+            a.forEach(e => {
+              if (t.name === e.xiang_mu_ming_) {
+                t.val = e.mu_biao_zhi_
+              }
+            });
+          })
+          console.log(this.quality,'546546654gsdf')
+        })
+      },
       /* 查询统计配置中的完成率*/
       getConfigData() {
         repostCurd('sql', getConfig()).then(response => {
@@ -283,7 +285,7 @@
 
           }
           this.relOf = of
-          // console.log(beg, end, of, response,this.relData,'getdata')
+          console.log(beg, end, of, response,this.relData,'getdata')
         })
       },
       /* 查询全部*/
@@ -293,6 +295,8 @@
         // 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.getConfigData()
+          this.getqualityData()
+
           // this.$forceUpdate();
 
           // this.selectEnd = this.endDate
@@ -368,6 +372,7 @@
       },
       goBack(){
         this.$router.back(-1)
+        clearInterval(this.timer1);
       }
     },
     created() {

+ 14 - 5
src/views/statistics/item/s13shengwuCol.vue

@@ -41,6 +41,10 @@
         type:String,
         default:'true'
       },
+      mubiao:{
+        type:String,
+        default:''
+      }
     },
     data () {
       return {
@@ -87,7 +91,7 @@
 
         option = {
           //v3
-              legend: {},
+            legend: {},
             tooltip: {
               trigger: 'axis',
               axisPointer: {
@@ -144,12 +148,17 @@
               bottom: '10%',
               containLabel: true
             },
-            title: {
+            title: [{
               text: this.title,
+              // subtext: 'Fake Data',
+              left: 0,
               textStyle:{ fontSize:14 }
-
-              // subtext: "        "+beingDate+"-"+endDate
-            },
+            },{
+              text: '目标值'+this.mubiao,
+              // subtext: 'Fake Data',
+              right: 0,
+              textStyle:{ fontSize:12 }
+            }],
           //v2
         //   rotate: {
         //     min: -90,

+ 13 - 3
src/views/statistics/item/s1jianCe.vue

@@ -8,6 +8,7 @@
         @close = "close"
         :title="title"
         :data="data"
+        :mubiao="mubiao"
       />
     </div>
   </div>
@@ -42,6 +43,10 @@
         type:String,
         default:'true'
       },
+      mubiao:{
+        type:String,
+        default:''
+      }
     },
     data () {
       return {
@@ -86,12 +91,17 @@
         let e = 100 -this.data.t_mjjcbgNum.res[0]
         let option = {
         //v3
-          title: {
+          title: [{
             text: this.title,
             // subtext: 'Fake Data',
-            left: 'left',
+            left: 0,
             textStyle:{ fontSize:14 }
-          },
+          },{
+            text: '目标值'+this.mubiao,
+            // subtext: 'Fake Data',
+            right: 0,
+            textStyle:{ fontSize:12 }
+          }],
           tooltip: {
             trigger: 'item'
           },

+ 13 - 3
src/views/statistics/item/s1zhiLiangMuBiao.vue

@@ -9,6 +9,7 @@
         @close = "close"
         :title="title"
         :data="data"
+        :mubiao="mubiao"
       />
     </div>
   </div>
@@ -43,6 +44,10 @@
         type:String,
         default:'true'
       },
+      mubiao:{
+        type:String,
+        default:''
+      }
     },
     data () {
       return {
@@ -79,12 +84,17 @@
         // }
         let e = 100 -this.data.t_jchzbNum.res[0]
         let option = {
-          title: {
+          title: [{
             text: this.title,
             // subtext: 'Fake Data',
-            left: 'left',
+            left: 0,
             textStyle:{ fontSize:14 }
-          },
+          },{
+            text: '目标值'+this.mubiao,
+            // subtext: 'Fake Data',
+            right: 0,
+            textStyle:{ fontSize:12 }
+          }],
           tooltip: {
             trigger: 'item'
           },

+ 13 - 3
src/views/statistics/item/s2manYiDu.vue

@@ -8,6 +8,7 @@
         @close = "close"
         :title="title"
         :data="data"
+        :mubiao="mubiao"
       />
     </div>
   </div>
@@ -43,6 +44,10 @@
         type:String,
         default:'true'
       },
+      mubiao:{
+        type:String,
+        default:''
+      }
     },
     data () {
       return {
@@ -93,12 +98,17 @@
         let beingDate=this.data.t_myddc2Begin.date
         let endDate=this.data.t_myddc2End.date
         let option = {
-            title: {
+          title: [{
             text: this.title,
             // subtext: 'Fake Data',
-            left: 'left',
+            left: 0,
             textStyle:{ fontSize:14 }
-          },
+          },{
+            text: '目标值'+this.mubiao,
+            // subtext: 'Fake Data',
+            right: 0,
+            textStyle:{ fontSize:12 }
+          }],
           tooltip: {
             trigger: 'item'
           },

+ 13 - 3
src/views/statistics/item/s3tousu.vue

@@ -8,6 +8,7 @@
         @close = "close"
         :title="title"
         :data="data"
+        :mubiao="mubiao"
       />
     </div>
   </div>
@@ -41,6 +42,10 @@
         type:String,
         default:'true'
       },
+      mubiao:{
+        type:String,
+        default:''
+      }
     },
     data () {
       return {
@@ -87,12 +92,17 @@
         let e = 100-this.data.t_complaintNum.res[0]
 
         option = {
-          title: {
+          title: [{
             text: this.title,
             // subtext: 'Fake Data',
-            left: 'left',
+            left: 0,
             textStyle:{ fontSize:14 }
-          },
+          },{
+            text: '目标值'+this.mubiao,
+            // subtext: 'Fake Data',
+            right: 0,
+            textStyle:{ fontSize:12 }
+          }],
           tooltip: {
             trigger: 'item'
           },

+ 7 - 0
src/views/statistics/properties/s1jianCePro.vue

@@ -22,6 +22,7 @@
             :data="data"
             width="50%"
             :height="height"
+            :mubiao="mubiao"
             id="s1jianCePro"
             click="false"
           />
@@ -44,6 +45,8 @@
             <br>
             检测报告差错率 :<el-tag>{{data.t_mjjcbgNum.res[0]}} 次</el-tag>
             <br>
+            当前目标值 :<el-tag>{{mubiao}}</el-tag>
+            <br>
           <!-- <el-divider content-position="left">{{data.t_gdyrqcwtBegin.date}} 年度</el-divider>
             委托检测数 :<el-tag>{{data.t_gdyrqcwtBegin.number}} 次</el-tag>
             <br>
@@ -105,6 +108,10 @@
         height:{
           type:String,
           default:window.screen.height * 0.50 +'px'
+        },
+        mubiao:{
+          type:String,
+          default:''
         }
         
       },

+ 7 - 0
src/views/statistics/properties/s1zhiLiangMuBiaoPro.vue

@@ -20,6 +20,7 @@
               <s5zhiLiangMuBiaoItem
                 :data="data"
                 width="50%"
+                :mubiao="mubiao"
                 :height="height"
                 id="s5zhiLiangMuBiaoPro"
                 click="false"
@@ -42,6 +43,8 @@
                 <br>
                 任务及时完成率 :<el-tag>{{data.t_jchzbNum.res[0]}} %</el-tag>
                 <br>
+                当前目标值 :<el-tag>{{mubiao}}</el-tag>
+                <br>
               </div>
               <!-- <div class="dataCont" style="font-size: 14px;">
               <el-divider content-position="left">2021 年度</el-divider>
@@ -90,6 +93,10 @@
         height:{
           type:String,
           default:window.screen.height * 0.5 +'px'
+        },
+        mubiao:{
+          type:String,
+          default:''
         }
       },
       beforeCreate: function () {

+ 7 - 0
src/views/statistics/properties/s2manYiDuPro.vue

@@ -21,6 +21,7 @@
           <s2manYiDuItem
             :data="data"
             width="50%"
+            :mubiao="mubiao"
             :height="height"
             id="s2manYiDuPro"
             click="false"
@@ -44,6 +45,8 @@
               <br>
               客户满意度 :<el-tag>{{data.t_khmydtjbNum.res[0]}} %</el-tag>
               <br>
+              当前目标值 :<el-tag>{{mubiao}}</el-tag>
+              <br>
            </div>
            <!-- <div v-for="(item,i) in data.t_khmydtjbNum.date" :key="i">
               <el-divider content-position="left">{{data.t_khmydtjbNum.date[i]}} 年度</el-divider>
@@ -78,6 +81,10 @@
         height:{
           type:String,
           default:window.screen.height * 0.5 +'px'
+        },
+        mubiao:{
+          type:String,
+          default:''
         }
       },
       beforeCreate: function () {

+ 8 - 1
src/views/statistics/properties/s3tousuPro.vue

@@ -21,6 +21,7 @@
           <s3tousuItem
             :data="data"
             width="50%"
+            :mubiao="mubiao"
             :height="height"
             id="s3tousuPro"
             click="false"
@@ -42,7 +43,9 @@
               委托总数次数 :<el-tag>{{data.t_complaintNum.numberAll[0]}} 次</el-tag>
               <br>
               客户投诉率 :<el-tag>{{data.t_complaintNum.res[0]}} %</el-tag>
-            <br>
+              <br>
+              当前目标值 :<el-tag>{{mubiao}}</el-tag>
+              <br>
               <!-- <div v-for="(item,i) in data.t_complaintNum.number" :key="i">
                   <el-divider content-position="left">{{data.t_complaintNum.date[i]}} 年度</el-divider>
                   投诉总数次数 :<el-tag>{{data.t_complaintNum.number[i]}} 次</el-tag>
@@ -76,6 +79,10 @@
         height:{
           type:String,
           default:window.screen.height * 0.5 +'px'
+        },
+        mubiao:{
+          type:String,
+          default:''
         }
       },
       beforeCreate: function () {

+ 1 - 1
src/views/statistics/sendDatas.js

@@ -250,7 +250,7 @@ export default {
                         }
                 },
                 getMyConfig(name){
-                        if(this.config.length == 0)  return
+                        if(Object.prototype.toString.call(this.config) != '[object Array]' || this.config.length == 0)  return
                         for(let i in this.config){
                                 if (this.config[i]['pei_zhi_biao_ming'] == name){
                                         return this.config[i]['pei_zhi_can_shu_'] //返回需要的对应参数