Просмотр исходного кода

样品和实验室看板修改

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

+ 42 - 150
src/views/demo/yangPin/yangPinShuJu/EntrustNumber.vue

@@ -20,9 +20,17 @@
 </template>
 
 <script>
- import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+import echarts from 'echarts'
+
 import { resolve } from 'path';
 export default {
+  props:{
+    NowTime1:{
+      type:String,
+      default:""
+    }
+  },
   data(){ 
     return{
       NowTime: '',
@@ -33,6 +41,9 @@ export default {
       day:0,
       //填充数量的数组
       filledNum:[],
+      yearA:'',
+      monthA:''
+
 
       // //已收到要填充的数组
       // ReceivedNum:[],
@@ -49,23 +60,33 @@ export default {
       
     }
   },
+  watch: {  
+    NowTime1(newValue, oldValue) {
+      this.days.length=0
+      this.getNowTime()
+    }  
+  },
   mounted() {
     this.getNowTime()
   },
   methods:{
     //样品相关数据时间控件 :页面进来显示当前时间
     getNowTime(){
-      const nowDate = new Date();
-      const date = {
-        year: nowDate.getFullYear(),
-        month: nowDate.getMonth() + 1,
-      }
-      this.NowTime = date.year + '-' + date.month
+      // const nowDate = new Date();
+      // const date = {
+      //   year: nowDate.getFullYear(),
+      //   month: nowDate.getMonth() + 1,
+      // }
+      this.yearA = ''
+      this.monthA = ''
+      this.yearA = this.NowTime1.split('-')[0]
+      this.monthA = this.NowTime1.split('-')[1]
+      this.NowTime = this.yearA + '-' + this.monthA
       // console.log('页面第一次进来显示时间',date.year,date.month)
       //进来获取当前时间 之后获取当前月份天数 传给
       // console.log('页面显示的时间',this.NowTime)  //2022-11
       //把页面第一次进来的 当前年度月份 传给该方法处理 得到day及days
-      this.getDaysInMonth(date.year,date.month)
+      this.getDaysInMonth(this.yearA,this.monthA)
       
     },
    
@@ -106,7 +127,7 @@ export default {
       //SELECT liu_yang_ri_qi_,liu_yang_shu_lian FROM (SELECT * FROM t_mjypdjb WHERE  liu_yang_ri_qi_ ='' ) a WHERE   a.shi_fou_liu_yang_ != '否' AND shou_yang_ri_qi_ LIKE '2022-11%'  //留样
       let sql1 = "select shou_yang_ri_qi_,shou_yang_shu_lia FROM t_mjypdjb WHERE shou_yang_ri_qi_ LIKE '"+this.NowTime+'%'+"'"
       let sql2 ="select shou_yang_ri_qi_,shou_yang_shu_lia FROM t_mjypdjb WHERE yan_shou_zhuang_t = '残缺'  AND shou_yang_ri_qi_ LIKE '"+this.NowTime+'%'+"'"
-      let sql3 = "select liu_yang_ri_qi_,liu_yang_shu_lian FROM (SELECT * FROM t_mjypdjb WHERE  liu_yang_ri_qi_ ='' ) a WHERE   a.shi_fou_liu_yang_ != '否' AND shou_yang_ri_qi_ LIKE '"+this.NowTime+'%'+"'"
+      let sql3 = "select liu_yang_ri_qi_,liu_yang_shu_lian FROM (SELECT * FROM t_mjypdjb) a WHERE  a.shi_fou_liu_yang_ != '否' AND shou_yang_ri_qi_ LIKE '"+this.NowTime+'%'+"'"
       Promise.all([
         curdPost('sql', sql1),
         curdPost('sql', sql2),
@@ -117,9 +138,9 @@ export default {
         let data3 = res3.variables.data
         // console.log('返回的全部数据',data1,data2)
         // console.log('返回的全部数据',data1,data2,data3)
-        const receivedData = this.dealingData(data1,dayNum)
-        const unqualifiedData = this.dealingData(data2,dayNum)
-        const retentionData = this.dealingRetentionData(data3,dayNum)
+        let receivedData = this.dealingData(data1,dayNum)
+        let unqualifiedData = this.dealingData(data2,dayNum)
+        let retentionData = this.dealingRetentionData(data3,dayNum)
         // console.log('xxxxxxxxx方法返回的数据1   -------',receivedData)
         // console.log('xxxxxxxxx方法返回的数据2   -------',unqualifiedData)
         // console.log('xxxxxxxxx方法返回的数据3   -------',retentionData)
@@ -128,13 +149,17 @@ export default {
       })
     },
     //处理sql查询出来的数据
+    // dealingData(data,dayNum){
+      
+    //   return data
+    // },
     dealingData(data,dayNum){
       let newArray = data.reduce((total, cur, index) => {
           let hasValue = total.findIndex(current => {
             return current.shou_yang_ri_qi_ === cur.shou_yang_ri_qi_;
           });
           hasValue === -1 && total.push(cur);
-          hasValue !== -1 && (total[hasValue].shou_yang_shu_lia = total[hasValue].shou_yang_shu_lia + cur.shou_yang_shu_lia);
+          hasValue !== -1 && (total[hasValue].shou_yang_shu_lia = Number(total[hasValue].shou_yang_shu_lia) + Number(cur.shou_yang_shu_lia));
           return total;
       }, []);
       //console.log('日期相同数量相加 处理结果',newArray);
@@ -143,7 +168,7 @@ export default {
       //遍历拿到的数组,截取出月份对应的 // 2022-11-01
       newArray.forEach(item =>{
         let key = item.shou_yang_ri_qi_.slice(8,10) < 10 ?item.shou_yang_ri_qi_.slice(9,10) :item.shou_yang_ri_qi_.slice(8,10)
-        let value =parseInt(item.shou_yang_shu_lia)
+        let value =Number(item.shou_yang_shu_lia)
         this.filledNum.splice(key - 1,1,value)
       })
       //返回处理好的数量数组
@@ -156,7 +181,7 @@ export default {
             return current.liu_yang_ri_qi_ === cur.liu_yang_ri_qi_;
           });
           hasValue === -1 && total.push(cur);
-          hasValue !== -1 && (total[hasValue].liu_yang_ri_qi_ = total[hasValue].liu_yang_ri_qi_ + cur.liu_yang_ri_qi_);
+          hasValue !== -1 && (total[hasValue].liu_yang_shu_lian = Number(total[hasValue].liu_yang_shu_lian) + Number(cur.liu_yang_shu_lian));
           return total;
       }, []);
         //console.log('日期相同数量相加 处理结果',newArray);
@@ -165,146 +190,12 @@ export default {
         //遍历拿到的数组,截取出月份对应的 // 2022-11-01
         newArray.forEach(item =>{
           let key = item.liu_yang_ri_qi_.slice(8,10) < 10 ?item.liu_yang_ri_qi_.slice(9,10) :item.liu_yang_ri_qi_.slice(8,10)
-          let value =parseInt(item.liu_yang_shu_lian)
+          let value =Number(item.liu_yang_shu_lian)
           this.filledNum.splice(key - 1,1,value)
         })
         //返回处理好的数量数组
         return this.filledNum;
     },
-    //1.已收到:样品登记表有数据
-    getReceivedData(dayNum){
-      // console.log('已收样品传日期到sql查询',this.NowTime)   //2022-11
-      // console.log('getReceivedData function ',dayNum)
-      //let sql2 = "select shou_yang_ri_qi_,shou_yang_shu_lia FROM t_mjypdjb"
-      let sql2 = "select shou_yang_ri_qi_,shou_yang_shu_lia FROM t_mjypdjb WHERE shou_yang_ri_qi_ LIKE '"+this.NowTime+'%'+"'" 
-        curdPost('sql',sql2).then(response => { 
-        let data = response.variables.data
-        // console.log('已收',data,data.length)
-
-        let newArray = data.reduce((total, cur, index) => {
-          let hasValue = total.findIndex(current => {
-            return current.shou_yang_ri_qi_ === cur.shou_yang_ri_qi_;
-          });
-          hasValue === -1 && total.push(cur);
-          hasValue !== -1 && (total[hasValue].shou_yang_shu_lia = total[hasValue].shou_yang_shu_lia + cur.shou_yang_shu_lia);
-          return total;
-        }, []);
-        //console.log('日期数量11111111',newArray);
-        //创建一个长度为当前月份天数的数组
-        this.ReceivedNum = Array(dayNum)
-        this.ReceivedNum = this.ReceivedNum.fill(0)
-        //console.log('创建对应月份的数组',this.ReceivedNum)
-        //遍历拿到的数组,截取出月份对应的 // 2022-11-01
-        newArray.forEach(item =>{
-          let key = item.shou_yang_ri_qi_.slice(8,10) < 10 ?item.shou_yang_ri_qi_.slice(9,10) :item.shou_yang_ri_qi_.slice(8,10)
-          let value =parseInt(item.shou_yang_shu_lia)
-          this.ReceivedNum.splice(key - 1,1,value)
-        })
-        //console.log('getReceivedData 处理好的数据',this.ReceivedNum)
-        //拿到月份数组和y轴数量数组
-        this.entrustNumberInit(this.days,this.ReceivedNum)
-      })
-    },
-  
-    //2.已经收到不合格 xx
-    getUnqualifiedData(dayNum){
-      //let sql3 = "select shou_yang_ri_qi_,shou_yang_shu_lia from t_mjypdjb where yan_shou_zhuang_t = '残缺'"
-      let sql3 ="select shou_yang_ri_qi_,shou_yang_shu_lia FROM t_mjypdjb WHERE yan_shou_zhuang_t = '残缺'  AND shou_yang_ri_qi_ LIKE '"+this.NowTime+'%'+"'"
-        curdPost('sql',sql3).then(response => { 
-        let data = response.variables.data
-        // console.log('不合格样品数据',data )
-        let newArray = data.reduce((total, cur, index) => {
-          let hasValue = total.findIndex(current => {
-            return current.shou_yang_ri_qi_ === cur.shou_yang_ri_qi_;
-          });
-          hasValue === -1 && total.push(cur);
-          hasValue !== -1 && (total[hasValue].shou_yang_shu_lia = total[hasValue].shou_yang_shu_lia + cur.shou_yang_shu_lia);
-          return total;
-        }, []);
-        //console.log('日期数量11111111',newArray);
-        //创建一个长度为当前月份天数的数组
-        //console.log("getUnqualifiedData function before this newArrayNew is ", this.newArrayNum);
-        this.UnqualifiedNum = Array(dayNum)
-        this.UnqualifiedNum = this.UnqualifiedNum.fill(0)
-        //console.log('创建对应月份的数组',this.UnqualifiedNum)
-        //遍历拿到的数组,截取出月份对应的 // 2022-11-01
-        newArray.forEach(item =>{
-          let key = item.shou_yang_ri_qi_.slice(8,10) < 10 ?item.shou_yang_ri_qi_.slice(9,10) :item.shou_yang_ri_qi_.slice(8,10)
-          let value =parseInt(item.shou_yang_shu_lia)
-          this.UnqualifiedNum.splice(key - 1,1,value)
-        })
-        // console.log('getUnqualifiedData 处理好的数据',this.UnqualifiedNum)
-        return this.UnqualifiedNum;
-        // 到这里说明上面的数据已经处理好了
-        // 可以写return语句将处理好的数据返回
-        //拿到月份数组和y轴数量数组
-        this.entrustNumberInit(this.days,this.UnqualifiedNum)
-        
-        })
-    },
-      
-    //3.留样样品数据xx
-    getRetentionData(dayNum){
-      let sql4 = "select  shou_yang_ri_qi_,shou_yang_shu_lia from (select * from t_mjypdjb where  liu_yang_ri_qi_ ='' ) a where   a.shi_fou_liu_yang_ != '否'"
-        curdPost('sql',sql4).then(response => { 
-        let data = response.variables.data
-        // console.log('已收',data)
-        let newArray = data.reduce((total, cur, index) => {
-          let hasValue = total.findIndex(current => {
-            return current.shou_yang_ri_qi_ === cur.shou_yang_ri_qi_;
-          });
-          hasValue === -1 && total.push(cur);
-          hasValue !== -1 && (total[hasValue].shou_yang_shu_lia = total[hasValue].shou_yang_shu_lia + cur.shou_yang_shu_lia);
-          return total;
-        }, []);
-        //console.log('日期数量11111111',newArray);
-        //创建一个长度为当前月份天数的数组
-        this.RetentionNum = Array(dayNum)
-        this.RetentionNum = this.RetentionNum.fill(0)
-        //console.log('创建对应月份的数组',this.RetentionNum)
-        //遍历拿到的数组,截取出月份对应的 // 2022-11-01
-        newArray.forEach(item =>{
-          let key = item.shou_yang_ri_qi_.slice(8,10) < 10 ?item.shou_yang_ri_qi_.slice(9,10) :item.shou_yang_ri_qi_.slice(8,10)
-          let value =parseInt(item.shou_yang_shu_lia)
-          this.RetentionNum.splice(key - 1,1,value)
-        })
-        // console.log('getRetentionData 处理好的数据',this.RetentionNum)
-        return this.RetentionNum;
-        })
-
-    },
-    //不合格
-    getUnqualifiedData(dayNum){
-      let sql3 = "select * from t_mjypdjb where yan_shou_zhuang_t = '残缺'"
-        curdPost('sql',sql3).then(response => {
-        this.unqualifiedData = response.variables.data
-        let data = response.variables.data
-        let newArray = data.reduce((total, cur, index) => {
-          let hasValue = total.findIndex(current => {
-            return current.shou_yang_ri_qi_ === cur.shou_yang_ri_qi_;
-          });
-          hasValue === -1 && total.push(cur);
-          hasValue !== -1 && (total[hasValue].shou_yang_shu_lia = total[hasValue].shou_yang_shu_lia + cur.shou_yang_shu_lia);
-          return total;
-        }, []);
-        //console.log('日期数量11111111',newArray);
-        //创建一个长度为当前月份天数的数组
-        this.newArrayNum = Array(dayNum)
-        this.newArrayNum = this.newArrayNum.fill(0)
-        //console.log('创建对应月份的数组',this.newArrayNum)
-        //遍历拿到的数组,截取出月份对应的 // 2022-11-01
-        newArray.forEach(item =>{
-          let key = item.shou_yang_ri_qi_.slice(8,10) < 10 ?item.shou_yang_ri_qi_.slice(9,10) :item.shou_yang_ri_qi_.slice(8,10)
-          let value =parseInt(item.shou_yang_shu_lia)
-          this.newArrayNum.splice(key - 1,1,value)
-        })
-        //console.log('处理好的数据',this.newArrayNum)
-        //拿到月份数组和y轴数量数组
-        this.entrustNumberInit(this.days,this.newArrayNum)
-
-        })
-    },
-  
     //委托样品图表
     entrustNumberInit(dayArray,receivedData,unqualifiedData,retentionData){
       // console.log('拿到日期数组',dayArray)
@@ -456,6 +347,7 @@ export default {
       font-weight:600;
     }
     .chooseMonth{
+      display: none;
       width: 120px;
       line-height: 50px;
       margin-left: 10px;

+ 38 - 7
src/views/demo/yangPin/yangPinShuJu/MonthlyNumber.vue

@@ -24,6 +24,12 @@
  <script>
  import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
  export default {
+  props:{
+    NowTime1:{
+      type:String,
+      default:""
+    }
+  },
   data(){ 
     return{
       NowTime: '',
@@ -37,25 +43,49 @@
   },
   created(){
   },
+  watch: {  
+    NowTime1(newValue, oldValue) {
+      this.days.length=0
+      this.getNowTime()
+    }  
+  },
   mounted() {
     this.getNowTime()
   },
   methods:{
     //样品相关数据时间控件 :页面进来显示当前时间
     getNowTime(){
-      const nowDate = new Date();
-      const date = {
-        year: nowDate.getFullYear(),
-        month: nowDate.getMonth() + 1,
-      }
-      this.NowTime = date.year + '-' + date.month
+      // const nowDate = new Date();
+      // const date = {
+      //   year: nowDate.getFullYear(),
+      //   month: nowDate.getMonth() + 1,
+      // }
+      this.yearA = ''
+      this.monthA = ''
+      this.yearA = this.NowTime1.split('-')[0]
+      this.monthA = this.NowTime1.split('-')[1]
+      this.NowTime = this.yearA + '-' + this.monthA
       // console.log('页面第一次进来显示时间',date.year,date.month)
       //进来获取当前时间 之后获取当前月份天数 传给
       // console.log('页面显示的时间',this.NowTime)  //2022-11
       //把页面第一次进来的 当前年度月份 传给该方法处理 得到day及days
-      this.getDaysInMonth(date.year,date.month)
+      this.getDaysInMonth(this.yearA,this.monthA)
       
     },
+    // getNowTime(){
+    //   const nowDate = new Date();
+    //  const date = {
+    //    year: nowDate.getFullYear(),
+    //    month: nowDate.getMonth() + 1,
+    //  }
+    //  this.NowTime = date.year + '-' + date.month
+    //  // console.log('页面第一次进来显示时间',date.year,date.month)
+    //  //进来获取当前时间 之后获取当前月份天数 传给
+    //  // console.log('页面显示的时间',this.NowTime)  //2022-11
+    //  //把页面第一次进来的 当前年度月份 传给该方法处理 得到day及days
+    //  this.getDaysInMonth(date.year,date.month)
+      
+    // },
     //手动操作时间控件改变时间
     changeTime(e){
     // console.log('改变时间',e) //2022-07
@@ -261,6 +291,7 @@
       font-weight:600;
     }
     .chooseMonth{
+      display: none;
       width: 120px;
       line-height: 50px;
       margin-left: 10px;

+ 38 - 7
src/views/demo/yangPin/yangPinShuJu/MonthlyStatus.vue

@@ -22,6 +22,12 @@
 <script>
 import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
 export default {
+  props:{
+    NowTime1:{
+      type:String,
+      default:""
+    }
+  },
   data(){
     return{
       monthlyStatus:null,
@@ -31,19 +37,43 @@ export default {
   created(){
     this.getNowTime()
   },
+  watch: {  
+    NowTime1(newValue, oldValue) {
+      // this.days.length=0
+      this.getNowTime()
+    }  
+  },
   mounted(){
     this.getCheckSampleData()
   },
   methods:{
     //页面进来显示当前时间
     getNowTime(){
-      const nowDate = new Date();
-      const date = {
-        year: nowDate.getFullYear(),
-        month: nowDate.getMonth() + 1,
-      }
-      this.NowTime = date.year + '-' + date.month
+      // const nowDate = new Date();
+      // const date = {
+      //   year: nowDate.getFullYear(),
+      //   month: nowDate.getMonth() + 1,
+      // }
+      this.yearA = ''
+      this.monthA = ''
+      this.yearA = this.NowTime1.split('-')[0]
+      this.monthA = this.NowTime1.split('-')[1]
+      this.NowTime = this.yearA + '-' + this.monthA
+      // console.log('页面第一次进来显示时间',date.year,date.month)
+      //进来获取当前时间 之后获取当前月份天数 传给
+      // console.log('页面显示的时间',this.NowTime)  //2022-11
+      //把页面第一次进来的 当前年度月份 传给该方法处理 得到day及days
+      // this.getDaysInMonth(this.yearA,this.monthA)
+      this.getCheckSampleData()
     },
+    // getNowTime(){
+    //   const nowDate = new Date();
+    //   const date = {
+    //     year: nowDate.getFullYear(),
+    //     month: nowDate.getMonth() + 1,
+    //   }
+    //   this.NowTime = date.year + '-' + date.month
+    // },
     //用户操作改变时间
     changeTime(e){
       // console.log('改变时间',e) //2022-07
@@ -63,7 +93,7 @@ export default {
         let data1 = res1.variables.data.length
         let data2 = res2.variables.data.length
         let data3 = data1+ data2
-        // console.log('hhhhhhhhhh',data1,data2,data3)
+        console.log('hhhhhhhhhh',data1,data2,data3)
         this.enmonthlyStatusData(data1,data2,data3)
       })
     },
@@ -193,6 +223,7 @@ export default {
       font-weight:600;
     }
     .chooseMonth{
+      display: none;
       width: 120px;
       line-height: 50px;
       margin-left: 10px;

+ 60 - 30
src/views/demo/yangPin/yangPinShuJu/headerContent.vue

@@ -102,68 +102,98 @@ export default {
     },
     //委托样品总数:样品表所有
     getEntrustedTotalData(){
-      let sql1 = "select count(id_) as sum from t_mjypb" 
+      let sql1 = "select SUM(yang_pin_zong_shu) as sum from t_mjypb" 
       curdPost('sql',sql1).then(response => { 
-      let data = response.variables.data
-      this.EntrustedTotal = data[0].sum
+        let data = response.variables.data
+        if(data[0]===null){
+          this.EntrustedTotal = 0
+        }else(
+          this.EntrustedTotal = data[0].sum
+        )
+        // this.EntrustedTotal = data[0].sum
       })
       
     },
     //待收样数量:已委托,未收到
     getNotReceivedData(){
-      let sql2= "select count(id_) as sum from  t_mjypb WHERE wai_jian_ in(select id_ from t_mjwtsqb where zhuang_tai_ = '待样品接收')" 
+      let sql2= "select SUM(yang_pin_zong_shu) as sum from  t_mjypb WHERE wai_jian_ in(select id_ from t_mjwtsqb where zhuang_tai_ = '待样品接收')" 
       curdPost('sql',sql2).then(response => { 
-      let data = response.variables.data
-      this.NotReceiveNumber = data[0].sum
+        let data = response.variables.data
+        if(data[0]===null){
+          this.NotReceiveNumber = 0
+        }else(
+          this.NotReceiveNumber = data[0].sum
+        )
+        // this.NotReceiveNumber = data[0].sum
 
-    })
-  },
+      })
+    },
      //已经收样
      getReceivedData(){
-      let sql3= "select count(id_) as sum from t_mjypdjb" 
+      let sql3= "select SUM(jie_yang_shu_lian) as sum from t_mjypdjb" 
       curdPost('sql',sql3).then(response => { 
-      let data = response.variables.data
-      this.ReceiveNumber = data[0].sum
-    })
-
+        let data = response.variables.data
+        if(data[0]===null){
+          this.ReceiveNumber = 0
+        }else(
+          this.ReceiveNumber = data[0].sum
+        )
+        // this.ReceiveNumber = data[0].sum
+      })
      },
      //待检样品数量
      getStagingNumberData(){
       // let sql6 = "select * from t_mjypdjb"
-      let sql6= "select count(id_) as sum from t_mjypdjb where liu_zhuan_zhuang_ = '待检' " 
+      let sql6= "select SUM(jie_yang_shu_lian) as sum from t_mjypdjb where liu_zhuan_zhuang_ = '待检'" 
       curdPost('sql',sql6).then(response => { 
-      let data = response.variables.data
-      this.StagingNumber =data[0].sum
-      // console.log("样品登记表数据777",this.StagingNumber)
+        let data = response.variables.data
+        if(data[0]===null){
+          this.StagingNumber = 0
+        }else(
+          this.StagingNumber = data[0].sum
+        )
+        // console.log("样品登记表数据777",this.StagingNumber)
 
-    })
-      },
+      })
+    },
      //不合格样品数量
      getUnqualifiedData(){
-      let sql4= "select count(id_) as sum from t_mjypdjb where yan_shou_zhuang_t = '残缺'" 
+      let sql4= "select SUM(jie_yang_shu_lian) as sum from t_mjypdjb where yan_shou_zhuang_t = '残缺'" 
       curdPost('sql',sql4).then(response => { 
-      let data = response.variables.data
-      this.UnqualifiedNumber =data[0].sum
+        let data = response.variables.data
+        if(data[0]===null){
+          this.UnqualifiedNumber = 0
+        }else(
+          this.UnqualifiedNumber = data[0].sum
+        )
 
-    })
+      })
      },
      //留样样品数量
      getStayData(){
-      let sql5= "select  * from (select * from t_mjypdjb where  liu_yang_ri_qi_ ='' ) a where   a.shi_fou_liu_yang_ != '否'" 
+      let sql5= "select SUM(jie_yang_shu_lian) as sum from t_mjypdjb where shi_fou_liu_yang_!= '否'" 
       curdPost('sql',sql5).then(response => { 
-      let data = response.variables.data
-      this.RetentionNumber = data.length 
+        let data = response.variables.data
+        if(data[0]===null){
+          this.RetentionNumber = 0
+        }else(
+          this.RetentionNumber = data[0].sum
+        )
 
-    })
+      })
      },
      //样品完成检测数量
      getSuccessData(){
       let sql6= "select COUNT(t_mjypdjb.id_) as num from t_mjypdjb LEFT JOIN t_mjjcbg on t_mjypdjb.yang_pin_bian_hao = t_mjjcbg.yang_pin_bian_hao where t_mjjcbg.zhuang_tai_ = '报告待发放'" 
       curdPost('sql',sql6).then(response => { 
-      let data = response.variables.data
-      this.SuccessNumber = data[0].num
+        let data = response.variables.data
+        if(data[0]===null){
+          this.SuccessNumber = 0
+        }else(
+          this.SuccessNumber = data[0].num
+        )
 
-    })
+      })
      }
 
   },

+ 75 - 12
src/views/demo/yangPin/yangPinShuJu/index.vue

@@ -6,7 +6,27 @@
         <div class="headerContent">
            <!-- 标题装饰组件 -->
           <header-decoration :titleName="outputData.headerName"/> 
+          <div 
+            class="goBackButton" 
+            style="width: 12%;
+            height:2.825rem;
+            line-height: 2.825rem;
+            text-align:center;
+            position: absolute;
+            left: 20%;
+            top:3.8%;" >
+            <el-date-picker
+              class="chooseMonth"
+              v-model="NowTime1"
+              type="month"
+              @change="changeTime1"
+              format="yyyy-MM" 
+              value-format="yyyy-MM"
+              placeholder="请选择时间">
+            </el-date-picker>
+          </div>
           <!-- 返回按钮 -->
+
           <div 
             class="goBackButton" 
             @click.prevent="goBack()" 
@@ -15,7 +35,7 @@
             line-height: 2.825rem;
             text-align:center;
             position: absolute;
-            left: 20%;
+            right: 3%;
             top:4%;" >
             <dv-border-box-8>返回</dv-border-box-8>
           </div>
@@ -28,14 +48,14 @@
             line-height: 2.825rem;
             text-align:center;
             position: absolute;
-            left: 70%;
+            left: 63%;
             top:4%;
             color: #FFFFFF;">
               <dv-border-box-8 >上一次更新时间:{{this.sendTime}}</dv-border-box-8>
           </div>
           <!-- 样品头部数据总览 -->
           <div class="overView">
-            <headerContent  @getUpdateTime="getTime"></headerContent>
+            <headerContent  @getUpdateTime="getTime" :NowTime1="NowTime1+'-01'"></headerContent>
             <dv-decoration-10 style="width:100%;height:5px;" />
           </div> 
 
@@ -45,13 +65,13 @@
         <!-- 主体内容(图表部分) -->
         <div class="mainContent">
           <div class="entrust">
-            <div class="Number" ref="Number_refs"><entrustNumber/> </div>
+            <div class="Number" ref="Number_refs"><entrustNumber :NowTime1="NowTime1"/> </div>
             <!-- <div class="Type" ><entrustType/></div> -->
           </div>
           <div class="detection">
-            <div class="monthlyS" ref="MonthlyStatus_refs"><monthlyStatus/></div>
-            <div class="monthlyN" ref="MonthlyNumber_refs"><monthlyNumber/></div>
+            <div class="monthlyS" ref="MonthlyStatus_refs"><monthlyStatus  :NowTime1="NowTime1"/></div>
             <div class="annualS" ref="AnnualStatus_refs"><annualStatus/></div>
+            <div class="monthlyN" ref="MonthlyNumber_refs"><monthlyNumber  :NowTime1="NowTime1"/></div>
           </div>
         </div>
         
@@ -92,17 +112,18 @@ export default {
       sendTime:'',
       outputData:{
         headerName:"样品管理看板"
-      }
-
+      },
+      NowTime1:'',
+      value1:[]
     }
     
   },
