index.vue 5.69 KB
Newer Older
1 2
<template>
  <div class="app-container">
3 4
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item label="设备编号" prop="deviceCode">
5
        <el-input
6 7
          v-model="queryParams.deviceCode"
          placeholder="请输入设备编号"
8 9 10 11 12
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
13 14 15 16
      <el-form-item label="设备类型" prop="deviceType">
        <el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable size="small">
          <el-option label="流量计" value="3" />
          <el-option label="压力表" value="4" />
17 18 19 20 21 22 23 24 25 26
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
27 28 29 30 31 32 33 34
      <el-table-column label="设备名称" align="center" prop="deviceName" />
      <el-table-column label="设备编号" align="center" prop="deviceCode" />
      <el-table-column label="设备类型" align="center" prop="deviceType" >
        <template slot-scope="scope">
          <span v-if="scope.row.deviceType == '3'">流量计</span>
          <span v-if="scope.row.deviceType == '4'">压力表</span>
        </template>
      </el-table-column>
35 36 37 38 39 40 41
      <el-table-column label="标况累计量" align="center" prop="standardConditionAccumulation" />
      <el-table-column label="工况累计量" align="center" prop="workingConditionAccumulation" />
      <el-table-column label="剩余量" align="center" prop="residualQuantity" />
      <el-table-column label="标况流量" align="center" prop="standardConditionFlow" />
      <el-table-column label="工况流量" align="center" prop="workingConditionFlow" />
      <el-table-column label="温度" align="center" prop="temperature" />
      <el-table-column label="压力" align="center" prop="pressure" />
42 43
      <el-table-column label="上报时间" align="center" prop="reportTime" />
      <el-table-column label="设备状态" align="center" prop="deviceStatus" >
44
      </el-table-column>
45
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
46
        <template slot-scope="scope">
47 48 49 50 51
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="showDetail(scope.row)"
52
            v-hasPermi="['system:data:export']"
53
          >详情</el-button>
54
        </template>
55
      </el-table-column>
56 57 58 59 60 61 62 63 64 65 66 67 68 69
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

  </div>
</template>

<script>
70
import { listData } from "@/api/dataMonitoring/reportData";
71 72

export default {
73
  name: "ReportData",
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
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 设备监控表格数据
      dataList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deviceNum: null,
        standardConditionAccumulation: null,
        workingConditionAccumulation: null,
        residualQuantity: null,
        standardConditionFlow: null,
        workingConditionFlow: null,
        temperature: null,
        pressure: null,
        reportTime: null,
        communicationStatus: null,
        deviceStatus: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询设备监控列表 */
    getList() {
      this.loading = true;
      listData(this.queryParams).then(response => {
        this.dataList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        deviceReportDataId: null,
        deviceNum: null,
        standardConditionAccumulation: null,
        workingConditionAccumulation: null,
        residualQuantity: null,
        standardConditionFlow: null,
        workingConditionFlow: null,
        temperature: null,
        pressure: null,
        reportTime: null,
        communicationStatus: "0",
        deviceStatus: "0",
        createTime: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.deviceReportDataId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
175 176 177 178 179 180 181 182 183
    /** 工单详细信息跳转 */
    showDetail(row) {
      this.$router.push({
        path: '/reportData/reportdetail',
        query:{
          orderId : row.orderId
        }
      }) //带参跳转
    },
184 185 186
  }
};
</script>