Commit 63fe4161 authored by 黄奎's avatar 黄奎

页面修改

parent d474efd3
......@@ -67,9 +67,7 @@
<el-tooltip class="item" effect="dark" content="删除" placement="top-start">
<i class="iconfont icon-xingzhuang" @click="removeDaysTrip(index)"></i>
</el-tooltip>
<!-- <el-tooltip class="item" effect="dark" content="编辑" placement="top-start">
<i class="iconfont icon-bianji" @click=""></i>
</el-tooltip> -->
<el-tooltip class="item" effect="dark" content="添加" placement="top-start">
<i class="iconfont icon-mui-icon-add" @click="addDaysTrip(index)"></i>
</el-tooltip>
......@@ -83,7 +81,7 @@
<div class="d">第{{index+1}}天</div>
<div class="title-box">
<div class="t">
{{item.TitleObj.Title}}
{{item.dayArray[0].childItem.Title}}
</div>
</div>
</div>
......@@ -95,7 +93,7 @@
<div class="daycnt">
<div class="d">第{{index+1}}天</div>
<div class="title-box">
<titleTrip :isOpenGroup="isOpenGroup" v-bind:subItemObj="subConfig.DayList[0].TitleObj.Title" >
<titleTrip :isOpenGroup="isOpenGroup" v-bind:subItemObj="item.dayArray[0]" >
</titleTrip>
</div>
</div>
......@@ -114,9 +112,7 @@
v-bind:subTotalIndex="item.dayArray.length"></hotelTrip>
</span>
<span v-else>
<hotelTripdisDirect v-bind:subItemObj="subItem" v-bind:DefaultList="hotelSameList"
v-bind:subIndex="subIndex" v-bind:DinnerList="DinnerList" v-bind:index="index" :isOpenGroup="isOpenGroup"
v-bind:subTotalIndex="item.dayArray.length"></hotelTripdisDirect>
</span>
</div>
<div v-if="subItem.Type==$tripUtils.TypeKey.scenic">
......@@ -124,10 +120,7 @@
<scienTrip v-bind:subItemObj="subItem" v-bind:DefaultList="scenicSameList" v-bind:subIndex="subIndex"
v-bind:index="index" :isOpenGroup="isOpenGroup" v-bind:subTotalIndex="item.dayArray.length"></scienTrip>
</span>
<span v-else>
<scienTripdisDirect v-bind:subItemObj="subItem" v-bind:DefaultList="scenicSameList"
v-bind:subIndex="subIndex" v-bind:index="index" :isOpenGroup="isOpenGroup" v-bind:subTotalIndex="item.dayArray.length"></scienTripdisDirect>
</span>
</div>
<div v-if="subItem.Type==$tripUtils.TypeKey.dinner">
<span v-if="IsDirect==1">
......@@ -136,9 +129,7 @@
v-bind:subTotalIndex="item.dayArray.length"></dinnerTrip>
</span>
<span v-else>
<dinnerTripdisDirect v-bind:subItemObj="subItem" v-bind:DefaultList="dinnerSameList"
v-bind:subIndex="subIndex" v-bind:HotelList="HotelList" v-bind:index="index" :isOpenGroup="isOpenGroup"
v-bind:subTotalIndex="item.dayArray.length"></dinnerTripdisDirect>
</span>
</div>
<div v-if="subItem.Type==$tripUtils.TypeKey.freedom">
......@@ -171,15 +162,14 @@
<script>
import trifficTrip from "../oldTravelGroupControl/trifficTrip";
import scienTrip from "../oldTravelGroupControl/scienTrip_Direct";
import scienTripdisDirect from "../oldTravelGroupControl/scienTrip_disDirect";
import hotelTrip from "../oldTravelGroupControl/hotelTrip_Direct";
import hotelTripdisDirect from "../oldTravelGroupControl/hotelTrip_disDirect";
import dinnerTrip from "../oldTravelGroupControl/dinnerTrip_Direct";
import dinnerTripdisDirect from "../oldTravelGroupControl/dinnerTrip_disDirect";
import freedomTrip from "../oldTravelGroupControl/freedomTrip";
import warmtipTrip from "../oldTravelGroupControl/warmtipTrip";
......@@ -289,13 +279,13 @@ export default {
trifficTrip: trifficTrip,
scienTrip: scienTrip,
scienTripdisDirect: scienTripdisDirect,
hotelTrip: hotelTrip,
hotelTripdisDirect: hotelTripdisDirect,
dinnerTrip: dinnerTrip,
dinnerTripdisDirect: dinnerTripdisDirect,
freedomTrip: freedomTrip,
warmtipTrip: warmtipTrip,
......@@ -358,6 +348,7 @@ export default {
}
this.subConfig.DayList.length = this.subConfig.DayNum;
}
console.log("this.sub",this.subConfig);
},
//点击往后追加
......
<template>
<div class="trip-item-box">
<div class="edit" v-if="isShowEdit">
<div class="TCtraffic flex">
<div class="partName">
<span class="TDTripType">餐饮</span>
</div>
<div class="delSpan">
<el-tooltip class="item" effect="dark" content="查看" placement="top-start">
<i class="iconfont icon-chakan" @click="isShowEdit=!isShowEdit"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" v-if="!isOpenGroup" content="删除" placement="top-start">
<i class="iconfont icon-xingzhuang" @click="removeDinnerTrip(subItemObj.childItem.DayNum,subIndex)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="上移" placement="top-start" v-if="subIndex!=0&&!isOpenGroup">
<i class="iconfont icon-shangyi" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,0)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="下移" placement="top-start" v-if="subIndex!=subTotalIndex-1&&!isOpenGroup">
<i class="iconfont icon-xiayi1" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,1)"></i>
</el-tooltip>
</div>
<div class="TDplanList clearfix">
<div class="TDLeftPlan">
<span style="margin-left:26px;">餐厅</span>
<span>
<el-form-item :prop="'DayList.'+index+'.dayArray.'+subIndex+'.childItem.DinnerName'" :rules="dinnerTripRules.DinnerName">
<el-input :disabled="isOpenGroup" class='w160' v-model="subItemObj.childItem.DinnerName"></el-input>
</el-form-item>
</span>
<span class="ST_ticket">套餐</span>
<span>
<el-input :disabled="isOpenGroup" class='w160' v-model="subItemObj.childItem.MealName"></el-input>
</span>
</div>
<div class="TDmealTime">
<label class="TDhotelDiner">用餐时段</label>
<el-checkbox-group v-model="Diner.UseDinerCked">
<!-- HotelList.indexOf(item.Id)==-1 判断是否存在此用餐类型 -->
<el-checkbox v-for="item in Diner.UseDinnerType" :disabled="isOpenGroup" :label="item.Id" :key='item.Id'>{{item.Name}}</el-checkbox>
</el-checkbox-group>
<span class="ST_ticket">用餐时间</span>
<el-input :disabled="isOpenGroup" type="text" class="w120" v-model="subItemObj.childItem.UseTimeHour"
@keyup.native="checkInteger(subItemObj.childItem,'UseTimeHour')"></el-input>
小时
<el-input :disabled="isOpenGroup" type="text" class="w120" v-model="subItemObj.childItem.UseTimeMinutes"
@keyup.native="checkInteger(subItemObj.childItem,'UseTimeMinutes')"></el-input>分钟
</div>
</div>
</div>
<div class="TP_edit">
<my-edit v-if="isShowEdit" v-on:edit-value="subItemObj.childItem.Description = arguments[0]" v-bind:editValue="subItemObj.childItem.Description"
v-bind:toolbarShow="toolbar" v-bind:referenceList="DefaultList" v-bind:placeholder="placeholder"></my-edit>
</div>
<div class="SiencDiv clearfix">
<div class="ScLeftImg">
<div class="TFimgList" v-for="(item,index) in subItemObj.childItem.ImaArray" :key="item.subCode">
<img v-if="!item.Url" src="../../../assets/img/bg_c3@3x.png" />
<img v-else :src="item.Url" />
<div class="imgzhe" @click="getPic(subItemObj.childItem.ImaArray,index)">
<div class="clearfix" style="text-align:center;">
<div class="re-delte" @click.stop="delImg(index,subItemObj)"><i class="iconfont icon-xingzhuang"></i></div>
<div class="re-delte" @click.stop="toExchangeImg(subItemObj.childItem.DayNum,subIndex,index,0)" v-if="index!=0"><i class="iconfont icon-zuoyi"></i></div>
<div class="re-delte" @click.stop="toExchangeImg(subItemObj.childItem.DayNum,subIndex,index,1)" v-if="index!=subItemObj.childItem.ImaArray.length-1"><i class="iconfont icon-youyi"></i></div>
</div>
</div>
</div>
</div>
<div class="rightAddImg">
<el-upload :file-list="subItemObj.childItem.ImaArray" :http-request="uploadScenImg" :data="subItemObj.childItem"
:multiple="true" accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
<i class="iconfont icon-img_haha"></i>
</el-upload>
</div>
</div>
</div>
<div class="read" v-if="!isShowEdit">
<div class="TCtraffic flex">
<div class="partName">
<span class="TDTripType">餐饮</span>
</div>
<div class="delSpan">
<el-tooltip class="item" effect="dark" content="编辑" placement="top-start">
<i class="iconfont icon-bianji" @click="isShowEdit=!isShowEdit"></i>
</el-tooltip>
<el-tooltip class="item" v-if="!isOpenGroup" effect="dark" content="删除" placement="top-start">
<i class="iconfont icon-xingzhuang" @click="removeDinnerTrip(subItemObj.childItem.DayNum,subIndex)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="上移" placement="top-start" v-if="subIndex!=0&&!isOpenGroup">
<i class="iconfont icon-shangyi" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,0)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="下移" placement="top-start" v-if="subIndex!=subTotalIndex-1&&!isOpenGroup">
<i class="iconfont icon-xiayi1" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,1)"></i>
</el-tooltip>
</div>
<div class="title-box">
<div class="TDLeftPlan">
<span>餐厅</span>
<span>
{{subItemObj.childItem.DinnerName}}
</span>
<span class="ST_ticket">套餐</span>
<span>
{{subItemObj.childItem.MealName}}
</span>
<span>用餐时段</span>
<span v-if="Diner.UseDinerCked==1">早餐</span>
<span v-if="Diner.UseDinerCked==2">中餐</span>
<span v-if="Diner.UseDinerCked==3">晚餐</span>
<span class="ST_ticket">用餐时间</span>
<span>{{subItemObj.childItem.UseTimeHour}}</span>
<span>小时</span>
<span>{{subItemObj.childItem.UseTimeMinutes}}</span><span>分钟</span>
</div>
</div>
</div>
<div class="TP_editShow">
<pre v-html="subItemObj.childItem.Description"></pre>
</div>
<div class="SiencDiv clearfix">
<div class="ScLeftImg">
<div class="TFimgList" v-for="(item,index) in subItemObj.childItem.ImaArray" :key="item.subCode">
<img v-if="!item.Url" src="../../../assets/img/bg_c3@3x.png" />
<img v-else :src="item.Url" @click="getPic(subItemObj.childItem.ImaArray,index)"/>
</div>
</div>
</div>
</div>
<div v-if="dspNone" class="viewBigPicLayer myPiclayer" @click="colseLayer">
<i @click="colseLayer" class="el-icon-circle-close-outline clolseViewBigPicLayer" ></i>
<el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click">
<el-carousel-item v-for="(item,index) in picObj" :key="index">
<img style="width:100%;" :src="item.Url" />
</el-carousel-item>
</el-carousel>
</div>
</div>
</template>
<script>
import MyEdit from "../../EditTemplate.vue";
export default {
props: [
"subItemObj",
"DefaultList",
"subIndex",
"HotelList",
"index",
"isOpenGroup",
"subTotalIndex",
"TimeTypeList"
],
data() {
var TimeTypeValidate = (rule, value, callback) => {
if (value === 0) {
callback(new Error("请选择时间类型"));
} else {
callback();
}
};
var DinnerIdValidate = (rule, value, callback) => {
if (value === 0) {
callback(new Error("请选择餐厅"));
} else {
callback();
}
};
return {
toolbar: {
clean: false, //清除样式
font: false, //字体
narrative: true //叙述,
},
//是否显示编辑框
isShowEdit:false,
dspNone:false,
initialIndex:0,
//text框placeholder
placeholder:'请输入餐饮信息',
//用餐时段
Diner: {
DefaultSelectValue: 0,
UseDinerCked: [],
UseDinnerType: [{
Id: "1",
Name: "早"
},
{
Id: "2",
Name: "中"
},
{
Id: "3",
Name: "晚"
}
]
},
//餐厅验证
dinnerTripRules: {
//时间类型验证
TimeType: [{
validator: TimeTypeValidate,
trigger: "change"
}],
DinnerName: [{
required: true,
message: "请填写餐厅名称",
trigger: "blur"
}]
}
};
},
components: {
"my-edit": MyEdit
},
methods: {
//上传景点图片
uploadScenImg(item) {
let newArr = [];
newArr.push(item.file);
let path = "/Upload/DMC/";
this.UploadSelfFileT(path, newArr, x => {
var fileObj = this.$commonUtils.FileObject();
fileObj.Url = this.domainManager().ViittoFileUrl + x.data.FilePath,
fileObj.fileName = x.data.FileName;
item.data.ImaArray.push(fileObj);
});
},
//删除晚餐
removeDinnerTrip(dayNum, subIndex) {
this.$parent.$parent.commonRemove(dayNum, subIndex);
},
//删除图片
delImg(index, subItemObj) {
this.$parent.$parent.commonRemoveImg(index, subItemObj);
},
//上移下移
MoveItem(dayNum,subIndex,IsUp)
{
this.$parent.$parent.MoveItem(dayNum, subIndex,IsUp);
},
//左右移动
toExchangeImg(dayNum, subIndex, imgIndex, IsMove) {
this.$parent.$parent.ExchangeImg(dayNum, subIndex, imgIndex,IsMove);
},
colseLayer(){
this.dspNone=false;
},
getPic(obj,index){
this.picObj=obj
this.dspNone=true;
this.initialIndex = index;
},
},
created() {
},
mounted() {
if (this.subItemObj.childItem.UseDinnerType != "") {
var array = this.subItemObj.childItem.UseDinnerType.split(",");
if (array.length > 0) {
array.forEach(item => {
if (item != "") {
this.Diner.UseDinerCked.push(item);
}
});
}
}
},
watch: {
Diner: {
//深度监听,可监听到对象、数组的变化
handler: function (val, oldVal) {
var ckedDiner = "";
this.Diner.UseDinerCked.forEach(x => {
ckedDiner = ckedDiner + x + ",";
});
if (ckedDiner != "") {
ckedDiner = ckedDiner.substring(0, ckedDiner.lastIndexOf(","));
}
this.subItemObj.childItem.UseDinnerType = ckedDiner;
},
deep: true
},
subItemObj: {
//深度监听,可监听到对象、数组的变化
handler: function (val, oldVal) {
this.subItemObj.childItem.DinnerImg = JSON.stringify(
this.subItemObj.childItem.ImaArray
);
},
deep: true
}
}
};
</script>
<template>
<div class="trip-item-box">
<div class="edit" v-if="isShowEdit">
<div class="TCtraffic flex">
<div class="partName">
<span class="TDTripType">酒店</span>
</div>
<span class="datePickContent" style="display:none;">
<!--:prop="'DayList.'+index+'.dayArray.'+subIndex+'.childItem.TimeType'" :rules="hotelTripRules.TimeType"-->
<el-form-item >
<el-select :disabled="isOpenGroup" class="w160" placeholder="请选择时间" v-model="subItemObj.childItem.TimeType">
<el-option v-for="item in TimeTypeList" :label='item.Name' :value='item.Id' :key='item.Id'>
</el-option>
</el-select>
</el-form-item>
</span>
<div class="delSpan">
<el-tooltip class="item" effect="dark" content="查看" placement="top-start">
<i class="iconfont icon-chakan" @click="isShowEdit=!isShowEdit"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start" v-if="!isOpenGroup">
<i class="iconfont icon-xingzhuang" @click="removeHotelTrip(subItemObj.childItem.DayNum,subIndex)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="上移" placement="top-start" v-if="subIndex!=0 && !isOpenGroup">
<i class="iconfont icon-shangyi" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,0)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="下移" placement="top-start" v-if="subIndex!=subTotalIndex-1 && !isOpenGroup">
<i class="iconfont icon-xiayi1" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,1)"></i>
</el-tooltip>
</div>
<div class="TDplanList clearfix">
<div class="TDLeftPlan">
<span>入住酒店</span>
<span>
<el-form-item :prop="'DayList.'+index+'.dayArray.'+subIndex+'.childItem.HotelName'" :rules="hotelTripRules.HotelName">
<el-input :disabled="isOpenGroup" class='w160' v-model="subItemObj.childItem.HotelName"></el-input>
</el-form-item>
</span>
<span class="ST_ticket">房型</span>
<span>
<el-input :disabled="isOpenGroup" class='w160' v-model="subItemObj.childItem.HotelProductName"></el-input>
</span>
<span v-if="subItemObj.childItem.IsUseDinner==1">
<span class="TDhotelDiner">酒店含餐</span>
<span>
<el-checkbox-group v-model="Diner.UseDinerCked">
<el-checkbox v-for="item in Diner.UseDinnerArray" disabled :label="item.Id" :key='item.Id'>{{item.Name}}</el-checkbox>
</el-checkbox-group>
</span>
</span>
</div>
</div>
</div>
<div class="TP_edit">
<my-edit v-if="isShowEdit" v-on:edit-value="subItemObj.childItem.Description = arguments[0]" v-bind:editValue="subItemObj.childItem.Description"
v-bind:toolbarShow="toolbar" v-bind:referenceList="DefaultList" v-bind:placeholder="placeholder"></my-edit>
</div>
<div class="SiencDiv clearfix">
<div class="ScLeftImg">
<div class="TFimgList" v-for="(item,index) in subItemObj.childItem.ImaArray" :key="item.subCode">
<img v-if="!item.Url" src="../../../assets/img/bg_c3@3x.png" />
<img v-else :src="item.Url" />
<div class="imgzhe" @click="getPic(subItemObj.childItem.ImaArray,index)">
<div class="clearfix" style="text-align:center;">
<div class="re-delte" @click.stop="delImg(index,subItemObj)"><i class="iconfont icon-xingzhuang"></i></div>
<div class="re-delte" @click.stop="toExchangeImg(subItemObj.childItem.DayNum,subIndex,index,0)" v-if="index!=0"><i class="iconfont icon-zuoyi"></i></div>
<div class="re-delte" @click.stop="toExchangeImg(subItemObj.childItem.DayNum,subIndex,index,1)" v-if="index!=subItemObj.childItem.ImaArray.length-1"><i class="iconfont icon-youyi"></i></div>
</div>
</div>
</div>
</div>
<div class="rightAddImg">
<el-upload :file-list="subItemObj.childItem.ImaArray" :http-request="uploadScenImg" :data="subItemObj.childItem"
:multiple="true" accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
<i class="iconfont icon-img_haha"></i>
</el-upload>
</div>
</div>
</div>
<div class="read" v-if="!isShowEdit">
<div class="TCtraffic flex">
<div class="partName">
<span class="TDTripType">酒店</span>
</div>
<div class="delSpan">
<el-tooltip class="item" effect="dark" content="编辑" placement="top-start" >
<i class="iconfont icon-bianji" @click="isShowEdit=!isShowEdit"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start" v-if="!isOpenGroup">
<i class="iconfont icon-xingzhuang" @click="removeHotelTrip(subItemObj.childItem.DayNum,subIndex)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="上移" placement="top-start" v-if="subIndex!=0 && !isOpenGroup">
<i class="iconfont icon-shangyi" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,0)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="下移" placement="top-start" v-if="subIndex!=subTotalIndex-1 && !isOpenGroup">
<i class="iconfont icon-xiayi1" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,1)"></i>
</el-tooltip>
</div>
<div class="title-box">
<div class="TDLeftPlan">
<span>入住酒店</span>
<span>{{subItemObj.childItem.HotelName}}</span>
<span>房型</span>
<span>{{subItemObj.childItem.HotelProductName}}</span>
<span v-if="subItemObj.childItem.IsUseDinner==1">
<span class="TDhotelDiner">酒店含餐</span>
<span v-if="Diner.UseDinerCked==1">早餐</span>
<span v-if="Diner.UseDinerCked==2">中餐</span>
<span v-if="Diner.UseDinerCked==3">晚餐</span>
</span>
</div>
</div>
</div>
<div class="TP_editShow">
<pre v-html="subItemObj.childItem.Description"></pre>
</div>
<div class="SiencDiv clearfix">
<div class="ScLeftImg">
<div class="TFimgList" v-for="(item,index) in subItemObj.childItem.ImaArray" :key="item.subCode">
<img v-if="!item.Url" src="../../../assets/img/bg_c3@3x.png" />
<img v-else :src="item.Url" @click="getPic(subItemObj.childItem.ImaArray,index)"/>
</div>
</div>
</div>
</div>
<div v-if="dspNone" class="viewBigPicLayer myPiclayer" @click="colseLayer">
<i @click="colseLayer" class="el-icon-circle-close-outline clolseViewBigPicLayer" ></i>
<el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click">
<el-carousel-item v-for="(item,index) in picObj" :key="index">
<img style="width:100%;" :src="item.Url" />
</el-carousel-item>
</el-carousel>
</div>
</div>
</template>
<script>
import MyEdit from "../../EditTemplate.vue";
export default {
props: ["subItemObj", "DefaultList", "index", "subIndex", "isOpenGroup","subTotalIndex","TimeTypeList"],
data() {
var TimeTypeValidate = (rule, value, callback) => {
if (value === 0) {
callback(new Error("请选择时间类型"));
} else {
callback();
}
};
var HotelIdValidate = (rule, value, callback) => {
if (value == '') {
callback(new Error("请选择酒店"));
} else {
callback();
}
};
return {
//酒店列表
QHotelList: [],
//酒店房型列表
toolbar: {
clean: false, //清除样式
font: false, //字体
narrative: true //叙述,
},
//是否显示编辑框
isShowEdit:false,
dspNone:false,
initialIndex:0,
//text框placeholder
placeholder:'请输入酒店信息',
//酒店含餐
Diner: {
DefaultSelectValue: 0,
UseDinerCked: [],
UseDinnerType: [{
Id: "1",
Name: "早"
},
{
Id: "2",
Name: "中"
},
{
Id: "3",
Name: "晚"
}
],
UseDinnerArray: []
},
//酒店验证
hotelTripRules: {
//时间类型验证
TimeType: [{
validator: TimeTypeValidate,
trigger: "change"
}],
HotelName: [{
required: true,
message: "请填写酒店名称",
trigger: "blur"
}]
}
};
},
components: {
"my-edit": MyEdit
},
methods: {
//上传景点图片
uploadScenImg(item) {
let newArr = [];
newArr.push(item.file);
let path = "/Upload/DMC/";
this.UploadSelfFileT(path, newArr, x => {
var fileObj = this.$commonUtils.FileObject();
fileObj.Url = this.domainManager().ViittoFileUrl + x.data.FilePath,
fileObj.fileName = x.data.FileName;
item.data.ImaArray.push(fileObj);
});
},
//删除酒店
removeHotelTrip(dayNum, subIndex) {
this.$parent.$parent.commonRemove(dayNum, subIndex);
},
//删除图片
delImg(index, subItemObj) {
this.$parent.$parent.commonRemoveImg(index, subItemObj);
},
//上移下移
MoveItem(dayNum,subIndex,IsUp)
{
this.$parent.$parent.MoveItem(dayNum, subIndex,IsUp);
},
//左右移动
toExchangeImg(dayNum, subIndex, imgIndex, IsMove) {
this.$parent.$parent.ExchangeImg(dayNum, subIndex, imgIndex,IsMove);
},
colseLayer(){
this.dspNone=false;
},
getPic(obj,index){
this.picObj=obj
this.dspNone=true;
this.initialIndex = index;
},
},
mounted() {
},
watch: {
subItemObj: {
//深度监听,可监听到对象、数组的变化
handler: function (val, oldVal) {
this.subItemObj.childItem.HotelImg = JSON.stringify(
this.subItemObj.childItem.ImaArray
);
},
deep: true
}
}
};
</script>
<template>
<div class="trip-item-box">
<div class="edit" v-if="isShowEdit">
<div class="TCtraffic flex">
<div class="partName">
<span class="TDTripType">景点</span>
</div>
<span class="datePickContent" style="display:none;">
<!--:prop="'DayList.'+index+'.dayArray.'+subIndex+'.childItem.TimeType'" :rules="scienTripRules.TimeType"-->
<el-form-item >
<el-select :disabled="isOpenGroup" class="w160" placeholder="请选择时间" v-model="subItemObj.childItem.TimeType">
<el-option v-for="item in TimeTypeList" :label='item.Name' :value='item.Id' :key='item.Id'>
</el-option>
</el-select>
</el-form-item>
</span>
<div class="delSpan">
<el-tooltip class="item" effect="dark" content="查看" placement="top-start">
<i class="iconfont icon-chakan" @click="isShowEdit=!isShowEdit"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start" v-if="!isOpenGroup">
<i class="iconfont icon-xingzhuang" @click="removeScienTrip(subItemObj.childItem.DayNum,subIndex)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="上移" placement="top-start" v-if="subIndex!=0 && !isOpenGroup">
<i class="iconfont icon-shangyi" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,0)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="下移" placement="top-start" v-if="subIndex!=subTotalIndex-1 && !isOpenGroup">
<i class="iconfont icon-xiayi1" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,1)"></i>
</el-tooltip>
</div>
<div class="TDplanList clearfix">
<div class="TDLeftPlan">
<span>
<el-form-item :prop="'DayList.'+index+'.dayArray.'+subIndex+'.childItem.CouponsName'" :rules="scienTripRules.CouponsName">
<el-input :disabled="isOpenGroup" class='w160' v-model="subItemObj.childItem.CouponsName"></el-input>
</el-form-item>
</span>
<span class="ST_ticket">门票</span>
<span>
<el-input :disabled="isOpenGroup" class='w160' v-model="subItemObj.childItem.CouponsTicketName"></el-input>
</span>
<span>
<label class="PlayTime">游玩时间</label>
<el-input :disabled="isOpenGroup" type="text" class="w120" v-model="subItemObj.childItem.PlayTimeHour"
@keyup.native="checkInteger(subItemObj.childItem,'PlayTimeHour')" maxlength="2"></el-input>&nbsp;&nbsp;小时
<el-input :disabled="isOpenGroup" type="text" class="w120" v-model="subItemObj.childItem.PlayTimeMinutes"
@keyup.native="checkInteger(subItemObj.childItem,'PlayTimeMinutes')" maxlength="2"></el-input>&nbsp;&nbsp;分钟
</span>
</div>
</div>
</div>
<div class="TP_edit">
<my-edit v-on:edit-value="subItemObj.childItem.Description = arguments[0]" v-bind:editValue="subItemObj.childItem.Description"
v-bind:toolbarShow="toolbar" v-bind:referenceList="DefaultList" v-bind:placeholder="placeholder"></my-edit>
</div>
<div class="SiencDiv clearfix">
<div class="ScLeftImg">
<div class="TFimgList" v-for="(item,index) in subItemObj.childItem.ImaArray" :key="item.subCode">
<img v-if="!item.Url" src="../../../assets/img/bg_c3@3x.png" />
<img v-else :src="item.Url" />
<div class="imgzhe" @click="getPic(subItemObj.childItem.ImaArray,index)">
<div class="clearfix" style="text-align:center;">
<div class="re-delte" @click.stop="delImg(index,subItemObj)"><i class="iconfont icon-xingzhuang"></i></div>
<div class="re-delte" @click.stop="toExchangeImg(subItemObj.childItem.DayNum,subIndex,index,0)" v-if="index!=0"><i class="iconfont icon-zuoyi"></i></div>
<div class="re-delte" @click.stop="toExchangeImg(subItemObj.childItem.DayNum,subIndex,index,1)" v-if="index!=subItemObj.childItem.ImaArray.length-1"><i class="iconfont icon-youyi"></i></div>
</div>
</div>
</div>
</div>
<div class="rightAddImg">
<el-upload :file-list="subItemObj.childItem.ImaArray" :http-request="uploadScenImg" :data="subItemObj.childItem"
:multiple="true" accept="image/jpeg,image/gif,image/png,image/bmp" :show-file-list="false" action="">
<i class="iconfont icon-img_haha"></i>
</el-upload>
</div>
</div>
</div>
<div class="read" v-if="!isShowEdit">
<div class="TCtraffic flex">
<div class="partName">
<span class="TDTripType">景点</span>
</div>
<div class="delSpan">
<el-tooltip class="item" effect="dark" content="编辑" placement="top-start" v-if="!isShowEdit">
<i class="iconfont icon-bianji" @click="isShowEdit=!isShowEdit"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start" v-if="!isOpenGroup">
<i class="iconfont icon-xingzhuang" @click="removeScienTrip(subItemObj.childItem.DayNum,subIndex)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="上移" placement="top-start" v-if="subIndex!=0 && !isOpenGroup">
<i class="iconfont icon-shangyi" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,0)"></i>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="下移" placement="top-start" v-if="subIndex!=subTotalIndex-1 && !isOpenGroup">
<i class="iconfont icon-xiayi1" @click="MoveItem(subItemObj.childItem.DayNum,subIndex,1)"></i>
</el-tooltip>
</div>
<div class="title-box">
<div class="TDLeftPlan">
<span>
{{subItemObj.childItem.CouponsName}}
</span>
<span class="ST_ticket">门票</span>
<span>
{{subItemObj.childItem.CouponsTicketName}}
</span>
<span>游玩时间</span><span>{{subItemObj.childItem.PlayTimeHour}}</span>
<span>小时</span><span>{{subItemObj.childItem.PlayTimeMinutes}}</span><span>分钟</span>
</div>
</div>
</div>
<div class="TP_editShow">
<pre v-html="subItemObj.childItem.Description"></pre>
</div>
<div class="SiencDiv clearfix">
<div class="ScLeftImg">
<div class="TFimgList" v-for="(item,index) in subItemObj.childItem.ImaArray" :key="item.subCode">
<img v-if="!item.Url" src="../../../assets/img/bg_c3@3x.png" />
<img v-else :src="item.Url" @click="getPic(subItemObj.childItem.ImaArray,index)"/>
</div>
</div>
</div>
</div>
<div v-if="dspNone" class="viewBigPicLayer myPiclayer" @click="colseLayer">
<i @click="colseLayer" class="el-icon-circle-close-outline clolseViewBigPicLayer" ></i>
<el-carousel height="600px" :initial-index='initialIndex' :interval="5000" trigger="click">
<el-carousel-item v-for="(item,index) in picObj" :key="index">
<img style="width:100%;" :src="item.Url" />
</el-carousel-item>
</el-carousel>
</div>
</div>
</template>
<script>
import MyEdit from "../../EditTemplate.vue";
export default {
props: ["subItemObj", "DefaultList", "subIndex", "index", "isOpenGroup","subTotalIndex","TimeTypeList"],
data() {
var TimeTypeValidate = (rule, value, callback) => {
if (value === 0) {
callback(new Error("请选择时间类型"));
} else {
callback();
}
};
var CouponsIdValidate = (rule, value, callback) => {
if (value == "") {
callback(new Error("请填写景点"));
} else {
callback();
}
};
return {
toolbar: {
clean: false, //清除样式
font: false, //字体
narrative: true //叙述,
},
//是否显示编辑框
isShowEdit:false,
dspNone:false,
initialIndex:0,
//text框placeholder
placeholder:'请输入景点信息',
DefaultSelectValue: 0,
//景点验证
scienTripRules: {
//时间类型验证
TimeType: [{
validator: TimeTypeValidate,
trigger: "change"
}],
CouponsName: [{
required: true,
message: "请填写景点名称",
trigger: "blur"
}]
}
};
},
components: {
"my-edit": MyEdit
},
methods: {
//删除景区
removeScienTrip(dayNum, subIndex) {
this.$parent.$parent.commonRemove(dayNum, subIndex);
},
//删除图片
delImg(index, subItemObj) {
this.$parent.$parent.commonRemoveImg(index, subItemObj);
},
//上传景点图片
uploadScenImg(item) {
let newArr = [];
newArr.push(item.file);
let path = "/Upload/DMC/";
this.UploadSelfFileT(path, newArr, x => {
var str = x.res.requestUrls[0];
var fileObj = this.$commonUtils.FileObject();
fileObj.Url = this.domainManager().ViittoFileUrl + x.data.FilePath,
fileObj.fileName = x.data.FileName;
item.data.ImaArray.push(fileObj);
});
},
//上移下移
MoveItem(dayNum,subIndex,IsUp)
{
this.$parent.$parent.MoveItem(dayNum, subIndex,IsUp);
},
//左右移动
toExchangeImg(dayNum, subIndex, imgIndex, IsMove) {
this.$parent.$parent.ExchangeImg(dayNum, subIndex, imgIndex,IsMove);
},
colseLayer(){
this.dspNone=false;
},
getPic(obj,index){
this.picObj=obj
this.dspNone=true;
this.initialIndex = index;
},
},
created() {
},
mounted() {},
watch: {
subItemObj: {
//深度监听,可监听到对象、数组的变化
handler: function (val, oldVal) {
this.subItemObj.childItem.ScenicImg = JSON.stringify(
this.subItemObj.childItem.ImaArray
);
},
deep: true
}
}
};
</script>
......@@ -3,9 +3,7 @@
<div class="TCtraffic clearfix">
<div>
<span class="datePickContent" style="background-color:transparent">
<!-- <span v-if="isOpenGroup">
{{subItemObj.childItem.Title}}
</span> -->
<el-form-item>
<el-input v-model="subItemObj.childItem.Title" class="" placeholder="行程大点"></el-input>
</el-form-item>
......
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