<template>
  <div class="project-box">
    <cy-info-title type="collapse" name="项目信息">
      <project-info ref="project" :project-information="projectInfo" :disabled="true" />
    </cy-info-title>
    <cy-info-title type="collapse" name="本次合作相关">
      <cooperation ref="cooperate" :cooperation="cooperation" :disabled="true" />
    </cy-info-title>
    <cy-info-title type="collapse" name="项目业主方审核">
      <project-owner ref="owner" :owner-info="ownerInfo" :disabled="true" />
    </cy-info-title>
    <assess ref="assess" :assess-info="assessResult" :disabled="true" />

    <div class="submit-btn">
      <el-button @click="$router.push({name: 'ProjectCredit'})">返回</el-button>
    </div>
  </div>
</template>

<script>
export default {
  components: {
    ProjectInfo: () => import('../../dueReview/components/Project/ProjectInfo.vue'),
    Cooperation: () => import('../../dueReview/components/Project/Cooperation.vue'),
    ProjectOwner: () => import('../../dueReview/components/Project/ProjectOwner.vue'),
    Assess: () => import('../../dueReview/components/Project/Assess.vue')
  },
  provide() {
    return {
      disabled: true
    }
  },
  props: {
    detailsInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      detailInfo: {},
      projectInfo: {},
      cooperation: {},
      ownerInfo: {},
      assessResult: {}
    }
  },
  watch: {
    detailsInfo: {
      handler(newV) {
        if (newV && Object.keys(newV).length) {
          this.detailInfo = JSON.parse(JSON.stringify(newV))
          const { projectInformation, enterpriseNature, regStocks, involvingLitigationAccessCcount, administrativePenaltyAccessCcount, administrativePenaltyAmount, environmentalPenaltyAmount, involvingLitigationAccess, administrativePenaltyAccess, administrativePenaltyAmountAccess, environmentalPenaltyAmountAccess, privateLendings, equityFreezeDataList, majorAnomalies, seriousIllegalData, taxOweNoticeData, taxIllegalData, blacklists, exceptionData, news, projectOwnerComprehensiveEvaluation, evaluationOpinions, holdingRatio, equityHierarchy, equityHierarchyDetail } = this.detailInfo
          // 项目信息
          this.projectInfo = projectInformation

          // 本次合作
          const { cooperationAmount, peakValue, estimatedAccountingPeriod, highPeakUsage, enterprise, companyForProject } = projectInformation
          this.cooperation = { cooperationAmount, peakValue, estimatedAccountingPeriod, highPeakUsage }

          // 项目业主
          this.ownerInfo = { ...enterprise, companyForProject, enterpriseNature, regStocks, involvingLitigationAccessCcount, administrativePenaltyAccessCcount, administrativePenaltyAmount, environmentalPenaltyAmount, involvingLitigationAccess, administrativePenaltyAccess, administrativePenaltyAmountAccess, environmentalPenaltyAmountAccess, privateLendings, equityFreezeDataList, majorAnomalies, seriousIllegalData, taxOweNoticeData, taxIllegalData, blacklists, exceptionData, news, evaluationOpinions, holdingRatio, equityHierarchy, equityHierarchyDetail }

          // 准入结论
          this.assessResult = projectOwnerComprehensiveEvaluation
        }
      },
      immediate: true,
      deep: true
    }
  }
}
</script>

  <style lang="scss" scoped>
  .project-box {

  }
  </style>
