Commit 2442d7bc authored by zhengke's avatar zhengke

修改

parent 94816e4c
......@@ -2,51 +2,98 @@
<div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="酒店" name="first">酒店</el-tab-pane>
<el-tab-pane label="餐食" name="second">餐食</el-tab-pane>
<el-tab-pane label="门票" name="third">门票</el-tab-pane>
<el-tab-pane label="酒店" name="1"></el-tab-pane>
<el-tab-pane label="餐食" name="2"></el-tab-pane>
<el-tab-pane label="门票" name="3"></el-tab-pane>
</el-tabs>
<template>
</template>
<el-input size="mini" v-model="msg.Name" placeholder="根据名称搜索" :clearable="true"
@clear="msg.pageIndex=1,getHotelPage()" @keyup.enter.native="msg.pageIndex=1,getHotelPage()">
<el-button slot="append" @click="msg.pageIndex=1,getHotelPage()">搜索</el-button>
@clear="msg.pageIndex=1,getCommonSerch()" @keyup.enter.native="msg.pageIndex=1,getCommonSerch()">
<el-button slot="append" @click="msg.pageIndex=1,getCommonSerch()">搜索</el-button>
</el-input>
<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" height="450" style="width: 100%"
@selection-change="handleSelectionChange">
<template v-if="isSingle">
<el-table-column width="50px" label="">
<template v-if="activeName=='1'">
<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" height="450" style="width: 100%"
@selection-change="handleSelectionChange">
<template v-if="isSingle">
<el-table-column width="50px" label="">
<template slot-scope="scope">
<el-radio v-model="scope.row.IsChecked" @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp;
</el-radio>
</template>
</el-table-column>
</template>
<template v-else>
<el-table-column type="selection" width="50px">
</el-table-column>
</template>
<el-table-column label="ID" width="80px">
<template slot-scope="scope">{{ scope.row.HotelId }}</template>
</el-table-column>
<el-table-column prop="HotelName" label="名称">
<template slot-scope="scope">
<el-radio v-model="scope.row.IsChecked" @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp;
</el-radio>
<div flex="cross:center dir:left">
<img style="width:50px;height:50px;margin-right:10px;" :src="scope.row.CoverImg" />
<div>{{ scope.row.HotelName }}</div>
</div>
</template>
</el-table-column>
</template>
<template v-else>
<el-table-column type="selection" width="50px">
</el-table>
</template>
<template v-if="activeName=='2'">
<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" height="450" style="width: 100%"
@selection-change="handleSelectionChange2">
<template v-if="isSingle">
<el-table-column width="50px" label="">
<template slot-scope="scope">
<el-radio v-model="scope.row.IsChecked" @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp;
</el-radio>
</template>
</el-table-column>
</template>
<template v-else>
<el-table-column type="selection" width="50px">
</el-table-column>
</template>
<el-table-column label="ID" width="80px">
<template slot-scope="scope">{{ scope.row.ID }}</template>
</el-table-column>
</template>
<el-table-column label="ID" width="80px">
<template slot-scope="scope">{{ scope.row.HotelId }}</template>
</el-table-column>
<!-- <el-table-column prop="CategoryList" label="分类" width="150px">
<template slot-scope="scope">
<div v-for="(subItem,SubIndex) in scope.row.CategoryList" :key="SubIndex">
{{subItem.CategoryName}}
</div>
<el-table-column prop="HotelName" label="名称">
<template slot-scope="scope">
<div flex="cross:center dir:left">
<img style="width:50px;height:50px;margin-right:10px;" :src="scope.row.CoverImg" />
<div>{{ scope.row.Name }}</div>
</div>
</template>
</el-table-column>
</el-table>
</template>
<template v-if="activeName=='3'">
<el-table ref="multipleTable" :data="dataList" tooltip-effect="dark" height="450" style="width: 100%"
@selection-change="handleSelectionChange3">
<template v-if="isSingle">
<el-table-column width="50px" label="">
<template slot-scope="scope">
<el-radio v-model="scope.row.IsChecked" @change.native="getTemplateRow(scope.$index,scope.row)">&nbsp;
</el-radio>
</template>
</el-table-column>
</template>
</el-table-column> -->
<el-table-column prop="HotelName" label="名称">
<template slot-scope="scope">
<div flex="cross:center dir:left">
<img style="width:50px;height:50px;margin-right:10px;" :src="scope.row.CoverImg" />
<div>{{ scope.row.HotelName }}</div>
</div>
<template v-else>
<el-table-column type="selection" width="50px">
</el-table-column>
</template>
</el-table-column>
</el-table>
<el-table-column label="ID" width="80px">
<template slot-scope="scope">{{ scope.row.ID }}</template>
</el-table-column>
<el-table-column prop="HotelName" label="名称">
<template slot-scope="scope">
<div flex="cross:center dir:left">
<img style="width:50px;height:50px;margin-right:10px;" :src="scope.row.CoverImg" />
<div>{{ scope.row.Name }}</div>
</div>
</template>
</el-table-column>
</el-table>
</template>
<el-pagination style="text-align:center" background @current-change="handleCurrentChange" :page-size="msg.pageSize"
layout="prev, pager, next" :total="total">
</el-pagination>
......@@ -65,9 +112,12 @@
GoodsStatus: 1, //上架中
IsGetSpec: 0
},
activeName: "first",
activeName: "1",
total: 0,
selectRow: [],
selectRow:[],
selectRow1: [],
selectRow2:[],
selectRow3:[],
};
},
created() {
......@@ -77,7 +127,29 @@
},
methods: {
handleClick() {
this.msg.Name='';
this.msg.pageIndex = 1;
if (this.activeName == '1') {
this.getHotelPage();
}
if (this.activeName == '2') {
this.getDinnerPage();
}
if (this.activeName == '3'){
this.getTicket();
}
},
//搜索
getCommonSerch() {
if (this.activeName == '1') {
this.getHotelPage();
}
if (this.activeName == '2') {
this.getDinnerPage();
}
if (this.activeName == '3'){
this.getTicket();
}
},
//获取酒店分页
getHotelPage() {
......@@ -92,16 +164,39 @@
}
this.dataList = JSON.parse(JSON.stringify(tempArray));
} else {
this.Info(res.data.message);
this.Error(res.data.message);
}
})
},
handleSelectionChange(val) {
this.selectRow = JSON.parse(JSON.stringify(val));
this.selectRow1 = JSON.parse(JSON.stringify(val));
},
handleSelectionChange2(val){
this.selectRow2 = JSON.parse(JSON.stringify(val));
},
handleSelectionChange3(val){
this.selectRow3 = JSON.parse(JSON.stringify(val));
},
//获取餐食分页
getDinnerPage() {
this.apipost("/api/AppletDining/DiningPage", this.msg, res => {
this.apipost("/api/AppletDining/GetDiningPage", this.msg, res => {
if (res.data.resultCode == 1) {
this.total = res.data.data.count;
var tempArray = res.data.data.pageData;
if (tempArray && tempArray.length > 0) {
tempArray.forEach(item => {
item.IsChecked = false;
});
}
this.dataList = JSON.parse(JSON.stringify(tempArray));
} else {
this.Error(res.data.message);
}
})
},
//获取门票分页
getTicket(){
this.apipost("/api/AppletDining/GetTicketCouponsPage", this.msg, res => {
if (res.data.resultCode == 1) {
this.total = res.data.data.count;
var tempArray = res.data.data.pageData;
......@@ -112,7 +207,7 @@
}
this.dataList = JSON.parse(JSON.stringify(tempArray));
} else {
this.Info(res.data.message);
this.Error(res.data.message);
}
})
},
......@@ -129,10 +224,12 @@
},
handleCurrentChange(val) {
this.msg.pageIndex = val;
this.getList();
this.getCommonSerch();
},
//父组件调用方法
getChoicedGoods() {
getChoicedDijie() {
this.selectRow=[];
this.selectRow = this.selectRow.concat(this.selectRow1).concat(this.selectRow2).concat(this.selectRow3) ;
return this.selectRow;
},
//清空多选方法
......@@ -147,7 +244,7 @@
},
},
mounted() {
this.getList();
this.getHotelPage();
}
};
......
......@@ -611,7 +611,7 @@
<choiceDmc ref="choiceDmc"></choiceDmc>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="isShowGoods=false">取 消</el-button>
<el-button size="small" type="danger" @click="getGoodsChoice()">确 定</el-button>
<el-button size="small" type="danger" @click="getChoicedDijie()">确 定</el-button>
</span>
</el-dialog>
</div>
......@@ -801,6 +801,41 @@
this.isShowGoods = false;
this.$refs.choiceGood.toggleSelection();
},
//选择地接服务
getChoicedDijie(){
var ckedArr = this.$refs.choiceDmc.getChoicedDijie();
console.log(ckedArr,'ckedArr');
var myArray = [];
if (ckedArr && ckedArr.length > 0) {
ckedArr.forEach(x => {
if(x.goodType==1){
myArray.push({
id: x.HotelId,
name: x.HotelName,
picUrl: x.CoverImg,
price: x.SalesPrice
});
}
if(x.goodType==2||x.goodType==3){
myArray.push({
id: x.ID,
name: x.Name,
picUrl: x.CoverImg,
price: x.SalesPrice
});
}
});
}
if (this.comIndex !== null) {
this.data.catList[this.comIndex].goodsList = this.data.catList[this.comIndex].goodsList.concat(myArray);
} else {
this.data.list = this.data.list.concat(myArray);
}
this.isShowGoods = false;
this.$refs.choiceDmc.toggleSelection();
},
//取消选择商品
quxiaoGoods() {
this.isShowGoods = false;
......
......@@ -745,6 +745,7 @@
Id: 'goods',
isCked: false,
data: {
goodType:1, //1酒店 2餐厅 3门票
showCat: false, //显示分类
catPosition: 'top', //分类栏位置
catStyle: 1, //分类样式
......
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