Commit 1434523c authored by 黄奎's avatar 黄奎
parents 79f8ffa4 0a631c31
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
</li> </li>
<li> <li>
<el-form-item label="出生日期" prop="Birthday"> <el-form-item label="出生日期" prop="Birthday">
<el-date-picker v-model='addMsg.Birthday' class="w230" value-format="yyyy-MM-dd" type="date" <el-date-picker v-model='addMsg.Birthday' class="w230" @change="zhanchuangTips(addMsg.Birthday)" value-format="yyyy-MM-dd" type="date"
placeholder="选择日期"></el-date-picker> placeholder="选择日期"></el-date-picker>
</el-form-item> </el-form-item>
</li> </li>
...@@ -604,6 +604,7 @@ ...@@ -604,6 +604,7 @@
export default { export default {
data() { data() {
return { return {
ppAge: 0,
loading: false, loading: false,
appkey_ocr: "OGAhU38ib8EweXMtPVqCbkpN", appkey_ocr: "OGAhU38ib8EweXMtPVqCbkpN",
secretKey_ocr: "OcqfFF5hlleWovzA6vLweykxPgwE8XF2", secretKey_ocr: "OcqfFF5hlleWovzA6vLweykxPgwE8XF2",
...@@ -798,6 +799,63 @@ ...@@ -798,6 +799,63 @@
}; };
}, },
methods: { methods: {
jsGetAge(strBirthday){
let returnAge;
let strBirthdayArr=strBirthday.split("-");
let birthYear = strBirthdayArr[0];
let birthMonth = strBirthdayArr[1];
let birthDay = strBirthdayArr[2];
let d = new Date();
let nowYear = d.getFullYear();
let nowMonth = d.getMonth() + 1;
let nowDay = d.getDate();
if(nowYear == birthYear && birthMonth <= nowMonth && birthDay <= nowDay){
returnAge = 1;//同年 则为0岁
} else {
let ageDiff = nowYear - birthYear ; //年之差
if(ageDiff > 0){
if(nowMonth == birthMonth) {
let dayDiff = nowDay - birthDay;//日之差
if(dayDiff < 0)
{
returnAge = ageDiff - 1;
}
else
{
returnAge = ageDiff ;
}
}
else
{
let monthDiff = nowMonth - birthMonth;//月之差
if(monthDiff < 0)
{
returnAge = ageDiff - 1;
}
else
{
returnAge = ageDiff ;
}
}
}
else
{
returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天
}
}
return returnAge;//返回周岁年龄
},
zhanchuangTips: function (b){
let age = this.jsGetAge(b)
this.ppAge = age
if (age == -1) {
this.$message.error('出生日期'+ b +'有误')
this.addMsg.Birthday = ''
return
}
},
getJingDIan: function (){ getJingDIan: function (){
this.apipost( this.apipost(
"sellorder_post_GetGuestScenicRefundList", "sellorder_post_GetGuestScenicRefundList",
...@@ -1585,25 +1643,35 @@ ...@@ -1585,25 +1643,35 @@
if (this.addMsg.Marriage == "") { if (this.addMsg.Marriage == "") {
this.addMsg.Marriage = "0"; this.addMsg.Marriage = "0";
} }
this.apipost( if(this.ppAge <= 10 && this.addMsg.IsBed == 1) {
"sellorder_post_SetTravelGuestInfo_V2", this.$confirm(this.$t('确认占床?'), this.$t('tips.tips'), {
this.addMsg, confirmButtonText: '确认',
res => { cancelButtonText: '取消',
if (res.data.resultCode == 1) { type: 'warning'
this.$message.success(res.data.message); }).then(() => {
if (type == 1) { this.apipost(
history.go(-1); "sellorder_post_SetTravelGuestInfo_V2",
} else { this.addMsg,
this.btnState = true res => {
this.ClearData(); if (res.data.resultCode == 1) {
} this.$message.success(res.data.message);
} else { if (type == 1) {
history.go(-1);
} else {
this.btnState = true
this.ClearData();
}
} else {
this.btnState = true
this.$message.error(res.data.message);
}
},
err => {}
);
}).catch(() => {
this.btnState = true this.btnState = true
this.$message.error(res.data.message); });
} }
},
err => {}
);
}, },
getEconomicCapability() { getEconomicCapability() {
//获取经济能力 //获取经济能力
......
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