admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
jcdm-ui/src/views/main/cfkb/Instructions/index.vue
@@ -23,41 +23,50 @@
    </el-row>
    <el-row :gutter="5" style="margin-top: 5px">
      <el-col :span="24">
      <el-col :span="12">
        <el-tabs type="border-card"  style="height: 600px" v-model="activeName" @tab-click="changeMenu">
          <el-tab-pane name="first">
            <span slot="label"> <a class="el-icon-date"></a>首页</span>
            <el-col :span="24">
              <div>
                <div style="display: none" id="printMe">
                  <p style="margin-left: 25px">9900166410</p>
                  <p style="margin-left: 25px">HW001.001</p>
                  <p style="margin-left: 25px">SW002.005</p>
                  <br>
                  <p style="margin-left: 43px">{{printInfoData.partNumber}}</p>
                  <p style="margin-left: 43px">{{printInfoData.hardwareVersion}}</p>
                  <p style="margin-left: 43px">{{printInfoData.softwareVersion}}</p>
                  <br>
                  <br>
<!--                  <span style="font-size: 30px;font-weight: bold;margin-left: 40px;">GEELY</span><br>-->
                  <img style="width: 140px;height: 20px;margin-left: 25px" :src="require('@/assets/images/a8963a24920640508e96150a053fc41.png')">
                  <span style="margin-left: 60px">{{printInfoData.printModel}}</span><br>
                  <span style="margin-left: 63px">{{printInfoData.supplierCode}}</span><br>
                  <span style="margin-left: 40px">{{printInfoData.partNumber}}</span><br>
                  <span style="font-size: 10px;margin-left: 17px;">{{text1}}</span><br>
                  <span style="font-size: 10px;margin-left: 52px">MADE IN CHINA</span><br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <span style="font-size: 30px;font-weight: bold;margin-left: 25px;">GEELY</span><br>
                  <span style="font-size: 10px;margin-left: 14px">COMMERCIAL VEHICLE</span><br>
                  <span style="margin-left: 44px">H2155D</span><br>
                  <span style="margin-left: 44px">993083</span><br>
                  <span style="margin-left: 26px">9900166410</span><br>
                  <span style="font-size: 10px;margin-right: 10px">{{text1}}</span>
                  <div ref="canvasWrapper" id="canvasWrapper1" 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: 9px">P{{printInfoData.partNumber}}#T{{text1}}#V{{printInfoData.supplierCode}}#S{{printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span>
<!--                  <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P{{printInfoData.partNumber}}#T{{text1}}#V{{printInfoData.supplierCode}}#S{{// printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span>-->
                  <br>
                  <br>
                  <br>
                  <br>
                  <br>
                  <div ref="canvasWrapper" id="canvasWrapper" style="display: flex;justify-content: center;margin-top: -27px"></div>
                  <span style="font-size: 7px;word-break: break-all;display: flex;justify-content: center;">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span>
                  <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: 9px">P{{printInfoData.partNumber}}#T{{text1}}#V{{printInfoData.supplierCode}}#S{{printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span>
<!--                  <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P{{printInfoData.partNumber}}#T{{text1}}#V{{printInfoData.supplierCode}}#S{{// printInfoData.softwareVersion}}#H{{printInfoData.hardwareVersion}}#NBMS#</span>-->
                </div>
                <el-button @click="print1">打印</el-button>
                <el-button style="display: none" @click="test1">生成二维码</el-button>
                <el-button style="display: none" @click="test2">生成二维码</el-button>
              </div>
            </el-col>
          </el-tab-pane>
        </el-tabs>
      </el-col>
      <el-col :span="12">
        <el-input v-model="weightValue" placeholder="请输入称重数据"></el-input>
        <el-button @click="enterWeighing">录入</el-button>
      </el-col>
    </el-row>
    <el-dialog v-dialogpop-up :title="title" :visible.sync="open1" width="1000" append-to-body>
