From 80a3aa28c4e66df31c6032e3098aeb376198f2d7 Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期五, 30 六月 2023 16:51:39 +0800
Subject: [PATCH] 验质功能增加逻辑修复错误

---
 pages.json                                                                                |    9 +
 pages/customer-page/customer-index/customer-index.vue                                     |    2 
 pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail.vue         |   36 ++--
 pages/driver-page/driver-index/bill-of-lading-details/selectOrderPlan/selectOrderPlan.vue |  269 ++++++++++++++++++++++++++++++++++++++
 pages/tabbar-page/index-tabbar/index-tabbar.vue                                           |   60 --------
 store/index.js                                                                            |    2 
 6 files changed, 297 insertions(+), 81 deletions(-)

diff --git a/pages.json b/pages.json
index 542652c..ba79e91 100644
--- a/pages.json
+++ b/pages.json
@@ -220,6 +220,15 @@
             }
             
         }
+        ,{
+            "path" : "pages/driver-page/driver-index/bill-of-lading-details/selectOrderPlan/selectOrderPlan",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"subPackages": [{
 			"root": "pages/register",
diff --git a/pages/customer-page/customer-index/customer-index.vue b/pages/customer-page/customer-index/customer-index.vue
index b9c51ef..9c4f17e 100644
--- a/pages/customer-page/customer-index/customer-index.vue
+++ b/pages/customer-page/customer-index/customer-index.vue
@@ -346,7 +346,7 @@
 			// 楠岃川
 			validateClick(index) {
 				uni
-					.navigateTo({ url: `/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail?index=${index}` });
+					.navigateTo({ url: `/pages/driver-page/driver-index/bill-of-lading-details/selectOrderPlan/selectOrderPlan?index=${index}` });
 			},
 		}
 	};
diff --git a/pages/driver-page/driver-index/bill-of-lading-details/selectOrderPlan/selectOrderPlan.vue b/pages/driver-page/driver-index/bill-of-lading-details/selectOrderPlan/selectOrderPlan.vue
new file mode 100644
index 0000000..118f719
--- /dev/null
+++ b/pages/driver-page/driver-index/bill-of-lading-details/selectOrderPlan/selectOrderPlan.vue
@@ -0,0 +1,269 @@
+<template>
+	<view>
+		<view style="position: relative;top: -120px;">
+			<u-empty mode="data"
+				icon="http://cdn.uviewui.com/uview/empty/data.png"
+				textSize="30"
+				iconSize="1000"
+				v-if="orderPlanData.length == 0"></u-empty>
+		</view>
+		<view class="collection-form">
+			<view class="collection-form-item"
+				v-for="(item, index) in orderPlanData"
+				:key="index">
+				<view class="first-line">
+					<view class="dispatch-receive">
+						<view class="dispatch">{{ item.filedName||'' }}</view>
+					</view>
+					<view class="point-number"
+						v-if="roleType == 1">
+						<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="black-bar"></view>
+						<view class="coal-type"
+							v-if="item.orderType">{{ item.orderType||'' }}</view>
+					</view>
+				</view>
+				<view class="third-line">
+					<view class="time-icon">
+						<view
+							style="width: 24rpx;height: 24rpx;li ne-height: 24rpx;background: url('https://mx.jzeg.cn:9095/appimg/image/banner/carNO.png') no-repeat;background-size: cover">
+						</view>
+					</view>
+					<view class="car-num">{{ item.carNo||''}}</view>
+				</view>
+				<view class="third-line">
+					<view class="time-icon">
+						<view
+							style="width: 24rpx;height: 24rpx;li ne-height: 24rpx;background: url('https://mx.jzeg.cn:9095/appimg/image/banner/clock.png') no-repeat;background-size: cover">
+						</view>
+					</view>
+					<view class="send-date">{{ item.sendDate }}</view>
+				</view>
+				<view class="fourth-line">
+					<view class="forward"
+						@click.stop="validateClick(item)"
+						v-if='roleType===4'>
+						<view class="button-image">閫夋嫨</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				orderPlanData: [],
+				index: null
+			};
+		},
+		computed: {
+			roleType() {
+				return uni.getStorageSync('roleType')
+			}
+		},
+		onLoad(params) {
+			this.index = params.index ? params.index : ''
+		},
+		onShow() {
+			this.GetOrderPlan()
+		},
+		methods: {
+			GetOrderPlan() {
+				uni.showLoading({ title: '鍔犺浇涓�...' });
+				this.$reqGet('GetOrderPlan').then(res => {
+					if (res.data) {
+						this.orderPlanData = res.data[this.index].tmTaskCoals ? res.data[this.index].tmTaskCoals :
+							[]
+						uni.hideLoading();
+					} else {
+						this.$u.toast('鍔犺浇澶辫触')
+						uni.hideLoading()
+					}
+				})
+			},
+			validateClick(item) {
+				uni.navigateTo({
+					url: `/pages/driver-page/driver-index/bill-of-lading-details/weighDetail/weighDetail?orderPlanId=${item.id}`
+				})
+			}
+		},
+	}
+</script>
+
+<style lang="scss"
+	scoped>
+	.collection-form {
+		width: vww(345);
+		margin: 0 vww(15);
+		position: relative;
+
+		.collection-form-item {
+			width: 690rpx;
+			height: 320rpx;
+			background: #ffffff;
+			box-shadow: 4rpx 6rpx 25rpx 0rpx rgba(73, 120, 240, 0.15);
+			border-radius: 20rpx;
+			overflow: hidden;
+			@include flex flex-direction: column;
+			position: relative;
+			align-items: flex-start;
+			margin-top: vww(10);
+
+			.first-line {
+				width: 94%;
+				height: vww(30);
+				margin: vww(10) vww(16) 0 vww(16);
+				display: flex;
+				justify-content: space-between;
+
+				.dispatch-receive {
+					width: 70%;
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+				}
+
+				.point-number {
+					width: 15%;
+
+					text {
+						font-size: 24rpx;
+						font-weight: 400;
+						color: #c78a64;
+					}
+
+					.residue {
+						font-size: 40rpx;
+						font-weight: 400;
+						color: #f81414;
+					}
+				}
+			}
+
+			.second-line {
+				width: 100%;
+				height: vww(30);
+				margin-left: vww(16);
+				display: flex;
+				align-items: center;
+				justify-content: flex-start;
+
+				.coal-name {
+					flex-grow: 1;
+					height: 30rpx;
+					font-size: 30rpx;
+					font-weight: 300;
+					color: #515151;
+					position: relative;
+					display: flex;
+					align-items: center;
+
+					.black-bar {
+						width: 2rpx;
+						height: 30rpx;
+						background: #515151;
+						margin-left: vww(12);
+					}
+
+					.coal-type {
+						margin-left: vww(12);
+						min-width: vww(50);
+						height: 30rpx;
+						line-height: 30rpx;
+						font-size: 30rpx;
+						font-weight: 300;
+						color: #515151;
+					}
+				}
+			}
+
+			.third-line {
+				width: 80%;
+				height: vww(30);
+				margin-left: vww(15);
+				display: flex;
+				justify-content: flex-start;
+				align-items: center;
+
+				.send-date {
+					margin-left: vww(14);
+					width: 148rpx;
+					height: 24rpx;
+					line-height: 24rpx;
+					font-size: 28rpx;
+					font-weight: 300;
+					color: #515151;
+				}
+
+				.car-num {
+					white-space: nowrap;
+					overflow: hidden;
+					text-overflow: ellipsis;
+				}
+			}
+
+			.fourth-line {
+				width: 100%;
+				height: vww(30);
+				@include flex;
+				justify-content: flex-end;
+				position: relative;
+				bottom: vww(10);
+				left: 25%;
+
+				.receive,
+				.forward {
+					width: vww(123);
+					height: vww(48);
+					@include flex;
+					justify-content: center;
+					color: #ffffff;
+					font-size: 28rpx;
+					position: absolute;
+
+					.button-image {
+						width: 100%;
+						height: 100%;
+						background: url('https://mx.jzeg.cn:9095/appimg/image/banner/button.png') no-repeat;
+						background-size: cover;
+						font-size: 28rpx;
+						font-weight: 300;
+						color: #ffffff;
+						text-align: center;
+						line-height: vww(45);
+					}
+				}
+
+				.receive {
+					left: vww(20);
+				}
+
+				.forward {
+					width: vww(106);
+					left: vww(140);
+
+					.button-image {
+						width: 100%;
+						height: 100%;
+						background: url('https://mx.jzeg.cn:9095/appimg/image/banner/transpartent.png') no-repeat;
+						background-size: cover;
+						font-size: 28rpx;
+						font-weight: 300;
+						color: #3b56eb;
+						text-align: center;
+						line-height: vww(45);
+					}
+				}
+			}
+		}
+	}
+</style>
\ No newline at end of file
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 cdd4203..fac4676 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
@@ -37,16 +37,16 @@
 					<view class="label-text">
 						鎶樻墸鐜�
 					</view>
