Commit 9cb0f9a2 authored by zhengke's avatar zhengke

修改

parent f2cbe176
......@@ -11,13 +11,32 @@
}
.delTrafic{
position: absolute;
right:0;
top:0;
right:165px;
top:-11px;
}
.Ghotel_baseinfo{
height: auto;
width: 100%;
}
.Gnhotel_Right{
float: left;
}
.InnerHotelDiv{
display: flex;
}
.InnerHoImgDiv{
width:100px;
height:100px;
margin-right:5px;
}
.InnerHoImgDiv img{
width:100%;
height:100%;
}
</style>
<template>
<div class="flexOne changInfo">
<div class="resource-content clearfix">
<div class="resource-content clearfix" style="min-height:550px;">
<el-form :model="addMsg" :rules="rules" ref="addMsg">
<el-tabs v-model="activeName">
<el-tab-pane label="基础资料" name="1"></el-tab-pane>
......@@ -25,8 +44,10 @@
<el-tab-pane label="规则设施" name="3"></el-tab-pane>
<el-tab-pane label="周边交通" name="4"></el-tab-pane>
</el-tabs>
<div class="resource-baseinfo">
<div class="Ghotel_baseinfo">
<template v-if="activeName==1">
<div>
<div style="float:left;width:600px;">
<el-form-item :label="$t('ground.jiudianmingzi')">
<el-input type="text" v-model="addMsg.HotelRealName" maxlength="100" class="w300"></el-input>
</el-form-item>
......@@ -91,7 +112,8 @@
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 新增标签</el-button>
</el-form-item>
<div class="resource-imginfo">
</div>
<div class="Gnhotel_Right">
<span class="resource-lititle">{{$t('hotel.hotel_imgintroduce')}}</span>
<div class="resource-list">
<div class="resource-imglist clearfix">
......@@ -115,41 +137,37 @@
<el-button type="primary" @click="isShowHotelImg=true" icon="el-icon-plus" circle></el-button>
</div>
</div>
<div>
<el-tabs>
<el-tab-pane v-for="(subItem,subIndex) in addMsg.InnerHotelImaList" :key="subIndex" :label="subItem.Label">
<div class="InnerHotelDiv">
<div class="InnerHoImgDiv" v-for="(sItem,sIndex) in subItem.ImgList" :key="sIndex">
<img :src="sItem.Path" />
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<template v-if="activeName==2">
<div class="jz_HotelName">{{addMsg.HotelRealName}}</div>
<el-row style="display:flex;justify-content:space-between;">
<el-col :span="12">
<el-form-item label="开业时间">
<el-input placeholder="开业时间" v-model="addMsg.HotelInfo.OpenTime"></el-input>
<el-input placeholder="开业时间" class="w300" v-model="addMsg.HotelInfo.OpenTime"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="装修时间">
<el-input placeholder="装修时间" v-model="addMsg.HotelInfo.DecorationTime"></el-input>
<el-input placeholder="装修时间" class="w300" v-model="addMsg.HotelInfo.DecorationTime"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="display:flex;justify-content:space-between;">
<el-col :span="12">
<el-form-item label="房间数量">
<el-input placeholder="房间数量" v-model="addMsg.RoomNumber"></el-input>
<el-input placeholder="房间数量" class="w300" v-model="addMsg.RoomNumber"></el-input>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="联系方式">
<el-input placeholder="联系方式" v-model="addMsg.Tel"></el-input>
<el-input placeholder="联系方式" class="w300" v-model="addMsg.Tel"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row style="display:flex;justify-content:space-between;">
<el-col :span="22">
<el-form-item label="酒店介绍">
<el-input type="textarea" v-model="addMsg.HotelInfo.Into" :rows="9"></el-input>
<el-input type="textarea" class="w300" v-model="addMsg.HotelInfo.Into" :rows="9"></el-input>
</el-form-item>
</el-col>
</el-row>
</template>
<template v-if="activeName==3">
<el-form-item label="公共服务设施">
......@@ -191,12 +209,14 @@
</template>
</template>
<template v-if="activeName==4">
<button class="save-Btn" style="float:right;" @click="addTraffic()">新增交通</button>
<div v-for="(item,index) in addMsg.TrafficInfo" :key="index" style="position:relative">
<el-button type="primary" @click="addTraffic()" style="float:right;margin:0 165px 50px 0" icon="el-icon-plus" circle></el-button>
<div style="margin-top:60px;">
<div v-for="(item,index) in addMsg.TrafficInfo" :key="index" style="position:relative;margin-bottom:20px;">
<el-input type="text" v-model="item.TTitle" class="w400" style="margin-bottom:10px;" placeholder="地点名称">
</el-input>
<el-input type="text" v-model="item.TSubTitle" class="w400" placeholder="地点介绍"></el-input>
<el-button type="danger" class="delTrafic" icon="el-icon-delete" circle></el-button>
<el-button type="danger" class="delTrafic" @click="delTraffic(index)" icon="el-icon-delete" circle></el-button>
</div>
</div>
</template>
</div>
......@@ -210,7 +230,7 @@
<tencentMap @map-submit="mapEvent" :address="addMsg.Address"></tencentMap>
</el-dialog>
<el-dialog title="酒店图片" :visible.sync="isShowHotelImg" width="1240px">
<comImgList :saveObj="HotelImgArr"></comImgList>
<comImgList :saveObj="HotelImgArr" @getHotelImg="getHotelImg"></comImgList>
</el-dialog>
<div class="btn-list">
<span class="common-lefttit"></span>
......@@ -368,6 +388,7 @@
serviceCked: [],
isShowHotelImg: false,
checkedRoom: [],
HotelActive:1, //
};
},
components: {
......@@ -376,6 +397,12 @@
comImgList: comImgList
},
methods: {
//获取子组件新增分类和图片
getHotelImg(data){
console.log(data,'datasss');
this.addMsg.InnerHotelImaList = data;
this.isShowHotelImg=false;
},
changeBooking(val) {
this.chooseObj.Bookings = [];
this.dropdownObj.BookingList.forEach(x => {
......@@ -394,6 +421,10 @@
}
this.addMsg.TrafficInfo.push(obj);
},
//删除交通
delTraffic(index){
this.addMsg.TrafficInfo.splice(index,1);
},
showInput() {
this.inputVisible = true;
this.$nextTick(_ => {
......@@ -452,7 +483,7 @@
this.addMsg.RoomFacilities = this.chooseObj.RoomFacilities.toString();
this.addMsg.ServiceItems = this.chooseObj.ServiceItems.toString();
this.addMsg.Bookings = this.chooseObj.Bookings;
this.addMsg.InnerHotelImaList = this.HotelImgArr;
// this.addMsg.InnerHotelImaList = this.HotelImgArr;
this.addMsg.ID = this.hotelID;
this.addMsg.Tags = this.TagsList.toString();
this.addMsg.HotelImageList = this.HotelImageArray;
......@@ -543,6 +574,16 @@
if (tempMsg.OpenPlatformList && tempMsg.OpenPlatformList.length > 0) {
this.chooseObj.openplatString = tempMsg.OpenPlatformList;
}
if(tempMsg.BookingList && tempMsg.BookingList.length>0){
this.checkedRoom = tempMsg.BookingList;
}
if(tempMsg.BookList && tempMsg.BookList.length>0){
this.chooseObj.Bookings = tempMsg.BookList;
}
if(tempMsg.InnerHotelImaList && tempMsg.InnerHotelImaList.length>0){
this.HotelImgArr = tempMsg.InnerHotelImaList;
this.addMsg.InnerHotelImaList = tempMsg.InnerHotelImaList;
}
} else {
_self.Error(res.data.message);
}
......@@ -671,7 +712,8 @@
this.dropdownObj.BookingList = sItem.SubList
}
});
console.log(this.dropdownObj,'dropdownObj');
console.log(tempData,'tempData');
}
});
}
......
<template>
<div class="ChooseImg">
<el-row style="border: 1px solid rgb(227, 227, 227);">
<el-col :span="6" style="border-right: 1px solid rgb(227, 227, 227);">
<el-button @click="addGroup" style="margin-top: 12px;margin-left: 5%;" type="primary" size="small">添加分组
</el-button>
<div class="el-scrollbar" style="height: 450px; width: 100%;">
<div class="el-scrollbar__wrap" style="margin-bottom: -8px; margin-right: -8px;">
<div class="el-scrollbar__view">
<li class="el-menu-item" style="padding-left: 10px;padding-right: 10px;">
<i class="el-icon-tickets"></i>
<span>全部</span>
</li>
<li class="el-menu-item" v-for="(item,index) in saveObj" :class="commonIndex==index?'selectActive' : ''" @click="getImgList(index,saveObj)" :key="index"
style="padding-left: 10px;padding-right: 10px;">
<div flex="dir:left box:last">
<el-col :span="18" style="overflow: hidden; text-overflow: ellipsis;">
<i class="el-icon-tickets"></i>
<span>{{item.label}}</span>
</el-col>
<el-col class="blue" :span="6">
<span @click="editGroup(index)">编辑</span>
| <span @click="delGroup(index)">删除</span>
</el-col>
</div>
</li>
</div>
</div>
</div>
</el-col>
<el-col :span="18">
<div class="basefix app-attachment-list">
<div class="app-attachment-item app-attachment-upload">
<el-upload class="avatar-uploader" action="" accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false" :http-request="UploadImage" multiple>
<div class="app-upload"
style="width: 100px; height: 100px;display:flex;align-items:center;justify-content:center;">
<i class="el-icon-upload"></i>
</div>
</el-upload>
</div>
<el-tooltip v-for="(item,index) in comImgArr" :key="index" class="item" effect="dark" placement="top-start">
<div class="el-tooltip item app-attachment-item">
<img :src="item" class="app-attachment-img" style="width: 100px; height: 100px;">
<div class="app-attachment-name">图片名字</div>
</div>
</el-tooltip>
</div>
<!-- <div style="padding-right:10px">
<el-pagination style="text-align:right" background :current-page="currentPage4"
@current-change="handleCurrentChange" :page-size="msg.pageSize" layout="prev, pager, next,jumper"
:total="total">
</el-pagination>
</div> -->
</el-col>
</el-row>
<div style="margin-top:20px;text-align:right">
<el-button size="small" type="primary" @click="SelectImgId()">选定</el-button>
</div>
<!-- 新增分组 -->
<el-dialog :modal="false" :modal-append-to-body='false' title="分组管理" :visible.sync="addGroupMsgDig" width="400px">
<el-form label-width="100px">
<el-form-item label="分组名称">
<el-input size="small" type="text" placeholder="请输入内容" v-model="GroupName" maxlength="8" show-word-limit>
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="addGroupMsgDig = false">取 消</el-button>
<el-button size="small" type="primary" @click="GroupCked()">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
//是否多选
props: {
saveObj: {
type: Array,
default: null
}
},
data() {
return {
GroupName: '', //分组名称
addGroupMsgDig: false,
pageMsgDig: false,
ImageArr: [], //显示数组
isAdd: 0, //添加标志
commonIndex:-1,
comImgArr:[],
}
},
created() {},
computed: {},
mounted() {
console.log(this.saveObj, 'saveObj');
},
methods: {
//新增分组
addGroup() {
this.isAdd = 0;
this.GroupName='';
this.addGroupMsgDig = true;
},
//确定分组
GroupCked() {
if (this.isAdd == 0) {
let obj = {
Id: 0,
label: this.GroupName,
imgArr: []
}
this.saveObj.push(obj);
}else{
this.saveObj[this.commonIndex].label = this.GroupName;
}
this.addGroupMsgDig = false;
},
//编辑分组
editGroup(index) {
this.isAdd = 1;
this.commonIndex = index;
this.GroupName = this.saveObj[index].label;
this.addGroupMsgDig = true;
},
//删除
delGroup(index){
this.saveObj.splice(index,1);
},
//点击获取图片arr
getImgList(index,obj){
this.commonIndex = index;
this.comImgArr =this.saveObj[index].imgArr;
},
//选定
SelectImgId() {
console.log('1111');
console.log(this.saveObj,'saveObj');
},
//上传酒店图片
UploadImage(file) {
if(this.commonIndex==-1){
this.Error('请选择分类')
return;
}
let newArr = [];
newArr.push(file.file);
let fileName = file.file.name;
var path = "/Upload/DMC/";
this.UploadSelfFileT(path, newArr, x => {
var obj = this.$DMCUtils.DMCImageObj();
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
obj.Path = str;
obj.ShowPath = imgUrl;
console.log(obj,'obj');
this.saveObj[this.commonIndex].imgArr.push(obj.ShowPath);
});
},
},
}
</script>
<style>
.ChooseImg .el-input.is-active .el-input__inner,
.ChooseImg .el-input__inner:focus {
border-color: #DCDFE6;
}
.ChooseImg {
margin: 10px;
}
.ChooseImg .app-attachment-list .selected {
box-shadow: 0 0 0 1px #1ed0ff;
background: #daf5ff;
border-radius: 5px;
}
.ChooseImg .selectActive .el-icon-tickets {
color: #409EFF;
}
.ChooseImg .selectActive {
color: #409EFF;
}
.ChooseImg .app-attachment-name {
color: #666666;
margin-top: 5px;
font-size: 13px;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
.ChooseImg .app-attachment-item .app-attachment-img {
display: block;
}
.ChooseImg .app-attachment-upload i {
font-size: 30px;
color: #909399;
}
.ChooseImg .app-attachment-item {
display: inline-block;
cursor: pointer;
position: relative;
float: left;
width: 120px;
height: 140px;
margin: 7.5px;
text-align: center;
padding: 10px 10px 0;
}
.ChooseImg .app-attachment-upload {
box-shadow: none;
border: 1px dashed #b2b6bd;
height: 100px;
width: 100px;
margin: 17.5px;
padding: 0;
}
.ChooseImg .app-attachment-list {
padding: 5px;
min-height: 475px;
}
.ChooseImg .appendInput .el-input__inner {
border-right: none;
}
.ChooseImg .appendInput .el-input-group__append {
background-color: #fff !important;
border-left: none;
padding: 0 15px;
}
</style>
......@@ -4,8 +4,8 @@
<el-col :span="6" style="border-right: 1px solid rgb(227, 227, 227);">
<el-button @click="clearGroupMsg" style="margin-top: 12px;margin-left: 5%;" type="primary" size="small">添加分组
</el-button>
<div class="el-scrollbar" style="height: 450px; width: 100%;">
<div class="el-scrollbar__wrap" style="margin-bottom: -8px; margin-right: -8px;">
<div class="el-scrollbar" style="height: 450px; width: 100%;overflow-y:auto;">
<div style="margin-bottom: -8px; margin-right: -8px;">
<div class="el-scrollbar__view">
<li class="el-menu-item" style="padding-left: 10px;padding-right: 10px;"
:class="commonIndex==-1?'selectActive' : ''" @click="getImgList(-1,saveObj)">
......@@ -31,7 +31,7 @@
</el-col>
<el-col :span="18">
<div class="basefix app-attachment-list">
<div class="app-attachment-item app-attachment-upload">
<div class="app-attachment-item app-attachment-upload" style="margin:1px 0 0 8px;">
<el-upload class="avatar-uploader" action="" accept="image/jpeg,image/gif,image/png,image/bmp"
:show-file-list="false" :http-request="UploadImage" multiple>
<div class="app-upload"
......@@ -40,12 +40,9 @@
</div>
</el-upload>
</div>
<el-tooltip v-for="(item,index) in comImgArr" :key="index" class="item" effect="dark" placement="top-start">
<div class="el-tooltip item app-attachment-item">
<div style="display:inline-block;margin-left:9px;" v-for="(item,index) in comImgArr" :key="index">
<img :src="item.Path" class="app-attachment-img" style="width: 100px; height: 100px;">
<div class="app-attachment-name">图片名字</div>
</div>
</el-tooltip>
</div>
</el-col>
</el-row>
......@@ -134,6 +131,7 @@
getImgList(index, obj) {
this.commonIndex = index;
if (index == -1) {
console.log(this.saveObj,'this.saveObj');
this.saveObj.forEach(item => {
this.comImgArr.concat(item.ImgList);
})
......@@ -143,7 +141,7 @@
},
//选定
SelectImgId() {
this.$emit('getHotelImg',this.saveObj);
},
//上传酒店图片
UploadImage(file) {
......@@ -156,13 +154,14 @@
let fileName = file.file.name;
var path = "/Upload/DMC/";
this.UploadSelfFileT(path, newArr, x => {
console.log(x,'xxxx');
;
var str = x.data.FilePath;
var imgUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
var obj = {
MappingId: 0,
PicId: 0,
Path: imgUrl,
Path: imgUrl
}
this.saveObj[this.commonIndex].ImgList.push(obj);
});
......
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