From 7f594b32345b5547d73d92ab6995eb5c69f357b9 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期一, 17 三月 2025 17:40:17 +0800
Subject: [PATCH] feat:注册车牌号校验修改

---
 pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue |  278 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 266 insertions(+), 12 deletions(-)

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 1f32a0e..f97e93c 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
@@ -1,7 +1,7 @@
 <template>
 	<view class="bill-of-lading-details">
 		<view class="top-banner"
-			style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/loadingbanner.png') no-repeat;background-size: cover;">
+			style="background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/loadingbanner.png') no-repeat;background-size: cover;">
 			<u-notice-bar :text="originInfoNotice"
 				v-if="haveInputOrigin&&!isSpecial"
 				fontSize='36'></u-notice-bar>
@@ -23,7 +23,7 @@
 					<view class="basic">
 						<view class="coalName">{{ coalDetailsData.coalName }}</view>
 						<view class="status-button"
-							style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/statusbutton.png') no-repeat;
+							style="background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/statusbutton.png') no-repeat;
 										background-size: cover;">
 							{{coalDetailsData.statusView||''}}
 						</view>
@@ -47,19 +47,19 @@
 					<view class="weigh-item">
 						<view class="item">
 							<view class="concrete"
-								style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/skin.png') no-repeat;background-size: cover;">
+								style="background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/skin.png') no-repeat;background-size: cover;">
 								鐨�</view>
 							<view class="num">{{ coalDetailsData.skin||"" }}</view>
 						</view>
 						<view class="item">
 							<view class="concrete"
-								style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/hair.png') no-repeat;background-size: cover;">
+								style="background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/hair.png') no-repeat;background-size: cover;">
 								姣�</view>
 							<view class="num">{{ coalDetailsData.hair||""  }}</view>
 						</view>
 						<view class="item">
 							<view class="concrete"
-								style="background: url('https://mx.jzeg.cn:9096/appimg/image/banner/clean.png') no-repeat;background-size: cover;">
+								style="background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/clean.png') no-repeat;background-size: cover;">
 								鍑�</view>
 							<view class="num">{{ coalDetailsData.clean||""  }}</view>
 						</view>
@@ -219,7 +219,7 @@
 			</view>
 			<view class="weigh-button"
 				v-show="ablePrintOut">
-				<u-button text="鎵撳嵃鍑洪棬璇�"
+				<u-button :text=" isXiaBang ? '涓嬬' : '鎵撳嵃鍑洪棬璇�'"
 					@click="printBefore('out')"
 					type="primary"
 					shape="circle"
@@ -228,6 +228,18 @@
 			</view>
 			<view class="weigh-button"><u-button text="灞曠ず鎻愮叅鍗�"
 					@click="showCaolPickUpBill"
+					type="primary"
+					shape="circle"></u-button></view>
+					<!-- 鐢靛瓙纾呭崟涓嬭浇 -->
+					<view class="weigh-button"
+					v-if="isBtnShow"
+					><u-button text="涓嬭浇鐢靛瓙纾呭崟"
+					@click="downloadFileFun"
+					type="primary"
+					shape="circle"></u-button></view>
+					<!-- 鏌ョ湅璺嚎鎸囧紩 -->
+	<view class="weigh-button"><u-button text="鏌ョ湅璺嚎鎸囧紩"
+					@click="reviewGuidelines"
 					type="primary"
 					shape="circle"></u-button></view>
 		</view>
@@ -255,6 +267,31 @@
 				:show="servieceShow"
 				cancelText="鍙栨秷"></u-action-sheet>
 		</view>
