<template>
  <div>
    <el-button v-show="auditInfo.auditStatus > 0" type="text" size="mini" @click="handleProgress()">[点击查看]</el-button>
    <el-button v-show="auditInfo.auditStatus === 0 && !auditInfo.submitDate" type="text" size="mini" class="gray">[无]</el-button>
    <el-button
      v-show="auditInfo.auditStatus === 0 && auditInfo.submitDate"
      type="text"
      size="mini"
      class="red"
      @click="handleProgress()"
    >[已退回]</el-button>
  </div>
</template>

<script>
import { deepClone } from '@/utils'
export default {
  props: {
    audit: {
      type: Object,
      default() {
        return {
          auditStatus: 0,
          submitDate: undefined
        }
      }
    }
  },
  data() {
    return {
      auditInfo: deepClone(this.audit)
    }
  },
  watch: {
    audit(val) {
      this.auditInfo = deepClone(val)
    }
  },
  methods: {
    handleProgress() {
      this.$emit('show_progress', this.auditInfo)
    }
  }
}
</script>
