Ver Fonte

feat: 统计

2912631854@qq.com há 10 meses atrás
pai
commit
9c398f709a

+ 2 - 2
App.vue

@@ -4,8 +4,8 @@
 			console.log('App Launch')
 		},
 		onShow: function() {
-			// console.log('App Show')
-			// this.autoUpdate();
+			console.log('App Show')
+			this.autoUpdate();
 			// if(uni.getStorageSync('userInfo')) uni.reLaunch({ url:'/pages/home/index' })
 			// else uni.reLaunch({ url:'/pages/login/index' })
 		},

+ 45 - 14
pages.json

@@ -1,18 +1,19 @@
 {
-	"pages": [{
-			"path": "pages/login/index",
-			"style": {
-				"navigationBarTitleText": "登录",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path": "pages/login/forgot",
-			"style": {
-				"navigationBarTitleText": "忘记密码",
-				"navigationStyle": "custom"
-			}
-		},
+	"pages": [
+		// {
+		// 	"path": "pages/login/index",
+		// 	"style": {
+		// 		"navigationBarTitleText": "登录",
+		// 		"navigationStyle": "custom"
+		// 	}
+		// },
+		// {
+		// 	"path": "pages/login/forgot",
+		// 	"style": {
+		// 		"navigationBarTitleText": "忘记密码",
+		// 		"navigationStyle": "custom"
+		// 	}
+		// },
 		{
 			"path": "pages/home/index",
 			"style": {
@@ -42,6 +43,7 @@
 				"navigationStyle": "custom"
 			}
 		},
+		//房态
 		{
 			"path": "pages/house/index",
 			"style": {
@@ -56,6 +58,35 @@
 				"navigationStyle": "custom"
 			}
 		},
+		{
+			"path": "pages/house/breast",
+			"style": {
+				"navigationBarTitleText": "添加早餐",
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/house/payAdd",
+			"style": {
+				"navigationBarTitleText": "添加收款",
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/house/orderInfo",
+			"style": {
+				"navigationBarTitleText": "订单详情",
+				"navigationStyle": "custom"
+			}
+		},
+		
+		{
+			"path": "pages/house/stayCheck",
+			"style": {
+				"navigationBarTitleText": "入住登记",
+				"navigationStyle": "custom"
+			}
+		},
 		{
 			"path": "pages/statistics/index",
 			"style": {

+ 186 - 0
pages/house/breast.vue

@@ -0,0 +1,186 @@
+<template>
+	<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="添加商品" :showIcon="true"></c-nav-bar>
+		<view class="content">
+			<view class="item" v-for="(item,index) in list" :key="index">
+				<text>{{item.breakfastName}}</text>
+				<text>{{item.price}}</text>
+				<u-number-box v-model="item.num" min="0">
+					<view slot="minus" class="minus">
+						<u-icon name="minus" size="22"></u-icon>
+					</view>
+					<text slot="input" class="input">{{item.num||0}}</text>
+					<view slot="plus" class="plus">
+						<u-icon name="plus" size="22"></u-icon>
+					</view>
+				</u-number-box>
+			</view>
+			<view class="item" v-for="(item,index) in list2" :key="index">
+				<text>{{item.projectName}}</text>
+				<text>{{item.defaultPrice}}</text>
+				<u-number-box v-model="item.num" min="0">
+					<view slot="minus" class="minus">
+						<u-icon name="minus" size="22"></u-icon>
+					</view>
+					<text slot="input" class="input">{{item.num||0}}</text>
+					<view slot="plus" class="plus">
+						<u-icon name="plus" size="22"></u-icon>
+					</view>
+				</u-number-box>
+			</view>
+		</view>
+		<view class="btn">
+			<text @click="conform()">确定</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	import listItem from '../../uni_modules/uview-ui/libs/config/props/listItem';
+	export default {
+		data() {
+			return {
+				list: [],
+				list2: []
+			}
+		},
+		onLoad(opt) {
+			console.log(opt)
+			let list = JSON.parse(opt.list1);
+			let list2 =JSON.parse(opt.list2);
+			this.getBreastData(list);
+			this.getOtherData(list2);
+		},
+		methods: {
+			conform() {
+				this.getOpenerEventChannel().emit('addSuccess', {
+					'data1': this.list,
+					'data2': this.list2
+				});
+				uni.navigateBack();
+			},
+			getBreastData(list) {
+				this.$api.get('/merchant/hotel/order/getBreakfastList', {
+					homestayId: '1711268640588517378'
+				}).then(res => {
+					console.log(res)
+					if (res.data.code == 0) {
+						if (list && list.length != 0) {
+							for (let i = 0; i < res.data.data.length; i++) {
+								let item = list.filter(
+									(item) =>
+									item.breakfastName == res.data.data[i].breakfastName
+								);
+								if (item) {
+									res.data.data[i].num = item[0].num;
+								}
+							}
+						}
+						this.list = res.data.data
+					}
+					console.log(this.list)
+				})
+			},
+			getOtherData(list2) {
+				this.$api.get('/merchant/hotel/order/getOtherList', {
+					homestayId: '1711268640588517378'
+				}).then(res => {
+					if (res.data.code == 0) {
+						if (list2 && list2.length != 0) {
+							for (let i = 0; i < res.data.data.length; i++) {
+								let item = list2.filter(
+									(item) =>
+									item.projectName == res.data.data[i].projectName
+								);
+								if (item) {
+									res.data.data[i].num = item[0].num;
+								}
+							}
+						}
+						this.list2 = res.data.data
+					}
+				})
+			},
+
+		}
+	}
+</script>
+
+<style lang="scss">
+	.btn {
+		position: fixed;
+		background-color: #fff;
+		padding: 30rpx 0;
+		z-index: 9;
+		bottom: 0;
+		width: 100%;
+		left: 0;
+		text-align: center;
+
+		text {
+			display: inline-block;
+			width: 90%;
+			height: 96rpx;
+			line-height: 96rpx;
+			background-color: #1372FF;
+			color: #fff;
+			font-size: 34rpx;
+			border-radius: 48rpx;
+
+		}
+	}
+
+	.page {
+		background: #F3F4F4;
+		box-sizing: border-box;
+		overflow-y: auto;
+		overflow-x: auto;
+	}
+
+	.content {
+		padding: 0 30rpx 20rpx;
+		width: 96%;
+		margin: 20rpx auto 0;
+		box-sizing: border-box;
+		background-color: #fff;
+
+		.item {
+			padding: 36rpx 0;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			border-bottom: 1rpx solid #D1D1D1;
+
+			&:last-child {
+				border: 0;
+			}
+
+			text {
+				font-size: 30rpx;
+				color: #F14D4D;
+
+				&:nth-of-type(1) {
+					font-weight: bold;
+					color: #333;
+				}
+			}
+		}
+
+	}
+	.input {
+		margin: 0 20rpx;
+		font-size: 28rpx;
+	}
+	.minus,
+	.plus {
+		justify-content: center;
+		display: flex;
+		width: 34rpx;
+		height: 34rpx;
+		line-height: 34rpx;
+		padding: 8rpx 6rpx;
+		border: 1px solid #999;
+		border-radius: 6rpx;
+	}
+	
+</style>

+ 369 - 22
pages/house/createOrder.vue

@@ -1,36 +1,141 @@
 <template>
-	<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
-		<c-nav-bar title="新增订单" :showIcon="false"></c-nav-bar>
-		<view class="box">
+	<view class="page" :style="{'height':(h)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="新增订单" :showIcon="true"></c-nav-bar>
+		<view class="box box1">
 			<view class="tit">预订信息</view>
-
-			<u-cell-group :border="false"
-				customStyle="background-color: #fff;border-radius: 16rpx;width: 94%;margin:0 auto;">
+			<u-cell-group :border="false" customStyle="margin:0 -30rpx">
 				<u-cell>
-					<text slot="icon" style="font-size: 30rpx">姓名</text>
+					<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="dataForm.guestName"></u--input>
 					</view>
 				</u-cell>
 				<u-cell>
-					<text slot="icon" style="font-size: 30rpx">手机号码</text>
+					<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="dataForm.guestPhone"></u--input>
 					</view>
 				</u-cell>
-				<u-cell isLink="true" @click="showLaiyuan=true">
-					<text slot="icon" style="font-size: 30rpx">订单来源</text>
+				<u-cell :isLink="true" @click="showLaiyuan=true">
+					<text slot="icon" class="label">订单来源</text>
 					<view slot="title" class="title">
 						{{dataForm.guestSourceName}}
 					</view>
 				</u-cell>
 			</u-cell-group>
 		</view>
+		<view class="box box1">
+			<view class="tit">房间信息</view>
+			<u-cell-group :border="false" customStyle="margin:0 -30rpx">
+				<u-cell>
+					<text slot="icon" class="label">入住日期</text>
+					<view slot="title" class="title">
+						{{dataForm.arriveDate}}
+						<!-- <u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx" :disabled="true"
+							placeholder="" v-model="dataForm.arriveDate"></u--input> -->
+					</view>
+				</u-cell>
+				<u-cell>
+					<text slot="icon" class="label">离店日期</text>
+					<view slot="title" class="title">
+						{{dataForm.leaveDate}}
+						<!-- <u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx" :disabled="true"
+							placeholder="" v-model="dataForm.leaveDate"></u--input> -->
+					</view>
+				</u-cell>
+				<u-cell isLink="true">
+					<text slot="icon" class="label">共几晚</text>
+					<view slot="title" class="title">
+						{{dataForm.num}}
+					</view>
+				</u-cell>
+				<u-cell isLink="true" @click="checkInTypeShow=true">
+					<text slot="icon" class="label">入住类型</text>
+					<view slot="title" class="title">
+						{{dataForm.detailFormList[0].checkInTypeName}}
+					</view>
+				</u-cell>
+				<u-cell isLink="true">
+					<text slot="icon" class="label">房间类型</text>
+					<view slot="title" class="title">
+						{{dataForm.houseBaseId}}
+					</view>
+				</u-cell>
+				<u-cell>
+					<text slot="icon" class="label">房间号</text>
+					<view slot="title" class="title">
+						{{dataForm.detailFormList[0].roomNumber}}
+					</view>
+				</u-cell>
+				<u-cell>
+					<text slot="icon" class="label">房价</text>
+					<view slot="title" class="title">
+						{{dataForm.detailFormList[0].roomAmount}}
+					</view>
+				</u-cell>
+				<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"
+							type="textarea" placeholder="请输入" v-model="dataForm.remarks" height="200"></u--input>
+					</view>
+				</u-cell>
+			</u-cell-group>
+		</view>
+		<view class="box">
+			<view class="tit tit2"><text>消费信息</text> <u-icon @click="addBreast()" 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=""
+					v-for="(item, index) in dataForm.detailFormList[0].breakfastData" :key="index" @click="click(index)"
+					:options="options">
+					<view class="goodsInfo item">
+						<view class="title-wrap">
+							<text class="title u-line-2">{{item.breakfastName}}/{{item.num}}/{{item.price}}</text>
+						</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)"
+					:options="options">
+					<view class="goodsInfo item">
+						<view class="title-wrap">
+							<text class="title u-line-2">{{item.projectName}}/{{item.num}}/{{item.defaultPrice}}</text>
+						</view>
+					</view>
+				</u-swipe-action-item>
+			</u-swipe-action>
+		</view>
+		<view class="box">
+			<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"
+					v-for="(item, index) in dataForm.flowRecord" :key="index" @click="click3(index)" :options="options">
+					<view class="item">
+						<view class="title-wrap">
+							<text
+								class="title u-line-2">{{item.flowTypeName}}/{{item.payTypeName}}/{{item.amount}}</text>
+						</view>
+					</view>
+				</u-swipe-action-item>
+			</u-swipe-action>
+		</view>
+		<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>
+			</view>
+		</view>
 		<u-picker :itemHeight="88" :immediateChange="true" :show="showLaiyuan" :columns="laiyuan" title="来源选择"
-			keyName="guestSource" :defaultIndex="passengerDefault" @cancel="areaShow=false;"
+			keyName="guestSource" :defaultIndex="passengerDefault" @cancel="showLaiyuan=false;"
 			@confirm="passengerConfirm"></u-picker>
+		<u-picker :itemHeight="88" :immediateChange="true" :show="checkInTypeShow" :columns="checkInType" title="入住类型选择"
+			keyName="label" :defaultIndex="passengerDefault2" @cancel="checkInTypeShow=false;"
+			@confirm="passengerConfirm2"></u-picker>
 	</view>
 </template>
 
@@ -38,44 +143,155 @@
 	export default {
 		data() {
 			return {
+				titleStyle: {
+					fontSize: '34rpx',
+					fontWeight: "bold",
+				},
 				showLaiyuan: false,
+				checkInTypeShow: false,
 				passengerDefault: [0],
+				passengerDefault2: [0],
+				options: [{
+					text: '删除',
+					style: {
+						backgroundColor: '#dd524d'
+					}
+				}],
+				totalMOney: 0, //订单总金额
 				dataForm: {
 					arriveDate: "",
 					detailFormList: [{
 						breakfastAmount: 0,
 						checkInPersonList: [],
 						checkInType: 0,
+						checkInTypeName: '',
 						id: 0,
 						otherAmount: 0,
 						roomAmount: 0,
 						roomIds: "",
+						breakfastData: [],
+						otherData: [],
 						roomNumber: "",
-					}, ],
+					}],
+					flowRecord: [],
 					guestName: "",
 					guestPhone: "",
 					guestSourceId: null,
 					guestSourceName: null,
-					homestayId: '1711268640588517378',
+					homestayId: this.$store.state.moduleHouse.homestayId,
 					houseBaseId: 0,
+					houseBaseName: '',
 					leaveDate: "",
 					num: 0,
 					orderStatus: null,
 					remarks: "",
 				},
+				checkInType: [
+					[{
+							label: '正常入住',
+							val: 1
+						}, {
+							label: '自用房',
+							val: 2
+						},
+						{
+							label: '免费入住',
+							val: 3
+						}
+					]
+				],
 				roomId: '',
-				laiyuan: []
+				laiyuan: [[]]
 			}
 		},
 		onLoad(opt) {
-			this.roomId = opt.roomId.split(',');
-			this.getInfo();
 			this.getLaiyuan();
+			this.roomId = opt.roomId.split(',');
+			if (opt.id) { //编辑
+				if (opt.orderStatus) {
+					this.orderStatus = opt.orderStatus;
+				}
+				this.dataForm.id = opt.id;
+				this.getInfo2()
+			} else {
+				//新增获取简单信息
+				this.getInfo();
+			}
 		},
 		methods: {
+			//添加早餐
+			addBreast() {
+				let list = JSON.stringify(this.dataForm.detailFormList[0].breakfastData);
+				let list2 = JSON.stringify(this.dataForm.detailFormList[0].otherData)
+				uni.navigateTo({
+					url: '/pages/house/breast?list1=' + list + '&list2=' + list2,
+					events: {
+						addSuccess: data => {
+							this.dataForm.detailFormList[0].breakfastData = data.data1.filter((item) => item
+								.num && item
+								.num != 0);
+							this.dataForm.detailFormList[0].otherData = data.data2.filter((item) => item.num &&
+								item.num !=
+								0);
+							this.totalMOney = this.dataForm.detailFormList[0].roomAmount;
+							for (let i = 0; i < this.dataForm.detailFormList[0].breakfastData.length; i++) {
+								this.totalMOney += parseFloat(this.dataForm.detailFormList[0].breakfastData[i]
+									.price);
+							}
+							for (let i = 0; i < this.dataForm.detailFormList[0].otherData.length; i++) {
+								this.totalMOney += parseFloat(this.dataForm.detailFormList[0].otherData[i]
+									.defaultPrice);
+							}
+						}
+					}
+				})
+			},
+			//添加收款
+			addpay() {
+				uni.navigateTo({
+					url: '/pages/house/payAdd?money=' + this.dataForm.detailFormList[0].roomAmount + '&list=' +
+						JSON.stringify(this.dataForm.flowRecord),
+					events: {
+						addSuccess: data => {
+							if (data.data.amount != 0) {
+								this.dataForm.flowRecord.push(data.data)
+								// if(data.data.flowType==1){ //收款
+								// 	this.totalMOney+=parseFloat(data.data.amount);
+								// }else{
+								// 	this.totalMOney=parseFloat(data.data.amount);
+								// }
+							}
+						}
+					}
+				})
+			},
+			confirmOrder(orderStatus) {
+				//orderStatus//预约入住 1,直接入住2
+				this.dataForm.orderStatus = orderStatus
+				this.$api.post('/merchant/hotel/order/placeOrder', this.dataForm).then(res => {
+					if (res.data.code == 0) {
+						this.$showToast('下单成功');
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '/pagesMy/orderList/orderList'
+							})
+						}, 1500)
+					}
+				})
+			},
+			click(index) {
+				console.log(index)
+				this.dataForm.detailFormList[0].breakfastData.splice(index, 1);
+			},
+			click2(index) {
+				this.dataForm.detailFormList[0].otherData.splice(index, 1);
+			},
+			click3(index) {
+				this.dataForm.flowRecord.splice(index, 1);
+			},
 			getLaiyuan() {
 				this.$api.get("/merchant/hotel/room/state/getSourceDownBox", {
-						homestayId: '1711268640588517378',
+						homestayId: this.dataForm.homestayId,
 					})
 					.then((res) => {
 						if (res.data.code == 0) {
@@ -83,16 +299,107 @@
 						}
 					});
 			},
+			getInfo2(){//详情信息
+				
+			},
+			// 房型列表
 			getInfo() {
 				this.$api.post('/merchant/hotel/order/getRoomInfoList', this.roomId).then(res => {
 					console.log(res)
+					if (res.data.code == 0) {
+						this.dataForm.detailFormList[0].roomIds = res.data.data.roomIds;
+						this.dataForm.detailFormList[0].roomNumber = res.data.data.roomNumber;
+						this.dataForm.detailFormList[0].checkInType = res.data.data.checkInType;
+						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;
+						this.dataForm.leaveDate = res.data.data.leaveDate;
+						this.dataForm.houseBaseId = res.data.data.houseBaseId;
+						this.dataForm.num = res.data.data.num;
+						this.totalMOney = res.data.data.roomAmount;
+					}
 				})
+			},
+			//  来源
+			passengerConfirm(e) {
+				this.dataForm.guestSourceId = e.value[0].id;
+				this.dataForm.guestSourceName = e.value[0].guestSource;
+				this.showLaiyuan = false;
+			},
+			//入住类型
+			passengerConfirm2() {
+				this.dataForm.detailFormList[0].checkInType = e.value[0].val;
+				this.dataForm.detailFormList[0].checkInTypeName = e.value[0].guestSource;
+				this.checkInTypeShow = false;
 			}
 		}
 	}
 </script>
+<style>
+	.u-swipe-action-item__right__button__wrapper__text {
+		font-size: 28rpx !important;
+	}
+</style>
+<style lang="scss" scoped>
+	.u-swipe-action-item__right__button__wrapper {
+		height: 36px
+	}
+
+	.u-swipe-action-item__right__button__wrapper__text {
+		font-size: 28rpx;
+	}
+
+	.footer {
+		position: fixed;
+		bottom: 0;
+		width: 100%;
+		background-color: #fff;
+		left: 0;
+		z-index: 9;
+		padding: 30rpx;
+		box-sizing: border-box;
+
+		.total {
+			text {
+				color: #1372FF;
+				font-size: 32rpx;
+
+				&:first-child {
+					color: #333;
+				}
+			}
+		}
+
+		.btns {
+			display: flex;
+			justify-content: space-between;
+			margin-top: 30rpx;
+
+			text {
+				display: inline-block;
+				width: 48%;
+				height: 96rpx;
+				line-height: 96rpx;
+				text-align: center;
+				font-size: 34rpx;
+				border-radius: 48rpx;
+				border: 1rpx solid #D1D1D1;
+				color: #999;
+
+				&:last-child {
+					background-color: #1372FF;
+					color: #fff;
+				}
+			}
+		}
+
+	}
+
+	.u-cell__body {
+		padding: 0 !important;
+	}
 
-<style lang="scss">
 	.page {
 		background: #F3F4F4;
 		padding-bottom: 260rpx;
@@ -100,16 +407,56 @@
 		overflow-y: auto;
 		overflow-x: auto;
 	}
-	.box{
+
+
+
+	.box {
 		background-color: #fff;
-		margin: 0 auto 20rpx;
+		margin: 20rpx auto 0;
 		border-radius: 10rpx;
 		width: 96%;
-		padding: 0 30rpx;
+		padding: 0 30rpx 30rpx;
+		box-sizing: border-box;
+
+		.label {
+			color: #333;
+			font-size: 30rpx;
+		}
+
+		&.box1 {
+			padding: 0 30rpx;
+
+			.title {
+				text-align: right;
+			}
+		}
+
+		.title {
+			color: #999;
+		}
 	}
-	.tit {
+
+	.tit,
+	.tit2 {
 		font-size: 32rpx;
 		font-weight: bold;
+		padding-top: 30rpx;
 		color: #333;
+		margin-bottom: 10rpx;
+	}
+
+	.tit2 {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+	}
+
+	.goodsInfo.item {
+		padding: 20rpx 0;
+
+		text {
+			font-size: 30rpx;
+		}
+
 	}
 </style>

+ 21 - 10
pages/house/index.vue

@@ -68,7 +68,8 @@
 		<Tabbar :tabbarIndex="1"></Tabbar>
 		<!-- 关房 -->
 		<u-picker :itemHeight="88" :immediateChange="true" :show="areaShow" :columns="areaTxt" title="房态选择"
-			:defaultIndex="passengerDefault" @cancel="areaShow=false;clearData();" @confirm="passengerConfirm"></u-picker>
+			:defaultIndex="passengerDefault" @cancel="areaShow=false;clearData();"
+			@confirm="passengerConfirm"></u-picker>
 	</view>
 </template>
 
@@ -77,6 +78,7 @@
 	export default {
 		data() {
 			return {
+				homestayId:this.$store.state.moduleHouse.homestayId,
 				areaShow: false,
 				passengerDefault: [0],
 				areaTxt: [
@@ -118,7 +120,7 @@
 				checkDataDate: [],
 				checkPrice: [],
 				checkDataRoomId: [],
-				checkStatus:''
+				checkStatus: ''
 			}
 		},
 		onLoad() {
@@ -156,9 +158,14 @@
 							obj = roomId[i];
 						}
 					}
-					if(obj.status==2||obj.status==3){
+					//已预订,已入住
+					if (obj.status == 1 || obj.status == 2) {
+						let orderId= obj.orderId;
+						uni.navigateTo({
+							url:"/pages/house/orderInfo?orderId="+orderId
+						})
 						//到详情
-					}else{
+					} else {
 						//更改状态
 						this.areaShow = true;
 						this.checkDataRoomId = [obj.id];
@@ -183,9 +190,9 @@
 				})
 			},
 			//新增订单
-			createOrder(){
+			createOrder() {
 				uni.navigateTo({
-					url:'/pages/house/createOrder?roomId='+this.checkDataRoomId
+					url: '/pages/house/createOrder?roomId=' + this.checkDataRoomId
 				})
 			},
 			//展开收起
@@ -268,7 +275,7 @@
 				}
 			},
 			getLeftData() {
-				this.$api.get('/merchant/hotel/room/state/getHouseCategoryData/1711268640588517378').then(res => {
+				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++) {
@@ -292,14 +299,13 @@
 			},
 			getData() {
 				this.$api.get('/merchant/hotel/room/state/getDateRoomList', {
-					homestayId: '1711268640588517378',
+					homestayId: this.homestayId,
 					nowDate: '',
 					status: ''
 				}).then(res => {
 					if (res.data.code == 0) {
 						this.xdata = res.data.data;
 					}
-					console.log(res)
 				})
 			}
 		}
@@ -319,6 +325,7 @@
 		display: flex;
 		align-items: center;
 		justify-content: space-between;
+		box-sizing: border-box;
 
 		text {
 			display: inline-block;
@@ -436,6 +443,9 @@
 				}
 
 				.td {
+					display: flex;
+					align-items: center;
+					justify-content: center;
 					position: relative;
 					width: 130rpx;
 					min-width: 130rpx;
@@ -445,7 +455,8 @@
 					color: #1F2425;
 					font-size: 20rpx;
 
-					.tdP,.cellBox {
+					.tdP,
+					.cellBox {
 						display: flex;
 						height: 100%;
 						flex-direction: column;

+ 320 - 0
pages/house/orderInfo.vue

@@ -0,0 +1,320 @@
+<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="body">
+			<!-- 个人信息 -->
+			<view class="uname">
+				<text style="margin-right: 20rpx;">{{orderInfo.guestName}}</text>
+				<text>{{orderInfo.guestPhone}}</text>
+			</view>
+			<!-- 房间信息  -->
+			<view class="room">
+				<!-- 房间/预定信息 -->
+				<view class="reservations">
+					<text
+						style="font-size: 30rpx; color: #333333; font-weight: 700;">{{orderInfo.houseBaseName}}-{{orderInfo.roomNumber}}</text>
+					<text style="font-size: 24rpx; color: #39CE77;" v-if="isOrderPanding">{{getStatusText()}}</text>
+				</view>
+				<!-- 时间/价格 -->
+				<view class="time-price">
+					<text style="font-size: 30rpx; color: #777;">{{orderInfo.arriveDate}}入住 {{orderInfo.num}}晚</text>
+					<text style="font-size: 30rpx; color: #245BED;">¥{{orderInfo.orderAmount}}</text>
+				</view>
+				<!-- 入住人数 -->
+				<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>
+						<u-icon name="arrow-right" @click.native="goStayCheck"></u-icon>
+						<!-- <u-icon name="arrow-right" ></u-icon>  -->
+					</view>
+				</view>
+			</view>
+			<!-- 订单信息 -->
+
+			<u-cell-group :border="false"
+				customStyle="background-color: #fff;border-radius: 16rpx;width: 690rpx;margin:0 auto;">
+				<u-cell>
+					<text slot="icon" style="font-size: 30rpx; margin-right: 50rpx;">订单号</text>
+					<view slot="title" class="title">
+						<text>{{orderInfo.orderCode}}</text>
+					</view>
+				</u-cell>
+				<u-cell>
+					<text slot="icon" style="font-size: 30rpx; margin-right: 20rpx;">创建时间</text>
+					<view slot="title" class="title">
+						<text>{{orderInfo.orderTime}}</text>
+					</view>
+				</u-cell>
+				<u-cell>
+					<text slot="icon" style="font-size: 30rpx; margin-right: 20rpx;">办理员工</text>
+					<view slot="title" class="title">
+						<text>何伟婷</text>
+					</view>
+				</u-cell>
+				<u-cell>
+					<text slot="icon" style="font-size: 30rpx; margin-right: 20rpx;">取消原因</text>
+					<view slot="title" class="title">
+						<text>-</text>
+					</view>
+				</u-cell>
+				<u-cell>
+					<text slot="icon" style="font-size: 30rpx; margin-right: 80rpx;">备注</text>
+					<view slot="title" class="title">
+						<text>-</text>
+					</view>
+				</u-cell>
+
+
+			</u-cell-group>
+			<!-- 按钮 -->
+			<view class="button">
+				<!-- 待确认 -->
+				<template v-if="orderInfo.orderStatus==-1">
+					<button class="edit" @click="cancle()">取消订单</button>
+					<button class="goRoom" @click="show2=true">确认订单</button>
+				</template>
+				<!-- 已预订 -->
+				<template v-if="orderInfo.orderStatus==1">
+					<button class="edit" @click="edit()">编辑订单</button>
+					<button class="goRoom" @click="checkIn()">办理入住</button>
+				</template>
+				<!-- 已入住 -->
+				<template v-if="orderInfo.orderStatus==2">
+					<button class="edit" @click="edit()">编辑订单</button>
+					<button class="goRoom" @click="checkIn()">办理退房</button>
+				</template>
+			</view>
+		</view>
+		<!-- 取消订单 -->
+		<u-modal v-model="show" @confirm="confirmCheck">
+			<view class="slot-content">
+				<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>
+			</view>
+		</u-modal>
+		<!-- 确认订单 -->
+		<u-modal v-model="show2" content="确定该操作?" @confirm="confirmOrder">
+		</u-modal>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				show: false,
+				show2: false,
+				check: {
+					initiator: 1,
+					refundReason: "",
+					status: -1,
+					orderCode: "",
+				},
+				orderId: '',
+				orderInfo: {}
+			}
+		},
+		onLoad(opt) {
+			if (opt.orderId) {
+				this.orderId = opt.orderId;
+				this.getOrderInfo()
+			}
+		},
+		methods: {
+			// 获取数据
+			getOrderInfo() {
+				this.$api.get(`/merchant/hotel/order/getMerchantOrderInfo/${this.orderId}`, {
+					orderId: this.orderId
+				}).then((res) => {
+					if (res.data.code == 0) {
+						this.orderInfo = res.data.data
+					}
+				})
+			},
+			// 客房状态
+			getStatusText() {
+				if (this.orderInfo.orderStatus === -1) {
+					return '待确定'
+				} else if (this.orderInfo.orderStatus === 1) {
+					return '已预订'
+				} else if (this.orderInfo.orderStatus === 2) {
+					return '已入住'
+				} else if (this.orderInfo.orderStatus === 3) {
+					return '已退房'
+				} else if (this.orderInfo.orderStatus === 4) {
+					return '已取消'
+				} else {
+					return '状态异常'
+				}
+			},
+			goStayCheck() {
+				uni.navigateTo({
+					url: '/pages/house/stayCheck'
+				})
+			},
+			// 确认订单
+			confirmOrder() {
+				this.$api
+					.get(`/merchant/hotel/order/confirm/${this.orderInfo.id}`)
+					.then((res) => {
+						if (res.data.code !== 0) {
+							return this.$showToast(res.data.msg);
+						}
+						this.show2 = false;
+						this.$showToast('操作成功');
+						setTimeout(() => {
+							uni.reLaunch({
+								url: '/pagesMy/orderList/orderList'
+							})
+						}, 1500)
+					});
+			},
+			//取消订单
+			cancle() {
+				this.show = true;
+				this.check.orderCode = this.orderInfo.orderCode;
+			},
+			//取消订单
+			confirmCheck() {
+				this.$api.post("/merchant/hotel/order/cancelOrder", this.check)
+					.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)
+					});
+			},
+			//办理入住
+			checkIn(orderStatus) {
+				uni.redirectTo({
+					url: "/pages/house/createOrder?id=" + this.orderInfo.id + '&orderStatus=' + orderStatus
+				})
+			},
+			// 编辑
+			edit() {
+				uni.redirectTo({
+					url: "/pages/house/createOrder?id=" + this.orderInfo.id
+				})
+			}
+		},
+		computed: {
+			isOrderPanding() {
+				return this.orderInfo.orderStatus === 1
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.page {
+		background: #F3F4F4;
+		padding-bottom: 260rpx;
+		box-sizing: border-box;
+		overflow-y: auto;
+		overflow-x: auto;
+	}
+
+	.body {
+		padding-top: 20rpx;
+		padding-left: 30rpx;
+		padding-right: 30rpx;
+	}
+
+	.uname {
+		width: 665rpx;
+		height: 100rpx;
+		line-height: 100rpx;
+		background-color: #fff;
+		padding-left: 30rpx;
+		font-size: 30rpx;
+		border-radius: 10rpx;
+
+	}
+
+	.room {
+		margin-top: 20rpx;
+		width: 92%;
+		height: 246rpx;
+		background-color: #fff;
+		margin-bottom: 20rpx;
+		border-radius: 10rpx;
+		padding: 30rpx;
+	}
+
+	.orderTip {
+		padding: 30rpx;
+		padding-top: 0;
+		width: 690rpx;
+		height: 514rpx;
+		background-color: #fff;
+		border-radius: 10rpx;
+
+	}
+
+	.button {
+		position: fixed;
+		bottom: 120rpx;
+		height: 96rpx;
+		width: 690rpx;
+		// background-color: teal;
+		margin-top: 20rpx;
+		display: flex;
+		justify-content: space-between;
+		border-radius: 10rpx;
+		z-index: 9;
+	}
+
+	.goRoom {
+		// border-radius: ;
+		width: 330rpx;
+		height: 96rpx;
+		border-radius: 48rpx;
+		font-size: 34rpx;
+		background-color: #1372FF;
+		color: #fff;
+	}
+
+	.edit {
+		width: 330rpx;
+		height: 96rpx;
+		border-radius: 48rpx;
+		font-size: 34rpx;
+		background-color: #E2EDFC;
+		color: #1372FF;
+	}
+
+	.reservations {
+		display: flex;
+		justify-content: space-between;
+	}
+
+	.time-price {
+		display: flex;
+		justify-content: space-between;
+		margin-top: 30rpx;
+	}
+
+	.house-person {
+		display: flex;
+		justify-content: space-between;
+		margin-top: 30rpx;
+	}
+
+	.right {
+		display: flex;
+	}
+</style>

+ 199 - 0
pages/house/payAdd.vue

@@ -0,0 +1,199 @@
+<template>
+	<view class="page" :style="{'height':(h-th)+'px','padding-top':mt+'px'}">
+		<c-nav-bar title="添加收款" :showIcon="true"></c-nav-bar>
+		<view class="content">
+			<view class="box">
+				<view class="item">
+					<text>订单金额</text>
+					<text style="color: #245BED;">{{money}}</text>
+				</view>
+				<view class="item">
+					<text>已付金额</text>
+					<text style="color: #FF9B17;">{{haspay}}</text>
+				</view>
+				<view class="item">
+					<text>还需付款</text>
+					<text style="color: #F14D4D;">{{money-haspay}}</text>
+				</view>
+			</view>
+			<view style="background-color:#fff;padding:0 30rpx 20rpx;">
+				<u-cell-group :border="false" customStyle="margin:0 -30rpx">
+					<u-cell class="pd15">
+						<text slot="icon" class="label">类型</text>
+						<view slot="title" class="title">
+							<u-radio-group v-model="dataForm.flowTypeName" iconPlacement="left" style="white">
+								<u-radio :customStyle="{padding: '8rpx 0',margin:'0 0 0 30px'}"
+									v-for="(item, index) in checkboxList" :key="index" :label="item.name" :name="item.name" shape="circle"
+									size="30" labelSize="30" icon-size="22">
+								</u-radio>
+							</u-radio-group>
+						</view>
+					</u-cell>
+					<u-cell class="pd15" :isLink="true" @click="showPay=true">
+						<text slot="icon" class="label">支付方式</text>
+						<view slot="title" class="title">
+							{{dataForm.payTypeName}}
+						</view>
+					</u-cell>
+					<u-cell class="pd15">
+						<text slot="icon" class="label">金额</text>
+						<view slot="title" class="title">
+							<u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
+								type="number" placeholder="请输入金额" v-model="dataForm.amount"></u--input>
+						</view>
+					</u-cell>
+					<u-cell class="pd15" :border="false">
+						<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="dataForm.remark"></u--input>
+						</view>
+					</u-cell>
+				</u-cell-group>
+			</view>
+		</view>
+		<view class="btn">
+			<text @click="conform()">确定</text>
+		</view>
+		<u-picker :itemHeight="88" :immediateChange="true" :show="showPay" :columns="payStyle" title="支付方式选择"
+			keyName="label" :defaultIndex="passengerDefault" @cancel="showPay=false;"
+			@confirm="passengerConfirm"></u-picker>
+	</view>
+</template>
+
+<script>
+import list from '../../uni_modules/uview-ui/libs/config/props/list';
+	export default {
+		data() {
+			return {
+				money: '',
+				showPay: false,
+				passengerDefault: [0],
+				checkboxList:[{
+					name:'收款'
+				},{
+					name:'退款'
+				}],
+				dataForm: {
+					flowType: '',
+					flowTypeName:'',
+					amount: '',
+					remark: '',
+					payType: '',
+					payTypeName: ''
+				},
+				haspay:0,
+				payStyle: [
+					[{
+							label: '微信',
+							val: 1
+						}, {
+							label: '支付宝',
+							val: 2
+						},
+						{
+							label: '云闪付',
+							val: 3
+						}
+					]
+				],
+			}
+		},
+		onLoad(opt) {
+			//this.haspay=0;
+			this.money = opt.money;
+			this.list = JSON.parse(opt.list);
+			for(let i=0;i<this.list.length;i++){
+				if(this.list[i].flowType==1){ //收款
+					this.haspay+=parseFloat(this.list[i].amount);
+				}else{
+					this.haspay-=parseFloat(this.list[i].amount);
+				}
+			}
+		},
+		methods: {
+			//  支付方式
+			passengerConfirm(e) {
+				this.dataForm.payType = e.value[0].val;
+				this.dataForm.payTypeName = e.value[0].label;
+				this.showPay = false;
+			},
+			conform() {
+				if(this.dataForm.flowTypeName=='收款'){
+					this.dataForm.flowType=1;
+				}else{
+					this.dataForm.flowType=2;
+				}
+				this.getOpenerEventChannel().emit('addSuccess', {
+					'data': this.dataForm,
+				});
+				uni.navigateBack();
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.pd15{padding: 10rpx 0!important;}
+	.btn {
+		position: fixed;
+		background-color: #fff;
+		padding: 30rpx 0;
+		z-index: 9;
+		bottom: 0;
+		width: 100%;
+		left: 0;
+		text-align: center;
+
+		text {
+			display: inline-block;
+			width: 90%;
+			height: 96rpx;
+			line-height: 96rpx;
+			background-color: #1372FF;
+			color: #fff;
+			font-size: 34rpx;
+			border-radius: 48rpx;
+
+		}
+	}
+
+	.page {
+		background: #F3F4F4;
+		box-sizing: border-box;
+		overflow-y: auto;
+		overflow-x: auto;
+	}
+
+	.content {
+		
+		width: 94%;
+		margin: 20rpx auto 0;
+		box-sizing: border-box;
+		
+		.title{
+			text-align: right;
+		}
+		.box {
+			padding: 28rpx 30rpx 0;
+			border-radius: 10rpx;
+			margin: 30rpx 0;
+			background-color: #fff;
+
+			.item {
+				padding-bottom: 32rpx;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+
+				&:last-child {
+					border: 0;
+				}
+
+				text {
+					font-size: 30rpx;
+				}
+			}
+		}
+	}
+</style>

+ 200 - 0
pages/house/stayCheck.vue

@@ -0,0 +1,200 @@
+<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>
+				 </u-form-item>
+			 </u-form>
+		</view>
+		<!-- 添加入住人 -->
+		<view class="addPerson">
+			 <u-icon name="plus" color="#2979ff"></u-icon>添加入住人
+		</view>
+		<!-- 按钮 -->
+		<!-- 按钮 -->
+		
+			<view class="yes" @click.native="submit">
+				确定
+			</view>
+			
+	</view>
+</template>
+
+<script>
+	export default{
+		data(){
+			return {
+				passengerDefault:[0],
+				form:{
+					guestPhone:'',
+					idCard:'',
+					idName:'',
+					guestName:'',					
+				},
+				orderInfo:[],
+				orderId:null,
+				show: false,
+								list: [[
+									{
+										value: '1',
+										label: '身份证'
+									},
+									{
+										value: '2',
+										label: '居住证'
+									}]
+								],
+			}
+			
+		},
+		onLoad({id}){
+			console.log(id)
+			this.orderId=id
+			console.log(this.orderId)	
+			this.getOrderInfo()
+		},
+		methods:{
+			passengerConfirm(e){
+				this.form.idName=e.value[0].label
+			},
+			// 证件下拉菜单
+			showCardChoose(){
+				console.log(11)
+				this.show=true
+			},
+					
+			// 订单数据回显
+			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
+					}
+				})
+			},
+			
+			
+			del(){
+				this.form.guestName=''
+				this.form.idCard=''
+				this.form.guestPhone=''
+			},			
+			submit(){
+				uni.navigateTo({
+					url:'/pages/house/orderInfo'
+				})
+			},			
+			
+		}
+		// onReady(){
+		// 	this.$refs.form.setRules(this.rules)
+		// }
+		
+	}
+</script>
+
+<style lang="scss">
+	.page {
+		background: #F3F4F4;
+		padding-bottom: 260rpx;
+		box-sizing: border-box;
+		overflow-y: auto;
+		overflow-x: auto;
+		
+	}
+	.box{
+		background-color: #fff;
+		margin: 0 auto 20rpx;
+		border-radius: 10rpx;
+		width: 92%;
+		padding: 0 30rpx;
+		margin-top: 20rpx;
+	}
+	.tit {
+		font-size: 32rpx;
+		font-weight: bold;
+		color: #333;
+	}
+	.del{
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		width: 100%;
+		height: 102rpx;
+		background-color: #fff;
+		font-size: 30rpx
+	}
+	.addPerson{
+		// margin: 0 auto ;
+		width: 92%;
+		height: 100rpx;
+		margin-left: 30rpx;
+		// margin-top: 20rpx; 
+		background-color: #fff;
+		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;
+		width: 690rpx;
+		height: 96rpx;
+		background-color: #1372FF;
+		border-radius: 48rpx;
+		position: fixed;
+		bottom: 10%;
+		margin-left: 30rpx;
+		color: #fff;
+		font-size: 34rpx;
+		// line-height: 96rpx;
+		// margin-top: 200rpx;
+	}
+	.delete{
+		display: flex;
+		 justify-content: center; 
+		 align-items: center;
+	}
+	.personInfo{
+		padding-left: 15rpx;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+	}
+</style>

+ 4 - 2
pages/login/select.vue

@@ -29,18 +29,20 @@
 			},
 			getList(){
 				this.list = [
-					{ name:'一家民宿', type:'酒店民宿' },
+					{ name:'一家民宿', type:'酒店民宿'},
 					{ name:'石柱村渔家乐', type:'渔家乐' },
 					{ name:'周游嵊泗', type:'旅行社' }
 				]
 			},
 			toHome(item){
+				console.log(item)
+				this.$store.state.moduleHouse.homestayId=item.merchantId||'1711268640588517378';
 				uni.setStorageSync('userInfo',this.userInfo);
 				uni.reLaunch({
 					url:'/pages/home/index'
 				})
 			}
-		}
+		}			
 	}
 </script>
 

+ 1 - 1
store/house/index.js

@@ -1,5 +1,5 @@
 const state = {
-	
+	 homestayId:'1711268640588517378',
 }
 
 const getters = {