+		<u-popup :show="guideLineshow" mode="bottom"   @close="close">
+        <view style="margin-top: 35rpx;padding-left: 20rpx;">
+			<u-radio-group 
+				v-model="radioValue"
+				placement="row" 
+				@change="radioChange"
+				>
+				<u-radio label="鐓ゅ満" :name="'鐓ゅ満'" :labelSize="30" :size="30"></u-radio>
+				<u-radio label="鍗曚綅"  :name="'鍗曚綅'" :labelSize="30" :size="30"></u-radio>
+			</u-radio-group>
+
+            <div class="guidebox">
+				<u-swiper
+				v-if="guideLineshow"
+				:height="200"
+				@click="swiperClick"
+				:list="swiperList"
+				keyName="image"
+				circular
+		></u-swiper>
+		  <view>{{ activeText }}</view>
+		  <u-album :urls="swiperList"  ref="swiperAlbum" keyName="src2"></u-album>
+			</div>
+        </view>
+	</u-popup>
 		<!-- 纾呮埧蹇欑鎻愮ず寮圭獥 -->
 		<view class="">
 			<u-modal :show="wsgShow"
@@ -323,9 +360,20 @@
 		},
 		data() {
 			return {
+				swiperList:[],
 				orderPlanId: null,
+				radioValue:'鐓ゅ満',
+				isBtnShow:true,
+				currentNum:0,
+				guideLineshow:false,
 				yyId: null,
+				isXiaBang:false, // 鍒ゆ柇鏄笉鏄┈澶存礂閫夊巶 鏄殑璇濓紝鎵撳嵃2瀛楁敼涓嬬
 				dayRZ: [],
+				activeText:'',
+				activeObj:{
+					affiliationId:'',
+					type:2,
+				},
 				coalDetailsData: {}, // 鎻愮叅鍗曡鎯�
 				currentPageCoalStatus: 0, // 褰撳墠椤甸潰鎻愮叅鍗曠姸鎬�
 				// 鑾峰彇鎵�鍦ㄧ鎴垮弬鏁�
@@ -563,6 +611,7 @@
 						this.originInfoForm.coalContactSkin = this.coalDetailsData.skinTwo;
 						this.originInfoForm.coalContactHair = this.coalDetailsData.hairTwo;
 						this.originInfoForm.contactPicture = this.coalDetailsData.contactPicture
+						this.isXiaBang = (this.coalDetailsData.deptId == '1765926490588897282' ? true : false);
 						if (this.coalDetailsData.contactPicture) {
 							this.fileList1 = this.coalDetailsData.contactPicture.split(',').map(v => {
 								return {
@@ -595,7 +644,30 @@
 						}
 					}, 1000)
 					}
-					
+					//鏌ヨ褰撳墠鍗曚綅鏄惁鏈夌數瀛愭彁鐓ゅ崟鍔熻兘
+					// this.$reqGet('getIsOpenTm').then(res=>{
+					// 	console.log(res,'鏌ヨ鏌ヨ')
+					// })
+					uni.request({
+					url: `${BaseUrl}/admin/dict/type/app_tmorder_use`,
+					method: 'GET',
+					success: (res) => {
+						console.log(res.data.data, '鏌ヨ瀛楀吀椤�');
+						let falseArr = res.data.data.map(item=>{
+							return item.value
+						});
+						if (falseArr.length){
+							if(falseArr.includes(this.coalDetailsData.deptId)){
+								this.isBtnShow = true;
+							}else{
+								this.isBtnShow = false;
+							}
+
+						}else{
+							this.isBtnShow = false;
+						}
+					}
+				})
 				})
 			},
 			// 鏃ュ織鏌ヨ
