<template>
  <ele-modal
    custom-class="ele-dialog-form long-dialog-form"
    :centered="true"
    :visible="autogenerateDialogFlag"
    title="提示"
    append-to-body
    :close-on-click-modal="false"
    width="20%"
    :before-close="cancel"
  >
    <el-form
      ref="form"
      :model="form"
      :rules="rules"
      label-width="160px"
      class="el-form-box"
    >
      <el-row>
        <el-col :span="24">
          <el-form-item label="自动生成采购计划：" prop="generatePurchase">
            <el-radio-group v-model="form.generatePurchase">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="自动生成生产计划：" prop="generateProduce">
            <el-radio-group v-model="form.generateProduce">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="自动生成项目立项：" prop="generateProject">
            <el-radio-group v-model="form.generateProject">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div style="float: right">
      <el-button type="primary" @click="save">确定</el-button>
    </div>
  </ele-modal>
</template>
<script>
  export default {
    name: 'autogenerateDialog',
    props: {
      autogenerateDialogFlag: {
        type: Boolean,
        default: false
      }
    },
    components: {},
    data() {
      return {
        form: {
          generatePurchase: 0,
          generateProduce: 0,
          generateProject: 0
        },
        rules: {},
        a: null
      };
    },
    methods: {
      save() {
        this.$emit('getAutogenerateParams', this.form);
        this.cancel();
      },
      cancel() {
        this.$emit('update:autogenerateDialogFlag', false);
      }
    }
  };
</script>

<style scoped lang="scss"></style>
