<template>
  <div class="d-page d-flex flex-column">
    <title-bar title="客户高管授信情况" @clickLeft="onClick">
      <van-icon slot="left" name="cross" size="24" />
    </title-bar>
    <!-- <div class="information-container h-scroller flex-1-dhc">
      <van-index-bar highlight-color="#F79400" :index-list="indexList">
        <van-index-anchor index="客户及高管在我行授信情况(个贷)">
          <sub-title>客户及高管在我行授信情况(个贷)</sub-title>
        </van-index-anchor>
        <personal-loan></personal-loan>
        <van-index-anchor index="客户及高管在他行授信情况(征信)">
          <sub-title>客户及高管在他行授信情况(征信)</sub-title>
        </van-index-anchor>
        <credit></credit>
      </van-index-bar>
    </div> -->
    <anchor-nav
      v-if="itemData1.length + itemData2.length != 0"
      ref="anchorNav"
      :navList="navList"
    >
      <template>
        <div slot="BasicPersonal">
          <!-- 我行授信情况 -->
          <div v-for="(item, index) in itemData1" :key="index">
            <table-double-view
              :data="item"
              :keyValue="keyValueBasic_personal"
            ></table-double-view>
          </div>
        </div>
        <div slot="BasicCredit">
          <!-- 我行授信情况 -->
          <div v-for="(item, index) in itemData2" :key="index">
            <table-double-view
              :data="item"
              :keyValue="keyValueBasic_Credit"
            ></table-double-view>
          </div>
        </div>
      </template>
    </anchor-nav>
    <div v-else align="center">
      <img
        src="@/assets/images/nodata.png"
        style="width: 40%; margin-top: 137px"
      />
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import TitleBar from "@/components/general/TitleBar.vue";
import Credit from "@/components/customer-information/business-application-status/credit-status-of-client-executives/Credit.vue";
import PersonalLoan from "@/components/customer-information/business-application-status/credit-status-of-client-executives/PersonalLoan.vue";
import nettyApi from "@/constants/api/ms-netty/netty.api.ts";
import IF from "@/public/factory/InterFaceFactory";
import { NativeUI } from "@/public/ts/NativeUI";
import TableDoubleView from "@/public/TableDoubleView.vue";
import TableSingleView from "@/public/TableSingleView.vue";
/**
 * @Description 客户高管授信情况
 * @Author JiangTao
 * @Date 2021-11-10 下午 03:16
 */
@Component({
  name: "CreditStatusOfClientExecutives",
  components: { TitleBar, Credit, PersonalLoan },
})
export default class CreditStatusOfClientExecutives extends Vue {
  pageTitle = ""; // 页面标题
  indexList = [
    "客户及高管在我行授信情况(个贷)",
    "客户及高管在他行授信情况(征信)",
  ];
  itemData1: any[] = []; //我行授信情况
  itemData2: any[] = []; //他行授信情况
  navList = [
    { key: "BasicPersonal", titleText: "我行授信情况(个贷)" },
    { key: "BasicCredit", titleText: "他行授信情况(征信)" },
  ];
  //我行授信情况(个贷)
  keyValueBasic_personal = {
    rel_type: "关联类型",
    com_mrg_name: "客户名称",
    prd_name: "业务品种",
    cont_amt: "合同金额(元)",
    acc_balance: "借据金额(元)",
    loan_status: "贷款状态",
    cla: "风险分类",
    flag: "所处阶段",
  };
  //'他行授信情况(征信)
  keyValueBasic_Credit = {
    gxdl: "关联类型",
    glxl: "关系细类",
    cus_name: "客户名称",
    ywpz: "业务品种",
    cur: "币种",
    jjje: "借据金额(元)",
    jjye: "借据金额(元)",
    num: "笔数",
    cla: "风险分类",
    start_date: "放款日期",
    end_date: "到期日期",
    dkxs: "贷款形式",
    assure: "担保",
    is_extend: "是否展期",
  };

  onClick() {
    this.$router.go(-1);
  }
  mounted() {
    this.pageTitle = this.$route.meta?.name;
    this.selectSXGD();
  }
  selectSXGD(pageNo = 1) {
    let param = {
      cus_id: this.$store.getters.getCusInfo.cus_id,
      tc: nettyApi.TRADE_CODE.selectGDSX,
    };
    NativeUI.showWaiting("正在查询...");
    IF.transferDataInter(nettyApi.commonRq, param).then((res: any) => {
      NativeUI.closeWaiting();
      if (res.rc === "1") {
        if (res.CusManagerLmtList.length != 0) {
          this.itemData1 = res.CusManagerLmtList;
        }
        if (res.CusManagerApplyList.length != 0) {
          this.itemData2 = res.CusManagerApplyList;
        }
      } else {
        NativeUI.toast(res.msg);
      }
    });
  }
}
</script>

<style scoped></style>