|
|
|
|
@ -7,7 +7,11 @@
|
|
|
|
|
|
|
|
|
|
<slot>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-select size="small" placeholder="关联板块" multiple v-model="selector.product_type_id" style="width:260px;margin-right: 10px;">
|
|
|
|
|
<el-option v-for="(item,index) in types" :key="item.id" :value="item.id" :label="item.name" ></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-cascader
|
|
|
|
|
size="small"
|
|
|
|
|
:value="selector.area_id"
|
|
|
|
|
style="width: 200px;"
|
|
|
|
|
placeholder="区域选择"
|
|
|
|
|
@ -20,6 +24,7 @@
|
|
|
|
|
@change="areaClick"
|
|
|
|
|
>
|
|
|
|
|
</el-cascader>
|
|
|
|
|
<el-button size="small" type="primary" style="margin-left: 10px;" @click="search">搜索</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <Input placeholder="关键字搜索" v-model="selector.keyword" style="width: 200px; margin-right: 10px" />-->
|
|
|
|
|
|
|
|
|
|
@ -63,6 +68,8 @@
|
|
|
|
|
import { getparameter } from '@/api/system/dictionary'
|
|
|
|
|
import { AMapManager,lazyAMapApiLoaderInstance } from 'vue-amap'
|
|
|
|
|
import { getList } from '@/api/customer'
|
|
|
|
|
import {getList as getTypes} from "@/api/productType";
|
|
|
|
|
import {deepCopy} from "@/utils";
|
|
|
|
|
|
|
|
|
|
const amapManager = new AMapManager()
|
|
|
|
|
export default {
|
|
|
|
|
@ -73,7 +80,8 @@ export default {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
keyword: '',
|
|
|
|
|
area_id:''
|
|
|
|
|
area_id:'',
|
|
|
|
|
product_type_id:[]
|
|
|
|
|
},
|
|
|
|
|
height:0,
|
|
|
|
|
amapManager,
|
|
|
|
|
@ -82,6 +90,7 @@ export default {
|
|
|
|
|
markers:[],
|
|
|
|
|
polygons:[],
|
|
|
|
|
areas:[],
|
|
|
|
|
types:[],
|
|
|
|
|
|
|
|
|
|
isShowCard:false,
|
|
|
|
|
select:'',
|
|
|
|
|
@ -89,6 +98,19 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async search(){
|
|
|
|
|
await this.getCustomers()
|
|
|
|
|
this.draw()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getTypes() {
|
|
|
|
|
const res = await getTypes({
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 9999
|
|
|
|
|
}, false)
|
|
|
|
|
this.types = res.data
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getAreas(){
|
|
|
|
|
let city = await getparameter({
|
|
|
|
|
number: 'city'
|
|
|
|
|
@ -115,8 +137,6 @@ export default {
|
|
|
|
|
|
|
|
|
|
async areaClick(e){
|
|
|
|
|
this.selector.area_id = e
|
|
|
|
|
await this.getCustomers()
|
|
|
|
|
this.draw()
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
initDistrict(){
|
|
|
|
|
@ -147,7 +167,9 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
this.polygons.push(polygon)
|
|
|
|
|
}
|
|
|
|
|
this.map.add(this.polygons)
|
|
|
|
|
this.polygons.forEach(item1 => {
|
|
|
|
|
this.map.add(item1)
|
|
|
|
|
})
|
|
|
|
|
this.map.setFitView(this.polygons)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
@ -183,7 +205,9 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
async getCustomers(){
|
|
|
|
|
let res = await getList(this.selector)
|
|
|
|
|
let copySelect = deepCopy(this.selector)
|
|
|
|
|
copySelect.product_type_id = copySelect?.product_type_id.toString()
|
|
|
|
|
let res = await getList(copySelect)
|
|
|
|
|
this.customers = res.data.data.map(item => {
|
|
|
|
|
let address = item.customer_address.filter(item => item.default === 1)[0] ? item.customer_address.filter(item => item.default === 1)[0] : item.customer_address[0]
|
|
|
|
|
return {
|
|
|
|
|
@ -223,7 +247,10 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
draw(){
|
|
|
|
|
this.map.remove(this.polygons)
|
|
|
|
|
this.map.clearMap()
|
|
|
|
|
this.polygons.forEach(item => {
|
|
|
|
|
this.map.remove(item)
|
|
|
|
|
})
|
|
|
|
|
this.map.remove(this.markers)
|
|
|
|
|
this.drawMarkers()
|
|
|
|
|
this.drawPolygon(this.areaMap.get(this.selector.area_id) || '常州市')
|
|
|
|
|
@ -243,6 +270,7 @@ export default {
|
|
|
|
|
created() {
|
|
|
|
|
this.initLoad()
|
|
|
|
|
this.getAreas()
|
|
|
|
|
this.getTypes()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|