<template>
  <div>
      <el-button size="mini"  :type="!disabled?'':'primary'" style="width:100%" @click="onShow" :disabled="!disabled">提 交</el-button>
  </div>
</template>

<script>
export default {
  name: "submitTo",
  props:["sa_quotedpriceid","disabled"],
  methods:{
    onShow(){
      this.$confirm('确定提交该报价单吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.CheckRow()
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消提交'
        });
      });
    },
    async CheckRow(){
      console.log("报价单id"+this.sa_quotedpriceid)
      const res = await this.$api.requested({
        "id": 20221020165303,
        "version":1,
        "content": {
          "sa_quotedpriceid":this.sa_quotedpriceid
        }
      })
      this.tool.showMessage(res, ()=>{
        console.log(res)
        this.$emit("onSubmit")
      })
    }
  }
}
</script>

<style scoped>

</style>