-					<view v-if='roleType!==1'
-						class="count">{{ item.discount }}%
-					</view>
-					<view v-else
+					<view v-if='roleType===4'
 						class="count-input">
 						<u--input placeholder="璇疯緭鍏ユ姌鎵g巼"
 							border="bottom"
 							clearable
 							v-model="item.discount"
 							@input='v=>discountInputHandle(v,i,item.clean)'></u--input>
+					</view>
+					<view v-else
+						class="count">{{ item.discount }}%
 					</view>
 				</view>
 				<view class="weigh">
@@ -60,13 +60,13 @@
 				<u-tag :text="item.level||'璇烽�夋嫨'"
 					plain
 					@click="popoverShow(i)"
-					v-if='item.level||roleType===1'></u-tag>
+					v-if='item.level||roleType===4'></u-tag>
 				<u-tag :text="item.productName||'璇烽�夋嫨'"
 					plain
 					@click="productNamePopoverShow(i)"
-					v-if='item.level||roleType===1'></u-tag>
+					v-if='item.level||roleType===4'></u-tag>
 			</view>
-			<view v-if='roleType===1'>
+			<view v-if='roleType===4'>
 				<u-picker :show="show"
 					:columns="columns"
 					@cancel='cancel'
@@ -82,7 +82,7 @@
 			</view>
 		</view>
 		<view class="confirm-button"
