<template>
  <div class="detail-container">
    <div class="detail-cont">
      <info-table class="info-tab" :list="defaultList1" :obj="forInfo" :labelWidth="labelWidth" title="项目基本情况" :isSubTitle="true"></info-table>
    </div>
    <div class="detail-cont">
      <info-table class="info-tab" :list="defaultList2" :obj="forInfo" :labelWidth="labelWidth" title="项目特征信息" :isSubTitle="true"></info-table>
    </div>
    <div class="detail-cont">
      <h2 class="infoTable-title">项目投标时的要点</h2>
      <el-tabs v-model="currentList">
        <el-tab-pane
          :key="index"
          v-for="(item, index) in toggleTabs"
          :label="item.name"
          :name="item.value"
        >
          {{item.content}}
        </el-tab-pane>
      </el-tabs>
      <div class="detail-cont-tab">
        <info-table class="info-tab" v-if="currentList === 'yd1'" :list="defaultListYd1" :obj="forInfoYd1" :labelWidth="labelWidth"></info-table>
        <info-table class="info-tab" v-if="currentList === 'yd2'" :list="defaultListYd2" :obj="forInfoYd2" :labelWidth="labelWidth"></info-table>
        <info-table class="info-tab" v-if="currentList === 'yd3'" :list="defaultListYd3" :obj="forInfoYd3" :labelWidth="labelWidth"></info-table>
        <info-table class="info-tab" v-if="currentList === 'yd4'" :list="defaultListYd4" :obj="forInfoYd4" :labelWidth="labelWidth"></info-table>
        <info-table class="info-tab" v-if="currentList === 'yd5'" :list="defaultListYd5" :obj="forInfoYd5" :labelWidth="labelWidth"></info-table>
      </div>
    </div>
    <div class="detail-cont">
      <info-table class="info-tab" :list="defaultList3" :obj="forInfo" :labelWidth="labelWidth" title="评标办法" :isSubTitle="true"></info-table>
    </div>
    <div class="detail-cont">
      <h2 class="infoTable-title">投标各时间节点</h2>
      <el-tabs v-model="currentList1">
        <el-tab-pane label="投标各时间节点" name="jd1"></el-tab-pane>
        <el-tab-pane label="开（回）标时间及地点" name="jd2"></el-tab-pane>
      </el-tabs>
      <div class="detail-cont-tab">
        <info-table class="info-tab" v-if="currentList1 === 'jd1'" :list="defaultListJd1" :obj="forInfoJd1" :labelWidth="labelWidth"></info-table>
        <info-table class="info-tab" v-if="currentList1 === 'jd2'" :list="defaultListJd2" :obj="forInfoJd2" :labelWidth="labelWidth"></info-table>
      </div>
    </div>
  </div>
</template>
<script>
  import InfoTable from '../../../../component/infoTable';
  import { getCbProjectInfo } from "@/api/projectCostLedger";
