Commit 7d091b23 authored by 罗林杰's avatar 罗林杰

修改校验

parent 16c8e0dc
......@@ -14,12 +14,12 @@
>
<u-form-item
label="民族"
prop="form.memNationText"
prop="memNationText"
borderBottom
@click="showNation = true; hideKeyboard()"
>
<u--input
v-model="form.memNationText"
v-model="userInfo.memNationText"
disabled
disabledColor="#ffffff"
placeholder="请选择民族"
......@@ -43,12 +43,12 @@
</u-form-item>
<u-form-item
label="性别"
prop="form.memSexText"
prop="memSexText"
borderBottom
@click="showSex = true; hideKeyboard()"
>
<u--input
v-model="form.memSexText"
v-model="userInfo.memSexText"
disabled
disabledColor="#ffffff"
placeholder="请选择性别"
......@@ -79,11 +79,11 @@
</u-form-item>
<u-form-item
label="星座"
prop="form.memConstellationText"
prop="memConstellationText"
borderBottom
>
<u--input
v-model="form.memConstellationText"
v-model="userInfo.memConstellationText"
disabled
disabledColor="#ffffff"
placeholder="星座"
......@@ -124,12 +124,12 @@
</u-form-item>
<u-form-item
label="教育经历"
prop="form.memMaxEducationText"
prop="memMaxEducationText"
borderBottom
@click="showEducation = true; hideKeyboard()"
>
<u--input
v-model="form.memMaxEducationText"
v-model="userInfo.memMaxEducationText"
disabled
disabledColor="#ffffff"
placeholder="请选择教育经历"
......@@ -187,12 +187,12 @@
</u-form-item>
<u-form-item
label="居住地"
prop="form.memResidence"
prop="memResidence"
borderBottom
@click="showResidence = true; hideKeyboard()"
>
<u--input
v-model="form.memResidence"
v-model="userInfo.memResidence"
disabled
disabledColor="#ffffff"
placeholder="请选择居住地"
......@@ -205,12 +205,12 @@
</u-form-item>
<u-form-item
label="籍贯"
prop="form.memNative"
prop="memNative"
borderBottom
@click="showNative = true; hideKeyboard()"
>
<u--input
v-model="form.memNative"
v-model="userInfo.memNative"
disabled
disabledColor="#ffffff"
placeholder="请选择籍贯"
......@@ -223,12 +223,12 @@
</u-form-item>
<u-form-item
label="婚姻状况"
prop="form.memMarriageText"
prop="memMarriageText"
borderBottom
@click="showMarriage = true; hideKeyboard()"
>
<u--input
v-model="form.memMarriageText"
v-model="userInfo.memMarriageText"
disabled
disabledColor="#ffffff"
placeholder="请选择婚姻状况"
......@@ -414,19 +414,18 @@ export default {
memMarriageRemarks:'',//婚姻状态备注
memMbti:'',//人格
},
form:{},
tipMsg: '',
isConfirm: false,
birthday: Number(new Date()),
rules: {
// 'form.memNationText': [
// {
// type: 'string',
// required: true,
// message: '请选择民族',
// trigger: ['blur', 'change']
// }
// ],
memNationText: [
{
type: 'string',
required: true,
message: '请选择民族',
trigger: ['blur', 'change']
}
],
memNickName: [
{
type: 'string',
......@@ -459,14 +458,14 @@ export default {
trigger: ['blur']
}
],
// 'form.memMaxEducationText': [
// {
// type: 'string',
// required: true,
// message: '请选择教育经历',
// trigger: ['blur', 'change']
// }
// ],
memMaxEducationText: [
{
type: 'string',
required: true,
message: '请选择教育经历',
trigger: ['blur', 'change']
}
],
memCollege: [
{
type: 'string',
......@@ -475,6 +474,14 @@ export default {
trigger: ['blur']
}
],
memCareer: [
{
type: 'string',
required: true,
message: '请输入职业',
trigger: ['blur']
}
],
memYearIncome: [
{
type: 'number',
......@@ -483,22 +490,22 @@ export default {
trigger: ['blur']
}
],
// 'form.memResidence': [
// {
// type: 'string',
// required: true,
// message: '请选择居住地',
// trigger: ['blur', 'change']
// }
// ],
// 'form.memNative': [
// {
// type: 'string',
// required: true,
// message: '请选择籍贯',
// trigger: ['blur', 'change']
// }
// ],
memResidence: [
{
type: 'string',
required: true,
message: '请选择居住地',
trigger: ['blur', 'change']
}
],
memNative: [
{
type: 'string',
required: true,
message: '请选择籍贯',
trigger: ['blur', 'change']
}
],
memIntroduce: [
{
type: 'string',
......@@ -531,14 +538,14 @@ export default {
trigger: ['blur']
}
],
// 'form.memMarriageText': [
// {
// type: 'string',
// required: true,
// message: '请选择婚姻状况',
// trigger: ['change']
// }
// ]
memMarriageText: [
{
type: 'string',
required: true,
message: '请选择婚姻状况',
trigger: ['change']
}
]
}
}
},
......@@ -555,35 +562,35 @@ export default {
this.userInfo = res.data.data
//处理性别
if(this.judgment(res.data.data.memSex)){
this.form.memSexText = getValue('sex',res.data.data.memSex)
this.userInfo.memSexText = getValue('sex',res.data.data.memSex)
}
//处理学历
if(this.judgment(res.data.data.memMaxEducation)){
this.form.memMaxEducationText = getValue('education',res.data.data.memMaxEducation)
this.userInfo.memMaxEducationText = getValue('education',res.data.data.memMaxEducation)
}
//处理星座
if(this.judgment(res.data.data.memConstellation)){
this.form.memConstellationText = getValue('constellation',res.data.data.memConstellation)
this.userInfo.memConstellationText = getValue('constellation',res.data.data.memConstellation)
}
//处理民族
if(this.judgment(res.data.data.memNation)){
this.form.memNationText = getValue('nation',Number(res.data.data.memNation))
this.userInfo.memNationText = getValue('nation',Number(res.data.data.memNation))
}
//处理教育经历
if(this.judgment(res.data.data.memMaxEducation)){
this.form.memEducationText = getValue('education',res.data.data.memMaxEducation)
this.userInfo.memEducationText = getValue('education',res.data.data.memMaxEducation)
}
//处理居住地
if (this.judgment(res.data.data.memResidenceProvince) && this.judgment(res.data.data.memResidenceCity)){
this.form.memResidence = getResidence(res.data.data.memResidenceProvince,res.data.data.memResidenceCity)
this.userInfo.memResidence = getResidence(res.data.data.memResidenceProvince,res.data.data.memResidenceCity)
}
//处理籍贯
if (this.judgment(res.data.data.memNativeProvince) && this.judgment(res.data.data.memNativeCity)){
this.form.memNative = getResidence(res.data.data.memNativeProvince,res.data.data.memNativeCity)
this.userInfo.memNative = getResidence(res.data.data.memNativeProvince,res.data.data.memNativeCity)
}
//处理婚姻状况
if(this.judgment(res.data.data.memMarriage)){
this.form.memMarriageText = getValue('marriage',Number(res.data.data.memMarriage))
this.userInfo.memMarriageText = getValue('marriage',Number(res.data.data.memMarriage))
}
})
},
......@@ -593,12 +600,12 @@ export default {
confirmMarriage(e){
this.showMarriage = false
this.userInfo.memMarriage = e.value[0].value
this.form.memMarriageText = e.value[0].label
this.userInfo.memMarriageText = e.value[0].label
},
confirmEducation(e){
this.showEducation = false
this.userInfo.memMaxEducation = e.value[0].value
this.form.memMaxEducationText = e.value[0].label
this.userInfo.memMaxEducationText = e.value[0].label
},
confirmBirthday(e) {
this.showBirthday = false
......@@ -615,55 +622,55 @@ export default {
if ((formattedMonth === 1 && dayInMonth >= 20) || (formattedMonth === 2 && dayInMonth <= 18)) {
this.userInfo.memConstellation = 1
this.form.memConstellationText = '水瓶座'
this.userInfo.memConstellationText = '水瓶座'
} else if ((formattedMonth === 2 && dayInMonth >= 19) || (formattedMonth === 3 && dayInMonth <= 20)) {
this.userInfo.memConstellation = 2
this.form.memConstellationText = '双鱼座'
this.userInfo.memConstellationText = '双鱼座'
} else if ((formattedMonth === 3 && dayInMonth >= 21) || (formattedMonth === 4 && dayInMonth <= 19)) {
this.userInfo.memConstellation = 3
this.form.memConstellationText = '白羊座'
this.userInfo.memConstellationText = '白羊座'
} else if ((formattedMonth === 4 && dayInMonth >= 20) || (formattedMonth === 5 && dayInMonth <= 20)) {
this.userInfo.memConstellation = 4
this.form.memConstellationText = '金牛座'
this.userInfo.memConstellationText = '金牛座'
} else if ((formattedMonth === 5 && dayInMonth >= 21) || (formattedMonth === 6 && dayInMonth <= 20)) {
this.userInfo.memConstellation = 5
this.form.memConstellationText = '双子座'
this.userInfo.memConstellationText = '双子座'
} else if ((formattedMonth === 6 && dayInMonth >= 21) || (formattedMonth === 7 && dayInMonth <= 22)) {
this.userInfo.memConstellation = 6
this.form.memConstellationText = '巨蟹座'
this.userInfo.memConstellationText = '巨蟹座'
} else if ((formattedMonth === 7 && dayInMonth >= 23) || (formattedMonth === 8 && dayInMonth <= 22)) {
this.userInfo.memConstellation = 7
this.form.memConstellationText = '狮子座'
this.userInfo.memConstellationText = '狮子座'
} else if ((formattedMonth === 8 && dayInMonth >= 23) || (formattedMonth === 9 && dayInMonth <= 22)) {
this.userInfo.memConstellation = 8
this.form.memConstellationText = '处女座'
this.userInfo.memConstellationText = '处女座'
} else if ((formattedMonth === 9 && dayInMonth >= 23) || (formattedMonth === 10 && dayInMonth <= 22)) {
this.userInfo.memConstellation = 9
this.form.memConstellationText = '天秤座'
this.userInfo.memConstellationText = '天秤座'
} else if ((formattedMonth === 10 && dayInMonth >= 23) || (formattedMonth === 11 && dayInMonth <= 21)) {
this.userInfo.memConstellation = 10
this.form.memConstellationText = '天蝎座'
this.userInfo.memConstellationText = '天蝎座'
} else if ((formattedMonth === 11 && dayInMonth >= 22) || (formattedMonth === 12 && dayInMonth <= 21)) {
this.userInfo.memConstellation = 11
this.form.memConstellationText = '射手座'
this.userInfo.memConstellationText = '射手座'
} else if ((formattedMonth === 12 && dayInMonth >= 22) || (formattedMonth === 1 && dayInMonth <= 19)) {
this.userInfo.memConstellation = 12
this.form.memConstellationText = '摩羯座'
this.userInfo.memConstellationText = '摩羯座'
}
},
confirmSex(e){
this.showSex = false
this.userInfo.memSex = e.value[0].value
this.form.memSexText = e.value[0].label
this.userInfo.memSexText = e.value[0].label
},
confirmNation(e){
this.showNation = false
this.userInfo.memNation = e.value[0].value
this.form.memNationText = e.value[0].label
this.userInfo.memNationText = e.value[0].label
},
confirmResidence(e){
this.showResidence = false
this.form.memResidence = e.value[0].label + '/' + e.value[1].label
this.userInfo.memResidence = e.value[0].label + '/' + e.value[1].label
this.userInfo.memResidenceProvince = e.value[0].value
this.userInfo.memResidenceCity = e.value[1].value
},
......@@ -673,7 +680,7 @@ export default {
},
confirmNative(e){
this.showNative = false
this.form.memNative = e.value[0].label + '/' + e.value[1].label
this.userInfo.memNative = e.value[0].label + '/' + e.value[1].label
this.userInfo.memNativeProvince = e.value[0].value
this.userInfo.memNativeCity = e.value[1].value
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment