Blame view

src/views/standard/device/error.vue 5.3 KB
8ef22809   梁保满   软件下载页面添加.net环境下载
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  <template>
    <div>
      <back-box>
        <template slot="title">
          <span>异常设备信息</span>
        </template>
      </back-box>
      <div class="page-content">
        <el-table :data="tableData" border style="width: 100%">
          <el-table-column
            prop="sn"
            label="设备编码"
            align="center"
            width="160"
          ></el-table-column>
d4b9eb45   梁保满   设备异常信息
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
          <el-table-column prop="abnormalSource" label="设备类型" align="center">
            <template slot-scope="scoped">
              {{
                scoped.row.abnormalSource == 0
                  ? "无"
                  : scoped.row.abnormalSource == 1
                  ? "云平台"
                  : scoped.row.abnormalSource == 2
                  ? "授课端"
                  : scoped.row.abnormalSource == 3
                  ? "出厂工具"
                  : "发卡工具"
              }}
            </template>
          </el-table-column>
          <el-table-column label="异常类型" align="center">
            <template slot-scope="scoped">
              {{
                scoped.row.status == 0
                  ? "正常"
                  : scoped.row.status == 1
                  ? "低电量异常"
                  : scoped.row.status == 2
                  ? "配对码异常"
                  : "关联班级异常"
              }}
            </template></el-table-column
          >
          <template v-if="type == 1">
            <el-table-column
              prop="pairingCode"
              label="配对码"
              align="center"
            ></el-table-column>
            <el-table-column label="关联班级" align="center">
              <template slot-scope="scoped">
                <p v-for="(item, index) in scoped.row.classList" :key="index">
                  {{ item.className }}
                </p>
              </template>
            </el-table-column>
          </template>
8ef22809   梁保满   软件下载页面添加.net环境下载
58
          <el-table-column
d4b9eb45   梁保满   设备异常信息
59
            prop="modifiedTime"
8ef22809   梁保满   软件下载页面添加.net环境下载
60
61
62
63
64
            label="最早发现时间"
            align="center"
            width="200"
          ></el-table-column>
          <el-table-column
d4b9eb45   梁保满   设备异常信息
65
66
            prop="answerTimes"
            label="答题次数"
8ef22809   梁保满   软件下载页面添加.net环境下载
67
68
69
            align="center"
          ></el-table-column>
          <el-table-column
d4b9eb45   梁保满   设备异常信息
70
            prop="abnormalRemark"
8ef22809   梁保满   软件下载页面添加.net环境下载
71
72
73
            label="状态"
            align="center"
          ></el-table-column>
d4b9eb45   梁保满   设备异常信息
74
          <el-table-column label="操作" align="center" width="100"
8ef22809   梁保满   软件下载页面添加.net环境下载
75
            ><template slot-scope="scoped">
d4b9eb45   梁保满   设备异常信息
76
77
78
79
80
              <el-link
                :disabled="scoped.row.abnormalRemark"
                @click="openDia(scoped.row)"
                >处理</el-link
              ></template
8ef22809   梁保满   软件下载页面添加.net环境下载
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
            ></el-table-column
          >
        </el-table>
        <div class="pagination-box">
          <el-pagination
            small=""
            layout="total,prev, pager, next"
            :hide-on-single-page="true"
            :total="total"
            @current-change="changePage"
            :current-page="page"
            :page-size="size"
          >
          </el-pagination>
        </div>
      </div>
d4b9eb45   梁保满   设备异常信息
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
      <el-dialog title="备注" :visible.sync="diaNotes" width="400">
        <el-form ref="formClass" label-width="100px">
          <el-form-item label="处理备注:" prop="studentName">
            <el-col :span="12">
              <el-input
                type="textarea"
                :rows="3"
                maxlength="200"
                v-model="ntoes"
              />
            </el-col>
          </el-form-item>
        </el-form>
        <div class="dialog-footer" slot="footer">
          <el-button @click="_SaveNotes" type="primary">确 定</el-button>
          <el-button @click="diaNotes = false">取 消</el-button>
        </div>
      </el-dialog>
8ef22809   梁保满   软件下载页面添加.net环境下载
115
116
117
118
119
120
121
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
d4b9eb45   梁保满   设备异常信息
122
123
124
125
126
127
        role: "",
        loading: false,
        diaNotes: false,
        ntoes: "",
        deviceId: "",
        type: 1,
8ef22809   梁保满   软件下载页面添加.net环境下载
128
129
130
131
132
133
134
        tableData: [],
        total: 0,
        page: 1,
        size: 20,
      };
    },
    created() {
d4b9eb45   梁保满   设备异常信息
135
136
137
138
139
      this.type = this.$route.query.type;
      this.role =
        this.$store.getters.info.showRole ||
        this.$store.getters.info.permissions[0].role;
      this._QueryData();
8ef22809   梁保满   软件下载页面添加.net环境下载
140
141
142
143
144
145
    },
    methods: {
      changePage(page) {
        this.page = page;
        this._QueryData();
      },
d4b9eb45   梁保满   设备异常信息
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
      openDia(obj) {
        this.diaNotes = true;
        this.deviceId = obj.id;
        this.ntoes = "";
      },
      async _SaveNotes() {
        if (!this.ntoes.trim()) {
          this.$message.warning("请填写备注内容!");
          return;
        }
        const { status, info } = await this.$request.abnormalRemark({
          deviceId: this.deviceId,
          abnormalRemark: this.ntoes,
        });
        if (status === 0) {
          this.ntoes = "";
          this.diaNotes = false;
          this._QueryData();
        } else {
          this.$message.error(info);
        }
      },
8ef22809   梁保满   软件下载页面添加.net环境下载
168
169
      async _QueryData() {
        this.loading = true;
d4b9eb45   梁保满   设备异常信息
170
171
172
173
174
175
176
177
        const deviceList =
          this.role != "ROLE_JITUAN"
            ? this.$request.deviceList
            : this.$request.tenantDeviceList;
        this.tableData = [];
        const { data, status, info } = await deviceList({
          status: 1,
          deviceType: this.type,
8ef22809   梁保满   软件下载页面添加.net环境下载
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
          page: this.page,
          size: this.size,
        });
        this.loading = false;
        if (status === 0) {
          this.tableData = (data?.list && [...data?.list]) || [];
          this.total = data.count;
        } else {
          this.$message.error(info);
        }
      },
    },
  };
  </script>
  
  <style lang="scss" scoped>
  .page-content {
    padding: 20px;
  }
  </style>