From 6ebd978221c7bf469f5e1d821b4345101357ca4c Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期一, 10 二月 2025 09:32:22 +0800
Subject: [PATCH] faat:提煤单详情下磅文字修改

---
 pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue |  167 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 157 insertions(+), 10 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 0161875..e37dac6 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=" isBtnShow ? '涓嬬' : '鎵撳嵃鍑洪棬璇�'"
 					@click="printBefore('out')"
 					type="primary"
 					shape="circle"
@@ -228,6 +228,13 @@
 			</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>
 					<!-- 鏌ョ湅璺嚎鎸囧紩 -->
@@ -268,7 +275,7 @@
 				@change="radioChange"
 				>
 				<u-radio label="鐓ゅ満" :name="'鐓ゅ満'" :labelSize="30" :size="30"></u-radio>
-				<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">
@@ -356,9 +363,11 @@
 				swiperList:[],
 				orderPlanId: null,
 				radioValue:'鐓ゅ満',
+				isBtnShow:true,
 				currentNum:0,
 				guideLineshow:false,
 				yyId: null,
+				isXiaBang:false, // 鍒ゆ柇鏄笉鏄┈澶存礂閫夊巶 鏄殑璇濓紝鎵撳嵃2瀛楁敼涓嬬
 				dayRZ: [],
 				activeText:'',
 				activeObj:{
@@ -602,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 {
@@ -634,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;
+						}
+					}
+				})
 				})
 			},
 			// 鏃ュ織鏌ヨ
@@ -882,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')
 				}
@@ -1066,8 +1099,122 @@
 					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>

--
Gitblit v1.9.1