Browse Source

更新

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

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

@ -144,7 +144,7 @@
</template> </template>
<script> <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 option from "@/option/distribution/distributionDelivery";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";

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

@ -1,134 +1,101 @@
<template> <template>
<div class="bmap" id="container" style="float: left"></div>
<div class="bmap" id="container" style="float: left"> <div
style="
</div> border: 1px solid pink;
<div style="border:1px solid pink ;margin-left: 5px;height: 600px;box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)" > margin-left: 5px;
<!-- @change="handleCheckedCitiesChange"--> height: 600px;
<el-checkbox-group v-model="reservationIds" > box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
<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> >
<!-- @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-col>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<div style="margin-left: 40%;margin-top: 5%;float: bottom"> <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 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> <el-button icon="el-icon-circle-close" @click="this.$router.go(-1)"> </el-button>
</div> </div>
</template> </template>
<script> <script setup>
import { useStore } from 'vuex' import { useStore } from 'vuex';
import { getReservationAddr } from '@/api/distribution/distributionReservation'; import { getReservationAddr } from '@/api/distribution/distributionReservation';
import { getDictionaryBiz } from '@/api/system/dict'; import { getDictionaryBiz } from '@/api/system/dict';
// import { ref } from 'vue' import { onMounted, reactive, toRefs } from 'vue';
export default { import { useRouter } from 'vue-router';
data () { let router = useRouter();
return { let details = reactive({
name: 'BmapDemo', name: 'BmapDemo',
loading: true, loading: true,
ids: null, ids: null,
error: null, error: null,
addressList:[], addressList: [],
reservationData:[], reservationData: [],
reservationIds:[], reservationIds: [],
setup() { });
// const store = useStore() onMounted(() => {});
// let latitude = ref('') function init() {
// let longitude = ref('') let map = new BMapGL.Map('container'); //
// console.log(store.state.record.latitude) let point = new BMapGL.Point(116.404, 39.915); //
// latitude.value = store.state.record.latitude map.centerAndZoom(point, 15);
// longitude.value = store.state.record.longitude map.enableScrollWheelZoom(true);
// return { let myGeo = new BMapGL.Geocoder();
// latitude, myGeo.getPoint('四川成都', function (point) {
// longitude if (point) {
// } map.centerAndZoom(point, 16);
} console.log(point);
} else {
// alert('');
console.log(point);
console.log('您选择的地址没有解析到结果!');
} }
}, });
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;
} }
}, function initMap(ids) {
initMap(ids){ if (ids.length > 1) {
if (ids.length>1){ ids.split(',');
ids.split(",")
} }
this.loading = true; this.loading = true;
getReservationAddr(ids).then(res=>{ getReservationAddr(ids).then(res => {
res.data.data.forEach(item=>{ res.data.data.forEach(item => {
this.ids.split(",").forEach(id=>{ this.ids.split(',').forEach(id => {
if (item.id==id){ if (item.id == id) {
this.reservationIds.push(item.id) this.reservationIds.push(item.id);
} }
}) });
}) });
console.log(this.reservationIds); console.log(this.reservationIds);
this.reservationData = res.data.data; this.reservationData = res.data.data;
this.addressList=res.data.data; this.addressList = res.data.data;
}) });
this.loading = false; this.loading = false;
}
}, function aaa() {
aaa(){ console.log('>>>>>>>>>>>', this.reservationIds);
console.log(">>>>>>>>>>>",this.reservationIds); let ids = this.reservationIds.join(',');
let ids = this.reservationIds.join(",")
this.$router.push({ this.$router.push({
path: '/distribution/deliveryInfo/deliveryInfo', path: '/distribution/deliveryInfo/deliveryInfo',
query: { query: {
id: ids id: ids,
}
});
},
}, },
mounted() { });
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'
})
},
} }
</script> </script>
<style scoped> <style scoped>
.bmap { .bmap {
width: 800px; width: 800px;
height: 600px; height: 600px;
border: 1px solid pink; border: 1px solid pink;
} }
</style> </style>

17
vite.config.js

@ -29,5 +29,22 @@ export default ({ mode, command }) => {
}, },
}, },
plugins: createVitePlugins(env, command === 'build'), 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