<template>
  <div class="from-table font-line-space" v-if="tabsData[0].isShow">
    <div v-if="tabsData[1].isShow">
      <a-row>
        <a-col :span="24" style="border-top: 0px;text-align: center;">
          <div class="main-title">
            <span>申报人基本情况</span>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>身份证号</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ value.certId }}
            </div>
          </div>
        </a-col>
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>人才类别</div>
          </div>
        </a-col>
        <a-col :span="13">
          <div class="special-middle">
            <div>
              {{ value.talentCategoryName }}
            </div>
          </div>
        </a-col>  
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>姓名</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ value.personName }}
            </div>
          </div>
        </a-col>
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>性别</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ value.sex }}
            </div>
          </div>
        </a-col>
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>民族</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ value.nationName }}
            </div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>出生年月</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ moment(value.birthday).format('YYYY-MM-DD') }}
            </div>
          </div>
        </a-col>
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>最高学位</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ value.degreeName }}
            </div>
          </div>
        </a-col>
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>最高学位授予时间</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ moment(value.degreeTime).format('YYYY-MM-DD') }}
            </div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>最高学位授予单位</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>{{ value.degreeUnit }}</div>
          </div>
        </a-col>
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>目前从事专业</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ value.specName }}
            </div>
          </div>
        </a-col>
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>是否为研究生导师</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              <para-check v-model="value.graduateTeacher" :typeId="18" :disabled="true" />
            </div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>专业技术职称</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ value.titleName }}
            </div>
          </div>
        </a-col>
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>党派</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ value.politicalParty }}
            </div>
          </div>
        </a-col>
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>行政职务</div>
          </div>
        </a-col>
        <a-col :span="5">
          <div class="special-middle">
            <div>
              {{ value.duty }}
            </div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>是否是省级或省级以上人才</div>
          </div>
        </a-col>
        <a-col :span="21">
          <div class="special-middle">
            <div>
              <para-check v-model="value.talentType" :typeId="16" :disabled="true" />
            </div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>省级及以上劳动模范、先进工作者等荣誉称号</div>
          </div>
        </a-col>
        <a-col :span="21">
          <div class="special-middle">
            <div v-html="toTextarea(value.honoraryTitle)"></div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>在国家、省级一级学术团体任职情况（包括任职时间和职务）</div>
          </div>
        </a-col>
        <a-col :span="21">
          <div class="special-middle">
            <div v-html="toTextarea(value.holdPost1)"></div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>担任国内统计源期刊职务情况（包括任职时间和职务）</div>
          </div>
        </a-col>
        <a-col :span="21">
          <div class="special-middle">
            <div>
              <div v-html="toTextarea(value.holdPost2)"></div>
            </div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>担任国家或省级重点学科/专科、重点实验室、内设研究机构负责人情况（包括任职时间和职务）</div>
          </div>
        </a-col>
        <a-col :span="21">
          <div class="special-middle">
            <div v-html="toTextarea(value.holdPost3)"></div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex">
        <a-col :span="3" class="bg-gray">
          <div class="special-middle">
            <div>联系方式</div>
          </div>
        </a-col>
        <a-col :span="21">
          <a-row>
            <a-col :span="4" class="bg-gray">
              <div style="margin-top: 10px;">电话</div>
            </a-col>
            <a-col :span="8">
              <div style="margin-top: 10px;">
                {{ value.mobile }}
              </div>
            </a-col>
            <a-col :span="4" class="bg-gray">
              <div style="margin-top: 10px;">传真</div>
            </a-col>
            <a-col :span="8">
              <div style="margin-top: 10px;">
                {{ value.fax }}
              </div>
            </a-col>
          </a-row>
          <a-row>
            <a-col :span="4" class="bg-gray">
              <div style="margin-top: 10px;">Email</div>
            </a-col>
            <a-col :span="20">
              <div style="margin-top: 10px;">
                {{ value.email }}
              </div>
            </a-col>
          </a-row>
        </a-col>
      </a-row>
    </div>
    <div v-if="tabsData[2].isShow">
      <resume-info :resumeList.sync="value.resumeList" />
      <a-row>
        <a-col :span="24" style="border-top: 0px; text-align: center">
          <div class="main-title">
            <span>申报人才业务技术能力</span>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24" class="bg-gray">
          <div style="margin-top: 10px;">
            <span>本人业务技术能力、外语水平及已经开展的主要业务工作（应阐明自身的技术优势、薄弱环节及改进措施）</span>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24">
          <div v-html="toTextarea(value.technicalSkill)"></div>
        </a-col>
      </a-row>
    </div>
    <div v-if="tabsData[3].isShow">
      <scientific-gain-info :scientificList.sync="value.scientificList" />
      <a-row>
          <a-col :span="24" style="border-top: 0px; text-align: center">
            <div class="main-title">
              <span>科学研究规划</span>
            </div>
          </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24" class="bg-gray">
          <div style="margin-top: 10px;">
            <span>结合本人业务基础和专长，所在学科的建设目标，获资助后拟研究的关键问题、主要研究内容、创新技术研发与应用及预期成果，要有量化指标：</span>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24">
          <div class="special-middle">
            <div v-html="toTextarea(value.qualityTarget)"></div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24" class="bg-gray">
          <div style="margin-top: 10px;">
            <span>目前的研究条件（详述已具备的研究条件，包括主要的仪器设备、实验动物等）</span>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24">
          <div class="special-middle">
            <div v-html="toTextarea(value.researchCondition)"></div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24" class="bg-gray">
          <div style="margin-top: 10px;">
            <span>研究进度：按年度列出研究进度及相关指标</span>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24">
          <div class="special-middle">
            <div v-html="toTextarea(value.researchProgress)"></div>
          </div>
        </a-col>
      </a-row>
    </div>
    <div v-if="tabsData[4].isShow">
      <members-info :membersList.sync="value.membersList" />
    </div>
    <div v-if="tabsData[5].isShow">
      <a-row>
        <a-col :span="24" style="border-top: 0px; text-align: center">
          <div class="main-title">
            <span>经费预算及培养计划和目标</span>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="7" class="bg-gray">
          <div class="special-middle">
            <div class="required">申请资助金额</div>
          </div>
        </a-col>
        <a-col :span="17">
          <div class="special-middle">
            <div>{{ parseFloat(value.applyFund).toFixed(2) }}(万元)</div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="7" class="bg-gray">
          <div class="special-middle">
            <div class="required">其他经费来源</div>
          </div>
        </a-col>
        <a-col :span="17">
          <div class="special-middle">
            <div>{{ parseFloat(value.otherFund).toFixed(2) }}(万元)</div>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="7" class="bg-gray">
          <div class="special-middle">
            <div class="required">合计</div>
          </div>
        </a-col>
        <a-col :span="17">
          <div class="special-middle">
            <div>{{ parseFloat(value.totalFund).toFixed(2) }}(万元)</div>
          </div>
        </a-col>
      </a-row>
      <budget-info :budgetList.sync="value.budgetList" :budgetType.sync="budgetType" />
      <a-row>
        <a-col :span="24" style="border-top: 0px; text-align: center">
          <div class="main-title">
            <span>申报人所在单位培养计划和培养目标</span>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24">
          <div class="special-middle">
            <div v-html="toTextarea(value.planTarget)"></div>
          </div>
        </a-col>
      </a-row>
      <a-row>
        <a-col :span="24" style="border-top: 0px; text-align: center">
          <div class="main-title">
            <span>申报人所在单位的学科发展和人才队伍建设专家指导委员会审核意见</span>
          </div>
        </a-col>
      </a-row>
      <a-row type="flex" class="row_center">
        <a-col :span="24">
          <div class="special-middle">
            <div v-html="toTextarea(value.unitAdvice)"></div>
          </div>
        </a-col>
      </a-row>
    </div>
    <div v-if="tabsData[6].isShow">
      <file-info :fileList.sync="value.fileList" />
    </div>
    <div v-if="tabsData[7].isShow">
      <a-row>
        <a-col :span="24">
          <div class="main-title">
            <span>审核记录</span>
          </div>
        </a-col>
      </a-row>
      <a-row>
        <a-col :span="24">
          <audit-info v-model="value.auditList" />
        </a-col>
      </a-row>
    </div>
  </div>
