<template>
  <div class="main-content market m20">
    <el-main class="main">
      <table class="apply-table" wdith="100%">
        <el-button type="text" style="font-size: 15px;" @click="back()">返回列表</el-button>
        <tr style="border-bottom:0">
          <th width="40%">企业名称</th>
          <td>{{ entLock.entname }}</td>
        </tr>
        <tr>
          <th>注册号/统一社会信用代码</th>
          <td>
            {{ entLock.uniscid && entLock.uniscid.length > 0 ? entLock.uniscid : entLock.regno }}
          </td>
        </tr>
        <tr>
          <th>锁定原因</th>
          <td>
            {{ entLock.lockreason }}
          </td>
        </tr>
        <tr>
          <th>锁定人员姓名</th>
          <td>
            {{ entLock.lockusername }}
          </td>
        </tr>
        <tr>
          <th>惩戒来源</th>
          <td>
            {{ entLock.punishFromStr }}
          </td>
        </tr>
        <tr>
          <th>惩戒措施</th>
          <td>
            {{ entLock.measure }}
          </td>
        </tr>
        <tr>
          <th>锁定时间</th>
          <td>
            {{ entLock.lockTime }}
          </td>
        </tr>
        <tr>
          <th>锁定类型</th>
          <td>
            {{ entLock.locktypeStr }}
          </td>
        </tr>
        <tr>
          <th>锁定状态</th>
          <td>
            {{ entLock.lockstateStr }}
          </td>
        </tr>
        <tr>
          <th>解锁时间</th>
          <td>
            {{ entLock.unlockTime }}
          </td>
        </tr>
        <!--        <tr>-->
        <!--          <th>锁定开始日期</th>-->
        <!--          <td>-->
        <!--            {{ entLock.lockstartdate }}-->
        <!--          </td>-->
        <!--        </tr>-->
        <!--        <tr>-->
        <!--          <th>锁定结束日期</th>-->
        <!--          <td>-->
        <!--            {{ entLock.lockenddate }}-->
        <!--          </td>-->
        <!--        </tr>-->
        <tr>
          <th>解锁原因</th>
          <td>
            {{ entLock.unlockreason }}
          </td>
        </tr>
<!--        <tr>-->
<!--          <th>解锁具体原因</th>-->
<!--          <td>-->
<!--            {{ entLock.uLockSpecificReason }}-->
<!--          </td>-->
<!--        </tr>-->
        <tr>
          <th>法定代表人</th>
          <td>
            {{ entLock.representative }}
          </td>
        </tr>
      </table>
    </el-main>
  </div>
</template>
<script>
import { getPunishFromList, getLockTypeList } from '@/api/punishment'
export default {
  data() {
    return {
      lockstates: [{
        value: '0',
        label: '锁定'
      }, {
        value: '2',
        label: '解锁中'
      }, {
        value: '3',
        label: '已解锁'
      }],
      punishFromList: [],
      lockTypeOptions: [],
      entLock: {}
    }
  },
  mounted() {
    this.punishFromList = getPunishFromList()
    this.lockTypeOptions = getLockTypeList()
    this.entLock = this.$route.query.data
    this.entLock.punishFromStr = this.punishFromFormat(this.entLock.punishFrom)
    this.entLock.locktypeStr = this.lockTypeFormat(this.entLock.locktype)
    this.entLock.lockstateStr = this.lockStateFormat(this.entLock.state)
    if (this.entLock.lockTime !== null) this.entLock.lockTime = this.$util.formatDate.format(new Date(Date.parse(this.entLock.lockTime)), 'yyyy-MM-dd hh:mm:ss')
    if (this.entLock.unlockTime !== null) this.entLock.unlockTime = this.$util.formatDate.format(new Date(Date.parse(this.entLock.unlockTime)), 'yyyy-MM-dd hh:mm:ss')
  },
  methods: {
    // 惩戒来源格式化
    punishFromFormat(row) {
      let name = ''
      this.punishFromList.forEach(each => {
        if (each.value === row) {
          name = each.label
        }
      })
      return name
    },
    lockTypeFormat(row) {
      let name = ''
      this.lockTypeOptions.forEach(each => {
        if (each.value === row) {
          name = each.label
        }
      })
      return name
    },
    lockStateFormat(row) {
      let name = ''
      this.lockstates.forEach(each => {
        if (each.value === row) {
          name = each.label
        }
      })
      return name
    },
    back() {
      this.$router.back()
    }
  }
}
</script>

<style lang="scss" scoped>
  .header-label{
    font-size: 20PX;
    font-family: Microsoft YaHei, Microsoft YaHei-Bold;
    font-weight: bold;
    color: #243668;
    line-height: 32px;
  }
  .apply-table{
    width: 100%;
    border-collapse: collapse;
    padding:15px;
    font-size:18px;
    table{
      border-top: 1px solid $color-border;
      border-left: 1px solid $color-border;
    }
    tr{
      width:100%
    }
    th,td{
      border-top: 1px solid $color-border;
      border-left: 1px solid $color-border;
      border-right: 1px solid $color-border;
      border-bottom: 1px solid $color-border;
      padding:15px
    }
    th{
      color: #5e5e5e;
      font-weight: normal;
      background: $color-form-label
    }
    td{
    }
  }
</style>
