Browse Source

用户修改调整

wangqiang 1 year ago
parent
commit
b975d78137
1 changed files with 19 additions and 10 deletions
  1. 19 10
      src/views/sys/user/UserForm.vue

+ 19 - 10
src/views/sys/user/UserForm.vue

@@ -1282,6 +1282,7 @@ import officeService from "@/api/sys/officeService";
 export default {
 	data() {
 		return {
+			idCardBJ: '',
 			limitNum: 1,
 			hideUploadEdit: false, //隐藏上传按钮
 			hideUploadEdit2: false, //隐藏上传按钮
@@ -1411,6 +1412,7 @@ export default {
 				if (this.$refs.inputForm !== undefined) {
 					this.$refs.inputForm.resetFields();
 				}
+				this.idCardBJ = ''
 				this.inputForm.oldLoinName = "";
 				this.inputForm.id = id;
 				this.inputForm.tenantDTO.id = tenantId;
@@ -1433,6 +1435,7 @@ export default {
 								item.professionList = this.$dictUtils.getDictList('sys_cert_profession_accounting')
 							}
 						})
+						this.idCardBJ = this.inputForm.otherInfoDto.idCard
 						if (this.commonJS.isNotEmpty(this.inputForm.otherInfoDto.certificatesFront)){
 							console.log('jlasd')
 							this.ossService.getTemporaryUrl(this.inputForm.otherInfoDto.certificatesFront).then((data) => {
@@ -1641,16 +1644,21 @@ export default {
 		},
 		// 身份证号rule验证
 		checkIdCardRule (rule, value, callback) {
-			//将证件类型与证件号传入到后台进行唯一性判断
-			let param = {certificatesType: this.inputForm.otherInfoDto.certificatesType, idCard: this.inputForm.otherInfoDto.idCard}
-			userService.findIdCardOnly(param).then((data) => {
-				if (data !== 0) {
-					callback(new Error('身份证号已存在,请重新确认!'))
-					this.inputForm.otherInfoDto.idCard = ''
-				} else {
-					this.blurIdCard(value, callback)
-				}
-			})
+			if (this.idCardBJ !== this.inputForm.otherInfoDto.idCard) {
+				//将证件类型与证件号传入到后台进行唯一性判断
+				let param = {certificatesType: this.inputForm.otherInfoDto.certificatesType, idCard: this.inputForm.otherInfoDto.idCard}
+				userService.findIdCardOnly(param).then((data) => {
+					if (data !== 0) {
+						callback(new Error('身份证号已存在,请重新确认!'))
+						this.inputForm.otherInfoDto.idCard = ''
+					} else {
+						this.blurIdCard(value, callback)
+					}
+				})
+			} else {
+				this.blurIdCard(value, callback)
+			}
+
 		},
 		blurIdCard (value, callback) {
 			if (!this.commonJS.isEmpty(this.inputForm.otherInfoDto.certificatesType)) {
@@ -1786,6 +1794,7 @@ export default {
 		},
 		close () {
 			this.$refs.inputForm.resetFields()
+			this.idCardBJ = ''
 			this.fileList = []
 			this.fileList2 = []
 			this.fileList3 = []