|
@@ -275,7 +275,7 @@
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState('m_user', ['userInfo']),
|
|
|
- ...mapState('m_business', ['checkinInfo', 'currentHotel', 'idCardInfo']),
|
|
|
+ ...mapState('m_business', ['checkinInfo', 'currentHotel', 'idCardInfo', 'order']),
|
|
|
getAllInfo() {
|
|
|
let getAll = true
|
|
|
for (const info of this.infoList) {
|
|
@@ -300,7 +300,7 @@
|
|
|
// #endif
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapMutations('m_business', ['updateCheckinInfo', 'updateIdCardInfo']),
|
|
|
+ ...mapMutations('m_business', ['updateCheckinInfo', 'updateIdCardInfo', 'updateOrder']),
|
|
|
...mapMutations('m_user', ['updateUserInfo']),
|
|
|
async finishInput() {
|
|
|
//检查格式是否正确
|
|
@@ -320,6 +320,15 @@
|
|
|
uni.$showMsg('手机号格式错误!')
|
|
|
return
|
|
|
}
|
|
|
+ //判断此顾客信息是否已添加
|
|
|
+ if (JSON.stringify(this.checkinInfo) !== '{}' && this.checkinInfo.length > 0) {
|
|
|
+ for (let info of this.checkinInfo) {
|
|
|
+ if (info.idNumber === this.idNumber) {
|
|
|
+ uni.$showMsg('已添加此顾客,请检查填写信息')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
//检查该顾客是否在当前酒店入住
|
|
|
let res = await uni.$http.post('/checkinInfo/queryByCondition', {
|
|
|
userIdNumber: this.idNumber,
|
|
@@ -1216,13 +1225,20 @@
|
|
|
idCardBackBase64: that.idCardBackPicPath.split(',')[1]
|
|
|
})
|
|
|
}
|
|
|
- //如果是主入住人,且当前账号姓名和身份证号信息与所传身份证不一致,则更新账号信息为主入住人信息
|
|
|
- if (this.isMainCustomer && (this.userInfo.name !== this.name || this
|
|
|
- .userInfo.idNumber !== this.idNumber)) {
|
|
|
- this.userInfo.name = this.name
|
|
|
- this.userInfo.idNumber = this.idNumber
|
|
|
- this.updateUserInfo(this.userInfo)
|
|
|
- uni.$http.put(`/userInfo/${this.userInfo.id}`, this.userInfo)
|
|
|
+ if (this.isMainCustomer) {
|
|
|
+ //如果是主入住人,且当前账号姓名和身份证号信息与所传身份证不一致,则更新账号信息为主入住人信息
|
|
|
+ if (this.userInfo.name !== this.name || this.userInfo.idNumber !== this
|
|
|
+ .idNumber) {
|
|
|
+ this.userInfo.name = this.name
|
|
|
+ this.userInfo.idNumber = this.idNumber
|
|
|
+ this.updateUserInfo(this.userInfo)
|
|
|
+ uni.$http.put(`/userInfo/${this.userInfo.id}`, this.userInfo)
|
|
|
+ }
|
|
|
+ //更新订单预定人信息为主入住人信息
|
|
|
+ let orderToUpdate = this.order
|
|
|
+ orderToUpdate.name = this.name
|
|
|
+ orderToUpdate.phone = this.phone
|
|
|
+ this.updateOrder(orderToUpdate)
|
|
|
}
|
|
|
uni.hideLoading();
|
|
|
uni.$showMsg('身份核验通过!')
|