Bläddra i källkod

样品扫码脚本修改

ZZJ 3 år sedan
förälder
incheckning
5013080345

+ 6 - 31
src/views/system/jbdScan/js/manualConfirmationJS.js

@@ -71,6 +71,7 @@ export default {
           let ypbhList = [] // 样品编号列表
           let mjypbList = [] // 明鉴样品表
           let mjypbWJ = [] // 明鉴样品表外键
+          let ypmcList = []
           for (let yp in ypInfoList) { //样品数据
             let cfwz = ''
             if (ypInfoList[yp].jie_yang_shu_lian > ypInfoList[yp].shou_yang_shu_lia) {
@@ -137,6 +138,7 @@ export default {
             saoMaNumList.push(ypInfoList[yp].jie_yang_shu_lian) // 扫码数量
             jieYangQueRenZTList.push(ypInfoList[yp].jie_yang_zhuang_t) // 接收确认状态
             ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表
+            ypmcList.push(ypInfoList[yp].yang_pin_ming_che)
           }
 
 
@@ -158,7 +160,7 @@ export default {
                 let resArr = response.variables.data
                 if (resArr.length == 1) {
                   if (resArr[0].wei_zhi_zhuang_ta == "空余") {
-                    repostCurd('update', '{"tableName":"t_mjypcfwz","paramWhere":' + dWhere[num] + ',"paramCond":' + '{"wei_zhi_zhuang_ta":"占用","yang_pin_bian_hao":"' + ypbh[num] + '","ru_ku_shi_jian_":"' + this_.dateFormat() + '","shou_yang_ri_qi_":"' + uuidList[num] + '"}}').then(res => {
+                    repostCurd('update', '{"tableName":"t_mjypcfwz","paramWhere":' + dWhere[num] + ',"paramCond":' + '{"wei_zhi_zhuang_ta":"占用","yang_pin_bian_hao":"' + ypbh[num] +'","yang_pin_ming_che":"'  + ypmcList[num] + '","ru_ku_shi_jian_":"' + this_.dateFormat() + '","shou_yang_ri_qi_":"' + uuidList[num] + '"}}').then(res => {
                       // console.log(res, "原本位置为空余 ,新位置更新成功")
                       // alert('样品货位状态更新成功')
                     })
@@ -177,30 +179,20 @@ export default {
                     cfNew["cun_fang_lei_xing"] = resArr[0].cun_fang_lei_xing
                     cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian
                     cfNew["yang_pin_bian_hao"] = ypbh[num]
+                    cfNew["yang_pin_ming_che"] = ypmcList[num]
                     cfNew["ru_ku_shi_jian_"] = this_.dateFormat()
                     cfNew["shou_yang_ri_qi_"] = uuidList[num]
                     cfNewList.push(cfNew)
                     let uuid = cfNew["shou_yang_ri_qi_"];
-                    // console.log(cfNewList, 111111111111111)
                     repostCurd('add', '{"tableName":"t_mjypcfwz","paramWhere":' + JSON.stringify(cfNewList) + '}').then(res => {
-                      // alert('样品货位占位时重新生成货位')
                       let selectsql = "select id_ from t_mjypcfwz where shou_yang_ri_qi_='" + uuid + "'";
-                      // console.log('zzj selectsql',selectsql)
                       repostCurd('sql', selectsql).then(res => {
                         let dataid = res.variables.data[0].id_;
-                        // console.log(res.variables.data)
                         let abc = '{"biao_zhi_uuid_":"' + uuid + '"}'
-                        // console.log('zzj abc ',abc)
                         if (changeWeizhi && !changesyWeizhi) {
-                          // alert(1)
-                          repostCurd('update', '{"tableName":"t_mjypdjb","paramWhere":' + abc + ',"paramCond":' + '{"shou_yang_wei_zhi":"' + dataid + '"}}').then(res => {
-                            // alert('yang状态更新成功')
-                          })
+                          repostCurd('update', '{"tableName":"t_mjypdjb","paramWhere":' + abc + ',"paramCond":' + '{"shou_yang_wei_zhi":"' + dataid + '"}}')
                         } else {
-                          // alert(2)
-                          repostCurd('update', '{"tableName":"t_mjypdjb","paramWhere":' + abc + ',"paramCond":' + '{"liu_yang_wei_zhi_":"' + dataid + '"}}').then(res => {
-                            // alert('yang状态更新成功')
-                          })
+                          repostCurd('update', '{"tableName":"t_mjypdjb","paramWhere":' + abc + ',"paramCond":' + '{"liu_yang_wei_zhi_":"' + dataid + '"}}')
                         }
                       })
 
@@ -232,17 +224,11 @@ export default {
             let mjwtsqbIdList = []
             let mjfbbList = []
             let mjfbbWJList = []
-            // console.log('wjAllList',wjAllList)
             for (let i in wjAllList) {
               repostCurd('select', '{"tableName":"t_mjwtsqb","paramWhere":' + wjAllList[i] + '}').then(response => {
                 mjfbbWJList.push('{"wei_tuo_wai_jian_":"' + response.variables.data[0].id_ + '"}')
                 mjwtsqbAllResult.push(response.variables.data[0])
                 mjwtsqbIdList.push('{"id_":"' + response.variables.data[0].id_ + '"}')
-                // console.log('fbb=>',i,mjfbbWJList[i])
-                // repostCurd('select','{"tableName":"t_mjfbb","paramWhere":'+mjfbbWJList[i]+'}').then(response=>{
-                //                  console.log(response.variables)
-                //                       mjfbbList.push(response.variables.data)
-                //                    })
               })
             }
             setTimeout(() => {
@@ -251,21 +237,11 @@ export default {
                 narr.push(a)
               }
               repostCurd('selects', '{"tableName":"t_mjfbb","paramWhere":[' + narr + ']}').then(response => {
-                // console.log(response.variables)
                 mjfbbList.push(response.variables.data)
               })
             }, 1000)
 
             setTimeout(() => {
-
-              // let mjfbbArray = []
-              // for(let a in mjfbbList){
-              //   for(let b in mjfbbList[a]){
-              //     mjfbbArray.push(mjfbbList[a][b])
-              //   }
-              // }
-              // console.log('mjfbbArray',mjfbbArray)
-
               // console.log('mjfbbList',mjfbbList)
               // console.log('mjypbList',mjypbList)
               let rwb = []
@@ -274,7 +250,6 @@ export default {
                 index = mjypbList[0].jian_ce_xiang_mu2.split(",").length - 1
               }
               for (var i in mjypbList) {
-                // console.log('坐标',i,p)
                 let rwzb = {}
                 let wz_ = ypInfoList[i].shi_fou_liu_yang_ == "是" ? ypInfoList[i].liu_yang_wei_zhi_ : ypInfoList[i].shou_yang_wei_zhi //	对应的样品存放位置
                 rwzb["yang_pin_bian_hao"] = mjypbList[i].yang_pin_bian_hao //	取对应的样品编号

+ 4 - 1
src/views/system/jbdScan/js/sampleConfirmationJS.js

@@ -83,6 +83,7 @@ export default {
             let ypbhList = []   // 样品编号列表
             let mjypbList = [] // 明鉴样品表
             let mjypbWJ = [] // 明鉴样品表外键
+            let ypmcList = []
 
             for(let yp in ypInfoList){
               let cfwz = ''
@@ -148,6 +149,7 @@ export default {
               jieYangQueRenZTList.push(ypInfoList[yp].jie_yang_zhuang_t)    // 接收确认状态
 
               ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表
+              ypmcList.push(ypInfoList[yp].yang_pin_ming_che)
             }
               for(let index in ypIdList){
                 let WZtem = ypWeiZhi[index]==null?'':ypWeiZhi[index]
@@ -163,7 +165,7 @@ export default {
                     let resArr = response.variables.data
                     if(resArr.length == 1){
                         if(resArr[0].wei_zhi_zhuang_ta == "空余"){
-                          repostCurd('update','{"tableName":"t_mjypcfwz","paramWhere":'+dWhere[num]+',"paramCond":'+'{"wei_zhi_zhuang_ta":"占用","yang_pin_bian_hao":"'+ ypbh[num] + '","ru_ku_shi_jian_":"'+ this_.dateFormat() + '","shou_yang_ri_qi_":"'+ uuidList[num] + '"}}')
+                          repostCurd('update','{"tableName":"t_mjypcfwz","paramWhere":'+dWhere[num]+',"paramCond":'+'{"wei_zhi_zhuang_ta":"占用","yang_pin_bian_hao":"'+ ypbh[num] +'","yang_pin_ming_che":"'  + ypmcList[num] + '","ru_ku_shi_jian_":"'+ this_.dateFormat() + '","shou_yang_ri_qi_":"'+ uuidList[num] + '"}}')
                         }else if(resArr[0].wei_zhi_zhuang_ta == "占用"){
                           // 新增一条新的位置记录,使用旧的位置记录 修改它的样品编号,入库时间,标识UUID
                                 let cfNewList = []
@@ -179,6 +181,7 @@ export default {
                                 cfNew["cun_fang_lei_xing"] = resArr[0].cun_fang_lei_xing
                                 cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian
                                 cfNew["yang_pin_bian_hao"] = ypbh[num]
+                                cfNew["yang_pin_ming_che"] = ypmcList[num]
                                 cfNew["ru_ku_shi_jian_"] = this_.dateFormat()
                                 cfNew["shou_yang_ri_qi_"] = uuidList[num]
                                 cfNewList.push(cfNew)