chris 3 rokov pred
rodič
commit
2e895c5a00

+ 4 - 4
src/views/common/msg.vue

@@ -87,10 +87,10 @@
       // 跳转到消息页面
       detail (row) {
         routeMsg(this, row)
-        readNotice(this, row.noticeId)
-        // if (row.type === 3) {
-        //   readNotice(this, row.noticeId)
-        // }
+        // readNotice(this, row.noticeId)
+        if (row.type === 3) {
+          readNotice(this, row.noticeId)
+        }
         if (this.notify) {
           this.notify.close()
         }

+ 3 - 1
src/views/modules/msg-center/announcement.vue

@@ -220,7 +220,9 @@
         this.$nextTick(() => {
           this.$refs.addOrUpdate.init(row.noticeId)
         })
-        readNotice(this, row.noticeId)
+        if (row.noticeId) {
+          readNotice(this, row.noticeId)
+        }
       }
     }
   }

+ 12 - 6
src/views/modules/msg-center/approve.vue

@@ -112,7 +112,7 @@
         width="80"
         label="操作">
         <template slot-scope="scope">
-          <el-button v-if="Number(scope.row.state) !== 3 && checkUser(scope.row)" type="text" size="small" @click="addOrUpdateHandle(scope.row.businessType, scope.row.businessId)">处理</el-button>
+          <el-button v-if="Number(scope.row.state) !== 3 && checkUser(scope.row)" type="text" size="small" @click="addOrUpdateHandle(scope.row)">处理</el-button>
           <el-button v-else type="text" size="small" @click="detailHandle(scope.row)">查看</el-button>
         </template>
       </el-table-column>
@@ -134,7 +134,7 @@
 <script>
   import AddOrUpdate from './approve-add-or-update'
   import { getApprovalList } from '@/api/msg'
-  // import { getApprovalList, readNotice } from '@/api/msg'
+  import { readNotices } from '@/utils/msg'
   import { getCusList } from '@/api/cus'
   import { checkStr } from '@/api/util'
   export default {
@@ -274,10 +274,14 @@
         return checkStr(currentUser, row.currentApprover)
       },
       // 新增 / 修改
-      addOrUpdateHandle (businessType, businessId) {
+      addOrUpdateHandle (row) {
         this.addOrUpdateVisible = true
+        // 已查看
+        if (row.noticeIds) {
+          readNotices(this, row.noticeIds)
+        }
         this.$nextTick(() => {
-          this.$refs.addOrUpdate.init(businessType, businessId)
+          this.$refs.addOrUpdate.init(row.businessType, row.businessId)
         })
       },
       // 详情
@@ -286,8 +290,10 @@
         this.$nextTick(() => {
           this.$refs.addOrUpdate.init(row.businessType, row.businessId, true)
         })
-        // todo 已查看
-        // readNotice(this, row.noticeId)
+        // 已查看
+        if (row.noticeIds) {
+          readNotices(this, row.noticeIds)
+        }
       }
     }
   }

+ 1 - 1
src/views/modules/msg-center/notice.vue

@@ -150,7 +150,7 @@
       },
       // 查看消息
       detailHandle (row) {
-        this.checkHandle(row.noticeId)
+        // this.checkHandle(row.noticeId)
         routeMsg(this, row)
       },
       timestampToTime (l) {