<template>
  <div class="inline-16">
    <el-button size="mini" type="primary" @click="open" >关闭</el-button>
  </div>

</template>

<script>
export default {
  name: "close",
  props:["data"],
  methods:{
    open() {
      this.$confirm('此操作将关闭该年度不可再进行修改, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.closeCheck()
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消关闭'
        });
      });
    },
    async closeCheck(){
      const res = await this.$api.requested({
        "id": 20221118105502,
        "content": {
          "sa_salestargetbillid": this.data.sa_salestargetbillid
        }
      })
      this.tool.showMessage(res,()=>{
        this.$emit("onClose")
      })
    }
  }
}
</script>

<style scoped>

</style>