Эх сурвалжийг харах

月报历史记录实时刷新

洪海涛 4 жил өмнө
parent
commit
9446f4530a

+ 11 - 2
src/views/monthlyReport/childrenPage/editReport/components/historyRecord.vue

@@ -42,6 +42,13 @@ export default {
     commentsAndChanges
     // record
   },
+  props: {
+    value: {
+      type: Boolean,
+      required: false,
+      default: () => false
+    }
+  },
   data() {
     return {
       historyList: [],
@@ -65,6 +72,9 @@ export default {
       if (this.tabPosition === 'second') {
         this.getHistoryFn()
       }
+    },
+    value() {
+      this.getHistoryFn()
     }
   },
   mounted() {
@@ -80,9 +90,8 @@ export default {
         if (res.code === 200) {
           this.historyList = res.data
         }
-
-        console.log(res)
       }
+      this.$emit('input', false)
     },
     // 查看历史月报详情
     showHistory(item) {

+ 3 - 1
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -100,7 +100,7 @@
             />
           </div>
           <div v-else style="margin-top: 30px;">暂无数据!</div>
-          <historyRecord v-if="pageType.search(/All/) < 0 && tabPageData && windowHref.indexOf('isHistory=new') < 0" />
+          <historyRecord v-model="historyRecordReload" v-if="pageType.search(/All/) < 0 && tabPageData && windowHref.indexOf('isHistory=new') < 0" />
         </div>
         <div class="right-wrapper">
           <Affix
@@ -249,6 +249,7 @@ export default {
       monthlyReportPreView: null,
       monthlyReportPrePdfView: null,
       scrollTop: 0,
+      historyRecordReload: false, // 月报历史记录实时刷新
       windowHref: ''
     }
   },
@@ -426,6 +427,7 @@ export default {
           window.log({ c: 'report_edit', d: 'report_edit_save' })
           this.$message.success('保存成功!')
         }
+        this.historyRecordReload = true
       })
     },
     // 月报确认