Commit 1f8be486 authored by 黄奎's avatar 黄奎

第三方酒店计算

parent a1443e8d
...@@ -414,8 +414,18 @@ var commonUtils = { ...@@ -414,8 +414,18 @@ var commonUtils = {
} }
myDate = myDate.setDate(myDate.getDate() + day); myDate = myDate.setDate(myDate.getDate() + day);
myDate = new Date(myDate); myDate = new Date(myDate);
//返回年月日 var seperator1 = "-";
return myDate.getFullYear() + '-' + parseInt(myDate.getMonth() + 1) + "-" + myDate.getDate() var year = myDate.getFullYear();
var month = myDate.getMonth() + 1;
var strDate = myDate.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + seperator1 + month + seperator1 + strDate;
return currentdate;
} }
} }
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
</table> </table>
</div> </div>
<div> <div>
<el-tabs type="border-card" v-loading="loading" v-if="IsShow"> <el-tabs type="border-card" v-loading="loading" v-if="qHotelType==1">
<el-tab-pane :label="item.ProvinceName" v-for="(item,index) in dataList" :key="item.subCode"> <el-tab-pane :label="item.ProvinceName" v-for="(item,index) in dataList" :key="item.subCode">
<div class="clearfix comCheckHotelV2"> <div class="clearfix comCheckHotelV2">
<div class="comCk_list" v-for="(subItem,subIndex) in item.HotelList"> <div class="comCk_list" v-for="(subItem,subIndex) in item.HotelList">
...@@ -124,6 +124,36 @@ ...@@ -124,6 +124,36 @@
</div> </div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<template v-else>
<table v-loading="loading" >
<thead>
<tr>
<th>选择</th>
<th>酒店名称</th>
<th>价格</th>
</tr>
</thead>
<tbody>
<tr v-for="item in ThirdHotelList">
<td width="50">
<input :id="item.hotelId" type="checkbox" />
</td>
<td width="150">{{item.hotelName}}</td>
<td width="150">{{item.lowrateTotal}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">
<el-pagination v-if="thirdHotelMsg.numberOfResultMatched>0" background @current-change="handleCurrentChange"
:current-page.sync="thirdHotelMsg.displayFrom" :page-size="thirdHotelMsg.numberOfResults"
layout="total,prev, pager, next, jumper" :total="thirdHotelMsg.numberOfResultMatched">
</el-pagination>
</td>
</tr>
</tfoot>
</table>
</template>
</div> </div>
<input type="button" class="normalBtn com_SaveBtn" @click="sendCkedHotel()" value="保存" /> <input type="button" class="normalBtn com_SaveBtn" @click="sendCkedHotel()" value="保存" />
</div> </div>
...@@ -142,6 +172,34 @@ ...@@ -142,6 +172,34 @@
Name: "", //酒店名称 Name: "", //酒店名称
UseDate: "", //入住时间 UseDate: "", //入住时间
}, },
thirdHotelMsg: {
displayFrom: 1, //当前页
numberOfResults: 5, //每页条数
numberOfResultMatched: 0, //总条数
arrivalDate: "", //入住时间
departureDate: "", //离店时间
//房间信息列表
searchroomGroup: [{
numberOfAdults: 1, //大人数,
numberOfChildren: 0, //儿童数
childAges: 0, //儿童年龄
roomNum: 1, //房间数
}],
searchHotelIdList: [], //酒店id,[1,2,3]
freeword: "", //关键字
//类型 1,地区,2-酒店名称
freewordType: 0,
reviewRatingUpperLimits: 0, //指定评论分数的上限
reviewRatingLowerLimits: 0, //指定评论分数的下限
searchHotelCategory: [], //酒店分类
searchHotelFeatures: [], //酒店的特征
searchRoomType: [], //类型的房间
searchMealType: [], //饮食条件搜索
searchMinRate: 0, //検索最小金額,
searchMinRate: 0, //検索最大金額
sort: 0, //排序
},
ThirdHotelList: [], //第三方酒店列表
IsShow: false, IsShow: false,
ckedHotel: {} ckedHotel: {}
}; };
...@@ -152,88 +210,88 @@ ...@@ -152,88 +210,88 @@
this.IsShow = false; this.IsShow = false;
this.dataList = []; this.dataList = [];
this.HotelList = []; this.HotelList = [];
this.ThirdHotelList=[];
//地接酒店 //地接酒店
if (this.qHotelType == 1) { if (this.qHotelType == 1) {
this.apipost('hotel_post_GetHasStockHotelList_V2', { this.GetDMCHotelList();
//1-只查询有库存的酒店
IsMoreThanZero: 0,
Country: "651",
IsAllHotel: 1,
Province: this.qMsg.ProvinceId,
Name: this.qMsg.Name,
sDate: this.qMsg.UseDate
}, res => {
this.loading = false;
this.IsShow = true;
if (res.data.resultCode == 1) {
this.dataList = res.data.data;
this.dataList.forEach(x => {
x.HotelList.forEach(y => {
y.isChecked = false;
})
})
} else {
this.Error(res.data.message)
}
}, err => {})
} }
//第三方酒店 //第三方酒店
else { else {
var nQMsg = { this.GetThirdHotelList();
displayFrom: "1", //当前页 }
numberOfResults: "10", //每页条数 },
arrivalDate: this.qMsg.UseDate, //入住时间 //查询地接酒店
departureDate: "", //离店时间 GetDMCHotelList() {
//房间信息列表 this.apipost('hotel_post_GetHasStockHotelList_V2', {
searchroomGroup: { //1-只查询有库存的酒店
numberOfAdults: 2, //大人数, IsMoreThanZero: 0,
numberOfChildren: 0, //儿童数 Country: "651",
childAges: 0, //儿童年龄 IsAllHotel: 1,
}, Province: this.qMsg.ProvinceId,
searchHotelIdList:[],//酒店id,[1,2,3] Name: this.qMsg.Name,
freeword:this.qMsg.Name,//关键字 sDate: this.qMsg.UseDate
//类型 1,地区,2-酒店名称 }, res => {
freewordType:0, this.loading = false;
reviewRatingUpperLimits:0,//指定评论分数的上限 this.IsShow = true;
reviewRatingLowerLimits:0,//指定评论分数的下限 if (res.data.resultCode == 1) {
searchHotelCategory:[],//酒店分类 this.dataList = res.data.data;
searchHotelFeatures:[],//酒店的特征 this.dataList.forEach(x => {
searchRoomType:[],//类型的房间 x.HotelList.forEach(y => {
searchMealType:[],//饮食条件搜索 y.isChecked = false;
searchMinRate:0,//検索最小金額, })
searchMinRate:100000,//検索最大金額 })
sort:0,//排序 } else {
}; this.Error(res.data.message)
if(nQMsg.arrivalDate=="")
{
this.Info("请选择入住时间!");
return;
}
else
{
nQMsg.departureDate=this.$commonUtils.AddDay(nQMsg.arrivalDate,1);
}
if(nQMsg.freeword!="")
{
nQMsg.freewordType=1;
}
else
{
nQMsg.freewordType=2;
nQMsg.freeword="";
} }
console.log("nQMsg",nQMsg); }, err => {})
//多了一个参数调用线上的就酒店数据 },
this.apipost('dmc_post_Get_GetJAPAN_HotelList', nQMsg, res => { //查询第三方酒店
this.loading = false; GetThirdHotelList() {
this.IsShow = true; this.thirdHotelMsg.arrivalDate=this.qMsg.UseDate;
if (res.data.resultCode == 1) { if (this.thirdHotelMsg.arrivalDate == "") {
console.log("res.data",res.data); this.Info("请选择入住时间!");
return;
} else {
this.thirdHotelMsg.departureDate = this.$commonUtils.AddDay(this.thirdHotelMsg.arrivalDate, 1);
}
this.thirdHotelMsg.freeword=this.qMsg.Name;
if (this.thirdHotelMsg.freeword == "") {
this.thirdHotelMsg.freewordType = 1;
if (this.qMsg.ProvinceId > 0) {
//获取当前选中的对象
let obj = {};
obj = this.ProvinceList.find(item => {
return item.ID === this.qMsg.ProvinceId; //筛选出匹配数据
});
if (obj != undefined) {
this.thirdHotelMsg.freeword = obj.Name;
} else { } else {
this.Error(res.data.message) this.thirdHotelMsg.freeword = this.ProvinceList[0].Name;
} }
}, err => {},true) } else {
this.thirdHotelMsg.freeword = this.ProvinceList[0].Name;
}
} else {
this.thirdHotelMsg.freewordType = 2;
this.thirdHotelMsg.freeword = this.qMsg.Name;
} }
//多了一个参数调用线上的就酒店数据
this.apipost('dmc_post_Get_GetJAPAN_HotelList', this.thirdHotelMsg, res => {
this.loading = false;
this.IsShow = true;
if (res.data.resultCode == 1) {
//总条数
this.thirdHotelMsg.numberOfResultMatched = Number(res.data.data.numberOfResultMatched);
this.ThirdHotelList = res.data.data.hotelSummary;
} else {
this.Error(res.data.message)
}
}, err => {}, true)
},
handleCurrentChange(val) {
this.thirdHotelMsg.displayFrom = val;
this.GetThirdHotelList();
}, },
getCheck(hotelList, index) { getCheck(hotelList, index) {
hotelList.forEach((x, subIndex) => { hotelList.forEach((x, subIndex) => {
......
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