DetailInfo.vue 8.8 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
<template>
  <el-dialog title="详情" :visible.sync="detailOpen" width="1200px" append-to-body destroy-on-close :close-on-click-modal="false">

    <el-form label-width="120px">
      <el-row>
        <el-col :span="12">
          <el-row class="el-row-table">
            <el-col :span="12">
              <el-form-item label="停气开始日期">
                <span v-if="detailInfo.fStartDate">{{ detailInfo.fStartDate }}</span>
                <span v-else>-</span>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="停气结束日期">
                <span v-if="detailInfo.fEndDate">{{ detailInfo.fEndDate }}</span>
                <span v-else>-</span>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="停气类型">
                <span v-if="detailInfo.fStopType">{{ $parent.fStopTypeFormat(detailInfo) }}</span>
                <span v-else>-</span>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="停气进度">
                <span v-if="detailInfo.fStopType">{{ $parent.fStopProgressFormat(detailInfo) }}</span>
                <span v-else>-</span>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="影响用户">
                <span v-if="detailInfo.fInfluenceCus">{{ detailInfo.fInfluenceCus }}</span>
                <span v-else>-</span>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="停气原因">
                <span v-if="detailInfo.fStopReason">{{ detailInfo.fStopReason }}</span>
                <span v-else>-</span>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="停气范围">
                <span v-if="detailInfo.fStopRange">{{ detailInfo.fStopRange }}</span>
                <span v-else>-</span>
              </el-form-item>
55
            </el-col>  
耿迪迪's avatar
耿迪迪 committed
56 57 58 59 60 61 62 63 64 65 66 67 68 69
            <el-col :span="12">
              <el-form-item label="创建时间">
                <span v-if="detailInfo.createTime">{{ detailInfo.createTime }}</span>
                <span v-else>-</span>
              </el-form-item>
            </el-col>

            <el-col :span="12">
              <el-form-item label="更新时间">
                <span v-if="detailInfo.updateTime">{{ detailInfo.updateTime }}</span>
                <span v-else>-</span>
              </el-form-item>
            </el-col>
          </el-row>
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
          <div>
            <h3>停气操作记录</h3>
            <div class="stop-record">
              <el-table :data="stopLog">
                <el-table-column label="停气进度" align="center" prop="fStopProgress" :formatter="$parent.fStopProgressFormat"/>
                <el-table-column label="操作停气进度时间" align="center" prop="fOprDate" width="150">
                  <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.fOprDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                  </template>
                </el-table-column>
              </el-table>
              <pagination
                v-show="total>0"
                :total="total"
                :pageSizes="[5,10, 20, 30, 50]"
                :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize"
                @pagination="getStopLog"
              />
            </div>
          </div>
耿迪迪's avatar
耿迪迪 committed
91 92 93 94 95 96 97 98 99 100
        </el-col>

        <el-col :span="12" style="padding-left: 10px">
          <div style="font-size: 14px;color: #606266;margin-bottom: 10px;font-weight: 700">停气区域</div>
          <div id="areaInfo"></div>
        </el-col>
      </el-row>

    </el-form>

101 102 103 104 105

    <el-divider content-position="left">上报时态</el-divider>
    <el-form label-width="170px">
      <el-row class="el-row-table">    
        
106
          <el-col :span="12">
107
                <el-form-item :label="fUploadTypeLable"  >
108 109 110 111 112
                  <span>{{fUploadType}}</span> 
                </el-form-item>
          </el-col>

          <el-col :span="12">
113
              <el-form-item :label="fUploadTimeLable" >
114 115 116 117 118 119 120 121 122
                <span>{{ fUploadTime }}</span> 
              </el-form-item>
          </el-col>
              
          <el-col :span="12"> 
            <el-form-item  v-if="this.$store.state.user.roleId == 3" label="企业端上报时间" >
              <span>{{ detailInfo.entRepTime }}</span>
            </el-form-item>
          </el-col>   
123 124 125 126 127

      </el-row>
    </el-form>


耿迪迪's avatar
耿迪迪 committed
128 129 130 131 132 133 134
  </el-dialog>

</template>

<script>
  import { getSup } from "@/api/supplybalance/stop";
  import { EditorMap } from "@/utils/mapClass/getPath.js";
135
  import { listLog } from "@/api/supplybalance/stopLog.js";