-  mounted(){
-    // this.getTime()
+  mounted() {
+    this.getNowTime()
   },
   created() {
     //时间
-    this.currentTime()
+    // this.currentTime()
     if(screenfull.isEnabled && !screenfull.isFullscreen){
      this.allView()
       
@@ -123,7 +144,49 @@ export default {
     },
     goBack(){
       this.$router.back(-1)
-    }
+    },
+    getNowTime(){
+      const nowDate = new Date();
+      const date = {
+        year: nowDate.getFullYear(),
+        month: nowDate.getMonth() + 1,
+      }
+      this.NowTime1 = date.year + '-' + date.month
+      // console.log('页面第一次进来显示时间',date.year,date.month)
+      //进来获取当前时间 之后获取当前月份天数 传给
+      // console.log('页面显示的时间',this.NowTime1+"-01")  //2022-11
+      //把页面第一次进来的 当前年度月份 传给该方法处理 得到day及days
+      // this.getDaysInMonth(date.year,date.month)
+      
+    },
+    changeTime1(e){
+      // console.log('改变时间',e) //2022-07
+      // debugger
+      let year = e.slice(0,4)
+      let month = e.slice(5,7)
+      this.NowTime1 = year + '-' + month
+      // this.$set(this.data_key[index], "key", value);
+      // console.log('用户操作之后 页面显示的时间',this.NowTime,year,month) //2022-11 2022 11
+      //把年度月份传给getDaysInMonth()之前,先清理上一次数据
+      // this.entrustNumber.diswpose()  //这个方法干嘛的?? 为啥清不掉entrustNumberInit()方法的数据
+      this.days=[]
+      //在这里打印一下this.days数组
+      // console.log('用户操作了时间控件之后打印this.days数组',this.days)
+      //把用户操作时间控件改变的时间 的年度月份 传给该方法处理 得到day及days
+      // this.getDaysInMonth(year,month)
+    },
+    // getDaysInMonth(year,month){
+    //   let temp = new Date(year,month,0);
+    //   this.day = temp.getDate(); 
+    //   // console.log('处理好的年 月 月份天数',year,month,this.day);   //2022 11 30
+    //   //把月份对应天数转化为数组
+    //   for( let i=1;i <= this.day ;i++){
+    //     this.days.push(i)
+    //   }
+    //   // console.log('月份每一天',this.days)
+    //   this.getCheckSampleData(this.day)
+
+    // }
   }
 
 }

