소스 검색

房态整个流程完成

17755135699 9 달 전
부모
커밋
39efee2b8b
6개의 변경된 파일331개의 추가작업 그리고 183개의 파일을 삭제
  1. 16 10
      pages/house/breast.vue
  2. 90 18
      pages/house/createOrder.vue
  3. 38 11
      pages/house/index.vue
  4. 47 19
      pages/house/orderInfo.vue
  5. 132 114
      pages/house/stayCheck.vue
  6. 8 11
      pagesMy/orderList/orderList.vue

+ 16 - 10
pages/house/breast.vue

@@ -40,6 +40,7 @@
 	export default {
 		data() {
 			return {
+				homestayId: this.$store.state.moduleHouse.homestayId,
 				list: [],
 				list2: []
 			}
@@ -47,7 +48,7 @@
 		onLoad(opt) {
 			console.log(opt)
 			let list = JSON.parse(opt.list1);
-			let list2 =JSON.parse(opt.list2);
+			let list2 = JSON.parse(opt.list2);
 			this.getBreastData(list);
 			this.getOtherData(list2);
 		},
@@ -61,18 +62,20 @@
 			},
 			getBreastData(list) {
 				this.$api.get('/merchant/hotel/order/getBreakfastList', {
-					homestayId: '1711268640588517378'
+					homestayId: this.homestayId
 				}).then(res => {
 					console.log(res)
 					if (res.data.code == 0) {
 						if (list && list.length != 0) {
+							let filItem = null;
 							for (let i = 0; i < res.data.data.length; i++) {
-								let item = list.filter(
+								filItem = list.filter(
 									(item) =>
 									item.breakfastName == res.data.data[i].breakfastName
 								);
-								if (item) {
-									res.data.data[i].num = item[0].num;
+								if (filItem) {
+									res.data.data[i].num = filItem[0].num;
+									break;
 								}
 							}
 						}
@@ -83,17 +86,19 @@
 			},
 			getOtherData(list2) {
 				this.$api.get('/merchant/hotel/order/getOtherList', {
-					homestayId: '1711268640588517378'
+					homestayId: this.homestayId
 				}).then(res => {
 					if (res.data.code == 0) {
 						if (list2 && list2.length != 0) {
+							let filItem = null;
 							for (let i = 0; i < res.data.data.length; i++) {
-								let item = list2.filter(
+								filItem = list2.filter(
 									(item) =>
 									item.projectName == res.data.data[i].projectName
 								);
-								if (item) {
-									res.data.data[i].num = item[0].num;
+								if (filItem) {
+									res.data.data[i].num = filItem[0].num;
+									break;
 								}
 							}
 						}
@@ -167,10 +172,12 @@
 		}
 
 	}
+
 	.input {
 		margin: 0 20rpx;
 		font-size: 28rpx;
 	}
+
 	.minus,
 	.plus {
 		justify-content: center;
@@ -182,5 +189,4 @@
 		border: 1px solid #999;
 		border-radius: 6rpx;
 	}
-	
 </style>

+ 90 - 18
pages/house/createOrder.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="page" :style="{'height':(h)+'px','padding-top':mt+'px'}">
-		<c-nav-bar title="新增订单" :showIcon="true"></c-nav-bar>
+		<c-nav-bar :title="!dataForm.id?'新增订单':!orderStatus?'编辑订单':'办理入住'" :showIcon="true"></c-nav-bar>
 		<view class="box box1">
 			<view class="tit">预订信息</view>
 			<u-cell-group :border="false" customStyle="margin:0 -30rpx">
@@ -97,8 +97,8 @@
 						</view>
 					</view>
 				</u-swipe-action-item>
-				<u-swipe-action-item :show="item.show" :index="index" class=""
-					v-for="(item, index) in dataForm.detailFormList[0].otherData" :key="index" @click="click2(index)"
+				<u-swipe-action-item :show="item.show" :index="index2" class=""
+					v-for="(item, index2) in dataForm.detailFormList[0].otherData" :key="index2" @click="click2(index2)"
 					:options="options">
 					<view class="goodsInfo item">
 						<view class="title-wrap">
@@ -112,9 +112,9 @@
 			<view class="tit tit2"><text>收款信息</text> <u-icon @click="addpay()" name="plus-circle" label="添加收款"
 					labelColor="#1372FF" labelSize="24" color="1372FF" size="30"></u-icon></view>
 			<u-swipe-action>
-				<u-swipe-action-item :show="item.show" :index="index" class="goodsInfo"
+				<u-swipe-action-item :show="item.show" :index="index" class=""
 					v-for="(item, index) in dataForm.flowRecord" :key="index" @click="click3(index)" :options="options">
-					<view class="item">
+					<view class="goodsInfo item">
 						<view class="title-wrap">
 							<text
 								class="title u-line-2">{{item.flowTypeName}}/{{item.payTypeName}}/{{item.amount}}</text>
@@ -126,8 +126,9 @@
 		<view class="footer">
 			<view class="total"><text>订单金额:</text><text>¥{{totalMOney}}</text></view>
 			<view class="btns">
-				<text @click="confirmOrder(2)">直接入住</text>
-				<text @click="confirmOrder(1)">提交订单</text>
+				{{today}}
+				<text @click="confirmOrder(2)" v-if="today==1">直接入住</text>
+				<text @click="confirmOrder(1)">提交</text>
 			</view>
 		</view>
 		<u-picker :itemHeight="88" :immediateChange="true" :show="showLaiyuan" :columns="laiyuan" title="来源选择"
@@ -157,6 +158,7 @@
 						backgroundColor: '#dd524d'
 					}
 				}],
+				orderStatus:'',
 				totalMOney: 0, //订单总金额
 				dataForm: {
 					arriveDate: "",
@@ -201,24 +203,60 @@
 					]
 				],
 				roomId: '',
-				laiyuan: [[]]
+				laiyuan: [
+					[]
+				],
+				currentDate: '',
+				today:''
 			}
 		},
 		onLoad(opt) {
 			this.getLaiyuan();
-			this.roomId = opt.roomId.split(',');
+			if (opt.roomId) {
+				this.roomId = opt.roomId.split(',');
+			}
 			if (opt.id) { //编辑
 				if (opt.orderStatus) {
 					this.orderStatus = opt.orderStatus;
 				}
+				console.log(this.orderStatus)
 				this.dataForm.id = opt.id;
 				this.getInfo2()
 			} else {
 				//新增获取简单信息
 				this.getInfo();
 			}
+			// 当前日期
+			this.getleftData();
+			let myDate = new Date();
+			let year = myDate.getFullYear();
+			let mon = myDate.getMonth() + 1;
+			let day = myDate.getDate();
+			mon = mon > 9 ? mon : '0' + mon;
+			day = day > 9 ? day : '0' + day;
+			this.currentDate = year + '-' + mon + '-' + day;
 		},
 		methods: {
+			compareDate(data) {
+				if (
+					new Date(data).getTime() < new Date(this.currentDate).getTime()
+				) {
+					this.today = -1;
+					//v.push("-1"); //有时间小于今天
+				}
+				if (
+					new Date(newval[i]).getTime() == new Date(this.currentDate).getTime()
+				) {
+					this.today = 1;
+					v.push("1"); //有时间等于今天
+				}
+				if (
+					new Date(newval[i]).getTime() > new Date(this.currentDate).getTime()
+				) {
+					this.today = 2;
+					//v.push("2"); //有时间大于今天
+				}
+			},
 			//添加早餐
 			addBreast() {
 				let list = JSON.stringify(this.dataForm.detailFormList[0].breakfastData);
@@ -234,13 +272,21 @@
 								item.num !=
 								0);
 							this.totalMOney = this.dataForm.detailFormList[0].roomAmount;
+							this.dataForm.detailFormList[0].breakfastAmount = 0;
+							this.dataForm.detailFormList[0].otherAmount = 0;
 							for (let i = 0; i < this.dataForm.detailFormList[0].breakfastData.length; i++) {
 								this.totalMOney += parseFloat(this.dataForm.detailFormList[0].breakfastData[i]
-									.price);
+									.price)*this.dataForm.detailFormList[0].breakfastData[i].num;
+								this.dataForm.detailFormList[0].breakfastAmount += parseFloat(this.dataForm
+									.detailFormList[0].breakfastData[i]
+									.price)*this.dataForm.detailFormList[0].breakfastData[i].num;
 							}
 							for (let i = 0; i < this.dataForm.detailFormList[0].otherData.length; i++) {
 								this.totalMOney += parseFloat(this.dataForm.detailFormList[0].otherData[i]
-									.defaultPrice);
+									.defaultPrice)*this.dataForm.detailFormList[0].otherData[i].num;
+								this.dataForm.detailFormList[0].otherAmount += parseFloat(this.dataForm
+									.detailFormList[0].otherData[i]
+									.defaultPrice)*this.dataForm.detailFormList[0].otherData[i].num;
 							}
 						}
 					}
@@ -254,6 +300,7 @@
 					events: {
 						addSuccess: data => {
 							if (data.data.amount != 0) {
+								this.dataForm.flowRecord = this.dataForm.flowRecord || [];
 								this.dataForm.flowRecord.push(data.data)
 								// if(data.data.flowType==1){ //收款
 								// 	this.totalMOney+=parseFloat(data.data.amount);
@@ -267,10 +314,21 @@
 			},
 			confirmOrder(orderStatus) {
 				//orderStatus//预约入住 1,直接入住2
-				this.dataForm.orderStatus = orderStatus
-				this.$api.post('/merchant/hotel/order/placeOrder', this.dataForm).then(res => {
+				if(orderStatus){
+					this.dataForm.orderStatus = orderStatus;
+				}
+				let url = '';
+				if (this.dataForm.id) {
+					url = '/merchant/hotel/order/updOrder'
+					if(this.orderStatus){
+						this.dataForm.orderStatus=this.orderStatus;
+					}
+				} else {
+					url = '/merchant/hotel/order/placeOrder'
+				}
+				this.$api.post(url, this.dataForm).then(res => {
 					if (res.data.code == 0) {
-						this.$showToast('下单成功');
+						this.$showToast('操作成功');
 						setTimeout(() => {
 							uni.reLaunch({
 								url: '/pagesMy/orderList/orderList'
@@ -280,10 +338,13 @@
 				})
 			},
 			click(index) {
-				console.log(index)
+				this.dataForm.detailFormList[0].breakfastAmount-=this.dataForm.detailFormList[0].breakfastData[index].price*this.dataForm.detailFormList[0].breakfastData[index].num;
+				this.totalMOney-=this.dataForm.detailFormList[0].breakfastData[index].price*this.dataForm.detailFormList[0].breakfastData[index].num;
 				this.dataForm.detailFormList[0].breakfastData.splice(index, 1);
 			},
 			click2(index) {
+				this.dataForm.detailFormList[0].otherAmount-=this.dataForm.detailFormList[0].otherData[index].defaultPrice*this.dataForm.detailFormList[0].otherData[index].num;
+				this.totalMOney-=this.dataForm.detailFormList[0].otherData[index].defaultPrice*this.dataForm.detailFormList[0].otherData[index].num;
 				this.dataForm.detailFormList[0].otherData.splice(index, 1);
 			},
 			click3(index) {
@@ -299,8 +360,18 @@
 						}
 					});
 			},
-			getInfo2(){//详情信息
-				
+			getInfo2() { //详情信息
+				this.$api.get('/merchant/hotel/order/getOrderDetail/' + this.dataForm.id).then(res => {
+					console.log(res)
+					if (res.data.code == 0) {
+						this.dataForm = {
+							...this.dataForm,
+							...res.data.data,
+						};
+						this.totalMOney = this.dataForm.orderAmount;
+						this.compareDate(this.dataForm.arriveDate)
+					}
+				})
 			},
 			// 房型列表
 			getInfo() {
@@ -356,7 +427,7 @@
 		width: 100%;
 		background-color: #fff;
 		left: 0;
-		z-index: 9;
+		z-index: 99;
 		padding: 30rpx;
 		box-sizing: border-box;
 
@@ -386,6 +457,7 @@
 				border-radius: 48rpx;
 				border: 1rpx solid #D1D1D1;
 				color: #999;
+				flex:1;
 
 				&:last-child {
 					background-color: #1372FF;

+ 38 - 11
pages/house/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
 		<c-nav-bar title="房态" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
-		<view class="content">
+		<view class="content" v-if="xdata.length!=0">
 			<view class="date">
 				<view class="item">
 					<u-icon name="calendar-fill" color="#B9C2D2" size="40" style="margin-bottom:10rpx;"></u-icon>
@@ -14,7 +14,7 @@
 				</view>
 			</view>
 			<view class="floorData" v-if="leftData.length!=0">
-				<view v-for="(item,key,i) in leftData" :key="i" style="margin-bottom: 16rpx;">
+				<view v-for="(item,key,i) in leftData" :key="i" style="margin-bottom: 16rpx;padding-top: 108rpx;position: relative;" :class="indexArr[i]==key.split('-')[0]?'big':opens[i]?'small':'pd0'">
 					<view class="head" v-if="indexArr[i]==key.split('-')[0]">
 						<text>{{key.split('-')[0]}}F</text>
 						<view class="rightIcon" @click="open(i,key.split('-')[0],false)" v-if="opens[i]">
@@ -133,7 +133,7 @@
 				for (let i = 0; i < roomId.length; i++) {
 					if (id == roomId[i].houseBaseId && roomNumber == roomId[i].roomNumber) {
 						if (name == "status") {
-							return that.statusTxt[roomId[i][name]]
+							return that.statusTxt[roomId[i][name]]+'-'+roomId[i][name]
 						} else {
 							return roomId[i][name] || ''
 						}
@@ -159,7 +159,7 @@
 						}
 					}
 					//已预订,已入住
-					if (obj.status == 1 || obj.status == 2) {
+					if (obj.status == 1 || obj.status == 2|| obj.status == -1) {
 						let orderId= obj.orderId;
 						uni.navigateTo({
 							url:"/pages/house/orderInfo?orderId="+orderId
@@ -191,6 +191,7 @@
 			},
 			//新增订单
 			createOrder() {
+				this.clearData()
 				uni.navigateTo({
 					url: '/pages/house/createOrder?roomId=' + this.checkDataRoomId
 				})
@@ -390,13 +391,17 @@
 		.roomType {
 			padding: 0 30rpx;
 			display: flex;
-			justify-content: space-between;
+			// justify-content: space-between;
 		}
 
 		.head {
+			position: absolute;
+			top:0;
+			left:0;
 			&>text {
 				&:first-child {
 					font-size: 32rpx;
+					margin-right: 30rpx;
 				}
 			}
 
@@ -405,13 +410,18 @@
 				align-items: center;
 				font-size: 24rpx;
 				color: #1F2425;
+				
 			}
 		}
 
 		.roomType {
+			position: absolute;
+			top:40rpx;
+			left:0;
+			
 			color: #333;
 			font-size: 24rpx;
-			position: relative;
+			// position: relative;
 			padding-left: 44rpx;
 			margin: 20rpx 0 16rpx;
 
@@ -437,12 +447,19 @@
 				display: flex;
 				align-items: center;
 				background-color: #fff;
-
+				position: relative;
+			
 				&:last-child {
 					border: 0;
 				}
 
 				.td {
+					&:first-child {
+						position: absolute;
+						left: 0;
+						top:0;
+						z-index: 1;
+					}
 					display: flex;
 					align-items: center;
 					justify-content: center;
@@ -458,6 +475,7 @@
 					.tdP,
 					.cellBox {
 						display: flex;
+						width:100%;
 						height: 100%;
 						flex-direction: column;
 						align-items: center;
@@ -503,25 +521,25 @@
 					}
 
 					//待确定
-					&.s5 {
+					&.s0 {
 						color: rgb(25, 185, 197);
 						background-color: rgba(25, 185, 197, 0.1);
 					}
 
 					//清洁中
-					&.s6 {
+					&.s5 {
 						color: rgb(237, 86, 86);
 						background-color: rgba(237, 86, 86, 0.1);
 					}
 
 					//暂停使用
-					&.s7 {
+					&.s6 {
 						color: rgb(41, 60, 115);
 						background-color: rgba(41, 60, 115, 0.1);
 					}
 
 					//保留房
-					&.s8 {
+					&.s7 {
 						color: rgb(132, 68, 244);
 						background-color: rgba(132, 68, 244, 0.1);
 					}
@@ -544,4 +562,13 @@
 			}
 		}
 	}
+	.small{
+		padding-top: 68rpx!important;
+		.roomType{
+			top:0!important;
+		}
+	}
+	.pd0{
+		padding: 0!important;
+	}
 </style>

+ 47 - 19
pages/house/orderInfo.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
-		<c-nav-bar title="订单详情" :showIcon="false" :titleStyle="titleStyle"></c-nav-bar>
+	<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="uname">
@@ -24,7 +24,7 @@
 				<view class="house-person">
 					<text style="font-size: 30rpx; color: #777;">入住人</text>
 					<view class="right">
-						<text style="font-size: 30rpx; color: #777; ">{{orderInfo.checkInNums}}人 </text>
+						<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" ></u-icon>  -->
 					</view>
@@ -72,36 +72,39 @@
 				<!-- 待确认 -->
 				<template v-if="orderInfo.orderStatus==-1">
 					<button class="edit" @click="cancle()">取消订单</button>
-					<button class="goRoom" @click="show2=true">确认订单</button>
+					<button class="goRoom" @click="show2=true" v-if="orderInfo.status==1">确认订单</button>
 				</template>
 				<!-- 已预订 -->
 				<template v-if="orderInfo.orderStatus==1">
 					<button class="edit" @click="edit()">编辑订单</button>
-					<button class="goRoom" @click="checkIn()">办理入住</button>
+					<button class="goRoom" @click="checkIn(2)">办理入住</button>
 				</template>
 				<!-- 已入住 -->
 				<template v-if="orderInfo.orderStatus==2">
 					<button class="edit" @click="edit()">编辑订单</button>
-					<button class="goRoom" @click="checkIn()">办理退房</button>
+					<button class="goRoom" @click="show3=true">办理退房</button>
 				</template>
 			</view>
 		</view>
 		<!-- 取消订单 -->
-		<u-modal v-model="show" @confirm="confirmCheck">
+		<u-modal :show="show" @confirm="confirmCheck" :show-cancel-button="true" @cancel="show=false">
 			<view class="slot-content">
-				<u-cell-group :border="false" customStyle="margin:0 -30rpx">
+				<input type="text" v-model="check.refundReason" placeholder="请输入原因" />
+				<!-- <u-cell-group :border="false" customStyle="margin:0 -30rpx">
 					<u-cell>
-						<text slot="icon" class="label">原因:</text>
 						<view slot="title" class="title">
 							<u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
 								placeholder="请输入原因" v-model="check.refundReason"></u--input>
 						</view>
 					</u-cell>
-				</u-cell-group>
+				</u-cell-group> -->
 			</view>
 		</u-modal>
 		<!-- 确认订单 -->
-		<u-modal v-model="show2" content="确定该操作?" @confirm="confirmOrder">
+		<u-modal :show="show2" content="确定该操作?" @confirm="confirmOrder" :show-cancel-button="true" @cancel="show2=false">
+		</u-modal>
+		<!-- 办理退房 -->
+		<u-modal :show="show3" content="确定该操作?" @confirm="checkoutRoom" :show-cancel-button="true" @cancel="show3=false">
 		</u-modal>
 	</view>
 </template>
@@ -112,6 +115,7 @@
 			return {
 				show: false,
 				show2: false,
+				show3: false,
 				check: {
 					initiator: 1,
 					refundReason: "",
@@ -131,9 +135,7 @@
 		methods: {
 			// 获取数据
 			getOrderInfo() {
-				this.$api.get(`/merchant/hotel/order/getMerchantOrderInfo/${this.orderId}`, {
-					orderId: this.orderId
-				}).then((res) => {
+				this.$api.get(`/merchant/hotel/order/getOrderDetail/${this.orderId}`).then((res) => {
 					if (res.data.code == 0) {
 						this.orderInfo = res.data.data
 					}
@@ -155,9 +157,17 @@
 					return '状态异常'
 				}
 			},
-			goStayCheck(id) {
+			//添加入住人
+			goStayCheck() {
+				let list = JSON.stringify(this.orderInfo);
 				uni.navigateTo({
-					url: `/pages/house/stayCheck?id=${this.orderId}`
+					url: '/pages/house/stayCheck?orderInfo=' + list,
+					events: {
+						addSuccess: data => {
+							this.orderInfo.detailFormList[0].checkInPersonList=data.data||[];
+							console.log(this.orderInfo.detailFormList[0].checkInPersonList)
+						}
+					},
 				})
 			},
 			// 确认订单
@@ -209,6 +219,22 @@
 				uni.redirectTo({
 					url: "/pages/house/createOrder?id=" + this.orderInfo.id
 				})
+			},
+			//办理退房
+			checkoutRoom() {
+				this.$api.get("/merchant/hotel/order/checkout/" + this.orderInfo.id)
+					.then((res) => {
+						if (res.data.code !== 0) {
+							return this.$showToast(res.data.msg);
+						}
+						this.show = false;
+						this.$showToast('操作成功');
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '/pagesMy/orderList/orderList'
+							})
+						}, 1500)
+					});
 			}
 		},
 		computed: {
@@ -235,24 +261,26 @@
 	}
 
 	.uname {
-		width: 665rpx;
+		width: 100%;
 		height: 100rpx;
 		line-height: 100rpx;
 		background-color: #fff;
 		padding-left: 30rpx;
 		font-size: 30rpx;
 		border-radius: 10rpx;
+		box-sizing: border-box;
 
 	}
 
 	.room {
 		margin-top: 20rpx;
-		width: 92%;
+		width: 100%;
 		height: 246rpx;
 		background-color: #fff;
 		margin-bottom: 20rpx;
 		border-radius: 10rpx;
 		padding: 30rpx;
+		box-sizing: border-box;
 	}
 
 	.orderTip {
@@ -267,7 +295,7 @@
 
 	.button {
 		position: fixed;
-		bottom: 120rpx;
+		bottom: 40rpx;
 		height: 96rpx;
 		width: 690rpx;
 		// background-color: teal;

+ 132 - 114
pages/house/stayCheck.vue

@@ -1,126 +1,139 @@
 <template>
-	<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
-		<c-nav-bar title="新增订单" :showIcon="true"></c-nav-bar>
-		<view class="box">
-		
-			 <u-form :model="form" ref="form">
-				 <u-form-item label="姓名" prop="guestName" label-width="172rpx" border-bottom>
-					 <u-input border="false" v-model="form.guestName" placeholder="请输入姓名"/>
-				 </u-form-item>
-				 <u-form-item label="手机号码" prop="guestPhone" label-width="172rpx" border-bottom>
-				 	<u-input border="false" v-model="form.guestPhone" placeholder="请输入手机号"/>
-				 </u-form-item>
-				 <u-form-item label="证件类型" label-width="172rpx" border-bottom>
-					    <view class="personInfo" @click.native="show=true">
-								<text style="font-size: 30rpx;">{{form.idName}}</text>
-								<!-- 证件下拉框 -->
-								<u-picker :itemHeight="88" :immediateChange="true" :show="show" :columns="list" keyName="label"
-									:defaultIndex="passengerDefault" @cancel="show=false;"
-									@confirm="passengerConfirm"></u-picker>
-								<!-- <u-select v-model="show"  mode="single-column" :list="list" @confirm="confirm"></u-select> -->
-								<u-icon name="arrow-right" ></u-icon>
-							</view>
-				 </u-form-item> 
-				 <u-form-item label="证件号" prop="idCard" label-width="172rpx" border-bottom>
-				 	<u-input border="false" v-model="form.idCard" placeholder="请输入证件号"/>
-				 </u-form-item>
-				 <u-form-item class="delete" >
-						<view class="delete" @click="del">
-							<u-icon name="trash"></u-icon>
-							<text style="font-size: 30rpx;">删除</text>
+	<view class="page" :style="{'height':(h)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="添加入住人" :showIcon="true"></c-nav-bar>
+		<u-form :model="form" ref="form">
+			<view class="box" v-for="(item,index) in checkInPersonList">
+				<u-form-item label="姓名" prop="checkInName" label-width="172rpx" border-bottom>
+					<u-input border="false" v-model="item.checkInName" placeholder="请输入姓名" />
+				</u-form-item>
+				<!-- <u-form-item label="手机号码" prop="guestPhone" label-width="172rpx" border-bottom>
+						<u-input border="false" v-model="item.guestPhone" placeholder="请输入手机号" />
+					</u-form-item> -->
+				<!-- <u-form-item label="证件类型" label-width="172rpx" border-bottom @click.native="show=true">
+						<view class="personInfo">
+							<text style="font-size: 30rpx;">{{item.idName}}</text>
+							<u-picker :itemHeight="88" :immediateChange="true" :show="show" :columns="list"
+								keyName="label" :defaultIndex="passengerDefault" @cancel="show=false;"
+								@confirm="passengerConfirm"></u-picker>
+							<u-icon name="arrow-right"></u-icon>
 						</view>
-				 </u-form-item>
-			 </u-form>
-		</view>
+					</u-form-item> -->
+				<u-form-item label="证件号" prop="idCard" label-width="172rpx" border-bottom>
+					<u-input border="false" v-model="item.idCard" placeholder="请输入证件号" />
+				</u-form-item>
+				<u-form-item label="民族" prop="nation" label-width="172rpx" border-bottom>
+					<u-input border="false" v-model="item.nation" placeholder="请输入民族" />
+				</u-form-item>
+				<u-form-item label="地址" prop="address" label-width="172rpx" border-bottom>
+					<u-input border="false" v-model="item.address" placeholder="请输入地址" />
+				</u-form-item>
+
+				<u-form-item class="delete" v-if="checkInPersonList.length>1">
+					<view class="delete" @click="del(index)">
+						<u-icon name="trash"></u-icon>
+						<text style="font-size: 30rpx;">删除</text>
+					</view>
+				</u-form-item>
+			</view>
+		</u-form>
+
 		<!-- 添加入住人 -->
-		<view class="addPerson">
-			 <u-icon name="plus" color="#2979ff"></u-icon>添加入住人
+		<view class="addPerson" @click="addPerson()">
+			<u-icon name="plus" color="#2979ff"></u-icon>添加入住人
 		</view>
 		<!-- 按钮 -->
 		<!-- 按钮 -->
-		
-			<view class="yes" @click.native="submit">
-				确定
-			</view>
-			
+
+		<view class="yes" @click.native="conform">
+			确定
+
+		</view>
+
 	</view>
 </template>
 
 <script>
-	export default{
-		data(){
+	export default {
+		data() {
 			return {
-				passengerDefault:[0],
-				form:{
-					guestPhone:'',
-					idCard:'',
-					idName:'',
-					guestName:'',					
+				dataForm:{},
+				checkInPersonList: [],
+				passengerDefault: [0],
+				form: {
+					nation: '',
+					idCard: '',
+					address: '',
+					checkInName: '',
 				},
-				orderInfo:[],
-				orderId:null,
+				orderInfo: [],
+				orderId: null,
 				show: false,
-								list: [[
-									{
-										value: '1',
-										label: '身份证'
-									},
-									{
-										value: '2',
-										label: '居住证'
-									}]
-								],
+				list: [
+					[{
+							value: '1',
+							label: '身份证'
+						},
+						{
+							value: '2',
+							label: '居住证'
+						}
+					]
+				],
 			}
-			
+
 		},
-		onLoad({id}){
-			console.log(id)
-			this.orderId=id
-			console.log(this.orderId)	
-			this.getOrderInfo()
+		onLoad(opt) {
+			this.orderInfo=JSON.parse(opt.orderInfo);
+			this.checkInPersonList =this.orderInfo.detailFormList[0].checkInPersonList;
+			if (this.checkInPersonList.length == 0) {
+				this.checkInPersonList.push({
+					nation: '',
+					idCard: '',
+					address: '',
+					checkInName: '',
+				})
+			}
 		},
-		methods:{
-			passengerConfirm(e){
-				this.form.idName=e.value[0].label
-			},
+		methods: {
+			// passengerConfirm(e) {
+			// 	this.form.idName = e.value[0].label
+			// },
 			// 证件下拉菜单
-			showCardChoose(){
-				console.log(11)
-				this.show=true
+			// showCardChoose() {
+			// 	this.show = true
+			// },
+			del(index) {
+				if (this.checkInPersonList.length > 1) {
+					this.checkInPersonList.splice(index, 1);
+				}
 			},
-					
-			// 订单数据回显
-			getOrderInfo(){
-				this.$api.get(`/merchant/hotel/order/getMerchantOrderInfo/${this.orderId}`,{
-					orderId:this.orderId
-				}).then((res)=>{
-					console.log(res)
-					if(res.data.code==0){
-						this.orderInfo = res.data.data
-						// console.log(this.orderInfo)
-						this.form.guestName=res.data.data.guestName
-						this.form.guestPhone=res.data.data.guestPhone
-					}
+			addPerson() {
+				this.checkInPersonList.push({
+					nation: '',
+					idCard: '',
+					address: '',
+					checkInName: '',
 				})
 			},
-			
-			
-			del(){
-				this.form.guestName=''
-				this.form.idCard=''
-				this.form.guestPhone=''
-			},			
-			submit(){
-				uni.navigateTo({
-					url:'/pages/house/orderInfo'
+			conform() {
+				let list = this.checkInPersonList.filter((item) => item.idCard && item.checkInName);
+				this.$api.post('/merchant/hotel/order/updOrder', this.orderInfo).then(res => {
+					if (res.data.code == 0) {
+						this.$showToast('操作成功');
+						setTimeout(() => {
+							this.getOpenerEventChannel().emit('addSuccess', {
+								'data': list
+							});
+							uni.navigateBack();
+						}, 1500)
+					}
 				})
-			},			
-			
+			},
 		}
 		// onReady(){
 		// 	this.$refs.form.setRules(this.rules)
 		// }
-		
+
 	}
 </script>
 
@@ -131,9 +144,10 @@
 		box-sizing: border-box;
 		overflow-y: auto;
 		overflow-x: auto;
-		
+
 	}
-	.box{
+
+	.box {
 		background-color: #fff;
 		margin: 0 auto 20rpx;
 		border-radius: 10rpx;
@@ -141,12 +155,14 @@
 		padding: 0 30rpx;
 		margin-top: 20rpx;
 	}
+
 	.tit {
 		font-size: 32rpx;
 		font-weight: bold;
 		color: #333;
 	}
-	.del{
+
+	.del {
 		display: flex;
 		justify-content: center;
 		align-items: center;
@@ -155,43 +171,45 @@
 		background-color: #fff;
 		font-size: 30rpx
 	}
-	.addPerson{
+
+	.addPerson {
 		// margin: 0 auto ;
 		width: 92%;
 		height: 100rpx;
 		margin-left: 30rpx;
-		// margin-top: 20rpx; 
 		background-color: #fff;
-		border-radius: 10rpx; 
+		border-radius: 10rpx;
 		display: flex;
 		justify-content: center;
 		align-items: center;
 		font-size: 30rpx;
 		color: #1372FF;
-		
+
 	}
-	.yes{
-		display: flex;
-		justify-content: center;
-		align-items: center;
+
+	.yes {
 		width: 690rpx;
 		height: 96rpx;
+		line-height: 96rpx;
 		background-color: #1372FF;
 		border-radius: 48rpx;
 		position: fixed;
-		bottom: 10%;
+		bottom: 40rpx;
 		margin-left: 30rpx;
 		color: #fff;
 		font-size: 34rpx;
+		text-align: center;
 		// line-height: 96rpx;
 		// margin-top: 200rpx;
 	}
-	.delete{
+
+	.delete {
 		display: flex;
-		 justify-content: center; 
-		 align-items: center;
+		justify-content: center;
+		align-items: center;
 	}
-	.personInfo{
+
+	.personInfo {
 		padding-left: 15rpx;
 		display: flex;
 		align-items: center;

+ 8 - 11
pagesMy/orderList/orderList.vue

@@ -33,7 +33,7 @@
 						¥{{item.orderAmount}}
 					</view>
 				</view>
-				<view class="bottom"  v-if="item.orderStatus==-1">
+				<!-- <view class="bottom"  v-if="item.orderStatus==-1">
 					<view class="refuse">
 						拒绝
 					</view>
@@ -50,17 +50,17 @@
 					<view class="btn">
 						办理退房
 					</view>
-				</view>
-				<view class="bottom" @click="handleDetail(item)" v-else-if="item.orderStatus==3">
+				</view> -->
+				<view class="bottom" @click="handleDetail(item)">
 					<view class="detail">
 						详情
 					</view>
 				</view>
-				<view class="bottom" @click="handleDetail(item)" v-else-if="item.orderStatus==4">
+				<!-- <view class="bottom" @click="handleDetail(item)" v-else-if="item.orderStatus==4">
 					<view class="detail">
 						详情
 					</view>
-				</view>
+				</view> -->
 			</view>
 		</view>
 	</view>
@@ -80,6 +80,7 @@
 				dataList: [],
 				limit: 10,
 				page: 1,
+				homestayId: this.$store.state.moduleHouse.homestayId,
 				statusClass: [
 					'',
 					'green',
@@ -116,8 +117,6 @@
 		onLoad(option) {
 			if (option.Type) {
 				const type = parseInt(option.Type) + 1
-				console.log(type, 'option');
-				console.log(option.Type, 'option11111');
 				this.changeTab1(type)
 			} else {
 				this.getOrderList()
@@ -141,7 +140,6 @@
 							this.dataList[index].arriveDate = i.arriveDate.slice(0, 10)
 							this.dataList[index].leaveDate = i.leaveDate.slice(0, 10)
 						})
-						console.log(this.dataList, 'this.dataList');
 					} else {
 						uni.showToast({
 							title: res.data.msg,
@@ -154,7 +152,7 @@
 			},
 			getOrderByStatusList() {
 				this.$api.get('/merchant/hotel/order/getMerchantOrderPageList', {
-					homestayId: '1711268640588517378',
+					homestayId: this.homestayId,
 					limit: this.limit,
 					page: this.page,
 					status: 0
@@ -165,7 +163,6 @@
 							this.dataList[index].arriveDate = i.arriveDate.slice(0, 10)
 							this.dataList[index].leaveDate = i.leaveDate.slice(0, 10)
 						})
-						console.log(this.dataList, 'this.dataList');
 					} else {
 						uni.showToast({
 							title: res.data.msg,
@@ -178,7 +175,7 @@
 			},
 			handleDetail(item) {
 				uni.navigateTo({
-					url: '/pages/house/orderInfo?orderId='+item.orderCode
+					url: '/pages/house/orderInfo?orderId='+item.id
 				})
 			},
 			changeTab(index) {