Compare commits
No commits in common. "95058b6e63f42778aeece01543d50cb663db40f7" and "b1c47a17e4e4c340000078c11d2f433ce777110d" have entirely different histories.
95058b6e63
...
b1c47a17e4
@ -98,7 +98,7 @@
|
|||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button size="mini" class="f-s-14" type="danger" icon="iconfont icon-meiyoudingdan-01" key="celBUt"
|
<el-button size="mini" class="f-s-14" type="danger" icon="iconfont icon-meiyoudingdan-01" key="celBUt"
|
||||||
@click="reQuest">
|
@click="reQuest">
|
||||||
<font class="m-l-5">取消任务</font>
|
<font class="m-l-5">未送达</font>
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini" class="f-s-14" type="success" icon="iconfont icon-qiandai" key="bingBut"
|
<el-button size="mini" class="f-s-14" type="success" icon="iconfont icon-qiandai" key="bingBut"
|
||||||
@click="overQuest">
|
@click="overQuest">
|
||||||
@ -301,9 +301,8 @@ export default {
|
|||||||
/**
|
/**
|
||||||
* @description: 已发货 订单列表
|
* @description: 已发货 订单列表
|
||||||
*/
|
*/
|
||||||
ShippedList () {
|
overQuestList () {
|
||||||
const plane = this.plane
|
return this.$store.state.paidOrderList.filter((item) => item.status === 'shipped')
|
||||||
return plane ? this.$store.state.paidOrderList.filter((item) => item.shop_id === plane.shop_id && item.shipment_status === '已发货') : []
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 当前选中的订单
|
* @description: 当前选中的订单
|
||||||
@ -502,7 +501,7 @@ export default {
|
|||||||
}
|
}
|
||||||
let res = await this.questAss(this.currentOrder.id, 'shipment_status', '已发货')// 订单改为发货状态 并更新订单列表
|
let res = await this.questAss(this.currentOrder.id, 'shipment_status', '已发货')// 订单改为发货状态 并更新订单列表
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
res = await this.$store.dispatch('fetchLockSite', { id: this.currentOrder.receive_site_id, shop_id: this.plane.shop_id, runing: newRuning })// 航线注册飞机 锁定送餐点
|
res = await this.$store.dispatch('fetchLockSite', { id: this.currentOrder.receive_site_id, runing: newRuning })// 航线注册飞机 锁定送餐点
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
this.publishFun(`{"questAss":${routeData}}`)// 发送航点信息主题
|
this.publishFun(`{"questAss":${routeData}}`)// 发送航点信息主题
|
||||||
this.speakText('提交任务,注册航线。')
|
this.speakText('提交任务,注册航线。')
|
||||||
@ -549,42 +548,25 @@ export default {
|
|||||||
*/
|
*/
|
||||||
reQuest () {
|
reQuest () {
|
||||||
if (!this.airLock) { // 只有飞机锁定状态 才向下执行 "取消"操作
|
if (!this.airLock) { // 只有飞机锁定状态 才向下执行 "取消"操作
|
||||||
this.$message.warning('当前没有执行任务')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$confirm('取消已发货状态,并使飞机复位?', '提示', {
|
this.$confirm('确认复位飞机状态,并清除航线的锁定?', '取消任务', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
/* 关联当前订单的站点 搜寻注册的飞机 并预设newRuning 用于注销runing字段航线 */
|
this.overQuestList.forEach((item) => {
|
||||||
let newRuning // 确保newRuning在函数块外定义
|
if (item.runing === this.plane.id) {
|
||||||
let receiveSiteId
|
/* 插入日志 */
|
||||||
let orderId
|
this.$store.dispatch('fetchLog', { content: `订单ID:${item.id},送餐任务取消。` })
|
||||||
const found = this.ShippedList.some((element) => {
|
/* 执行写在这里 */
|
||||||
const runing = element.runing.split(',')
|
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
||||||
return runing.some((item, index, arr) => {
|
this.questAss(item.id, 'status', 'pending')// 订单改回到发货状态之前 既“已付款状态”
|
||||||
if (item === this.plane.id.toString()) {
|
this.$store.dispatch('fetchLockSite', { id: item.receive_site_id, runing: 'null' })// 解锁航线
|
||||||
arr[index] = '' // 将匹配的id替换为空字符串
|
this.questForm.id = ''// 选择框设置成 空的状态
|
||||||
newRuning = runing.join(',')
|
speakText('任务取消,退回未备货状态')
|
||||||
orderId = element.id
|
}
|
||||||
receiveSiteId = element.receive_site_id
|
|
||||||
return true // 找到id后退出内层循环
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
/* 确认 把订单从发货退回到已接单 站点runing字段飞机航线注销 重置飞机状态 */
|
|
||||||
if (found) {
|
|
||||||
this.questAss(orderId, 'shipment_status', '已接单').then(res => { // 退回到已接单 并更新订单列表
|
|
||||||
if (res.data.status === 1) {
|
|
||||||
this.$store.dispatch('fetchLockSite', { id: receiveSiteId, shop_id: this.plane.shop_id, runing: newRuning }).then(res => { // 注销航线
|
|
||||||
if (res.data.status === 1) {
|
|
||||||
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message.info('取消操作!')
|
this.$message.info('取消操作!')
|
||||||
})
|
})
|
||||||
@ -594,42 +576,25 @@ export default {
|
|||||||
*/
|
*/
|
||||||
overQuest () {
|
overQuest () {
|
||||||
if (!this.airLock) { // 只有飞机锁定状态 才向量下执行 "已送达"操作
|
if (!this.airLock) { // 只有飞机锁定状态 才向量下执行 "已送达"操作
|
||||||
this.$message.warning('当前没有执行任务')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$confirm('确认订单已送达?', '提示', {
|
this.$confirm('确认将订单状态改为已送达吗?', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
/* 关联当前订单的站点 搜寻注册的飞机 并预设newRuning 用于注销runing字段航线 */
|
// 确认执行
|
||||||
let newRuning // 确保newRuning在函数块外定义
|
this.questList.map((item) => {
|
||||||
let receiveSiteId
|
if (item.runing === this.plane.id) { // 找出当前飞机正在执行的任务
|
||||||
let orderId
|
/* 插入日志 */
|
||||||
const found = this.ShippedList.some((element) => {
|
this.$store.dispatch('fetchLog', { content: `订单ID:${item.id} 送餐任务已完成。` })
|
||||||
const runing = element.runing.split(',')
|
/* 执行写在这里 */
|
||||||
return runing.some((item, index, arr) => {
|
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
||||||
if (item === this.plane.id.toString()) {
|
this.questAss(item.id, 'shipment_status', '已送达')// 订单改为已完成状态
|
||||||
arr[index] = '' // 将匹配的id替换为空字符串
|
this.$store.dispatch('fetchLockSite', { id: item.receive_site_id, runing: 'null' })// 解锁航线
|
||||||
newRuning = runing.join(',')
|
this.speakText('任务完成')
|
||||||
orderId = element.id
|
}
|
||||||
receiveSiteId = element.receive_site_id
|
|
||||||
return true // 找到id后退出内层循环
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
/* 确认 把订单从发货退回到已接单 站点runing字段飞机航线注销 重置飞机状态 */
|
|
||||||
if (found) {
|
|
||||||
this.questAss(orderId, 'shipment_status', '已送达').then(res => { // 订单改为已完成状态
|
|
||||||
if (res.data.status === 1) {
|
|
||||||
this.$store.dispatch('fetchLockSite', { id: receiveSiteId, shop_id: this.plane.shop_id, runing: newRuning }).then(res => { // 注销航线
|
|
||||||
if (res.data.status === 1) {
|
|
||||||
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message.info('取消操作!')
|
this.$message.info('取消操作!')
|
||||||
})
|
})
|
||||||
@ -687,16 +652,12 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 主动获取飞机状态
|
// 主动获取飞机状态
|
||||||
if (this.plane) {
|
this.publishFun('{getPlaneState:1}')
|
||||||
this.publishFun('{getPlaneState:1}')
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
airLock (val) {
|
airLock (val) {
|
||||||
if (val) { // 如果当前飞机正在执行任务 把航线绘制到地图上
|
if (val) { // 如果当前飞机正在执行任务 把航线绘制到地图上
|
||||||
if (this.siteList) {
|
this.makeRouteForMap()
|
||||||
this.makeRouteForMap()
|
|
||||||
}
|
|
||||||
} else { // 如果没有执行任务 把地图上航线清除
|
} else { // 如果没有执行任务 把地图上航线清除
|
||||||
this.$emit('clearRoute')
|
this.$emit('clearRoute')
|
||||||
}
|
}
|
||||||
@ -718,9 +679,6 @@ export default {
|
|||||||
if (!found) {
|
if (!found) {
|
||||||
this.questForm.id = ''
|
this.questForm.id = ''
|
||||||
}
|
}
|
||||||
},
|
|
||||||
plane (val) {
|
|
||||||
this.publishFun('{getPlaneState:1}')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -815,34 +773,4 @@ export default {
|
|||||||
.butIconBox .butIcon:nth-child(4n) {
|
.butIconBox .butIcon:nth-child(4n) {
|
||||||
margin-right: 0 !important;
|
margin-right: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 手机端样式 */
|
|
||||||
@media screen and (max-height: 500px) {
|
|
||||||
.tab-container {
|
|
||||||
height: 300px;
|
|
||||||
width: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.butIconGroup {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-button {
|
|
||||||
font-size: 14px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contentTit {
|
|
||||||
font-size: 14px !important;
|
|
||||||
margin-bottom: 5px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.contentTit i {
|
|
||||||
font-size: 18px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.butIcon {
|
|
||||||
height: 56px;
|
|
||||||
margin-bottom: 10px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -75,7 +75,7 @@ export default {
|
|||||||
mounted () {
|
mounted () {
|
||||||
this.init().then(() => { // 地图初始化之后
|
this.init().then(() => { // 地图初始化之后
|
||||||
this.map.on('load', () => {
|
this.map.on('load', () => {
|
||||||
/* 更新样式,添加自定义 sprite */
|
// 更新样式,添加自定义 sprite
|
||||||
|
|
||||||
// 星空背景 大气层
|
// 星空背景 大气层
|
||||||
this.map.setFog({
|
this.map.setFog({
|
||||||
@ -142,7 +142,7 @@ export default {
|
|||||||
*/
|
*/
|
||||||
async init () {
|
async init () {
|
||||||
// token
|
// token
|
||||||
mapboxgl.accessToken = 'pk.eyJ1Ijoic3pkb3QiLCJhIjoiY2xhN2pkMWFoMHJ4eTN3cXp6bmlzaHZ0NCJ9.3hH-EAUr0wQCaLvIM2lBMQ'
|
mapboxgl.accessToken = 'pk.eyJ1Ijoic3pkb3QiLCJhIjoiY2xhNXpjd3IxMG9leTNubjg3dnFhZm84ZyJ9.ubUTyh6ZR87qyndE5adgvw'
|
||||||
// 实例化map
|
// 实例化map
|
||||||
this.map = new mapboxgl.Map({
|
this.map = new mapboxgl.Map({
|
||||||
container: 'map',
|
container: 'map',
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row class="m-15" type="flex" justify="space-between">
|
<el-row class="m-15" type="flex" justify="space-between">
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-weixing" :val="plane.planeState.satCount" unit="颗" state="normal" />
|
<PublicTag icon="icon-weixing" val="16.88" unit="颗" state="normal" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-weixing" :val="plane.planeState.voltagBattery" unit="V" state="normal" />
|
<PublicTag icon="icon-weixing" val="16.88" unit="颗" state="normal" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-weixing" :val="plane.planeState.loadweight" unit="克" state="normal" />
|
<PublicTag icon="icon-weixing" val="16.88" unit="颗" state="normal" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-gaodu" :val="plane.planeState.state" unit="状" state="normal" />
|
<PublicTag icon="icon-gaodu" val="50" unit="米" state="normal" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="3">
|
<el-col :span="3">
|
||||||
<HeartTag :heartBeat="plane.planeState.heartBeat" :heartRandom="plane.planeState.heartRandom"
|
<HeartTag :heartBeat="planeState.heartBeat" :heartRandom="planeState.heartRandom"
|
||||||
:getPlaneMode="plane.planeState.getPlaneMode" />
|
:getPlaneMode="planeState.getPlaneMode" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-mianxingdiaogou" :val="plane.planeState.hookstatus" unit="" state="normal" />
|
<PublicTag icon="icon-mianxingdiaogou" :val="planeState.state" unit="" state="normal" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-gaodu" :val="plane.planeState.positionAlt" unit="米" state="normal" />
|
<PublicTag icon="icon-gaodu" :val="planeState.groundSpeed" unit="米" state="normal" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-gaodu" :val="plane.planeState.fixType" unit="" state="danger" />
|
<PublicTag icon="icon-gaodu" val="50" unit="米" state="danger" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<PublicTag icon="icon-gaodu" val="50" unit="米" state="danger" />
|
<PublicTag icon="icon-gaodu" val="50" unit="米" state="danger" />
|
||||||
@ -39,6 +39,8 @@ export default {
|
|||||||
name: 'PlaneStatus',
|
name: 'PlaneStatus',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
planesId: this.$route.params.id,
|
||||||
|
planeState: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@ -54,9 +56,18 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
plane: {
|
||||||
|
handler (val) {
|
||||||
|
this.planeState = val.planeState
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {},
|
methods: {},
|
||||||
created () {
|
created () {
|
||||||
|
if (this.plane) {
|
||||||
|
this.planeState = this.plane.planeState
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -401,7 +401,6 @@ const store = new Vuex.Store({
|
|||||||
async fetchLockSite ({ dispatch }, form) {
|
async fetchLockSite ({ dispatch }, form) {
|
||||||
const params = new URLSearchParams()
|
const params = new URLSearchParams()
|
||||||
params.append('id', form.id)
|
params.append('id', form.id)
|
||||||
params.append('shop_id', form.shop_id)
|
|
||||||
params.append('runing', form.runing)
|
params.append('runing', form.runing)
|
||||||
const res = await api.post('lockSite', params)
|
const res = await api.post('lockSite', params)
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
|
@ -69,7 +69,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$refs.mapbox.removePlanes()// 先清除画布上现有的飞机
|
this.$refs.mapbox.removePlanes()// 先清除画布上现有的飞机
|
||||||
this.$refs.mapbox.makePlane(plane)// 创建飞机
|
this.$refs.mapbox.makePlane(plane)// 创建飞机
|
||||||
// this.$refs.mapbox.goto({ lng: plane.lng, lat: plane.lat })// 跳转到飞机位置
|
this.$refs.mapbox.goto({ lng: plane.lng, lat: plane.lat })// 跳转到飞机位置
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 创建航线
|
* @description: 创建航线
|
||||||
|
@ -79,11 +79,10 @@ export default {
|
|||||||
activeMenu () {
|
activeMenu () {
|
||||||
const route = this.$route
|
const route = this.$route
|
||||||
const { meta, path } = route
|
const { meta, path } = route
|
||||||
const decodedPath = decodeURIComponent(path) // 解码 URL
|
|
||||||
if (meta.activeMenu) {
|
if (meta.activeMenu) {
|
||||||
return meta.activeMenu
|
return meta.activeMenu
|
||||||
}
|
}
|
||||||
return decodedPath
|
return path
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 获取飞机列表
|
* @description: 获取飞机列表
|
||||||
|
Loading…
Reference in New Issue
Block a user