<template>
  <div>
    <el-button type="primary" size="small" :disabled="length === 0" @click="dialogVisible = true">删 除</el-button>
    <el-dialog
        title="提示"
        :visible.sync="dialogVisible"
        append-to-body
        width="20%"
        >
      <span>确定删除这些商品吗</span>
      <span slot="footer" class="dialog-footer">
    <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
    <el-button size="mini" type="primary" @click="delProduct">确 定</el-button>
  </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "delProduct",
  props:['data'],
  data(){
    return {
      dialogVisible:false,
      length:0
    }
  },
  methods:{
    async delProduct(){
      const res = await this.$api.requested({
        "id": 20221021095603,
        "version":1,
        "content": {
          "sa_quotedprice_itemsids":this.data     //sat_notice_classid<=0时 为新增
        }
      })
      this.tool.showMessage(res,()=>{
        this.dialogVisible = false
        this.$emit('delSuccess')
      })
    },
  },
  mounted() {
    console.log(this.data)
  }
}
</script>

<style scoped>

</style>