| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-row :gutter="5"> |
| | | <el-col :span="7"> |
| | | <el-col :span="5"> |
| | | <el-card shadow="never"> |
| | | <span class="head-font">工位编号 : {{headContent.processesCode}}</span> |
| | | <span hidden>{{headContent.inboundTime}}</span> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="7"> |
| | | <el-col :span="5"> |
| | | <el-card shadow="never"> |
| | | <span class="head-font">工位名称 : {{headContent.processesName}}</span> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <el-col :span="6"> |
| | | <el-card style="height: 57px" shadow="never"> |
| | | <span class="head-font">产品型号 : </span> |
| | | <el-select style="width: 70%;margin-top: -10px" v-model="selectProductCode" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-card shadow="never"> |
| | | <span class="head-font">产品序列号 : {{headContent.sfcCode}}</span> |
| | | <!-- <el-input v-model="content" style="float: right;width: 150px;" placeholder="请输入内容"></el-input>--> |
| | |
| | | <span slot="label"> <a class="el-icon-date"></a>首页</span> |
| | | <el-col :span="24"> |
| | | <el-table height="500" :cell-style="rowStyle" :data="formulaChildList"> |
| | | <el-table-column label="排序" width="60" align="center" type="index"> |
| | | <!-- <el-table-column label="排序" width="60" align="center" type="index">--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column label="拧紧步号" width="80" align="center" prop="stepSort"> |
| | | </el-table-column> |
| | | <el-table-column label="操作内容" :show-overflow-tooltip='true' align="center" prop="operationSteps"> |
| | | </el-table-column> |
| | | <el-table-column label="产品编号" align="center" prop="productCode"> |
| | | <el-table-column label="产品编号" width="80" align="center" prop="productCode"> |
| | | </el-table-column> |
| | | <el-table-column label="物料编码" align="center" prop="materialCode"> |
| | | <el-table-column label="物料编码" width="140" align="center" prop="materialCode"> |
| | | </el-table-column> |
| | | <el-table-column label="采集值" align="center" prop="collectData"> |
| | | </el-table-column> |
| | | <el-table-column label="结果" align="center" prop="results"> |
| | | <el-table-column label="结果" width="60" align="center" prop="results"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | |
| | | <script> |
| | | import {getIpv4, listStationConf} from "@/api/main/sc/stationConf"; |
| | | import { |
| | | checkMaterialCode, |
| | | clearWorkpieceRelease, |
| | | fistSetpNumber, |
| | | noPageListFormulaChild, |
| | | workpieceRelease, |
| | | yzUpdateResults, |
| | |
| | | import USBDevice from "@/utils/usb.json"; |
| | | import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection"; |
| | | import { |
| | | addTighteningParameters, |
| | | addTighteningParameters, preInstallOut, |
| | | replaceAssemblyCode, |
| | | saveCampaignTimeParameters, |
| | | yzAddBasicParameters, |
| | |
| | | name: "stationTerminal", |
| | | data() { |
| | | return { |
| | | selectProductCode: 'PE01B', |
| | | options: [{ |
| | | value: 'PE01B', |
| | | label: 'PE01B' |
| | | }, { |
| | | value: 'PE01F', |
| | | label: 'PE01F' |
| | | }, { |
| | | value: 'PE01H', |
| | | label: 'PE01H' |
| | | }], |
| | | showInput: true, |
| | | serialPortContent: '', |
| | | // 查询参数 |
| | |
| | | processesName: '贴标机-贴码', |
| | | sfcCode: '', |
| | | yzSfcCode: '', |
| | | inboundTime: '', |
| | | }, |
| | | workpieceInformation: { |
| | | workOrderNo: null, |
| | |
| | | }, |
| | | content: '', |
| | | activeName: 'first', |
| | | // url: "ws://192.168.2.248:8080/websocket/message/", |
| | | // url: "ws://10.103.210.248:8080/websocket/message/", |
| | | url: "ws://192.168.2.76:8080/websocket/message/", |
| | | message: "", |
| | | text_content: "", |
| | |
| | | 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"){ |
| | |
| | | } |
| | | |
| | | }, |
| | | |
| | | getCurrentTime() { |
| | | const now = new Date(); |
| | | const year = now.getFullYear(); |
| | | const month = this.padTimeUnit(now.getMonth() + 1); // 月份是从0开始的 |
| | | const day = this.padTimeUnit(now.getDate()); |
| | | const hours = this.padTimeUnit(now.getHours()); |
| | | const minutes = this.padTimeUnit(now.getMinutes()); |
| | | const seconds = this.padTimeUnit(now.getSeconds()); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | }, |
| | | padTimeUnit(value) { |
| | | return value.toString().padStart(2, '0'); |
| | | }, |
| | | serialPortMethod(value){ |
| | | let formulaChildParams = { |
| | | scanBarcode: value, |
| | | sfcBarcode: this.headContent.sfcCode, |
| | | workOrderNo: this.workpieceInformation.workOrderNo, |
| | | productCode: "1P102S", |
| | | productCode: this.selectProductCode, |
| | | locationCode: this.headContent.processesCode, |
| | | collectionTime: new Date() |
| | | } |
| | |
| | | }, |
| | | /** 查询配方配置子信息列表 */ |
| | | getListFormulaChild() { |
| | | this.formulaChildParams.productCode = "1P102S" |
| | | this.formulaChildParams.productCode = this.selectProductCode |
| | | this.formulaChildParams.processesCode = this.headContent.processesCode |
| | | console.log(this.formulaChildParams) |
| | | noPageListFormulaChild(this.formulaChildParams).then(response => { |
| | |
| | | console.log(tab, event); |
| | | }, |
| | | clearClick(){ |
| | | this.$message('这是一条清除消息提示'); |
| | | this.headContent.sfcCode = null |
| | | const param = { |
| | | productCode: this.selectProductCode, |
| | | locationCode: this.headContent.processesCode, |
| | | } |
| | | clearWorkpieceRelease(param).then(response => {}); |
| | | this.headContent.sfcCode = '' |
| | | this.formulaChildList = []; |
| | | this.$message('清除成功!'); |
| | | }, |
| | | scanCompleted(){ |
| | | this.$message('扫码完成'+this.content); |
| | |
| | | }, |
| | | /** 查询工单列表 */ |
| | | async getList() { |
| | | const param = { |
| | | productCode: this.selectProductCode, |
| | | processesCode: this.headContent.processesCode, |
| | | } |
| | | fistSetpNumber(param).then(response => {}); |
| | | this.getListFormulaChild() |
| | | this.addOverStationCollection() |
| | | // this.addOverStationCollection() |
| | | }, |
| | | |
| | | /** 入站增加过站采集记录 **/ |
| | |
| | | this.ws = new WebSocket(wsuri); |
| | | const self = this; |
| | | this.ws.onopen = function (event) { |
| | | this.$message('websocket连接成功!'); |
| | | self.$message('websocket连接成功!'); |
| | | }; |
| | | this.ws.onmessage = function (event) { |
| | | if (event.data === "IN") { |
| | | self.cakeLamp.InPlace = 1; |
| | | } else if (event.data === "IN0") { |
| | | self.cakeLamp.InPlace = 0; |
| | | } else if (event.data === "OUT") { |
| | | console.log("out") |
| | | |
| | | const param = { |
| | | workOrderNo: self.workpieceInformation.workOrderNo, |
| | | productCode: "1P102S", |
| | | locationCode: self.headContent.processesCode, |
| | | productBarcode: self.headContent.sfcCode, |
| | | } |
| | | // saveCampaignTimeParameters(param).then(response => {}); |
| | | // self.cakeLamp.release = 1; |
| | | workpieceRelease(param).then(response => {}); |
| | | self.formulaChildList = []; |
| | | self.headContent.sfcCode = ''; |
| | | console.log(self.formulaChildList) |
| | | } else if (event.data === "END") { |
| | | // const param = { |
| | | // workOrderNo: self.workpieceInformation.workOrderNo, |
| | | // productCode: self.workpieceInformation.productCode, |
| | | // locationCode: self.headContent.processesCode, |
| | | // productBarcode: self.headContent.sfcCode, |
| | | // } |
| | | // saveCampaignTimeParameters(param).then(response => {}); |
| | | // self.endClear() |
| | | // workpieceRelease(param).then(response => {}); |
| | | } else if (event.data.includes("[")) { |
| | | if(event.data.includes("[")) { |
| | | let formulaChilds = ""; |
| | | self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort); |
| | | self.formulaChildList |
| | |
| | | tightenTheArray: event.data, |
| | | paramCode: formulaChilds.paramCode, |
| | | // workOrderNo: self.workpieceInformation.workOrderNo, |
| | | productCode: "1P102S", |
| | | productCode: self.selectProductCode, |
| | | locationCode: self.headContent.processesCode, |
| | | productBarcode: self.headContent.sfcCode, |
| | | spareField2: formulaChilds.spareField2, |
| | | spareField3: formulaChilds.spareField3, |
| | | spareField4: formulaChilds.spareField4, |
| | | stepSort: formulaChilds.stepSort |
| | | } |
| | | addTighteningParameters(param).then(response => {}); |
| | | yzUpdateTighteningFormula(param).then(response => { |
| | | console.log(response.msg) |
| | | if(response.msg === "1"){ |
| | | self.getListFormulaChild() |
| | | if(self.headContent.sfcCode === null||self.headContent.sfcCode ===''){ |
| | | self.$message('未找到总成码,请先扫码!'); |
| | | return; |
| | | } |
| | | if(formulaChilds.paramCode === null||formulaChilds.paramCode ===''){ |
| | | self.$message('未找到参数码,请检查参数码是否正确'); |
| | | return; |
| | | } |
| | | |
| | | checkMaterialCode(param).then(response => { |
| | | if(response.msg === "2"){ |
| | | self.$message('未扫描物料码完毕!'); |
| | | }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 = ''; |
| | | yzUpdateTighteningFormula(param).then(response => { |
| | | console.log(response) |
| | | if(response.msg === "1" || response.msg === "3"){ |
| | | self.getListFormulaChild() |
| | | }else { |
| | | const param = { |
| | | id: formulaChilds.id, |
| | | locationCode: self.headContent.processesCode, |
| | | productBarcode: self.headContent.sfcCode, |
| | | inboundTime: self.headContent.inboundTime, |
| | | productCode: self.selectProductCode, |
| | | workOrderNo: "-", |
| | | |
| | | } |
| | | preInstallOut(param).then(response => {}); |
| | | workpieceRelease(param).then(response => {}); |
| | | self.formulaChildList = []; |
| | | self.headContent.sfcCode = ''; |
| | | } |
| | | }); |
| | | addTighteningParameters(param).then(response => {}); |
| | | } |
| | | }); |
| | | } |
| | |
| | | console.log("串口收到数据-------------------"+scanValue) |
| | | |
| | | if(this.headContent.sfcCode !== ''){ |
| | | this.$message('扫描物料编码'+scanValue); |
| | | this.$message('预装工位扫描物料编码'+scanValue); |
| | | console.log(scanValue) |
| | | this.serialPortMethod(scanValue) |
| | | } else { |
| | | this.headContent.sfcCode = scanValue; |
| | | this.getList() |
| | | if(scanValue.includes("P9900183275") || scanValue.includes("P9900173252")){ |
| | | this.headContent.sfcCode = scanValue; |
| | | this.headContent.inboundTime = this.getCurrentTime(); |
| | | this.getList() |
| | | }else { |
| | | this.$message.error('总成码扫描错误!'); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |