From 3fd84886a15713ece1ba34954f49fd1e075ef7be Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期三, 19 四月 2023 17:38:48 +0800 Subject: [PATCH] 改变称重监听,增加发运详情,修复电子提煤单错误 --- pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue | 70 ++++++++++++---------------------- 1 files changed, 25 insertions(+), 45 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 3b96ba9..e541d34 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,20 @@ sceneId: '', gateCameraId: '', equipmentCode: '', - weigh: 30 - } + weigh: 0, + sceneInOut: '' + }, + // 鍘熷彂淇℃伅 + primarySkin: null, + primaryHair: null, + primaryClean: null }; }, onShow() { this.init(); }, computed: { + ...mapState(['globalweigh', 'globalinfraredStatus']), name() { return uni.getStorageSync('name'); }, @@ -141,7 +147,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 +164,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; } }); }, @@ -244,53 +255,18 @@ this.weighData.sceneId = res.data.id; this.weighData.gateCameraId = res.data.lastEquipmentId; this.weighData.equipmentCode = res.data.lastEquipmentCode; + this.weighData.sceneInOut = res.data.sceneInOut; this.weighHouseCode = res.data.code; 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}&psrimaryClean=${this.primaryClean}&sceneInOut=${res.data.sceneInOut}` }); } 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('鍑虹幇閿欒锛岃閲嶆柊杩涘叆璇ラ〉闈紝閲嶈瘯锛侊紒'); }); }, // 鏀剧┖ @@ -299,6 +275,10 @@ }, // 鏀剧┖寮圭獥纭 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, '绗竴娆℃斁绌�'); -- Gitblit v1.9.1