From 984b4fea0cb45ad57bb2ecd85b06d2937e368dd0 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期三, 20 三月 2024 18:18:27 +0800
Subject: [PATCH] feat:超出平均皮重限制

---
 api/publicInterface.js                                                                  |    4 ++--
 pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue |   43 ++++++++++++++++++++++++++++++++++++-------
 api/globalApi.js                                                                        |    3 ++-
 api/request.js                                                                          |    4 ++--
 pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue        |    2 +-
 5 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/api/globalApi.js b/api/globalApi.js
index 837994c..93d157b 100644
--- a/api/globalApi.js
+++ b/api/globalApi.js
@@ -539,5 +539,6 @@
 	useEqCodeGetCameraUrl: {
 		url: '/wrzs/jcequipment/useEqCodeGetCameraUrl',
 		method: 'GET'
-	}
+	},
+
 }
\ No newline at end of file
diff --git a/api/publicInterface.js b/api/publicInterface.js
index 1cf0ebd..b76ee0e 100644
--- a/api/publicInterface.js
+++ b/api/publicInterface.js
@@ -3,7 +3,7 @@
 
 
 import { BaseUrl as wrBaseUrl } from '@/api/request.js'
-// const BaseUrl = 'http://192.168.0.110:9999'
+// const BaseUrl = 'http://192.168.0.22:9999'
 // const BaseUrl = 'http://192.168.0.22:9999'
 const BaseUrl = 'https://mx.jzeg.cn:9195'
 // const BaseUrl = 'http://192.168.31.17:9999'
@@ -174,7 +174,7 @@
 				'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app
 				'content-type': 'application/x-www-form-urlencoded',
 				'clientToc': 'Y',
