<template>
  <view class="item-box">
  <view class="tripartite-item">
    <item-img label="征信照片" :value="credit.credit_img" @onShowImg="onShowImg"></item-img>
  </view>
  <view class="tripartite-item" v-for="(deal,dealIndex) in credit.deal_data">
    <item-title :title-type="2" v-if="deal.deal_type*1===1" label="个人住房贷款" ></item-title>
    <item-title :title-type="2" v-else-if="deal.deal_type*1===2" label="个人商用住房贷款" ></item-title>
    <item-title :title-type="2" v-else-if="deal.deal_type*1===3" label="其他类贷款" ></item-title>
    <item-title :title-type="2" v-else-if="deal.deal_type*1===4" label="贷记卡" ></item-title>
    <item-title :title-type="2" v-else-if="deal.deal_type*1===5" label="其他" ></item-title>
    <item-text label="账户数" :value="deal.account_num" ></item-text>
    <item-text label="首笔业务发放年份" :value="deal.first_date" ></item-text>
  </view>

    <view class="tripartite-item" v-for="(overdue,overdueIndex) in credit.overdue_data">
      <item-title :title-type="2" v-if="overdue.overdue_type*1===1" label="循环贷款账户一信息汇总" ></item-title>
      <item-title :title-type="2" v-else-if="overdue.overdue_type*1===2" label="循环贷款账户二信息汇总" ></item-title>
      <item-title :title-type="2" v-else-if="overdue.overdue_type*1===3" label="循环贷款账户三信息汇总" ></item-title>
      <item-title :title-type="2" v-else-if="overdue.overdue_type*1===4" label="贷记卡账户信息汇总" ></item-title>
      <item-title :title-type="2" v-else-if="overdue.overdue_type*1===5" label="准贷记卡账户信息汇总" ></item-title>
      <item-text label="管理机构数" :value="overdue.regulate_num" ></item-text>
      <item-text label="账户数" :value="overdue.account_num" ></item-text>
      <item-text label="授信总额" :value="overdue.credit_money" ></item-text>
      <item-text label="余额" :value="overdue.balance" ></item-text>
      <item-text label="最近6个月平均应还" :value="overdue.average_money" ></item-text>
      <item-text label="最长逾期月数" :value="overdue.overdue_num" ></item-text>
      <item-text label="单月最高逾期金额" :value="overdue.overdue_money" ></item-text>
    </view>
    <view class="tripartite-item" v-for="(query,queryIndex) in credit.query_data">
      <item-title :title-type="2" v-if="query.query_type*1===1" label="近6个月查询机构数" ></item-title>
      <item-title :title-type="2" v-else-if="query.query_type*1===2" label="近6个月查询次数" ></item-title>
      <item-title :title-type="2" v-else-if="query.query_type*1===3" label="近2年查询次数" ></item-title>
      <view v-if="query.query_type<=2">
        <item-text label="贷款审批" :value="query.loans_num" ></item-text>
        <item-text label="信用审批" :value="query.credit_num" ></item-text>
      </view>
      <view v-if="query.query_type*1===2">
        <item-text label="本人查询" :value="query.self_num" ></item-text>
      </view>
      <view v-if="query.query_type*1===3">
        <item-text label="贷后管理" :value="query.post_loan_num" ></item-text>
        <item-text label="担保资格审查" :value="query.guarantee_num" ></item-text>
        <item-text label="法人代表、负责人、高管等自信审查" :value="query.legal_num" ></item-text>
      </view>
    </view>


  </view>
</template>

<script>
import ItemImg from "@/pages-task/task-info/module/item-img";
import IdentityItem from "@/pages-task/task-info/module/identity-item";
import ItemText from "@/pages-task/task-info/module/item-text";
import ItemTitle from "@/pages-task/task-info/module/item-title";

export default {
  name: "task-credit",
  components: {ItemImg, IdentityItem, ItemText, ItemTitle},
  props: {
    credit:{
      default:{}
    },
    typeKeys:{
      default:[]
    }
  },
  data() {
    return {}
  },
  watch: {},
  mounted() {

  },
  methods: {
    onShowImg(img){
      this.$emit('onShowImg',img)
    }
  }
}
</script>

<style scoped lang="scss">
@import "@/static/css/task-info/item";
</style>