@@ -730,7 +802,7 @@
 							res.data.id
 						}&gateCameraId=${res.data.lastEquipmentId}&gateCameraCode=${res.data.lastEquipmentCode}&weighHouseCode=${res.data.code}&primarySkin=${
 							this.primarySkin
-						}&primaryHair=${this.primaryHair}&primaryClean=${this.primaryClean}&sceneInOut=${res.data.sceneInOut}&overTmWaixiao=${this.overTmWaixiao}`
+						}&primaryHair=${this.primaryHair}&primaryClean=${this.primaryClean}&sceneInOut=${res.data.sceneInOut}&overTmWaixiao=${this.overTmWaixiao}&deptId=${this.getWeightHouseObj.deptId }`
 						});
 					} else {
 						this.$u.toast(res.msg ? res.msg : '鏈湪纾呮埧锛岃鍓嶅線纾呮埧鍚庡啀璇曪紒锛�');
@@ -843,7 +915,7 @@
 					filedId: this.getWeightHouseObj.filedId,
 					tmId: this.getWeightHouseObj.tmId,
 					carNo: uni.getStorageSync('carNo'),
-					type: 3,
+					type: this.$store.state.ispecial.includes(this.coalDetailsData.deptId) ? 4 : 3,
 					weighingNumber: 2,
 					printing: uni.getStorageSync('selectedPrintStyle')
 				}
@@ -979,13 +1051,192 @@
 				uni.navigateTo({
 					url: `/pages/public-page/driverStream/driverStream?eqCode=${this.timeLineEqCode}`
 				})