+ 1 - 1
src/views/statistics/item/s7sheBeiJiaoZhun.vue

@@ -45,7 +45,7 @@
     },
     data () {
       return {
-        title:'设备检定/校计划完成情况',
+        title:'设备检定/校计划完成情况',
         dialogOff:false,
       }
     },

+ 2 - 2
src/views/statistics/item/s7sheBeiJiaoZhunCol.vue

@@ -45,7 +45,7 @@
     },
     data () {
       return {
-        title:'设备检定/校计划完成情况',
+        title:'设备检定/校计划完成情况',
         dialogOff:false,
       }
     },
@@ -105,7 +105,7 @@
             // },
             xAxis: { 
               type: 'category',
-              data:['设备检定/校验计划总数', '设备检定/校验计划已完成数量']
+              data:['设备检定/校准计划总数', '设备检定/校准计划已完成数量']
 
             },
             yAxis: [

+ 1 - 1
src/views/statistics/item/s7sheBeiJiaoZhunCol2.vue

@@ -45,7 +45,7 @@
     },
     data () {
       return {
-        title:'各个设备鉴定/校验计划数量',
+        title:'各个设备检定/校准计划数量',
         dialogOff:false,
       }
     },

+ 3 - 3
src/views/statistics/properties/s7sheBeiJiaoZhunPro.vue

@@ -48,11 +48,11 @@
 
           <div v-for="(item,i) in data.t_mjsbjdxzjhzbNum.name" :key="i">
               <el-divider content-position="left">{{data.t_mjsbjdxzjhzbNum.name[i]}}</el-divider>
-              仪器已完成校次数 :<el-tag>{{data.t_mjsbjdxzjhzbNum.number[i]}} 次</el-tag>
+              仪器已完成校次数 :<el-tag>{{data.t_mjsbjdxzjhzbNum.number[i]}} 次</el-tag>
               <br>
-              仪器计划校次数 :<el-tag>{{data.t_mjsbjdxzjhzbNum.numberAll[i]}} 次</el-tag>
+              仪器计划校次数 :<el-tag>{{data.t_mjsbjdxzjhzbNum.numberAll[i]}} 次</el-tag>
               <br>
-              校完成率 :<el-tag>{{data.t_mjsbjdxzjhzbNum.val[i]}} %</el-tag>
+              校完成率 :<el-tag>{{data.t_mjsbjdxzjhzbNum.val[i]}} %</el-tag>
               <br>
             </div>
            <!-- <div class="dataCont" style="font-size: 14px;">