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