xiongchao 3 years ago
parent
commit
0dc9d4339c
1 changed files with 19 additions and 13 deletions
  1. 19 13
      src/views/workplace/backlog/WorkplaceBacklog.vue

+ 19 - 13
src/views/workplace/backlog/WorkplaceBacklog.vue

@@ -22,13 +22,13 @@
                   <a-select :default-value="defaultValue" v-model="queryParam.status" placeholder="请选择">
                     <a-select-option
                       :key="1"
-                      label="待办"
-                      :value="1">待办
+                      label="未读"
+                      :value="1">未读
                     </a-select-option>
                     <a-select-option
                       :key="2"
-                      label="已"
-                      :value="2">已
+                      label="已"
+                      :value="2">已
                     </a-select-option>
                   </a-select>
                 </a-form-item>
@@ -55,7 +55,7 @@
             <template>
               <a @click="handle(record)">详情</a>
               <a-divider v-if="record.status === 1" type="vertical" />
-              <a v-if="record.status === 1" @click="dealJumpDetail(record)">处理</a>
+              <a v-if="record.status === 1" @click="dealJumpDetail(record)">跳转</a>
             </template>
           </span>
           <a slot="name" slot-scope="text" v-html="text"> {{ text }}</a>
@@ -191,7 +191,7 @@ export default {
           align: 'center',
           dataIndex: 'status',
           customRender: (text, record, index) => {
-            return (text === 1 ? '待办' : '已办')
+            return (text === 1 ? '未读' : '已读')
           }
         },
         {
@@ -264,6 +264,12 @@ export default {
       this.optionAlertShow = false
     },
     handle (record) {
+      // 已读
+      if (record.status === 1) {
+        updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
+          record.status = 2
+        })
+      }
       fetchWorkplaceBacklogUserById({ id: record.id }).then(res => {
         const data = res.data
         this.$refs.detail.base(data)
@@ -272,10 +278,10 @@ export default {
     dealJumpDetail (record) {
       // 维修跳转到维修详情
       if (record.type === this.DictCache.getValueByCode(this.DictCache.TYPE.WORKPLACE_BACKLOG_TYPE, 'REPAIR')) {
-        // 已
+        // 已
         if (record.status === 1) {
           updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-            console.log('已置为已办')
+            record.status = 2
           })
         }
         if (record.detailType === this.DictCache.getValueByCode(this.DictCache.TYPE.WORKPLACE_BACKLOG_DETAIL_TYPE, 'REPAIR_APPLICATION') ||
@@ -315,7 +321,7 @@ export default {
         })
       } else if (record.type === this.DictCache.VALUE.WORKPLACE_BACKLOG_TYPE.SB_ALLOCATE) {
         this.targetId = record.targetId
-        // 已
+        // 已
         if (record.status === 1) {
           updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
           })
@@ -333,10 +339,10 @@ export default {
           this.$message.info('没有该类型消息通知,请联系管理员...')
         }
       } else if (record.type === this.DictCache.VALUE.WORKPLACE_BACKLOG_TYPE.SB_OIL) {
-        // 已
+        // 已
         if (record.status === 1) {
           updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-            console.log('已置为已')
+            console.log('已置为已')
           })
         }
         // 设备加油处理
@@ -367,10 +373,10 @@ export default {
           this.$message.info('没有该类型消息通知,请联系管理员...')
         }
       } else if (record.type === this.DictCache.VALUE.WORKPLACE_BACKLOG_TYPE.SB_SCRAP) {
-        // 已
+        // 已
         if (record.status === 1) {
           updateWorkplaceBacklog({ id: record.backlogId }).then(res => {
-            console.log('已置为已')
+            console.log('已置为已')
           })
         }
         if (record.detailType === this.DictCache.VALUE.WORKPLACE_BACKLOG_DETAIL_TYPE.SB_SCRAP) {