Browse Source

更新

dev-warehouse
zhangsiyu 2 years ago
parent
commit
62c8668fc8
  1. 2
      src/views/distribution/delivery/distributionDelivery.vue
  2. 211
      src/views/distribution/reservation/atlas.vue
  3. 17
      vite.config.js

2
src/views/distribution/delivery/distributionDelivery.vue

@ -144,7 +144,7 @@
</template>
<script>
import { addDelivery, getDetailDelivery, addDelivery, updateDelivery, removeDelivery } from "@/api/distribution/distributionDelivery";
import { addDelivery, getDetailDelivery, updateDelivery, removeDelivery } from "@/api/distribution/distributionDelivery";
import option from "@/option/distribution/distributionDelivery";
import { mapGetters } from "vuex";

211
src/views/distribution/reservation/atlas.vue

@ -1,134 +1,101 @@
<template>
<div class="bmap" id="container" style="float: left"></div>
<div
style="
border: 1px solid pink;
margin-left: 5px;
height: 600px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
"
>
<!-- @change="handleCheckedCitiesChange"-->
<el-checkbox-group v-model="reservationIds">
<el-col v-for="(item, index) in reservationData">
<el-checkbox :label="item.id" :key="item.id"
>{{ item.consignee }}&emsp;{{ item.deliveryAddress }}&emsp;{{
item.deliveryPhone
}}</el-checkbox
>
</el-col>
</el-checkbox-group>
</div>
<div class="bmap" id="container" style="float: left">
</div>
<div style="border:1px solid pink ;margin-left: 5px;height: 600px;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)" >
<!-- @change="handleCheckedCitiesChange"-->
<el-checkbox-group v-model="reservationIds" >
<el-col v-for="(item,index) in reservationData">
<el-checkbox :label="item.id" :key="item.id">{{item.consignee}}&emsp;{{item.deliveryAddress}}&emsp;{{item.deliveryPhone}}</el-checkbox>
</el-col>
</el-checkbox-group>
</div>
<div style="margin-left: 40%;margin-top: 5%;float: bottom">
<el-button type="primary" icon="el-icon-circle-close" @click="aaa">确认(转配送页面)</el-button>
<el-button icon="el-icon-circle-close" @click="this.$router.go(-1)"> </el-button>
</div>
<div style="margin-left: 40%; margin-top: 5%; float: bottom">
<el-button type="primary" icon="el-icon-circle-close" @click="aaa">确认(转配送页面)</el-button>
<el-button icon="el-icon-circle-close" @click="this.$router.go(-1)"> </el-button>
</div>
</template>
<script>
import { useStore } from 'vuex'
import { getReservationAddr } from '@/api/distribution/distributionReservation';
import { getDictionaryBiz } from '@/api/system/dict';
// import { ref } from 'vue'
export default {
data () {
return {
name: 'BmapDemo',
loading: true,
ids: null,
error: null,
addressList:[],
reservationData:[],
reservationIds:[],
setup() {
// const store = useStore()
// let latitude = ref('')
// let longitude = ref('')
// console.log(store.state.record.latitude)
// latitude.value = store.state.record.latitude
// longitude.value = store.state.record.longitude
// return {
// latitude,
// longitude
// }
<script setup>
import { useStore } from 'vuex';
import { getReservationAddr } from '@/api/distribution/distributionReservation';
import { getDictionaryBiz } from '@/api/system/dict';
import { onMounted, reactive, toRefs } from 'vue';
import { useRouter } from 'vue-router';
let router = useRouter();
let details = reactive({
name: 'BmapDemo',
loading: true,
ids: null,
error: null,
addressList: [],
reservationData: [],
reservationIds: [],
});
onMounted(() => {});
function init() {
let map = new BMapGL.Map('container'); //
let point = new BMapGL.Point(116.404, 39.915); //
map.centerAndZoom(point, 15);
map.enableScrollWheelZoom(true);
let myGeo = new BMapGL.Geocoder();
myGeo.getPoint('四川成都', function (point) {
if (point) {
map.centerAndZoom(point, 16);
console.log(point);
} else {
// alert('');
console.log(point);
console.log('您选择的地址没有解析到结果!');
}
});
}
function initMap(ids) {
if (ids.length > 1) {
ids.split(',');
}
},
created() {
this.$watch(
() => this.$route.params,
() => {
this.fetchData();
},
//
// data observed
{ immediate: true }
)
//
this.initMap(this.ids);
},
methods:{
fetchData() {
this.error = this.post = null
this.loading = true
if (this.$route.query.id){
this.ids= this.$route.query.id;
}
},
initMap(ids){
if (ids.length>1){
ids.split(",")
}
this.loading = true;
getReservationAddr(ids).then(res=>{
res.data.data.forEach(item=>{
this.ids.split(",").forEach(id=>{
if (item.id==id){
this.reservationIds.push(item.id)
}
})
})
console.log(this.reservationIds);
this.reservationData = res.data.data;
this.addressList=res.data.data;
})
this.loading = false;
},
aaa(){
console.log(">>>>>>>>>>>",this.reservationIds);
let ids = this.reservationIds.join(",")
this.$router.push({
path: '/distribution/deliveryInfo/deliveryInfo',
query: {
id: ids
}
this.loading = true;
getReservationAddr(ids).then(res => {
res.data.data.forEach(item => {
this.ids.split(',').forEach(id => {
if (item.id == id) {
this.reservationIds.push(item.id);
}
});
});
},
},
mounted() {
console.log(this.reservationIds);
this.reservationData = res.data.data;
let map = new BMapGL.Map("container"); //
let point = new BMapGL.Point(116.404, 39.915); //
map.centerAndZoom(point, 15);
let content = "label";
let label = new BMapGL.Label(content, { //
position: point, //
offset: new BMapGL.Size(10, 20) //
})
map.addOverlay(label);
map.addOverlay(label); //
label.setStyle({ // label
color: '#000',
fontSize: '30px',
border: '2px solid #1E90FF'
})
},
}
this.addressList = res.data.data;
});
this.loading = false;
}
function aaa() {
console.log('>>>>>>>>>>>', this.reservationIds);
let ids = this.reservationIds.join(',');
this.$router.push({
path: '/distribution/deliveryInfo/deliveryInfo',
query: {
id: ids,
},
});
}
</script>
<style scoped>
.bmap {
width: 800px;
height: 600px;
border: 1px solid pink;
}
.bmap {
width: 800px;
height: 600px;
border: 1px solid pink;
}
</style>

17
vite.config.js

@ -29,5 +29,22 @@ export default ({ mode, command }) => {
},
},
plugins: createVitePlugins(env, command === 'build'),
build: {
chunkSizeWarningLimit: 1000,
rollupOptions: {
output: {
// 分包
manualChunks(id) {
if (id.includes("node_modules")) {
return id
.toString()
.split("node_modules/")[1]
.split("/")[0]
.toString();
}
},
},
},
}
});
};

Loading…
Cancel
Save