耿迪迪's avatar
耿迪迪 committed
136 137 138 139 140 141
  export default {
    name: "detail-info",
    data(){
        return{
          detailInfo: {},
          detailOpen: false,
142 143
          stopLog: [],
          total: 0,
144 145
          fUploadType: "",
          fUploadTime: null,
146 147
          fUploadTimeLable: "",
          fUploadTypeLable: "",
148 149 150 151 152
          queryParams: {
            pageNum: 1,
            pageSize: 5,
            fGasStopId: null,
          },
耿迪迪's avatar
耿迪迪 committed
153 154 155 156 157 158 159 160
        }
    },
    watch:{
      detailOpen(newVal){
        if(newVal){
          //if(this.detailInfo.fGasStopArea) this.path = JSON.parse(this.detailInfo.fGasStopArea);
          this.$nextTick(() =>{
            this.initMap();
161 162
          });
          this.getStopLog();
耿迪迪's avatar
耿迪迪 committed
163 164 165 166
        }
      }
    },
    methods:{
167 168 169 170 171
      //根据不同角色显示不同字段
      showUploadType() {
        let roleId = this.$store.state.user.roleId;
        if (roleId == 3) {
          this.fUploadType =  this.detailInfo.fGovUploadStatus
172
          this.fUploadTypeLable = "上报省厅状态"
173 174 175
        }
        if (roleId == 5) {
          this.fUploadType =  this.detailInfo.fRepStatus
176
          this.fUploadTypeLable = "上报状态"
177 178 179 180 181 182 183 184 185 186 187 188 189 190
        }

        if (this.fUploadType == '0') {
          this.fUploadType = "未上报"
        }
        if (this.fUploadType == '1') {
          this.fUploadType = "已上报"
        }
      },
      showUploadTime() {

        let roleId = this.$store.state.user.roleId;
        if (roleId == 3) {
          this.fUploadTime =  this.detailInfo.fGovUploadTime
191
          this.fUploadTimeLable = "上报省厅时间"
192 193 194
        }
        if (roleId == 5) {
          this.fUploadTime =  this.detailInfo.entRepTime
195
          this.fUploadTimeLable = "上报时间"
196 197
        }
      },
耿迪迪's avatar
耿迪迪 committed
198
      getDetailInfo(id){
199
        this.queryParams.fGasStopId = id;
耿迪迪's avatar
耿迪迪 committed
200 201 202
        getSup(id).then(res =>{
          if(res.code == 200 && res.data){
            this.detailInfo = res.data;
203 204
            this.showUploadType();
            this.showUploadTime();
耿迪迪's avatar
耿迪迪 committed
205 206 207 208 209 210 211 212
            this.detailOpen = true;
          }
        })
      },
      initMap(){
        const path = eval(this.$store.state.user.systemSetting.map_center);
        const gaoMap = new EditorMap("areaInfo", {center:path}, this);
        if(this.detailInfo.fGasStopArea){
213 214
          if (this.detailInfo.fGasStopArea.includes("#")){
            let areas = this.detailInfo.fGasStopArea.split("#");
215 216 217
            for (let i = 0; i < areas.length;i++) {
                let areasItem = areas[i];
                if (areasItem != null && areasItem != "") {
218 219 220 221 222
                    new AMap.Polygon({
                      map: gaoMap.map,
                      path: JSON.parse(areasItem),
                      fillColor:'#00b0ff',
                      strokeColor:'#80d8ff'
223
                    });
224 225 226 227 228
                }
            }

          } else {
            new AMap.Polygon({
耿迪迪's avatar
耿迪迪 committed
229 230 231 232 233 234
            map: gaoMap.map,
            path: JSON.parse(this.detailInfo.fGasStopArea),
            fillColor:'#00b0ff',
            strokeColor:'#80d8ff'
          });
          gaoMap.setCenter(JSON.parse(this.detailInfo.fGasStopArea)[0]);
235
          }
耿迪迪's avatar
耿迪迪 committed
236 237
          gaoMap.map.setZoom(12)
        }
238 239 240 241 242 243 244 245 246
      },
      getStopLog(){
        listLog(this.queryParams).then(res =>{
          if(res.code == 200 && res.rows){
            console.log("fdsfd=======",res)
            this.stopLog = res.rows;
            this.total = res.total;
          }
        })
耿迪迪's avatar
耿迪迪 committed
247 248 249 250 251 252 253 254
      }
    }
  }
</script>

<style scoped lang="scss">
  #areaInfo{
    width: 100%;
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
    height: 650px;
  }

  .stop-record{
    height: 350px;
    overflow-y: scroll;
    &::-webkit-scrollbar {
      /* 设置滚动条宽度 */
      width: 4px;
      /* 设置滚动条背景色 */
      //background: black;
    }

    //滚动条轨道
    &::-webkit-scrollbar-track {
      background-color:transparent;
      -webkit-border-radius: 2em;
      -moz-border-radius: 2em;
      border-radius:2em;
    }

    //滚动条滑块
    &::-webkit-scrollbar-thumb {
      background-color: rgb(147,147,153,0.5);
      -webkit-border-radius: 2em;
      -moz-border-radius: 2em;
      border-radius:2em;
    }
耿迪迪's avatar
耿迪迪 committed
283 284 285
  }

</style>