-
admin
2024-06-18 bdb4046a1ed5358a94cc9ce846f2a1ec88e5d5ec
jcdm-ui/src/views/main/kb/preInstalledTerminal/index.vue
@@ -187,26 +187,24 @@
  </div>
</template>
<script>
import {listWorkReport} from "@/api/main/om/workReport/workReport";
import {listStationConf,getIpv4} from "@/api/main/sc/stationConf";
import {getIpv4, listStationConf} from "@/api/main/sc/stationConf";
import {
  listFormulaChild,
  checkMaterialCode,
  clearWorkpieceRelease,
  fistSetpNumber,
  noPageListFormulaChild,
  releaseCheck,
  updateResults,
  updateTighteningFormula,
  workpieceRelease, yzUpdateResults, yzUpdateTighteningFormula
  workpieceRelease,
  yzUpdateResults,
  yzUpdateTighteningFormula
} from "@/api/main/bs/formulaChild/formulaChild";
import MySerialPort from "@/utils/MySerialPort";
import USBDevice from "@/utils/usb.json";
import {listProductionOrde} from "@/api/main/om/productionOrde/productionOrde";
import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection";
import {
  addBasicParameters,
  addParamCollection,
  addTighteningParameters,
  replaceAssemblyCode,
  saveCampaignTimeParameters,
  replaceAssemblyCode, yzAddBasicParameters,
  yzAddBasicParameters,
} from "@/api/main/da/paramCollection/paramCollection";
export default {
@@ -329,20 +327,6 @@
    serialLink() {
      this.open1 = true
    },
    bindYzSfc(){
      if(this.headContent.sfcCode!==""&&this.headContent.yzSfcCode!==""){
        let param = {
          sfcCode: this.headContent.sfcCode,
          locationCode: this.headContent.processesCode,
          yzSfcCode: this.headContent.yzSfcCode
        }
        this.$message('可以绑定!');
        replaceAssemblyCode(param).then(response => {
        });
      }
    },
    Release(){
      // this.$message('portsList!'+this.portsList.length);
      if(this.btnType === "danger"){
@@ -382,6 +366,25 @@
      console.log(this.formulaChildParams)
      noPageListFormulaChild(this.formulaChildParams).then(response => {
        this.formulaChildList = response.rows;
        if (this.formulaChildList.length >0){
          let pos = 0
          const tempArr = this.formulaChildList.filter(x=> 'OK' === x.results)
          if (tempArr.length>0){
            pos = tempArr.length
            this.$nextTick(() => {
              let temp33 = document.getElementsByClassName('el-table__row')
              console.log('temp33',temp33)
              console.log('len',temp33.item(pos))
              if (temp33.length > 0){
                console.log('1111111111111111')
                let arr = temp33[pos-1]
                console.log('srr',arr)
                arr.scrollIntoView({ block: 'center' })
              }
            })
          }
        }
      });
    },
    endClear(){
@@ -391,8 +394,14 @@
      console.log(tab, event);
    },
    clearClick(){
      this.$message('这是一条清除消息提示');
      this.headContent.sfcCode = null
      const param = {
        productCode: '1P102S',
        locationCode: this.headContent.processesCode,
      }
      clearWorkpieceRelease(param).then(response => {});
      this.headContent.sfcCode = ''
      this.formulaChildList = [];
      this.$message('清除成功!');
    },
    scanCompleted(){
      this.$message('扫码完成'+this.content);
@@ -406,6 +415,10 @@
    },
    /** 查询工单列表 */
    async getList() {
      const param = {
        processesCode: this.headContent.processesCode,
      }
      fistSetpNumber(param).then(response => {});
      this.getListFormulaChild()
      this.addOverStationCollection()
    },
@@ -514,25 +527,41 @@
            locationCode: self.headContent.processesCode,
            productBarcode: self.headContent.sfcCode,
          }
          addTighteningParameters(param).then(response => {});
          yzUpdateTighteningFormula(param).then(response => {
            console.log(response.msg)
            if(response.msg === "1"){
                self.getListFormulaChild()
            }else {
              const param = {
                workOrderNo: self.workpieceInformation.workOrderNo,
                productCode: "1P102S",
                locationCode: self.headContent.processesCode,
                productBarcode: self.headContent.sfcCode,
              }
              saveCampaignTimeParameters(param).then(response => {});
              workpieceRelease(param).then(response => {});
              self.formulaChildList = [];
              self.headContent.sfcCode = '';
          if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){
            self.$message('未找到参数码,请检查参数码是否正确');
            return;
          }
          if(self.headContent.sfcCode === null||self.headContent.sfcCode ===''){
            self.$message('未找到总成码,请先扫码!');
            return;
          }
          checkMaterialCode(param).then(response => {
            if(response.msg === "2"){
              self.$message('未扫描物料码完毕!');
              return;
            }
          });
          yzUpdateTighteningFormula(param).then(response => {
          console.log(response)
          if(response.msg === "1" || response.msg === "3"){
              self.getListFormulaChild()
          }else {
            const param = {
              workOrderNo: self.workpieceInformation.workOrderNo,
              productCode: "1P102S",
              locationCode: self.headContent.processesCode,
              productBarcode: self.headContent.sfcCode,
            }
            saveCampaignTimeParameters(param).then(response => {});
            workpieceRelease(param).then(response => {});
            self.formulaChildList = [];
            self.headContent.sfcCode = '';
          }
        });
        addTighteningParameters(param).then(response => {});
        // self.getListFormulaChild()
        }
      };
    },
@@ -547,7 +576,7 @@
        console.log("串口收到数据-------------------"+scanValue)
        if(this.headContent.sfcCode !== ''){
          this.$message('扫描物料编码'+scanValue);
          this.$message('预装工位扫描物料编码'+scanValue);
          console.log(scanValue)
          this.serialPortMethod(scanValue)
        } else {