-			}
+			},
+			getguideFun(){
+				this.$reqGet('getRoute', this.activeObj).then((res)=>{
+					console.log(res,'res');
+					if(res.data.length){
+						this.swiperList = res.data[0].guideImg.split(',').map(item=>{
+							return BaseUrl + item;
+						});//鏁扮粍
+						console.log(this.swiperList,'swiperList');
+						this.activeText = res.data[0].guideText;
+					}else{
+						this.swiperList = [];
+						this.activeText = '鏆傛棤鏁版嵁'
+					}
+
+				})
+
+			},
+			reviewGuidelines(){
+				this.guideLineshow = true;
+				this.swiperList = [];
+				this.activeText = '';
+				this.activeObj.affiliationId = this.coalDetailsData.filedId; //榛樿鏌ョ叅鍦�
+				this.getguideFun();
+
+			},
+			close(){
+				this.guideLineshow = false;
+			},
+			radioChange(item){
+				console.log(item);
+				if(item == '鐓ゅ満'){
+					this.activeObj.affiliationId = this.coalDetailsData.filedId;
+					this.activeObj.type = 2
+				}else{
+					this.activeObj.affiliationId = this.coalDetailsData.deptId;
+					this.activeObj.type = 1
+				}
+				this.getguideFun();
+
+			},
+			//鎵撳紑鍥剧墖棰勮
+			swiperClick(){
+				console.log(this.$refs.swiperAlbum,'swiperAlbum')
+				this.$nextTick(()=>{
+					this.$refs.swiperAlbum.onPreviewTap();
+					this.$refs.swiperAlbum.openPage();
+				})
+			},
+			downloadFileFun(){
+				wx.getSetting({
+								success: (res) => {
+									//妫�鏌ユ槸鍚︽湁璁块棶鐩稿唽鐨勬潈闄愶紝濡傛灉娌℃湁鍒欓�氳繃wx.authorize鏂规硶鎺堟潈
+									if (!res.authSetting['scope.writePhotosAlbum']) {
+										console.log('娌℃湁鑾峰彇鎺堟潈');
+										wx.authorize({
+											scope: 'scope.writePhotosAlbum',
+											success: (res) => {
+												//鐢ㄦ埛鐐瑰嚮鍏佽鑾峰彇鐩稿唽淇℃伅鍚庤繘鍏ヤ笅杞戒繚瀛橀�昏緫
+												this.downloadTmFile()
+											}
+										})
+
+									} else {
+										console.log('宸茶幏鍙栨巿鏉�');
+										this.downloadTmFile()
+
+									}
+
+								}
+
+								});
+			},
+			//涓嬭浇鐢靛瓙纾呭崟
+			downloadTmFile(){
+				uni.showLoading({
+					title: '鍔犺浇涓�'
+				});
+				this.$reqGetId('downLoadTm',this.coalDetailsData.id).then(res=>{
+					console.log(res,'result')
+					this.$u.toast('涓嬭浇鎴愬姛锛�')
+					uni.hideLoading();
+					const result =    res.data.url;
+					let that = this;
+					const fileExtName = ".pdf";
+					const randfile = new Date().getTime() +res.data.fileName;
+					const newPath = `${wx.env.USER_DATA_PATH}/${randfile}`;
+					if(result){
+								wx.downloadFile({
+								url: `${BaseUrl}${result}`,
+								filePath:wx.env.USER_DATA_PATH+`/${randfile}`,
+								header: {
+									Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'),
+									CLIENT_TOC: 'Y'
+								},
+								success(res){
+									const filePath = res.tempFilePath;
+									wx.openDocument({
+									filePath: res.filePath,
+									showMenu: true,
+									fileType: 'pdf',
+									success: function (res) {}
+									})
+									//鍏堟鏌ョ浉鍐岃闂巿鏉冩儏鍐�
+									// try {
+									// 	setTimeout(() => {
+									// 		wx.getFileSystemManager().saveFile({
+									// 	tempFilePath:data,
+									// 	// filePath: data,
+									// 	success(res2) {
+									// 		console.log('瑙﹀彂res2save',res2)
+									// 		//鑾峰彇浜嗙浉鍐岀殑璁块棶鏉冮檺锛屼娇鐢� wx.saveImageToPhotosAlbum 灏嗗浘鐗囦繚瀛樺埌鐩稿唽涓�
+
+									// 		wx.saveImageToPhotosAlbum({
+									// 		filePath: res2.savedFilePath,
+									// 		success: (res) => {
+									// 			console.log('淇濆瓨鍒扮浉鍐�>>>>>>',res)
+									// 			//淇濆瓨鎴愬姛寮瑰嚭鎻愮ず锛屽憡鐭ヤ竴涓嬬敤鎴�
+									// 			wx.showModal({
+									// 				title: '鏂囦欢宸蹭繚瀛樺埌鎵嬫満鐩稿唽',
+									// 				content: '浣嶄簬tencent/MicroMsg/WeiXin涓� \r\n灏嗕繚瀛樼殑鏂囦欢閲嶅懡鍚嶆敼涓篬 .pdf ]鍚庣紑鍗冲彲',
+									// 			confirmText: '鐭ラ亾浜�',
+									// 				s	confirmColor: '#0bc183',
+									// 				howCancel: false
+									// 			})
+									// 		},
+									// 		fail(res) {
+									// 			console.log('瑙﹀彂澶辫触save',res)
+
+									// 		}
+									// 		})
+									// 	},
+									// 	fail(err){
+									// 		console.log(err,'淇濆瓨澶辫触')
+
+									// 	}
+										
+									// })
+									// 	}, 2000);
+									
+									// } catch (error) {
+									// 	console.log(error,'resoor')
+										
+									// }
+
+									
+									
+									// wx.openDocument({
+									// filePath: data,
+									// fileType: 'pdf',
+									// showMenu: true  //琛ㄧず鍙充笂瑙掓槸鍚︽湁杞彂鎸夐挳
+									// })
+									uni.hideLoading();
+
+								},
+								fail(err){
+									console.log(err,'涓嬭浇鏂囦欢澶辫触')
+								}
+					})
+							}
+
+				})
+			},
+			
 		}
 	};
 </script>
 
-<style lang="scss"
-	scoped>
+<style lang="scss"	scoped>
+	.guidebox{
+		height:600rpx;
+		padding: 20rpx
+	}
+    .indicator-num {
+        padding: 2px 0;
+        background-color: rgba(0, 0, 0, 0.35);
+        border-radius: 100px;
+        width: 35px;
+        @include flex;
+        justify-content: center;
+
+        &__text {
+             color: #FFFFFF;
+             font-size: 12px;
+         }
+    }
 	/deep/.u-steps {
 		.u-steps-item {
 			.u-steps-item__content {
@@ -1362,4 +1613,7 @@
 			}
 		}
 	}
+	::v-deep .u-album{
+		display: none!important;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1