Commit 9a7745ae authored by 黄奎's avatar 黄奎
parents 9c36500a 82c0ebfc
......@@ -99,7 +99,7 @@ module.exports = {
// Various Dev Server settings
host: 'www.test.com', // can be overwritten by process.env.HOST
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
......
......@@ -430,7 +430,7 @@
}
.scenicSpotInfoManage .el-form-item__label {
width: 96px;
width: 105px;
font-size: 12px;
}
......@@ -765,9 +765,29 @@
<el-option v-for="item in district" :key="item.ID" :label="item.Name" :value="item.ID"></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="包车时长" prop="TravelHours" v-if="addMsg.CarType==3">
<el-input type="Number" placeholder="请输入包车时长" class="w300 addAddress" :min="0" v-model="addMsg.TravelHours">
<span slot="append"> 小时 </span>
</el-input>
</el-form-item>
<el-form-item label="提前取消时间" prop="">
<el-input type="Number" placeholder="提前几天可免费取消" class="w300 addAddress" :min="0" v-model="addMsg.FreeCancelDay">
<span slot="append"></span>
</el-input>
</el-form-item>
</template>
<span v-if="addMsg.CarType!=3" class="resource-lititle sheshi" style="width: 100%;">
<template v-if="addMsg.CarType==1">接机</template>
<template v-if="addMsg.CarType==2">送机</template>
<template v-if="!addMsg.CarType">-</template>
(机场信息)
<span style="float: right;margin-right: 206px;color: #6e6e6e;cursor: pointer;" @click="clickShow(1)">
{{AirportShow?'收起':'展开'}}
</span>
</span>
<template v-for="(item,index) in addMsg.AirportList">
<el-form-item label="机场" :prop="`AirportList.${index}.AirportId`" :rules="rules.AirportId">
<div v-show="AirportShow&&addMsg.CarType!=3">
<el-form-item :label="`机场${index+1}`" :prop="`AirportList.${index}.AirportId`" :rules="rules.AirportId">
<div style="position: relative;">
<el-select placeholder="请选择机场" filterable v-model="item.AirportId" @change="getAirportItem(item,item.AirportId)"
class='multiple_input w300'
......@@ -779,17 +799,17 @@
<i v-else class="el-icon-delete addlist" @click="clickAirport(index)"></i>
</div>
</el-form-item>
<el-form-item label="机场(IATA)" :prop="`AirportList.${index}.Name`" :rules="rules.Name2">
<el-form-item :label="`机场(IATA)${index+1}`" :prop="`AirportList.${index}.Name`" :rules="rules.Name2">
{{item.AirportName}}
<el-input maxlength="100" placeholder="请输入机场地址(IATA)" class="w300 addAddress" v-model="item.Name"></el-input>
</el-form-item>
<el-form-item label="机场详细地址" :prop="`AirportList.${index}.Address`" :rules="rules.Address">
<el-form-item :label="`机场详细地址${index+1}`" :prop="`AirportList.${index}.Address`" :rules="rules.Address">
<el-input maxlength="600" placeholder="请输入机场详细地址" class="w300 addAddress" v-model="item.Address">
<el-button slot="append" @click="clickMapAddress(1,item.Address,index)" icon="iconfont icon-img_dw"></el-button>
</el-input>
</el-form-item>
<div class="toolOne" style="margin: 0 0 28px 13px;">
<span class="fanbili">机场地理位置</span>
<span class="fanbili">机场地理位置{{index+1}}</span>
<div class="RabateDiv clearfix">
<div class="RebateCount reOne">
<div class="leftPnum">经度</div>
......@@ -801,23 +821,34 @@
</div>
</div>
</div>
</div>
</template>
<span class="resource-lititle sheshi" style="width: 100%;">
<template v-if="addMsg.CarType==1">接机</template>
<template v-if="addMsg.CarType==2">送机</template>
<template v-if="addMsg.CarType==3">包车</template>
<template v-if="!addMsg.CarType">-</template>
(上车信息)
<span style="float: right;margin-right: 206px;color: #6e6e6e;cursor: pointer;" @click="clickShow(2)">
{{PlaceShow?'收起':'展开'}}
</span>
</span>
<template v-for="(item,index) in addMsg.PlaceList">
<el-form-item label="上车地址" :prop="`PlaceList.${index}.Name`" :rules="rules.Name3">
<div v-show="PlaceShow">
<el-form-item :label="`上车地址${index+1}`" :prop="`PlaceList.${index}.Name`" :rules="rules.Name3">
<div style="position: relative;">
<el-input maxlength="100" placeholder="请输入上车地址" class="w300 addAddress" v-model="item.Name"></el-input>
<i v-if="index==0" class="el-icon-circle-plus addlist" @click="clickPlace(index,1)"></i>
<i v-else class="el-icon-delete addlist" @click="clickPlace(index)"></i>
</div>
</el-form-item>
<el-form-item label="上车详细地址" :prop="`PlaceList.${index}.Address`" :rules="rules.Address">
<el-form-item :label="`上车详细地址${index+1}`" :prop="`PlaceList.${index}.Address`" :rules="rules.Address">
<el-input maxlength="300" placeholder="请输入上车详细地址" class="w300 addAddress" v-model="item.Address">
<el-button slot="append" @click="clickMapAddress(2,item.Address,index)" icon="iconfont icon-img_dw"></el-button>
</el-input>
</el-form-item>
<div class="toolOne" style="margin: 0 0 28px 13px;">
<span class="fanbili">上车地理位置</span>
<span class="fanbili">上车地理位置{{index+1}}</span>
<div class="RabateDiv clearfix">
<div class="RebateCount reOne">
<div class="leftPnum">经度</div>
......@@ -829,25 +860,17 @@
</div>
</div>
</div>
<el-form-item label="距离中心范围" :prop="`PlaceList.${index}.Range`" :rules="rules.Range" >
<el-form-item :label="`距离中心范围${index+1}`" :prop="`PlaceList.${index}.Range`" :rules="rules.Range" >
<el-input type="Number" placeholder="上车距离中心范围" class="w300 addAddress" v-model="item.Range"></el-input>
</el-form-item>
<!-- <el-form-item label="上车多边形描点" prop="">
<!-- <el-form-item :label="`上车多边形描点${index+1}`" prop="">
<el-input type="Number" placeholder="上车多边形描点" class="w300 addAddress" v-model="item.LngLatMultiple">
<el-button slot="append" @click="selectAddress = true" icon="iconfont icon-img_dw"></el-button>
<el-button slot="append" @click="clickMapAddress(3,item.Address,index)" icon="iconfont icon-img_dw"></el-button>
</el-input>
</el-form-item> -->
</div>
</template>
<el-form-item label="包车时长" prop="TravelHours" v-if="addMsg.CarType==3">
<el-input type="Number" placeholder="请输入包车时长" class="w300 addAddress" :min="0" v-model="addMsg.TravelHours">
<span slot="append"> 小时 </span>
</el-input>
</el-form-item>
<el-form-item label="提前取消时间" prop="">
<el-input type="Number" placeholder="提前几天可免费取消" class="w300 addAddress" :min="0" v-model="addMsg.FreeCancelDay">
<span slot="append"></span>
</el-input>
</el-form-item>
</div>
<div class="resource-imginfo">
<div class="resourcerightTop">
......@@ -937,12 +960,6 @@
<Map @refList="selectAddress=false" v-on:headCallBack="headCall"
v-bind:Address="Address"
:id="ID" :type="MapType" :index="index"></Map>
<!-- <template v-if="MapType==1">
<Map @refList="selectAddress=false" v-on:headCallBack="headCall" v-bind:Address="addMsg.AirportList[0].Address" :id="ID" :type="MapType"></Map>
</template>
<template v-else>
<Map2 @refList="selectAddress=false" v-on:headCallBack="headCall" v-bind:Address="addMsg.AirportList[0].Address" :id="ID" :type="MapType"></Map2>
</template> -->
</el-dialog>
<div class="btn-list">
......@@ -957,11 +974,16 @@
</template>
<script>
import Map from "./components/Map.vue";
import Map2 from "./components/Map.vue";
import DMCchooseImg from "../../commonPage/DMCchooseImg.vue";
export default {
components: {
Map: Map,
DMCchooseImg: DMCchooseImg
},
data() {
return {
PlaceShow: true,
AirportShow: true,
index:'',
Address: '',//地址
MapType:1,//1机场 2上车
......@@ -1053,7 +1075,7 @@
PlaceList: [//接机地址
{
Id:0,
ProductId: 0,//产品id
ProductId: '',//产品id
Lng: '',
Lat: '',
Name: '',//地点名称
......@@ -1065,7 +1087,7 @@
AirportList:[//送机地址
{
Id:0,
ProductId: 0,//产品id
ProductId: '',//产品id
AirportId: '',//机场id
Lng: '',
Lat: '',
......@@ -1093,7 +1115,7 @@
AirportList://机场
{
Id:0,
ProductId: 0,//产品id
ProductId: '',//产品id
AirportId: '',//机场id
Lng: '',
Lat: '',
......@@ -1103,7 +1125,7 @@
PlaceList://地点
{
Id:0,
ProductId: 0,//产品id
ProductId: '',//产品id
Lng: '',
Lat: '',
Name: '',//地点名称
......@@ -1223,12 +1245,14 @@
loading: false
};
},
components: {
Map: Map,
Map2: Map2,
DMCchooseImg: DMCchooseImg
},
methods: {
clickShow(type){
if(type==1){
this.AirportShow = !this.AirportShow
}else{
this.PlaceShow = !this.PlaceShow
}
},
clickMapAddress(type,index){
this.index = index
this.MapType = type
......@@ -1548,16 +1572,33 @@
});
},
submitForm(addMsg) {
if(this.addMsg.PlaceList[0].Range&&this.addMsg.PlaceList[0].LngLatMultiple){
return this.tips('请输入距离中心点范围', "error");
}
if(!this.addMsg.ImageList[0]){
return this.tips('请上传图片', "error");
if(this.addMsg.CarType==3){
this.addMsg.AirportList = []
}
//提交创建、修改表单
let that = this;
that.$refs[addMsg].validate(valid => {
if (valid) {
let PlaceList = that.addMsg.PlaceList
let AirportList = that.addMsg.AirportList
for(let i=0;i<PlaceList.length;i++){
if(!PlaceList[i].Range){
return that.tips(`请输入上车距离中心范围${i+1}`, "error");
}
if(!PlaceList[i].Lng||!PlaceList[i].Lat){
return that.tips(`请选择上车信息地图获取地理位置${i+1}`, "error");
}
}
if(this.addMsg.CarType!=3){
for(let i=0;i<AirportList.length;i++){
if(!AirportList[i].Lng||!AirportList[i].Lat){
return that.tips(`请选择机场地址信息地图获取地理位置${i+1}`, "error");
}
}
}
if(!that.addMsg.ImageList[0]){
return that.tips('请上传图片', "error");
}
that.saveResource();
} else {
return false;
......@@ -1653,20 +1694,27 @@
googleMap() {
this.selectAddress = false;
},
headCall(msg,type) {
headCall(msg,type,index,address_detail) {
// this.addMsg.QCountry = msg.country;
// this.addMsg.QProvince = msg.province;
// this.addMsg.QCity = msg.city;
// this.addMsg.Address = msg.address;
// console.log(msg,type,index,address_detail,'-----')
if(type==1){
this.addMsg.AirportList.forEach(x=>{
this.addMsg.AirportList.forEach((x,i)=>{
if(i==index){
x.Lng = msg.lng;
x.Lat = msg.lat;
x.Address = address_detail
}
})
}else{
this.addMsg.PlaceList.forEach(x=>{
}if(type==2){
this.addMsg.PlaceList.forEach((x,i)=>{
if(i==index){
x.Lng = msg.lng;
x.Lat = msg.lat;
x.Address = address_detail
}
})
}
......@@ -1759,9 +1807,11 @@
this.querys = this.$route.query
this.ID = this.querys.id;
this.addMsg.Name = this.querys.Name
this.PlaceList.ProductId = this.ID
this.AirportList.ProductId = this.ID
this.init(); //开放平台
this.GetCounrty();
if (typeof this.ID != "undefined") {
if (this.ID >0) {
this.initHotelData();
}
}
......
......@@ -251,7 +251,7 @@
<button class="hollowFixedBtn" type="button"
@click="resetPageIndex(),selectResource()">{{$t('pub.searchBtn')}}</button>
<button class="normalBtn" type="button"
@click="$router.push('CharteringInfoManage')">{{$t('pub.addBtn')}}</button>
@click="goUrl('CharteringInfoManage')">{{$t('pub.addBtn')}}</button>
<!-- <button class="hollowFixedBtn" type="button" @click="DownLoadFile()">{{$t('adm.adm_download')}}</button> -->
</li>
</ul>
......@@ -527,6 +527,7 @@
);
},
goUrl(path, id) {
if(id){
this.$store.commit("pageConditionUpdate", this.msg);
this.$router.push({
path: path,
......@@ -536,6 +537,17 @@
tab: '修改产品信息'
}
});
}else{
this.$router.push({
path: path,
query: {
id: 0,
blank: 'y',
tab: '新增产品信息'
}
});
}
},
goUrlT(path, id,Name) {
let data = {
......
<template>
<div>
<div style="text-align: center;display: flex;justify-content: center;">
<el-input class="w300" style="margin-right: 10px;" id="suggestId" v-model="city" placeholder="请输入搜索名称" name="address_detail" />
<input type="button" class="normalBtn sureBtn" value="搜索" @click="search"/>
<el-input class="w300" style="margin-right: 10px;" id="suggestId" v-model="city"
placeholder="请输入需要检索的地名" name="address_detail" @input="search"/>
<!-- <input type="button" class="normalBtn sureBtn" value="搜索" @click="search"/> -->
</div>
<div style="height: 330px;width: 100%;margin-top: 15px;" :id="`allmap_${id}${type}_${index}`"></div>
<div style="height: 310px;width: 100%;margin-top: 15px;" :id="`allmap_${id}${type}_${index}`"></div>
<div style="margin-top: 10px;" v-if="address_detail">已选地址:{{address_detail}}</div>
<div class="btnList">
<input type="button" class="normalBtn sureBtn" value="确定" @click="sendMsg"/>
<input type="button" class="hollowFixedBtn" value="取消" @click="closeDialog"/>
......@@ -19,20 +21,23 @@ export default {
return{
city: '',
address_detail: null, //详细地址
add_housing_list: [""],
userlocation: null,
dataList: null,
point: {
lng:'',
lat: ''
}
},
}
},
watch: {
Address: {
handler(newValue) {
this.city = this.Address
if(!newValue){
this.getcity()
}else{
this.search()
}
},
immediate: true
},
......@@ -47,9 +52,9 @@ export default {
},
sendMsg() {
if (!this.point.lng) {
this.Error("请搜索选择");
this.Error("请点击地图上你需要选择的地址");
} else {
this.$emit("headCallBack", this.point,this.type);
this.$emit("headCallBack", this.point,this.type,this.index,this.address_detail);
this.$emit("refList");
}
},
......@@ -69,16 +74,17 @@ export default {
})
local.search(that.city)
map.addEventListener('click', function(e,target) {
var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
map.centerAndZoom(point, 15)
// console.log(e,target)
// // 经度
// console.log(that.userlocation.lng)
// // 纬度
// console.log(that.userlocation.lat)
// var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
// map.centerAndZoom(point, 11)
// that.point = e.point
})
var gc = new BMap.Geocoder();
map.addEventListener('mousedown', function(type) {
var pt = type.point;
gc.getLocation(pt, function(rs){
var addComp = rs.addressComponents;
that.address_detail = addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber
})
map.addEventListener('mousedown', function(type, target, point,pixel) {
console.log(type.point, target+'---', point+'---',pixel+'---')
})
},
getcity(){
......@@ -86,22 +92,53 @@ export default {
var that = this
// 创建Map实例
var map = new BMap.Map(`allmap_${that.id}${that.type}_${that.index}`)
// 获取当前位置
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function(r){
if(r){
var mk = new BMap.Marker(r.point);
map.addOverlay(mk);
map.panTo(r.point);
that.address_detail = addComp.province + "" + addComp.city + "" + addComp.district + "" + addComp.street + "" + addComp.streetNumber
that.point.lng = r.point.lng
that.point.lat = r.point.lat
console.log(that.address_detail,'城市===')
console.log('您的位置:'+r.point.lng+','+r.point.lat);
}
else {
console.log('failed');
}
});
// 点击地图
map.addEventListener('click', function(e,target) {
// var point = new BMap.Point(e.point.lng, e.point.lat) // 创建点坐标,汉得公司的经纬度坐标
// map.centerAndZoom(point, 11)
// that.point = e.point
})
var gc = new BMap.Geocoder();
map.addEventListener('mousedown', function(type) {
map.centerAndZoom(type.point, 11)
that.point = type.point
var pt = type.point;
gc.getLocation(pt, function(rs){
var addComp = rs.addressComponents;
that.address_detail = addComp.province + "" + addComp.city + "" + addComp.district + "" + addComp.street + "" + addComp.streetNumber
})
})
// 初始化地图,设置中心点坐标,
var point = new BMap.Point(120.211877, 30.255194) // 创建点坐标
map.centerAndZoom(point, 15)
if(that.point.lat){
var point = new BMap.Point(that.point.lat, that.point.lng) // 创建点坐标
map.centerAndZoom(point, 11)
}else{
map.centerAndZoom(new BMap.Point(104.073652,30.664369), 11);
}
map.enableScrollWheelZoom()
if(that.Address){
that.search()
}
})
},
// 新增小区 点击的地址增加进list
add_housing() {
this.add_housing_list.push(this.city)
},
// 删除小区
delete_housing(index) {
// console.log(index)
this.add_housing_list.splice(index, 1)
},
}
}
</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