Commit d5bf8476 authored by 黄奎's avatar 黄奎

页面修改

parent 851b4aca
...@@ -116,10 +116,19 @@ ...@@ -116,10 +116,19 @@
<td v-if="childIndex==0" :rowspan="5"> <td v-if="childIndex==0" :rowspan="5">
<table class="hotelTable"> <table class="hotelTable">
<tr> <tr>
<td width="70" style="text-align:right;">酒店</td> <td width="70" style="text-align:center;" colspan="2">
<td> <span style="color:red">{{subItem.NewHotelName}}</span>
<!--:disabled="subItem.OPState==1"--> <el-popover placement="right" width="500" trigger="click" v-model="subItem.isShowPop">
<el-select class='w120 sel' v-model='subItem.NewHotelId' filterable <comCheckHotel :ref="'comCheckHotel'+index+subIndex+''" v-on:childHotel="childHotelList" :UseDate="item.UseTimeStr">
</comCheckHotel>
<el-button size="small" type="danger" :data-index="'comCheckHotel'+index+subIndex+''"
slot="reference" style="cursor:pointer;"
@click="getChildHotel(index,subIndex),subItem.isShowPop=true">
酒店选择
</el-button>
</el-popover>
<!-- <el-select class='w120 sel' v-model='subItem.NewHotelId' filterable
:placeholder="$t('pub.pleaseSel')" @visible-change='getHotelList(subItem)' :placeholder="$t('pub.pleaseSel')" @visible-change='getHotelList(subItem)'
@change='sendValue(subItem)'> @change='sendValue(subItem)'>
<el-option v-for='itemHotel in subItem.hotelList' :label='itemHotel.Name' :value='itemHotel.ID' <el-option v-for='itemHotel in subItem.hotelList' :label='itemHotel.Name' :value='itemHotel.ID'
...@@ -127,14 +136,14 @@ ...@@ -127,14 +136,14 @@
<span style="float: left">{{itemHotel.Name}}</span> <span style="float: left">{{itemHotel.Name}}</span>
<span style="float: right; color:red; font-size: 13px">{{itemHotel.Inventory }}</span> <span style="float: right; color:red; font-size: 13px">{{itemHotel.Inventory }}</span>
</el-option> </el-option>
</el-select> </el-select> -->
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" style="height:5px;"></td> <td colspan="2" style="height:5px;"></td>
</tr> </tr>
<tr> <tr>
<td width="70" style="text-align:right;"> <td width="70" style="text-align:right;">
供应商 供应商
</td> </td>
<td> <td>
...@@ -282,7 +291,7 @@ ...@@ -282,7 +291,7 @@
<el-tooltip class="item" effect="dark" content="新增" placement="top-start"> <el-tooltip class="item" effect="dark" content="新增" placement="top-start">
<el-button @click='AddHotel(item,subIndex)' icon="iconfont icon-tianjia" type="primary"></el-button> <el-button @click='AddHotel(item,subIndex)' icon="iconfont icon-tianjia" type="primary"></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip v-if="item.HotelOrderList.length>1||index==0" class="item" effect="dark" content="删除" <el-tooltip v-if="item.HotelOrderList.length>1" class="item" effect="dark" content="删除"
placement="top-start"> placement="top-start">
<el-button type="primary" icon="iconfont icon-shanchu" @click='DeleteHotel(item,subIndex)'> <el-button type="primary" icon="iconfont icon-shanchu" @click='DeleteHotel(item,subIndex)'>
</el-button> </el-button>
...@@ -300,6 +309,7 @@ ...@@ -300,6 +309,7 @@
</div> </div>
</template> </template>
<script> <script>
import comCheckHotel from "../commonPage/comCheckHotel.vue";
export default { export default {
data() { data() {
return { return {
...@@ -327,9 +337,36 @@ ...@@ -327,9 +337,36 @@
IsOperation: '', IsOperation: '',
//供应商列表 //供应商列表
SupplierList: [], SupplierList: [],
ckedHotelId: 0,
ckedHotelName: '',
showHotelList: false,
findex: 0,
childIndex: 0,
} }
}, },
components: {
comCheckHotel
},
methods: { methods: {
childHotelList(ckedObj) {
this.list.forEach(x => {
x.HotelOrderList.forEach(y => {
y.isShowPop = false;
})
})
this.list[this.findex].HotelOrderList[this.childIndex].Address = ckedObj.Address;
this.list[this.findex].HotelOrderList[this.childIndex].NewHotelName = ckedObj.Name;
this.list[this.findex].HotelOrderList[this.childIndex].Tel = ckedObj.Tel;
this.list[this.findex].HotelOrderList[this.childIndex].NewHotelId = ckedObj.ID;
this.list[this.findex].HotelOrderList[this.childIndex].PayStyle = ckedObj.PayStyle;
this.list[this.findex].HotelOrderList[this.childIndex].PayStyleExt = ckedObj.PayStyle;
},
getChildHotel(index, subIndex) {
this.findex = index;
this.childIndex = subIndex;
let str = `comCheckHotel${index}${subIndex}`
this.$refs[str][0].getCheckHotel();
},
getItem(index, subIndex) { getItem(index, subIndex) {
this.checkedIndex = index this.checkedIndex = index
this.checkedsubIndex = subIndex this.checkedsubIndex = subIndex
...@@ -465,6 +502,8 @@ ...@@ -465,6 +502,8 @@
if (subItem.ReserveNo == '' || subItem.ReserveNo == null) { if (subItem.ReserveNo == '' || subItem.ReserveNo == null) {
subItem.ReserveNo = this.$route.query.NewCombinationNum; subItem.ReserveNo = this.$route.query.NewCombinationNum;
} }
subItem.isShowPop = false;
subItem.ckedHotelName = "";
}) })
}); });
this.list = list; this.list = list;
......
<style> <style>
.comCheckHotel{
padding-bottom:20px; .comCheckHotel>div {
border-bottom:1px solid #d1d1d1; width: 100%;
} height: 150px;
.comCheckHotel>div{ overflow: auto
width:100%; }
height:200px;
overflow: auto .comCk_list {
} cursor: pointer;
.comCk_list{ padding: 0 20px;
cursor: pointer; margin: 0 15px 5px 0;
padding:0 20px; }
margin:0 15px 5px 0;
} .cm_Inventory {
.cm_Inventory{ margin-left: 20px;
margin-left:20px; color: red;
color:red; display: inline-block;
display: inline-block; }
}
.cm_hotelTitle{ .cm_hotelTitle {
width:100%; width: 100%;
text-align: center; text-align: center;
margin-bottom:20px; margin-bottom: 20px;
border-bottom: 1px solid #d1d1d1; border-bottom: 1px solid #d1d1d1;
padding:0 20px 10px 20px; padding: 0 20px 10px 20px;
} }
.com_SaveBtn{
margin:10px 20px 0 45%; .com_SaveBtn {
} margin: 10px 20px 0 45%;
.ckedList{ }
background-color: #E95252;
color:#fff; .ckedList {
} background-color: #E95252;
color: #fff;
}
.Ck_hotelInfo{
width:100%;
height:40px;
background-color: #F6F8FB;
text-align: center;
line-height: 40px;
margin-bottom:10px;
}
</style> </style>
<template> <template>
<div>
<div class="Ck_hotelInfo">
<span style="color:red">{{UseDate}}</span> 酒店库存信息
</div>
<div class="cm_hotelTitle">
地区筛选:
<el-select filterable v-model="ProvinceId" @change="getCheckHotel()" :placeholder="$t('pub.pleaseSel')">
<el-option label="不限" :value='0'></el-option>
<el-option v-for="item in ProvinceList" :label='item.Name' :value='item.ID' :key='item.ID'>
</el-option>
</el-select>
</div>
<div> <div>
<div class="cm_hotelTitle"> <el-tabs type="border-card" v-loading="loading">
<el-select filterable v-model="selHotelId" @change="getChangeHotel(selHotelId)" :placeholder="$t('pub.pleaseSel')"> <el-tab-pane :label="item.ProvinceName" v-for="(item,index) in dataList" >
<el-option label="不限" :value='0'></el-option> <div class="clearfix comCheckHotel">
<el-option v-for="item in ProvinceList" :label='item.Name' :value='item.ID'
:key='item.ID'>
</el-option>
</el-select>
酒店信息
</div>
<div>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane :label="item.ProvinceName" v-for="item in dataList"></el-tab-pane>
</el-tabs>
</div>
<div class="clearfix comCheckHotel">
<div> <div>
<div class="comCk_list" v-for="(item,index) in HotelList"> <div class="comCk_list" v-for="(subItem,subIndex) in item.HotelList">
<input type="checkbox" v-model="item.isChecked" @click="getCheck(item,index)" style=""/> <input type="checkbox" v-model="subItem.isChecked" @click="getCheck(item.HotelList,subIndex)"
{{item.Name}}<span class="cm_Inventory">{{item.Inventory}}</span> style="" />
</div> {{subItem.Name}}<span class="cm_Inventory">{{subItem.Inventory}}</span>
</div>
</div> </div>
</div> </div>
<input type="button" class="normalBtn com_SaveBtn" @click="sendCkedHotel()" value="保存"/> </el-tab-pane>
</el-tabs>
</div> </div>
<input type="button" class="normalBtn com_SaveBtn" @click="sendCkedHotel()" value="保存" />
</div>
</template> </template>
<script> <script>
export default { export default {
data() { props: ["UseDate"],
return { data() {
dataList:[], return {
HotelList:[], loading:false,
ckindexOne:-1, dataList: [],
ckindexTwo:-1, ProvinceList: [],
ID:0, ProvinceId: 0, //选择个省份编号
HotelName:'', };
ProvinceList:[], },
selHotelId:0, methods: {
activeName:'', getCheckHotel() {
this.loading=true;
}; this.dataList = [];
}, this.HotelList = [];
methods: {
getCheckHotel(sDate){
this.apipost('hotel_post_GetHasStockHotelList_V2', { this.apipost('hotel_post_GetHasStockHotelList_V2', {
//1-只查询有库存的酒店 //1-只查询有库存的酒店
IsMoreThanZero: 0, IsMoreThanZero: 0,
Country: "651", Country: "651",
IsAllHotel: 1, IsAllHotel: 1,
sDate: sDate Province: this.ProvinceId,
sDate: this.UseDate
}, res => { }, res => {
if (res.data.resultCode == 1) { this.loading=false;
this.dataList = res.data.data; if (res.data.resultCode == 1) {
this.dataList.forEach(x=>{ this.dataList = res.data.data;
x.HotelList.forEach(y=>{ this.dataList.forEach(x => {
y.isChecked=false; x.HotelList.forEach(y => {
}) y.isChecked = false;
})
}) })
console.log(this.dataList,'datalist');
} else { } else {
this.Error(res.data.message) this.Error(res.data.message)
} }
}, err => {}) }, err => {})
}, },
getCheck(item,index){ getCheck(hotelList, index) {
this.HotelList.forEach((x,subIndex)=>{ hotelList.forEach((x, subIndex) => {
if(index==subIndex){ if (index == subIndex) {
x.isChecked = !x.isChecked; x.isChecked = !x.isChecked;
}else{ } else {
x.isChecked = false; x.isChecked = false;
} }
}) })
this.$forceUpdate(); this.$forceUpdate();
}, },
//向父组件传递选中酒店 //向父组件传递选中酒店
sendCkedHotel(){ sendCkedHotel() {
var ckHotelObj = {}; var ckHotelObj = {};
this.HotelList.forEach((x,index)=>{ this.dataList.forEach((x, index) => {
if(x.isChecked){ x.HotelList.forEach(subItem => {
ckHotelObj.ID = x.ID; if (subItem.isChecked) {
ckHotelObj.Address = x.Address; ckHotelObj.ID = subItem.ID;
ckHotelObj.Inventory = x.Inventory; ckHotelObj.Address = subItem.Address;
ckHotelObj.Name = x.Name; ckHotelObj.Inventory = subItem.Inventory;
ckHotelObj.PayStyle = x.PayStyle; ckHotelObj.Name = subItem.Name;
ckHotelObj.Tel = x.Tel; ckHotelObj.PayStyle = subItem.PayStyle;
ckHotelObj.Tel = subItem.Tel;
} }
});
}) })
this.$emit("childHotel", ckHotelObj); this.$emit("childHotel", ckHotelObj);
}, },
//获取日本下面的市->下拉框用 //获取日本下面的市->下拉框用
getProvinceList(){ getProvinceList() {
let msg = { let msg = {
Id:651 Id: 651
}; };
this.apipost("dict_post_Destination_GetChildList", msg,res => { this.apipost("dict_post_Destination_GetChildList", msg, res => {
if(res.data.resultCode == 1){ if (res.data.resultCode == 1) {
this.ProvinceList = res.data.data; this.ProvinceList = res.data.data;
}else{ } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
}, },
err => {} err => {}
); );
}, },
getChangeHotel(id){ },
let msg = { mounted() {
Province:id this.getProvinceList();
} }
this.apipost( };
"hotel_post_GetHasStockHotelList_V2",msg,res => {
if(res.data.resultCode==1){
this.dataList = res.data.data;
this.HotelList = [];
this.dataList.forEach(x=>{
x.HotelList.forEach(y=>{
y.isChecked=false;
})
})
console.log(this.dataList,'dataList');
}else{
this.Error(res.data.message);
}
},
err => {}
);
},
handleClick() {
this.HotelList = this.dataList[this.activeName].HotelList;
}
},
mounted() {
}
};
</script> </script>
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