|
@@ -46,6 +46,36 @@
|
|
|
</transition>
|
|
|
</a-layout-content>
|
|
|
|
|
|
+ <!-- 消息通知 -->
|
|
|
+ <div class="notes-box" v-if="notesList.length && nowRoute.indexOf('notice')<0">
|
|
|
+ <div v-for="item in notesList" :key="item.id">
|
|
|
+ <a-alert v-if="item.notice.bizType=='TEMP_ORDER'" type="warning" showIcon closable @close="setRead(item)">
|
|
|
+ <div slot="description">
|
|
|
+ 【急送提醒】{{ item.notice.plainContent }} <a-button @click="toAction(item)" size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
+ </div>
|
|
|
+ </a-alert>
|
|
|
+ <a-alert v-if="item.notice.bizType=='SHELF_REPLENISH'" type="info" showIcon closable @close="setRead(item)">
|
|
|
+ <div slot="description">
|
|
|
+ 【补货提醒】{{ item.notice.plainContent }} <a-button @click="toAction(item)" size="small" type="link" class="button-info">立即处理</a-button>
|
|
|
+ </div>
|
|
|
+ </a-alert>
|
|
|
+ <a-alert v-if="item.notice.bizType=='SHELF_ORDER'" type="info" showIcon closable @close="setRead(item)">
|
|
|
+ <div slot="description">
|
|
|
+ 【订单提醒】{{ item.notice.plainContent }} <a-button @click="toAction(item)" size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
+ </div>
|
|
|
+ </a-alert>
|
|
|
+ <a-alert v-if="item.notice.bizType=='SHELF_WARN'" type="warning" showIcon closable @close="setRead(item)">
|
|
|
+ <div slot="description">
|
|
|
+ 【货架异常提醒】{{ item.notice.plainContent }} <a-button @click="toAction(item)" size="small" type="link" class="button-info">点击查看</a-button>
|
|
|
+ </div>
|
|
|
+ </a-alert>
|
|
|
+ </div>
|
|
|
+ <div class="notes-footer">
|
|
|
+ <div class="notes-more" @click="noDoNotes">暂不处理</div>
|
|
|
+ <div class="notes-more" @click="toNotes">更多消息>></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <audio controls="controls" hidden :src="mp3" ref="audio"></audio>
|
|
|
<!-- 视频播放弹窗 -->
|
|
|
<div v-if="isShowVideoVal">
|
|
|
<a-modal
|
|
@@ -95,14 +125,15 @@ 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',
|
|
|
mixins: [mixin, mixinDevice, commonMixin],
|
|
|
provide () {
|
|
|
return {
|
|
|
- reloadView: this.reloadView,
|
|
|
- setIsHomeNav: this.setIsHomeNav
|
|
|
+ setIsHomeNav: this.setIsHomeNav,
|
|
|
+ reloadView: this.reloadView
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -121,7 +152,9 @@ export default {
|
|
|
menus: [],
|
|
|
isRouterAlive: true,
|
|
|
showPdfView: false,
|
|
|
- showSelectPrint: false
|
|
|
+ showSelectPrint: false,
|
|
|
+ notesList: [],
|
|
|
+ mp3: mp3
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -132,13 +165,12 @@ export default {
|
|
|
fixedHeader: state => state.app.fixedHeader
|
|
|
}),
|
|
|
...mapGetters(['nowRoute', 'isShowVideo']),
|
|
|
- isShowVideoVal: {
|
|
|
- get () {
|
|
|
- return this.$store.state.app.isShowVideo
|
|
|
- },
|
|
|
- set (newValue) {
|
|
|
- this.$store.state.app.isShowVideo = newValue
|
|
|
- }
|
|
|
+ isShowVideoVal () {
|
|
|
+ return this.$store.state.app.isShowVideo
|
|
|
+ },
|
|
|
+ // 接受到ws消息
|
|
|
+ wsMessage () {
|
|
|
+ return this.$store.getters.wsMessageData()
|
|
|
},
|
|
|
contentPaddingLeft () {
|
|
|
if (!this.fixSidebar || this.isMobile()) {
|
|
@@ -173,20 +205,20 @@ export default {
|
|
|
fullscreenToggle: true // 全屏按钮
|
|
|
}
|
|
|
}
|
|
|
- const isSaleOrder = this.nowRoute.indexOf('salesQuery') > -1 // 当前展示是否为销售单模块
|
|
|
- const isSalesReturn = this.nowRoute.indexOf('salesReturn') > -1 // 当前展示是否为销售退货模块
|
|
|
- const isPurchaseOrder = this.nowRoute.indexOf('purchaseOrder') > -1 // 当前展示是否为采购单管理模块
|
|
|
- const isPurchaseReturn = this.nowRoute.indexOf('purchaseReturn') > -1 // 当前展示是否为采购退货模块
|
|
|
- if (isSaleOrder) {
|
|
|
+ // 当前展示是否为销售单模块
|
|
|
+ if (this.nowRoute.indexOf('salesQuery') > -1) {
|
|
|
playerOptions.sources[0].src = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/helpvideo/1xiaoshou.mp4'
|
|
|
}
|
|
|
- if (isSalesReturn) {
|
|
|
+ // 当前展示是否为销售退货模块
|
|
|
+ if (this.nowRoute.indexOf('salesReturn') > -1) {
|
|
|
playerOptions.sources[0].src = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/helpvideo/2xiaoshoutuihuo.mp4'
|
|
|
}
|
|
|
- if (isPurchaseOrder) {
|
|
|
+ // 当前展示是否为采购单管理模块
|
|
|
+ if (this.nowRoute.indexOf('purchaseOrder') > -1) {
|
|
|
playerOptions.sources[0].src = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/helpvideo/3caigou.mp4'
|
|
|
}
|
|
|
- if (isPurchaseReturn) {
|
|
|
+ // 当前展示是否为采购退货模块
|
|
|
+ if (this.nowRoute.indexOf('purchaseReturn') > -1) {
|
|
|
playerOptions.sources[0].src = 'https://jianguan-images.oss-cn-beijing.aliyuncs.com/helpvideo/4caigoutuihuo.mp4'
|
|
|
}
|
|
|
return playerOptions
|
|
@@ -196,8 +228,21 @@ export default {
|
|
|
sidebarOpened (val) {
|
|
|
this.collapsed = !val
|
|
|
},
|
|
|
+ // 监听ws消息通知
|
|
|
+ wsMessage (a, b) {
|
|
|
+ if (a !== b && a) {
|
|
|
+ // 新未读消息
|
|
|
+ if (a.type == 'new_remind') {
|
|
|
+ if (this.nowRoute.indexOf('notice') < 0) {
|
|
|
+ this.getNotes()
|
|
|
+ }
|
|
|
+ // 播放音效
|
|
|
+ this.playAudio()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 打印预览
|
|
|
'$store.state.app.showPdfPrintView' (newValue, oldValue) {
|
|
|
- console.log(newValue)
|
|
|
if (newValue) {
|
|
|
this.showPdfView = newValue
|
|
|
this.$nextTick(() => {
|
|
@@ -205,8 +250,8 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ // 选择打印机
|
|
|
'$store.state.app.showSelectPrint' (newValue, oldValue) {
|
|
|
- console.log(newValue)
|
|
|
if (newValue) {
|
|
|
this.showSelectPrint = newValue
|
|
|
}
|
|
@@ -220,12 +265,14 @@ export default {
|
|
|
const noqx = asyncRouterMap.find((item) => item.path === '/').children
|
|
|
this.menus = [noqx.find(item => item.path === '/home')]
|
|
|
}
|
|
|
+
|
|
|
// 重置主题,字体,布局
|
|
|
this.collapsed = !this.sidebarOpened
|
|
|
this.$store.dispatch('ToggleMultiTab', true)
|
|
|
this.$store.dispatch('ToggleColor', '#2A86F4')
|
|
|
this.$store.dispatch('ToggleTheme', localStorage.getItem('DEFAULT_THEME') || 'dark')
|
|
|
this.$store.dispatch('ToggleFontSize', localStorage.getItem('DEFAULT_FONT_SIZE') || 'small')
|
|
|
+
|
|
|
// 判断是否是当月25日后
|
|
|
this.$store.state.app.isLastDayForMonth = moment().date() >= 25
|
|
|
if (this.$store.state.app.isLastDayForMonth && this.$hasPermissions('M_mothEndTips')) {
|
|
@@ -242,6 +289,9 @@ export default {
|
|
|
this.$store.commit('SET_printLoading', false)
|
|
|
this.$store.commit('SET_printDefNeedle', localStorage.getItem('DEFAULT_PRINT_NEEDLE') || undefined)
|
|
|
this.$store.commit('SET_printDefInk', localStorage.getItem('DEFAULT_PRINT_INK') || undefined)
|
|
|
+
|
|
|
+ // 消息通知
|
|
|
+ this.getNotes()
|
|
|
},
|
|
|
mounted () {
|
|
|
const userAgent = navigator.userAgent
|
|
@@ -255,7 +305,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapActions(['setSidebar']),
|
|
|
+ ...mapActions([
|
|
|
+ 'setSidebar',
|
|
|
+ 'getMessageList', // 查询列表
|
|
|
+ 'hasRead' // 设置已读
|
|
|
+ ]),
|
|
|
+ reloadView () {},
|
|
|
// 关闭视频弹窗
|
|
|
closeVido () {
|
|
|
store.commit('IS_ShOW_VIDEO', false)
|
|
@@ -279,11 +334,83 @@ export default {
|
|
|
drawerClose () {
|
|
|
this.collapsed = false
|
|
|
},
|
|
|
- reloadView () {
|
|
|
- this.isRouterAlive = false
|
|
|
- this.$nextTick(() => {
|
|
|
- this.isRouterAlive = true
|
|
|
+ playAudio () {
|
|
|
+ this.$refs.audio.currentTime = 0// 从头开始播放
|
|
|
+ this.$refs.audio.play() // 播放
|
|
|
+ },
|
|
|
+ // 获取最新消息
|
|
|
+ getNotes () {
|
|
|
+ this.getMessageList({
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 5,
|
|
|
+ notice: {
|
|
|
+ type: 'tx'
|
|
|
+ },
|
|
|
+ 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) {
|
|
|
+ console.log(this.nowRoute)
|
|
|
+ // 急送订单
|
|
|
+ if (data.notice.extInfo.bizType == 'TEMP_ORDER') {
|
|
|
+ if (this.nowRoute.indexOf('salesManagement/salesQuery/detail') >= 0) {
|
|
|
+ this.$router.go(-1)
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.push({ name: 'salesDetail', params: { sn: data.notice.extInfo.bizSn } })
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ // 补货订单
|
|
|
+ if (data.notice.extInfo.bizType == 'SHELF_REPLENISH') {
|
|
|
+ this.$router.push({ name: 'replenishmentManagement', query: { bizType: 'WAIT_CONFIRM' } })
|
|
|
+ }
|
|
|
+ // 货架订单
|
|
|
+ if (data.notice.extInfo.bizType == 'SHELF_ORDER') {
|
|
|
+ if (this.nowRoute.indexOf('numsGoodsShelves/shelfOrder/shelfOrderDetail') >= 0) {
|
|
|
+ this.$router.go(-1)
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.push({ name: 'shelfOrderDetail', params: { sn: data.notice.extInfo.bizSn } })
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ // 货架异常
|
|
|
+ if (data.notice.extInfo.bizType == 'SHELF_WARN') {
|
|
|
+ if (this.nowRoute.indexOf('numsGoodsShelves/shelfOrder/list') >= 0) {
|
|
|
+ this.$router.go(-1)
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$router.push({ name: 'shelfOrderList', query: { bizType: 'SHELF_WARN', shelfSn: data.notice.extInfo.bizSn } })
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ // 设置已读
|
|
|
+ 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' })
|
|
|
+ },
|
|
|
+ noDoNotes () {
|
|
|
+ this.notesList = []
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -291,4 +418,44 @@ export default {
|
|
|
|
|
|
<style lang="less">
|
|
|
@import url('../components/global.less');
|
|
|
+.notes-box{
|
|
|
+ position:fixed;
|
|
|
+ right:0;
|
|
|
+ bottom:0;
|
|
|
+ min-width:400px;
|
|
|
+ z-index: 10000;
|
|
|
+ .ant-alert-with-description .ant-alert-close-icon{
|
|
|
+ top: 13px;
|
|
|
+ }
|
|
|
+ .ant-alert, .ant-alert-info{
|
|
|
+ padding: 10px 30px!important;
|
|
|
+ }
|
|
|
+ .ant-alert .ant-alert-icon, .ant-alert-info .ant-alert-icon{
|
|
|
+ top: 16px !important;
|
|
|
+ left: 10px !important;
|
|
|
+ font-size: 18px;
|
|
|
+ }
|
|
|
+ .ant-alert-with-description .ant-alert-description{
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ .notes-footer{
|
|
|
+ display:flex;
|
|
|
+ background: #fff;
|
|
|
+ border: 1px solid #eee;
|
|
|
+ border-radius: 5px 5px 0 0;
|
|
|
+ > div{
|
|
|
+ width: 50%;
|
|
|
+ &:first-child{
|
|
|
+ border-right:1px solid #eee;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .notes-more{
|
|
|
+ padding: 10px;
|
|
|
+ text-align:center;
|
|
|
+ color:#00aaff;
|
|
|
+ font-size: 14px;
|
|
|
+ cursor:pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|