| | |
| | | </view> |
| | | <view class=""> |
| | | 红外: |
| | | <u--text :type="infraredStatus ? 'error' : 'success'" :text="infraredStatus ? '异常' : '正常'" size="34"></u--text> |
| | | <u--text :type="globalinfraredStatus ? 'error' : 'success'" :text="globalinfraredStatus ? '异常' : '正常'" size="34"></u--text> |
| | | </view> |
| | | <!-- <view class=""> |
| | | 雷达: |
| | |
| | | <u-button |
| | | type="primary" |
| | | text="确定称重" |
| | | :disabled="realTimeWeigh == 0 || infraredStatus" |
| | | :disabled="realTimeWeigh == 0 || globalinfraredStatus" |
| | | :loading="isConfirmWeighLoading" |
| | | loadingText="加载中" |
| | | loadingText="确认" |
| | | @click="confirmWeigh" |
| | | ></u-button> |
| | | <u-button type="primary" text="返回加减吨" :disabled="addAndSubtractCoalDisabled" @click="addAndSubtractCoal" class="jiajian"></u-button> |
| | |
| | | <script> |
| | | let socket = null; |
| | | import { webSocketUrl } from '@/api/request.js'; |
| | | import { mapState, mapMutations } from 'vuex'; |
| | | import toast from '../../../../../uni_modules/uview-ui/libs/config/props/toast'; |
| | | export default { |
| | | onLoad(params) { |
| | | console.log(params, '第二次放空参数'); |
| | | this.takeCoalId = params.takeCoalId; |
| | | this.weighData.sceneId = params.sceneId; |
| | | this.weighData.gateCameraId = params.gateCameraId; |
| | | this.weighData.equipmentCode = params.gateCameraCode; |
| | | this.weighHouseCode = params.weighHouseCode; |
| | | this.changeweighHouseCode(params.weighHouseCode); |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | watch: { |
| | | realTimeWeigh(newV, oldV) { |
| | | console.log(newV); |
| | | if (this.weighList.orderType == '外销' || this.weighList.orderType == '内销') { |
| | | if (this.weighList.skin == 0) { |
| | | // this.temporaryWeighObj.skin = this.realTimeWeigh; |
| | |
| | | this.temporaryWeighObj.clean = (this.weighList.hair - this.temporaryWeighObj.skin).toFixed(2); |
| | | } |
| | | } |
| | | }, |
| | | // 监听重量变化 |
| | | globalweigh(v) { |
| | | this.weighData.weigh = this.realTimeWeigh = v; |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.init(); |
| | | this.initWebSocket(); |
| | | // this.initWebSocket(); |
| | | }, |
| | | computed: { |
| | | ...mapState(['globalweigh', 'globalinfraredStatus']), |
| | | token() { |
| | | return uni.getStorageSync('token'); |
| | | }, |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | ...mapMutations(['changeweighHouseCode']), |
| | | init() { |
| | | // 获取称重信息 |
| | | this.$reqGet('weighList', { id: this.takeCoalId }).then(res => { |
| | |
| | | }); |
| | | this.isConfirmWeighLoading = false; |
| | | }, 1000); |
| | | } else { |
| | | this.$u.toast('称重失败,请稍后重试'); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | |
| | | socket.onMessage(res => { |
| | | console.log('socketWeigh', res); |
| | | let nowWeighObj = JSON.parse(res.data.slice(7)); |
| | | console.log(nowWeighObj); |
| | | // 一开始是weighHouseCode |
| | | if (nowWeighObj.eqCode == this.weighHouseCode) { |
| | | if (nowWeighObj.eqInfraredStatus) { |
| | | this.infraredStatus = true; |