| | |
| | | // pingMessage: JSON.stringify({ type: 'ping' }) // 心跳请求信息 |
| | | // } |
| | | // 临时称重对象 |
| | | temporaryWeighObj:{ |
| | | skin:0, |
| | | hair:0, |
| | | clean:0 |
| | | temporaryWeighObj: { |
| | | skin: 0, |
| | | hair: 0, |
| | | clean: 0 |
| | | }, |
| | | infraredStatus:false// 红外状态 |
| | | infraredStatus: false // 红外状态 |
| | | }; |
| | | }, |
| | | watch:{ |
| | | realTimeWeigh(newV,oldV){ |
| | | if(this.weighList.orderTye == '外销'){ |
| | | if(this.weighList.skin == 0){ |
| | | this.temporaryWeighObj.skin = this.realTimeWeigh |
| | | watch: { |
| | | realTimeWeigh(newV, oldV) { |
| | | if (this.weighList.orderTye == '外销') { |
| | | if (this.weighList.skin == 0) { |
| | | this.temporaryWeighObj.skin = this.realTimeWeigh; |
| | | } else { |
| | | this.temporaryWeighObj.hair = this.realTimeWeigh |
| | | this.temporaryWeighObj.clean = this.temporaryWeighObj.hair - this.weighList.skin |
| | | this.temporaryWeighObj.hair = this.realTimeWeigh; |
| | | this.temporaryWeighObj.clean = this.temporaryWeighObj.hair - this.weighList.skin; |
| | | } |
| | | } else if(this.weighList.orderTye == '外购'){ |
| | | if(this.weighList.hair == 0){ |
| | | this.temporaryWeighObj.hair = this.realTimeWeigh |
| | | } else if (this.weighList.orderTye == '外购') { |
| | | if (this.weighList.hair == 0) { |
| | | this.temporaryWeighObj.hair = this.realTimeWeigh; |
| | | } else { |
| | | this.temporaryWeighObj.skin = this.realTimeWeigh |
| | | this.temporaryWeighObj = this.weighList.hair - this.temporaryWeighObj.skin |
| | | this.temporaryWeighObj.skin = this.realTimeWeigh; |
| | | this.temporaryWeighObj = this.weighList.hair - this.temporaryWeighObj.skin; |
| | | } |
| | | } |
| | | } |
| | |
| | | return false; |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | init() { |
| | |
| | | // 获取服务器传来的数据,做相应处理 |
| | | socket.onMessage(res => { |
| | | console.log('socketWeigh', res); |
| | | let nowWeighObj = JSON.parse(res.data.slice(7)) |
| | | let nowWeighObj = JSON.parse(res.data.slice(7)); |
| | | if (nowWeighObj.eqCode == this.weighHouseCode) { |
| | | if(nowWeighObj.eqInfraredStatus){ |
| | | this.infraredStatus = true |
| | | if (nowWeighObj.eqInfraredStatus) { |
| | | this.infraredStatus = true; |
| | | this.weighData.weigh = this.realTimeWeigh = nowWeighObj.weigh; |
| | | }else{ |
| | | this.infraredStatus = false |
| | | } else { |
| | | this.infraredStatus = false; |
| | | this.weighData.weigh = this.realTimeWeigh = nowWeighObj.weigh; |
| | | } |
| | | } |