Browse Source

配送计划地图呈现、市配配送编辑数据回显

dev-warehouse
kilo 2 years ago
parent
commit
a07d107b8c
  1. 2
      src/views/distribution/deliverylist/distributionDeliveryList.vue
  2. 2
      src/views/distribution/deliverylist/distributionDeliveryListdis.vue
  3. 4
      src/views/distribution/deliverylist/distributionDeliveryListmar.vue
  4. 1
      src/views/distribution/reservation/atlas.vue
  5. 108
      src/views/distribution/reservation/atlas1.vue
  6. 2
      src/views/distribution/turndelivery/deliveryDiscuss.vue
  7. 148
      src/views/distribution/turndelivery/deliveryMarket.vue

2
src/views/distribution/deliverylist/distributionDeliveryList.vue

@ -52,7 +52,7 @@
<template #default="slotProps">
<el-button size="small" @click="editsolt(slotProps.scope)"> </el-button>
<el-button size="small" @click="editmap(slotProps.scope)"> </el-button>
<el-button size="small" @click="costadd(slotProps.scope)"> </el-button>
<!-- <el-button size="small" @click="costadd(slotProps.scope)"> </el-button>-->
</template>
</tablecmt>
<!-- <el-table ref="table" v-loading="loading"-->

2
src/views/distribution/deliverylist/distributionDeliveryListdis.vue

@ -43,7 +43,7 @@
<el-button size="small" @click="editsolt(slotProps.scope)"> </el-button>
<el-button size="small" @click="editmap(slotProps.scope)"> </el-button>
<el-button size="small" @click="handleEdit(slotProps.scope)"> </el-button>
<el-button size="small" @click="costadd(slotProps.scope)"> </el-button>
<!-- <el-button size="small" @click="costadd(slotProps.scope)"> </el-button>-->
</template>
</tablecmt>
<!-- <el-table ref="table" v-loading="loading"-->

4
src/views/distribution/deliverylist/distributionDeliveryListmar.vue

@ -40,8 +40,8 @@
<template #default="slotProps">
<el-button size="small" @click="editsolt(slotProps.scope)"> </el-button>
<el-button size="small" @click="editmap(slotProps.scope)"> </el-button>
<el-button size="small" @click="handleEdit(slotProps.scope)"> </el-button>
<el-button size="small" @click="costadd(slotProps.scope)"> </el-button>
<!-- <el-button size="small" @click="handleEdit(slotProps.scope)"> </el-button>-->
<!-- <el-button size="small" @click="costadd(slotProps.scope)"> </el-button>-->
</template>
</tablecmt>
<!-- <el-table ref="table" v-loading="loading"-->

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

