17755135699 1 år sedan
förälder
incheckning
597f8fd44a
4 ändrade filer med 39 tillägg och 23 borttagningar
  1. 17 11
      pages/house/createOrder.vue
  2. 14 7
      pages/house/index.vue
  3. 7 4
      pages/house/orderInfo.vue
  4. 1 1
      pages/house/stayCheck.vue

+ 17 - 11
pages/house/createOrder.vue

@@ -33,7 +33,7 @@
 			<view class="perItem" v-for="(item,index) in dataForm.detailFormList[0].checkInPersonList">
 				<text>{{item.checkInName}}</text>
 				<text style="margin-left: 40px;">{{item.idCard}}</text>
-				<u-icon name="close-circle" color="#999" size="28" @click="delPer(index)"></u-icon>
+				<u-icon name="close-circle-fill" color="#ddd" size="30" @click="delPer(index)"></u-icon>
 			</view>
 		</view>
 		<view class="box box1">
@@ -46,8 +46,8 @@
 				<view class="dateNum">共{{dataForm.num}}晚</view>
 				<view class="end" v-if="dataForm.leaveDate">
 					<text>离店日期</text>
-					<text @click="leaveDateShow=true" class="txt">{{dataForm.leaveDate.substring(5,10)}}</text>
-					<u-datetime-picker :show="leaveDateShow"  mode="date"
+					<text @click="showPick()" class="txt">{{dataForm.leaveDate.substring(5,10)}}</text>
+					<u-datetime-picker :show="leaveDateShow"  mode="date" ref="picker"
 						@cancel="leaveDateShow=false"
 						@confirm="credentialsConfirmtime" :defaultIndex="credentialsDefaulttime"></u-datetime-picker>
 				</view>
@@ -164,7 +164,7 @@
 	export default {
 		data() {
 			return {
-				credentialsDefaulttime:[0],
+				credentialsDefaulttime:[10,1,0],
 				titleStyle: {
 					fontSize: '34rpx',
 					fontWeight: "bold",
@@ -189,7 +189,7 @@
 						checkInPersonList: [],
 						checkInType: 0,
 						checkInTypeName: '',
-						id: 0,
+						id:0,
 						otherAmount: 0,
 						roomAmount: 0,
 						roomIds: "",
@@ -262,10 +262,14 @@
 			this.currentDate = year + '-' + mon + '-' + day;
 		},
 		methods: {
+			showPick(){
+				this.leaveDateShow=true;
+				this.$refs.picker.innerValue=new Date().getTime()
+			},
 			//i计算天数
 			getDaysBetween(dateString1,dateString2){
-			    var  startDate = Date.parse(dateString1);
-			    var  endDate = Date.parse(dateString2);
+			    var  startDate =Date.parse(dateString1);
+			    var  endDate =Date.parse(dateString2);
 			    if (startDate>endDate){
 			        return 0;
 			    }
@@ -473,8 +477,8 @@
 						this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
 							.val == res.data.data.checkInType))[0].label;
 						this.dataForm.detailFormList[0].roomAmount = res.data.data.roomAmount;
-						this.dataForm.arriveDate = res.data.data.arriveDate.substring(0,10);
-						this.dataForm.leaveDate = res.data.data.leaveDate.substring(0,10);
+						this.dataForm.arriveDate = res.data.data.arriveDate;
+						this.dataForm.leaveDate = res.data.data.leaveDate;
 						this.dataForm.houseBaseId = res.data.data.houseBaseId;
 						this.dataForm.houseBaseName = res.data.data.houseBaseName;
 						this.dataForm.num = res.data.data.num;
@@ -625,9 +629,11 @@
 	.perItem {
 		display: flex;
 		align-items: center;
-		padding: 30rpx 0;
+		padding: 26rpx 0;
 		border-bottom: 1rpx solid #E1E1E1;
-
+		&:last-child{
+			border: 0;
+		}
 		text {
 			font-size: 30rpx;
 			color: #333;

+ 14 - 7
pages/house/index.vue

@@ -74,6 +74,12 @@
 										<template
 											v-if="delDataStatus(item2.roomNumber,item2.houseBaseId,roomData.roomDataList,'status') == 1">
 											<view
+												v-if="disTabCli(roomData) == 1"
+												class="cellBox disT">
+												{{item2.roomNumber|delDataStatus(item2.houseBaseId,roomData.roomDataList,'price')}}
+											</view>
+											<view
+												v-else
 												@click="check(item2.roomNumber,item2.houseBaseId,roomData,i + '-'+index2+ '-'+ ind)"
 												class="cellBox">
 												{{item2.roomNumber|delDataStatus(item2.houseBaseId,roomData.roomDataList,'price')}}
@@ -202,7 +208,6 @@
 			},
 			scroll(e) {
 				//this.scrollLeft = e.detail.scrollLeft; // div 到左边的距离
-				//console.log(e)
 			},
 			//关房
 			tabCli(roomNumber, id, roomId) {
@@ -237,7 +242,6 @@
 					status: status
 				}).then(res => {
 					if (res.data.code == 0) {
-						console.log(res.data)
 						this.clearData();
 						this.areaShow = false;
 						this.init()
@@ -272,6 +276,11 @@
 					}
 				}
 			},
+			disTabCli(roomData) {
+				if(new Date(roomData.rentDate).Format('yyyy-MM-dd')<new Date().Format('yyyy-MM-dd')){
+					return 1
+				}
+			},
 			clearData() {
 				setTimeout(() => {
 					this.checkDataDate = [];
@@ -325,15 +334,12 @@
 								this.checkDataDate = [];
 								this.checkPrice = [];
 							}
-							console.log(this.checkDataDate);
-							console.log(this.checkDataRoomId)
 						}
 					}
 				}
 			},
 			getLeftData() {
 				this.$api.get(`/merchant/hotel/room/state/getHouseCategoryData/${this.homestayId}`).then(res => {
-					console.log(res)
 					if (res.data.code == 0) {
 						// for (let i; i < res.data.data.length; i++) {
 						// 	res.data.data[i].open = true;
@@ -349,8 +355,6 @@
 							}
 						}
 						this.leftData = res.data.data;
-						console.log(this.leftData)
-						console.log(this.indexArr)
 					}
 				})
 			},
