earthsitesInfo.vue 8.29 KB
<template>
  <div v-loading="loading" style="border:1px solid black;">
        <el-row class="bd_bottom" >
          <el-col :span="6" class="bd_right bd_padding">建筑垃圾处理场所名称</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.site.name}}</el-col>
          <el-col :span="6" class="bd_left bd_right bd_padding">证书编号</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.certificateNo}}</el-col>
        </el-row>
        <el-row class="bd_bottom" >
          <el-col :span="6" class="bd_right bd_padding">所在地址</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.site.address}}</el-col>
            <el-col :span="6" class="bd_right bd_padding bd_lefts">工程类型</el-col>
            <el-col :span="6" class="bd_padding">{{infoData.projectTypeName}}</el-col>
        </el-row>

        <el-row class="bd_bottom">
          <el-col :span="6" class="bd_right bd_padding">处理场所类型</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.typeName}}</el-col>
          <el-col :span="6" class="bd_left bd_right bd_padding">所在区域</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.areaName}}</el-col>
        </el-row>
        <el-row class="bd_bottom" >
            <el-col :span="6" class="bd_right bd_padding">作业区域</el-col>
            <el-col :span="6" class="bd_padding">{{infoData.workAreaCodeName}}</el-col>
          <el-col :span="6" class="bd_left bd_right bd_padding">可受纳建筑垃圾类型</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.buildWasteTypeName}}</el-col>
        </el-row>

        <el-row class="bd_bottom">
          <el-col :span="6" class="bd_padding">建设单位名称</el-col>
          <el-col :span="6" class="bd_padding bd_right bd_left">{{infoData.buildCompany}}</el-col>
              <el-col :span="6" class="bd_padding">建筑单位责任人</el-col>
              <el-col :span="6" class="bd_padding bd_left">{{infoData.site.principal}}</el-col>
        </el-row>
        <el-row class="bd_bottom" >
            <el-col :span="6" class="bd_right bd_padding">责任人联系电话</el-col>
            <el-col :span="6" class="bd_padding ">{{infoData.site.principalPhoneNo}}</el-col>
          <el-col :span="6" class="bd_right bd_padding bd_left">审批方量(m3)</el-col>
          <el-col :span="6" class="bd_padding ">{{infoData.capacity}}</el-col>
        </el-row>

        <el-row class="bd_bottom">
          <el-col :span="6" class="bd_right bd_padding">有效期开始时间</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.site.effectiveFrom}}</el-col>
          <el-col :span="6" class="bd_left bd_right bd_padding">有效期结束时间</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.site.effectiveEnd}}</el-col>
        </el-row>

        <el-row class="bd_bottom">
          <el-col :span="6" class="bd_right bd_padding">洗车作业设施</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.washingPlatformName}}</el-col>
          <el-col :span="6" class="bd_left bd_right bd_padding">出口道路状况</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.exitRoadConditionsName}}</el-col>
        </el-row>
        <el-row class="bd_bottom">
          <el-col :span="6" class="bd_right bd_padding">照明设施</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.lightingName}}</el-col>
          <el-col :span="6" class="bd_left bd_right bd_padding">视频监控设施</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.monitorName}}</el-col>
        </el-row>
        <el-row class="bd_bottom">
          <el-col :span="6" class="bd_right bd_padding">填表人名称</el-col>
          <el-col :span="6" class="bd_padding">{{infoData.filledBy}}</el-col>
        </el-row>

        <el-row class="">
          <el-col :span="6" class="bd_right bd_padding">申请意见</el-col>
          <el-col :span="18" class="bd_padding">{{infoData.applyOpinion}}</el-col>
        </el-row>

    <!-- <el-button  style="color:blue;margin: 5px;" @click="showMap">查看电子围栏</el-button>
    <el-dialog title="电子围栏" :visible.sync="open" width="400px" append-to-body>
        <div id="container"></div>
    </el-dialog> -->


  </div>
</template>

<style scoped>
  #container{
    padding:0px;
    margin: 0px;
    width: 100%;
    height: 400px;
  }
</style>

<script>

import AMapLoader from '@amap/amap-jsapi-loader';
import store from "@/store";
  import {
    getToken
  } from "@/utils/auth";


  import {
    earthsitesById,
    getArea,
    getDict
  } from "@/api/dict";


  export default {
    name: "ThreestepInfo",
    props: {
      businessKey: {
        type: String
      },
    },
    data() {
      return {
        sign: store.getters.avatar, //裁剪图片的地址
        areas: [],
        loading: null,
        open:false,
        infoData: {},
      }
    },
    created() {



      this.loading = true;
      this.getInfo();

    },
    methods: {
      showMap(){
        if(!this.map){
          AMapLoader.load({
                key:"cfe6a9d5adbdb09212d25d3257a7a082",             // 申请好的Web端开发者Key,首次调用 load 时必填
                version:"2.0",      // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
                plugins:[''],       // 需要使用的的插件列表,如比例尺'AMap.Scale'等
              }).then((AMap)=>{
                this.map = new AMap.Map("container",{  //设置地图容器id
                });

                let arr = this.infoData.site.coord.split(";");
                let path = [];

                for(let i in arr){
                  path.push(new AMap.LngLat(arr[i].split(",")[0],arr[i].split(",")[1]));
                }

                let polygon = new AMap.Polygon({
                  path: path,
                  fillColor: '#fff', // 多边形填充颜色
                  borderWeight: 1, // 线条宽度,默认为 1
                  strokeColor: 'red', // 线条颜色
                });
                this.map.add(polygon);
                this.map.setFitView([ polygon ]);

              }).catch(e=>{
                console.log(e);
              })
        }else{
          let arr = this.infoData.site.coord.split(";");
          let path = [];

          for(let i in arr){
            path.push(new AMap.LngLat(arr[i].split(",")[0],arr[i].split(",")[1]));
          }

          let polygon = new AMap.Polygon({
            path: path,
            fillColor: '#fff', // 多边形填充颜色
            borderWeight: 1, // 线条宽度,默认为 1
            strokeColor: 'red', // 线条颜色
          });
          this.map.add(polygon);
          this.map.setFitView([ polygon ]);
        }

        this.open = true;
      },
      getInfo() {
        let id;
        if (this.businessKey.split(":").length == 2) {
          id = this.businessKey.split(":")[1];
        } else {
          id = this.businessKey;
        }

        earthsitesById(id).then(response => {

           this.infoData = response.result;

           let type = {"type":"CSDisSiteType"};
           getDict(type).then(res=>{
                for(var i in res.result){

               if(this.infoData.disposalType == res.result[i].code){
                            this.infoData.disposalType = res.result[i].name;
               }
             }
           });

           type = {"type":"CSDisSiteProjectType"};
           getDict(type).then(res=>{
             for(var i in res.result){
               if(this.infoData.projectType == res.result[i].code){
                this.infoData.projectType = res.result[i].name;
               }

             }
           });

          // type = {"type":"CSDisSiteType"};
          //  getDict(type).then(res=>{
          //    for(var i in res.result){

          //      // for(let j in this.infoData.buildWasteType.split(,)){



          //      // }

          //      // if(this.infoData.buildWasteType == res.result[i].code){

          //      //   this.infoDate.buildWasteType = res.result[i].name;
          //      // }

          //    }

          //  });

          this.loading = false;
        });
      },
    }

  }
</script>