constructionInfo.js 4.64 KB


import {  getSignByObjId, addSign, updateSign } from "@/api/sign/sign";
import store from "@/store";
  import {
    getToken
  } from "@/utils/auth";


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


  export default {
    name: "ThreestepInfo",
    props: {
      businessKey: {
        type: String
      },
      signData:{},
    },
    data() {
      return {
        hide:'block',
        sign: store.getters.avatar, //裁剪图片的地址
        areas: [],
        loading: null,
        objectDict: {
          id: "工地id",
          name: "工地名称",
          certificateNo: "证书编号",
          address: "施工地址",
          monitorModel: "监控模式",
          workAreaCode: "作业区域",
          areaCode: "管辖区",
          projectType: "工程类型",
          cargoId: "建筑垃圾类型",
          constructionCompany: "建设单位",
          constructionCompanyAddress: "建设单位地址",
          constructionCompanyPerson: "建设单位责任人",
          constructionCompanyPhone: "建设单位联系电话",
          transportCompanyId: "运输企业单位",
          transportCompany: "运输企业单位",
          transportCompanyAddress: "运输单位地址",
          transportCompanyPerson: "运输单位负责人",
          transportCompanyPhone: "运输单位联系电话",
          projectCompany: "施工单位",
          projectCompanyAddress: "施工单位地址",
          projectCompanyPerson: "施工单位责任人",
          projectnCompanyPhone: "施工单位联系电话",
          principal: "现场负责人",
          reportingCapacity: "申报容量(m³)",
          effectiveFrom: "有效期开始时间",
          effectiveEnd: "有效期结束时间",
          transportStartTime: "运输开始时间",
          transportEndTime: "运输结束时间",
          monitorBall: "视频监控设施设备 球机(台)",
          monitorGun: "视频监控设施设备 枪机(台)",
          waterTroughLength: "过水槽 长度(米)",
          waterTroughWidth: "过水槽 宽度(米)",
          carWasherLength: "自动洗车机 长度(米)",
          carWasherWidth: "自动洗车机 宽度(米)",
          carWasherHeight: "自动洗车机 挡板高度(米)",
          carWasherResponse: "自动洗车机 感应装置",
          ManualFlushingLength: "人工冲洗 长度(米)",
          waterGun: "水枪(把)",
          buffer: "缓冲区(米)",
          lightingFacilities: "照明设施(盏)",
          washingPlatform: "洗车平台",
          washingGunNum: "洗车水枪数",
          electricRailings: "电动栏杆",
          hydroelectricity: "水电情况",
          exitRoadConditions: "出口道路状况",
          projectProgress: "工程进度情况",
          constructionEnclosure: "施工围挡",
          siteInvestmentType: "工地投资类型",
          deductionPercentage: "减免百分比",
          deductionBasis: "减免依据",
          circuitId: "线路图",
          polygonId: "电子围栏ID",
          earthId: "处理场所地ID",
          earthName: "处理场所地",
          applyOpinion: "申请意见",
          surveyor: "勘察人员",
          candidates: "待选人员"
        },
        infoData: [],
      }
    },
    created() {
      // if(){
        if(window.location.search){

          let arr = window.location.search.split("&");

          if(arr.length == 2){
            this.businessKey = arr[0].split("=")[1];
          }
          else{
            if(!window.location.search.startsWith("?token")){
              this.businessKey = arr[0].split("=")[1];
            }
          }
        }



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

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

        constructionById(id).then(response => {

          this.infoData = response.result;
          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;
              }
            }
          });


          getSignByObjId(id).then(res=>{

              this.signData = res.data;
          });

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

  }