<template>
  <!-- 施工图设计 -->
  <div
    class="do-jump items bgc"
    id="page8"
  >
    <!-- 标题 -->
    <div class="title">
      <span class="icon"></span>
      <span class="text">施工图设计</span>
    </div>
    <!-- 详情 -->
    <div class="table-border">
      <el-table
        :data="data"
        height="200"
        border
        style="width: 100%"
        :header-cell-style="{background: '#f2f2f2', color: '#000'}"
        @row-click="handleRowDBClick"
      >
        <el-table-column
          type="index"
          label="序号"
          width="60"
          align="center"
        >
        </el-table-column>
        <el-table-column
          prop="name"
          label="设计单位"
          align="center"
          :show-overflow-tooltip="true"
        >
         <template v-slot="{row}">
          <a
            class="a-link"
            >{{ row.name }}</a
          >
        </template>
        </el-table-column>
        <el-table-column
          prop="constructionUnit"
          label="审核人"
          align="center"
          :show-overflow-tooltip="true"
        >
        </el-table-column>
        <el-table-column
          prop="constructionWidth"
          label="设计负责人"
          align="center"
          :show-overflow-tooltip="true"
        >
        </el-table-column>
        <el-table-column
          prop="designSpeed"
          label="主要负责人"
          align="center"
          :show-overflow-tooltip="true"
        >
        </el-table-column>
        <el-table-column
          prop="proposedLocation"
          label="审定人"
          align="center"
          :show-overflow-tooltip="true"
        >
        </el-table-column>
        <el-table-column
          prop="establishmentRemarks"
          label="备注"
          align="center"
          width="100"
          :show-overflow-tooltip="true"
        >
        </el-table-column>
      </el-table>
      <div class="page-footer">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="pageResult.page"
          :page-sizes="[5, 10, 20, 30, 50]"
          :page-size="pageResult.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="pageResult.total"
        >
        </el-pagination>
      </div>
      <el-dialog
        title="施工图设计-详情"
        :visible.sync="dialogVisible"
        width="1000px"
      >
        <table align="center">
          <tr>
            <td
              class="bgColor"
              style="width: 150px"
            >设计单位</td>
            <td style="width: 340px">
              <el-tooltip
                content="查看合同管理信息"
                placement="top"
              >
                <el-link
                  type="primary"
                  @click="handleViewDetils(form.name)"
                >
                  <p class="descStyle">{{form.name}}</p>
                </el-link>
              </el-tooltip>
            </td>
            <td
              class="bgColor"
              style="width: 150px"
            >设计证书号</td>
            <td>{{ form.preliminaryDesignNumber }}</td>
          </tr>
          <tr>
            <td
              class="bgColor"
              style="width: 150px"
            >项目主管总工</td>
            <td>
              {{ form.constructionLength }}
            </td>
            <td class="bgColor">主要负责人</td>
            <td>{{ form.designSpeed }}</td>
          </tr>
          <tr>
            <td
              class="bgColor"
              style="width: 150px"
            >设计负责人</td>
            <td>
              {{form.constructionWidth}}
            </td>
            <td
              class="bgColor"
              style="width: 150px"
            >主要设计人</td>
            <td>
              {{form.constructionScale}}
            </td>
          </tr>
          <tr>
            <td
              class="bgColor"
              style="width: 150px"
            >审核人</td>
            <td>
              {{form.constructionUnit}}
            </td>
            <td
              class="bgColor"
              style="width: 150px"
            >审定人</td>
            <td>
              {{form.proposedLocation}}
            </td>
          </tr>
          <tr>
            <td class="bgColor">工程规模</td>
            <td>{{getDictName('sgtsj-gcgm',form.designUnit) }}</td>
            <td class="bgColor">工程编号</td>
            <td>{{form.documentNumber}}</td>
          </tr>
          <tr>
            <td class="bgColor">设计阶段</td>
            <td>{{getDictName('sgtsj-sjjd',form.surveyUnit)}}</td>
            <td class="bgColor"></td>
            <td></td>
          </tr>
          <!-- <tr>
            <td class="bgColor">附件信息</td>
            <td colspan="3">
              <el-link
                type="primary"
                @click="handleLook(form.accessoryInfo)"
                v-if="form.accessoryInfo && form.accessoryInfo.length > 0"
              >查看附件({{ form.accessoryInfo.length }}个)</el-link>
              <span v-else>无</span>
            </td>
          </tr> -->
          <tr>
            <td class="bgColor">备注</td>
            <td colspan="3">{{ form.establishmentRemarks }}</td>
          </tr>
        </table>
        <dialog-accessory ref="accessory" :accessoryInfo="form.accessoryInfo" />
        <div class="flexEnd">
          <div class="end">
            <!-- <span>项目名称：{{form.projectInfo && form.projectInfo.projectName}}</span> -->
            <span>{{form.projectInfo && form.projectInfo.projectManager}}</span>
            <span>{{form.projectInfo && form.projectInfo.commencementTime}}</span>
          </div>
        </div>
      </el-dialog>
      <!-- <dialog-accessory ref="accessory" /> -->
    </div>
    <contractListDialog
      :querysValue='querysValue'
      ref='contractList'
    />
  </div>
</template>
<script>
import dialogAccessory from '../dialog/dialogAccessory.vue'
import contractListDialog from '../dialog/contractListDialog.vue'
export default {
  name: 'mapDesign',
  components: {
    dialogAccessory,
    contractListDialog
  },
  data() {
    return {
      data: [], //表格数据
      pageResult: {
        page: 1,
        pageSize: 10,
        total: 0
      },
      form: {},
      dialogVisible: false,
      dialogTitle: '详情',
      querysValue: ''
    }
  },
  mounted() {
    this.loadData()
  },
  methods: {
    //附件
    handleLook(obj) {
      this.$refs.accessory.open(obj)
    },
    handleSizeChange(val) {
      this.pageResult.pageSize = val
      this.loadData()
    },
    handleCurrentChange(val) {
      this.pageResult.page = val
      this.loadData()
    },
    handleRowDBClick(data) {
      this.dialogVisible = true
      this.form = data
    },
    loadData() {
      let param = {
        pageBean: {
          ...this.pageResult
        },
        querys: [
          {
            group: 'advance',
            opener: 'LIKE',
            property: 'PROJECT_ID_',
            relation: 'AND',
            value: this.$route.params.id
          }
        ]
      }
      this.$http
        .post('${cqxy}/biz/designEstimate/constructionDrawing/v1/page', param)
        .then(
          resp => {
            let response = resp.data.value
            this.data = response.rows
            this.pageResult = {
              page: response.page,
              pageSize: response.pageSize,
              total: response.total
            }
          },
          error => {
            reject(error)
          }
        )
    },
    handleViewDetils(value) {
      this.querysValue = value
      this.$refs.contractList.open()
    }
  }
}
</script>
<style lang="scss" scoped>
@import '../css/projectCommon.scss';
/deep/ .el-main .content {
  padding: 0 !important;
}
.page-footer {
  padding-top: 10px;
  float: right;
  height: 38px;
}
/deep/ .el-dialog__body {
  padding-top: 10px;
}
.table-border {
  height: 513px;
}
/deep/ .el-table {
  height: calc(100% - 38px) !important;
}
</style>
