<template>
<div class="noSpSo">
  <Query
    class="noSpSo__query"
    @getList="getList"
  ></Query>
  <List
    :list="noSpSoList"
    :total="total"
    :currentNo="currentNo"
    :pageSize="pageSize"
    @getList="getList"
  ></List>
</div>
</template>

<script>
import Query from './components/Query'
import List from './components/List'

export default {
  name: 'NoSpSo',
  components: { Query, List },
  mounted () {
    this.getList()
  },

  data () {
    return {
      query: {
        'page.currentPage': 1,
        'page.limitCount': 20,
      }, // 查询条件
      noSpSoList: [], // 报表列表
      total: 0, // 总数据量
      currentNo: 1,
      pageSize: 20,
    }
  },
  methods: {
    // 获取报表列表
    getList (query = {}) {
      const url = this.$API.summaryReport.noSpSoList
      const param = { ...this.query, ...query }
      param.quickCondition !== undefined && (param.quickCondition = `%${param.quickCondition}%`) // 避免传空值只能查到部分数据
      this.$https.post(url, param)
        .then(data => {
          this.noSpSoList = data.rows
          this.total = data.total
          this.currentNo = data.currentPage
          this.pageSize = data.limit
        })
    },
    // 勾选变化, 缓存id
    // cacheSelectedIds (ids) {
    //   this.selectedIds = ids
    // }
  },
}
</script>

<style lang="scss" scoped>
.noSpSo__query {
  margin-bottom: 20px;
}
</style>
