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,6 +1643,12 @@ ...@@ -1585,6 +1643,12 @@
if (this.addMsg.Marriage == "") { if (this.addMsg.Marriage == "") {
this.addMsg.Marriage = "0"; this.addMsg.Marriage = "0";
} }
if(this.ppAge <= 10 && this.addMsg.IsBed == 1) {
this.$confirm(this.$t('确认占床?'), this.$t('tips.tips'), {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.apipost( this.apipost(
"sellorder_post_SetTravelGuestInfo_V2", "sellorder_post_SetTravelGuestInfo_V2",
this.addMsg, this.addMsg,
...@@ -1604,6 +1668,10 @@ ...@@ -1604,6 +1668,10 @@
}, },
err => {} err => {}
); );
}).catch(() => {
this.btnState = true
});
}
}, },
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