-			v-if='roleType===1'>
+			v-if='roleType===4'>
 			<u-button type="primary"
 				shape="circle"
 				text="纭"
@@ -150,8 +150,8 @@
 				this.$reqGet('GetOrderPlan').then(res => {
 					if (res.data) {
 						this.coalDetailsData = res.data;
-						this.showWeigh = this.coalDetailsData[this.index].tmTaskCoalItems ? this.coalDetailsData[
-								this.index].tmTaskCoalItems : [],
+						this.showWeigh = this.coalDetailsData[this.index].tmTaskCoals ? this.coalDetailsData[
+								this.index].tmTaskCoals : [],
 							uni.hideLoading();
 					} else {
 						this.$u.toast('鍔犺浇澶辫触')
@@ -187,14 +187,14 @@
 			},
 			// 閫夋嫨璐ㄩ噺
 			popoverShow(i) {
-				if (this.roleType === 1) {
+				if (this.roleType === 4) {
 					this.show = true
 					this.selectIndex = i
 				}
 			},
 			// 閫夋嫨浜у搧
 			productNamePopoverShow(i) {
-				if (this.roleType === 1) {
+				if (this.roleType === 4) {
 					this.actionShow = true
 					this.actionIndex = i
 				}
@@ -216,7 +216,7 @@
 			},
 			// 鎶樻墸鐜囪緭鍏�
 			discountInputHandle(value, index, clean) {
-				this.showWeigh[index].discountWeight = (Number(value) * clean) / 100
+				this.showWeigh[index].discountWeight = ((Number(value) * clean) / 100).toFixed(2)
 			}
 		},
 	}
@@ -236,7 +236,8 @@
 
 	.main {
 		width: 100%;
-		height: 100vh;
+		height: 100%;
+		min-height: 400rpx;
 		background-color: #fff;
 		margin: 0 auto;
 		display: flex;
@@ -313,8 +314,8 @@
 
 			.level {
 				width: 40%;
-				margin-top: 30 rpx;
-				margin-left: 80 rpx;
+				margin-top: 30rpx;
+				margin-left: 80rpx;
 				display: flex;
 				justify-content: space-between;
 			}
@@ -322,9 +323,6 @@
 		}
 
 		.confirm-button {
-			// position: relative;
-			// bottom: 10rpx;
-			// right: 10rpx;
 			width: 100%;
 			@include flex;
 			justify-content: center;
diff --git a/pages/tabbar-page/index-tabbar/index-tabbar.vue b/pages/tabbar-page/index-tabbar/index-tabbar.vue
index 1c4698e..81d8858 100644
--- a/pages/tabbar-page/index-tabbar/index-tabbar.vue
+++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -180,9 +180,6 @@
 			this.userAuthorization();
 			this.messageReq();
 		},
-		onHide() {
-			console.log('椤甸潰闅愯棌')
-		},
 		onUnload() {
 			console.log('椤甸潰鍗歌浇');
 			this.$store.dispatch('websocketOnClose')
@@ -262,63 +259,6 @@
 					fail() {
 						console.log('鑾峰彇澶辫触');
 					}
-				});
-			},
-			// 鍒濆鍖杦ebsocket
-			initWebsocket() {
-				let wsUrl = `${webSocketUrl}?access_token=${uni.getStorageSync('token')}`;
-				socket = uni.connectSocket({
-					url: wsUrl,
-					header: {
-						CLIENT_TOC: 'Y'
-					},
-					complete: res => {
-						console.log(res, 'socket缁撴灉');
-						if (res.errMsg == 'connectSocket:ok') {
-							this.changeisconnect(true);
-							this.isconnect = true;
-						}
-					}
-				});
-				socket.onOpen(() => {
-					console.log('onOpen');
-					this.intervalId = setInterval(() => {
-						socket.send({
-							data: JSON.stringify({ type: 'ping' }),
-							success(e) {
-								console.log(e, '鍙戦�佸績璺虫垚鍔�');
-							}
-						});
-					}, 30000);
-				});
-
-				// 鑾峰彇鏈嶅姟鍣ㄤ紶鏉ョ殑鏁版嵁锛屽仛鐩稿簲澶勭悊
-				socket.onMessage(res => {
-					console.log('message', res);
-					if (res.data.startsWith('weigh')) {
-						let nowWeighObj = JSON.parse(res.data.slice(7));
-						if (this.globalweighHouseCode && nowWeighObj.eqCode == this.globalweighHouseCode) {
-							if (nowWeighObj.eqInfraredStatus) {
-								this.changeinfraredStatus(true);
-								this.changeWeigh(nowWeighObj.weigh);
-							} else {
-								this.changeinfraredStatus(false);
-								this.changeWeigh(nowWeighObj.weigh);
-							}
-						}
-					} else if (res.data.startsWith('msg')) {
-						this.messageList = JSON.parse(res.data.slice(5));
-						this.messagePushShow = true;
-					} else {}
-				});
-				socket.onClose(e => {
-					console.log('webSocketClose', e);
-					this.isconnect = false;
-					this.changeisconnect(false);
-				});
-				socket.onError(err => {
-					console.log('socket鎶ラ敊', err);
-					this.$u.toast('鍑虹幇閿欒锛岃閲嶆柊杩涘叆璇ラ〉闈紝閲嶈瘯锛侊紒');
 				});
 			},
 			messageconfirm() {
diff --git a/store/index.js b/store/index.js
index 1ce1db3..d498e51 100644
--- a/store/index.js
+++ b/store/index.js
@@ -89,7 +89,7 @@
 		// 璁剧疆搴曢儴鏍�
 		setUserTabbar(state, roleType) {
 			state.roleType = roleType
-			if (roleType == 1) {
+			if (roleType == 1 || roleType == 4) {
 				state.userTabbar = userRoleTabbar.first
 				uni.setStorageSync('userTabbar', state.userTabbar)
 			} else if (roleType == 2 || roleType == 3) {

--
Gitblit v1.9.1