<template>
  <m-dialog ref="dialog" title="审批明细">
    <el-steps align-center finish-status="success">
      <el-step
        v-for="(item) in items"
        :key="item.id"
        :title="item.title"
        :status="statusMap[item.status]"
      >
        <template #description>
          <div>{{ item.date }}</div>
          <div v-if="item.status === 2">拒绝理由： {{ item.msg }}</div>
        </template>
      </el-step>
    </el-steps>
  </m-dialog>
</template>

<script>
export default {
  name: 'approvalProgress',
  data () {
    return {
      items: [],
      statusMap: ['wait', 'success', 'error']
    }
  },
  methods: {
    open (item) {
      console.log(item)
      this.items = item
      this.$refs.dialog.open()
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
