<template>
  <div class="d-flex flex-wrap pb-3">
    <!-- 编辑 -->
		<!-- <div>{{ editData}}</div> -->
     <a-modal 
		  :mask-closable="false"
      @cancel="$emit('closeModal')"
      destroy-on-close
      footer
      title="修改企业基本信息"
      v-model="editVisible"
      width="700px"
		 	:confirm-loading="confirmLoading" 
		
		>
      <a-form :form="form" v-if="current === 0">
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="公司名称" required>
          <a-input placeholder="请输入公司名称..." v-model.trim="platform.company" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="成立时间" required>
          <!-- 时间选择器（时间点） -->
          <a-date-picker :default-value="$moment(platform.buildTime).format('YYYY-MM-DD HH:mm:ss')" @change="changeBirthday" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="法人代码" required>
          <a-input placeholder="请输入法人代码..." v-model.trim="platform.legalPerson" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="现注册地址" required>
          <a-input placeholder="请输入现注册地址..." v-model.trim="platform.registerSite" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="注册资金(单位：万)">
          <a-input placeholder="请输入注册资金..." type="number" v-model.trim="platform.registerMoney" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="员工人数">
          <a-input placeholder="请输入员工人数..." type="number" v-model.trim="platform.staffCount" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="其中研发人数">
          <a-input placeholder="请输入研发人数..." type="number" v-model.trim="platform.resarchStaff" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="大专以上人员">
          <a-input placeholder="请输入员工人数..." type="number" v-model.trim="platform.juniorCollege" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="主营业务">
          <a-input placeholder="请输入主营业务..." v-model.trim="platform.mainBusiness" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="营业收入(单位：万)">
          <a-input placeholder="请输入营业收入..." type="number" v-model.trim="platform.businessIncome" />
        </a-form-item>
      </a-form>
      <a-form :form="form" v-if="current === 1">
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="产品/技术阶段" required>
          <!-- 单选 -->
          <a-radio-group v-model="platform.productTech">
            <a-radio :value="0" style="margin-right: 20px">创意阶段</a-radio>
            <a-radio :value="1" style="margin-right: 20px">研发阶段</a-radio>
            <a-radio :value="2" style="margin-right: 20px">转化阶段</a-radio>
            <a-radio :value="3" style="margin-right: 20px">原型样品</a-radio>
            <a-radio :value="4">产业化开发</a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="申请专利数">
          <a-input placeholder="请输入申请专利数..." type="number" v-model.trim="platform.patentApply" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="授权专利数">
          <a-input placeholder="请输入授权专利数..." type="number" v-model.trim="platform.patentGrented" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="发明专利数">
          <a-input placeholder="请输入发明专利数..." type="number" v-model.trim="platform.patentInvent" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="软件著作权">
          <a-input placeholder="请输入软件著作权..." v-model.trim="platform.softwareRegister" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="动植物新品种">
          <a-input placeholder="请输入动植物新品种..." v-model.trim="platform.plantKind" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="集成电路布图设计">
          <a-input placeholder="请输入集成电路布图设计..." v-model.trim="platform.electricDesign" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="合作单位">
          <a-input placeholder="请输入合作单位..." v-model.trim="platform.friendCompany" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="上传附件">
          <a-upload
            :action="action"
            :before-upload="beforeUpload"
            :default-file-list="fileList"
            @change="fileChange"
            list-type="picture"
            name="files"
          >
            <p>1.营业执照复印件（尚无注册的无需梯控）</p>
            <p>2.法定代表或授权代表身份证复印件</p>
            <p>3.主导产品或技术简介</p>
            <a-button> <a-icon type="upload" />点击上传附件 </a-button>
          </a-upload>
        </a-form-item>
      </a-form>
      <a-form :form="form" v-if="current === 2">
        <!-- <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="公司名称">
          <a-input v-model.trim="platform.companyName" placeholder="请输入公司名称..." />
        </a-form-item>-->
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="姓名" required>
          <a-input placeholder="请输入申请人姓名..." v-model.trim="platform.manName" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="性别" required>
          <!-- 单选 -->
          <a-radio-group v-model="platform.sex">
            <a-radio :value="1" style="margin-right: 100px">男</a-radio>
            <a-radio :value="0">女</a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="职务" required>
          <a-input placeholder="请输入申请人职务..." v-model.trim="platform.position" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="联系电话" required>
          <a-input @change="changePhone" placeholder="请输入联系电话.." type="tel" v-decorator="['tel', { rules: phoneRules }]" />
        </a-form-item>
        <!-- <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="图片验证码" required>
          <div class="d-flex flex-nowrap">
            <a-input placeholder="图片验证码" type="number" v-model="codeNum" />
            <img :src="picCode.imageBase64" @click="changePicCode" class="code_img ml-2" v-if="picCode && picCode.imageBase64" />
            <a-button @click="changePicCode" class="code_img ml-2" size="small" v-else>获取验证码</a-button>
          </div>
        </a-form-item> -->
        <!-- <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="短信验证码" required>
          <div class="d-flex flex-nowrap">
            <a-input placeholder="请输入验证码" type="number" v-model="platform.code" />
            <a-button class="code_img ml-2" disabled type="primary" v-if="showInterval">重新发送 {{ interval }}</a-button>
            <a-button :disabled="platform.isTel === false" @click="getCode" class="code_img ml-2" type="primary" v-else
              >获取验证码</a-button
            >
          </div>
        </a-form-item> -->
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="电子邮箱">
          <!-- 电子邮箱 -->
          <a-input @change="changeEamil" placeholder="请输入电子邮箱..." type="email" v-decorator="['email', { rules: emailRules }]" />
        </a-form-item>
        <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" label="身份证号" required>
          <!-- 身份证号 -->
          <a-input @change="changeIdCard" placeholder="请输入身份证号..." v-decorator="['idCard', { rules: idCardRules }]" />
        </a-form-item>
      </a-form>
      <a-steps :current="current">
        <a-step @click="current = 0" style="cursor: pointer">
          <template slot="title">
            <span v-if="current === 0">Waiting...</span>
            <span v-else>完成</span>
          </template>
          <span slot="description">企业基本信息</span>
        </a-step>
        <a-step :title="current > 1 ? '完成' : 'Waiting...'" @click="current = 1" description="企业详细信息" style="cursor: pointer" />
        <a-step :title="current > 2 ? '完成' : 'Waiting...'" @click="current = 2" description="申请人基本信息" style="cursor: pointer" />
      </a-steps>
    </a-modal>
  </div>