</template>

<script>
import moment from 'moment'
import { toTextarea } from '@/views/utils/common'
import paraCheck from '@/views/components/common/paraCheck'
import resumeInfo from '@/views/report/talent/components/resumeInfo'
import scientificGainInfo from '@/views/report/talent/components/scientificGainInfo'
import membersInfo from '@/views/report/talent/components/membersInfo'
import budgetInfo from '@/views/report/talent/components/budgetInfo'
import fileInfo from '@/views/report/talent/components/fileInfo'
import auditInfo from '@/views/audit/components/auditInfo'

export default {
  name: "talentInfo",
  components: {
    paraCheck, resumeInfo, scientificGainInfo, membersInfo, budgetInfo, fileInfo, auditInfo
  },
  props: {
    value: {
      type: Object,
      default: () => {
        return null
      }
    },
    tabsData: {
      type: Array,
      default: () => {
        return []
      }
    },
  },
  data() {
    return {
      talentTraningInfo: {
        HTTalent: null,
        ALTalent: null,
        RTTalent: null,
        ALTrainingYear: null,
        ALEveryYearFee: null,
        HTTrainingYear: null,
        HTEveryYearFee: null,
        RTTrainingYear: null,
        RTEveryYearFee: null,
      },
      budgetType: { type: 'HTTalent', trainingYear: 5, EveryYearFee: 10 },
    };
  },
  created () {
    if (!!!this.tabsData || this.tabsData.length == 0)
      this.tabsData = [
        { title: '全部', key: '0', isShow: true },
        { title: '申报人基本情况', key: '1', isShow: true },
        { title: '申报人简历', key: '2', isShow: true },
        { title: '申报人科研成绩', key: '3', isShow: true },
        { title: '科学研究规划及团队人员名单', key: '4', isShow: true },
        { title: '经费预算及培养计划和目标', key: '5', isShow: true },
        { title: '附件', key: '6', isShow: true },
        { title: '项目审核记录', key: '7', isShow: true },
      ]
    if (!!!this.value) {
      this.getTalentTraningInfo()
    }
  },
  methods: {
    moment, toTextarea,
    getTalentTraningInfo () {
      this.$api.systemSet.getTalentTraningInfo().then(({ data = {} }) => {
        if (data) {
          this.talentTraningInfo = data
          this.processBudgetType()
        }
      })
    },
    processBudgetType() {
      if (this.value.talentCategory === this.talentTraningInfo.HTTalent) {
        this.budgetType = { type: 'HTTalent', trainingYear: this.talentTraningInfo.HTTrainingYear, EveryYearFee: this.talentTraningInfo.HTEveryYearFee }
      } else if (this.formData.talentCategory === this.talentTraningInfo.ALTalent) {
        this.budgetType = { type: 'ALTalent', trainingYear: this.talentTraningInfo.ALTrainingYear, EveryYearFee: this.talentTraningInfo.ALEveryYearFee }
      } else {
        this.budgetType = { type: 'RTTalent', trainingYear: this.talentTraningInfo.RTTrainingYear, EveryYearFee: this.talentTraningInfo.RTEveryYearFee }
      }
      if (!!!this.formData.applyFund || this.formData.applyFund == 0)
        this.formData.applyFund = this.budgetType.trainingYear * this.budgetType.EveryYearFee
    }
  }
};
</script>