From 029dd92e96bec1ca325e99f154c8a2188919e8d5 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期一, 26 六月 2023 08:49:56 +0800
Subject: [PATCH] 增加验质功能

---
 pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue |   34 ++++-------
 api/globalApi.js                                                                        |    6 ++
 pages.json                                                                              |   11 +++
 pages/customer-page/customer-index/customer-index.vue                                   |   33 +++++-----
 pages/tabbar-page/index-tabbar/index-tabbar.vue                                         |    1 
 pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue        |   36 ++++++++---
 6 files changed, 71 insertions(+), 50 deletions(-)

diff --git a/api/globalApi.js b/api/globalApi.js
index 3ab8f3f..730ec60 100644
--- a/api/globalApi.js
+++ b/api/globalApi.js
@@ -378,5 +378,11 @@
 	setUpWxOpenid: {
 		url: '/admin/user/setUpWxOpenid',
 		method: 'POST'
+	},
+	/**
+	 * @@description 鏍规嵁id鏇存柊鎶樻墸鐜�  娌抽挗*/
+	updateTmTaskCoalItem: {
+		url: '/wrzs/tmtaskcoalitem/updateTmTaskCoalItem',
+		method: 'POST'
 	}
 }
\ No newline at end of file
diff --git a/pages.json b/pages.json
index d2b59a4..542652c 100644
--- a/pages.json
+++ b/pages.json
@@ -211,7 +211,16 @@
 			}
 
 		}
-	],
+	    ,{
+            "path" : "pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"subPackages": [{
 			"root": "pages/register",
 			"pages": [{
diff --git a/pages/customer-page/customer-index/customer-index.vue b/pages/customer-page/customer-index/customer-index.vue
index 499b969..d4837a0 100644
--- a/pages/customer-page/customer-index/customer-index.vue
+++ b/pages/customer-page/customer-index/customer-index.vue
@@ -20,19 +20,19 @@
 						@click="cardBodyClick(item)">
 						<view class="first-line">
 							<view class="dispatch-receive">
-								<view class="dispatch">{{ item.filedName }}</view>
+								<view class="dispatch">{{ item.filedName||'' }}</view>
 							</view>
-							<view class="point-number">
-								<text class="residue">{{ item.cars2 }}</text>
-								<text>/{{ item.carNum }}</text>
-							</view>
+							<!-- <view class="point-number">
+								<text class="residue">{{ item.cars2||'' }}</text>
+								<text>/{{ item.carNum ||''}}</text>
+							</view> -->
 						</view>
 						<view class="second-line">
 							<view class="coal-name">
-								<view class="">{{ item.coalName }}</view>
+								<view class="">{{ item.coalName ||''}}</view>
 								<view class="black-bar"></view>
 								<view class="coal-type"
-									v-if="item.orderType">{{ item.orderType }}</view>
+									v-if="item.orderType">{{ item.orderType||'' }}</view>
 							</view>
 						</view>
 						<view class="third-line">
@@ -44,13 +44,13 @@
 							<view class="send-date">{{ item.sendDate }}</view>
 						</view>
 						<view class="fourth-line">
-							<view class="receive"
+							<!-- <view class="receive"
 								@click.stop="receiveClick(item)">
-								<view class="button-image">棰嗗彇</view>
-							</view>
+								<view class="button-image">楠岃川</view>
+							</view> -->
 							<view class="forward"
-								@click.stop="forwardClick(item)">
-								<view class="button-image">杞彂</view>
+								@click.stop="forwardClick(index)">
+								<view class="button-image">楠岃川</view>
 							</view>
 						</view>
 					</view>
@@ -313,7 +313,7 @@
 			// 鎻愮叅鍗曡鎯�
 			cardBodyClick(v) {
 				uni
-		.navigateTo({ url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&code=${v.code}&cars2=${v.cars2}` });
+					.navigateTo({ url: `/pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails?orderPlanId=${v.id}&code=${v.code}&cars2=${v.cars2}` });
 			},
 			// 鐐瑰嚮鍘嗗彶鎻愮叅鍗曡幏鍙栬鎯�
 			faYundetail(v) {
@@ -322,10 +322,9 @@
 				});
 			},
 			// 杞彂
-			forwardClick(obj) {
-				if (obj.cars2 == 0) return this.$u.toast('璇峰厛棰嗗彇鍚庡啀杞彂');
+			forwardClick(index) {
 				uni
-					.navigateTo({ url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&carNumSurplus1=${obj.carNumSurplus1}&carNum=${obj.carNum}&cars2=${obj.cars2}` });
+		.navigateTo({ url: `/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail?index=${index}` });
 			}
 		}
 	};
@@ -574,7 +573,7 @@
 						width: 100%;
 						height: vww(30);
 						@include flex;
-						justify-content: flex-start;
+						justify-content: flex-end;
 						position: relative;
 						bottom: vww(10);
 						left: 25%;
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 6831ae7..f1e7407 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
@@ -18,11 +18,11 @@
 			<view class="block-information">
 				<view class="block-main">
 					<view class="basic">
-						<view class="coalName">{{ coalDetailsData.coalName }}</view>
+						<view class="coalName">{{ coalDetailsData.coalName||'' }}</view>
 						<view class="status-button"
 							style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/statusbutton.png') no-repeat;
 										background-size: cover;">
-							{{ coalStatus[coalDetailsData.status] || '' }}
+							{{ coalStatus[coalDetailsData.statusWeigh] || '' }}
 						</view>
 					</view>
 					<view class="time">
@@ -34,24 +34,29 @@
 					<view class="coal-code">鎻愮叅鍗曠紪鍙�:&nbsp;&nbsp;{{ coalDetailsData.code || '' }}</view>
 					<view class="order-code">
 						璁㈠崟缂栧彿:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ coalDetailsData.orderCode || '' }}</view>
