From 292019d23db79aa99535735e13e6b3c129d87251 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期四, 02 十一月 2023 13:56:11 +0800
Subject: [PATCH] 验质员页面tabbarg高亮bug

---
 pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue |   62 +++++++++++++++++++++---------
 1 files changed, 43 insertions(+), 19 deletions(-)

diff --git a/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue b/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue
index 57e5a2a..ca5d10d 100644
--- a/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue
+++ b/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue
@@ -58,7 +58,7 @@
 					<view class="label-text">
 						鎵f福鍚庡噣閲�
 					</view>
-					<view class="count">{{ item.weight }}</view>
+					<view class="count">{{ item.weight  || item.clean}}</view>
 				</view>
 			</view>
 			<!-- 鍒ゆ柇鏄惁妫�楠岃川閲� -->
@@ -440,6 +440,10 @@
 						} else {
 							this.changeglobalShowWeigh(uni.getStorageSync('showWeighCopyStorge'))
 						}
+						//绉伴噸鏄庣粏鏃犳暟鎹椂鏄剧ず鐗╄祫鏄庣粏
+						if(!this.coalDetailsData.tmTaskCoalItems.length){
+							this.current = 0; 
+						}
 					} else {
 						this.$u.toast('鍔犺浇澶辫触')
 						uni.hideLoading()
@@ -513,6 +517,20 @@
 						}
 					})
 			},
+			// 鏍¢獙鏁版嵁鏄惁鍚堟牸 
+			checkValue(data,target){
+				if(!data.length){
+					return
+				}
+				let flag = data.find(item=>item[target] <=0);
+				console.log(flag,'flag');
+			    if(flag){
+					return false 
+				}else{
+					return true;
+				}
+
+			},
 			// 鐗╄祫鏄庣粏
 			goodsPopoverShow(index) {
 				if (this.roleType === 4 && !this.flag) {
@@ -555,13 +573,18 @@
 			// 鎶樻墸鐜囪緭鍏�
 			discountInputHandle(value, index, clean) {
 				console.log('璁$畻鍑�閲�',value, index, clean)
-				value = Number(value)
-				this.showWeigh[index].cinderWeight = Number(value)
-				if (clean) {
-					let x = new BigNumber(clean)
-					let y = new BigNumber(value)
-					this.showWeigh[index].weight = x.minus(y).toFixed(2)
-				}
+				this.showWeigh[index].cinderWeight = (value - 0)
+					let x = new BigNumber(clean - 0)
+					let y = new BigNumber(value - 0)
+					let z =  new BigNumber(this.showWeigh[index].unqualifiedWeight - 0)
+					console.log(clean,value,this.showWeigh[index].unqualifiedWeight - 0,'鎵f福');
+					if(x.minus(y).minus(z).toFixed(2) <= 0){
+						this.showWeigh[index].weight = '0';
+						this.$u.toast('褰撳墠鍑�閲嶄笉鍚堟牸锛岃妫�鏌ョ毊閲嶏紝姣涢噸鏄惁鍑嗙‘')
+					}else{
+						this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2)
+					}
+				
 				
 			},
 			// 閫夋嫨涓嶅悎鏍煎搧鍚�
@@ -582,17 +605,18 @@
 			},
 			// 涓嶅悎鏍奸噸閲忚緭鍏�
 			unqualifiedWeightInputHandle(value, index, clean) {
-				value = value + 0;
-				let x = new BigNumber(clean)
-				let y = new BigNumber(value)
-				let z;
-				if(!this.showWeigh[index].cinderWeight){
-				 z = 0;
-				}else{
-				 z = new BigNumber(this.showWeigh[index].cinderWeight);
-				}
-				console.log(value, index, clean,'涓嶅悎鏍奸噸閲忚緭鍏�')
-				this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2) || ''
+				// 鍒ゆ柇鏄笉鏄湁鍑�閲嶆墠杩涜璁$畻
+				let x = new BigNumber(clean - 0)
+				let y = new BigNumber(value - 0)
+				let z = new BigNumber(this.showWeigh[index].cinderWeight -  0);
+				if(x.minus(y).minus(z).toFixed(2)  <= 0){
+						this.showWeigh[index].weight = '0';
+						this.$u.toast('褰撳墠鍑�閲嶄笉鍚堟牸锛岃妫�鏌ョ毊閲嶏紝姣涢噸鏄惁鍑嗙‘')
+					}else{
+						this.showWeigh[index].weight = x.minus(y).minus(z).toFixed(2) ;
+					}
+				
+			
 			},
 			// 鍒犻櫎鍥剧墖
 			deletePic(event) {

--
Gitblit v1.9.1