From 3e5ccc0369e0b8e61ce50e186246e57c1547ae00 Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期二, 30 七月 2024 18:00:59 +0800
Subject: [PATCH] 申请复磅细节

---
 pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue |   56 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 36 insertions(+), 20 deletions(-)

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 0b4f32c..98bd6b3 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
@@ -10,7 +10,7 @@
 				<view class="top_right">
 					<view class="">
 						绉伴噸:
-						<u--text :type="weightStatusType"      
+						<u--text :type="weightStatusType"
 							:text="weightStatus"
 							size="34"></u--text>
 					</view>
@@ -103,7 +103,7 @@
 			<!-- .澶栬喘璁㈠崟锛屼笉鍑虹幇杩斿洖鍔犲噺鍚ㄧ殑鎸夐挳 -->
 			<u-button type="primary"
 				text="纭畾绉伴噸"
-				:disabled="realTimeWeigh == 0 || globalinfraredStatus || isweigh ||globalWarning"
+				:disabled="realTimeWeigh == 0 || globalinfraredStatus || isweigh ||globalWarning || weighList.isReWeigh == 1"
 				:loading="isConfirmWeighLoading"
 				loadingText="纭"
 				@click="confirmWeigh"></u-button>
@@ -119,7 +119,7 @@
 				:loading="UnloadingAgainLoading"
 				loadingText="纭"
 				:disabled="isweigh||realTimeWeigh == 0"
-				v-if='canUnload'></u-button>
+				v-if='canUnload && isJixuxiehuo'></u-button>
 			<!-- 鏀剧┖ -->
 			<u-button type="primary"
 				text="鏀剧┖"
@@ -237,6 +237,9 @@
 			globalweigh: {
 				handler: function(newV) {
 					this.weighData.weigh = this.realTimeWeigh = newV;
+          console.log(newV,'new====')
+          console.log(this.isweight,'isweight=====')
+          console.log(this.currentClean,'this.currentClean=====')
 					if  ((this.weighList.orderType == '澶栭攢' || this.weighList.orderType == '鍐呴攢' || this.weighList
 						.orderType == '杞嚭')) {
 						if (!this.showWeigh.skin) {
@@ -258,13 +261,13 @@
 					}else if((this.weighList.orderType == '澶栬喘' || this.weighList.orderType == '鍐呰喘' || this.weighList
 						.orderType == '杞叆') && (!this.isweight)){
 							if (!this.showWeigh.skin) {
-							this.temporaryWeighObj.skin = newV;
-							this.temporaryWeighObj.isWeightclean = newV;
-						} else {
-							this.temporaryWeighObj.isWeightclean = newV;
+                this.temporaryWeighObj.skin = newV;
+                this.temporaryWeighObj.isWeightclean = newV;
+              } else {
+                this.temporaryWeighObj.isWeightclean = newV;
 
-							this.isweigh = Number(this.currentClean) < 0;
-						}
+                this.isweigh = Number(this.currentClean) < 0;
+              }
 						}
 				},
 				deep: true
@@ -281,6 +284,11 @@
 					uni.stopPullDownRefresh();
 				}
 			}
+      setTimeout(() => {
+        this.init(() => {
+          uni.stopPullDownRefresh()
+        })
+      },1000)
 		},
 		onShow() {
 			this.init();
@@ -295,7 +303,7 @@
                     this.changesocketTask(null);
                     this.changereconnectNum({ connectNum: 1, isWeigh: true })
                     this.$store.dispatch('websocketInit');
-				
+
                 }
             }, 3000)
 				uni.showToast({
@@ -401,16 +409,22 @@
 					}else{
 						return true
 					}
-
 				}else{
 					return true
 				}
 			},
-			
+      isJixuxiehuo() {   //鏄惁鏄剧ず缁х画鍗歌揣鎸夐挳
+        console.log(this.weighList?.tmTaskCoalItems,'this.weighList?.tmTaskCoalItems')
+        if(this.weighList?.tmTaskCoalItems && this.weighList?.tmTaskCoalItems.length > 0) {
+          return this.weighList?.tmTaskCoalItems.length > 0
+        }else {
+          return false
+        }
+      },
 		},
 		methods: {
 			...mapMutations(['changeweighHouseCode', 'changeisLogin', 'changeWeigh','changereconnectNum','changesocketTask']),
-			init() {
+      init() {
 				uni.showLoading({
 					title: '鍔犺浇涓�'
 				})
@@ -428,6 +442,7 @@
 						this.outBuy = (this.weighList.orderType.indexOf('閿�') !== -1) && this.showWeigh.skin > 0;
 						// 缁х画鍗歌揣鍙湁澶栬喘绫诲瀷绗簩娆′細鏈�
 						this.canUnload = this.weighList.orderType === '澶栬喘' && this.showWeigh.hair > 0;
+            console.log(this.canUnload,'this.canUnload====')
 					}
 				});
 			},
@@ -462,11 +477,12 @@
 						console.log(res, '绉伴噸鎺ュ彛');
 						if (res.code == 0) {
 							this.$u.toast('绉伴噸鎴愬姛');
+              this.isConfirmWeighLoading = false;
 							setTimeout(() => {
 								uni.navigateBack({
 									delta: 1
 								});
-								this.isConfirmWeighLoading = false;
+
 							}, 1000);
 						} else {
 							this.$u.toast('绉伴噸澶辫触锛岃绋嶅悗閲嶈瘯' + (res.msg ? res.msg : ''));
@@ -476,7 +492,9 @@
 						this.isConfirmWeighLoading = false;
 						console.log(err);
 						this.$u.toast(err.msg ? err.msg : '绉伴噸澶辫触');
-					});
+					}).finally(() => {
+          this.isConfirmWeighLoading = false;
+        });
 			},
 			// 鍔犲噺鐓�
 			addAndSubtractCoal() {
@@ -484,7 +502,6 @@
 					deptId: this.weighData.deptId,
 					sceneId: this.weighData.sceneId,
 					carNo: this.weighData.carNo,
-					tmId: this.weighData.tmId,
 					filedId: this.weighData.filedId,
 					tmId: this.weighData.tmId,
 					gateCameraId: this.weighData.gateCameraId,
@@ -503,7 +520,7 @@
 						}, 1000);
 						console.log(res, '鍔犲噺鐓�');
 					} else {
-						this.$u.toast('鎿嶄綔澶辫触锛岃绋嶅�欓噸璇�');
+						this.$u.toast(res.msg);
 					}
 				});
 			},
@@ -516,7 +533,6 @@
 					carNo: this.weighData.carNo,
 					tmId: this.weighData.tmId,
 					filedId: this.weighData.filedId,
-					tmId: this.weighData.tmId,
 					gateCameraId: this.weighData.gateCameraId,
 					equipmentCode: this.weighData.equipmentCode,
 					tmCode: this.weighData.tmCode,
@@ -532,7 +548,7 @@
 							});
 						}, 1000);
 					} else {
-						this.$u.toast('鎿嶄綔澶辫触锛岃绋嶅�欓噸璇�');
+						this.$u.toast(res.msg);
 					}
 				})
 			},
@@ -886,4 +902,4 @@
 			justify-content: space-between;
 		}
 	}
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.1