admin
2 天以前 4e91ae3c1ff41d0bf9f65d444c90c2583e69cdb7
jcdm-ui/src/views/main/cfkb/Instructions/index.vue
@@ -3,17 +3,17 @@
    <el-row :gutter="5">
      <el-col :span="7">
        <el-card shadow="never">
          <span class="head-font">工位编号 : {{headContent.processesCode}}</span>
          <span class="head-font">工位编号:{{headContent.processesCode}}</span>
        </el-card>
      </el-col>
      <el-col :span="7">
        <el-card shadow="never">
          <span class="head-font">工位名称 : {{headContent.processesName}}</span>
          <span class="head-font">工位名称:{{headContent.processesName}}</span>
        </el-card>
      </el-col>
      <el-col :span="10">
        <el-card shadow="never">
          <span class="head-font">产品序列号 :</span>
        <el-card shadow="never" body-style="padding: 10px;">
          <span class="head-font">产品序列号:</span>
          <el-input style="width: 50%;" v-model="headContent.sfcCode" placeholder="请输入内容"></el-input>
<!--          <el-button type="primary" id="print" v-print="'#printMe'">打印</el-button>-->
          <el-button type="primary" id="print" v-print="'#printMe'" style="display: none;">打印</el-button>
@@ -31,7 +31,7 @@
            <span slot="label"> <a class="el-icon-date"></a>首页</span>
            <el-col :span="24">
              <div>
                <div id="printMe" class="print_hide">
                <div id="printMe">
                  <offline-qualification-report :printParam="printParam"></offline-qualification-report>
                </div>
              </div>
@@ -54,13 +54,14 @@
import USBDevice from "@/utils/usb.json";
import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection";
import {
  addTighteningParameters, enterWeighing,
  addTighteningParameters, enterWeighing, getPrintOfflineReportInfo, listParamCollection,
  replaceAssemblyCode,
  saveCampaignTimeParameters,
  yzAddBasicParameters,
} from "@/api/main/da/paramCollection/paramCollection";
import QRCode from "qrcodejs2";
import OfflineQualificationReport from "@/views/components/offlineQualificationReport.vue";
import {listProductionOrde} from "@/api/main/om/productionOrde/productionOrde";
export default {
  name: "stationTerminal",
@@ -68,8 +69,7 @@
  data() {
    return {
      printParam: {
        key: '选项1',
        label: '黄金糕'
      },
      weightValue: '',
      showInput: true,
@@ -159,52 +159,7 @@
    //   this.connectWebsocket();
    // }, 3000);
  },
  mounted() {
    if ("serial" in navigator) {
      this.myserialport = new MySerialPort();
      this.getPorts();
      navigator.serial.addEventListener("connect", (e) => {
        this.$message.success("设备已连接");
        this.getPorts();
      });
      navigator.serial.addEventListener("disconnect", (e) => {
        this.$message.error("设备已断开");
      });
      this.restaurants = this.loadAll();
    } else {
      this.$message.error(
        "当前为HTTP模式或者浏览器版本过低,不支持网页连接串口"
      );
    }
  },
  computed: {
    isDisable() {
      return this.btnType === "danger";
    },
    printContent() {
      return {
        // id: '',
        // id: '#printMe',
        // preview: false,
      }
    }
  },
  methods: {
    enterWeighing(){
      if(this.headContent.sfcCode ==='' || this.weightValue === '' ){
        this.$message.error('参数不全!');
      }else {
        let param = {
          sfcCode: this.headContent.sfcCode,
          weightValue: this.weightValue,
        }
        enterWeighing(param).then(response => {
          this.$message('录入完成!');
        });
      }
    },
    serialLink() {
      this.open1 = true
    },
@@ -222,17 +177,6 @@
      }
    },
    Release(){
      // this.$message('portsList!'+this.portsList.length);
      if(this.btnType === "danger"){
        this.$message('连接了!!');
      }else {
        this.$message('mei连接了!');
      }
    },
    serialPortMethod(value){
      let formulaChildParams = {
        scanBarcode: value,
@@ -310,11 +254,22 @@
    },
    printBefore() {
      if (this.headContent.sfcCode !== '') {
        document.getElementById('print').click();
        listProductionOrde({productNum: this.headContent.sfcCode}).then(response => {
          let rowsData = response.rows[0];
          if(rowsData){
            getPrintOfflineReportInfo({productNum: this.headContent.sfcCode}).then(response => {
              this.printParam = response.data
              document.getElementById('print').click();
            });
          }else {
            this.$message.error('系统没有此工单,请重新扫码!');
          }
        });
      } else {
        alert('请先扫码');
        this.$message.error('请先扫码!');
      }
    },
    // print1() {
    //   if(this.headContent.sfcCode !== ''){
    //     // 新开页面打印
@@ -721,5 +676,16 @@
.el-table .success-row {
  background: #f0f9eb;
}
/*隐藏打印区域*/
/*#printMe {*/
/*  display: none;*/
/*}*/
/*!*打印时显示打印区域*!*/
/*@media print {*/
/*  #printMe {*/
/*    display: block;*/
/*  }*/
/*}*/
</style>