<template>
  <div>
    <div class="box1">
      <div class="title">合同信息
        <div class="line"></div>
      </div>
      <div class="info">
        <el-descriptions border style="margin-top: 10px;" :column="3">
          <el-descriptions-item label="合同编码" label-class-name="my-label">
            {{ form.contractCode }}
          </el-descriptions-item>
          <el-descriptions-item label="合同编号" label-class-name="my-label">
            {{ form.contractNumber }}
          </el-descriptions-item>
          <el-descriptions-item label="合同金额" label-class-name="my-label">
            {{ form.amount }}
          </el-descriptions-item>
          <el-descriptions-item label="履约保证金" label-class-name="my-label">
            {{ form.deposit }}
          </el-descriptions-item>
          <el-descriptions-item label="拟稿人" label-class-name="my-label">
            {{ getUserName(form.drafter) }}
          </el-descriptions-item>
          <el-descriptions-item label="拟稿日期" label-class-name="my-label">
            {{ form.draftTime }}
          </el-descriptions-item>
          <el-descriptions-item label="合同文件" label-class-name="my-label" :span="3">
            <div v-if="form.contractDocument">
              <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.contractDocument}`)">
                {{ getFileName(form.contractDocument) }}
              </el-link>
              <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.contractDocument}`"
                :underline="false" target="_blank">
                <span class="el-icon-download">下载文件</span>
              </el-link>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="合同备注" label-class-name="my-label">
            {{ form.remark }}
          </el-descriptions-item>
          <el-descriptions-item label="签订日期" label-class-name="my-label">
            {{ form.signDate }}
          </el-descriptions-item>
          <el-descriptions-item label="签订备注" label-class-name="my-label">
            {{ form.signRemark }}
          </el-descriptions-item>
          <el-descriptions-item label="签订扫描件" label-class-name="my-label" :span="3">
            <div v-if="form.signScan">
              <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.signScan}`)">
                {{ getFileName(form.signScan) }}
              </el-link>
              <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.signScan}`"
                :underline="false" target="_blank">
                <span class="el-icon-download">下载文件</span>
              </el-link>
            </div>
          </el-descriptions-item>
        </el-descriptions>
      </div>
    </div>
    <div class="box1">
      <div class="title">投标项目信息
        <div class="line"></div>
      </div>
      <div class="info">
        <el-descriptions border style="margin-top: 10px;" :column="3">
          <el-descriptions-item label="投标项目名称" label-class-name="my-label" :span="3">
            {{ tender.projectName }}
          </el-descriptions-item>
          <el-descriptions-item label="招标业主" label-class-name="my-label">
            {{ tender.partyA }}</el-descriptions-item>
          <el-descriptions-item label="代理联系人" label-class-name="my-label">
            {{ tender.aPerson }}</el-descriptions-item>
          <el-descriptions-item label="代理联系电话" label-class-name="my-label">
            {{ tender.aPhone }}
          </el-descriptions-item>
          <el-descriptions-item label="投标委托人" label-class-name="my-label">
            {{ getUserName(tender.trustee) }}
          </el-descriptions-item>
          <el-descriptions-item label="业主预算" label-class-name="my-label">
            {{ tender.budget }}
          </el-descriptions-item>
          <el-descriptions-item label="拟报价金额" label-class-name="my-label">
            {{ tender.quote }}
          </el-descriptions-item>
          <el-descriptions-item label="保证金" label-class-name="my-label">
            {{ tender.deposit }}
          </el-descriptions-item>
          <el-descriptions-item label="招标文件" label-class-name="my-label" :span="2">
            <div v-if="tender.bidDocument">
              <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + tender.bidDocument}`)">
                {{ getFileName(tender.bidDocument) }}
              </el-link>
              <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + tender.bidDocument}`"
                :underline="false" target="_blank">
                <span class="el-icon-download">下载文件</span>
              </el-link>
            </div>
          </el-descriptions-item>
          <el-descriptions-item label="项目内容简述" label-class-name="my-label" :span="3">
            {{ tender.projectBriefly }}
          </el-descriptions-item>
          <el-descriptions-item label="标书文件" label-class-name="my-label" :span="3">
            <div v-if="tender.tenderDocument">
              <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + tender.tenderDocument}`)">
                {{ getFileName(tender.tenderDocument) }}
              </el-link>
              <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + tender.tenderDocument}`"
                :underline="false" target="_blank">
                <span class="el-icon-download">下载文件</span>
              </el-link>
            </div>
          </el-descriptions-item>
        </el-descriptions>
      </div>
    </div>
    <div class="box1">
      <div class="title">关联项目
        <div class="line"></div>
      </div>
      <div class="info">
        
      </div>
    </div>
  </div>
</template>

<script>
import { listTender, getTender } from "@/api/oa/tender/tender";
import { listContract, getContract } from "@/api/oa/contract/contract";
import { getContractComment } from "@/api/oa/contract/contractComment";
import { getContractMeeting } from "@/api/oa/contract/contractMeeting";
import { getContractPayment } from "@/api/oa/contract/contractPayment";
import { getContractWork } from "@/api/oa/contract/contractWork";
export default {
  props: {
    form: {
      type: Object,
      require: true
    }
  },
  watch: {
    'form.contractId'() {
      this.init()
    }
  },
  mounted() {
    this.init();
  },
  data() {
    return {
      baseUrl: process.env.VUE_APP_BASE_API,
      tender: {}
    }
  },
  methods: {
    init() {
      let contractId = this.form.contractId;
      let tenderId = this.form.tenderId;
      getTender(tenderId).then(response => {
        this.tender = response.data;
      })
      getContractMeeting(contractId).then(res => {
      })

    },
  }
}
</script>

<style lang="scss" scoped>
@import "@/assets/styles/element-reset.scss";

.box1 {
  width: 100%;
  background-color: #ffffff;
}

.info {
  padding: 20px;
}

.title {
  font-size: 18px;
  font-weight: bold;
  padding: 20px 35px 0px;
  position: relative;

  .line {
    position: absolute;
    top: 22px;
    left: 20px;
    width: 4px;
    height: 20px;
    border-radius: 20px;
    background-color: #409EFF;
  }
}

::v-deep .el-descriptions-item__label.is-bordered-label {
  color: #5a5757;
  background: rgba($color: #a9adb3, $alpha: 0.1);
  width: 150px;
  min-width: 150px;
}

::v-deep .el-descriptions .is-bordered .el-descriptions-item__cell {
  border: 1px solid #cdd0d3;
}
</style>