lilei 2 лет назад
Родитель
Сommit
d3dce0cb84

+ 1 - 1
public/version.json

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

+ 7 - 0
src/api/noticeUser.js

@@ -33,6 +33,13 @@ export const hasRead = id => {
     url: `noticeUser/setRead/${id}`,
     method: 'get'
   })
+}
+// 设置全部已读
+export const setReadAllNotice = params => {
+  return axios({
+    url: `noticeUser/setReadAllNotice`,
+    method: 'get'
+  })
 }
  // 消息公共权限设置列表
 export const noticeUserBizQuery = (params) => {

+ 11 - 1
src/store/modules/websocketStore.js

@@ -1,5 +1,5 @@
 // import Vue from 'vue'
-import { noticeUserList, hasRead, getUnreadCount } from '@/api/noticeUser'
+import { noticeUserList, hasRead, getUnreadCount, setReadAllNotice } from '@/api/noticeUser'
 export default {
   state: {
     websock: null,
@@ -115,6 +115,16 @@ export default {
         })
       })
     },
+    // 全部已读 
+    setAllNoticeRead({ state, commit }) {
+      return new Promise((resolve, reject) => {
+        setReadAllNotice().then((res) => {
+          resolve(res)
+        }).catch(error => {
+          reject(error)
+        })
+      })
+    },
     // 更新未读数
     updateUnreadcount ({ state, commit }, count) {
       commit('setMessageCount', count)

+ 18 - 5
src/views/notice/list.vue

@@ -4,17 +4,17 @@
     <div ref="tableSearch" class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="handelSearch(1)">
         <a-row :gutter="15">
-          <a-col :md="8" :sm="24">
+          <a-col :md="6" :sm="24">
             <a-form-item label="发布时间">
               <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
-          <a-col :md="8" :sm="24">
+          <a-col :md="4" :sm="24">
             <a-form-item label="标题">
               <a-input v-model.trim="queryParam.notice.title" allowClear placeholder="请输入标题"/>
             </a-form-item>
           </a-col>
-          <a-col :md="8" :sm="24">
+          <a-col :md="4" :sm="24">
             <a-form-item label="类型">
               <a-select v-model.trim="queryParam.notice.type" allowClear placeholder="请选择类型">
                 <a-select-option v-for="item in typeList" :key="item.val" :value="item.val">
@@ -23,7 +23,7 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :md="8" :sm="24">
+          <a-col :md="4" :sm="24">
             <a-form-item label="状态">
               <a-select v-model.trim="queryParam.readFlag" allowClear placeholder="请选择状态">
                 <a-select-option value="0">
@@ -35,12 +35,16 @@
               </a-select>
             </a-form-item>
           </a-col>
-          <a-col :md="8" :sm="24">
+          <a-col :md="6" :sm="24">
             <a-button type="primary" @click="handelSearch(1)" :disabled="disabled" id="noticeList-refresh">查询</a-button>
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="noticeList-reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button type="primary" class="button-error" @click="handleSetRead">设置全部已读</a-button>
+      </div>
     </div>
     <!-- 列表 -->
     <a-table
@@ -155,6 +159,7 @@ export default {
   methods: {
     ...mapActions([
       'getMessageList', // 查询列表
+      'setAllNoticeRead',
       'hasRead' // 设置已读
     ]),
     //  时间  change
@@ -162,6 +167,14 @@ export default {
       this.queryParam.beginDate = date[0] ? date[0] : ''
       this.queryParam.endDate = date[1] ? date[1] : ''
     },
+    handleSetRead () {
+      this.setAllNoticeRead().then(res => {
+      	if (res.status == 200) {
+          this.$message.info(res.message)
+          this.resetSearchForm()
+      	}
+      })
+    },
     toAction (data) {
       // 急送订单
       if (data.notice.extInfo.bizType == 'TEMP_ORDER') {

+ 2 - 2
src/views/numsGoodsShelves/replenishmentManagement/list.vue

@@ -416,8 +416,7 @@ export default {
           this.tabPaneData[3].countNum = res.data.WAIT_CHECK || 0
           this.tabPaneData[4].countNum = res.data.FINISH || 0
           this.tabPaneData[5].countNum = res.data.CANCEL || 0
-          this.queryParam.bizType = this.$route.query && this.$route.query.bizType || this.curBizType
-          this.curBizType = this.queryParam.bizType
+          this.queryParam.bizType = this.curBizType
           this.$refs.table.refresh(!flag)
         }
         this.spinning = false
@@ -433,6 +432,7 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
+      this.curBizType = this.$route.query && this.$route.query.bizType || this.curBizType
       this.queryByTypeSum()
     }
   },