<template>
  <div>
    <tableLayout :layout="tablecols" :data="list" :custom="true" height="calc(100vh - 405px)">
      <template v-slot:customcol="scope">
        <div v-if="scope.column.columnname == 'balance'">
          <span>{{scope.column.data[[scope.column.columnname]] !== 0?tool.formatAmount(scope.column.data[[scope.column.columnname]],2):'--'}}</span>
        </div>
        <div v-else-if="scope.column.columnname == 'creditquota'">
          <span>{{scope.column.data[[scope.column.columnname]] !== 0?tool.formatAmount(scope.column.data[[scope.column.columnname]],2):'--'}}</span>
        </div>
        <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
      </template>
    </tableLayout>
  </div>
</template>

<script>
export default {
  name: "index",
  props:["data"],
  data () {
    return {
      list:[],
      tablecols:[],
      param:{}
    }
  },
  components:{
  },
  methods:{
    async query_areascope () {
      const res = await this.$api.requested({
        "id": "20221009160003",
        "version":1,
        "content": {
          "sys_enterpriseid":this.data.sys_enterpriseid
        }
      })
      this.list = res.data
    },
  },
  mounted () {
    this.query_areascope()
  },
  watch:{
    mainData (val) {
      this.param = val
      // this.query_areascope()
    }
  },
  created () {
    // 获取角色表结构
    this.tablecols = this.tool.tabelCol(this.$route.name)['accountMoneyTable'].tablecols
  }
}
</script>

<style scoped>

</style>