<template>
  <div>
    <van-nav-bar
      @click-left="onClickLeft"
      @click-right="onClickRight"
      style="background-color: #1989fa"
    >
      <template #title>
        <van-col style="color: #ffffff">催办</van-col>
      </template>
      <template #left>
        <i
          class="fa fa-arrow-circle-left"
          aria-hidden="true"
          style="color: #ffffff; font-size: 18px"
        ></i>
      </template>
      <template #right>
        <van-icon name="replay" size="18" color="#ffffff" />
      </template>
    </van-nav-bar>

    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="已显示所有数据"
      @load="GetTodayTodoSummary"
    >
      <van-cell
        v-for="item in listdata"
        :key="item.id"
        :title="item.rmtype"
        :value="item.num"
        border
        title-class="title1"
        value-class="value1"
        size="large"
        @click="click1($event, item.id)"
      >
        <template #icon>
          <van-icon name="volume-o" color="#1989fa" size="18" />
        </template>
      </van-cell>
    </van-list>
  </div>
</template>

<script>
import { GetTodayTodoSummary } from "@/common/api/loginApi.js";
export default {
  name: "login",
  data() {
    return {
      listdata: [], //公司信息
      radio: "", //单选框
      projectname: "",
      loading: false,
      finished: false,
    };
  },
  created: function () {
    console.info("created");
    //console.info(this.$util);
    this.$util.persistLogin(this);
  },
  methods: {
    GetTodayTodoSummary: function () {
      var that = this;
      var data = {
        userCode: that.$store.state.data.userCode,
        projectId: that.$store.state.projectId,
        page: "",
        pageCount: "",
      };
      console.info("data", data);
      GetTodayTodoSummary(data).then((res) => {
        console.info("GetTodayTodoSummary", res);
        if (!res.result) {
          that.$toast(res.msg);
          return;
        }
        res.data.listdata.forEach(function (item, index, array) {
          that.$set(that.listdata, index, item);
        });
        that.loading = false;
        that.finished = true;
      });
    },
    // 单选按钮点击事件
    click1: function (event, id) {
      //console.info("click1 event", event);
      //console.info("click1 value", id);
      //console.info("click1", e.target.innerText);
      if (id == "1") {
        //逾期待签约客户跳转
        this.$router.push("/getremindsigncontracttoday");
      }
      else if(id=="2"){
        //逾期待认购客户跳转
        this.$router.push("/getremindbuycontracttoday");
      }
       else if(id=="3"){
        //逾期待缴款客户跳转
        this.$router.push("/getremindarrearagetoday");
      }
       else if(id=="4"){
        //逾期待回访客户跳转
        this.$router.push("/getremindvisittoday");
      }
       else if(id=="5"){
        //新分配到的客户跳转
        this.$router.push("/getremindallocation");
      }
    },
    onClickLeft() {
      // this.$toast('返回')
      console.info("left");
      this.$router.go(-1);
    },
    onClickRight() {
      this.$router.go(0);
    },
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.title1 {
  color: #999;
}
.value1 {
  color: #999;
  font-size: 18px;
}
</style>
