From 783ce26ca70a54deb98c6644a911df88021ee28f Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 12 三月 2024 09:41:53 +0800
Subject: [PATCH] mrshi

---
 h5/pages/visitorApplication/visitorApplication.vue |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/h5/pages/visitorApplication/visitorApplication.vue b/h5/pages/visitorApplication/visitorApplication.vue
index 927e769..bdf5b0a 100644
--- a/h5/pages/visitorApplication/visitorApplication.vue
+++ b/h5/pages/visitorApplication/visitorApplication.vue
@@ -35,7 +35,7 @@
 					<text>绂诲巶鏃堕棿</text>
 					<text>*</text>
 				</view>
-				<view class="list_item_content" @click="show5 = true">
+				<view class="list_item_content" @click="openLC">
 					<text :style="{color: form1.endtime ? '#000000' : ''}">{{form1.endtime ? form1.endtime : '璇烽�夋嫨'}}</text>
 					<u-icon name="arrow-right" color="#CCCCCC" size="20"></u-icon>
 				</view>
@@ -105,8 +105,10 @@
 		></u-datetime-picker>
 		<!-- 绂诲満鏃堕棿 -->
 		<u-datetime-picker
+			v-if="form1.starttime"
 			:show="show5"
-			:minDate="new Date().getTime()"
+			:minDate="new Date(form1.starttime).getTime()"
+			:maxDate="new Date(maxTime).getTime()"
 			mode="datetime"
 			@cancel="show5 = false"
 			@confirm="setoutDate"
@@ -291,6 +293,7 @@
 	import tlyPictureCut from "@/components/tly-picture-cut/tlyPictureCut.vue";
 	import keyboardInput from "@/components/keyboard-input/keyboard-input.vue";
 	import QfImageCropper from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-cropper.vue';
+	import { getDaysAfterDate } from '@/utils/utils.js'
 	export default {
 		data() {
 			return {
@@ -309,6 +312,8 @@
 				columns1: [[{name: '韬唤璇�', id: 0}, {name: '娓境璇佷欢', id: 1},{name: '鎶ょ収', id: 2}]],
 				columns: [],
 				cars: [],
+				day: null,
+				maxTime: '',
 				carName: '',
 				personnel: [],
 				userAnswerId: '',
@@ -443,6 +448,16 @@
 				}).then(res => {
 					if (res.code === 200) {
 						this.visit = res.data.code
+					}
+				})
+				// 璧峰鏃堕棿鏃堕暱
+				this.$u.api.getSystemDictData({
+					dictCode: 'VISIT_CONFIG',
+					label: 'VALIDATE_VISIT'
+				}).then(res => {
+					if (res.code === 200) {
+						this.day = Number(res.data.code)
+						// console.log(nextDay('after', true, this.day))
 					}
 				})
 			},
@@ -588,8 +603,16 @@
 					}
 				})
 			},
+			openLC() {
+				if (!this.form1.starttime) return uni.showToast({
+					title: '璇峰厛閫夋嫨鍏ュ巶鏃堕棿',
+					icon: 'none'
+				})
+				this.show5 = true
+			},
 			setinDate(e) {
 				this.form1.starttime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM');
+				this.maxTime = getDaysAfterDate(uni.$u.timeFormat(e.value, 'yyyy-mm-dd'), this.day)
 				this.show4 = false
 			},
 			setoutDate(e) {

--
Gitblit v1.9.3