<template>
  <div>
    <el-popconfirm
        title="确定锁定该客户吗？"
        @confirm="onLock()">
      <el-button style="width:100%" slot="reference" block size="small" >锁定</el-button>
    </el-popconfirm>
  </div>
</template>

<script>
export default {
  name: "lock",
  props:["id"],
  methods:{
    async onLock(){
      const res = await this.$api.requested({
        "id": 20221012164002,
        "content": {
          "sa_customersids": [this.id],
          "datastatus": 2//（0:正常；1:作废；2:锁定）
        },
      })
      this.tool.showMessage(res,() => {
        this.$emit("onshow")
      })

    }
  }
}
</script>

<style scoped>

</style>