<template>
  <div class="d-page d-flex flex-column">
    <title-bar
      title="客户及所在集团在我行在途业务申请情况"
      @clickLeft="onClick"
    >
      <van-icon slot="left" name="cross" size="24" />
    </title-bar>

    <!-- <van-index-bar highlight-color="#F79400" :index-list="indexList">
        <van-index-anchor index="客户及所在集团在我行在途业务申请情况">
          <sub-title>客户及所在集团在我行在途业务申请情况</sub-title>
        </van-index-anchor>
        <application-status-form></application-status-form>
      </van-index-bar> -->
    <anchor-nav v-if="itemData.length != 0" ref="anchorNav" :navList="navList">
      <template>
        <div slot="applyBusiness">
          <!-- 申请关联信息 -->
          <div v-for="(item, index) in itemData" :key="index">
            <table-double-view
              :data="item"
              :keyValue="keyValueBasic"
            ></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 ApplicationStatusForm from "@/components/customer-information/business-application-status/application-status/ApplicationStatusForm.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: wanghang
 *@date: 2022-02-19
 */

@Component({
  name: "ApplicationStatus",
  components: { TitleBar, ApplicationStatusForm },
})
export default class ApplicationStatus extends Vue {
  pageTitle = ""; // 页面标题
  indexList = ["客户及所在集团在我行在途业务申请情况"];
  itemData: any = [];
  navList = [
    { key: "applyBusiness", titleText: "客户及所在集团在我行在途业务申请情况" },
  ];
  keyValueBasic = {
    rel_type: "关联类型",
    cus_name: "客户名称",
    prd_name: "产品名称",
    start_date: "申请日期",
    ty_amount: "申请金额",
  };

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

<style scoped></style>