-				'CLIENT_TOC': 'Y',
+				'CLIENT_TOC ': 'Y',
 				'isToken': 'false'
 			},
 			success: res => {
diff --git a/api/request.js b/api/request.js
index 8a2a8c5..a369ab4 100644
--- a/api/request.js
+++ b/api/request.js
@@ -103,8 +103,8 @@
 // const BaseUrl = "http://192.168.0.110:9896"
 // const webSocketUrl = "ws://192.168.0.110:9896/wrzs/ws/info"
 
-// const BaseUrl = "http://192.168.0.102:9896"
-// const webSocketUrl = "ws://192.168.0.102:9896/wrzs/ws/info"
+// const BaseUrl = "http://192.168.0.22:9896"
+// const webSocketUrl = "ws://192.168.0.22:9896/wrzs/ws/info"
 
 export const onlineurl = 'https://mx.jzeg.cn:9195';
 // const BaseUrl = "http://192.168.0.100:9997";
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 1f32a0e..7bb0318 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
@@ -730,7 +730,7 @@
 							res.data.id
 						}&gateCameraId=${res.data.lastEquipmentId}&gateCameraCode=${res.data.lastEquipmentCode}&weighHouseCode=${res.data.code}&primarySkin=${
 							this.primarySkin
-						}&primaryHair=${this.primaryHair}&primaryClean=${this.primaryClean}&sceneInOut=${res.data.sceneInOut}&overTmWaixiao=${this.overTmWaixiao}`
+						}&primaryHair=${this.primaryHair}&primaryClean=${this.primaryClean}&sceneInOut=${res.data.sceneInOut}&overTmWaixiao=${this.overTmWaixiao}&deptId=${this.getWeightHouseObj.deptId }`
 						});
 					} else {
 						this.$u.toast(res.msg ? res.msg : '鏈湪纾呮埧锛岃鍓嶅線纾呮埧鍚庡啀璇曪紒锛�');
diff --git a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
index 5992771..45ad154 100644
--- a/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
+++ b/pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
@@ -189,8 +189,8 @@
 		</view>
 		<view v-show="isExceedOrigin"
 			style="color: #ff6363;width: auto;margin: 0 auto;">
-			<text v-if="weighList.orderType == '澶栬喘'">瓒呭嚭鍘熷彂姣涢噸,纾呮埧浜哄憳纭涓�,璇峰嬁绂诲紑姝ら〉闈�</text>
-			<text v-else>瓒呭嚭鏈�澶ф瘺閲�,纾呮埧浜哄憳纭涓�,璇峰嬁绂诲紑姝ら〉闈�</text>
+			<text v-if="weighList.orderType == '澶栬喘'">瓒呭嚭鍘熷彂{{avgFalse ? '鐨噸' :'姣涢噸'}} ,纾呮埧浜哄憳纭涓�,璇峰嬁绂诲紑姝ら〉闈�</text>
+			<text v-else>瓒呭嚭鏈�澶� {{avgFalse ? '鐨噸' :'姣涢噸'}},纾呮埧浜哄憳纭涓�,璇峰嬁绂诲紑姝ら〉闈�</text>
 		</view>
 		<view v-show="afterEvacuationStatus"
 			style="color: #ff6363;width: auto;margin: 0 auto;">
@@ -242,6 +242,7 @@
 <script>
 	import { webSocketUrl } from '@/api/request.js';
 	import { mapState, mapMutations } from 'vuex';
+	import { BaseUrl } from '@/api/publicInterface.js'
 	import combinedTitle from '@/components/combined-title/combined-title.vue';
 	import BigNumber from "bignumber.js"
 	export default {
@@ -254,12 +255,14 @@
 			this.weighHouseCode = params.weighHouseCode;
 			this.primarySkin = params.primarySkin;
 			this.primaryHair = params.primaryHair;
+			this.deptId = params.deptId;
 			this.primaryClean = params.primaryClean;
 			if (params.overTmWaixiao !== 'null') {
 				this.weighData.overTmWaixiao = 1
 			}
 			this.changeweighHouseCode(params.weighHouseCode);
 			this.init();
+			this.getDept();
 			this.changeWeigh('')
 			this.realTimeWeigh = 0
 		},
@@ -288,6 +291,7 @@
 		},
 		data() {
 			return {
+				avgFalse:false, // 鏄惁鐨噸寮傚父
 				weighData: {
 					//纭绉伴噸鎺ュ彛鍙傛暟
 					deptId: '',
@@ -296,6 +300,7 @@
 					carNo: '',
 					gateCameraId: '',
 					equipmentCode: '',
+					avgSkin:'',
 					weigh: 0,
 					tmCode: '',
 					sceneInOut: '',
@@ -307,6 +312,8 @@
 					abnormalText: ''
 				},
 				takeCoalId: null,
+				deptId:'',
+				weightReal:0, // 绉伴噸娴姩鏁版嵁
 				weighHouseCode: '',
 				isConfirmWeighLoading: false, //纭畾绉伴噸鎸夐挳
 				realTimeWeigh: 0,
@@ -391,7 +398,7 @@
 							this.temporaryWeighObj.skin = newV;
 							let xx = new BigNumber(this.avgSkin)
 							let yy = new BigNumber(newV)
-							this.errorTipShow = (xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2) &&
+							this.errorTipShow = (xx.minus(yy).toNumber() <= -this.weightReal || xx.minus(yy).toNumber() >= this.weightReal) &&
 								this.avgSkin !== 0
 						} else {
 							this.isSkinWeigh = false;
@@ -415,7 +422,7 @@
 							this.temporaryWeighObj.skin = newV;
 							let xx = new BigNumber(this.avgSkin)
 							let yy = new BigNumber(newV)
-							this.errorTipShow = (xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2) &&
+							this.errorTipShow = (xx.minus(yy).toNumber() <= -this.weightReal || xx.minus(yy).toNumber() >= this.weightReal) &&
 								this.avgSkin !== 0;
 							let x = new BigNumber(this.weighList.hair)
 							let y = new BigNumber(this.temporaryWeighObj.skin)
@@ -515,7 +522,7 @@
 						} else {
 							let xx = new BigNumber(this.avgSkin)
 							let yy = new BigNumber(this.globalweigh)
-							if (xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2) {
+							if (xx.minus(yy).toNumber() <= -this.weightReal || xx.minus(yy).toNumber() >= this.weightReal) {
 								this.abnormalModalShow = true
 								this.skinAbnormal()
 							} else {
@@ -546,7 +553,14 @@
 								this.isConfirmWeighLoading = false;
 							}, 1000);
 						} else if (res.code === 3) {
-							this.isExceedOrigin = true
+							if(/鐨噸/.test(res.msg)){
+								this.avgFalse = true;
+								this.isExceedOrigin = true;
+							}else{
+								this.avgFalse = false;
+								this.isExceedOrigin = true;
+							}
+							
 						} else {
 							this.$u.toast(res.msg ? res.msg : '绉伴噸澶辫触锛岃绋嶅悗閲嶈瘯');
 							this.isConfirmWeighLoading = false
@@ -639,7 +653,8 @@
 				this.$reqGet('getAvgSkin', { xsUserId1: this.weighList.xsUserId1 }).then(res => {
 					if (res.code === 0) {
 						uni.hideLoading()
-						this.avgSkin = res.data.avgSkin
+						this.avgSkin = res.data.avgSkin;
+						this.weighData.avgSkin = res.data.avgSkin;
 						this.tmTaskCoalList = res.data.tmTaskCoalList
 						/**
 						 * @description true鐨勮瘽鏄涓�娆$О, false灏变笉鏄�,娌℃湁鍘嗗彶锛屽钩鍧囩毊閲嶄负0鏄涓�娆′篃鏄甯� */
@@ -676,6 +691,20 @@
 							delta: 1
 						})
 				}, 800)
+			},
+			//鑾峰彇閲嶉噺闃堝��
+			getDept(){
+				uni.request({
+					url: `${BaseUrl}/admin/dept/${this.deptId}`,
+					method: 'GET',
+					header: {
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					success: (res) => {
+						console.log(res.data.data,'res.datra')
+						res.data.data.skinSafeValue ? 	this.weightReal = res.data.data.skinSafeValue : this.weightReal = '';
+					}
+				})
 			}
 		}
 	};

--
Gitblit v1.9.1