【类 型】:feat 飞机操作模块 正在执行订单 增加风险提示标签功能

【原  因】:
【过  程】:
【影  响】:
This commit is contained in:
tk 2024-08-07 18:02:33 +08:00
parent d90fe9982d
commit b32d1075ca

View File

@ -62,6 +62,9 @@
</el-select>
</el-form-item>
<template v-else>
<el-form-item v-if="waringTags.length > 0" label="提示:">
<el-tag v-for="(tag, index) in waringTags" :key="index" class="m-r-5" type="warning">{{ tag }}</el-tag>
</el-form-item>
<el-form-item label="订单ID:">
{{ executeOrder.id }}
</el-form-item>
@ -78,8 +81,8 @@
icon="f-s-14 iconfont icon-chakanzhihangrizhi" @click="checkQuest">
<font class="m-l-5">上传航点</font>
</el-button>
<el-button size="mini" class="f-s-14" v-else-if="Number(plane.planeState.state) === 2" key="wirteBut" type="info"
:loading="true" disabled>
<el-button size="mini" class="f-s-14" v-else-if="Number(plane.planeState.state) === 2" key="wirteBut"
type="info" :loading="true" disabled>
<font class="m-l-5">航点写入中···</font>
</el-button>
<el-button size="mini" class="f-s-14" v-else-if="Number(plane.planeState.state) === 4" type="warning"
@ -96,8 +99,7 @@
@click="publishFun('{setPlaneState:{bit:5,state:1}'); speakText('准备起飞,执行送餐任务')">
<font class="m-l-5">执行任务</font>
</el-button>
<el-button size="mini" class="f-s-14" v-else-if="isShipped" type="info"
:loading="true" disabled>
<el-button size="mini" class="f-s-14" v-else-if="isShipped" type="info" :loading="true" disabled>
<font class="m-l-5">执行任务中...</font>
</el-button>
</el-button-group>
@ -106,7 +108,7 @@
<el-button-group>
<el-button size="mini" class="f-s-14" type="danger" icon="iconfont icon-cuowu" key="celBUt"
@click="reQuest">
<font class="m-l-5">取消任务</font>
<font class="m-l-5">取消</font>
</el-button>
<el-button size="mini" class="f-s-14" type="success" icon="iconfont icon-qiandai" key="bingBut"
@click="overQuest">
@ -290,7 +292,8 @@ export default {
tabIsOpen: false, // tab
questForm: { //
id: ''
}
},
waringTags: []// 退
}
},
props: {
@ -660,7 +663,7 @@ export default {
return
}
try {
const confirmation = await this.$confirm('取消已发货状态,并使飞机复位?', '提示', {
const confirmation = await this.$confirm('确认货物未送达,取消已发货状态,并使飞机复位?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@ -705,7 +708,7 @@ export default {
}
try {
const confirmation = await this.$confirm('确认订单已送达?', '提示', {
const confirmation = await this.$confirm('确认货物已送达?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@ -780,12 +783,62 @@ export default {
const isOverWaight = Number(item.total_weight) >= Number(this.plane.weight_max)//
const isQuestIng = (item.runing ?? '').split(',').some(i => i !== '') //
return isOverWaight || isQuestIng
},
/**
* 设置执行订单 提示标签
* @param order 执行订单
*/
setExecuteOrderTag (order) {
const aIndex = this.waringTags.indexOf('已申请退款')
const bIndex = this.waringTags.indexOf('已退款')
const cIndex = this.waringTags.indexOf('超出飞机载重')
const dIndex = this.waringTags.indexOf('站点多架执行')
// 退
if (order.refund_status === '申请中') {
if (aIndex === -1) {
this.waringTags.push('已申请退款')
}
} else if (order.refund_status === '已同意') {
if (bIndex === -1) {
this.waringTags.push('已退款')
}
} else {
if (aIndex !== -1) {
this.waringTags.splice(aIndex, 1)
}
if (bIndex !== -1) {
this.waringTags.splice(bIndex, 1)
}
}
//
if (this.plane.weight_max < order.total_weight) {
if (cIndex === -1) {
this.waringTags.push('超出飞机载重')
}
} else {
if (cIndex !== -1) {
this.waringTags.splice(cIndex, 1)
}
}
//
const splitArray = order.runing.split(',')// s
const nonEmptyArray = splitArray.filter(item => item.trim() !== '')//
if (nonEmptyArray.length > 1) { //
this.waringTags.push('站点多架执行')
} else {
if (dIndex !== -1) {
this.waringTags.splice(dIndex, 1)
}
}
}
},
mounted () {
//
if (this.executeOrder) { //
this.makeRouteForMap()//
//
this.setExecuteOrderTag(this.executeOrder)
//
this.makeRouteForMap()
} else { //
if (this.plane) {
this.publishFun('{"resetState":1}')//
@ -794,10 +847,13 @@ export default {
},
watch: {
executeOrder (val) {
if (val) { // 线
if (val) {
/* 如果当前飞机正在执行任务 把航线绘制到地图上 */
this.makeRouteForMap()
} else { // 线
this.$emit('clearRoute')
/* 检查添加提示标签 */
this.setExecuteOrderTag(val)
} else {
this.$emit('clearRoute')// 线
this.publishFun('{"resetState":1}')//
}
},