春风项目四线(合箱线、总装线)
yyt
2024-06-03 5030f3d30ccc1bd16db371c6970a48103aff9191
jcdm-ui/src/views/main/cfkb/crankshaftUp/index.vue
@@ -57,7 +57,7 @@
              <span>{{queryParams.scanObject2}}</span>
            </el-descriptions-item>
            <el-descriptions-item label="结果">
              <span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.tileColor}}</span>
              <span  style="color: #FFFFFF;"  :style="{ backgroundColor: queryParams.tileColor }">{{queryParams.words}}</span>
            </el-descriptions-item>
          </el-descriptions>
          <el-divider></el-divider>
@@ -70,6 +70,7 @@
import VueQr from 'vue-qr'
import { listTileMatchRules, getTileMatchRules, delTileMatchRules, addTileMatchRules, updateTileMatchRules } from "@/api/main/bs/tileMatchRules/tileMatchRules";
import {listStationConf,getIp} from "@/api/main/sc/stationConf";
import {setBarcode1} from "@/api/main/da/opcuaconfig/opcuaconfig";
export default {
  name: "index",
  dicts: ['colour_hex','productseries','axisname','neckname','tilename'],
@@ -119,6 +120,7 @@
        neckParameterPosition: null,
        axisValue: null,
        neckValue: null,
        words:"",
        tileColor: null,
        createUser: null,
        updateUser: null,
@@ -153,11 +155,41 @@
      }
      const input = event.target
      const inputValue = input.value
      this.from.scanObject2 = inputValue
      //this.from.scanObject2 = inputValue
      if (event.key === 'Enter'){
        this.scannerFlag = true
        console.log('条码:',this.from.scanObject2)
        //扫描完成
        this.from.scanObject2 = inputValue
        //console.log('条码:',this.from.scanObject2,this.locationCode)
        if (typeof this.from.scanObject2 !== 'undefined'&& typeof this.locationCode !== 'undefined' ) {
          console.log('条码:',this.from.scanObject2,this.locationCode)
          setBarcode1({barcode:this.from.scanObject2,locationCode:this.locationCode}).then(res => {
            if (res.data===500){
              this.$message({
                message:res.msg,
                type:'warning'
              })
            }else {
              this.$message({
                message:'操作成功',
                type:'success'
              })
              console.log('返回:',res)
              this.queryParams.productSeries=res.sfcCode
              this.queryParams.scanObject1=res.paramValue
              this.queryParams.scanObject2=this.from.scanObject2
              this.queryParams.words="扫码成功";
              this.queryParams.tileColor='#00FF00';
            }
          })
        }
        //setBarcode({barcode:'1111',locationCode:'555555'})
        // //扫描完成
        // if(this.form.scanObject2 !== null && this.form.scanObject2 !== undefined){
        //   console.log('条码:',this.from.scanObject2,this.locationCode)
        //   //setBarcode(this.form.scanObject2,this.locationCode)
        // }
      }
    },