<template>
  <div class="project-cost-ledger-detail-header">
    <div class="project-cost-ledger-detail-header-inner">
      <project-bread-crumb :current="current" :breadCrumbTree="breadCrumbTree" @breadCrumbTrigger="breadCrumbTrigger"></project-bread-crumb>
      <!-- 项目名称 -->
      <div class="project-detail-header-name">{{comDetailInfo.projectName ? comDetailInfo.projectName : "-"}}</div>
      <!-- 项目信息 -->
      <div class="project-detail-plate">
        <div class="detail-plate-item project-code">
        <!-- <div class="detail-plate-item project-code" v-if="isShowProjectCode.includes(current)"> -->
          <span class="plate-item-name">项目编码：</span>
          <span>{{comDetailInfo.ipmProjectNo ? comDetailInfo.ipmProjectNo : "-"}}</span>
        </div>
        <div class="detail-plate-item">
          <span class="plate-item-name">客户名称：</span>
          <span>{{comDetailInfo.merchantName ? comDetailInfo.merchantName : "-"}}</span>
        </div>
        <div class="detail-plate-item">
          <span class="plate-item-name">签订单位：</span>
          <span>{{comDetailInfo.signingUnit ? comDetailInfo.signingUnit : "-"}}</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import ProjectBreadCrumb from "@/views/projectCostLedger/detail/components/ProjectBreadCrumb";
export default {
  name: "projectDetailHeader",
  props: {
    current: String,
    breadCrumbTree: Array,
    detailInfo: {
      type: Object,
      default: () => ({})
    }
  },
  components: {
    ProjectBreadCrumb
  },
  watch: {
    detailInfo: {
      handler(newValue) {
        this.comDetailInfo = newValue ? newValue : {};
      }
    }
  },
  data() {
    return {
      isShowProjectCode: ["basicEngineeringInformation", "directCost", "feedSummary", "cost"],
      comDetailInfo: this.detailInfo ? this.detailInfo : {}
    };
  },
  //可访问data属性
  created() {

  },
  //计算集
  computed: {

  },
  //方法集
  methods: {
    breadCrumbTrigger(item) {
      console.log(item);
      if (item.path == "root") {
        this.$router.push("/projectCostLedger/list");
      }
    }
  },
}
</script>
<style lang="scss" scoped>
.project-cost-ledger-detail-header {
  width: 100%;
  height: 118px;
  overflow: hidden;
  background: #fff;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  border-bottom: 1px solid #eeeeee;
  padding: 16px;
  box-sizing: border-box;

  .project-cost-ledger-detail-header-inner {
    width: 100%;
    height: 100%;

    .project-detail-header-name {
      line-height: 16px;
      margin-top: 16px;
      width: 100%;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      font-family: Source Han Sans, Source Han Sans;
      font-size: 16px;
      color: #232323;
      font-weight: bold;
    }

    .project-detail-plate {
      display: flex;
      align-items: center;
      margin-top: 12px;

      .detail-plate-item {
        display: flex;
        align-items: center;
        font-size: 14px;
        font-weight: 350;
        color: rgba(35, 35, 35, 0.8);
        line-height: 18px;
        margin-right: 24px;

        .plate-item-name {
          color: rgba(35, 35, 35, 0.4);
        }
      }
    }
  }
}
</style>