@ -41,6 +41,7 @@ export default {
type:true,
}
},
mounted() {
let router = useRouter();
let type =router.currentRoute.value.query.type

108
src/views/distribution/reservation/atlas1.vue

@ -1,26 +1,27 @@
<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" ></div>
<!-- <div-->
<!-- style="-->
<!-- border: 1px solid pink;-->
<!-- margin-left: 5px;-->
<!-- height: 600px;-->
<!-- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);-->
<!-- "-->
<!-- >-->
<!-- &lt;!&ndash; @change="handleCheckedCitiesChange"&ndash;&gt;-->
<!-- <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">
<div style="margin-left: 50%; margin-top: 5%; float: bottom">
<el-button icon="el-icon-circle-close" @click="back"> </el-button>
</div>
</template>
@ -29,9 +30,12 @@
import { useStore } from 'vuex';
import { getReservationAddr } from '@/api/distribution/distributionReservation';
import { getDictionaryBiz } from '@/api/system/dict';
import { selectStockArticleAtlasInfo} from '@/api/distribution/distributionDeliveryList'
import { onMounted, reactive, toRefs, watchEffect } from 'vue';
import { selectStockArticleAtlasInfo } from '@/api/distribution/distributionDeliveryList';
import { onMounted, reactive, toRefs, createApp } from 'vue';
import { useRouter } from 'vue-router';
import { ref, watch } from "vue"
let router = useRouter();
let details = reactive({
name: 'BmapDemo',
@ -40,25 +44,41 @@ let details = reactive({
addressList: [],
reservationData: [],
reservationIds: [],
mapLoc: null,
mapLoc: null
});
onMounted(() => {
details.item = JSON.parse(router.currentRoute.value.query.item);
console.log("details.item.id------------->",details.item.id);
selectStockArticleAtlasInfo(details.item.id).then(res=>{
console.log("-------------->",res);
})
console.log("------------->",details.item);
setTimeout(() => {
init();
}, 1500);
console.log('details.item.id------------->', details.item.id);
watch(details.item.id, (newValue, oldValue) => {
console.log("item变了", newValue, oldValue);
a(details.item);
},{immediate:true});
console.log('------------->', details.item);
// setTimeout(()=>{
// details.mapLoc.clearOverlays();
// },9500)
});
function init() {
function a(data) {
selectStockArticleAtlasInfo(data.id).then(res => {
const data = res.data.data;
console.log('res------------->', data);
setTimeout(() => {
init(data);
}, 1500);
});
}
function init(data) {
details.mapLoc = new BMapGL.Map('container'); //
let point = new BMapGL.Point(116.404, 39.915); //
details.mapLoc.centerAndZoom(point, 12);
@ -67,8 +87,16 @@ function init() {
if (details.mapLoc) {
details.mapLoc.clearOverlays(); //label
}
maplabel('四川成都龙泉驿区','展示的内容', 0);
let a = data;
a.forEach((item,index)=>{
console.log('item------------->', item);
maplabel(item.customerAddress, item.customerName+"--"+item.customerAddress+"--"+item.customerTelephone, index);
// maplabel('-1-26-154', '', 0);
})
}
function maplabel(address, contents, index) {
let myGeo = new BMapGL.Geocoder();
myGeo.getPoint(address, function(point) {
@ -81,7 +109,7 @@ function maplabel(address,contents, index) {
let label = new BMapGL.Label(content, {
//
position: point,
offset: new BMapGL.Size(10, 20),
offset: new BMapGL.Size(10, 20)
});
details.mapLoc.addOverlay(label); //
label.setStyle({
@ -90,7 +118,7 @@ function maplabel(address,contents, index) {
fontSize: '10px',
border: '1px solid #1E90FF',
borderRadius: '20px',
padding: '5px 10px',
padding: '5px 10px'
});
console.log(label, '---------------');
} else {
@ -100,15 +128,19 @@ function maplabel(address,contents, index) {
}
});
}
function back() {
router.back(-1);
}
const { reservationIds }=toRefs(details)
const { reservationIds } = toRefs(details);
</script>
<style scoped>
.bmap {
width: 800px;
margin-top: 2%;
width: 1800px;
height: 600px;
border: 1px solid pink;
}

2
src/views/distribution/turndelivery/deliveryDiscuss.vue

@ -1479,7 +1479,7 @@
let data = res.data.data;
Object.assign(this.stockUpForm,data.reservationInfo)
Object.assign(this.stockUpForm,data.stockupInfo)
this.stockUpForm.deliveryType = '10';
this.stockUpForm.deliveryType = '1';
this.stockUpForm.deliveryWay = data.reservationInfo.deliveryWay;
this.serveType = data.reservationInfo.serveType.split(",");
if (data.stockupInfo){

148
src/views/distribution/turndelivery/deliveryMarket.vue

@ -177,7 +177,8 @@
</el-col>
<el-col :span="6">
<el-form-item label="备货时间:" prop="goodsShelfId">
<el-date-picker v-model="stockUpForm.stockupDate" type="datetime" placeholder="请选择备货时间" :disabled="isDisable">
<el-date-picker v-model="stockUpForm.stockupDate" type="datetime" placeholder="请选择备货时间"
:disabled="isDisable">
</el-date-picker>
</el-form-item>
</el-col>
@ -243,6 +244,13 @@
:key="index">
</el-table-column>
</template>
<el-table-column prop="menu" label="操作" :width="220" align="center" v-if="isoperation">
<template #="{row}">
<el-button type="primary" link icon="el-icon-edit" @click="removeStockArticle(row)">移除
</el-button>
</template>
</el-table-column>
<!-- 操作栏模块 -->
</el-table>
</el-row>
@ -457,6 +465,7 @@
},
isInitialized: false,
isUpdate: false,
isoperation: false
};
},
watch: {
@ -546,9 +555,9 @@
//
async getTeam() {
let params = this.deptId;
console.log("%%%%%%%%%",params);
console.log('%%%%%%%%%', params);
getListTeamInfo(params).then(res => {
console.log("aaaaaaaaa",res.data.data);
console.log('aaaaaaaaa', res.data.data);
let fo = [];
res.data.data.forEach(i => {
let a = {
@ -563,9 +572,9 @@
//
async getStorageArea() {
let params = this.deptId;
console.log("^^^^^^^^^^^^^",params);
console.log('^^^^^^^^^^^^^', params);
stockUpInfo(params).then(res => {
console.log("=========================》",res);
console.log('=========================》', res);
let fo = [];
res.data.data.forEach(i => {
let v = {
@ -582,20 +591,20 @@
return new Promise((rv, rev) => {
getDriverList(1, 10, '').then(res => {
this.driverData = res.data.data.records;
console.log("===============>",res.data.data);
rv(res.data.data.records)
console.log('===============>', res.data.data);
rv(res.data.data.records);
});
});
})
},
selectionChange(list) {
//
this.selectionList = list;
console.log(" this.selectionList = list", this.selectionList);
console.log(' this.selectionList = list', this.selectionList);
this.orderData.forEach(item => {
if (item.id === this.obj.id) {
item.isUpdate = true;
}
})
});
//
// this.obj.
},
@ -609,15 +618,15 @@
return new Promise((rv, rev) => {
getVehicleList(1, 10, '').then(res => {
this.vehicleData = res.data.data.records;
console.log("^^^^^^^^^^^^^^^^",res.data.data);
rv(res.data.data.records)
console.log('^^^^^^^^^^^^^^^^', res.data.data);
rv(res.data.data.records);
});
});
})
},
fetchData() {
this.error = this.post = null;
this.loading = true;
console.log("this.$route.query",this.$route.query);
console.log('this.$route.query', this.$route.query);
if (this.$route.query.id) {
this.reservationIds = this.$route.query.id;
}
@ -626,6 +635,17 @@
}
},
removeStockArticle(row){
if (this.data.length===1){
this.$message({
message: '无法进行预约任务取消!!!',
type: 'warning'
});
return;
}
console.log("row------------->",row);
},
viewDriverInfo() {
console.log(this.driverInfo.length);
console.log(this.vehticleInfo.length);
@ -751,15 +771,22 @@
data.taskTime = this.form.taskTime;
}
}
console.log('this.data------------>', this.data);
if (!this.deliveryListId) {
data.reservationIds = this.reservationIds;
console.log("this.data------------>",this.data);
console.log(">>>>>>>>>>>>",data);
console.log('>>>>>>>>>>>>', data);
deliveryTask(data).then((res) => {
this.$router.push({
path: '/distribution/deliverylist/distributionDeliveryListmar',
name: '配送市配列表'
});
});
} else {
data.reservationInfos =this.data ;
console.log('>>>>>>>>>>>>', data);
console.log('-------------》', '修改提交');
}
},
changeVehicle(params) {
console.log(params);
@ -814,7 +841,7 @@
} else {
this.$message({
message: '已经是第一条,上移失败',
type: 'warning',
type: 'warning'
});
}
console.log(this.vehticleInfo);
@ -889,8 +916,8 @@
}
this.aaa = true;
this.bbb = false;
this.stockUpForm.deliveryType="2";
this.stockUpForm.deliveryWay="2";
this.stockUpForm.deliveryType = '2';
this.stockUpForm.deliveryWay = '2';
this.stockUpForm.stockupDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
this.form.taskTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
this.stockUpForm.outboundDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
@ -909,8 +936,8 @@
}
this.aaa = false;
this.bbb = true;
this.stockUpForm.deliveryType="2";
this.stockUpForm.deliveryWay="2";
this.stockUpForm.deliveryType = '2';
this.stockUpForm.deliveryWay = '2';
this.form.taskTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
this.stockUpForm.stockupDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
this.stockUpForm.outboundDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
@ -921,20 +948,20 @@
},
onLoad(page, params = {}) {
//
this.stockUpForm.deliveryType="2";
this.stockUpForm.deliveryWay="2";
this.stockUpForm.deliveryType = '2';
this.stockUpForm.deliveryWay = '2';
this.stockUpForm.stockupDate = new Date();
this.form.taskTime = new Date();
this.stockUpForm.outboundDate = dayjs().format('YYYY-MM-DD HH:mm:ss');
this.stockUpForm.otherFee = 0;
this.loadAndUnload = ["1","2"] ;
this.loadAndUnload = ['1', '2'];
if (this.reservationIds) {
console.log("》》》》》》》》》》》》》》》",this.reservationIds);
this.isoperation = false;
console.log('》》》》》》》》》》》》》》》', this.reservationIds);
let ids = this.reservationIds;
getReservationAddr(ids).then(res => {
console.log("------------->",res);
console.log('------------->', res);
const reservationData = res.data.data;
this.page.total = reservationData.total;
this.data = reservationData.records;
@ -943,16 +970,68 @@
});
}
if (this.deliveryListId) {
console.log("<<<<<<<<<<",this.deliveryListId);
this.isoperation = true;
console.log('<<<<<<<<<<', this.deliveryListId);
//
getMarketDeliveryList(this.deliveryListId).then(res=>{
console.log(res.data.data);
})
getMarketDeliveryList(this.deliveryListId).then(async res => {
console.log('--------------->', res.data.data);
const deliveryData = res.data.data;
this.stockUpForm.outboundDate = deliveryData.stockupInfo.outboundDate;
this.stockUpForm.taskTime = deliveryData.stockupInfo.taskTime;
this.stockUpForm.goodsAreaId = deliveryData.stockupInfo.goodsAreaId;
this.stockUpForm.forklift = deliveryData.stockupInfo.forkliftId;
this.stockUpForm.loader = deliveryData.stockupInfo.loaderId;
this.stockUpForm.taskTime = deliveryData.taskTime;
console.log('reservationInfo--------------->', res.data.data.reservationInfo);
this.data = res.data.data.reservationInfos;
if (deliveryData.kind === '1') {
//
let self = deliveryData.deliverySelfVO;
let vehicle = await this.getvehicleData();
console.log('___________________-->', vehicle);
let driver = await this.getMasterDriverData();
let a = [];
let b = [];
let vehicleInfo = [];
vehicle.forEach(item => {
self.forEach(s => {
if (item.id === s.vehicleId) {
a.push(s.vehicleId);
vehicleInfo.push(item);
}
if (s.isMaster === 2) {
this.driverForm.masterVehicleNub = s.vehicleNub;
}
});
});
this.vehticleList = a;
this.vehicleIds = a;
console.log(' this.vehicleIds', this.vehicleIds);
this.vehticleInfo = vehicleInfo;
let driverInfo = [];
driver.forEach(item => {
self.forEach(s => {
if (item.id === s.driverId) {
b.push(s.driverId);
driverInfo.push(item);
}
if (s.isMaster === 2) {
this.driverForm.masterDriverName = s.driverName;
}
});
});
this.deliveryDriver = b;
this.driverList = b;
this.driverInfo = driverInfo;
} else {
}
});
}
this.loading = false;
},
},
}
}
};
</script>
@ -973,14 +1052,17 @@
border-bottom: 4px solid #ffffff;
// background-color: #ffffff;
}
.check {
color: #D3832A;
border-bottom: 4px solid #D3832A;
}
}
.minaxbox {
display: flex;
flex-direction: column;
.tophed {
display: flex;
flex-wrap: wrap;

Loading…
Cancel
Save