</template>

<script>
import { upload, updateService } from 'config/api';

const formItemLayout = {
  labelCol: { span: 6 },
  wrapperCol: { span: 16 },
};

const tailItemLayout = { wrapperCol: { span: 16, offset: 6 } };

export default {
  name: 'EntityApplyEdit',
  props: {
    editVisible: { type: Boolean, default: false },
    editData: { type: Object, default: () => {} },
    contents: { type: String, default: '' },
    showFile: { type: Boolean, default: true },
  },
  data() {
    return {
      formItemLayout,
      tailItemLayout,
      form: this.$form.createForm(this, { name: 'r-d-member-add' }),
      upload: upload,
      fileList: [],
      //限制文件上传的格式
      beforeUpload: file => {
        const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
        if (!isJpgOrPng) {
          this.$message.error('仅支持 JPG/PNG 格式的图片!');
        }
        return isJpgOrPng;
      },
      recStatusList: ['正常', '禁用'],
      serviceTypeList: ['创新平台', '孵化平台', '产业平台'],
      serviceName: '',
      content: '',
      intro: '',
      orders: '',
      picId: '',
      recStatus: 0,
      serviceType: 0,
			platform: {},
			current: 0,
      
    };
  },


  watch: {
    editData(val) {
			console.log("wacth")
			console.log(val)
			this.platform = val

    },
    
  },
  methods: {
  
  },
};
</script>

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