From 169e9b4d59bdd763bb5bd1b5a9b092a1200e327b Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期一, 17 四月 2023 17:37:18 +0800 Subject: [PATCH] 增加原发信息,修复bug --- pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue | 74 ++++++++++++------------------------ 1 files changed, 25 insertions(+), 49 deletions(-) diff --git a/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue b/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue index f4a9bc0..3b31d83 100644 --- a/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue +++ b/pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue @@ -3,7 +3,7 @@ <view class="bangDanMessage"> <view class=""> <text>瀹㈡埛锛歿{ coalDetailsData.customerName || '' }}</text> - <text>鐭垮巶锛歿{ coalDetailsData.deptName || '' }}</text> + <text>鐭垮満锛歿{ coalDetailsData.deptName || '' }}</text> </view> <view class=""> <text>鐨噸锛歿{ coalDetailsData.skin || '' }}</text> @@ -11,7 +11,7 @@ <text>鍑�閲嶏細{{ coalDetailsData.clean || '' }}</text> </view> <view class=""> - <text>纾呭崟绫诲瀷锛歿{ coalDetailsData.orderTye || '' }}</text> + <text>纾呭崟绫诲瀷锛歿{ coalDetailsData.orderType || '' }}</text> <text>鐘舵�侊細{{ coalStatus[coalDetailsData.status] }}</text> </view> <view class=""> @@ -48,8 +48,8 @@ </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) { @@ -100,14 +100,19 @@ sceneId: '', gateCameraId: '', equipmentCode: '', - weigh: 30 - } + weigh: 0 + }, + // 鍘熷彂淇℃伅 + primarySkin: null, + primaryHair: null, + primaryClean: null }; }, onShow() { this.init(); }, computed: { + ...mapState(['globalweigh', 'globalinfraredStatus']), name() { return uni.getStorageSync('name'); }, @@ -141,7 +146,8 @@ 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; @@ -157,6 +163,10 @@ 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; } }); }, @@ -248,51 +258,13 @@ 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}&getWeightHouseObj=${JSON.stringify( - this.getWeightHouseObj - )}` + }&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('鍑虹幇閿欒锛岃閲嶆柊杩涘叆璇ラ〉闈紝閲嶈瘯锛侊紒'); }); }, // 鏀剧┖ @@ -301,14 +273,18 @@ }, // 鏀剧┖寮圭獥纭 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, '绗竴娆℃斁绌�'); if (res.code == 0) { - this.$u.toast('宸叉斁绌�'); + this.$u.toast('鎿嶄綔鎴愬姛'); this.evacuationModalShow = false; } else { - this.$u.toast('鏀剧┖澶辫触锛岃绋嶅悗閲嶈瘯'); + this.$u.toast('鎿嶄綔澶辫触锛岃绋嶅悗閲嶈瘯'); this.evacuationModalShow = false; } }); -- Gitblit v1.9.1