From 2ea83048e7f11eb9a453da7371f9b3719a323fad Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期五, 15 九月 2023 09:52:40 +0800
Subject: [PATCH] 煤炭增加操作指引,增加打印入门证出门证

---
 pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue |   23 +--
 api/globalApi.js                                                                        |    6 +
 pages/driver-page/drvier-my/drvier-my.vue                                               |   42 +++++++
 pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue        |   73 +++++++++++++-
 pages/driver-page/driver-index/driver-index.vue                                         |   83 +++++++++++++++
 store/index.js                                                                          |   58 +++++++++++
 6 files changed, 255 insertions(+), 30 deletions(-)

diff --git a/api/globalApi.js b/api/globalApi.js
index 13a763d..7df10be 100644
--- a/api/globalApi.js
+++ b/api/globalApi.js
@@ -423,5 +423,11 @@
 	bindUserFleetBatch: {
 		url: '/wrzs/wx/bindUserFleetBatch',
 		method: 'POST'
+	},
+	/**
+	 * @description 鎵撳嵃鍑哄叆闂ㄨ瘉*/
+	printer: {
+		url: '/wrzs/printer/handler',
+		method: 'GET'
 	}
 }
\ No newline at end of file
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 1c3474e..e5ea6f9 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
@@ -103,6 +103,24 @@
 			</view>
 		</view>
 		<view class="weigh-ability">
+			<view class="weigh-button"
+				v-show='ablePrintInduction'>
+				<u-button text="鎵撳嵃鍏ラ棬璇�"
+					@click="printEntryCertificate"
+					type="primary"
+					shape="circle"
+					:loading="enterLoading"
+					loadingText="鎵撳嵃涓�,璇风◢鍊�"></u-button>
+			</view>
+			<view class="weigh-button"
+				v-show="ablePrintOut">
+				<u-button text="鎵撳嵃鍑洪棬璇�"
+					@click="printExitPermit"
+					type="primary"
+					shape="circle"
+					:loading="outLoading"
+					loadingText="鎵撳嵃涓�,璇风◢鍊�"></u-button>
+			</view>
 			<view class="weigh-button"><u-button text="灞曠ず鎻愮叅鍗�"
 					@click="showCaolPickUpBill"
 					type="primary"
@@ -153,7 +171,6 @@
 		},
 		onShow() {
 			this.init();
-
 		},
 		data() {
 			return {
@@ -221,7 +238,11 @@
 				completeOutSaleShow: false,
 				overTmWaixiao: null,
 				list: [{ name: '鎵嬫満鍙�', subname: '1213456', id: 1 }, { name: '寰俊璇煶', id: 2 }], //鍛煎彨瀹㈡湇閫夐」
-				servieceShow: false
+				servieceShow: false,
+				ablePrintInduction: false, //鍏ラ棬璇佹槸鍚︽樉绀�
+				ablePrintOut: false, //鍑洪棬璇佹槸鍚︽樉绀�
+				enterLoading: false, //鍏ラ棬鎸夐挳loading
+				outLoading: false, //鍑洪棬鎸夐挳loading
 			};
 		},
 		onHide() {
@@ -329,6 +350,9 @@
 						this.primarySkin = this.coalDetailsData.skinTwo;
 						this.primaryHair = this.coalDetailsData.hairTwo;
 						this.primaryClean = this.coalDetailsData.cleanTwo;
+						// 鍏ラ棬璇� 鍜� 鍑洪棬璇� 鏄惁鏄剧ず
+						this.ablePrintInduction = this.coalDetailsData.hair || this.coalDetailsData.skin
+						this.ablePrintOut = this.coalDetailsData.hair && this.coalDetailsData.skin
 					} else {
 						this.$u.toast('鍔犺浇澶辫触');
 					}
@@ -515,6 +539,38 @@
 			completeOutSaleCancel() {
 				this.completeOutSaleShow = false
 			},
+			// 鎵撳嵃鍏ラ棬璇�
+			printEntryCertificate() {
+				uni.showLoading({
+					title: '姝e湪鎵撳嵃涓�,璇风◢鍚�'
+				})
+				this.enterLoading = true
+				this.$reqGet('printer', { type: 2, tmId: this.coalDetailsData.id }).then(res => {
+					uni.hideLoading()
+					this.enterLoading = false
+					if (res.code === 0) {
+						this.$u.toast('鎵撳嵃鎴愬姛')
+					} else {
+						this.$u.toast(res.msg ? res.msg : '鎵撳嵃澶辫触')
+					}
+				})
+			},
+			// 鎵撳嵃鍑洪棬璇�
+			printExitPermit() {
+				uni.showLoading({
+					title: '姝e湪鎵撳嵃涓�,璇风◢鍚�'
+				})
+				this.outLoading = true
+				this.$reqGet('printer', { type: 3, tmId: this.coalDetailsData.id }).then(res => {
+					uni.hideLoading()
+					this.outLoading = false
+					if (res.code === 0) {
+						this.$u.toast('鎵撳嵃鎴愬姛')
+					} else {
+						this.$u.toast(res.msg ? res.msg : '鎵撳嵃澶辫触')
+					}
+				})
+			},
 		}
 	};
 </script>
