<!--
  @description:  立项-项目基本信息-配置-不展示委托合同、建设项目
  @Modifier: 肖文龙
  @routerPath: /bidding/bidProjectStep/bidProjectBase
  @date: 2019/10/26-12:56
-->
<template>
  <div>
    <el-form
      ref="form"
      :model="formData"
      :rules="rules"
      :inline-message="true"
    >
      <table class="from_table">
        <tr>
          <td>
            <el-form-item label="招标项目编号" prop="tenderNo" />
          </td>
          <td colspan="3">
            <gx-input
              v-model="formData.tenderNo"
              style="width:calc(100% - 50px)"
              gx-maxlength="varchar200"
              placeholder="招标项目编号自动生成"
            />
          </td>
        </tr>
        <tr>
          <td><el-form-item label="招标项目名称" prop="tenderName" /></td>
          <td colspan="3">
            <gx-input
              v-model.trim="formData.tenderName"
              style="width:calc(100% - 50px)"
              gx-placeholder="placeholderText600"
              gx-maxlength="varchar600"
            />
          </td>
        </tr>
        <tr>
          <!--采购人登录展示-start-->
          <template v-if="roleCode==='10'">
            <td>
              <el-form-item label="组织形式" prop="tenderOrgMethod" />
            </td>
            <td colspan="3">
              <!-- 代理机构登录-制灰不让选择 -->
              <!-- :disabled="roleCode==='11'&&item.typecode==='00'" -->
              <!-- 采购人登录-制灰不让选择 -->
              <!-- :disabled="roleCode==='10'&&item.typecode==='01'" -->
              <el-radio-group v-model="formData.tenderOrgMethod">
                <el-radio
                  v-for="(item,index) in orgMethodList"
                  :key="index"
                  :disabled="roleCode==='10'&&item.typecode==='01'||roleCode==='11'&&item.typecode==='00'"
                  :label="item.typecode"
                >
                  {{ item.typename }}
                </el-radio>
              </el-radio-group>
            </td>
          </template>
          <!--采购人登录展示-End-->
        </tr>
        <tr>
          <!--招标方式-->
          <td>
            <el-form-item label="招标方式" prop="tenderMethod" />
          </td>
          <td>
            <el-radio-group v-model="formData.tenderMethod">
              <el-radio v-for="(item,index) in bidTypeList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-form-item label="资格审查方式" prop="qualificationMethod" />
          </td>
          <td>
            <el-radio-group v-model="formData.qualificationMethod">
              <el-radio v-for="(item,index) in phaseTypeList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
        </tr>
        <tr>
          <!--招标项目类型-->
          <td>
            <el-form-item v-if="!formData.industryName" label="招标项目类型" prop="industryName" />
            <el-form-item v-if="formData.industryName" label="招标项目类型" prop="projectIndustryCode" />
          </td>
          <td>
            <!--父级-->
            <el-select
              v-model="formData.industryName"
              style="width: calc(48% - 5px);"
              placeholder="请选择"
              @change="projectIndustryChange"
            >
              <el-option
                v-for="(item,index) in projectClassificationList"
                :key="index"
                :label="item.typename"
                :value="item.typecode"
              />
            </el-select>
            <!--子级-->
            <el-select
              v-for="(item,index) in projectClassificationList"
              v-if="formData.industryName===item.typecode"
              :key="index"
              v-model="formData.projectIndustryCode"
              placeholder="请选择"
              @change="projectIndustryChange(item.typecode,item.child)"
            >
              <el-option
                v-for="(child,childIndex) in item.child"
                :key="childIndex"
                :label="child.typename"
                :value="child.typecode"
              />
            </el-select>
          </td>
          <td>
            <el-form-item label="项目性质" prop="projectNature" />
          </td>
          <td>
            <el-select v-model="formData.projectNature" style="width: 100%;" placeholder="请选择">
              <el-option
                v-for="(item,index) in projectNatureList"
                :key="index"
                :label="item.typename"
                :value="item.typecode"
              />
            </el-select>
          </td>
        </tr>
        <tr>
          <!--委托招标时 && 委托合同配置（00 否 01是）为01有委托合同则展示-委托合同-->
          <template v-if="formData.tenderOrgMethod=='01' && isShowContract==='01'">
            <td>
              <el-form-item label="委托合同" prop="contractName" />
            </td>
            <td>
              <gx-input
                v-model="formData.contractName"
                placeholder="请选择"
                gx-maxlength="varchar200"
                style="width:calc(100% - 180px)"
                disabled
              />
              <el-button type="primary" @click="dialogData.consignContractVisible=true">
                选择
              </el-button>
              <el-button @click="consignContractInfo('clear')">
                清空
              </el-button>
            </td>
            <template v-if="isShowConstructionProject==='00'">
              <td />
              <td />
            </template>
          </template>
          <!--根据配置是否显示建设项目--配置00 否 01是-->
          <template v-if="isShowConstructionProject==='01'">
            <td>
              <el-form-item label="建设项目" />
            </td>
            <td>
              <gx-input
                v-model="formData.constructionProjectName"
                placeholder="请选择"
                style="width: calc(100% - 180px)"
                disabled
                gx-maxlength="varchar500"
              />
              <el-button type="primary" @click="dialogData.buildingProjectVisible=true">
                选择
              </el-button>
              <el-button @click="buildingProjectInfo('clear')">
                清空
              </el-button>
            </td>
            <template v-if="isShowContract==='00'">
              <td />
              <td />
            </template>
          </template>
        </tr>
        <!-- <tr>
          <td>
            <el-form-item label="系统内/外" prop="systemSource" />
          </td>
          <td>
            <el-radio-group v-model="formData.systemSource">
              <el-radio v-for="(item,index) in systemSourceList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-form-item label="采购类别" prop="purchaseType" />
          </td>
          <td>
            <el-radio-group v-model="formData.purchaseType">
              <el-radio v-for="(item,index) in purchaseTypeList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
        </tr>
        <tr>
          <td>
            <el-form-item label="采购分类" prop="purchaseClassification" />
          </td>
          <td>
            <el-radio-group v-model="formData.purchaseClassification">
              <el-radio v-for="(item,index) in purchaseClassificationList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
          <td>
            <el-form-item label="采购内容分类" prop="purchaseContentClassification" />
          </td>
          <td>
            <el-select v-model="formData.purchaseContentClassification" style="width: 100%;" placeholder="请选择">
              <el-option
                v-for="(item,index) in purchaseContentClassList"
                :key="index"
                :label="item.typename"
                :value="item.typecode"
              />
            </el-select>
          </td>
        </tr> -->
        <!-- <tr>
          <td>
            <el-form-item label="年度协议" prop="isAnnualAgreement" />
          </td>
          <td colspan="3">
            <el-radio-group v-model="formData.isAnnualAgreement">
              <el-radio v-for="(item,index) in annualAgreementTypeList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
        </tr> -->
        <tr>
          <!-- <td>
            <el-form-item label="系统内/外" prop="systemSource" />
          </td>
          <td :colspan="formData.projectNature==='00'?'':'3'">
            <el-radio-group v-model="formData.systemSource">
              <el-radio v-for="(item,index) in systemSourceList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td> -->
          <td v-if="formData.projectNature==='00'">
            <el-form-item label="采购分类" prop="purchaseClassification" />
          </td>
          <td v-if="formData.projectNature==='00'" colspan="3">
            <el-radio-group v-model="formData.purchaseClassification">
              <el-radio v-for="(item,index) in purchaseClassificationList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
        </tr>
        <tr>
          <td>
            <el-form-item label="是否依法必招" prop="isLegalTender" />
          </td>
          <td :colspan="formData.projectNature==='00'?'':'3'">
            <el-radio-group v-model="formData.isLegalTender">
              <el-radio v-for="(item,index) in isLegalTenderList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
          <td v-if="formData.projectNature==='00'">
            <el-form-item label="是否限额以下" prop="beyondLegalLimit" />
          </td>
          <td v-if="formData.projectNature==='00'">
            <el-radio-group v-model="formData.beyondLegalLimit">
              <el-radio v-for="(item,index) in beyondLegalLimitList" :key="index" :label="item.typecode">
                {{ item.typename }}
              </el-radio>
            </el-radio-group>
          </td>
        </tr>
        <tr>
          <!-- <td>
            <el-form-item label="采购级别" prop="purchaseLevel" />
          </td>
          <td>
            <el-select v-model="formData.purchaseLevel" style="width: 100%;" placeholder="请选择">
              <el-option
                v-for="(item,index) in purchaseLevelList"
                :key="index"
                :label="item.typename"
                :value="item.typecode"
              />
            </el-select>
          </td> -->
          <td>
            <el-form-item label="项目行业" prop="projectIndustry" />
          </td>
          <td colspan="3">
            <el-select v-model="formData.projectIndustry" style="width: 100%;" placeholder="请选择">
              <el-option
                v-for="(item,index) in projectIndustryList"
                :key="index"
                :label="item.typename"
                :value="item.typecode"
              />
            </el-select>
          </td>
        </tr>
        <!--项目所在区域-->
        <tr>
          <td>
            <el-form-item label="项目所在区域" prop="projectAreaName" />
          </td>
          <td colspan="3">
            <!--地区组件-->
            <cascader
              :region-text="formData.projectAreaName"
              style="width: 220px"
              @regionData="regionData"
            />
            <gx-input
              v-model.trim="formData.palceAddress"
              style="width:calc(100% - 270px)"
              gx-placeholder="placeholderText1000"
              gx-maxlength="varchar1000"
            />
          </td>
        </tr>
        <tr>
          <td>
            <el-form-item label="项目总概算" prop="budgetTotalMoney" />
          </td>
          <td colspan="3">
            <!--金额组件-->
            <money
              :thousands="true"
              :unit-stust="true"
              :great="true"
              :money-value="formData"
              style="display: inline-block"
              name="budgetTotalMoney"
            />
          </td>
        </tr>
        <!-- <tr>
          <td>
            <el-form-item label="实施地点" prop="palceAddress" />
          </td>
          <td colspan="3">
            <gx-input
              v-model.trim="formData.palceAddress"
              style="width: 96%"
              gx-placeholder="placeholderText1000"
              gx-maxlength="varchar1000"
            />
          </td>
        </tr> -->
        <tr>
          <td>
            <el-form-item label="项目内容范围" prop="tenderingArea" />
          </td>
          <td colspan="3">
            <gx-input
              v-model="formData.tenderingArea"
              :autosize="{ minRows: 4, maxRows: 4 }"
              type="textarea"
              style="width: 96%"
            />
          </td>
        </tr>
      </table>
    </el-form>
    <!-- 委托合同选择弹框 -->
    <consignContractSelectDialog :dialog-data="dialogData" @consignContractInfo="consignContractInfo" />
    <!-- 建设项目选择弹框 -->
    <buildingProjectSelectDialog :dialog-data="dialogData" @buildingProjectInfo="buildingProjectInfo" />
  </div>
</template>

<script>
/* 组件*/
import consignContractSelectDialog from '@/views/purchasePlan/consignContract/components/consignContractSelect-dialog'// 委托合同选择弹框
import buildingProjectSelectDialog from '@//views/purchasePlan/buildingProject/components/buildingProjectSelect-dialog'// 建设项目选择弹框
// mixins混入公共方法
import { bidProjectInfo } from './mixins/bidProject'
import { bidProjectCommon } from '../mixins/bidProjectCommon'
import { bidProjectBase } from './mixins/bidProjectBase'

export default {
  name: 'BidProjectBase',
  components: {
    consignContractSelectDialog, // 委托合同选择弹框
    buildingProjectSelectDialog // 建设项目选择弹框
  },
  mixins: [bidProjectCommon, bidProjectInfo, bidProjectBase]
}
</script>

<style lang="less" scoped>

</style>