export default {
  name: "projectInformation",
  components: {InfoTable},
  data() {
    return {
      comProjectId:'',
      labelWidth: 250,
      forInfo: { },
      defaultList1: [
        // { name: '工程名称', prop: 'name', slot: true  },
        { name: '工程名称', prop: 'projectName', style: true },
        { name: '工程所在地', prop: 'areaName' },
        { name: '工程详细地址', prop: 'projectAddress' },
        { name: '业态', prop: 'status' },
        { name: '工程类型', prop: 'projectType1' },
        { name: '计价模式（清单/定额）', prop: 'registCapi' },
        { name: '承包形式（EPC/DB/EP/PC）', prop: 'actualCapi'},
        { name: '合同类型', prop: 'checkDate' },
        { name: '建设单位', prop: 'orgNo' },
        { name: '设计单位', prop: 'designOrgName' },
        { name: '勘察单位', prop: 'creditNo' },
        { name: '监理单位', prop: 'supervisorOrgName' },
        { name: '代理公司（或工料测量师）', prop: 'term'},
        { name: '招标形式', prop: 'qualification' },
        { name: '承包方式', prop: 'provinceCode'},
        { name: '资金来源', prop: 'moneySource' },
        { name: '分包标准费用项价格库', prop: 'colleguesNum'},
        { name: '材料机械标准费用价格库', prop: 'colleguesNum'},
        { name: '专业类别', prop: 'scope'},
        { name: '平台项目名称', prop: 'scope'},
        { name: '核定总人数', prop: 'scope'},
        { name: '折算收入不含税系数(应纳税率)', prop: 'scope'},
        { name: '收入清单增值税率', prop: 'scope'},
      ],
      defaultList2: [
        { name: '地上建筑面积', prop: 'creditNo' },
        { name: '地下建筑面积', prop: 'operName' },
        { name: '坑底面积', prop: 'status' },
        { name: '占地面积', prop: 'startDate' },
        { name: '结构类型', prop: 'registCapi' },
        { name: '基础类型', prop: 'actualCapi'},
        { name: '单体个数', prop: 'checkDate', style: true  },
        { name: '地上层数', prop: 'noOfOverfloor' },
        { name: '地下层数', prop: 'noOfUnderfloor' },
        { name: '建筑高度', prop: 'constructHeight' },
        { name: '地下深度', prop: 'econKind' },
        { name: '首层（m）', prop: 'term'},
        { name: '标准层（m）', prop: 'qualification' },
        { name: '其他说明', prop: 'provinceCode', style: true},
      ],
      currentList: "yd1",
      toggleTabs: [
        {
          value: "yd1",
          name: "招标范围",
        },
        {
          value: "yd2",
          name: "指定分包/指定供应",
        },
        {
          value: "yd3",
          name: "商务标书投标文件组成（详细）",
        },
        {
          value: "yd4",
          name: "工期要求（天数，起止时间）",
        },
        {
          value: "yd5",
          name: "质量标准及质量要求",
        },
      ],
      forInfoYd1:{
        time:'2023-10-20'
      },
      defaultListYd1: [
        { name: '建筑工程', prop: 'time' },
        { name: '装饰工程', prop: 'operName' },
        { name: '机电工程', prop: 'status' },
        { name: '配套工程', prop: 'startDate' },
        { name: '专业工程暂估', prop: 'startDate', style: true },
      ],
      forInfoYd2:{
        time:'2023-10-20'
      },
      defaultListYd2: [
        { name: '指定分包', prop: 'time' },
        { name: '指定供应', prop: 'operName' },
        { name: '报价方式/合同形式', prop: 'startDate', style: true },
      ],
      forInfoYd3:{
        time:'2023-10-20'
      },
      defaultListYd3: [
        { name: '电子标', prop: 'startDate', style: true },
      ],
      forInfoYd4:{
        time:'2023-10-20'
      },
      defaultListYd4: [
        { name: '计划开工日期', prop: 'planStartDate' },
        { name: '计划竣工日期', prop: 'planEndDate' },
        { name: '总工期（天）', prop: 'contractWorkDays' },
        { name: '缺陷责任', prop: 'startDate' },
      ],
      forInfoYd5:{
        time:'2023-10-20'
      },
      defaultListYd5: [
        { name: '质量标准', prop: 'time' },
        { name: '质量要求', prop: 'operName' },
        { name: '品牌要求', prop: 'status' },
        { name: '报价中需要注意的其他问题/风险', prop: 'startDate' },
      ],
      defaultList3: [
        { name: '评标程序', prop: 'creditNo' },
        { name: '专家组成', prop: 'operName' },
        { name: '评标原则', prop: 'status' },
        { name: '定标原则', prop: 'startDate' },
        { name: '招标控制价（如有）', prop: 'startDate' },
        { name: '报价上限（如有）', prop: 'startDate' },
      ],
      currentList1: "jd1",
      forInfoJd1:{
        time:'2023-10-20'
      },
      defaultListJd1: [
        { name: '标前会议（或者领取投标文件的时间)', prop: 'time' },
        { name: '投标人提出疑问的截止时间', prop: 'operName' },
        { name: '招标人答复疑问的截止时间', prop: 'status' },
        { name: '现场踏勤时间', prop: 'startDate' },
        { name: '招标控制价（如有）', prop: 'startDate' },
        { name: '报价上限（如有）', prop: 'startDate' },
      ],
      forInfoJd2:{
        time:'2023-10-20'
      },
      defaultListJd2: [
        { name: '时间', prop: 'time' },
        { name: '地点', prop: 'operName' },
        { name: '开标时的要求', prop: 'status' },
        { name: '投标有效期', prop: 'startDate' },
      ],
    };
  },
  props: {
    // 项目ID
    // projectId: {
    //   type: String,
    //   required: true,
    //   default: ""
    // },
    // 详情信息
    projectDetailInfo: {
      type: Object,
      default: () => ({})
    }
  },
  watch: {
    projectDetailInfo: {
      handler(newValue) {
        this.comProjectDetailInfo = newValue ? newValue : {};
        // this.getCbProjectInfo(this.comProjectDetailInfo.projectId)
        this.getCbProjectInfo('1759507630130479106')
        // this.init(this.comProjectDetailInfo);
      },
      deep: true,
      immediate: true
    },
    projectId: {
      handler(newValue) {
        this.comProjectId = newValue;
      },
      immediate: true
    }
  },
  //可访问data属性
  created() {
    // this.getCbProjectInfo()
  },
  //计算集
  computed: {

  },
  //方法集
  methods: {
    async getCbProjectInfo(params) {
      try {
        const result = await getCbProjectInfo(params);
        if (result.code == 200) {
          console.log(result.data)
          this.forInfo=result.data;
        }
      } catch (error) {

      }
    },
  },
}
</script>
<style lang="scss" scoped>
  .detail-container {
    width: 100%;
    box-sizing: border-box;
    padding: 0 24px;
    background: #ffffff;
    .infoTable-title {
      font-size: 16px;
      font-family: Microsoft YaHei-Bold, Microsoft YaHei;
      font-weight: bold;
      padding-left: 8px;
      border-left: 2px solid #58637B;
      color: #000000;
      text-shadow: 0px 0px 10px rgba(0, 37, 106, 0.10000000149011612);
      margin: 0 0 16px 0;
    }
    .detail-cont{
      padding:16px 0;
      ::v-deep .el-tabs {
        height: 48px;
        line-height: 48px;
        .el-tabs__nav-wrap::after {
          position: static !important;
        }
      }
    }
    .detail-cont-tab{
      margin-top: 20px;
    }
  }
</style>
