|
@@ -47,32 +47,32 @@
|
|
|
</a-layout-content>
|
|
|
|
|
|
<!-- 消息通知 -->
|
|
|
- <div class="notes-box" v-if="notesList.length">
|
|
|
+ <div class="notes-box" v-if="notesList.length && nowRoute.indexOf('notice')<0">
|
|
|
<div v-for="item in notesList" :key="item.id">
|
|
|
- <!-- <a-alert type="warning" showIcon closable>
|
|
|
+ <a-alert v-if="item.notice.bizType=='TEMP_ORDER'" type="error" showIcon closable @close="setRead(item)">
|
|
|
<div slot="description">
|
|
|
- 【急送提醒】成美汽配发来一条急送需求 <a-button size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
+ 【急送提醒】{{ item.notice.plainContent }} <a-button @click="toAction(item)" size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
</div>
|
|
|
</a-alert>
|
|
|
- <a-alert type="info" showIcon closable>
|
|
|
+ <a-alert v-if="item.notice.bizType=='SHELF_REPLENISH'" type="info" showIcon closable @close="setRead(item)">
|
|
|
<div slot="description">
|
|
|
- 【补货提醒】成美汽配发来一条急送需求 <a-button size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
+ 【补货提醒】{{ item.notice.plainContent }} <a-button @click="toAction(item)" size="small" type="link" class="button-info">立即处理</a-button>
|
|
|
</div>
|
|
|
</a-alert>
|
|
|
- <a-alert type="info" showIcon closable>
|
|
|
+ <a-alert v-if="item.notice.bizType=='SHELF_ORDER'" type="info" showIcon closable @close="setRead(item)">
|
|
|
<div slot="description">
|
|
|
- 【订单提醒】成美汽配发来一条急送需求 <a-button size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
+ 【订单提醒】{{ item.notice.plainContent }} <a-button @click="toAction(item)" size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
</div>
|
|
|
</a-alert>
|
|
|
- <a-alert type="error" showIcon closable>
|
|
|
+ <a-alert v-if="item.notice.bizType=='SHELF_WARN'" type="error" showIcon closable @close="setRead(item)">
|
|
|
<div slot="description">
|
|
|
- 【货架异常提醒】成美汽配发来一条急送需求 <a-button size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
+ 【货架异常提醒】{{ item.notice.plainContent }} <a-button @click="toAction(item)" size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
</div>
|
|
|
- </a-alert> -->
|
|
|
+ </a-alert>
|
|
|
</div>
|
|
|
- <div class="notes-more">更多消息>></div>
|
|
|
+ <div class="notes-more" @click="toNotes">更多消息>></div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <audio controls="controls" hidden :src="mp3" ref="audio"></audio>
|
|
|
<!-- 视频播放弹窗 -->
|
|
|
<div v-if="isShowVideoVal">
|
|
|
<a-modal
|
|
@@ -122,6 +122,7 @@ import GlobalHeader from '@/components/GlobalHeader'
|
|
|
import GlobalFooter from '@/components/GlobalFooter'
|
|
|
import SettingDrawer from '@/components/SettingDrawer'
|
|
|
import { asyncRouterMap } from '@/config/router.config'
|
|
|
+import mp3 from '@/assets/notes.mp3'
|
|
|
import store from '@/store'
|
|
|
export default {
|
|
|
name: 'BasicLayout',
|
|
@@ -149,7 +150,8 @@ export default {
|
|
|
isRouterAlive: true,
|
|
|
showPdfView: false,
|
|
|
showSelectPrint: false,
|
|
|
- notesList: []
|
|
|
+ notesList: [],
|
|
|
+ mp3: mp3
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -227,8 +229,10 @@ export default {
|
|
|
wsMessage (a, b) {
|
|
|
if (a !== b && a) {
|
|
|
// 新未读消息
|
|
|
- if (a.type == 'no_read_count') {
|
|
|
+ if (a.type == 'no_read_count' && this.nowRoute.indexOf('notice') < 0) {
|
|
|
this.getNotes()
|
|
|
+ // 播放音效
|
|
|
+ this.playAudio()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -325,6 +329,10 @@ export default {
|
|
|
drawerClose () {
|
|
|
this.collapsed = false
|
|
|
},
|
|
|
+ playAudio () {
|
|
|
+ this.$refs.audio.currentTime = 0// 从头开始播放
|
|
|
+ this.$refs.audio.play() // 播放
|
|
|
+ },
|
|
|
// 获取最新消息
|
|
|
getNotes () {
|
|
|
this.getMessageList({
|
|
@@ -336,20 +344,49 @@ export default {
|
|
|
readFlag: 0
|
|
|
}).then((res) => {
|
|
|
if (res.status == 200) {
|
|
|
+ const data = res.data
|
|
|
+ for (var i = 0; i < data.list.length; i++) {
|
|
|
+ if (data.list[i].notice.extInfo) {
|
|
|
+ data.list[i].notice.extInfo = JSON.parse(data.list[i].notice.extInfo)
|
|
|
+ }
|
|
|
+ }
|
|
|
this.notesList = res.data.list
|
|
|
} else {
|
|
|
this.notesList = []
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ toAction (data) {
|
|
|
+ // 急送订单
|
|
|
+ if (data.notice.extInfo.bizType == 'TEMP_ORDER') {
|
|
|
+ this.$router.push({ name: 'salesDetail', params: { sn: data.notice.extInfo.bizSn } })
|
|
|
+ }
|
|
|
+ // 补货订单
|
|
|
+ if (data.notice.extInfo.bizType == 'SHELF_REPLENISH') {
|
|
|
+ this.$router.push({ name: 'replenishmentManagement', query: { bizType: 'WAIT_CONFIRM' } })
|
|
|
+ }
|
|
|
+ // 货架订单
|
|
|
+ if (data.notice.extInfo.bizType == 'SHELF_ORDER') {
|
|
|
+ this.$router.push({ name: 'shelfOrderDetail', params: { sn: data.notice.extInfo.bizSn } })
|
|
|
+ }
|
|
|
+ // 货架异常
|
|
|
+ if (data.notice.extInfo.bizType == 'SHELF_WARN') {
|
|
|
+ this.$router.push({ name: 'shelfOrderList', query: { shelfSn: data.notice.extInfo.bizSn } })
|
|
|
+ }
|
|
|
+ // 设置已读
|
|
|
+ this.setRead(data)
|
|
|
+ },
|
|
|
// 设置已读
|
|
|
setRead (row) {
|
|
|
this.hasRead({ msg_id: row.id }).then(res => {
|
|
|
// 刷新列表
|
|
|
if (res.status == 200) {
|
|
|
-
|
|
|
+ this.getNotes()
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ toNotes () {
|
|
|
+ this.$router.push({ path: '/notice' })
|
|
|
}
|
|
|
}
|
|
|
}
|