From 373929a32aa4a3197260a106be3fdc21eb109afc Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期二, 04 三月 2025 08:38:11 +0800
Subject: [PATCH] feat:门卫页面修改状态传参

---
 pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue |  322 +++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 234 insertions(+), 88 deletions(-)

diff --git a/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue b/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue
index ceb911d..9a58dd9 100644
--- a/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue
+++ b/pages/public-page/faYunstatisticsDetails/faYunstatisticsDetails.vue
@@ -1,100 +1,246 @@
 <template>
 	<view>
-		<combined-title title="鍙戣繍璇︽儏"></combined-title>
-		<view class="compDetails">
-			<uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁">
-				<uni-tr>
-					<uni-th align="left">鎻愮叅鍗曠紪鍙�</uni-th>
-					<uni-td align="left">{{ faYunDetailobj.code || '' }}</uni-td>
-				</uni-tr>
-				<uni-tr>
-					<uni-th align="left">鎻愮叅鍗曠姸鎬�</uni-th>
-					<uni-td align="left">{{ coalStatus[faYunDetailobj.status] }}</uni-td>
-				</uni-tr>
-				<uni-tr>
-					<uni-th align="left">杞︾墝鍙�</uni-th>
-					<uni-td align="left">{{ faYunDetailobj.carNo || '' }}</uni-td>
-				</uni-tr>
-				<uni-tr>
-					<uni-th align="left">鍏ュ満鏃堕棿</uni-th>
-					<uni-td align="left">{{ faYunDetailobj.inTime || '' }}</uni-td>
-				</uni-tr>
-				<uni-tr>
-					<uni-th align="left">鍑哄満鏃堕棿</uni-th>
-					<uni-td align="left">{{ faYunDetailobj.outTime || '' }}</uni-td>
-				</uni-tr>
-				<uni-tr>
-					<uni-th align="left">鐨噸</uni-th>
-					<uni-td align="left">{{ faYunDetailobj.skin || 0 }}</uni-td>
-				</uni-tr>
-				<uni-tr>
-					<uni-th align="left">姣涢噸</uni-th>
-					<uni-td align="left">{{ faYunDetailobj.hair || 0 }}</uni-td>
-				</uni-tr>
-				<uni-tr>
-					<uni-th align="left">鍑�閲�</uni-th>
-					<uni-td align="left">{{ faYunDetailobj.clean || 0 }}</uni-td>
-				</uni-tr>
-				<uni-tr>
-					<uni-th align="left">璁㈠崟缂栧彿</uni-th>
-					<uni-td align="left">{{ faYunDetailobj.orderCode || '' }}</uni-td>
-				</uni-tr>
-				<uni-tr>
-					<uni-th align="left">璁㈠崟鍓╀綑閲�</uni-th>
-					<uni-td align="left">{{ faYunDetailobj.allowance || 0 }}</uni-td>
-				</uni-tr>
-			</uni-table>
+		<view class="main">
+			<view class="main-body">
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">杞︾墝鍙�</view>
+						<view class="">{{ faYunDetailobj.carNo || '' }}</view>
+					</view>
+				</view>
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">鎻愮叅鍗曠姸鎬�</view>
+						<view class="">{{ coalStatus[faYunDetailobj.status] }}</view>
+					</view>
+				</view>
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">鍏ュ満鏃堕棿</view>
+						<view class="">{{ faYunDetailobj.inTime || '' }}</view>
+					</view>
+				</view>
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">鐨噸</view>
+						<view class="">{{ faYunDetailobj.skin || 0 }}</view>
+					</view>
+				</view>
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">姣涢噸</view>
+						<view class="">{{ faYunDetailobj.hair || '' }}</view>
+					</view>
+				</view>
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">鍑�閲�</view>
+						<view class="">{{ faYunDetailobj.clean || '' }}</view>
+					</view>
+				</view>
+				<view class="body-container"
+					v-if="!isSpecial">
+					<view class="container-block">
+						<view class="">璁㈠崟鍓╀綑閲�</view>
+						<view class="">{{ faYunDetailobj.allowance || '' }}</view>
+					</view>
+				</view>
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">鎻愮叅鍗曠紪鍙�</view>
+						<view class="">{{ faYunDetailobj.code || '' }}</view>
+					</view>
+				</view>
+				<view class="body-container last"
+					v-if="!isSpecial">
+					<view class="container-block">
+						<view class="">璁㈠崟缂栧彿</view>
+						<view class="">{{ faYunDetailobj.orderCode || '' }}</view>
+					</view>
+				</view>
+			</view>
+			<view class="origin-info"
+				v-if="faYunDetailobj.orderType == '澶栬喘' || faYunDetailobj.orderType == '鍐呰喘' || faYunDetailobj.orderType == '杞嚭'">
+				<combined-title title="鍘熷彂淇℃伅"></combined-title>
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">鐨噸</view>
+						<view class="">{{ faYunDetailobj.skinTwo || 0 }}</view>
+					</view>
+				</view>
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">姣涢噸</view>
+						<view class="">{{ faYunDetailobj.hairTwo || 0 }}</view>
+					</view>
+				</view>
+				<view class="body-container">
+					<view class="container-block">
+						<view class="">鍑�閲�</view>
+						<view class="">{{ faYunDetailobj.cleanTwo || 0 }}</view>
+					</view>
+				</view>
+			</view>
+			<!-- 澧炲姞鐢靛瓙纾呭崟涓嬭浇 -->
+			<!-- v-if="roleType === 3" -->
+			<view class="weigh-button">	<u-button text="涓嬭浇鐢靛瓙纾呭崟"
+					@click="downloadTmFile"
+					type="primary"
+					shape="circle"></u-button></view>
 		</view>
 	</view>
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			id: '',
-			faYunDetailobj: {},
-			coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅鍦�', '鍑虹叅浠�']
-		};
-	},
-	methods: {},
-	onLoad(params) {
-		this.id = params.id;
-	},
-	onShow() {
-		this.$reqGet('getTakeCoal', { takeCoalId: this.id }).then(res => {
-			if (res.code == 0) {
-				this.faYunDetailobj = res.data;
-			} else {
-				this.$u.toast('鑾峰彇鏁版嵁澶辫触');
-			}
-		});
-	}
-};
+	import { BaseUrl } from '@/api/publicInterface.js';
+	import combinedTitle from '@/components/combined-title/combined-title.vue';
+	export default {
+		components: {
+			combinedTitle
+		},
+		data() {
+			return {
+				id: '',
+				faYunDetailobj: {},
+				coalStatus: ['棰嗗彇', '棰勭害', '绛惧埌', '鍏ュ満', '绉扮毊', '绉版瘺', '绂诲満', '鍏ョ鎴�', '鍑虹鎴�', '鍏ョ叅浠�', '鍑虹叅浠�', '鏀剧┖', '浣滃簾', '鍏ュ満鐢宠',
+					'杩涘叆鍦洪櫌', '寮傚父瀹℃牳涓�', '鎵撳嵃涓�', '鎵撳嵃涓�', '濉啓'
+				],
+				isSpecial: null //1 鏄壒娈� 0涓嶆槸鐗规畩
+			};
+		},
+		methods: {
+			//涓嬭浇鐢靛瓙纾呭崟
+			downloadTmFile(){
+				uni.showLoading({
+					title: '鍔犺浇涓�'
+				});
+				this.$reqGetId('downLoadTm',this.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) {}
+									})
+									uni.hideLoading();
+
+								},
+								fail(err){
+									console.log(err,'涓嬭浇鏂囦欢澶辫触')
+								}
+					})
+							}
+
+				})
+			},
+		},
+		onLoad(params) {
+			this.id = params.id;
+		},
+		onShow() {
+			this.$reqGet('getTakeCoal', { takeCoalId: this.id }).then(res => {
+				if (res.code == 0) {
+					this.faYunDetailobj = res.data;
+					this.isSpecial = res.data.isSpecial
+				} else {
+					this.$u.toast('鑾峰彇鏁版嵁澶辫触');
+				}
+			});
+		},
+	  	computed:{
+		roleType() {
+				return uni.getStorageSync('roleType');
+			},
+	  }
+	};
 </script>
 
