This commit is contained in:
闫晓茹 2023-08-14 15:59:44 +08:00
parent 44e7d2e4ae
commit 6c331a5293

View File

@ -54,7 +54,7 @@
</view> </view>
<u-form-item label="学生性别:" borderBottom> <u-form-item label="学生性别:" borderBottom>
<u-radio-group v-model="studentSex" @change="groupChange"> <u-radio-group v-model="form.studentSex" @change="groupChange">
<u-radio :customStyle="{marginBottom: '4px'}" v-for="(item, index) in radiolist1" :key="index" <u-radio :customStyle="{marginBottom: '4px'}" v-for="(item, index) in radiolist1" :key="index"
:label="item.name" :name="item.name" @change="radioChange"> :label="item.name" :name="item.name" @change="radioChange">
</u-radio> </u-radio>
@ -108,7 +108,6 @@
studentSex: '', studentSex: '',
className: '', className: '',
}, },
studentSex: '',
rules: { rules: {
'birthDate': { 'birthDate': {
type: 'string', type: 'string',
@ -149,12 +148,12 @@
}); });
this.studentId = options.studentId this.studentId = options.studentId
getStudent(this.studentId).then(res => { getStudent(this.studentId).then(res => {
if (res.data.studentSex == 'MALE') {
this.studentSex = '男'
} else if (res.data.studentSex == 'FEMALE') {
this.studentSex = '女'
}
this.form = res.data 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 this.form.parentName = res.data.parentName
}) })
@ -238,6 +237,11 @@
duration: '2000' 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 => { this.$refs.uForm.validate().then(res => {
// uni.$u.toast('') // uni.$u.toast('')
updateStudent(this.form).then(res => { updateStudent(this.form).then(res => {
@ -451,4 +455,4 @@
height: 200rpx !important; height: 200rpx !important;
overflow: auto; overflow: auto;
} }
</style> </style>