From d9b1b7643c4c8d0db32aae07fc2276364553d4be Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期四, 15 八月 2024 17:28:49 +0800
Subject: [PATCH] fix:消息管理、客户首页修改样式

---
 pages/driver-page/appointment/appointment.vue |  339 ++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 204 insertions(+), 135 deletions(-)

diff --git a/pages/driver-page/appointment/appointment.vue b/pages/driver-page/appointment/appointment.vue
index dae7583..e801625 100644
--- a/pages/driver-page/appointment/appointment.vue
+++ b/pages/driver-page/appointment/appointment.vue
@@ -1,19 +1,30 @@
 <template>
 	<view class="appointment">
-		<combined-title :title="yuYueData.length != 0 ? yuYueData[0].filedName + '鈥斺��' + yuYueData[0].sendDate : '鏆傛棤棰勭害鍒楄〃'"></combined-title>
+		<view class="appointment-description"
+			v-if="isRCSQ">
+			*鎮ㄥ綋鍓嶇殑棰勭害鏃堕棿娈�<text>{{yuYueSection}}</text>
+		</view>
+		<combined-title
+			:title="yuYueData.length != 0 ? yuYueData[0].filedName + '鈥斺��' + yuYueSection : '鏆傛棤棰勭害鍒楄〃'"></combined-title>
 		<view class="appointment-table">
-			<uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁">
+			<uni-table border
+				stripe
+				emptyText="鏆傛棤鏇村鏁版嵁">
 				<uni-tr>
 					<uni-th align="center">鏃堕棿娈�</uni-th>
 					<uni-th align="center">鍙绾�</uni-th>
 					<uni-th align="center">宸查绾�</uni-th>
 					<uni-th align="center">鎿嶄綔</uni-th>
 				</uni-tr>
-				<uni-tr v-for="(item, index) in yuYueData" :key="item.id">
+				<uni-tr v-for="(item, index) in yuYueData"
+					:key="item.id">
 					<uni-td align="center">{{ (item.startTime || '') + '-' + (item.endTime || '') }}</uni-td>
 					<uni-td align="center">{{ item.carNum || '' }}</uni-td>
 					<uni-td align="center">{{ item.carNum1 || '' }}</uni-td>
-					<uni-td><u-button text="閫夋嫨" type="primary" :disabled="item.carNum == item.carNum1" @click="yuYueBtnClick(item)"></u-button></uni-td>
+					<uni-td><u-button text="閫夋嫨"
+							type="primary"
+							:disabled="item.carNum == item.carNum1&&!isRCSQ"
+							@click="yuYueBtnClick(item)"></u-button></uni-td>
 				</uni-tr>
 			</uni-table>
 		</view>
@@ -21,151 +32,209 @@
 </template>
 
 <script>