-<style scoped lang="scss">
-.uni-table {
-	.uni-table-tr {
-		padding: 0;
-		border: vww(1) solid #c6c6c6;
-		.uni-table-th {
-			font-size: vww(14);
-			height: vww(30);
-			line-height: vww(30);
-			padding: vww(5) vww(10);
-			color: #111111;
-			font-weight: 500;
-			background: #e2e2e2;
+<style scoped
+	lang="scss">
+	@mixin flex {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+	}
+	.weigh-button{
+		margin-top: 30rpx;
+	}
+	.main {
+		width: 100%;
+		margin-top: vww(10);
+		@include flex;
+		flex-direction: column;
+
+		.main-body {
+			width: 690rpx;
+			height: 1062rpx;
+			background: #ffffff;
+			box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
+			border-radius: 20rpx;
+			@include flex;
+			flex-direction: column;
+			align-items: flex-start;
+
+			.body-container {
+				width: 100%;
+				height: vww(56);
+				border-bottom: vww(1) solid #d6d6d6;
+				@include flex;
+				justify-content: center;
+
+				.container-block {
+					width: 96%;
+					height: vww(56);
+					@include flex;
+				}
+			}
+
+			.last {
+				border-bottom: none;
+			}
 		}
-		.uni-table-td {
-			font-size: vww(14);
-			font-weight: 400;
-			height: vww(30);
-			line-height: vww(30);
-			padding: vww(5) vww(10);
-			color: #111111;
+
+		.origin-info {
+			width: 690rpx;
+			min-height: 300rpx;
+			margin-top: 20rpx;
+			margin-bottom: 20rpx;
+			background: #ffffff;
+			box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
+			border-radius: 20rpx;
+			@include flex;
+			flex-direction: column;
+			align-items: flex-start;
+
+			.body-container {
+				width: 100%;
+				height: vww(56);
+				border-bottom: vww(1) solid #d6d6d6;
+				@include flex;
+				justify-content: center;
+
+				.container-block {
+					width: 94%;
+					@include flex;
+				}
+			}
 		}
 	}
-}
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.1