| | |
| | | <view class="bangDanMessage"> |
| | | <view class=""> |
| | | <text>客户:{{ coalDetailsData.customerName || '' }}</text> |
| | | <text>矿厂:{{ coalDetailsData.deptName || '' }}</text> |
| | | <text>矿场:{{ coalDetailsData.deptName || '' }}</text> |
| | | </view> |
| | | <view class=""> |
| | | <text>皮重:{{ coalDetailsData.skin || '' }}</text> |
| | |
| | | <text>净重:{{ coalDetailsData.clean || '' }}</text> |
| | | </view> |
| | | <view class=""> |
| | | <text>磅单类型:{{ coalDetailsData.orderTye || '' }}</text> |
| | | <text>磅单类型:{{ coalDetailsData.orderType || '' }}</text> |
| | | <text>状态:{{ coalStatus[coalDetailsData.status] }}</text> |
| | | </view> |
| | | <view class=""> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | let socket = null; |
| | | import { webSocketUrl } from '@/api/request.js'; |
| | | import { mapState, mapMutations } from 'vuex'; |
| | | export default { |
| | | onLoad(value) { |
| | | if (value.orderPlanId && value.yyId) { |
| | |
| | | gateCameraId: '', |
| | | equipmentCode: '', |
| | | weigh: 0 |
| | | } |
| | | }, |
| | | // 原发信息 |
| | | primarySkin: null, |
| | | primaryHair: null, |
| | | primaryClean: null |
| | | }; |
| | | }, |
| | | onShow() { |
| | | this.init(); |
| | | }, |
| | | computed: { |
| | | ...mapState(['globalweigh', 'globalinfraredStatus']), |
| | | name() { |
| | | return uni.getStorageSync('name'); |
| | | }, |
| | |
| | | getTakeCoal() { |
| | | this.$reqGet('getTakeCoal', { takeCoalId: this.orderPlanId }).then(res => { |
| | | if (res.code == 0) { |
| | | this.coalDetailsData = res.data[0]; |
| | | console.log(res, '提煤单详情'); |
| | | this.coalDetailsData = res.data; |
| | | // 获取所在磅房参数赋值 |
| | | this.getWeightHouseObj.deptId = this.coalDetailsData.deptId; |
| | | this.getWeightHouseObj.filedId = this.coalDetailsData.filedId; |
| | |
| | | this.getServiceOpenid.filedId = this.coalDetailsData.filedId; |
| | | // 获取提煤单状态 |
| | | this.currentPageCoalStatus = this.coalDetailsData.status; |
| | | // 获取原发信息 |
| | | this.primarySkin = this.coalDetailsData.skinTwo; |
| | | this.primaryHair = this.coalDetailsData.hairTwo; |
| | | this.primaryClean = this.coalDetailsData.cleanTwo; |
| | | } |
| | | }); |
| | | }, |
| | |
| | | uni.navigateTo({ |
| | | url: `/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice?takeCoalId=${this.orderPlanId}&sceneId=${ |
| | | res.data.id |
| | | }&gateCameraId=${res.data.lastEquipmentId}&gateCameraCode=${res.data.lastEquipmentCode}&weighHouseCode=${res.data.code}` |
| | | }&gateCameraId=${res.data.lastEquipmentId}&gateCameraCode=${res.data.lastEquipmentCode}&weighHouseCode=${res.data.code}&primarySkin=${ |
| | | this.primarySkin |
| | | }&primaryHair=${this.primaryHair}&primaryClean=${this.primaryClean}` |
| | | }); |
| | | } else { |
| | | this.$u.toast('未在磅房,请前往磅房后再试!!'); |
| | | } |
| | | }); |
| | | }, |
| | | /** |
| | | * 初始化 weoSocket |
| | | */ |
| | | initWebSocket() { |
| | | let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}`; |
| | | socket = uni.connectSocket({ |
| | | url: wsUrl, |
| | | header: { |
| | | CLIENT_TOC: 'Y' |
| | | }, |
| | | complete: res => { |
| | | console.log(res, 'socket结果'); |
| | | } |
| | | }); |
| | | socket.onOpen(() => { |
| | | console.log('onOpen'); |
| | | }); |
| | | // 获取服务器传来的数据,做相应处理 |
| | | socket.onMessage(res => { |
| | | console.log('socketWeigh', res); |
| | | let nowWeighObj = JSON.parse(res.data.slice(7)); |
| | | if (nowWeighObj.eqCode == this.weighHouseCode) { |
| | | if (nowWeighObj.eqInfraredStatus) { |
| | | this.weighData.weigh = nowWeighObj.weigh; |
| | | } else { |
| | | this.weighData.weigh = nowWeighObj.weigh; |
| | | } |
| | | } |
| | | }); |
| | | socket.onClose(() => { |
| | | console.log('webSocketClose'); |
| | | this.$u.toast('磅房接口终端'); |
| | | }); |
| | | socket.onError(err => { |
| | | console.log('socket报错', err); |
| | | this.$u.toast('磅房接口暂时不能使用,请重新进入该页面,重试!!'); |
| | | }); |
| | | }, |
| | | // 放空 |
| | |
| | | }, |
| | | // 放空弹窗确认 |
| | | evacuationConfirm() { |
| | | this.weighData = { |
| | | ...this.weighData, |
| | | weigh: this.globalweigh |
| | | }; |
| | | let mix = Object.assign(this.weighData, this.getWeightHouseObj); |
| | | this.$reqPost('getOneEvacuation', mix, 'json').then(res => { |
| | | console.log(res, '第一次放空'); |
| | | this.evacuationModalShow = false; |
| | | if (res.code == 0) { |
| | | this.$u.toast('操作成功'); |
| | | this.evacuationModalShow = false; |
| | | } else { |
| | | this.$u.toast('操作失败,请稍后重试'); |
| | | this.evacuationModalShow = false; |
| | | } |
| | | }); |
| | | }, |
| | | // 放空弹窗取消 |