|
|
@@ -3,7 +3,7 @@
|
|
|
<el-dialog
|
|
|
width="21cm"
|
|
|
height="10cm"
|
|
|
- :modal-append-to-body='false' title="样品标签" :visible.sync="scanVisible">
|
|
|
+ :modal-append-to-body='true' :append-to-body="true" title="样品标签" :visible.sync="scanVisible">
|
|
|
<!-- 表单是否显示 -->
|
|
|
<div style="height:500px">
|
|
|
<div ref="qrcode" id="box">
|
|
|
@@ -25,7 +25,7 @@
|
|
|
<div>样本编号:</div>
|
|
|
<div>{{ item1.serial }}</div>
|
|
|
</div>
|
|
|
- <div class="lh" style="margin-left: 18px">
|
|
|
+ <div class="lh" style="margin-left: 8px">
|
|
|
<div>样品数量:</div>
|
|
|
<div>{{ index2 + 1 }}/{{ item1.num }}支</div>
|
|
|
</div>
|
|
|
@@ -113,7 +113,8 @@ export default {
|
|
|
num: 5
|
|
|
// condition: 5
|
|
|
}],
|
|
|
- visible: true
|
|
|
+ visible: true,
|
|
|
+ sampleShuLiangList:[]
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -130,14 +131,42 @@ export default {
|
|
|
this.$refs.easyPrint.print()
|
|
|
},
|
|
|
getInit() {
|
|
|
- console.log('getInit:',this.obj)
|
|
|
+ // console.log('getInit:',this.obj)
|
|
|
+ this.sampleShuLiangList = []
|
|
|
var idStr = '';
|
|
|
this.obj.forEach(item=>{
|
|
|
- idStr += item + ','
|
|
|
+ idStr += item.split(" ")[0] + ','
|
|
|
+ this.sampleShuLiangList.push(parseInt(item.split(" ")[1]))
|
|
|
})
|
|
|
idStr = idStr.substring(0,idStr.length-1);
|
|
|
- console.log(idStr)
|
|
|
- this.getLook(idStr)
|
|
|
+ this.getLooks(idStr,this.sampleShuLiangList)
|
|
|
+
|
|
|
+ },
|
|
|
+ getLooks(id,list) {
|
|
|
+ console.log(id)
|
|
|
+ console.log(list)
|
|
|
+ let sql = `select * from t_mjypb where find_in_set(id_,'${id}')`
|
|
|
+ // console.log(sql)
|
|
|
+ repostCurd("sql", sql).then(res => {
|
|
|
+ const data = res.variables.data
|
|
|
+ let list = []
|
|
|
+ data.forEach((item,index) => {
|
|
|
+ // let num = parseInt(item.shou_yang_shu_lia)
|
|
|
+ let num = this.sampleShuLiangList[index]
|
|
|
+ // console.log(num)
|
|
|
+ if(typeof(num) == 'number'){
|
|
|
+ let o = {
|
|
|
+ name: item.yang_pin_ming_che,
|
|
|
+ serial: item.yang_pin_bian_hao,
|
|
|
+ // type: item.jian_ce_xiang_mu_,
|
|
|
+ num: num,
|
|
|
+ // condition: item.yang_ben_yun_shu_
|
|
|
+ }
|
|
|
+ list.push(o)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.list = list
|
|
|
+ })
|
|
|
},
|
|
|
getLook(id) {
|
|
|
// console.log(id)
|