@@ -543,7 +599,7 @@
 
 	::v-deep.bill-of-lading-details {
 		width: 100%;
-		height: 100vh;
+		height: 100%;
 		margin: 0 auto;
 		display: flex;
 		flex-direction: column;
@@ -702,7 +758,7 @@
 		}
 
 		.timeLine {
-			height: 40%;
+			height: 300rpx;
 			margin: vww(20);
 			position: relative;
 			top: vww(120);
@@ -764,15 +820,18 @@
 
 		.weigh-ability {
 			width: 631rpx;
-			height: vww(100);
+			height: vww(200);
 			margin: vww(80) auto;
-			margin-bottom: vww(10);
+			margin-top: vww(100);
+			margin-bottom: vww(20);
 			@include flex;
 			flex-direction: column;
+			justify-content: flex-start;
 
 			.weigh-button {
 				width: 631rpx;
-				height: vww(89);
+				height: vww(40);
+				margin: vww(10);
 
 				.u-button {
 					font-size: 28rpx;
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 2a19181..c30c17c 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
@@ -293,7 +293,6 @@
 			this.init();
 			this.changeWeigh('')
 			this.realTimeWeigh = 0
-			console.log(this.abnormalModalShow);
 		},
 		components: {
 			combinedTitle
@@ -364,9 +363,6 @@
 			};
 		},
 		watch: {
-			realTimeWeigh(newV, oldV) {
-
-			},
 			// 鐩戝惉閲嶉噺鍙樺寲
 			globalweigh: {
 				deep: true,
@@ -380,9 +376,7 @@
 							this.temporaryWeighObj.skin = newV;
 							let xx = new BigNumber(this.avgSkin)
 							let yy = new BigNumber(newV)
-							if (xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2) {
-								this.errorTipShow = true
-							}
+							this.errorTipShow = xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2
 						} else {
 							this.isSkinWeigh = false;
 							this.temporaryWeighObj.hair = newV;
@@ -402,9 +396,7 @@
 							this.temporaryWeighObj.skin = newV;
 							let xx = new BigNumber(this.avgSkin)
 							let yy = new BigNumber(newV)
-							if (xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2) {
-								this.errorTipShow = true
-							}
+							this.errorTipShow = xx.minus(yy).toNumber() <= -0.2 || xx.minus(yy).toNumber() >= 0.2
 							this.temporaryWeighObj.clean = (this.weighList.hair - this.temporaryWeighObj.skin).toFixed(
 								2);
 							this.isweigh = this.temporaryWeighObj.clean > this.weighList.orderSurplus || this
@@ -418,7 +410,9 @@
 		computed: {
 			...mapState(['globalweigh', 'globalinfraredStatus']),
 			coalContactClean() {
-				return (Number(this.weighData.coalContactHair) - Number(this.weighData.coalContactSkin)).toFixed(2);
+				let xx = BigNumber(this.weighData.coalContactHair)
+				let yy = BigNumber(this.weighData.coalContactSkin)
+				return xx.minus(yy).toNumber().toFixed(2)
 			},
 			token() {
 				return uni.getStorageSync('token');
@@ -492,7 +486,7 @@
 					if (this.weighData.weigh != 0) {
 						// 濡傛灉姝e湪绉扮毊
 						if (this.isSkinWeigh) {
-							// 濡傛灉绗竴娆$О閲�
+							// 濡傛灉骞冲潎鐨噸涓�0
 							if (this.isAbnormalAvgSkin) {
 								this.abnormalModalShow = false
 								this.saveWeigh();
@@ -611,8 +605,9 @@
 						this.tmTaskCoalList = res.data.tmTaskCoalList
 						/**
 						 * @description true鐨勮瘽鏄涓�娆$О, false灏变笉鏄�,娌℃湁鍘嗗彶锛屽钩鍧囩毊閲嶄负0鏄涓�娆′篃鏄甯� */
-						this.isAbnormalAvgSkin = (Array.isArray(this.tmTaskCoalList) && this
-							.tmTaskCoalList.length === 0 || !this.tmTaskCoalList) && this.avgSkin == 0
+						// this.isAbnormalAvgSkin = (Array.isArray(this.tmTaskCoalList) && this
+						// 	.tmTaskCoalList.length === 0 || !this.tmTaskCoalList) && this.avgSkin == 0
+						this.isAbnormalAvgSkin = this.avgSkin == 0
 					} else {
 						uni.hideLoading()
 						this.$u.toast('鍔犺浇澶辫触')
diff --git a/pages/driver-page/driver-index/driver-index.vue b/pages/driver-page/driver-index/driver-index.vue
index 774f18f..a9e020c 100644
--- a/pages/driver-page/driver-index/driver-index.vue
+++ b/pages/driver-page/driver-index/driver-index.vue
@@ -6,6 +6,25 @@
 				<view class="wait-collection"
 					style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/diverbanner.png') no-repeat;background-size:contain">
 				</view>
+				<!-- 寮曞椤� -->
+				<view class="noob-tour"
+					v-if="roleType===3&&isFirstLogin">
+					<combined-title title="鎿嶄綔鎸囧紩"></combined-title>
+					<u-cell-group>
+						<u-cell title="鏂版墜鎸囧紩"
+							name='1'
+							:clickable="true"
+							@click="noobTour">
+							<u-badge type="primary"
+								value="01"
+								slot='icon'></u-badge>
+							<u-icon slot="value"
+								name="arrow-right"
+								size="30"
+								color="#b8b8b8"></u-icon>
+						</u-cell>
+					</u-cell-group>
+				</view>
 				<view class="collection-form">
 					<view class="collection-form-item"
 						v-for="(item, index) in driverBillOfLoadingData.list1"
@@ -220,6 +239,12 @@
 						</view>
 					</view>
 					<view class="white-block"></view>
+					<!-- 鍥剧墖棰勮寮瑰嚭妗� -->
+					<view class="previewImage-container">
+						<previewImage ref="previewImage"
+							:imgs="driverTourImgList"
+							:saveBtn='false'></previewImage>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -229,10 +254,12 @@
 <script>
 	import { customerId } from '@/utils/status';
 	import combinedTitle from '@/components/combined-title/combined-title.vue';
-
+	import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
+	import { mapState } from 'vuex'
 	export default {
 		components: {
-			combinedTitle
+			combinedTitle,
+			previewImage
 		},
 		props: {
 			indexdriverBillOfLoadingData: {
@@ -249,6 +276,12 @@
 				immediate: true
 			}
 		},
+		computed: {
+			...mapState(['driverTourImgList']),
+			roleType() {
+				return uni.getStorageSync('roleType');
+			},
+		},
 		data() {
 			return {
 				driverBillOfLoadingData: {
@@ -263,7 +296,8 @@
 				qiangDanOrderPlanId: null,
 				fleetId: '',
 				xsUserId: '',
-				customerId: ''
+				customerId: '',
+				isFirstLogin: true //鏄惁鏄涓�娆$櫥褰�
 			};
 		},
 		onShow() {
@@ -351,7 +385,10 @@
 				uni.navigateTo({
 					url: `/pages/driver-page/appointment/appointment?takeCoalId=${value.id}&filedId=${value.filedId}&deptId=${value.deptId}&sendDate=${value.sendDate}`
 				});
-			}
+			},
+			noobTour() {
+				this.$refs.previewImage.open('https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png')
+			},
 		}
 	};
 </script>
@@ -719,11 +756,22 @@
 								color: #ffffff;
 								margin-right: vww(20);
 							}
+
+							.filedname {
+								width: 80%;
+							}
+						}
+
+						.map-icon {
+							position: absolute;
+							right: vww(-1);
+							top: vww(2)
 						}
 					}
 
 					.first-extra {
 						@include firstLine;
+						position: relative;
 
 						.main-information {
 							width: 100%;
@@ -744,6 +792,16 @@
 								color: #ffffff;
 								margin-right: vww(20);
 							}
+
+							.filedname {
+								width: 80%;
+							}
+						}
+
+						.map-icon {
+							position: absolute;
+							right: vww(-1);
+							top: vww(2)
 						}
 					}
 
@@ -751,6 +809,7 @@
 						@include firstLine;
 						margin: 0;
 						margin-left: vww(16);
+						position: relative;
 
 						.main-information {
 							width: 100%;
@@ -771,6 +830,16 @@
 								color: #ffffff;
 								margin-right: vww(20);
 							}
+
+							.filedname {
+								width: 80%;
+							}
+						}
+
+						.map-icon {
+							position: absolute;
+							right: vww(-1);
+							top: vww(2)
 						}
 					}
 
@@ -835,6 +904,12 @@
 					margin-top: vww(10);
 				}
 			}
