这位怪蜀黍 早上好,早起的鸟儿有虫吃噢!早起的虫儿被鸟吃,你是鸟儿还是虫儿?嘻嘻!

二维码生成及打印

Posted on   WALL*E  阅读(57)  评论(0编辑  收藏  举报
creatQrCode(hospitalId,ref,qrcodeWid) {//生成二维码
      var qrcode =''
      qrcode = new QRCode(ref, {
          text: hospitalId, // 需要转换为二维码的内容
          width: qrcodeWid,
          height: qrcodeWid,
          colorDark: '#000000',
          colorLight: '#ffffff',
          correctLevel: QRCode.CorrectLevel.H
      });
    }

async printBottle(row) {
 this.printData =row
      let prints = document.getElementsByClassName('prints')[0]
      let printBottl = document.getElementsByClassName('printBottl')[0]
      printBottl.classList.remove('printF')
      prints.classList.add('printF')
      let qrcodeWid=100
      //二维码
      this.$nextTick(()=>{
        this.printData.forEach((item,index)=>{
          this.creatQrCode(row.hospitalId,'qrCodeUrl'+index,qrcodeWid) 
        }) ;
        setTimeout(function(){
          window.print();
        },1000)
      })
    },
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类
点击右上角即可分享
微信分享提示