<script setup name="projectApprovalInfo">
import Accessory from '@/components/accessory/index.vue'

defineProps({
  detailData: {
    type: Object,
    default: () => {}
  },
  basicInfoData: {
    type: Object
  },
  dictionaryList: Array
})
</script>

<template>
  <el-descriptions :column="2" border>
    <el-descriptions-item v-if="basicInfoData?.baseProjSetProg!=='01'" label="评审结果">
      {{ dictionaryList?.filter(i => i.type === 'REVIEW_RESULTS').find(i=>i.value===detailData?.baseReviewResults)?.label ||'-' }}
    </el-descriptions-item>
    <el-descriptions-item v-if="basicInfoData?.baseProjIsConfidentiality === '01'&&!['01','02','03'].includes(basicInfoData?.baseProjSetProg)" label="等保定级">
      {{ dictionaryList?.filter(i => i.type === 'EQUAL_PROTECTION_RATING').find(i=>i.value===detailData?.equalProtectionLevel)?.label ||'-' }}
    </el-descriptions-item>
    <el-descriptions-item v-if="basicInfoData?.baseProjSetProg!=='01'" label="评审意见" :span="2">
      {{ detailData?.baseReviewOpinion||'-' }}
    </el-descriptions-item>
    <el-descriptions-item v-if="basicInfoData?.baseProjSetProg!=='01'" label="评审意见附件" :span="2">
      <template v-if="detailData?.baseReviewCommentsFile&&JSON.parse(detailData?.baseReviewCommentsFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.baseReviewCommentsFile&&JSON.parse(detailData?.baseReviewCommentsFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item v-if="!['01','02','03'].includes(basicInfoData?.baseProjSetProg)" label="立项批复文件" :span="2">
      <template v-if="detailData?.approvalFile&&JSON.parse(detailData?.approvalFile)?.length">
        <p v-for="(file,fileIndex) in detailData?.approvalFile&&JSON.parse(detailData?.approvalFile)" :key="fileIndex" class="mb-4">
          <accessory :file-name="file.originalFileName" :file-id="file.id" />
        </p>
      </template>
      <span v-else>-</span>
    </el-descriptions-item>
    <el-descriptions-item v-if="!['01','03'].includes(basicInfoData?.baseProjSetProg)" label="建议总投资">
      {{ detailData?.baseExpertTotalMoney||'-' }}
    </el-descriptions-item>
    <el-descriptions-item v-if="!['01','03'].includes(basicInfoData?.baseProjSetProg)" label="建议年度预算">
      {{ detailData?.baseExpertYearMoney||'-' }}
    </el-descriptions-item>
    <el-descriptions-item v-if="!['01','02','03'].includes(basicInfoData?.baseProjSetProg)" label="建议批复总投资">
      {{ detailData?.baseInitialReviewTotalMoney||'-' }}
    </el-descriptions-item>
    <el-descriptions-item v-if="!['01','02','03'].includes(basicInfoData?.baseProjSetProg)" label="建议批复年度预算">
      {{ detailData?.baseProjReplyAmount||'-' }}
    </el-descriptions-item>
    <el-descriptions-item v-if="['05','06','07','00'].includes(basicInfoData?.baseProjSetProg)" label="年度预算下达金额">
      {{ detailData?.releaseYearMoney||'-' }}
    </el-descriptions-item>
    <template v-if="detailData?.baseProjReplyAmount>=5000&&['04','05','06','07','00'].includes(basicInfoData?.baseProjSetProg)">
      <el-descriptions-item label="初步设计方案" :span="2">
        <template v-if="detailData?.preliminaryDesignScheme&&JSON.parse(detailData?.preliminaryDesignScheme)?.length">
          <p v-for="(file,fileIndex) in detailData?.preliminaryDesignScheme&&JSON.parse(detailData?.preliminaryDesignScheme)" :key="fileIndex" class="mb-4">
            <accessory :file-name="file.originalFileName" :file-id="file.id" />
          </p>
        </template>
        <span v-else>-</span>
      </el-descriptions-item>
      <el-descriptions-item label="初步设计方案批复函" :span="2">
        <template v-if="detailData?.preliminaryDesignFile&&JSON.parse(detailData?.preliminaryDesignFile)?.length">
          <p v-for="(file,fileIndex) in detailData?.preliminaryDesignFile&&JSON.parse(detailData?.preliminaryDesignFile)" :key="fileIndex" class="mb-4">
            <accessory :file-name="file.originalFileName" :file-id="file.id" />
          </p>
        </template>
        <span v-else>-</span>
      </el-descriptions-item>
    </template>
  </el-descriptions>
</template>
