<template>
  <div class="binary">
    <div class="binary-left">
      <all-user-files v-ref:alluser :row="row" @select-changed="selected"></all-user-files>
    </div>
    <div class="binary-right">
      <div class="flex">
        <strong class="bg-info text-center">可选择的分表信息</strong>
        <split-list v-ref:split :data="row" @refresh="refreshView"></split-list>
        <strong class="bg-info text-center">总表下的分表信息</strong>
        <total-split-list v-ref:totalsplit :data="row" @refresh="refreshAllUser" style="height: 60%;"></total-split-list>
      </div>
    </div>
  </div>
</template>
<script>
  /**
   *发票分配汇总组件
   */

  export default {
    title: '总分表管理',
    data () {
      return {
        row: null,
        all: false
      }
    },
    methods: {
      selected (obj) {
        console.log(obj)
        console.log('我还没选你就给我默认了？？？')
        this.row = obj.val
      },
      refreshView () {
        this.$refs.totalsplit.getUpdate(this.row.f_user_id)
        this.refreshAllUser()
      },
      refreshAllUser () {
        this.$refs.alluser.$refs.paged.$refs.cri.search()
        this.$refs.split.search()
        this.$refs.split.ids = []
      }
    }
  }
</script>
