<template>
  <div class="flex-row">
    <div class="basic-main" :class="{'basic-main':!chargeShow,'binary-left':chargeShow}" style="height: 98%;">
      <batch-preloads-list :charge-show="chargeShow"  v-ref:list></batch-preloads-list>
    </div>
    <div style="height: 98%;width: 40%" class="binary-right" v-if="chargeShow">
      <batch-preloads-charge :batch-id="batch_id" v-ref:charge></batch-preloads-charge>
    </div>
  </div>
</template>
<script>
export default {
  title: '批量预存',
  data () {
    return {
      chargeShow: false,
      batch_id: ''
    }
  },
  ready () {},
  methods: {},
  events: {
    async batchToSell (condition) {
      await this.$resetpost(`rs/logic/sale_chargePreloads`, {condition}, {
        resolveMsg: '生成收费记录成功',
        rejectMsg: '生成收费记录失败',
        silent: true
      }, 0).then(res => {
        this.batch_id = res.data
      })
      await this.$refs.list.search()
      this.chargeShow = true
    },
    reSearch () {
      this.chargeShow = false
    }
  }
}
</script>
<style lang="less" scoped>
</style>
