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,8 +210,18 @@ ...@@ -152,8 +210,18 @@
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.GetDMCHotelList();
}
//第三方酒店
else {
this.GetThirdHotelList();
}
},
//查询地接酒店
GetDMCHotelList() {
this.apipost('hotel_post_GetHasStockHotelList_V2', { this.apipost('hotel_post_GetHasStockHotelList_V2', {
//1-只查询有库存的酒店 //1-只查询有库存的酒店
IsMoreThanZero: 0, IsMoreThanZero: 0,
...@@ -176,64 +244,54 @@ ...@@ -176,64 +244,54 @@
this.Error(res.data.message) this.Error(res.data.message)
} }
}, err => {}) }, err => {})
}
//第三方酒店
else {
var nQMsg = {
displayFrom: "1", //当前页
numberOfResults: "10", //每页条数
arrivalDate: this.qMsg.UseDate, //入住时间
departureDate: "", //离店时间
//房间信息列表
searchroomGroup: {
numberOfAdults: 2, //大人数,
numberOfChildren: 0, //儿童数
childAges: 0, //儿童年龄
}, },
searchHotelIdList:[],//酒店id,[1,2,3] //查询第三方酒店
freeword:this.qMsg.Name,//关键字 GetThirdHotelList() {
//类型 1,地区,2-酒店名称 this.thirdHotelMsg.arrivalDate=this.qMsg.UseDate;
freewordType:0, if (this.thirdHotelMsg.arrivalDate == "") {
reviewRatingUpperLimits:0,//指定评论分数的上限
reviewRatingLowerLimits:0,//指定评论分数的下限
searchHotelCategory:[],//酒店分类
searchHotelFeatures:[],//酒店的特征
searchRoomType:[],//类型的房间
searchMealType:[],//饮食条件搜索
searchMinRate:0,//検索最小金額,
searchMinRate:100000,//検索最大金額
sort:0,//排序
};
if(nQMsg.arrivalDate=="")
{
this.Info("请选择入住时间!"); this.Info("请选择入住时间!");
return; return;
} else {
this.thirdHotelMsg.departureDate = this.$commonUtils.AddDay(this.thirdHotelMsg.arrivalDate, 1);
} }
else this.thirdHotelMsg.freeword=this.qMsg.Name;
{ if (this.thirdHotelMsg.freeword == "") {
nQMsg.departureDate=this.$commonUtils.AddDay(nQMsg.arrivalDate,1); 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 {
this.thirdHotelMsg.freeword = this.ProvinceList[0].Name;
} }
if(nQMsg.freeword!="") } else {
{ this.thirdHotelMsg.freeword = this.ProvinceList[0].Name;
nQMsg.freewordType=1;
} }
else } else {
{ this.thirdHotelMsg.freewordType = 2;
nQMsg.freewordType=2; this.thirdHotelMsg.freeword = this.qMsg.Name;
nQMsg.freeword="";
} }
console.log("nQMsg",nQMsg);
//多了一个参数调用线上的就酒店数据 //多了一个参数调用线上的就酒店数据
this.apipost('dmc_post_Get_GetJAPAN_HotelList', nQMsg, res => { this.apipost('dmc_post_Get_GetJAPAN_HotelList', this.thirdHotelMsg, res => {
this.loading = false; this.loading = false;
this.IsShow = true; this.IsShow = true;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
console.log("res.data",res.data); //总条数
this.thirdHotelMsg.numberOfResultMatched = Number(res.data.data.numberOfResultMatched);
this.ThirdHotelList = res.data.data.hotelSummary;
} else { } else {
this.Error(res.data.message) this.Error(res.data.message)
} }
}, err => {},true) }, 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