From 825abb00f52fe7d68b3479f328928bf74a47171e Mon Sep 17 00:00:00 2001
From: 819527061@qq.com <123456>
Date: 星期四, 18 七月 2024 10:56:11 +0800
Subject: [PATCH] 细节问题

---
 pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue |   48 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 32 insertions(+), 16 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 574a0ea..8c19b36 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
@@ -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();
@@ -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);
 					}
 				})
 			},

--
Gitblit v1.9.1