<!--
  @description:专家库-查看项目
  @Modifier:肖文龙
  @routerPath: /expert/createExtractProject-detail
  @date:2020-8-25
-->
<template>
  <div>
    <section class="title title_border p0-16 clearfix">
      <template>
        <div class="pointer" @click="back">
          <i class="iconfont icon-fanhui mr10" />
          查看项目
        </div>
      </template>
    </section>
    <div class="p0-16">
      <div class="page-title">
        1.项目信息
      </div>
      <table class="tableData">
        <tr>
          <td>项目名称</td>
          <td>
            {{ formData.tenderName }}
          </td>
          <td>
            项目编号
          </td>
          <td>
            {{ formData.tenderNo }}
          </td>
        </tr>
        <tr>
          <td>是否分包</td>
          <td>
            {{ filterDictText(isPackList,formData.isPack) }}
          </td>
          <td />
          <td />
        </tr>
      </table>
      <!-- 分包时-展示 -->
      <template v-if="formData.isPack==='01'">
        <div class="page-title">
          2.标段信息
        </div>
        <div>
          <el-table
            ref="package"
            :data="formData.packageList"
          >
            <el-table-column
              type="index"
              label="序号"
              width="60"
              align="center"
            />
            <el-table-column
              min-width="110"
              label="标段（包）编号"
              prop="packNo"
              header-align="center"
            />
            <el-table-column
              min-width="110"
              label="标段（包）名称"
              prop="packName"
              header-align="center"
            />
          </el-table>
        </div>
      </template>
    </div>
  </div>
</template>
<script>
/* api */
import { queryProjectDetailById } from '@/api/expert/expertscloud.js'
/* 公用方法*/
import { filterDictText } from '@/assets/js/utils'// 常用方法
import { extractProjectMixin } from '../mixins/extractProjectMixins'// 字典信息
export default {
  mixins: [extractProjectMixin],
  data() {
    return {
      // 项目信息
      formData: {
        id: this.$route.params.id, // 项目id
        packageList: [], // 标段（包）
        tenderName: '', // 项目名称
        tenderNo: '', // 项目编号
        isPack: '', // 是否分包 00 否 01 是
        useStatus: '' // 状态值 00 保存 01 提交
      }
    }
  },
  created() {
    // 获取项目信息
    this.initData()
  },
  methods: {
    filterDictText,
    // 返回
    back() {
      this.$router.push('/expert/createExtractProject-list')
    },
    // 获取项目信息
    initData() {
      if (!this.formData.id) return
      queryProjectDetailById(this.formData.id).then(res => {
        this.formData = res.data
        this.packageList = this.formData.packageList || []
      })
    }
  }
}
</script>
<style lang="less" scoped>
</style>

