<template>
  <div>
    <div class="app-container">
      <div class="level-title">
        <h1>基本信息</h1>
      </div>
      <div class="mb-20">
        <table class="table-ui">
          <tr>
            <td class="tbg">会员级别</td>
            <td>{{ pd.ROLE_NAME }}</td>
            <td class="tbg"/>
            <td/>
          </tr>
          <tr>
            <td class="tbg">企业名称</td>
            <td>{{ pd.CORP_NAME }}</td>
            <td class="tbg">邮政编码</td>
            <td>{{ pd.POSTAL_CODE }}</td>
          </tr>
          <tr>
            <td class="tbg">统一社会信用代码</td>
            <td>{{ pd.CODE }}</td>
            <td class="tbg">市行业监管部门</td>
            <td>{{ pd.INDUSTRY_DEPARTMENTName }}</td>
          </tr>
          <tr>
            <td class="tbg">属地</td>
            <td >{{ pd.COMPANY_AREA }}</td>
            <td class="tbg">监管类型</td>
            <td>{{ pd.REGULARTYPE_NAME }}</td>
          </tr>
          <tr>
            <td class="tbg">经济类型</td>
            <td>{{ pd.ECO_TYPE_NAME }}</td>
            <td class="tbg">所属行业</td>
            <td>{{ pd.CORP_TYPE_NAME }}</td>
          </tr>
          <tr>
            <td class="tbg">企事业单位经营地址</td>
            <td>{{ pd.ADDRESS_BUSINESS }}</td>
            <td class="tbg">企业状态</td>
            <td>{{ pd.CORP_STATE_NAME }}</td>
          </tr>
          <tr>
            <td class="tbg">经度</td>
            <td>{{ pd.LONGITUDE }}</td>
            <td class="tbg">纬度</td>
            <td>{{ pd.LATITUDE }}</td>
          </tr>
          <tr>
            <td class="tbg">主要负责人</td>
            <td>{{ pd.CONTACTS }}</td>
            <td class="tbg">主要负责人电话</td>
            <td>{{ pd.CONTACTS_PHONE }}</td>
          </tr>
          <tr>
            <td class="tbg">法定代表人</td>
            <td>{{ pd.LR_NAME }}</td>
            <td class="tbg">法人手机号</td>
            <td>{{ pd.LR_PHONE }}</td>
          </tr>
          <tr>
            <td class="tbg">占地面积（㎡）</td>
            <td>{{ pd.AREA_COVERED }}</td>
            <td class="tbg">职工人数(人)</td>
            <td>{{ pd.EMPLOYEES }}</td>
          </tr>
          <tr>
            <td class="tbg">成立时间</td>
            <td>{{ pd.CREATE_DATE }}</td>
            <td class="tbg">注册资金（万元）</td>
            <td>{{ pd.REGCAPITAL }}</td>
          </tr>
          <tr>
            <td class="tbg">资产总额（万元）</td>
            <td>{{ pd.TOTALASSETS }}</td>
            <td class="tbg">隶属关系</td>
            <td>{{ pd.SUBORDINATIONNAME }}</td>
          </tr>
          <!--          <tr>-->
          <!--            <td class="tbg">企业类型</td>-->
          <!--            <td>{{ pd.CORP_OF_TYPE_NAME?pd.CORP_OF_TYPE_NAME:'' }}{{ pd.CORP_OF_TYPE_NAME&&pd.CORP_OF_TYPE_NAME2?'/':'' }}{{ pd.CORP_OF_TYPE_NAME2?pd.CORP_OF_TYPE_NAME2:'' }}</td>-->

          <!--          </tr>-->
          <tr>
            <td class="tbg">规模</td>
            <td>{{ pd.SCALE_NAME }}</td>
            <td class="tbg">是否规模以上</td>
            <td>

              <template v-if="pd.SCALE_TYPE=='0'">否</template>
              <template v-if="pd.SCALE_TYPE=='1'">是</template>
            </td>
          </tr>
          <tr>
            <td class="tbg">培训行业类型</td>
            <td>{{ pd.TRAINTYPE_NAME }}</td>
            <td class="tbg">企业可新建用户数量</td>
            <td>{{ pd.USERS_NUM }}</td>
          </tr>

          <tr v-if="pd.FOURTYPE== '1'">
            <td class="tbg">四色图</td>
            <td colspan="3">
              <div class="img-flex">
                <viewer :images="four_images">
                  <img v-for="item in four_images" :src="config.fileUrl + item.FILEPATH" :key="item.IMGFILES_ID" width="100" height="100" style="margin-left:10px;">
                </viewer>

              </div>
            </td>
          </tr>

          <tr>
            <td class="tbg">营业执照</td>
            <td colspan="3">
              <div class="img-flex">
                <viewer :images="bus_images">
                  <img v-for="item in bus_images" :src="config.fileUrl + item.FILEPATH" :key="item.IMGFILES_ID" width="100" height="100" style="margin-left:10px;">
                </viewer>

              </div>
            </td>
          </tr>
        </table>
      </div>

      <div class="level-title">
        <h1>安全负责人信息</h1>
      </div>
      <div class="mb-20">
        <table class="table-ui">
          <tr>
            <td class="tbg">姓名</td>
            <td>{{ pd.SAFETY_NAME }}</td>
            <td class="tbg">职务</td>
            <td>{{ pd.SAFETY_POST }}</td>
          </tr>
          <tr>
            <td class="tbg">单位电话</td>
            <td>{{ pd.SAFETY_NUMBER }}</td>
            <td class="tbg">手机号码</td>
            <td>{{ pd.SAFETY_PHONE }}</td>
          </tr>
        </table>
      </div>
      <!--      <div class="level-title">-->
      <!--        <h1>安全标准化</h1>-->
      <!--      </div>-->
      <!--      <div class="mb-20">-->
      <!--        <table class="table-ui">-->
      <!--          <tr>-->
      <!--            <td class="tbg">安全标准化等级</td>-->
      <!--            <td>{{ pd.AQ_BZ_LEVEL_NAME }}</td>-->
      <!--            <td class="tbg">安全标准化证书编号</td>-->
      <!--            <td>{{ pd.AQ_BZ_NO }}</td>-->
      <!--          </tr>-->
      <!--          <tr>-->
      <!--            <td class="tbg">安全标准化发证单位</td>-->
      <!--            <td>{{ pd.AQ_BZ_UNIT }}</td>-->
      <!--            <td class="tbg">安全标准化有效期</td>-->
      <!--            <td>{{ pd.AQ_BZ_TIME }}</td>-->
      <!--          </tr>-->
      <!--        </table>-->
      <!--      </div>-->
      <div class="level-title">
        <h1>企业相关属性</h1>
      </div>
      <div class="mb-20">
        <table class="table-ui">
          <tr>
            <td class="tbg">有无职业卫生信息</td>
            <td>
              <template v-if="pd.WHETHER_HYGIENE=='0'">无</template>
              <template v-if="pd.WHETHER_HYGIENE=='1'">有</template>
            </td>
            <td class="tbg">有无重大危险源</td>
            <td>
              <template v-if="pd.WHETHER_HAZARDS=='0'">无</template>
              <template v-if="pd.WHETHER_HAZARDS=='1'">有</template>
            </td>
          </tr>
          <tr>
            <td class="tbg">是否有稀缺大型应急物资或设施</td>
            <td>
              <template v-if="pd.WHETHER_SCARCE=='0'">否</template>
              <template v-if="pd.WHETHER_SCARCE=='1'">是</template>
            </td>
            <td class="tbg">是否涉及危化品</td>
            <td>
              <template v-if="pd.WHETHER_CHEMICALS=='0'">否</template>
              <template v-if="pd.WHETHER_CHEMICALS=='1'">是</template>
            </td>
          </tr>
          <tr>
            <td class="tbg">有无特种设备</td>
            <td>
              <template v-if="pd.WHETHER_SPECIALEQUIPMENT=='0'">无</template>
              <template v-if="pd.WHETHER_SPECIALEQUIPMENT=='1'">有</template>
            </td>
            <td class="tbg">有无特种作业人员</td>
            <td>
              <template v-if="pd.WHETHER_SPECIALPEOPLE=='0'">无</template>
              <template v-if="pd.WHETHER_SPECIALPEOPLE=='1'">有</template>
            </td>
          </tr>
          <tr>
            <td class="tbg">是否涉及煤气</td>
            <td>
              <template v-if="pd.WHETHER_COALGAS=='0'">否</template>
              <template v-if="pd.WHETHER_COALGAS=='1'">是</template>
            </td>
            <td class="tbg">是否属于消防重点单位</td>
            <td>
              <template v-if="pd.WHETHER_FIRE=='0'">否</template>
              <template v-if="pd.WHETHER_FIRE=='1'">是</template>
            </td>
          </tr>
          <tr>
            <td class="tbg">是否在受限空间作业</td>
            <td>
              <template v-if="pd.WHETHER_CONFINED=='0'">否</template>
              <template v-if="pd.WHETHER_CONFINED=='1'">是</template>
            </td>
            <td class="tbg">是否存在涉爆粉尘作业</td>
            <td>
              <template v-if="pd.WHETHER_POWDER=='0'">否</template>
              <template v-if="pd.WHETHER_POWDER=='1'">是</template>
            </td>
          </tr>
          <tr>
            <td class="tbg">是否涉及防雷防静电</td>
            <td>
              <template v-if="pd.WHETHER_LIGHTNING=='0'">否</template>
              <template v-if="pd.WHETHER_LIGHTNING=='1'">是</template>
            </td>
            <td class="tbg">是否持有放射源</td>
            <td>
              <template v-if="pd.WHETHER_ACTINOGEN=='0'">否</template>
              <template v-if="pd.WHETHER_ACTINOGEN=='1'">是</template>
            </td>
          </tr>
          <tr>
            <td class="tbg">是否涉及液氨制冷</td>
            <td>
              <template v-if="pd.WHETHER_LIQUIDAMMONIA=='0'">否</template>
              <template v-if="pd.WHETHER_LIQUIDAMMONIA=='1'">是</template>
            </td>
            <td class="tbg">是否涉及危化品管道</td>
            <td>
              <template v-if="pd.WHETHER_PIPELINE=='0'">否</template>
              <template v-if="pd.WHETHER_PIPELINE=='1'">是</template>
            </td>
          </tr>
        </table>
      </div>
    </div>
    <div class="ui-height" />
    <div class="ui-foot">
      <!--      <el-button type="primary" icon="el-icon-edit" @click="handleEdit">修改</el-button>-->
      <el-button type="info" @click="goBack">返回</el-button>
    </div>

  </div>
