|
@@ -5,6 +5,7 @@
|
|
|
<view class="tit">预订信息</view>
|
|
|
<u-cell-group :border="false" customStyle="margin:0 -30rpx">
|
|
|
<u-cell>
|
|
|
+ <text>*</text>
|
|
|
<text slot="icon" class="label">姓名</text>
|
|
|
<view slot="title" class="title">
|
|
|
<u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
|
|
@@ -21,46 +22,65 @@
|
|
|
<u-cell :isLink="true" @click="showLaiyuan=true">
|
|
|
<text slot="icon" class="label">订单来源</text>
|
|
|
<view slot="title" class="title">
|
|
|
- {{dataForm.guestSourceName}}
|
|
|
+ {{dataForm.guestSourceName||''}}
|
|
|
</view>
|
|
|
</u-cell>
|
|
|
</u-cell-group>
|
|
|
</view>
|
|
|
+ <view class="box">
|
|
|
+ <view class="tit tit2">入住登记<u-icon @click="goStayCheck()" name="plus-circle" label="添加入住人"
|
|
|
+ labelColor="#1372FF" labelSize="24" color="1372FF" size="30"></u-icon></view>
|
|
|
+ <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>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<view class="box box1">
|
|
|
<view class="tit">房间信息</view>
|
|
|
+ <view class="dateBetween">
|
|
|
+ <view class="start" v-if="dataForm.arriveDate">
|
|
|
+ <text>入住日期</text>
|
|
|
+ <text class="txt">{{dataForm.arriveDate.substring(5,10)}}</text>
|
|
|
+ </view>
|
|
|
+ <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"
|
|
|
+ @cancel="leaveDateShow=false"
|
|
|
+ @confirm="credentialsConfirmtime" :defaultIndex="credentialsDefaulttime"></u-datetime-picker>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
<u-cell-group :border="false" customStyle="margin:0 -30rpx">
|
|
|
- <u-cell>
|
|
|
+ <!-- <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">
|
|
|
+ </u-cell> -->
|
|
|
+ <!-- <u-cell>
|
|
|
<text slot="icon" class="label">共几晚</text>
|
|
|
<view slot="title" class="title">
|
|
|
{{dataForm.num}}
|
|
|
</view>
|
|
|
- </u-cell>
|
|
|
+ </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">
|
|
|
+ <u-cell>
|
|
|
<text slot="icon" class="label">房间类型</text>
|
|
|
<view slot="title" class="title">
|
|
|
- {{dataForm.houseBaseId}}
|
|
|
+ {{dataForm.houseBaseName}}
|
|
|
</view>
|
|
|
</u-cell>
|
|
|
<u-cell>
|
|
@@ -144,6 +164,7 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ credentialsDefaulttime:[0],
|
|
|
titleStyle: {
|
|
|
fontSize: '34rpx',
|
|
|
fontWeight: "bold",
|
|
@@ -152,13 +173,14 @@
|
|
|
checkInTypeShow: false,
|
|
|
passengerDefault: [0],
|
|
|
passengerDefault2: [0],
|
|
|
+ leaveDateShow: false,
|
|
|
options: [{
|
|
|
text: '删除',
|
|
|
style: {
|
|
|
backgroundColor: '#dd524d'
|
|
|
}
|
|
|
}],
|
|
|
- orderStatus:'',
|
|
|
+ orderStatus: '',
|
|
|
totalMOney: 0, //订单总金额
|
|
|
dataForm: {
|
|
|
arriveDate: "",
|
|
@@ -207,9 +229,12 @@
|
|
|
[]
|
|
|
],
|
|
|
currentDate: '',
|
|
|
- today:''
|
|
|
+ today: ''
|
|
|
}
|
|
|
},
|
|
|
+ onReady() {
|
|
|
+ // 微信小程序需要用此写法
|
|
|
+ },
|
|
|
onLoad(opt) {
|
|
|
this.getLaiyuan();
|
|
|
if (opt.roomId) {
|
|
@@ -237,6 +262,34 @@
|
|
|
this.currentDate = year + '-' + mon + '-' + day;
|
|
|
},
|
|
|
methods: {
|
|
|
+ //i计算天数
|
|
|
+ getDaysBetween(dateString1,dateString2){
|
|
|
+ var startDate = Date.parse(dateString1);
|
|
|
+ var endDate = Date.parse(dateString2);
|
|
|
+ if (startDate>endDate){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ if (startDate==endDate){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ var days=(endDate - startDate)/(1*24*60*60*1000);
|
|
|
+ this.dataForm.num=days;
|
|
|
+ //return days;
|
|
|
+ },
|
|
|
+ credentialsConfirmtime(e) {
|
|
|
+ // 创建一个Date对象并传入时间戳
|
|
|
+ const date = new Date(e.value);
|
|
|
+ // 使用Date对象的方法获取年、月、日、小时、分钟和秒
|
|
|
+ const year = date.getFullYear();
|
|
|
+ const month = ('0' + (date.getMonth() + 1)).slice(-2);
|
|
|
+ const day = ('0' + date.getDate()).slice(-2);
|
|
|
+ // 格式化时间
|
|
|
+ const formattedTime = `${year}-${month}-${day}`;
|
|
|
+
|
|
|
+ this.dataForm.leaveDate = formattedTime;
|
|
|
+ this.getDaysBetween(this.dataForm.arriveDate,this.dataForm.leaveDate);
|
|
|
+ this.leaveDateShow = false;
|
|
|
+ },
|
|
|
compareDate(data) {
|
|
|
if (
|
|
|
new Date(data).getTime() < new Date(this.currentDate).getTime()
|
|
@@ -257,6 +310,19 @@
|
|
|
//v.push("2"); //有时间大于今天
|
|
|
}
|
|
|
},
|
|
|
+ //添加入住人
|
|
|
+ goStayCheck() {
|
|
|
+ let list = JSON.stringify(this.dataForm);
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/house/stayCheck?orderInfo=' + list,
|
|
|
+ events: {
|
|
|
+ addSuccess: data => {
|
|
|
+ this.dataForm.detailFormList[0].checkInPersonList = data.data || [];
|
|
|
+ console.log(this.dataForm.detailFormList[0].checkInPersonList)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ },
|
|
|
//添加早餐
|
|
|
addBreast() {
|
|
|
let list = JSON.stringify(this.dataForm.detailFormList[0].breakfastData);
|
|
@@ -276,17 +342,17 @@
|
|
|
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)*this.dataForm.detailFormList[0].breakfastData[i].num;
|
|
|
+ .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;
|
|
|
+ .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)*this.dataForm.detailFormList[0].otherData[i].num;
|
|
|
+ .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;
|
|
|
+ .defaultPrice) * this.dataForm.detailFormList[0].otherData[i].num;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -295,7 +361,7 @@
|
|
|
//添加收款
|
|
|
addpay() {
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/house/payAdd?money=' + this.dataForm.detailFormList[0].roomAmount + '&list=' +
|
|
|
+ url: '/pages/house/payAdd?money=' + this.totalMOney + '&list=' +
|
|
|
JSON.stringify(this.dataForm.flowRecord),
|
|
|
events: {
|
|
|
addSuccess: data => {
|
|
@@ -312,16 +378,35 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ delPer(index) {
|
|
|
+ this.dataForm.detailFormList[0].checkInPersonList.splice(index, 1)
|
|
|
+ },
|
|
|
confirmOrder(orderStatus) {
|
|
|
+ if(!this.dataForm.guestName){
|
|
|
+ this.$showToast('请输入姓名');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.dataForm.guestPhone){
|
|
|
+ this.$showToast('请输入手机号');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.dataForm.guestSourceName){
|
|
|
+ this.$showToast('请选择来源');
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!this.dataForm.detailFormList[0].checkInPersonList||this.dataForm.detailFormList[0].checkInPersonList.length==0){
|
|
|
+ this.$showToast('请添加入住人');
|
|
|
+ return
|
|
|
+ }
|
|
|
//orderStatus//预约入住 1,直接入住2
|
|
|
- if(orderStatus){
|
|
|
+ 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;
|
|
|
+ if (this.orderStatus) {
|
|
|
+ this.dataForm.orderStatus = this.orderStatus;
|
|
|
}
|
|
|
} else {
|
|
|
url = '/merchant/hotel/order/placeOrder'
|
|
@@ -338,13 +423,17 @@
|
|
|
})
|
|
|
},
|
|
|
click(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].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].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) {
|
|
@@ -384,9 +473,10 @@
|
|
|
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.arriveDate = res.data.data.arriveDate.substring(0,10);
|
|
|
+ this.dataForm.leaveDate = res.data.data.leaveDate.substring(0,10);
|
|
|
this.dataForm.houseBaseId = res.data.data.houseBaseId;
|
|
|
+ this.dataForm.houseBaseName = res.data.data.houseBaseName;
|
|
|
this.dataForm.num = res.data.data.num;
|
|
|
this.totalMOney = res.data.data.roomAmount;
|
|
|
}
|
|
@@ -457,7 +547,7 @@
|
|
|
border-radius: 48rpx;
|
|
|
border: 1rpx solid #D1D1D1;
|
|
|
color: #999;
|
|
|
- flex:1;
|
|
|
+ flex: 1;
|
|
|
|
|
|
&:last-child {
|
|
|
background-color: #1372FF;
|
|
@@ -531,4 +621,57 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ .perItem {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 30rpx 0;
|
|
|
+ border-bottom: 1rpx solid #E1E1E1;
|
|
|
+
|
|
|
+ text {
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #333;
|
|
|
+
|
|
|
+ &:nth-of-type(2) {
|
|
|
+ flex: 1;
|
|
|
+ margin: 0 10rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .dateBetween {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 20rpx 0 30rpx;
|
|
|
+ border-bottom: 1rpx solid #E1E1E1;
|
|
|
+
|
|
|
+ .start,
|
|
|
+ .end {
|
|
|
+ text-align: center;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ text {
|
|
|
+ &.txt {
|
|
|
+ font-size: 40rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-top: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .dateNum {
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 30rpx;
|
|
|
+ display: inline-block;
|
|
|
+ width: 120rpx;
|
|
|
+ height: 50rpx;
|
|
|
+ line-height: 50rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
+ color: #333;
|
|
|
+ background-color: #F9FAFC;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|