lilei 2 éve
szülő
commit
08d4aeb774
4 módosított fájl, 61 hozzáadás és 18 törlés
  1. 1 1
      public/version.json
  2. BIN
      src/assets/notes.mp3
  3. 52 15
      src/layouts/BasicLayout.vue
  4. 8 2
      src/views/notice/list.vue

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
 {
   "message": "发现有新版本发布,确定更新系统?",
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
   "vendorJsVersion": "",
-  "version": 1663825298533
+  "version": 1663831911478
 }
 }

BIN
src/assets/notes.mp3


+ 52 - 15
src/layouts/BasicLayout.vue

@@ -47,32 +47,32 @@
       </a-layout-content>
       </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">
         <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">
             <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>
             </div>
           </a-alert>
           </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">
             <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>
             </div>
           </a-alert>
           </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">
             <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>
             </div>
           </a-alert>
           </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">
             <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>
             </div>
-          </a-alert> -->
+          </a-alert>
         </div>
         </div>
-        <div class="notes-more">更多消息>></div>
+        <div class="notes-more" @click="toNotes">更多消息>></div>
       </div>
       </div>
-
+      <audio controls="controls" hidden :src="mp3" ref="audio"></audio>
       <!-- 视频播放弹窗 -->
       <!-- 视频播放弹窗 -->
       <div v-if="isShowVideoVal">
       <div v-if="isShowVideoVal">
         <a-modal
         <a-modal
@@ -122,6 +122,7 @@ import GlobalHeader from '@/components/GlobalHeader'
 import GlobalFooter from '@/components/GlobalFooter'
 import GlobalFooter from '@/components/GlobalFooter'
 import SettingDrawer from '@/components/SettingDrawer'
 import SettingDrawer from '@/components/SettingDrawer'
 import { asyncRouterMap } from '@/config/router.config'
 import { asyncRouterMap } from '@/config/router.config'
+import mp3 from '@/assets/notes.mp3'
 import store from '@/store'
 import store from '@/store'
 export default {
 export default {
   name: 'BasicLayout',
   name: 'BasicLayout',
@@ -149,7 +150,8 @@ export default {
       isRouterAlive: true,
       isRouterAlive: true,
       showPdfView: false,
       showPdfView: false,
       showSelectPrint: false,
       showSelectPrint: false,
-      notesList: []
+      notesList: [],
+      mp3: mp3
     }
     }
   },
   },
   computed: {
   computed: {
@@ -227,8 +229,10 @@ export default {
     wsMessage (a, b) {
     wsMessage (a, b) {
       if (a !== b && a) {
       if (a !== b && a) {
         // 新未读消息
         // 新未读消息
-        if (a.type == 'no_read_count') {
+        if (a.type == 'no_read_count' && this.nowRoute.indexOf('notice') < 0) {
           this.getNotes()
           this.getNotes()
+          // 播放音效
+          this.playAudio()
         }
         }
       }
       }
     },
     },
@@ -325,6 +329,10 @@ export default {
     drawerClose () {
     drawerClose () {
       this.collapsed = false
       this.collapsed = false
     },
     },
+    playAudio () {
+      this.$refs.audio.currentTime = 0// 从头开始播放
+      this.$refs.audio.play() // 播放
+    },
     // 获取最新消息
     // 获取最新消息
     getNotes () {
     getNotes () {
       this.getMessageList({
       this.getMessageList({
@@ -336,20 +344,49 @@ export default {
         readFlag: 0
         readFlag: 0
       }).then((res) => {
       }).then((res) => {
         if (res.status == 200) {
         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
           this.notesList = res.data.list
         } else {
         } else {
           this.notesList = []
           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) {
     setRead (row) {
       this.hasRead({ msg_id: row.id }).then(res => {
       this.hasRead({ msg_id: row.id }).then(res => {
         // 刷新列表
         // 刷新列表
         if (res.status == 200) {
         if (res.status == 200) {
-
+          this.getNotes()
         }
         }
       })
       })
+    },
+    toNotes () {
+      this.$router.push({ path: '/notice' })
     }
     }
   }
   }
 }
 }

+ 8 - 2
src/views/notice/list.vue

@@ -67,7 +67,7 @@
       <!-- 内容 content-->
       <!-- 内容 content-->
       <template slot="content" slot-scope="text, record">
       <template slot="content" slot-scope="text, record">
         {{ text?text.slice(0,30)+(text.length>30?'...':''):'--' }}
         {{ text?text.slice(0,30)+(text.length>30?'...':''):'--' }}
-        <a-button v-if="record.notice.type=='tx'" @click="toAction(record)" size="small" type="link" class="button-info">
+        <a-button v-if="record.notice&&record.notice.type=='tx'" @click="toAction(record)" size="small" type="link" class="button-info">
           {{ record.notice.extInfo.bizType == 'SHELF_REPLENISH' ? '立即处理':'点击查看' }}
           {{ record.notice.extInfo.bizType == 'SHELF_REPLENISH' ? '立即处理':'点击查看' }}
         </a-button>
         </a-button>
       </template>
       </template>
@@ -179,6 +179,12 @@ export default {
       if (data.notice.extInfo.bizType == 'SHELF_WARN') {
       if (data.notice.extInfo.bizType == 'SHELF_WARN') {
         this.$router.push({ name: 'shelfOrderList', query: { shelfSn: data.notice.extInfo.bizSn } })
         this.$router.push({ name: 'shelfOrderList', query: { shelfSn: data.notice.extInfo.bizSn } })
       }
       }
+      this.hasRead({ msg_id: data.id }).then(res => {
+        // 刷新列表
+        if (res.status == 200) {
+          this.handelSearch()
+        }
+      })
     },
     },
     // 查询列表
     // 查询列表
     handelSearch (pageNo) {
     handelSearch (pageNo) {
@@ -206,7 +212,7 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
             data.list[i].no = no + i + 1
-            if (data.list[i].notice.extInfo) {
+            if (data.list[i].notice && data.list[i].notice.extInfo) {
               data.list[i].notice.extInfo = JSON.parse(data.list[i].notice.extInfo)
               data.list[i].notice.extInfo = JSON.parse(data.list[i].notice.extInfo)
             }
             }
           }
           }