|
@@ -47,8 +47,7 @@
|
|
<view class="end" v-if="dataForm.leaveDate">
|
|
<view class="end" v-if="dataForm.leaveDate">
|
|
<text>离店日期</text>
|
|
<text>离店日期</text>
|
|
<text @click="showPick()" class="txt">{{dataForm.leaveDate.substring(5,10)}}</text>
|
|
<text @click="showPick()" class="txt">{{dataForm.leaveDate.substring(5,10)}}</text>
|
|
- <u-datetime-picker :show="leaveDateShow" mode="date" ref="picker"
|
|
|
|
- @cancel="leaveDateShow=false"
|
|
|
|
|
|
+ <u-datetime-picker :show="leaveDateShow" mode="date" ref="picker" @cancel="leaveDateShow=false"
|
|
@confirm="credentialsConfirmtime" :defaultIndex="credentialsDefaulttime"></u-datetime-picker>
|
|
@confirm="credentialsConfirmtime" :defaultIndex="credentialsDefaulttime"></u-datetime-picker>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -161,10 +160,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import {
|
|
|
|
+ encrypt
|
|
|
|
+ } from '../../utils/aes.js'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- credentialsDefaulttime:[10,1,0],
|
|
|
|
|
|
+ credentialsDefaulttime: [10, 1, 0],
|
|
titleStyle: {
|
|
titleStyle: {
|
|
fontSize: '34rpx',
|
|
fontSize: '34rpx',
|
|
fontWeight: "bold",
|
|
fontWeight: "bold",
|
|
@@ -189,7 +191,7 @@
|
|
checkInPersonList: [],
|
|
checkInPersonList: [],
|
|
checkInType: 0,
|
|
checkInType: 0,
|
|
checkInTypeName: '',
|
|
checkInTypeName: '',
|
|
- id:0,
|
|
|
|
|
|
+ id: 0,
|
|
otherAmount: 0,
|
|
otherAmount: 0,
|
|
roomAmount: 0,
|
|
roomAmount: 0,
|
|
roomIds: "",
|
|
roomIds: "",
|
|
@@ -224,13 +226,17 @@
|
|
}
|
|
}
|
|
]
|
|
]
|
|
],
|
|
],
|
|
- flowTypeNames:['微信','支付宝','云闪付'],
|
|
|
|
|
|
+ flowTypeNames: ['微信', '支付宝', '云闪付'],
|
|
roomId: '',
|
|
roomId: '',
|
|
laiyuan: [
|
|
laiyuan: [
|
|
[]
|
|
[]
|
|
],
|
|
],
|
|
currentDate: '',
|
|
currentDate: '',
|
|
- today: ''
|
|
|
|
|
|
+ today: '',
|
|
|
|
+ //加密备用
|
|
|
|
+ tempCheckInPersonList: null,
|
|
|
|
+ tempGuestName: null,
|
|
|
|
+ tempGuestPhone: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onReady() {
|
|
onReady() {
|
|
@@ -261,23 +267,23 @@
|
|
this.currentDate = year + '-' + mon + '-' + day;
|
|
this.currentDate = year + '-' + mon + '-' + day;
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- showPick(){
|
|
|
|
- this.leaveDateShow=true;
|
|
|
|
- this.$refs.picker.innerValue=new Date().getTime()
|
|
|
|
|
|
+ showPick() {
|
|
|
|
+ this.leaveDateShow = true;
|
|
|
|
+ this.$refs.picker.innerValue = new Date().getTime()
|
|
},
|
|
},
|
|
//i计算天数
|
|
//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;
|
|
|
|
|
|
+ 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) {
|
|
credentialsConfirmtime(e) {
|
|
// 创建一个Date对象并传入时间戳
|
|
// 创建一个Date对象并传入时间戳
|
|
@@ -288,13 +294,13 @@
|
|
const day = ('0' + date.getDate()).slice(-2);
|
|
const day = ('0' + date.getDate()).slice(-2);
|
|
// 格式化时间
|
|
// 格式化时间
|
|
const formattedTime = `${year}-${month}-${day}`;
|
|
const formattedTime = `${year}-${month}-${day}`;
|
|
-
|
|
|
|
|
|
+
|
|
this.dataForm.leaveDate = formattedTime;
|
|
this.dataForm.leaveDate = formattedTime;
|
|
- this.getDaysBetween(this.dataForm.arriveDate,this.dataForm.leaveDate);
|
|
|
|
|
|
+ this.getDaysBetween(this.dataForm.arriveDate, this.dataForm.leaveDate);
|
|
this.leaveDateShow = false;
|
|
this.leaveDateShow = false;
|
|
},
|
|
},
|
|
compareDate(data) {
|
|
compareDate(data) {
|
|
- let data2=data.substring(0,10);
|
|
|
|
|
|
+ let data2 = data.substring(0, 10);
|
|
if (
|
|
if (
|
|
new Date(data2).getTime() < new Date(this.currentDate).getTime()
|
|
new Date(data2).getTime() < new Date(this.currentDate).getTime()
|
|
) {
|
|
) {
|
|
@@ -381,20 +387,25 @@
|
|
delPer(index) {
|
|
delPer(index) {
|
|
this.dataForm.detailFormList[0].checkInPersonList.splice(index, 1)
|
|
this.dataForm.detailFormList[0].checkInPersonList.splice(index, 1)
|
|
},
|
|
},
|
|
- confirmOrder(orderStatus) {
|
|
|
|
- if(!this.dataForm.guestName){
|
|
|
|
|
|
+ confirmOrder(orderStatus) {
|
|
|
|
+ if (!this.dataForm.guestName) {
|
|
this.$showToast('请输入姓名');
|
|
this.$showToast('请输入姓名');
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!this.$u.test.mobile(this.dataForm.guestPhone)){
|
|
|
|
|
|
+ let value = this.dataForm.guestPhone;
|
|
|
|
+ if (value.indexOf("**") > -1) {
|
|
|
|
+ value = value.replace(/\*/g, "5");
|
|
|
|
+ }
|
|
|
|
+ if (!this.$u.test.mobile(value)) {
|
|
this.$showToast('请输入正确手机号');
|
|
this.$showToast('请输入正确手机号');
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!this.dataForm.guestSourceName){
|
|
|
|
|
|
+ if (!this.dataForm.guestSourceName) {
|
|
this.$showToast('请选择来源');
|
|
this.$showToast('请选择来源');
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!this.dataForm.detailFormList[0].checkInPersonList||this.dataForm.detailFormList[0].checkInPersonList.length==0){
|
|
|
|
|
|
+ if (!this.dataForm.detailFormList[0].checkInPersonList || this.dataForm.detailFormList[0].checkInPersonList
|
|
|
|
+ .length == 0) {
|
|
this.$showToast('请添加入住人');
|
|
this.$showToast('请添加入住人');
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -411,7 +422,70 @@
|
|
} else {
|
|
} else {
|
|
url = '/merchant/hotel/order/placeOrder'
|
|
url = '/merchant/hotel/order/placeOrder'
|
|
}
|
|
}
|
|
- this.$api.post(url, this.dataForm).then(res => {
|
|
|
|
|
|
+ //加密
|
|
|
|
+ let newDataForm = JSON.parse(JSON.stringify(this.dataForm));
|
|
|
|
+ if (
|
|
|
|
+ newDataForm.guestName &&
|
|
|
|
+ this.tempGuestName != newDataForm.guestName
|
|
|
|
+ ) {
|
|
|
|
+ //编辑了
|
|
|
|
+ newDataForm.guestName = encrypt(
|
|
|
|
+ newDataForm.guestName
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ newDataForm.guestName = null;
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ newDataForm.guestPhone &&
|
|
|
|
+ this.tempGuestPhone != newDataForm.guestPhone
|
|
|
|
+ ) {
|
|
|
|
+ newDataForm.guestPhone = encrypt(
|
|
|
|
+ newDataForm.guestPhone
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ newDataForm.guestPhone = null;
|
|
|
|
+ }
|
|
|
|
+ let checkInPersonList =
|
|
|
|
+ newDataForm.detailFormList[0].checkInPersonList;
|
|
|
|
+ //入住人里面身份证
|
|
|
|
+ //let len = this.tempCheckInPersonList;
|
|
|
|
+ checkInPersonList.forEach((element, i) => {
|
|
|
|
+ //姓名 checkInName,idCard,checkInPhone
|
|
|
|
+ //新增直接加密,编辑判断是否修改
|
|
|
|
+ if (
|
|
|
|
+ (!this.tempCheckInPersonLis) ||
|
|
|
|
+ element.checkInName &&
|
|
|
|
+ element.checkInName != this.tempCheckInPersonList[i].checkInName
|
|
|
|
+ ) {
|
|
|
|
+ element.checkInName = encrypt(element.checkInName);
|
|
|
|
+ } else {
|
|
|
|
+ element.checkInName = null;
|
|
|
|
+ }
|
|
|
|
+ //身份证
|
|
|
|
+ if (
|
|
|
|
+ (!this.tempCheckInPersonLis) ||
|
|
|
|
+ element.idCard &&
|
|
|
|
+ element.idCard != this.tempCheckInPersonList[i].idCard
|
|
|
|
+ ) {
|
|
|
|
+ element.idCard = encrypt(element.idCard);
|
|
|
|
+ } else {
|
|
|
|
+ element.idCard = null;
|
|
|
|
+ }
|
|
|
|
+ //手机号
|
|
|
|
+ if (
|
|
|
|
+ (!this.tempCheckInPersonLis) ||
|
|
|
|
+ element.checkInPhone &&
|
|
|
|
+ element.checkInPhone != this.tempCheckInPersonList[i].checkInPhone
|
|
|
|
+ ) {
|
|
|
|
+ element.checkInPhone = encrypt(
|
|
|
|
+ element.checkInPhone
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ element.checkInPhone = null;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ newDataForm.detailFormList[0].checkInPersonList = checkInPersonList;
|
|
|
|
+ this.$api.post(url, newDataForm).then(res => {
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
this.$showToast('操作成功');
|
|
this.$showToast('操作成功');
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -456,20 +530,25 @@
|
|
...this.dataForm,
|
|
...this.dataForm,
|
|
...res.data.data,
|
|
...res.data.data,
|
|
};
|
|
};
|
|
|
|
+ //加密备用
|
|
|
|
+ this.tempCheckInPersonList =
|
|
|
|
+ this.dataForm.detailFormList[0].checkInPersonList || []; //入住人集合
|
|
|
|
+ this.tempGuestName = this.dataForm.guestName;
|
|
|
|
+ this.tempGuestPhone = this.dataForm.guestPhone;
|
|
this.compareDate(this.dataForm.arriveDate);
|
|
this.compareDate(this.dataForm.arriveDate);
|
|
this.dataForm.detailFormList[0].checkInType = res.data.data.detailFormList[0].checkInType;
|
|
this.dataForm.detailFormList[0].checkInType = res.data.data.detailFormList[0].checkInType;
|
|
this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
|
|
this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
|
|
- .val ==this.dataForm.detailFormList[0].checkInType))[0].label;
|
|
|
|
|
|
+ .val == this.dataForm.detailFormList[0].checkInType))[0].label;
|
|
this.totalMOney = this.dataForm.orderAmount;
|
|
this.totalMOney = this.dataForm.orderAmount;
|
|
- this.dataForm.flowRecord.forEach((i,index)=>{
|
|
|
|
- let flowTypeName=i.flowType==1?'收款':'退款';
|
|
|
|
- var payTypeName='微信';
|
|
|
|
- if(i.payType){
|
|
|
|
- payTypeName=this.flowTypeNames[i.payType-1];
|
|
|
|
|
|
+ this.dataForm.flowRecord.forEach((i, index) => {
|
|
|
|
+ let flowTypeName = i.flowType == 1 ? '收款' : '退款';
|
|
|
|
+ var payTypeName = '微信';
|
|
|
|
+ if (i.payType) {
|
|
|
|
+ payTypeName = this.flowTypeNames[i.payType - 1];
|
|
}
|
|
}
|
|
-
|
|
|
|
- this.$set(this.dataForm.flowRecord[index],'flowTypeName',flowTypeName)
|
|
|
|
- this.$set(this.dataForm.flowRecord[index],'payTypeName',payTypeName)
|
|
|
|
|
|
+
|
|
|
|
+ this.$set(this.dataForm.flowRecord[index], 'flowTypeName', flowTypeName)
|
|
|
|
+ this.$set(this.dataForm.flowRecord[index], 'payTypeName', payTypeName)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -491,7 +570,7 @@
|
|
this.dataForm.houseBaseName = res.data.data.houseBaseName;
|
|
this.dataForm.houseBaseName = res.data.data.houseBaseName;
|
|
this.dataForm.num = res.data.data.num;
|
|
this.dataForm.num = res.data.data.num;
|
|
this.totalMOney = res.data.data.roomAmount;
|
|
this.totalMOney = res.data.data.roomAmount;
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -560,7 +639,7 @@
|
|
border-radius: 48rpx;
|
|
border-radius: 48rpx;
|
|
border: 1rpx solid #D1D1D1;
|
|
border: 1rpx solid #D1D1D1;
|
|
color: #999;
|
|
color: #999;
|
|
- margin:0 3%;
|
|
|
|
|
|
+ margin: 0 3%;
|
|
flex: 1;
|
|
flex: 1;
|
|
|
|
|
|
&:last-child {
|
|
&:last-child {
|
|
@@ -641,9 +720,11 @@
|
|
align-items: center;
|
|
align-items: center;
|
|
padding: 26rpx 0;
|
|
padding: 26rpx 0;
|
|
border-bottom: 1rpx solid #E1E1E1;
|
|
border-bottom: 1rpx solid #E1E1E1;
|
|
- &:last-child{
|
|
|
|
|
|
+
|
|
|
|
+ &:last-child {
|
|
border: 0;
|
|
border: 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
text {
|
|
text {
|
|
font-size: 30rpx;
|
|
font-size: 30rpx;
|
|
color: #333;
|
|
color: #333;
|