<template>
  <div v-if="nodata" class="customer-management-information-content">
    <scroller-view v-calculate-height :pulldown="pulldown" :pullup="pullup" :refresh-data="selectBZXR" :load-data="onloaddata">
      <div v-for="(item, index) in itemData" :key="index" class="customer-data-list" @click="onClientInfo(item)">
        <div class="data-title">{{ item.title }}</div>
        <div>被执行人名称：{{ item.pname }}</div>
        <div>立案时间：{{ item.sortTimeString }}</div>
      </div>
    </scroller-view>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import nettyApi from "@/constants/api/ms-netty/netty.api.ts";
import IF from "@/public/factory/InterFaceFactory";
import { NativeUI } from "@/public/ts/NativeUI";
import Public from '@/public/ts/Public';
/**
 * @Description 被执行人信息
 * @Author JiangTao
 * @Date 2021-11-10 下午 04:13
 */
@Component({
  name: "InformationOfThePersonSubjectToExecution",
})
export default class InformationOfThePersonSubjectToExecution extends Vue {
  itemData = [];
  pageNo = 1;
  pullup = true;
  pulldown = true;
  nodata = true;
  mounted() {
    this.selectBZXR();
  }
  onClientInfo(item: any) {
    this.$router.push({
      name: "InformationOfThePersonSubjectToExecutionDetail",
      params: item
    });
  }
  //上拉加载
  onloaddata() {
    this.pageNo = Math.ceil(this.itemData.length / 10) + 1;
    return this.selectBZXR(this.pageNo);
  }
  selectBZXR(pageNo = 1) {
    let param = {
      pname: this.$store.getters.getCusInfo.cus_name,
      pageno: pageNo,
      beginTime: "",
      endTime: "",
      ProdId: Public.getProdId(),
      SvrCode: Public.getSvrCode(nettyApi.TRADE_CODE.selectBZXR),
      ClientNo: this.$store.getters.getCusInfo.cus_id,
      tc: nettyApi.TRADE_CODE.selectBZXR, //被执行人
    };
    NativeUI.showWaiting("正在查询...");
    return IF.transferDataInter(nettyApi.commonRq, param).then((res: any) => {
      NativeUI.closeWaiting();
      if (res.rc == "1") {
        if (res.zxggList.length !== 0) {
          if (pageNo == 1) {
            this.itemData = res.zxggList;
          } else {
            this.itemData = this.itemData.concat(res.zxggList);
          }
        }
      } else {
        if (res.ret_code != "4999999") {
          NativeUI.toast(res.msg);
        }
      }
      if (res.zxggList && res.zxggList.length < 10) {
        this.pullup = false;
      }
      if (this.itemData.length == 0) {
        this.nodata = false;
        this.pulldown = false;
      }
    });
  }
}
</script>

<style scoped></style>