+
+			.noob-tour {
+				margin-bottom: vww(10);
+				position: relative;
+				top: -240rpx;
+			}
 		}
 	}
 </style>
\ No newline at end of file
diff --git a/pages/driver-page/drvier-my/drvier-my.vue b/pages/driver-page/drvier-my/drvier-my.vue
index 652a7c7..7f722ae 100644
--- a/pages/driver-page/drvier-my/drvier-my.vue
+++ b/pages/driver-page/drvier-my/drvier-my.vue
@@ -136,7 +136,25 @@
 					shape="circle"
 					plain></u-button></view>
 		</view>
-
+		<!-- 寮曞椤� -->
+		<view class="noob-tour"
+			style="margin-top: 80rpx;">
+			<combined-title title="鎿嶄綔鎸囧紩"></combined-title>
+			<u-cell-group>
+				<u-cell title="鏂版墜鎸囧紩"
+					name='1'
+					:clickable="true"
+					@click="noobTour">
+					<u-badge type="primary"
+						value="01"
+						slot='icon'></u-badge>
+					<u-icon slot="value"
+						name="arrow-right"
+						size="30"
+						color="#b8b8b8"></u-icon>
+				</u-cell>
+			</u-cell-group>
+		</view>
 		<!-- 鍥剧墖棰勮寮瑰嚭妗� -->
 		<view class="previewImage-container">
 			<u-popup :show="previewImageShow"
