|
@@ -130,7 +130,7 @@ export default {
|
|
|
watch: {
|
|
watch: {
|
|
|
obj() {
|
|
obj() {
|
|
|
this.getInit()
|
|
this.getInit()
|
|
|
- console.log(this.obj)
|
|
|
|
|
|
|
+ // console.log(this.obj)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -150,50 +150,18 @@ export default {
|
|
|
let jcxmList = []
|
|
let jcxmList = []
|
|
|
let idStr = ''
|
|
let idStr = ''
|
|
|
let wjStr = ''
|
|
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(','))
|
|
// 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 = []
|
|
let ypInfo = []
|
|
|
for(let item of this.obj){
|
|
for(let item of this.obj){
|
|
@@ -230,32 +198,6 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
this_.getLook2(ypInfo)
|
|
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){
|
|
getLook2(data){
|
|
@@ -271,9 +213,28 @@ export default {
|
|
|
})
|
|
})
|
|
|
this.list = list;
|
|
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){
|
|
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 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}')`
|
|
let sql = `select yang_pin_ming_che,yang_pin_bian_hao from t_mjypb where find_in_set(id_,'${id}')`
|
|
|
// console.log(sql)
|
|
// console.log(sql)
|