Commit 5396e2ab authored by youjie's avatar youjie

no message

parent 24026294
......@@ -94,13 +94,13 @@
<span>
<em>业务员</em>
<el-select filterable v-model='msg.EnterID' class="">
<el-option :value="0" label="不限"></el-option>
<el-option v-for='item in EmployeeList'
:label='item.EmName'
:value='item.EmployeeId'
:key='item.EmployeeId'>
</el-option>
</el-select>
<el-option :value="0" label="不限"></el-option>
<el-option v-for='item in EmployeeList'
:label='item.EmName'
:value='item.EmployeeId'
:key='item.EmployeeId'>
</el-option>
</el-select>
</span>
</li>
......@@ -304,7 +304,7 @@
this.Datelist = this.getyMDOne()
this.userInfo = this.getLocalStorage();
this.GetList();
//自适应高度调节
this.com_onresize();
window.onresize = () => {
......
......@@ -854,7 +854,7 @@
<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, index, item.Address,)"
<el-button slot="append" @click="clickMapAddress(2, index, item.Address)"
icon="iconfont icon-img_dw"></el-button>
</el-input>
</el-form-item>
......@@ -1262,9 +1262,10 @@ export default {
this.PlaceShow = !this.PlaceShow
}
},
clickMapAddress(type, index) {
clickMapAddress(type, index, Address) {
this.index = index
this.MapType = type
this.Address = Address
this.selectAddress = true
},
clickAirport(index, type) {
......
<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="search" />
<!-- <input type="button" class="normalBtn sureBtn" value="搜索" @click="search"/> -->
</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" />
</div>
<baidu-map v-bind:style="mapStyle" class="bm-view"
ak="L5Qw0GlbbCIMwgR4Uug3ogM40Imkd3CV"
:center="center" :zoom="zoom" :scroll-wheel-zoom="true"
@click="getClickInfo" @moving="syncCenterAndZoom" @moveend="syncCenterAndZoom" @zoomend="syncCenterAndZoom">
<bm-view style="width: 100%; height:400px;"></bm-view>
<bm-marker :position="{lng: center.lng, lat: center.lat}"
:dragging="true"
animation="BMAP_ANIMATION_BOUNCE">
</bm-marker>
<bm-control :offset="{width: '10px', height: '10px'}">
<bm-auto-complete v-model="keyword" :sugStyle="{zIndex: 999999}">
<input v-model="keyword" type="text" placeholder="请输入搜索关键字" class="serachinput">
</bm-auto-complete>
<button class="normalBtn" type="primary" @click="determineLngLat">
确定
</button>
</bm-control>
<bm-local-search :keyword="keyword" :auto-viewport="true"
style="width:0px;height:0px;overflow: hidden;"></bm-local-search>
</baidu-map>
</div>
</template>
<script>
import {BaiduMap, BmControl,
BmView, BmAutoComplete,
BmLocalSearch, BmMarker} from 'vue-baidu-map'
export default {
props: ["Address", "id", "type", "index"],
components: {
BaiduMap,
BmControl,
BmView,
BmAutoComplete,
BmLocalSearch,
BmMarker
},
data() {
return {
city: '',
address_detail: null, //详细地址
userlocation: null,
dataList: null,
point: {
lng: '',
lat: ''
keyword: '',
mapStyle: {
width: '100%',
height: '100%'
},
center: {lng: 116.404, lat: 39.915},
zoom: 15,
}
},
watch: {
Address: {
handler(newValue) {
this.city = this.Address
if (!newValue) {
this.getcity()
} else {
this.search()
}
handler(newValue,onldValue) {
this.keyword = newValue
},
immediate: true
},
},
mounted() {
this.city = this.Address
this.getcity()
this.keyword = this.Address
},
methods: {
closeDialog() {
this.$emit("refList");
getClickInfo (e) {
// console.log(e,'---')
// this.center.lng = e.point.lng
// this.center.lat = e.point.lat
},
syncCenterAndZoom (e) {
const {lng, lat} = e.target.getCenter()
this.center.lng = lng
this.center.lat = lat
this.zoom = e.target.getZoom()
},
sendMsg() {
if (!this.point.lng) {
this.Error("请点击地图上你需要选择的地址");
} else {
this.$emit("headCallBack", this.point, this.type, this.index, this.address_detail);
// 经纬度
determineLngLat(){
if(this.center.lng){
this.$emit("headCallBack", this.center, this.type, this.index, this.keyword);
this.$emit("refList");
}else{
this.Error("请搜索您需要选择的地址");
}
},
search() {
var that = this
var map = new BMap.Map(`allmap_${that.id}${that.type}_${that.index}`, { enableMapClick: false })
var local = new BMap.LocalSearch(map, { // 智能搜索
onSearchComplete: function () {
if (local.getResults() && local.getResults().getPoi(0) && local.getResults().getPoi(0).point) {
that.userlocation = local.getResults().getPoi(0).point // 获取第一个智能搜索的结果
that.point.lat = that.userlocation.lat
that.point.lng = that.userlocation.lng
map.centerAndZoom(that.userlocation, 15)
map.addOverlay(new BMap.Marker(that.userlocation)) // 添加标注
}
}
})
local.search(that.city)
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) {
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
})
})
},
getcity() {
this.$nextTick(function () {
var that = this
// 创建Map实例
var map = new BMap.Map(`allmap_${that.id}${that.type}_${that.index}`, { enableMapClick: false })
// 获取当前位置
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);
// map.mapClick = false
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
})
})
// 初始化地图,设置中心点坐标,
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()
}
})
},
}
}
</script>
<style scoped>
.btnList {
margin: 15px 0 0 auto;
text-align: right;
margin-bottom: 15px;
.serachinput{
margin-left: 10px;
margin-top: 10px;
width: 350px;
height: 30px;
margin-right: 10px;
}
</style>
\ No newline at end of file
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