zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<template>
  <div class='app'>
    <!--周报录入-->
    <div>
      <a-button @click='handleReload' style='position: absolute;z-index: 300;right: 40px;top: 45px' type='primary'>
        刷新
      </a-button>
 
      <weekly-list-project-compent :model='model'  @onLoadMore='onLoadMore' :loadingMore='loadingMore' @reload='handleReload' :show-load-model='true'  />
    </div>
  </div>
 
</template>
 
<script>
import { deleteAction, getAction, postAction, putAction } from '@api/manage'
 
import WeeklyListProjectCompent from '@views/week/modules/WeeklyListProjectCompent'
 
export default {
  name: 'RightAllProjectWeekly',
  components: { WeeklyListProjectCompent },
  props: {
 
  },
  watch: {
 
  },
  data() {
    return {
      loading: false,
      loadingMore: false,
      showLoadingMore: true,
      page:1,
      model: {
        result:[]
      },
 
      url: {
        addBatch: '/wek/record/addBatch'
      }
    }
  },
  created() {
    this.page = 1
    this.onLoadMore()
  },
  methods: {
    onLoadMore() {
      this.loadingMore = true
      getAction('/wek/record/queryAllProjectWeekly', {page:this.page}).then((res) => {
        if (res.success) {
 
          if (this.page == 1) {
            this.model = res
          } else {
            this.model.result = this.model.result.concat(res.result)
          }
          //有数据才添加页码
          if (res.result && res.result.length > 0) {
            this.page++
          } else {
            this.$message.warning('无更多数据')
          }
 
        }else {
          this.$message.warning(res.message)
        }
        this.loadingMore = false
        this.$nextTick(() => {
          window.dispatchEvent(new Event('resize'))
        })
      })
 
    },
 
 
 
    handleReload() {
      this.page = 1
      this.onLoadMore()
    }
  },
  computed: {}
}
</script>
 
<style lang='less' scoped>
.app {
  width: 100%;
  height: 100%;
  background: white;
  min-height: calc(100vh - 140px);
 
 
}
 
 
</style>