From 6c331a52930e83dc07480a0f8fa09c8fc73dca1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Mon, 14 Aug 2023 15:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/add/add.vue | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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