@@ -567,6 +571,9 @@
 						flex-direction: column;
 						align-items: center;
 						justify-content: center;
+						&.disT{
+							color: #ccc;
+						}
 					}
 
 

+ 7 - 4
pages/house/orderInfo.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="page" :style="{'height':(h)+'px','padding-top':mt+'px'}">
 		<c-nav-bar title="订单详情" showIcon="true" :titleStyle="titleStyle"></c-nav-bar>
-		<view class="body">
+		<view class="body" v-if="orderInfo.detailFormList[0]">
 			<!-- 个人信息 -->
 			<view class="uname">
 				<text style="margin-right: 20rpx;">{{orderInfo.guestName}}</text>
@@ -27,7 +27,7 @@
 						<text
 							style="font-size: 30rpx; color: #777; ">{{orderInfo.detailFormList[0].checkInPersonList.length}}人
 						</text>
-						<u-icon name="arrow-right" @click.native="goStayCheck"></u-icon>
+						<!-- <u-icon name="arrow-right" @click.native="goStayCheck"></u-icon> -->
 						<!-- <u-icon name="arrow-right" ></u-icon>  -->
 					</view>
 				</view>
@@ -79,7 +79,7 @@
 				<!-- 已预订 -->
 				<template v-if="orderInfo.orderStatus==1">
 					<button class="edit" @click="edit()">编辑订单</button>
-					<button class="goRoom" @click="checkIn(2)">办理入住</button>
+					<button class="goRoom" @click="checkIn(2)" v-if="showRuzhu">办理入住</button>
 				</template>
 				<!-- 已入住 -->
 				<template v-if="orderInfo.orderStatus==2">
@@ -133,6 +133,7 @@
 					status: -1,
 					orderCode: "",
 				},
+				showRuzhu:false,
 				orderId: '',
 				orderInfo: {}
 			}
@@ -149,7 +150,9 @@
 				this.$api.get(`/merchant/hotel/order/getOrderDetail/${this.orderId}`).then((res) => {
 					if (res.data.code == 0) {
 						this.orderInfo = res.data.data
-
+						if(new Date(this.orderInfo.arriveDate).Format('yyyy-MM-dd')== new Date().Format('yyyy-MM-dd')){
+							this.showRuzhu=true;
+						}
 					}
 				})
 			},

+ 1 - 1
pages/house/stayCheck.vue

@@ -119,7 +119,7 @@
 			this.checkInPersonList = this.orderInfo.detailFormList[0].checkInPersonList;
 			if (!this.checkInPersonList || this.checkInPersonList.length == 0) {
 				this.checkInPersonList.push({
-					cardType: '',
+					cardType:0,
 					idCard: '',
 					checkInPhone: '',
 					checkInName: '',