<template>
  <div class="bxcbhb" @click="bxcbhb">
    <div class="godetail"><img src="../../assets/bargound/shuangjiantou.png" alt="">&nbsp;保险承保核保</div>
    <dv-scroll-board :config="bx_data" style="width:96%;height:82%;text-align: center;margin: 1% auto;" />
  </div>
</template>
<script>
import { bxcbhbchartInfo } from "../../servuces/prove";
export default {
  data () {
    return {
      bx_data: {
        header: ['/', '新保金额', '续保金额', '总承保金额', '理赔金额', '理赔比例'],
        data: [],
        rowNum: 4,
        headerBGC: 'rgb(19,54,84)',
        headerHeight: 28,
        align: 'center',
        evenRowBGC: 'rgb(8,27,43)',
        oddRowBGC: 'rgb(19,54,84)',
      },
    }
  },
  mounted () {
    this.getData();
  },
  methods: {
    getData () {
      bxcbhbchartInfo().then(res => {
        const keyindex = {
          'name': 0,
          'first_amount': 1,
          'again_amount': 2,
          'amount': 3,
          'lp_amount': 4,
          'lpbl': 5
        };

        let item_values = [];
        res.data.map(obj => {
          let item_value = [];
          for (let key in obj) {
            let index = keyindex[key]
            item_value[index] = obj[key] + ''
          }
          item_values.push(item_value)
        });
        this.bx_data.data = item_values;
        this.bx_data = { ...this.bx_data }

      })
    },
    bxcbhb(){
      this.$router.push('/baoxianchengbaodetail')

    }
  }
}
</script>
<style scoped lang="scss">
.bxcbhb {
  width: 100%;
  height: 100%;
}
</style>