index.vue 15.9 KB
Newer Older
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 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 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400
<template>
  <div class="app-container homeA">
    <div clss="div-row">
      <!--<div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%;text-align: center;float: left;font-size: 15px;">
            <img src="../assets/taskDistribution.png" width="15%" style="margin-top: 2.5rem;">
            <p>车辆信息</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">{{totalObj.taskTotal}}</div>
        </el-card>
      </div>
      <div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
            <img src="../assets/taskFeedback.png" width="15%" style="margin-top: 2.5rem;">
            <p>气瓶追溯</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">0</div>
        </el-card>
      </div>-->
      <div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%;text-align: center;float: left;font-size: 15px;">
            <img src="../assets/taskDistribution.png" width="15%" style="margin-top: 2.5rem;">
            <p>巡检巡查任务</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">{{totalObj.taskTotal}}</div>
        </el-card>
      </div>
      <div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
            <img src="../assets/taskFeedback.png" width="15%" style="margin-top: 2.5rem;">
            <p>入户安检任务</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">{{totalObj.taskFeedbackTotal}}</div>
        </el-card>
      </div>
      <div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
            <img src="../assets/complaint.png" width="15%" style="margin-top: 2.5rem;">
            <p>投诉处置</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">{{totalObj.complaintTotal}}</div>
        </el-card>
      </div>
      <div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
            <img src="../assets/complaintFeedback.png" width="15%" style="margin-top: 2.5rem;">
            <p>投诉反馈</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">{{totalObj.complaintFeedbackTotal}}</div>
        </el-card>
      </div>
    </div>

    <div clss="div-row">
      <div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
            <img src="../assets/video.png" width="15%" style="margin-top: 2.5rem;">
            <p>视频监控</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">{{totalObj.videoTotal}}</div>
        </el-card>
      </div>
      <div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
            <img src="../assets/equipment.png" width="15%" style="margin-top: 2.5rem;">
            <p>安全装置</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">{{totalObj.equipmentTotal}}</div>
        </el-card>
      </div>
      <div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
            <img src="../assets/trouble.png" width="15%" style="margin-top: 2.5rem;">
            <p>燃气事故</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">{{totalObj.troubleTotal}}</div>
        </el-card>
      </div>
      <div class="div-col1">
        <el-card>
          <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
            <img src="../assets/hidden.png" width="15%" style="margin-top: 2.5rem;">
            <p>隐患整治</p>
          </div>
          <div style="width: 50%;height: 100%;text-align: center;line-height: 8rem;float: right;font-size: 2.5rem;font-family: 'UnidreamLED';">{{totalObj.hiddenTotal}}</div>
        </el-card>
      </div>
    </div>

    <div clss="div-row">
      <div :class="'-2' == this.$store.state.user.enterpriseId?'div-col2':'div-col2-en'" @click="$router.push('/operationMonitor/monitorData')" v-if="'-2' == this.$store.state.user.enterpriseId">
        <el-card>
            <img src="../assets/dataMonitor.png" width="20%"/>
            <p>数据监控</p>
        </el-card>
      </div>
      <div :class="'-2' == this.$store.state.user.enterpriseId?'div-col2':'div-col2-en'" @click="$router.push('/emergency/eventInfo')" v-if="'-2' == this.$store.state.user.enterpriseId">
        <el-card>
            <img src="../assets/emergency.png" width="20%"/>
            <p>应急处置</p>
        </el-card>
      </div>
      <div :class="'-2' == this.$store.state.user.enterpriseId?'div-col2':'div-col2-en'" @click="$router.push('/regulation/info')" v-if="'-2' == this.$store.state.user.enterpriseId">
        <el-card>
            <img src="../assets/enterprise.png" width="20%"/>
            <p>燃气企业</p>
        </el-card>
      </div>
      <div :class="'-2' == this.$store.state.user.enterpriseId?'div-col2':'div-col2-en'" @click="$router.push('/regulation/gasuser')">
        <el-card>
            <img src="../assets/user.png" width="20%"/>
            <p>燃气用户</p>
        </el-card>
      </div>
      <div :class="'-2' == this.$store.state.user.enterpriseId?'div-col2':'div-col2-en'" @click="$router.push('/regulation/station')">
        <el-card>
            <img src="../assets/station.png" width="20%"/>
            <p>场站信息</p>
        </el-card>
      </div>
      <div :class="'-2' == this.$store.state.user.enterpriseId?'div-col2':'div-col2-en'" @click="$router.push('/regulation/pipe')">
        <el-card>
            <img src="../assets/pipe.png" width="20%"/>
            <p>管道信息</p>
        </el-card>
      </div>
      <div :class="'-2' == this.$store.state.user.enterpriseId?'div-col2':'div-col2-en'" @click="$router.push('/regulation/device')">
        <el-card>
            <img src="../assets/device.png" width="20%"/>
            <p>设备信息</p>
        </el-card>
      </div>
      <div :class="'-2' == this.$store.state.user.enterpriseId?'div-col2':'div-col2-en'" @click="$router.push('/standingBook/equipment')">
        <el-card>
            <img src="../assets/addDetector.png" width="20%"/>
            <p>用户加装安全装置</p>
        </el-card>
      </div>
    </div>

    <div class="div-row">
      <div class="div-col3">
        <el-card>
          <!--<div slot="header">
            <span>任务下发</span>
            <span class="div-header" style="cursor: pointer; float: right;" @click="$router.push('/operationMonitor/workOrder')">更多>></span>
          </div>-->
          <div slot="header">
            <span>巡检巡查任务</span>
            <span v-if="'-2' == this.$store.state.user.enterpriseId" class="div-header" style="cursor: pointer; float: right;" @click="$router.push('/inspectionWork/workOrderInspectionAndPatrol')">更多>></span>
            <span v-else class="div-header" style="cursor: pointer; float: right;" @click="$router.push('/inspectionWork/PatrolTask')">更多>></span>
          </div>
          <div class="body">
            <el-table v-loading="orderLoading" :data="orderList" height="354" style="width: 100%; border: 1px solid #e6ebf5;">
             <!-- <el-table-column label="序号" type="index" align="center"/>
              <el-table-column label="任务类型" align="center" prop="workType" width="90">
                <template slot-scope="scope">
                  <span v-if="scope.row.workType == '1'">入户安检</span>
                  <span v-if="scope.row.workType == '2'">巡检</span>
                  <span v-if="scope.row.workType == '3'">报警巡查</span>
                  <span v-if="scope.row.workType == '4'">其他</span>
                </template>
              </el-table-column>
              <el-table-column label="任务名称" align="left" prop="workTitle"/>
              <el-table-column label="创建时间" align="center" prop="createTime" width="200"/>
              <el-table-column label="状态" align="center" prop="workStatus" width="100">
                <template slot-scope="scope">
                  <span v-if="scope.row.workStatus == 0" style="color: #ff7272">派发中</span>
                  <span v-if="scope.row.workStatus == 1" style="color: #ffba00">已接单</span>
                  <span v-if="scope.row.workStatus == 2" style="color: #1890ff">已反馈</span>
                  <span v-if="scope.row.workStatus == 3" style="color: #30B46B">已归档</span>
                </template>
              </el-table-column>-->
              <el-table-column label="任务标题" align="center" prop="taskTitle" width="200" :show-overflow-tooltip="true"/>
              <el-table-column label="任务类型" align="center" prop="taskType" :formatter="taskTypeFormatter"/>
              <el-table-column label="任务状态" align="center" prop="status" :formatter="taskStatusFormatter"/>
              <el-table-column label="所属单位" align="center" prop="createEnterpriseId" :formatter="enterpriseFormatter"/>
              <el-table-column label="开始时间" align="center" prop="createTime" width="180">
                <template slot-scope="scope">
                  <span v-if="scope.row.createTime">{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                  <span v-else>-</span>
                </template>
              </el-table-column>
              <el-table-column label="截止时间" align="center" prop="endTime" width="180">
                <template slot-scope="scope">
                  <span v-if="scope.row.endTime">{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                  <span v-else>-</span>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-card>
      </div>
      <div class="div-col3">
        <el-card>
          <div slot="header">
            <span>投诉处置</span>
            <span class="div-header" style="cursor: pointer; float: right;" @click="$router.push('/complainDeal')">更多>></span>
          </div>
          <div class="body">
            <el-table v-loading="complainLoading" :data="complainList" height="355" style="width: 100%; border: 1px solid #e6ebf5;">
              <el-table-column label="序号" type="index" align="center"/>
              <el-table-column label="投诉事项" align="left" prop="complainMatter"/>
              <el-table-column label="投诉时间" align="center" prop="createTime" width="200"/>
              <el-table-column label="状态" align="center" prop="complainStatus" width="100">
                <template slot-scope="scope">
                  <span v-if="scope.row.complainStatus == '1'" style="color: #ff7272">派发中</span>
                  <span v-if="scope.row.complainStatus == '2'" style="color: #1890ff">已反馈</span>
                  <span v-if="scope.row.complainStatus == '3'" style="color: #30B46B">已归档</span>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-card>
      </div>
    </div>
  </div>
</template>

<script>
import { homepageStatistic } from "@/api/statistic/statisticAnalysis";
import { listOrder } from "@/api/operationMonitor/order";
import { listComplainDeal } from "@/api/complainDeal/complainDeal";
import { listTask } from "@/api/inspectionWork/workTask";
import { enterpriseLists } from "@/api/regulation/info";
export default {
  name: "index",
  data() {
    return {
      // 遮罩层
      orderLoading: true,
      complainLoading: true,
      // 统计数据
      totalObj: {},
      // 列表数据
      orderList: [],
      complainList: [],
      // 总条数
      orderTotal: 0,
      complainTotal: 0,
      // 查询参数
      orderParams: {
        pageNum: 1,
        pageSize: 10,
        isDel: '0'
      },
      complainParams: {
        pageNum: 1,
        pageSize: 10,
        isDel: '0'
      },
      workTaskType: [],
      workTaskStatus: []
    };
  },
  created(){
    // 默认配置
    console.log(this.$store.state.settings)
  },
  mounted() {
    this.getEnterpriseLists();
    this.getWorkTaskType();
    this.getWorkTaskStatus();
    this.getStatiData();
    this.getOrderList();
    this.getComplainDealList();
  },
  methods: {
    getStatiData() {
      homepageStatistic().then(response => {
        this.totalObj = response.data;
        console.log("this.totalObj",this.totalObj)
      });
    },
    getOrderList() {
      this.orderLoading = true;
      /*listOrder(this.orderParams).then(response => {
        this.orderList = response.rows.slice(0, 7);
        this.orderTotal = response.total;
        this.orderLoading = false;
      });*/
      if('-2' != this.$store.state.user.enterpriseId){
        this.orderParams.taskType = 1;
      }
      listTask(this.orderParams).then(res =>{
        this.orderList = res.rows.slice(0, 7);
        this.orderTotal = res.total;
        this.orderLoading = false;
      })
    },
    getComplainDealList() {
      this.complainLoading = true;
      listComplainDeal(this.complainParams).then(response => {
        this.complainList = response.rows.slice(0, 7);
        this.complainTotal = response.total;
        this.complainLoading = false;
      });
    },
    goTarget(href) {
      window.open(href, "_blank");
    },
    getWorkTaskType(){
      this.getDicts("t_work_task_type").then(response => {
          this.workTaskType = response.data;
      });
    },
    getWorkTaskStatus(){
      this.getDicts("t_work_task_status").then(response => {
          this.workTaskStatus = response.data;
      });
    },
    //任务类型
    taskTypeFormatter(row){
      return this.selectDictLabel(this.workTaskType, row.taskType);
    },
    //任务状态
    taskStatusFormatter(row){
      return this.selectDictLabel(this.workTaskStatus, row.status);
    },
    enterpriseFormatter(row){
      let info = this.enterprises.find(item => item.enterpriseId == row.createEnterpriseId);
      return info?info.enterpriseName:"-";
    },
    getEnterpriseLists(){
      enterpriseLists().then(response => {
        this.enterprises = response.rows;
        this.enterprises.push({enterpriseId:-2,enterpriseName:"政府部门"})
      });
    },
  },
};
</script>

<style scoped lang="scss">
.homeA {
  div {
    color: #515a6e;
  }

  .col-item {
    margin-bottom: 20px;
  }

  padding: 10px;
  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  overflow-x: hidden;

  p {
    margin: 0px;
    color: #515a6e;
  }

  .div-col1 {
    width: 25%;
    padding: 6px;
    float: left;
  }

  .div-col2 {
    width: 12.5%;
    padding: 9px 6px;
    float: left;
    text-align: center;
    cursor: pointer;
  }

  .div-col2-en {
    width: 20%;
    padding: 9px 6px;
    float: left;
    text-align: center;
    cursor: pointer;
    img{
      width: 11%;
    }
  }

  .div-col3 {
    width: 50%;
    padding: 6px;
    float: left;
  }

  .div-header:hover {
    text-decoration:underline;
    color: #1890ff;
  }
}
</style>