<template>
  <!-- <div class=""> -->
  <!-- 123456 -->
  <el-timeline reverse>
   
    <el-timeline-item  v-for="(item, index) in options"
        :key="item.time + index" :timestamp="item.addtime" placement="top">
      <!-- <el-card> -->
        <!-- 111 -->
        <h4>王小虎 {{item.status_name}}</h4>
        <!-- <p>王小虎 提交于 2018/4/12 20:46</p> -->
      <!-- </el-card> -->
    </el-timeline-item>
  </el-timeline>
  <!-- </div> -->
</template>

<script>
import asyncRequest from "@/apis/components/process-time-line";
import resToken from "@/mixins/resToken";
export default {
  name: "processTimeLine",
  props: ["type", "orderCode", "newTime"],
  mixins: [resToken],
  data() {
    return {
      options: [],
      loading: false,
    };
  },
  watch: {
    newTime: function (val) {
      console.log(val);
      if (val) {
        this.getList();
      }
    },
  },
  mounted() {
    this.getList();
  },

  methods: {
    async getList() {
      console.log(123456);
      if (!this.loading) {
        this.loading=true
        this.options = [];
        const res = await asyncRequest.list({
          type: this.type,
          orderCode: this.orderCode,
        });
        if (res && res.code === 0 && res.data) {
          this.options = res.data;
          // this.recursion(this.options);
        } else {
          this.options = [];
        }
        this.loading=false
      }
    },
  },
};
</script>
<style lang="scss">
.date-picker.el-input {
  // width: 150px !important;
}
</style>
