<template>
  <div>
    <el-button type="primary" size="mini" v-if="data.status == '新建' && tool.checkAuth($route.name,'check')" @click="check('审核')">审 核</el-button>
    <el-button type="primary" size="mini" @click="check('反审核')" v-else-if="data.status == '审核' && tool.checkAuth($route.name,'reverseCheck')">反 审 核</el-button>
  </div>
</template>

<script>
export default {
  props:['data'],
  name: '',
  data() {
    return {
    };
  },
  computed:{
  },
  watch:{
  },
  methods: {
    async check (title) {
      this.$confirm(`确定${title}当前核销单吗?`,'提示',{
        "confirmButtonText":'确定',
        "cancelButtonText":'取消'
      }).then( async () => {
        let res = await this.$api.requested({
        "id":20221124090404,
          "content": {
            sa_writeoffbillid:this.$route.query.id
          }
        })
        this.tool.showMessage(res,() => {
          this.$emit('onSuccess')
        })
      })

      
    }
  },
};
</script>

<style scoped>

</style>
