<template>
  <el-steps
    :active="active"
    align-center
    process-status="finish"
    style="padding: 12px 0 18px 0"
  >
    <el-step
      :title="tab.label"
      v-for="(tab, index) in dstatusOptions"
      :key="tab.name + index"
    ></el-step>
  </el-steps>
</template>

<script>
export default {
  props: ["dstatus"],
  data() {
    return {
      active: -1,
      status: "",
      // 状态
      dstatusOptions: [
        { id: "1", label: "待业务审核" },
        { id: "2", label: "待财务审核" },
        { id: "3", label: "待资金认领完成" },
        { id: "4", label: "退款已完成" },
      ],
    };
  },
  watch: {
    dstatus: function (val) {
      this.status = val;
      console.log(this.status);
      if (this.status) {
        this.initForm();
      }
    },
  },

  methods: {
    async initForm() {
      this.active = this.dstatusOptions.findIndex((v) => v.id === this.status);
    },
  },
};
</script>

<style>
</style>