@@ -211,17 +220,26 @@
import USBDevice from "@/utils/usb.json";
import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection";
import {
  addTighteningParameters,
  addTighteningParameters, enterWeighing,
  replaceAssemblyCode,
  saveCampaignTimeParameters,
  yzAddBasicParameters,
} from "@/api/main/da/paramCollection/paramCollection";
import QRCode from "qrcodejs2";
import {listEquipmentArchives} from "@/api/main/em/equipmentArchives/equipmentArchives";
export default {
  name: "stationTerminal",
  data() {
    return {
      printInfoData: {
        softwareVersion: 'SW001.001', //软件版本号
        hardwareVersion: 'HW001.001', //硬件版本号
        printModel: 'H2155D', //型号
        partNumber: '9900200136', //零部件号
        supplierCode: '993983', //供应商编码
      },
      weightValue: '',
      showInput: true,
      serialPortContent: '',
      // 查询参数
@@ -336,6 +354,28 @@
    },
  },
  methods: {
    initializePrintInfoData(){
      listEquipmentArchives().then(response => {
        this.printInfoData.softwareVersion = response.rows[0].equipmentCode
        this.printInfoData.hardwareVersion = response.rows[0].equipmentName
        this.printInfoData.supplierCode = response.rows[0].equipmentSpec
        this.printInfoData.printModel = response.rows[0].equipmentBrand
        this.printInfoData.partNumber = response.rows[0].equipmentTypeName
      });
    },
    enterWeighing(){
      if(this.headContent.sfcCode ==='' || this.weightValue === '' ){
        this.$message.error('参数不全!');
      }else {
        let param = {
          productBarcode: this.headContent.sfcCode,
          weightValue: this.weightValue,
        }
        enterWeighing(param).then(response => {
          this.$message('录入完成!');
        });
      }
    },
    serialLink() {
      this.open1 = true
    },
@@ -448,16 +488,30 @@
      return false;
    },
    test1(){
      document.getElementById('canvasWrapper').innerHTML = '';
      document.getElementById('canvasWrapper1').innerHTML = '';
      this.$nextTick(() => {
        let qrCode = new QRCode('canvasWrapper',{
        let qrCode = new QRCode('canvasWrapper1',{
          width: 120,
          height: 120,
          text: this.text1,
          text: 'P'+this.printInfoData.partNumber+'#T'+ this.text1 +'#V'+this.printInfoData.supplierCode+'#S'+this.printInfoData.softwareVersion+'#H'+this.printInfoData.hardwareVersion+'#NBMS#',
          colorDark: '#000',
          colorLight: '#fff'
        })
      })
      }
      )
    },
    test2(){
      document.getElementById('canvasWrapper2').innerHTML = '';
      this.$nextTick(() => {
          let qrCode = new QRCode('canvasWrapper2',{
            width: 120,
            height: 120,
            text: 'P'+this.printInfoData.partNumber+'#T'+ this.text1 +'#V'+this.printInfoData.supplierCode+'#S'+this.printInfoData.softwareVersion+'#H'+this.printInfoData.hardwareVersion+'#NBMS#',
            colorDark: '#000',
            colorLight: '#fff'
          })
        }
      )
    },
    /** 入站增加过站采集记录 **/
@@ -490,7 +544,10 @@
    },
    initStation: async function () {
      await getIpv4().then(response => {
        this.initializePrintInfoData();
        this.StationConfQueryParams.ipAddress = response.msg
        console.log('查询到本工位IP为' + this.StationConfQueryParams.ipAddress)
      });
@@ -596,6 +653,7 @@
        const scanValue = this.myserialport.hex2atostr(value).replace(/[\r\n]/g, '');
        console.log("串口收到数据-------------------"+scanValue)
        this.test1()
        this.test2()
        this.text1 = scanValue
        this.headContent.sfcCode = scanValue
        // this.print1()