<template>
  <div>
    <el-button size="mini" type="primary" plain @click="dialogVisible = true">变更阶段</el-button>
    <el-dialog
        title="提示"
        :visible.sync="dialogVisible"
        append-to-body
        width="20%"
    >
      <el-row :gutter="20">
        <el-form :model="form" :rules="rules" ref="form" label-width="120px" label-position="right" size="mini" >
          <el-col :span="24">
            <el-form-item label="切换阶段:" prop="brandname">
              <el-select v-model="form.stageData" placeholder="请选择">
                <el-option
                    v-for="item in stage"
                    :key="item.index"
                    :label="item.stagename"
                    :value="item.sa_project_stageid">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
        <el-button type="primary" @click="onSubmit" size="mini">确 定</el-button>
       </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "setStage",
  props:["stage"],
  data(){
    return {
      dialogVisible:false,
      form:{
        stageData:'',
      },
      rules:{}
    }
  },
  methods:{
    onSubmit(){
      console.log(this.form)
      this.dialogVisible = false
      this.$emit("setStage",this.form.stageData)
    }
  }
}
</script>

<style scoped>

</style>