+					<view class="coal-code"
+						@click="jumpWeighDetail"
+						style="color: rgb(73, 123, 251);">
+						鏌ョ湅鏄庣粏
+					</view>
 					<view class="weigh-item">
 						<view class="item">
 							<view class="concrete"
 								style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/skin.png') no-repeat;background-size: cover;">
 								鐨�</view>
-							<view class="num">{{ coalDetailsData.skin }}</view>
+							<view class="num">{{ showWeigh.skin }}</view>
 						</view>
 						<view class="item">
 							<view class="concrete"
 								style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/hair.png') no-repeat;background-size: cover;">
 								姣�</view>
-							<view class="num">{{ coalDetailsData.hair }}</view>
+							<view class="num">{{ showWeigh.hair }}</view>
 						</view>
 						<view class="item">
 							<view class="concrete"
 								style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/clean.png') no-repeat;background-size: cover;">
 								鍑�</view>
-							<view class="num">{{ coalDetailsData.clean }}</view>
+							<view class="num">{{ showWeigh.clean }}</view>
 						</view>
 					</view>
 				</view>
@@ -174,9 +179,7 @@
 					openId: null,
 					openName: ''
 				},
-				coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
-					'杩涘叆鍦洪櫌'
-				], // 鐘舵��
+				coalStatus: ['鏈О閲�', '绉伴噸涓�', '楠岃川涓�', '绉伴噸瀹屾垚'], // 鐘舵��
 				weighHouseCode: '',
 				// 鏀剧┖寮圭獥鎺у埗鍙橀噺
 				evacuationModalShow: false,
@@ -243,6 +246,11 @@
 			},
 			isapproach() {
 				return this.currentPageCoalStatus !== 3;
+			},
+			// 灞曠ず鐨瘺鍑�
+			showWeigh() {
+				return this.coalDetailsData.tmTaskCoalItems ? (this.coalDetailsData.tmTaskCoalItems[0] ? this
+					.coalDetailsData.tmTaskCoalItems[0] : {}) : {}
 			}
 		},
 		methods: {
@@ -287,8 +295,8 @@
 					title: '鍔犺浇涓�'
 				});
 				this.$reqGet('getTakeCoal', { takeCoalId: this.orderPlanId }).then(res => {
+					uni.hideLoading();
 					if (res.code == 0) {
-						uni.hideLoading();
 						console.log(res, '鎻愮叅鍗曡鎯�');
 						this.coalDetailsData = res.data;
 						this.orderType = this.coalDetailsData.orderType;
@@ -311,7 +319,7 @@
 						this.getServiceOpenid.deptId = this.coalDetailsData.deptId;
 						this.getServiceOpenid.filedId = this.coalDetailsData.filedId;
 						// 鑾峰彇鎻愮叅鍗曠姸鎬�
-						this.currentPageCoalStatus = this.coalDetailsData.status;
+						this.currentPageCoalStatus = this.coalDetailsData.statusWeigh;
 						// 鑾峰彇鍘熷彂淇℃伅
 						this.primarySkin = this.coalDetailsData.skinTwo;
 						this.primaryHair = this.coalDetailsData.hairTwo;
@@ -356,7 +364,7 @@
 							});
 						}
 					});
-				}, 5000);
+				}, 10000);
 			},
 			// 灞曠ず鎻愮叅鍗曡鎯�
 			showCaolPickUpBill() {
@@ -493,6 +501,12 @@
 			completeOutSaleCancel() {
 				this.completeOutSaleShow = false
 			},
+			// 鏌ョ湅璐ㄩ噺鏄庣粏
+			jumpWeighDetail() {
+				uni.navigateTo({
+					url: `/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail?orderPlanId=${this.orderPlanId}`
+				})
+			}
 		}
 	};
 </script>
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 75b1b71..739eb25 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
@@ -142,17 +142,17 @@
 				</view>
 				<view class="main-information">
 					<view class="prefix">鐨噸:</view>
