diff --git a/pages/add/add.vue b/pages/add/add.vue index db288bb..850c216 100644 --- a/pages/add/add.vue +++ b/pages/add/add.vue @@ -54,7 +54,7 @@ - + @@ -108,7 +108,6 @@ studentSex: '', className: '', }, - studentSex: '', rules: { 'birthDate': { type: 'string', @@ -149,12 +148,12 @@ }); this.studentId = options.studentId getStudent(this.studentId).then(res => { - if (res.data.studentSex == 'MALE') { - this.studentSex = '男' - } else if (res.data.studentSex == 'FEMALE') { - this.studentSex = '女' - } this.form = res.data + if (res.data.studentSex == 'MALE') { + this.form.studentSex = '男' + } else if (res.data.studentSex == 'FEMALE') { + this.form.studentSex = '女' + } this.form.parentName = res.data.parentName }) @@ -238,6 +237,11 @@ duration: '2000' }) } + if(this.form.studentSex=='男'){ + this.$set(this.form,'studentSex','MALE') + }else if(this.form.studentSex=='女'){ + this.$set(this.form,'studentSex','FEMALE') + } this.$refs.uForm.validate().then(res => { // uni.$u.toast('校验通过') updateStudent(this.form).then(res => { @@ -451,4 +455,4 @@ height: 200rpx !important; overflow: auto; } - + \ No newline at end of file