Sfoglia il codice sorgente

opt:添加顾客信息页面将判断顾客信息是否已添加放在检查顾客是否在当前酒店入住前

LiChengjin 1 mese fa
parent
commit
75d1bda96c
1 ha cambiato i file con 9 aggiunte e 10 eliminazioni
  1. 9 10
      subpkg_checkin/addGuest/addGuest.vue

+ 9 - 10
subpkg_checkin/addGuest/addGuest.vue

@@ -241,6 +241,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,
@@ -257,16 +266,6 @@
 				let pages = getCurrentPages()
 				let beforePage = pages[pages.length - 2]
 
-				//判断此顾客信息是否已添加
-				if (JSON.stringify(this.checkinInfo) !== '{}' && this.checkinInfo.length > 0) {
-					for (let info of this.checkinInfo) {
-						if (info.idNumber === this.idNumber) {
-							uni.$showMsg('已添加此顾客,请检查填写信息')
-							return
-						}
-					}
-				}
-
 				//判断本地缓存是否有顾客身份证信息,有则跳转step 2
 				for (const info of this.idCardInfo) {
 					if (info.idNumber === this.idNumber && info.name === this.name) {