Compare commits
11 Commits
77a0bfdea5
...
6ec284c9d3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6ec284c9d3 | ||
![]() |
d758c7d554 | ||
![]() |
3f21670345 | ||
![]() |
8e225dceb5 | ||
![]() |
cea1b66635 | ||
![]() |
97f6fa7125 | ||
![]() |
526a5780ae | ||
![]() |
136ee3ca0f | ||
![]() |
e44d78cded | ||
![]() |
c3e407327b | ||
![]() |
c5f2a27789 |
91
package-lock.json
generated
91
package-lock.json
generated
@ -4330,16 +4330,10 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/chokidar": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
||||
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
|
||||
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://paulmillr.com/funding/"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"anymatch": "~3.1.2",
|
||||
"braces": "~3.0.2",
|
||||
@ -4352,6 +4346,9 @@
|
||||
"engines": {
|
||||
"node": ">= 8.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://paulmillr.com/funding/"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
@ -8087,10 +8084,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||
"dev": true
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/function.prototype.name": {
|
||||
"version": "1.1.5",
|
||||
@ -8578,6 +8578,18 @@
|
||||
"minimalistic-assert": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
@ -9414,12 +9426,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/is-core-module": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz",
|
||||
"integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==",
|
||||
"version": "2.13.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
|
||||
"integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"has": "^1.0.3"
|
||||
"hasown": "^2.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
@ -13153,12 +13165,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/resolve": {
|
||||
"version": "1.22.3",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.3.tgz",
|
||||
"integrity": "sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==",
|
||||
"version": "1.22.8",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz",
|
||||
"integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-core-module": "^2.12.0",
|
||||
"is-core-module": "^2.13.0",
|
||||
"path-parse": "^1.0.7",
|
||||
"supports-preserve-symlinks-flag": "^1.0.0"
|
||||
},
|
||||
@ -20556,9 +20568,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"chokidar": {
|
||||
"version": "3.5.3",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
|
||||
"integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
|
||||
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"anymatch": "~3.1.2",
|
||||
@ -23532,9 +23544,9 @@
|
||||
"optional": true
|
||||
},
|
||||
"function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"dev": true
|
||||
},
|
||||
"function.prototype.name": {
|
||||
@ -23903,6 +23915,15 @@
|
||||
"minimalistic-assert": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"function-bind": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
@ -24547,12 +24568,12 @@
|
||||
}
|
||||
},
|
||||
"is-core-module": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz",
|
||||
"integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==",
|
||||
"version": "2.13.1",
|
||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
|
||||
"integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has": "^1.0.3"
|
||||
"hasown": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"is-data-descriptor": {
|
||||
@ -27600,12 +27621,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.22.3",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.3.tgz",
|
||||
"integrity": "sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==",
|
||||
"version": "1.22.8",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz",
|
||||
"integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-core-module": "^2.12.0",
|
||||
"is-core-module": "^2.13.0",
|
||||
"path-parse": "^1.0.7",
|
||||
"supports-preserve-symlinks-flag": "^1.0.0"
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1,10 +1,12 @@
|
||||
<template>
|
||||
<el-breadcrumb separator-class="el-icon-caret-right" class="app-breadcrumb">
|
||||
<el-breadcrumb-item>
|
||||
<router-link to="/">飞机主控</router-link>
|
||||
<!-- <router-link to="/">飞机主控</router-link> -->
|
||||
{{ $route.meta.tapName === "plane" ? "飞机主控" : "小程序后台" }}
|
||||
</el-breadcrumb-item>
|
||||
<el-breadcrumb-item v-for="(item, index) in breadcrumb" :key="index">
|
||||
<router-link :to="item.path">{{ item.title }}</router-link>
|
||||
<!-- <router-link :to="item.path">{{ item.title }}</router-link> -->
|
||||
{{ item.title }}
|
||||
</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</template>
|
||||
|
@ -44,7 +44,7 @@
|
||||
<div class="tab-container">
|
||||
<el-button size="medium" type="primary" :class="activeIndex === index ? 'butIconGroupBG' : ''"
|
||||
class="butIconGroup" v-for="(item, index) in controlItems" :key="index"
|
||||
@click="toggleContent(index); speakText(item.voice)">
|
||||
@click="toggleContent(index, item.voice)">
|
||||
<i :class="item.icon" class="iconfont f-s-35"></i>
|
||||
<div class="m-t-5 fb">{{ item.title }}</div>
|
||||
</el-button>
|
||||
@ -61,7 +61,8 @@
|
||||
<el-form label-position="left" ref="questForm" :model="questForm" label-width="80px">
|
||||
<el-form-item label="订单任务">
|
||||
<el-select v-model="questForm.id" :filterable="isMobile" placeholder="请选择,也可输入搜索" :disabled="airLock">
|
||||
<el-option v-for="item in questList" :key="item.id" :label="item.id" :value="item.id">
|
||||
<el-option v-for="item in questList" :key="item.id" :label="item.id" :value="item.id"
|
||||
:class="Number(item.total_weight) >= Number(plane.weight_max) ? 'danger-color' : ''">
|
||||
<span class="l">{{ item.id }}</span>
|
||||
<span class="l m-l-5">{{ item.receiver }}</span>
|
||||
<span class="l m-l-5">{{ item.receive_site_name }}</span>
|
||||
@ -75,7 +76,7 @@
|
||||
<font class="m-l-5">航线锁定</font>
|
||||
</el-button>
|
||||
<el-button size="mini" class="f-s-14" v-if="planeState & 1 && !airLock" type="primary"
|
||||
icon="f-s-14 iconfont icon-chakanzhihangrizhi" @click="runQuest; speakText('提交任务,锁定航线。')">
|
||||
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-if="planeState & 2" key="wirteBut" type="info"
|
||||
@ -97,11 +98,11 @@
|
||||
<el-form-item label="任务操作">
|
||||
<el-button-group>
|
||||
<el-button size="mini" class="f-s-14" type="danger" icon="iconfont icon-meiyoudingdan-01" key="celBUt"
|
||||
@click="reQuest; speakText('任务取消,退回未备货状态')">
|
||||
@click="reQuest">
|
||||
<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; speakText('任务完成')">
|
||||
@click="overQuest">
|
||||
<font class="m-l-5">已送达</font>
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
@ -312,6 +313,15 @@ export default {
|
||||
overQuestList () {
|
||||
return this.$store.state.orderList.filter((item) => item.status === 'shipped')
|
||||
},
|
||||
/**
|
||||
* @description: 当前选中的订单
|
||||
*/
|
||||
currentOrder () {
|
||||
if (this.questForm && this.questForm.id !== undefined) {
|
||||
return this.questList.find((item) => item.id === this.questForm.id) || null
|
||||
}
|
||||
return null
|
||||
},
|
||||
/**
|
||||
* @description: 航线列表
|
||||
*/
|
||||
@ -366,17 +376,21 @@ export default {
|
||||
/**
|
||||
* @description: 菜单切换 PS:UI
|
||||
* @param {*} index 序号
|
||||
* @param {*} voice 播放声音的文本
|
||||
*/
|
||||
toggleContent (index) {
|
||||
toggleContent (index, voice) {
|
||||
this.activeIndex = this.activeIndex === index ? null : index
|
||||
if (this.tabIsOpen) {
|
||||
if (index !== this.activeIndex) {
|
||||
this.tabIsOpen = false
|
||||
this.$emit('mapXOffset', -200)
|
||||
} else {
|
||||
this.speakText(voice)
|
||||
}
|
||||
} else {
|
||||
this.tabIsOpen = true
|
||||
this.$emit('mapXOffset', 200)
|
||||
this.speakText(voice)
|
||||
}
|
||||
},
|
||||
/**
|
||||
@ -391,6 +405,35 @@ export default {
|
||||
this.$message.warning('与飞机通信未接通,请稍后')
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @description: 执行任务前 先检测订单是否 合法 例如:订单重量会不会超出飞机载重上限
|
||||
*/
|
||||
checkQuest () {
|
||||
// 检查重量
|
||||
if (Number(this.currentOrder.total_weight) >= Number(this.plane.weight_max)) {
|
||||
this.$confirm('此订单总重超出本飞机的载重上限', '检测订单', {
|
||||
confirmButtonText: '仍然提交',
|
||||
cancelButtonText: '放弃提交',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '存在超重风险,仍然提交订单'
|
||||
})
|
||||
this.runQuest()// 提交订单
|
||||
})
|
||||
.catch(action => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消提交订单'
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// 合法 直接提交订单
|
||||
this.runQuest()
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @description: 执行订单任务
|
||||
*/
|
||||
@ -399,41 +442,73 @@ export default {
|
||||
this.$message.error('未选择订单任务!')
|
||||
return
|
||||
}
|
||||
let i
|
||||
this.questList.map((item) => {
|
||||
if (this.questForm.id === item.id) {
|
||||
i = true
|
||||
/* 插入日志 */
|
||||
this.$store.dispatch('fetchLog', { content: `${this.plane.name} 开始执行 订单ID:${item.id}、叫餐号:${item.food_sn}号。` })
|
||||
/* 执行写在这里 */
|
||||
if (item.bind_route === null) { // 判断站点是否已经绑定站点 未绑定 中断操作
|
||||
this.$message.error('此站点,未绑定任务航点')
|
||||
return
|
||||
}
|
||||
let routeData
|
||||
try {
|
||||
const bindRoute = item.bind_route.split(',')
|
||||
routeData = this.routeList.find(element => element.id === bindRoute[0]).route_data
|
||||
routeData = JSON.parse(routeData)// 反序列化
|
||||
/* 处理声音航点 航点里面的表达式 如$food_sn$ 正则替换成订单对应的字段 */
|
||||
item.telTail = item.tel.substr(-4)// 手动加一个手机尾号telTail字段 从 tel字段截取后四位
|
||||
routeData.tasks.forEach((x, index) => {
|
||||
if (x.sound) {
|
||||
const str = this.voiceRouteParse(item, x.sound)
|
||||
routeData.tasks[index].sound = str// 重新写入声音航点
|
||||
}
|
||||
})
|
||||
routeData = JSON.stringify(routeData)// 重新序列化
|
||||
} catch (error) {
|
||||
this.$message.error('操作失败,请重新尝试')
|
||||
}
|
||||
this.publishFun(`{"questAss":${routeData}}`)// 发送航点信息主题
|
||||
this.questAss(item.id, 'status', 'shipped')// 订单改为发货状态 并更新订单列表
|
||||
this.$store.dispatch('fetchLockSite', { id: item.receive_site_id, runing: this.plane.id })// 航线注册飞机 锁定送餐点
|
||||
if (this.currentOrder) {
|
||||
/* 插入日志 */
|
||||
this.$store.dispatch('fetchLog', { content: `${this.plane.name} 开始执行 订单ID:${this.currentOrder.id}、叫餐号:${this.currentOrder.food_sn}号。` })
|
||||
/* 执行写在这里 */
|
||||
if (this.currentOrder.bind_route === null) { // 判断站点是否已经绑定站点 未绑定 中断操作
|
||||
this.$message.error('此站点,未绑定任务航点')
|
||||
return
|
||||
}
|
||||
})
|
||||
if (i) { return }
|
||||
this.$message.error('此订单已被申请退款或者订单已经被取消!')
|
||||
let routeData
|
||||
try {
|
||||
const bindRoute = this.currentOrder.bind_route.split(',')
|
||||
routeData = this.routeList.find(element => element.id === bindRoute[0]).route_data
|
||||
routeData = JSON.parse(routeData)// 反序列化
|
||||
/* 处理声音航点 航点里面的表达式 如$food_sn$ 正则替换成订单对应的字段 */
|
||||
this.currentOrder.telTail = this.currentOrder.tel.substr(-4)// 手动加一个手机尾号telTail字段 从 tel字段截取后四位
|
||||
routeData.tasks.forEach((x, index) => {
|
||||
if (x.sound) {
|
||||
const str = this.voiceRouteParse(this.currentOrder, x.sound)
|
||||
routeData.tasks[index].sound = str// 重新写入声音航点
|
||||
}
|
||||
})
|
||||
routeData = JSON.stringify(routeData)// 重新序列化
|
||||
} catch (error) {
|
||||
this.$message.error('操作失败,请重新尝试')
|
||||
}
|
||||
this.publishFun(`{"questAss":${routeData}}`)// 发送航点信息主题
|
||||
this.questAss(this.currentOrder.id, 'status', 'shipped')// 订单改为发货状态 并更新订单列表
|
||||
this.$store.dispatch('fetchLockSite', { id: this.currentOrder.receive_site_id, runing: this.plane.id })// 航线注册飞机 锁定送餐点
|
||||
this.speakText('提交任务,锁定航线。')
|
||||
} else {
|
||||
this.$message.error('此订单已被申请退款或者订单已经被取消!')
|
||||
}
|
||||
// let i
|
||||
// this.questList.map((item) => {
|
||||
// if (this.questForm.id === item.id) {
|
||||
// i = true
|
||||
// /* 插入日志 */
|
||||
// this.$store.dispatch('fetchLog', { content: `${this.plane.name} 开始执行 订单ID:${item.id}、叫餐号:${item.food_sn}号。` })
|
||||
// /* 执行写在这里 */
|
||||
// if (item.bind_route === null) { // 判断站点是否已经绑定站点 未绑定 中断操作
|
||||
// this.$message.error('此站点,未绑定任务航点')
|
||||
// return
|
||||
// }
|
||||
// let routeData
|
||||
// try {
|
||||
// const bindRoute = item.bind_route.split(',')
|
||||
// routeData = this.routeList.find(element => element.id === bindRoute[0]).route_data
|
||||
// routeData = JSON.parse(routeData)// 反序列化
|
||||
// /* 处理声音航点 航点里面的表达式 如$food_sn$ 正则替换成订单对应的字段 */
|
||||
// item.telTail = item.tel.substr(-4)// 手动加一个手机尾号telTail字段 从 tel字段截取后四位
|
||||
// routeData.tasks.forEach((x, index) => {
|
||||
// if (x.sound) {
|
||||
// const str = this.voiceRouteParse(item, x.sound)
|
||||
// routeData.tasks[index].sound = str// 重新写入声音航点
|
||||
// }
|
||||
// })
|
||||
// routeData = JSON.stringify(routeData)// 重新序列化
|
||||
// } catch (error) {
|
||||
// this.$message.error('操作失败,请重新尝试')
|
||||
// }
|
||||
// this.publishFun(`{"questAss":${routeData}}`)// 发送航点信息主题
|
||||
// this.questAss(item.id, 'status', 'shipped')// 订单改为发货状态 并更新订单列表
|
||||
// this.$store.dispatch('fetchLockSite', { id: item.receive_site_id, runing: this.plane.id })// 航线注册飞机 锁定送餐点
|
||||
// this.speakText('提交任务,锁定航线。')
|
||||
// }
|
||||
// })
|
||||
// if (i) { return }
|
||||
},
|
||||
/**
|
||||
* @description: 匹配声音航点字符串 比如$food_sn$ food_sn匹配成 送餐订单里面的对应字段
|
||||
@ -489,6 +564,7 @@ export default {
|
||||
this.questAss(item.id, 'status', 'pending')// 订单改回到发货状态之前 既“已付款状态”
|
||||
this.$store.dispatch('fetchLockSite', { id: item.receive_site_id, runing: 'null' })// 解锁航线
|
||||
this.questForm.id = ''// 选择框设置成 空的状态
|
||||
speakText('任务取消,退回未备货状态')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
@ -516,6 +592,7 @@ export default {
|
||||
this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置
|
||||
this.questAss(item.id, 'status', 'completed')// 订单改为已完成状态
|
||||
this.$store.dispatch('fetchLockSite', { id: item.receive_site_id, runing: 'null' })// 解锁航线
|
||||
this.speakText('任务完成')
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
@ -570,6 +647,11 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
@import "@/styles/theme.scss";
|
||||
|
||||
.danger-color {
|
||||
color: $danger-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tab-container {
|
||||
height: 365px;
|
||||
width: 80px;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-date-picker v-model="value" type="daterange" align="right" unlink-panels range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" format="yyyy-MM-dd HH:mm:ss">
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</template>
|
||||
|
||||
|
@ -402,8 +402,8 @@ const routes = [
|
||||
component: Layout,
|
||||
redirect: '/order/index',
|
||||
meta: {
|
||||
title: '订单管理',
|
||||
icon: 'iconfont icon-a-SalesOrderManagement',
|
||||
title: '订单与统计',
|
||||
icon: 'iconfont icon-dingdantongji',
|
||||
roles: ['admin', 'editor'],
|
||||
tapName: 'admin'
|
||||
},
|
||||
@ -428,6 +428,16 @@ const routes = [
|
||||
tapName: 'admin',
|
||||
hidden: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/order/stat',
|
||||
component: () => import('@/views/layout/components/main/order/stat'),
|
||||
meta: {
|
||||
title: '销售统计',
|
||||
icon: 'iconfont icon-data-view',
|
||||
roles: ['admin', 'editor'],
|
||||
tapName: 'admin'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -142,10 +142,26 @@ label {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.bg-b {
|
||||
background-color: $brand-color;
|
||||
}
|
||||
|
||||
.bg-white {
|
||||
background-color: $white-color;
|
||||
}
|
||||
|
||||
.fc-b {
|
||||
color: $brand-color;
|
||||
}
|
||||
|
||||
.fc-m {
|
||||
color: $maintext-color;
|
||||
}
|
||||
|
||||
.fc-i {
|
||||
color: $holdtext-color;
|
||||
}
|
||||
|
||||
.border-b-n {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
@ -185,6 +201,111 @@ label {
|
||||
}
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
//垂直排列
|
||||
.column {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
//主轴左对齐
|
||||
.ml {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
//主轴右对齐
|
||||
.mr {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
//主轴两端对齐
|
||||
.msb {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
//主轴 居中对齐
|
||||
.mc {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
//主轴 等距
|
||||
.mse {
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
//主轴 元素两侧平分
|
||||
.msa {
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
//交叉轴 填满
|
||||
.man {
|
||||
align-items: normal;
|
||||
}
|
||||
|
||||
//交叉轴 上对齐
|
||||
.mu {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
//交叉轴 下对齐
|
||||
.md {
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
//交叉轴 居中对齐
|
||||
.mac {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
//交叉轴 第一行最高的基线对齐
|
||||
.mub {
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
|
||||
.flex1 {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.flex2 {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.flex3 {
|
||||
flex: 3;
|
||||
}
|
||||
|
||||
.flex4 {
|
||||
flex: 4;
|
||||
}
|
||||
|
||||
.rad-c {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.rad32 {
|
||||
border-radius: 32px;
|
||||
}
|
||||
|
||||
.rad16 {
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
.rad8 {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.rad4 {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.rad2 {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
//m-l-0 p-l-0 马根 帕丁
|
||||
$position: (
|
||||
"t":"top",
|
||||
|
@ -1 +1 @@
|
||||
@import 'https://at.alicdn.com/t/c/font_3703467_it8bp4b57g9.css'; //iconfont阿里巴巴
|
||||
@import 'https://at.alicdn.com/t/c/font_3703467_om4sfs0bw5s.css'; //iconfont阿里巴巴
|
@ -48,6 +48,7 @@ export function questAss (id, state, val) {
|
||||
store.dispatch('fetchOrderList')// 更新订单列表
|
||||
} else {
|
||||
Message.error(res.data.msg)
|
||||
store.dispatch('fetchOrderList')// 更新订单列表
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 订单音效 -->
|
||||
<audio controls="controls" hidden src="@/assets/sound/newMsg.mp3" ref="newMsg"></audio>
|
||||
<audio controls="controls" hidden src="@/assets/sound/rebackMsg.mp3" ref="rebackMsg"></audio>
|
||||
<!-- menu缩进按钮 -->
|
||||
<div class="w-50px h-50px fc l" id="menuTabB" @click="handleCollapse">
|
||||
<i class="iconfont f-s-26" :class="isCollapse ? 'icon-a-yousuojin3x' : 'icon-a-zuosuojin3x'"></i>
|
||||
@ -19,11 +16,6 @@
|
||||
<i class="el-icon-caret-bottom" />
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||
<el-dropdown-item divided>
|
||||
<RouterLink to="/">
|
||||
主控
|
||||
</RouterLink>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item divided @click.native="logout">
|
||||
<span style="display:block;">退出登录</span>
|
||||
</el-dropdown-item>
|
||||
@ -55,7 +47,7 @@
|
||||
<el-tabs type="card">
|
||||
<el-tab-pane>
|
||||
<template slot="label">
|
||||
<span>已付款处理中</span>
|
||||
<span>已付款</span>
|
||||
<el-badge :hidden="pendingCount == 0 ? true : false" :value="pendingCount">
|
||||
</el-badge>
|
||||
</template>
|
||||
@ -63,7 +55,7 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane>
|
||||
<template slot="label">
|
||||
<span>已接单备货中</span>
|
||||
<span>备货中</span>
|
||||
<el-badge :hidden="processingCount == 0 ? true : false" :value="processingCount">
|
||||
</el-badge>
|
||||
</template>
|
||||
@ -71,7 +63,7 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane>
|
||||
<template slot="label">
|
||||
<span>申请退款订单</span>
|
||||
<span>申请退款</span>
|
||||
<el-badge :hidden="requestedCount == 0 ? true : false" :value="requestedCount">
|
||||
</el-badge>
|
||||
</template>
|
||||
@ -93,6 +85,7 @@ import mqtt from '@/utils/mqtt'
|
||||
import Breadcrumb from '@/components/Breadcrumb'
|
||||
import QuestTabs from '@/components/QuestTabs'
|
||||
import SelectionShopId from '@/components/SelectionShopId'
|
||||
import { speakText } from '@/utils/index'
|
||||
|
||||
export default {
|
||||
name: 'Headbar',
|
||||
@ -154,6 +147,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
speakText,
|
||||
/**
|
||||
* @description: 切换侧边栏 显隐
|
||||
*/
|
||||
@ -172,10 +166,10 @@ export default {
|
||||
const processing = list.filter(item => item.status === 'processing' && item.back === 'normal')// 过滤 备货中订单
|
||||
const requested = list.filter(item => item.back === 'requested')// 过滤退款订单
|
||||
if (this.pendingCount < pending.length && this.pendingCount != null) { // 有新的数据 播放提示声音
|
||||
this.playMusic('newMsg')// 新消息 声音播放
|
||||
this.speakText('有新的付款订单')
|
||||
}
|
||||
if (this.requestedCount < requested.length && this.requestedCount != null) { // 有新的数据 播放提示声音
|
||||
this.playMusic('rebackMsg')// 退款 声音播放
|
||||
this.speakText('有申请退款订单')
|
||||
}
|
||||
this.pendingCount = pending.length// 处理中 订单总数
|
||||
this.processingCount = processing.length// 备货中 订单总数
|
||||
@ -184,31 +178,12 @@ export default {
|
||||
this.animationTrumpet = !this.animationTrumpet// 面包条订单图标跳动
|
||||
}, 500)
|
||||
},
|
||||
// 新消息 声音播放
|
||||
playMusic (domId) {
|
||||
const audioElement = this.$refs[domId]
|
||||
if (!audioElement) {
|
||||
console.error(`音频元素 ${domId} 不存在`)
|
||||
return
|
||||
}
|
||||
audioElement.currentTime = 0 // 从头开始播放
|
||||
audioElement.play()
|
||||
.then(() => {
|
||||
console.log('音频播放成功')
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('音频播放失败', error)
|
||||
})
|
||||
setTimeout(() => {
|
||||
audioElement.pause() // 停止
|
||||
}, 11000)
|
||||
},
|
||||
/**
|
||||
* @description: 刷新当前页面
|
||||
*/
|
||||
refreshPage () {
|
||||
mqtt.mqttDestroy()// 断开mqtt
|
||||
this.$router.go(0)// 刷新页面
|
||||
window.location.reload() // 刷新页面
|
||||
},
|
||||
/**
|
||||
* @description: 登出
|
||||
|
@ -5,18 +5,18 @@
|
||||
<el-col :span="4">
|
||||
<SelectionShopId class="w-100" v-model="shop_id" :allSel="true" />
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-col :span="8">
|
||||
<DatePickerOrder class="w-100" />
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-col :span="12">
|
||||
<SearchOrder class="w-100" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="15">
|
||||
<el-col :span="13">
|
||||
<el-col :span="12">
|
||||
<SelectionOrderStatus />
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-col :span="12">
|
||||
<SelectionOrderBack />
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
74
src/views/layout/components/main/order/stat.vue
Normal file
74
src/views/layout/components/main/order/stat.vue
Normal file
@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 用户select选项 -->
|
||||
<el-row :gutter="15" class="m-t-0">
|
||||
<el-col :span="4">
|
||||
<SelectionShopId class="w-100" v-model="shop_id" :allSel="true" />
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<DatePickerOrder class="w-100" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 统计标签 -->
|
||||
<el-row :gutter="10" class="m-t-20">
|
||||
<el-col :span="8">
|
||||
<div class="statBox rad4 flex p-10">
|
||||
<div class="flex3 flex mc column">
|
||||
<div class="flex">
|
||||
<div class="p-4 bg-white rad2 fc-b fb">成交额</div>
|
||||
<div class="p-4 m-l-5">¥23441.44</div>
|
||||
</div>
|
||||
<div class="flex m-t-5">
|
||||
<div class="p-4 bg-white rad2 fc-b fb">退款额</div>
|
||||
<div class="p-4 m-l-5">¥23441.44</div>
|
||||
</div>
|
||||
<div class="flex m-t-5">
|
||||
<div class="p-4 bg-white rad2 fc-b fb">订单总数</div>
|
||||
<div class="p-4 m-l-5">18单</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex1 flex mc mac">
|
||||
<div class="rad-c w-50px h-50px bg-white fb fc f-s-32 fc-b l-h-50">日</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SelectionShopId from '@/components/SelectionShopId.vue'
|
||||
import DatePickerOrder from '@/components/DatePickerOrder.vue'
|
||||
|
||||
export default {
|
||||
name: 'Stat',
|
||||
data () {
|
||||
return {
|
||||
shop_id: '' // 搜索条件 商铺id
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SelectionShopId,
|
||||
DatePickerOrder
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
created () {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/styles/theme.scss";
|
||||
|
||||
.statBox {
|
||||
background-color: $brand-color;
|
||||
height: 30vh;
|
||||
color: $white-color;
|
||||
}
|
||||
</style>
|
@ -126,7 +126,6 @@ export default {
|
||||
watch: {
|
||||
},
|
||||
created () {
|
||||
console.log('hi')
|
||||
},
|
||||
filters: {
|
||||
parseTime,
|
||||
|
Loading…
Reference in New Issue
Block a user