<template>
<div class="noRcvAsn">
  <Query
    class="noRcvAsn__query"
    @getList="getList"
  ></Query>
  <List
    :list="noRcvAsnList"
    :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: 'NoRcvAsn',
  components: { Query, List },
  mounted () {
    this.getList()
  },

  data () {
    return {
      query: {
        'page.currentPage': 1,
        'page.limitCount': 20,
      }, // 查询条件
      noRcvAsnList: [], // 报表列表
      total: 0, // 总数据量
      currentNo: 1,
      pageSize: 20,
    }
  },
  methods: {
    // 获取报表列表
    getList (query = {}) {
      const url = this.$API.summaryReport.noRcvAsnList
      const param = { ...this.query, ...query }
      param.quickCondition !== undefined && (param.quickCondition = `%${param.quickCondition}%`) // 避免传空值只能查到部分数据
      this.$https.post(url, param)
        .then(data => {
          this.noRcvAsnList = 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>
.noRcvAsn__query {
  margin-bottom: 20px;
}
</style>