-import combinedTitle from '@/components/combined-title/combined-title.vue';
-export default {
-	components: {
-		combinedTitle
-	},
-	data() {
-		return {
-			// 棰勭害鍒楄〃璇锋眰鍙傛暟
-			yuYueListParams: {
-				filedId: '',
-				deptId: '',
-				sendDate: ''
-			},
-			// 棰勭害璇锋眰鍙傛暟
-			yuYuePostParams: {
-				takeCoalId: null,
-				yuYueId: null
-			},
-			yuYueData: [],
-			isRCSQ: false, // 鍏ュ満鐢宠鎺ュ彛鎺у埗
-			rcsqData: {
-				taskId: '',
-				originalYyId: '',
-				yyId: '',
-				deptId: '',
-				filedId: '',
-				remark: ''
+	import combinedTitle from '@/components/combined-title/combined-title.vue';
+	export default {
+		components: {
+			combinedTitle
+		},
+		data() {
+			return {
+				// 棰勭害鍒楄〃璇锋眰鍙傛暟
+				yuYueListParams: {
+					filedId: '',
+					deptId: '',
+					sendDate: ''
+				},
+				// 棰勭害璇锋眰鍙傛暟
+				yuYuePostParams: {
+					takeCoalId: null,
+					yuYueId: null
+				},
+				yuYueData: [],
+				isRCSQ: false, // 鍏ュ満鐢宠鎺ュ彛鎺у埗
+				rcsqData: {
+					taskId: '',
+					originalYyId: '',
+					yyId: '',
+					deptId: '',
+					filedId: '',
+				},
+				yuYueSection: '',
+				coalStatus: '',
+				tmId: ""
+			};
+		},
+		onLoad(params) {
+			console.log(params,'params')
+			if (params.type == '鍏ュ満鐢宠') {
+				this.isRCSQ = true;
+				this.rcsqData.originalYyId = params.yyId;
+				// this.yuYueSection = params.yuYueSection
+				this.yuYueSection = this.getNowFormatDate();
 			}
-		};
-	},
-	onLoad(params) {
-		console.log('appointment,params', params);
-		if (params.type == '鍏ュ満鐢宠') {
-			this.isRCSQ = true;
-			this.rcsqData.originalYyId = params.yyId;
-		}
-		this.yuYuePostParams.takeCoalId = params.takeCoalId;
-		this.yuYueListParams.filedId = params.filedId;
-		this.yuYueListParams.deptId = params.deptId;
-		this.yuYueListParams.sendDate = params.sendDate;
-	},
-	onShow() {
-		this.init();
-	},
-	methods: {
-		init() {
-			this.yuYueList();
+			this.yuYueSection = this.getNowFormatDate();
+			this.yuYuePostParams.takeCoalId = params.takeCoalId;
+			this.yuYueListParams.filedId = params.filedId;
+			this.yuYueListParams.deptId = params.deptId;
+			this.yuYueListParams.sendDate = params.sendDate;
+			this.coalStatus = params.coalStatus;
+			this.tmId = params.tmId
 		},
-		// 棰勭害鍒楄〃
-		yuYueList() {
-			uni.showLoading({
-				title: '鍔犺浇涓�...'
-			});
-			this.$reqGet('yuYueList', this.yuYueListParams).then(res => {
-				uni.hideLoading();
-				if (res.code == 0) {
-					this.yuYueData = res.data;
-				}
-			});
+		onShow() {
+			this.init();
 		},
-		// 棰勭害鍜屽叆鍦虹敵璇峰叡鐢ㄤ簨浠�
-		yuYueBtnClick(value) {
-			if (this.isRCSQ) {
-				this.rcsqData.taskId = this.yuYuePostParams.takeCoalId;
-				this.saveRCSQ(value);
-			} else {
-				this.yuYueClick(value.id);
-			}
-		},
-		// 棰勭害
-		yuYueClick(id) {
-			this.yuYuePostParams.yuYueId = id;
-			this.$reqPost('yuYue', { takeCoalId: this.yuYuePostParams.takeCoalId, yuYueId: this.yuYuePostParams.yuYueId }, 'params').then(res => {
-				if (res.code == 0) {
-					this.$u.toast('棰勭害鎴愬姛锛�');
-					let timer = setTimeout(() => {
-						uni.navigateBack({
-							delta: 1
-						});
-					}, 1000);
+		methods: {
+			init() {
+				this.yuYueList();
+			},
+			// 棰勭害鍒楄〃
+			yuYueList() {
+				uni.showLoading({
+					title: '鍔犺浇涓�...'
+				});
+				this.$reqGet('yuYueList', this.yuYueListParams).then(res => {
+					uni.hideLoading();
+					if (res.code == 0) {
+						this.yuYueData = res.data;
+					} else {
+						this.$u.toast('鍔犺浇澶辫触');
+					}
+				});
+			},
+			// 棰勭害鍜屽叆鍦虹敵璇峰叡鐢ㄤ簨浠�
+			yuYueBtnClick(value) {
+				if (this.isRCSQ) {
+					this.rcsqData.taskId = this.yuYuePostParams.takeCoalId;
+					this.saveRCSQ(value);
 				} else {
-					this.$u.toast(res.msg ? res.msg : '棰勭害澶辫触');
+					this.yuYueClick(value.id);
 				}
-				setTimeout(() => {
-					this.yuYueList();
-				}, 500);
-			});
-		},
-		// 鍏ュ満鐢宠
-		saveRCSQ(value) {
-			this.rcsqData.yyId = value.id;
-			this.rcsqData.deptId = value.deptId;
-			this.rcsqData.filedId = value.filedId;
-			this.$reqPost('saveRCSQ', this.rcsqData, 'json').then(res => {
-				if (res.code == 0) {
-					this.$u.toast('鏂板缓鍏ュ満鐢宠鎴愬姛銆�');
-				}
-			});
+			},
+			// 棰勭害
+			yuYueClick(id) {
+				this.yuYuePostParams.yuYueId = id;
+				this.$reqPost('yuYue', {
+					takeCoalId: this.yuYuePostParams.takeCoalId,
+					yuYueId: this.yuYuePostParams.yuYueId
+				}, 'params').then(res => {
+					if (res.code == 0) {
+						this.yuYueList();
+						this.$u.toast('棰勭害鎴愬姛');
+						let timer = setTimeout(() => {
+							uni.switchTab({
+								url: '/pages/tabbar-page/index-tabbar/index-tabbar'
+							})
+						}, 1500);
+					} else {
+						this.$u.toast(res.msg ? res.msg : '棰勭害澶辫触');
+					}
+				})
+			},
+			//鑾峰彇褰撳ぉ鏃ユ湡
+			//鑾峰彇褰撳墠鏃ユ湡鍑芥暟
+				getNowFormatDate() {
+				let date = new Date(),
+					year = date.getFullYear(), //鑾峰彇瀹屾暣鐨勫勾浠�(4浣�)
+					month = date.getMonth() + 1, //鑾峰彇褰撳墠鏈堜唤(0-11,0浠h〃1鏈�)
+					strDate = date.getDate() // 鑾峰彇褰撳墠鏃�(1-31)
+				if (month < 10) month = `0${month}` // 濡傛灉鏈堜唤鏄釜浣嶆暟锛屽湪鍓嶉潰琛�0
+				if (strDate < 10) strDate = `0${strDate}` // 濡傛灉鏃ユ槸涓綅鏁帮紝鍦ㄥ墠闈㈣ˉ0
+				
+				return `${year}-${month}-${strDate}`
+				},
+			// 鏇存崲棰勭害鏃堕棿娈�
+			saveRCSQ(value) {
+				this.rcsqData.yyId = value.id;
+				this.rcsqData.deptId = value.deptId;
+				this.rcsqData.filedId = value.filedId;
+				this.$reqPost('saveRCSQ', this.rcsqData, 'json').then(res => {
+					if (res.code == 0) {
+						this.$u.toast('鏇存崲棰勭害鏃堕棿娈垫垚鍔�');
+						let timer = setTimeout(() => {
+							uni.switchTab({
+								url: '/pages/tabbar-page/index-tabbar/index-tabbar'
+							})
+						}, 1500);
+						//濡傛灉鏈鍒� 鍏堢鍒板啀鐢宠
+					} else {
+						this.$u.toast(res.msg ? res.msg : '鏇存崲棰勭害鏃堕棿娈靛け璐ワ紝璇风◢鍚庨噸璇�');
+					}
+
+					// else if (res.code == 3) {
+					// 	this.$u.toast('璇峰厛绛惧埌');
+					// 	setTimeout(() => {
+					// 		uni.navigateTo({
+					// 			url: `/pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock?orderPlanId=${this.yuYuePostParams.takeCoalId}&coalStatus=${
+					// 			this.coalStatus}&tmId=${this.tmId}&yyId=${this.rcsqData.originalYyId}&filedId=${this.yuYueListParams.filedId}&deptId=${this.yuYueListParams.deptId}&sendDate=${this.yuYueListParams.sendDate}&yuYueSection=${this.yuYueSection}`
+					// 		})
+					// 	}, 1500)
+					// 	return
+					// } 
+				});
+			}
 		}
-	}
-};
+	};
 </script>
 
-<style lang="scss" scoped>
-::v-deep.appointment {
-	width: 94%;
-	margin: 0 auto;
-	h1 {
-		font-size: vww(20);
-		text-align: center;
-		font-weight: 550;
-		margin: vww(30) 0 vww(18) 0;
-	}
-	// 琛ㄦ牸
-	.uni-table-scroll {
-		width: 100%;
-		overflow-x: hidden;
+<style lang="scss"
+	scoped>
+	::v-deep.appointment {
+		width: 94%;
+		margin: 0 auto;
 
-		.uni-table {
-			min-width: 0 !important;
+		// 棰勭害鐣岄潰鎻忚堪
+		.appointment-description {
+			margin: vww(8) 0;
+			color: #fd1446;
 
-			.uni-table-tr {
-				padding: 0;
-				font-size: vww(13);
+			text {
+				font-weight: bold;
+				display: inline-block;
+				margin-left: vww(5);
+				color: #252525;
+			}
+		}
 
-				.uni-table-th {
-					height: vww(32);
-					line-height: vww(20);
-					padding: vww(5) vww(10);
-					color: #111111;
-					font-weight: 550;
-					background: #f5f5f5;
-				}
+		h1 {
+			font-size: vww(20);
+			text-align: center;
+			font-weight: 550;
+			margin: vww(30) 0 vww(18) 0;
+		}
 
-				.uni-table-td {
-					height: vww(32);
-					line-height: vww(20);
-					padding: vww(5) vww(10);
-					color: #111111;
-					.u-button {
-						height: vww(23);
+		// 琛ㄦ牸
+		.uni-table-scroll {
+			width: 100%;
+			overflow-x: hidden;
+
+			.uni-table {
+				min-width: 0 !important;
+
+				.uni-table-tr {
+					padding: 0;
+					font-size: vww(13);
+
+					.uni-table-th {
+						height: vww(32);
+						line-height: vww(20);
+						padding: vww(5) vww(10);
+						color: #111111;
+						font-weight: 550;
+						background: #f5f5f5;
+					}
+
+					.uni-table-td {
+						height: vww(32);
+						line-height: vww(20);
+						padding: vww(5) vww(10);
+						color: #111111;
+
+						.u-button {
+							height: vww(23);
+						}
 					}
 				}
 			}
 		}
 	}
-}
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.1