<template>
  <!-- 移交 -->
  <div
    class="items bgc"
    id="acc4"
  >
    <!-- 标题 -->
    <div class="title">
      <span class="icon"></span>
      <span class="text">移交</span>
    </div>
    <div
      class="main-content"
      v-if="show"
    >
      <table align="center">
        <tr>
          <td
            class="bgColor"
            style="width: 130px"
          >移交单位</td>
          <td>
            <el-tooltip
              class="item"
              effect="dark"
              :content="data.finalAccountsOpinions"
              placement="top-start"
            >
              <p class="descStyle">
                {{ data.finalAccountsOpinions }}
              </p>
            </el-tooltip>
          </td>
          <td
            class="bgColor"
            style="width: 130px"
          >移交时间</td>
          <td style="width: 220px">{{ data.finalAccountsDate }}</td>
        </tr>
        <tr>
          <td class="bgColor">经办人</td>
          <td>{{ data.handler }}</td>
          <td class="bgColor">接收单位</td>
          <!-- <td>{{ data.receivingUnit }}</td> -->
           <td>
            <el-tooltip
              class="item"
              effect="dark"
              :content="data.receivingUnit"
              placement="top-start"
            >
              <p class="descStyle">
                {{ data.receivingUnit }}
              </p>
            </el-tooltip>
          </td>
        </tr>
        <tr>
          <td class="bgColor">接收人</td>
          <td>{{ data.receiver }}</td>
          <td class="bgColor">移交内容</td>
          <td colspan="3">{{ data.handoverContent }}</td>
        </tr>
        <!-- <tr>
          <td class="bgColor">附件信息</td>
          <td colspan="3">
            <el-link
              type="primary"
              @click="handleLook(data.accessoryInfo)"
              v-if="data.accessoryInfo && data.accessoryInfo.length > 0"
            >查看附件({{ data.accessoryInfo.length }}个)</el-link>
            <span v-else>无</span>
          </td>
        </tr> -->
        <tr>
          <td class="bgColor">备注</td>
          <td colspan="3">{{ data.remarks }}</td>
        </tr>
      </table>
      <dialog-accessory ref="accessory" :accessoryInfo="data.accessoryInfo" />
      <div class="flexEnd">
        <div class="end">
          <!-- <span>项目名称：{{data.projectInfo && data.projectInfo.projectName}}</span> -->
          <span>{{data.projectInfo && data.projectInfo.projectManager}}</span>
          <span>{{data.projectInfo && data.projectInfo.commencementTime}}</span>
        </div>
      </div>
    </div>
    <div
      class="main-content"
      v-else
    >
      <el-empty
        description="暂无数据"
        :image-size="100"
      ></el-empty>
    </div>
    <!-- <dialog-accessory ref="accessory" /> -->
  </div>
</template>
<script>
import dialogAccessory from '../dialog/dialogAccessory.vue'
export default {
  name: 'handOver',
  components: {
    dialogAccessory
  },
  data() {
    return {
      data: {},
      show: true
    }
  },
  mounted() {
    this.loadData()
  },
  methods: {
    //附件
    handleLook(obj) {
      this.$refs.accessory.open(obj)
    },
    loadData() {
      let param = {
        pageBean: {
          page: 1,
          pageSize: 1,
          total: true
        },
        querys: [
          {
            group: 'main',
            operation: 'EQUAL',
            parentGroup: '',
            property: 'PROJECT_ID_',
            relation: 'AND',
            value: this.$route.params.id
          }
        ]
      }
      this.$http
        .post('${cqxy}/biz/completionAcceptance/finalTransfer/v1/page', param)
        .then(
          resp => {
            let data = resp.data.value.rows
            if (data.length > 0) {
              this.data = data[0]
              this.show = true
            } else {
              this.show = false
            }
          },
          error => {
            reject(error)
          }
        )
    }
  }
}
</script>
<style lang="scss" scoped>
@import '../css/projectCommon.scss';
</style>