<template>
  <div class="d-page d-flex flex-column">
    <title-bar :title="title" @clickLef="onClick">
      <van-icon slot="left" name="cross" size="30" />
    </title-bar>
    <anchor-nav ref="anchorNav" :navList="navList">
      <template slot="baseInfo">
        <div class="flow-y-dhc">
          <table-double-view :data="dataBasic" :keyValue="keyValueDouble"></table-double-view>
        </div>
      </template>
    </anchor-nav>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import BasicInformation from "@/components/customer-information/business-information/overview/BasicInformation.vue";
import TableDoubleView from "@/public/TableDoubleView.vue";
import TableSingleView from "@/public/TableSingleView.vue";
import Public from "@/public/ts/Public";
import nettyApi from "@/constants/api/ms-netty/netty.api";
import { NativeUI } from "@/public/ts/NativeUI";
import IF from "@/public/factory/InterFaceFactory";
import { toMillion } from "@/public/ts/money.util";
import { getText } from "@/stores";
import { forTime } from "@/public/ts/date.util";

/**
 * @Description 流程查询信息
 * @Author Kangzhirui
 * @Date 2022-3-3 下午 21.48
 */
@Component({
  name: "HistoryView",
  components: { BasicInformation, TableDoubleView, TableSingleView }
})
export default class HistoryView extends Vue {
  title = "审批历史流程详情"; // 页面标题

  indexList = ["审批历史信息"];
  custName = "";
  custType = "";
  custState = "";
  resetvalue = false;

  pageNo = 1;
  pullup = true;
  pulldown = true;
  nodata = true;
  IF: any;
  //流程查询
  pk_value = '';
  cus_id = '';
  list: any = [];

  navList = [{ key: "baseInfo", titleText: "审批历史信息" }];
  keyValueDouble = {
    wfi_node_id: '节点编号',
    wfi_node_name:	'审批岗位',
    SPJLLS:	'处理结果',
    app_advice:	'意见',
    app_org_displayname:	'审批机构名称',
    app_user_displayname:	'审批人',
    operate_time:	'审批时间',
  };
  dataBasic = {
    wfi_node_id: this.$store.getters.getCusInfo.wfi_node_id,
    wfi_node_name:	this.$store.getters.getCusInfo.wfi_node_name,
    SPJLLS:	this.$store.getters.getCusInfo.SPJLLS,
    app_advice:	this.$store.getters.getCusInfo.app_advice,
    app_org_displayname:	this.$store.getters.getCusInfo.app_org_displayname,
    app_user_displayname:	this.$store.getters.getCusInfo.app_user_displayname,
    operate_time:	this.$store.getters.getCusInfo.operate_time,
  };


  /**
   * @Description 审批历史信息
   * @Author Kangzhirui
   * @Date 2022-03-03 下午 21:48
   */
  /**
   * @Description 对公流程列表查询
   * @Author Kangzhirui
   * @Date 2022-3-3 下午 21.48
   */
  selectProcessHistory(pageNo = 1) {
    this.nodata = true;
    const param = {
      // user_code: sessionStorage.getItem('user_code'),
      //流程查询
      instanceid: this.$store.getters.getCusInfo.instanceid, //业务申请号
      nodeid: this.$store.getters.getCusInfo.nodeid,
      orgid: this.$store.getters.getCusInfo.orgid,
      menuId: 'wdgzt_ybsx',
      wfsign: this.$store.getters.getCusInfo.wfsign,	//流程标识
      maxLine: "10",//每页最大数据
      targetPage: pageNo,//目标页
      tc: nettyApi.TRADE_CODE.selectProcessHistory
    };
    NativeUI.showWaiting("正在查询...");
    return IF.transferDataInter(nettyApi.commonRq, param).then((res: any) => {
      console.log('az', res);
      NativeUI.closeWaiting();
      if (res.rc == "1") {
        if (pageNo == 1) {
          this.list = res.iCollWL__resultset;
        } else {
          this.list = this.list.concat(res.iCollWL__resultset);
        }
      } else {
        NativeUI.toast(res.msg);
      }
      if (res.iCollWL__resultset && res.iCollWL__resultset.length < 10) {
        this.pullup = false;
      }
      if (this.list.length == 0) {
        this.nodata = false;
        this.pulldown = false;
      }
    });
  }

  onClick() {
    console.log(111111);
  }

  mounted() {
    this.selectProcessHistory();
  }
}
</script>

<style scoped>
span {
  color: #999999;
  font-size: 16px;
}

.verify-view-details {
  float: right;
  margin-bottom: 10px;
  color: #fd5065;
  font-size: 12px;
  border: 1px solid #fd5065;
  border-radius: 4px;
  background-color: white;
  padding: 0.5% 0.8%;
  font-family: "苹方 粗体", "苹方 中等", "苹方";
}
/*右侧导航栏*/
::v-deep .van-index-bar__sidebar {
  top: 130px !important;
  right: 5px !important;
  transform: unset;
}
</style>
