<template>
  <div>
    <el-button type="primary" size="mini" @click="check('审核')" v-if="data.status == '新建' && tool.checkAuth($route.name,'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>
import { log } from '@antv/g2plot/lib/utils';
export default {
  name: '',
  props:['data'],
  data() {
    return {
    };
  },
  computed:{
  },
  watch:{
  },
  methods: {
    check (status) {
      this.$confirm(`确定${status}当前促销方案吗?`,'提示',{
        confirmButtonText:'确定',
        cancelButtonText:'取消',
        type:'warning'
      }).then(async () => {
        let id
        status == '审核' ? id = 20221230145003 : id = 20221230145103
        let res = await this.$api.requested({
          "id": id,
          "version":1,
          "content": {
              "sa_promotionid": this.$route.query.id
          }
        })
        this.tool.showMessage(res,() => {
          this.$emit('onSuccess')
        })
      })
    }
  },
};
</script>

<style scoped>

</style>