</template>

<script>
import { requestFN } from '@/utils/request'
import vueQr from 'vue-qr'
export default {
  components: {
    vueQr
  },
  data() {
    return {
      config: config,
      USER_ID: JSON.parse(sessionStorage.getItem('user')).USER_ID,
      ROLEID: JSON.parse(sessionStorage.getItem('user')).ROLEID,
      pd: [],
      bus_images: [],
      imgUrl: require('@/assets/images/map.png'),
      dialogFormShow: false,
      qrcodeStr: ''
    }
  },
  created() {
    this.getData()
  },
  methods: {
    getData() {
      requestFN(
        '/corpinfo/goEdit',
        {
          CORPINFO_ID: this.$parent.CORPINFO_ID,
          AGENCY_MANAGEMENT_ID: this.$parent.AGENCY_MANAGEMENT_ID,
          tm: new Date().getTime()
        }
      ).then((data) => {
        this.pd = data.pd
        this.bus_images = data.busImgs
        this.four_images = data.fourImgs
      }).catch((e) => {
        this.listLoading = false
      })
    },

    goBack() {
      this.$parent.activeName = 'CorpList'
    },
    // 修改
    handleEdit() {
      this.$parent.activeName = 'corpEdit'
    },
    chooseMap() {
      if (this.pd.CORPINFO_ID) {
        this.dialogFormShow = true
        this.qrcodeStr = this.config.weburl + 'static/qrcode/views/qiye/info.html?CORPINFO_ID=' + this.pd.CORPINFO_ID
        console.info(this.qrcodeStr)
      } else {
        this.$message.error('请重新获取二维码')
      }
    }
  }
}
</script>

<style lang="sass" scoped>
.table-ui
  td
    line-height: 34px
  .tbg
    width: 220px
.img-flex
  display: flex
  .img-ui
    width: 110px
    height: 110px
    margin-right: 20px
    & img
      width: 100%
      height: 100%
</style>
