Commit f2fe7465 authored by zhengke's avatar zhengke

增加验证防止重复提交

parent dd531c1c
......@@ -340,6 +340,19 @@
margin-top: 20px;
border: 1px solid #E0E0E0;
}
.HotelSure .disClick {
background-color: #d1d1d1!important;
color: #fff!important;
background-image: none;
border: 1px solid #d1d1d1!important;
}
.HotelSure .disClick:hover {
background-color: #d1d1d1 !important;
cursor: default !important;
box-shadow: none !important;
}
</style>
......@@ -597,7 +610,7 @@
</ul>
</div>
</div>
<input type="button" class="HD_payBtn" :class="{'disBtn':isBaoChild}" @click="submitForm('sureMsg')" value="下单" />
<input type="button" class="HD_payBtn" :class="{'disBtn':isBaoChild,'disClick':!isSubmit}" @click="submitForm('sureMsg')" value="下单" />
</div>
<div class="HS_RightList">
<div class="HS_RightTopImg">
......@@ -704,6 +717,8 @@ export default {
roomOptionCd:'',
searchroomGroup:[]
},
//防止重复提交
isSubmit: true,
auditNum:0,
childNum:0,
//入住 周几
......@@ -1317,40 +1332,44 @@ export default {
if(this.sureMsg.CustomerId==null||this.sureMsg.CustomerId==""){
this.sureMsg.CustomerId=0
}
this.apipost("dmc_post_Get_GetJAPAN_HotelBooking",this.sureMsg,res => {
if (res.data.resultCode == 1) {
this.Success('预订成功');
let num =0;
this.sureMsg.roomGroup.forEach(x=>{
num+=parseInt(x.roomFemaleCount)+parseInt(x.roomMaleCount)+parseInt(x.roomChildCount)
})
let msg = {
RB_Branch_id:res.data.data.RB_Branch_id,
costType:res.data.data.costType,
orderId:res.data.data.orderId,
bookingNumber:res.data.data.parmResult.bookingNumber,
bookMoney:this.SettlementPrice,
CancelTime:res.data.data.CancelTime,
hotelName:res.data.data.parmResult.hotelName,
totalPnumber:num
}
sessionStorage.setItem("HotelPayMsg", JSON.stringify(msg));
this.$router.push({
path:"/HotelPayBefore",
})
} else {
var that = this
if(res.data.message=='Room rate(s) for 1 day(s) changed'){
that.Confirm("当前酒店价格已发生变化,需要重新加载?", function() {
that.getBookInfo();
});
}else{
that.Error(res.data.message);
if (this.isSubmit) {
this.isSubmit = false;
this.apipost("dmc_post_Get_GetJAPAN_HotelBooking",this.sureMsg,res => {
this.isSubmit = true;
if (res.data.resultCode == 1) {
this.Success('预订成功');
let num =0;
this.sureMsg.roomGroup.forEach(x=>{
num+=parseInt(x.roomFemaleCount)+parseInt(x.roomMaleCount)+parseInt(x.roomChildCount)
})
let msg = {
RB_Branch_id:res.data.data.RB_Branch_id,
costType:res.data.data.costType,
orderId:res.data.data.orderId,
bookingNumber:res.data.data.parmResult.bookingNumber,
bookMoney:this.SettlementPrice,
CancelTime:res.data.data.CancelTime,
hotelName:res.data.data.parmResult.hotelName,
totalPnumber:num
}
sessionStorage.setItem("HotelPayMsg", JSON.stringify(msg));
this.$router.push({
path:"/HotelPayBefore",
})
} else {
var that = this
if(res.data.message=='Room rate(s) for 1 day(s) changed'){
that.Confirm("当前酒店价格已发生变化,需要重新加载?", function() {
that.getBookInfo();
});
}else{
that.Error(res.data.message);
}
}
}
},
err => {}
);
},
err => {}
);
}
},
}
};
......
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