@@ -148,7 +166,12 @@
 					height="400px"></u--image>
 			</u-popup>
 		</view>
-
+		<!-- 寮曞鍥剧墖寮瑰嚭 -->
+		<view class="previewImage-container">
+			<previewImage ref="previewImage"
+				:imgs="driverTourImgList"
+				:saveBtn='false'></previewImage>
+		</view>
 		<!-- 淇敼寮瑰嚭妗� -->
 		<view class="editDriverPopup-container">
 			<u-popup :show="editDriverPopupShow"
@@ -279,8 +302,16 @@
 <script>
 	import { redirectLogin } from '@/utils/status';
 	import { BaseUrl } from '@/api/publicInterface.js';
-	import { mapMutations } from 'vuex';
+	import previewImage from '@/components/kxj-previewImage/kxj-previewImage.vue';
+	import { mapMutations, mapState } from 'vuex';
 	export default {
+		components: { previewImage },
+		computed: {
+			...mapState(['driverTourImgList']),
+			roleType() {
+				return uni.getStorageSync('roleType');
+			},
+		},
 		data() {
 			return {
 				// 鑾峰彇鐨勫徃鏈鸿鎯�
@@ -617,7 +648,10 @@
 				uni.navigateTo({
 					url: '/pages/customer-page/customer-my/faYunstatistics/faYunstatistics'
 				});
-			}
+			},
+			noobTour() {
+				this.$refs.previewImage.open('https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png')
+			},
 		}
 	};
 </script>
diff --git a/store/index.js b/store/index.js
index d556246..d0e432f 100644
--- a/store/index.js
+++ b/store/index.js
@@ -93,7 +93,56 @@
 		globalIntervalId: null,
 		is_open_socket: false, //閬垮厤閲嶅杩炴帴
 		connectNum: 1, //閲嶈繛娆℃暟,
-		reconnectTimeOut: null
+		reconnectTimeOut: null,
+		// 鎵撳嵃鍑哄叆闂ㄨ瘉  涓�娆″氨鍙互鏈夋墦鍗板叆闂ㄨ瘉锛�  涓ゆ鍙互鏈夊叆闂ㄨ瘉 鍑洪棬璇�  0娆′竴寮犻兘娌℃湁 
+		ablePrintInduction: false, //鍏ラ棬璇�
+		ablePrintOut: false, //鍑洪棬璇�
+		driverTourImgList: ['https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj1.png',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj2.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj3.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj4.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj5.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj6.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj7.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj8.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj9.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj10.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj11.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj12.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj13.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj14.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj15.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj16.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj17.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj18.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj19.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj20.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj21.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj22.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj23.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj24.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj25.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj26.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj27.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj28.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj29.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj30.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj31.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj32.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj33.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj33-1.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj34.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj35.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj36.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj37.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj38.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj39.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj40.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj41.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj42.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj43.jpg',
+			'https://mx.jzeg.cn:9096/appimg/image/tour/driver/sj44.jpg',
+		],
 	},
 	mutations: {
 		lengthchange(state, payload) {
@@ -163,6 +212,13 @@
 				state.connectNum = payload
 			}
 		},
+		changeablePrintInduction(state, payload) {
+			state.ablePrintInduction = payload
+		},
+		changeablePrintOut(state, payload) {
+			state.ablePrintOut = payload
+			console.log(state.ablePrintOut, '鍑洪棬璇佲��');
+		}
 	},
 	actions: {
 		websocketInit({ state, dispatch, commit }) {

--
Gitblit v1.9.1