Эх сурвалжийг харах

Merge branch 'master' of http://119.23.210.103:3000/wy/mj_firm_former

cfort 2 жил өмнө
parent
commit
db70144225

+ 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

+ 33 - 72
src/views/system/jbdScan/goods/sampleTag.vue

@@ -130,7 +130,7 @@ export default {
   watch: {
     obj() {
       this.getInit()
-      console.log(this.obj)
+    //   console.log(this.obj)
     }
   },
   created() {
@@ -150,50 +150,18 @@ export default {
         let jcxmList = []
         let idStr = ''
         let wjStr = ''
-       if(this.obj.length > 0 && this.obj[0].indexOf(" ") != -1){
-        for(let item of this.obj){
-            idStr += item.split(" ")[0] + ','
-            wjStr += item.split(" ")[1] + ','
-            jcxmList.push(item.split(" ")[2].split(','))
-        }
-        idStr = idStr.substring(0,idStr.length-1);
-        wjStr = wjStr.substring(0,wjStr.length-1);
-        this.getLookJCXM(idStr,wjStr,jcxmList) 
-
-        //  this.obj.forEach((item,index)=>{
-        //     let jcxmList = []
-        //     let tcxmList = []
-        //     let idStr = item.split(" ")[0];
-        //     let wjStr = item.split(" ")[1];
-        //     // idStr += item.split(" ")[0] + ','
-        //     // wjStr += item.split(" ")[1] + ','
+       if(this.obj.length > 0 && this.obj[0].sampleNo != undefined){
+        console.log(this.obj[0].sampleNo)
+        this.formPrintSampleTag(this.obj);
+        // for(let item of this.obj){
+        //     idStr += item.split(" ")[0] + ','
+        //     wjStr += item.split(" ")[1] + ','
         //     jcxmList.push(item.split(" ")[2].split(','))
-        //     tcxmList.push(item.split(" ")[3].split(','))
-        //     this.getLookJCXM(idStr,wjStr,jcxmList,tcxmList) 
-        //     if(index === this.obj.length -1){
-        //         this.list = this.finalList
-        //     }
-        // })
-        // setTimeout(() => {
-        //     console.log('obj',this.obj.length)
-        //     console.log('finalList',this.finalList.length)
-        //     console.log('finalList',this.finalList)
-        //     this.list = this.finalList
-        // }, 3000);
-      }
-      
-/*
-      if(this.obj.length > 0 && this.obj[0].indexOf(" ") != -1){
-        this.obj.forEach(item=>{
-        idStr += item.split(" ")[0] + ','
-        wjStr += item.split(" ")[1] + ','
-        this.jcxmList.push(item.split(" ")[2].split(','))
-        })
-        idStr = idStr.substring(0,idStr.length-1);
-        wjStr = wjStr.substring(0,wjStr.length-1);
-        this.getLookJCXM(idStr,wjStr,this.jcxmList) 
-      }
-      */else{
+        // }
+        // idStr = idStr.substring(0,idStr.length-1);
+        // wjStr = wjStr.substring(0,wjStr.length-1);
+        // this.getLookJCXM(idStr,wjStr,jcxmList) 
+      }else{
         // 列表标签打印
         let ypInfo = []
         for(let item of this.obj){
@@ -230,32 +198,6 @@ export default {
           })
         }
           this_.getLook2(ypInfo)
-       
-        /*
-        let ypInfo = []
-        let promiseArr = [];
-        let p = new Promise((resolve,reject) =>{
-              let sql1 = `select yang_pin_ming_che,yang_pin_bian_hao,jian_ce_xiang_mu_ from t_mjypdjb where find_in_set(id_,'${this.obj}')`
-              repostCurd('sql',sql1).then(res=>{
-                const data =  res.variables.data 
-                data.forEach((item,index)=>{
-                  let sql2 =  `select xiang_mu_bian_hao from t_mjjcnlfw where find_in_set(id_,'${item.jian_ce_xiang_mu_}')`
-                  repostCurd('sql',sql2).then(r=>{
-                    let result = r.variables.data
-                    data[index].xiang_mu_bian_hao = result
-                  })
-                })
-                this_.ypInfo = data
-                // console.log(this_.ypInfo)
-              })
-        })
-        promiseArr.push(p)
-        Promise.all([p]).then(([res]) =>{
-          console.log(res)
-          this_.getLook2(this_.ypInfo);
-        })
-        */
-
       }
     },
     getLook2(data){
@@ -271,9 +213,28 @@ export default {
       })
       this.list = list;
     },
+    /*
+        表单内 打印标签方法
+    */
+   formPrintSampleTag(objList){
+      let jcxmSQL = `select id_,xiang_mu_bian_hao from t_mjjcnlfw`
+      repostCurd("sql", jcxmSQL).then(res=>{
+        const jcxmInfo = res.variables.data
+        let list = []
+        objList.forEach(item =>{
+            let o = {
+                name: item.sampleName,
+                serial: item.sampleNo,
+                condition: jcxmInfo.find(x => x.id_ == item.jianCeProject).xiang_mu_bian_hao //item.jianCeProject
+            }
+            list.push(o)
+        })
+        this.list = list
+      })
+    
+   },
     getLookJCXM(id,wjStr,jcxmList){
-    //   console.log(id,wjStr,jcxmList)    
-    //   let jcxmSQL = `select xiang_mu_bian_hao from t_mjjcnlfw where find_in_set(id_,'${jcxmList}') union all select xiang_mu_bian_hao from t_mjjcnlfw where find_in_set(id_,'${tcxmList}')`
+      console.log(id,wjStr,jcxmList)    
       let jcxmSQL = `select id_,xiang_mu_bian_hao from t_mjjcnlfw`
       let sql = `select yang_pin_ming_che,yang_pin_bian_hao from t_mjypb where find_in_set(id_,'${id}')`
     //   console.log(sql)