Browse Source

opt:上传身份证信息后检查当前身份信息是否已添加、是否已入住

LiChengjin 1 month ago
parent
commit
371e0a89c4
1 changed files with 22 additions and 1 deletions
  1. 22 1
      subpkg_checkin/addGuest/addGuest.vue

+ 22 - 1
subpkg_checkin/addGuest/addGuest.vue

@@ -747,8 +747,29 @@
 					// #endif
 				}
 			},
-			finishIdCardUpload() {
+			async finishIdCardUpload() {
 				if (this.getAllInfo) {
+					//判断此顾客信息是否已添加
+					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,
+						status: 1,
+						hotelId: this.currentHotel.hotelId,
+						pageNo: 1,
+						pageSize: 1
+					})
+					if (res.data.code == 200 && res.data.data.records.length > 0) {
+						uni.$showMsg('该顾客已入住!')
+						return
+					}
 					this.step = 'checkIdentity'
 				} else {
 					uni.$showMsg('请检查身份证照片')