admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
jcdm-ui/src/views/main/kb/stationTerminal/index.vue
@@ -97,9 +97,15 @@
         </el-row>
         <el-row v-show="offlineFlag" style="margin-top: 20px">
           <el-button id="print" v-print="'#printMe'" type="primary">打印三联码</el-button>
           <el-button id="printBack" v-print="'#printMeBack'" type="primary">打印一联码</el-button><br>
           <el-button style="margin-top: 20px" id="print" v-print="'#printMe'" type="primary">打印三联码</el-button>
           <el-button style="display: none" @click="test1">生成二维码</el-button>
           <el-button style="display: none" @click="test2">生成
             <span style="font-size: 10px;margin-left: 52px">MADE IN CHINA</span><br>
             <br>
             <br>二维码</el-button>
           <el-button style="display: none" @click="test4">生成二维码</el-button>
           <el-button style="display: none" @click="test5">生成
             <span style="font-size: 10px;margin-left: 52px">MADE IN CHINA</span><br>
             <br>
             <br>二维码</el-button>
@@ -128,6 +134,19 @@
               <br>
               <br>
               <div ref="canvasWrapper" id="canvasWrapper2" style="display: flex;justify-content: center;margin-top: -27px"></div>
               <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 20px;margin-top: 3px">P{{printInfoData.partNumber}}#T{{headContent.sfcCode}}#V{{printInfoData.supplierCode}}#S{{printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span>
             </div>
           </div>
           <div style="display: none">
             <div  id="printMeBack">
               <br>
               <br>
               <div ref="canvasWrapper" id="canvasWrapper4" style="display: flex;justify-content: center;margin-top: -27px"></div>
               <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 20px;margin-top: 3px">P{{printInfoData.partNumber}}#T{{headContent.sfcCode}}#V{{printInfoData.supplierCode}}#S{{printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span>
               <br>
               <br>
               <div ref="canvasWrapper" id="canvasWrapper5" style="display: flex;justify-content: center;margin-top: -27px"></div>
               <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 20px;margin-top: 3px">P{{printInfoData.partNumber}}#T{{headContent.sfcCode}}#V{{printInfoData.supplierCode}}#S{{printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span>
             </div>
           </div>
@@ -544,6 +563,32 @@
        }
      )
    },
    test4(){
      document.getElementById('canvasWrapper4').innerHTML = '';
      this.$nextTick(() => {
          let qrCode = new QRCode('canvasWrapper4',{
            width: 120,
            height: 120,
            text: 'P'+this.printInfoData.partNumber+'#T'+ this.headContent.sfcCode +'#V'+this.printInfoData.supplierCode+'#S'+this.printInfoData.softwareVersion+'#H'+this.printInfoData.hardwareVersion+'#NBMS#',
            colorDark: '#000',
            colorLight: '#fff'
          })
        }
      )
    },
    test5(){
      document.getElementById('canvasWrapper5').innerHTML = '';
      this.$nextTick(() => {
          let qrCode = new QRCode('canvasWrapper5',{
            width: 120,
            height: 120,
            text: 'P'+this.printInfoData.partNumber+'#T'+ this.headContent.sfcCode +'#V'+this.printInfoData.supplierCode+'#S'+this.printInfoData.softwareVersion+'#H'+this.printInfoData.hardwareVersion+'#NBMS#',
            colorDark: '#000',
            colorLight: '#fff'
          })
        }
      )
    },
    print1() {
      // 使用插件打印方式
      // this.$print(this.$refs.printMe)
@@ -731,6 +776,8 @@
      if(this.headContent.processesCode === 'POP430'){
        this.test1()
        this.test2()
        this.test4()
        this.test5()
      }
      this.getListFormulaChild()
      // this.addOverStationCollection()
@@ -827,7 +874,11 @@
      };
      this.ws.onmessage = function (event) {
        if (event.data === "print") {
        if (event.data === "reportError") {
          self.$message.error('下线报工异常失败!');
        }else if (event.data === "reportSuccess") {
          self.$message('下线报工成功!');
        }else if (event.data === "print") {
          self.$message('postman调用打印方法打印!');
          // self.print1()
          document.getElementById('print').click();