dropPointinfo.vue 5.3 KB
<template>
  <div>
    <div v-loading="loading" style="border: 1px solid black;">
      <el-row  >
        <el-col :span="12" class="bd">投放点编号</el-col>
        <el-col :span="12" class="bd">{{infoData.dropPointNo}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">投放点名称</el-col>
        <el-col :span="12" class="bd">{{infoData.dropPointName}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">所属区域</el-col>
        <el-col :span="12" class="bd">{{dict(infoData.place)}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">所属街道</el-col>
        <el-col :span="12" class="bd">{{dictInfo(infoData.street)}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">社区</el-col>
        <el-col :span="12" class="bd">{{infoData.community}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">详细地址</el-col>
        <el-col :span="12" class="bd">{{infoData.address}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">投放点形式</el-col>
        <el-col :span="12" class="bd">{{infoData.type}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">投放点面积(m²)</el-col>
        <el-col :span="12" class="bd">{{infoData.area}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">投放点容量(m³)</el-col>
        <el-col :span="12" class="bd">{{infoData.capacity}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">管理单位</el-col>
        <el-col :span="12" class="bd">{{infoData.managementUnit}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">管理人</el-col>
        <el-col :span="12" class="bd">{{infoData.custodian}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">管理员电话</el-col>
        <el-col :span="12" class="bd">{{infoData.custodianPhone}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">投放时间</el-col>
        <el-col :span="12" class="bd">{{infoData.dropTime}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">运营单位</el-col>
        <el-col :span="12" class="bd">{{infoData.operatingUnit}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">运输单位</el-col>
        <el-col :span="12" class="bd">{{infoData.transportUnit}}</el-col>
      </el-row>
      <el-row  >
        <el-col :span="12" class="bd">坐标点</el-col>
        <el-col :span="12" class="bd">{{infoData.coordinatePoint}}</el-col>
      </el-row>
    </div>
  </div>
</template>

<script>


import store from "@/store";
import {
  getToken
} from "@/utils/auth";
import {
  listDropPointInfo,
  getDropPointInfo,
  delDropPointInfo,
  addDropPointInfo,
  updateDropPointInfo,
  exportDropPointInfo
} from "@/api/unit/dropPointInfo";
import {getAreaList} from "@/api/dict"




export default {
  name: "dropPointinfo",
  props: {
    businessKey: {
      type: String
    },
  },
  data() {
    return {
      sign: store.getters.avatar, //裁剪图片的地址
      areas: [],
      loading: null,
      infoData: {},
      dicts:null,
      showPic:false,
      picImage:null,
    }
  },
  created() {
    getAreaList().then(response => {
      if(response==null || response.length===0){
        this.$message.error("获取区域列表失败");
        return;
      }
      const data = response;
      for (let dataKey in data) {
        if(data[dataKey].level === '3'){
          this.areas.push({name:data[dataKey].name,code:data[dataKey].id, streets:[]})
        }
      }
      for(let dataKey in data){
        for(let areas1Key in this.areas){
          if(data[dataKey].pid === this.areas[areas1Key].code){
            this.areas[areas1Key].streets.push({code:data[dataKey].id, name:data[dataKey].name})
          }
        }
      }
    });
    this.loading = true;
    this.getInfo();

  },
  methods: {
    dict(code) {
      for (let key in this.areas) {
        if (this.areas[key].code === code) {
          return this.areas[key].name;
        }
      }
    },
    dictInfo(code) {
      for (let key in this.areas) {
        for (let keyInfo in this.areas[key].streets) {
          if (this.areas[key].streets[keyInfo].code === code) {
            return this.areas[key].streets[keyInfo].name;
          }
        }
      }
    },
    getInfo() {
      let id;
      if (this.businessKey.split(":").length == 2) {
        id = this.businessKey.split(":")[1];
      } else {
        id = this.businessKey;
      }

      getDropPointInfo(id).then(response => {

        this.infoData = response.data;
        // getArea().then(res => {
        //   this.areas = res.result;
        //   this.loading = false;
        //   for (let i = 0; i < this.areas.length; i++) {
        //     if (Number(this.infoData.place) == this.areas[i].code) {
        //       this.infoData.place = this.areas[i].name;
        //     }
        //   }
        // });

        // for(let i in obj){
        //   if(this.objectDict[i]){
        //       this.infoData.push({label:this.objectDict[i] ,value:obj[i]})
        //   }
        // }
        this.loading = false;
      });
    },
  }

}
</script>
<style>
.bd{
  padding:5px;
}



</style>