Преглед на файлове

fix sample unReceive sum

ZZJ преди 2 години
родител
ревизия
ceb117c115
променени са 1 файла, в които са добавени 7 реда и са изтрити 4 реда
  1. 7 4
      src/views/system/jbdHome/board/checkBoard.vue

+ 7 - 4
src/views/system/jbdHome/board/checkBoard.vue

@@ -331,16 +331,19 @@
                 const sql2 = `select zhuang_tai_ as state, DATE_FORMAT(create_time_, '%Y-%m-%d %H:%i:%s') as time from t_mjjcbg where create_time_ LIKE '${this.year}%'`
                 // 获取样品 收样/留样/不合格数量
                 const sql4 = `select count(a.id_) as receive, count(a.shi_fou_liu_yang_ = '是' or null) as keep, count(a.yan_shou_zhuang_t = '残缺' or null) as incomplete, count(a.jie_yang_zhuang_t = '待确认' or null) as unReceive from (select id_, shi_fou_liu_yang_, yan_shou_zhuang_t, jie_yang_zhuang_t from t_mjypdjb where create_time_ like '${this.month}%' group by yang_pin_bian_hao) as a`
+                const sql5 = `select count( CASE WHEN jie_yang_zhuang_t != '已确认' THEN 1 END ) AS unReceive FROM 	t_mjypb WHERE create_time_ LIKE '${this.month}%'`
                 Promise.all([
                     curdPost('sql', sql1),
                     curdPost('sql', sql2),
-                    curdPost('sql', sql4)
-                ]).then(([ res1, res2, res4]) => {
+                    curdPost('sql', sql4),
+                    curdPost('sql',sql5)
+                ]).then(([ res1, res2, res4,res5]) => {
                     this.bottomCardData.flag = false
                     const data1 = res1.variables && res1.variables.data
                     const data2 = res2.variables && res2.variables.data
                     const data4 = res4.variables && res4.variables.data
-                    // console.log(data1, data2, data3, data4)
+                    const data5 = res5.variables && res5.variables.data
+                    // console.log(data1, data2, data3, data4,data5)
 
                     let trust = new Array(12).fill(0)
                     let accepted = new Array(12).fill(0)
@@ -374,7 +377,7 @@
                     //         value: completeCount
                     //     }
                     // ]
-                    let sample = [data4[0].unReceive, data4[0].receive, data4[0].incomplete, data4[0].keep]
+                    let sample = [data5[0].unReceive, data4[0].receive, data4[0].incomplete, data4[0].keep]
                     this.bottomCardData.trust = trust
                     this.bottomCardData.accepted = accepted
                     this.bottomCardData.reports = reports