-					<view class="suffix">{{ temporaryWeighObj.skin == 0 ? weighList.skin : temporaryWeighObj.skin }}
+					<view class="suffix">{{ showWeigh.skin||"" }}
 					</view>
 				</view>
 				<view class="main-information">
 					<view class="prefix">姣涢噸:</view>
-					<view class="suffix">{{ temporaryWeighObj.hair == 0 ? weighList.hair : temporaryWeighObj.hair }}
+					<view class="suffix">{{showWeigh.hair||""}}
 					</view>
 				</view>
 				<view class="main-information">
 					<view class="prefix">鍑�閲�:</view>
-					<view class="suffix">{{ temporaryWeighObj.clean == 0 ? weighList.clean : temporaryWeighObj.clean }}
+					<view class="suffix">{{ showWeigh.clean||"" }}
 					</view>
 				</view>
 				<view class="main-information">
@@ -305,13 +305,6 @@
 				}
 			},
 			// 鐩戝惉閲嶉噺鍙樺寲
-			// globalweigh: {
-			// 	handler(v) {
-			// 		this.weighData.weigh = this.realTimeWeigh = v;
-			// 		console.log(this.realTimeWeigh, '鐪熷疄閲嶉噺鏀瑰彉浜�');
-			// 	},
-			// 	deep: true
-			// },
 			globalweigh(newV) {
 				this.weighData.weigh = this.realTimeWeigh = newV;
 				console.log(this.realTimeWeigh, '鐪熷疄閲嶉噺鏀瑰彉浜�');
@@ -336,13 +329,6 @@
 			// 鍔犲噺鐓ゆ寜閽鐢ㄤ笌鍚�
 			addAndSubtractCoalDisabled() {
 				return this.realTimeWeigh == 0;
-				// if (this.weighList.orderType == '澶栭攢' || this.weighList.orderType == '鍐呴攢' || this.weighList.orderType == '杞嚭') {
-				// 	if (this.weighList.hair == 0) {
-				// 		return true;
-				// 	} else if (this.weighList.hair != 0) {
-				// 		return false;
-				// 	}
-				// }
 			},
 			// 鏄惁鏀剧┖鎸夐挳绂佺敤
 			isEvacuation() {
@@ -350,27 +336,31 @@
 					'杞嚭') {
 					return (this.weighList.skin === 0 ? this.temporaryWeighObj.skin : this.weighList.skin) == this
 						.temporaryWeighObj.hair;
-					// return this.weighList.skin == this.temporaryWeighObj.hair || this.temporaryWeighObj.skin == this
-					// 	.temporaryWeighObj.hair;
 				}
 				if (this.weighList.orderType == '澶栬喘' || this.weighList.orderType == '鍐呰喘' || this.weighList.orderType ==
 					'杞叆') {
 					return (this.weighList.hair === 0 ? this.temporaryWeighObj.skin : this.weighList.hair) == this
 						.temporaryWeighObj.hair;
-					// return this.weighList.hair == this.temporaryWeighObj.skin || this.temporaryWeighObj.skin == this
-					// 	.temporaryWeighObj.hair;
 				}
 			},
 			sideline() {
 				return this.weighList.orderType == '鍐呰喘' || this.weighList.orderType == '杞叆';
+			},
+			showWeigh() {
+				return this.weighList.tmTaskCoalItems ? (this.weighList.tmTaskCoalItems[0] ? this
+					.weighList.tmTaskCoalItems[0] : {}) : {}
 			}
 		},
 		methods: {
 			...mapMutations(['changeweighHouseCode', 'changeisLogin']),
 			init() {
+				uni.showLoading({
+					title: '鍔犺浇涓�'
+				})
 				// 鑾峰彇绉伴噸淇℃伅
 				this.$reqGet('weighList', { id: this.takeCoalId }).then(res => {
 					console.log(res, '鑾峰彇绉伴噸淇℃伅');
+					uni.hideLoading()
 					if (res.code == 0) {
 						this.weighList = res.data;
 						this.weighData.deptId = res.data.deptId;
@@ -460,6 +450,8 @@
 							this.isConfirmWeighLoading = false;
 						}, 1000);
 						console.log(res, '鍔犲噺鐓�');
+					} else {
+						this.$u.toast('鎿嶄綔澶辫触锛岃绋嶅�欓噸璇�');
 					}
 				});
 			},
diff --git a/pages/tabbar-page/index-tabbar/index-tabbar.vue b/pages/tabbar-page/index-tabbar/index-tabbar.vue
index 04a8ca5..7fe7a38 100644
--- a/pages/tabbar-page/index-tabbar/index-tabbar.vue
+++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -187,6 +187,7 @@
 			console.log('椤甸潰鍗歌浇');
 			this.$store.dispatch('websocketOnClose')
 			clearInterval(this.globalIntervalId);
+			this.changeisconnect(true)
 		},
 		methods: {
 			...mapMutations(['pushMessage', 'changeWeigh', 'changeinfraredStatus', 'changeisconnect', 'websocketInit']),

--
Gitblit v1.9.1