<!--
  @description: 招标计划信息-流程控制信息
  @Modifier: haofengxian
  @routerPath:
  @date: 2020-6-11-10:05
-->
<template>
  <el-form ref="ruleForm" :model="formData" :rules="rules" :inline-message="true">
    <!--=======================================================流程控制信息=======================================================-->
    <table class="from_table">
      <tr>
        <td>
          <el-form-item label="招标方式" prop="biddingMethod" required />
        </td>
        <td>
          <el-radio-group v-model="formData.biddingMethod">
            <el-radio v-for="(item,index) in purchasesSchemeBidWayList" :key="index" :label="item.typecode">
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
        <!--资格审查方式 00单次资格预审 01年度资格预审 02资格后审-->
        <td>
          <el-form-item label="资格审查方式" prop="qualificationCheckWay" required />
        </td>
        <td>
          <el-radio-group v-model="formData.qualificationCheckWay" :disabled="qualificationCheckWayDisable">
            <el-radio
              v-for="(item,index) in purchasesSchemeQuaWayList"
              :key="index"
              :label="item.typecode"
            >
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
      </tr>
      <tr v-if="screenProjectToggle">
        <td>
          <el-form-item label="年度资格预审筛选项目" required />
        </td>
        <td>
          <el-radio-group v-model="formData.annualPrequalificationScreeningProject">
            <el-radio v-for="(item,index) in purchasesSchemeQuaProjectList" :key="index" :label="item.typecode">
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
        <td />
        <td />
      </tr>
      <tr v-if="thirdToggle">
        <td>
          <el-form-item label="资格预审开启方式" required />
        </td>
        <td>
          <el-radio-group v-model="formData.prequalificationOpeningMethod">
            <el-radio v-for="(item,index) in purchasesSchemeQuaOpenWayList" :key="index" :label="item.typecode">
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
        <td>
          <el-form-item label="资格预审评审方式" />
        </td>
        <td>
          <el-radio-group v-model="formData.prequalificationEvaluationWay" :disabled="prequalificationReviewMethodDisable">
            <el-radio v-for="(item,index) in purchasesSchemeQuaEvalWayList" :key="index" :label="item.typecode">
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
      </tr>
      <tr>
        <template v-if="thirdToggle">
          <td>
            <el-form-item label="资格预审评审办法" required />
          </td>
          <td>
            <el-radio-group v-model="formData.prequalificationEvaluationMethod">
              <el-radio v-for="(item,index) in purchasesSchemeQuaEvalMethodList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
        </template>
        <template v-if="numberLimitToggle">
          <td>
            <el-form-item label="数量限制" prop="quantitativeRestriction" />
          </td>
          <td>
            <el-input v-model="formData.quantitativeRestriction" placeholder="数量限制" type="number" />
          </td>
        </template>
      </tr>
      <tr>
        <td>
          <el-form-item label="开标方式" required />
        </td>
        <td>
          <el-radio-group v-model="formData.bidOpeningMethod" :disabled="flag=='3'">
            <el-radio v-for="(item,index) in purchasesSchemeOpenWayList" :key="index" :label="item.typecode">
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
        <td>
          <el-form-item label="开标步制" prop="bidOpeningStep" />
        </td>
        <td>
          <el-radio-group v-model="formData.bidOpeningStep" :disabled="flag=='1' || flag=='2'">
            <el-radio v-for="(item,index) in purchasesSchemeOpenStepWayList" :key="index" :label="item.typecode">
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
      </tr>
      <tr>
        <td>
          <el-form-item label="评标方式" required />
        </td>
        <td>
          <el-radio-group v-model="formData.biddingEvaluationWay" :disabled="flag=='1' || flag=='3'">
            <el-radio v-for="(item,index) in purchasesSchemeEvalWayList" :key="index" :label="item.typecode">
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
        <td>
          <el-form-item label="评标办法" required />
        </td>
        <td>
          <el-radio-group v-model="formData.bidEvaluationMethod">
            <el-radio v-for="(item,index) in purchasesSchemeProEvalMethodList" :key="index" :label="item.typecode">
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
      </tr>
      <tr>
        <td>
          <el-form-item label="投标报价方式" required />
        </td>
        <td>
          <el-select v-model="formData.biddingQuotationMethod" placeholder="请选择">
            <el-option
              v-for="item in purchaseSchemeBidPriceMethodList"
              :key="item.value"
              :label="item.typename"
              :value="item.typecode"
            />
          </el-select>
        </td>
        <td>
          <el-form-item label="投标文件递交方式" required />
        </td>
        <td>
          <el-radio-group v-model="formData.bidSubmissionMethod" :disabled="flag=='1'||flag=='2'">
            <el-radio v-for="(item,index) in purchasesSchemeDocWayList" :key="index" :label="item.typecode">
              {{ item.typename }}
            </el-radio>
          </el-radio-group>
        </td>
      </tr>
    </table>
  </el-form>
</template>

<script>
/* mixins混入公共方法*/
import { tenderPlan } from '../../mixins/tenderPlan'
import { baseInfoCommon } from '../../mixins/baseInfoCommon'
/* 常用公共方法*/
import { checkRate } from '@/assets/js/validate'
export default {
  name: 'ProcessControlInfoForm',
  mixins: [tenderPlan, baseInfoCommon],
  props: {
    formData: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      rules: {
        qualificationCheckWay: [{ required: true, message: '不能为空', trigger: 'blur' }], // 资格审查方式
        biddingMethod: [{ required: true, message: '不能为空', trigger: 'blur' }], // 招标方式
        bidOpeningStep: [{ required: true, message: '不能为空', trigger: 'blur' }], // 开标步制
        bidOpeningMethod: [{ required: true, message: '不能为空', trigger: 'blur' }], // 开标方式
        biddingEvaluationWay: [{ required: true, message: '不能为空', trigger: 'blur' }], // 评标方式
        quantitativeRestriction: [{ required: true, message: '不能为空', trigger: 'blur' }, { validator: checkRate, trigger: 'blur' }] // 数量限制
      }
    }
  },
  created() {
    // 招标计划-字典信息
    this.initPurchaseSchemeWebTypeGroup()
  },
  methods: {
    // 提交校验
    vaildate() {
      return this.$refs['ruleForm'].validate()
    }
  }
}
</script>

<style scoped>

</style>
