马宇豪
2025-03-04 509f1d71c91242b11fd287cfcdeafe3d19b2d807
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
<template>
  <div class="app-container">
    <el-radio-group v-model="queryParams.status" @change="changeTimeStatus" style="margin-bottom: 10px">
      <el-radio-button label="0">全部</el-radio-button>
      <el-radio-button label="2">异常记录</el-radio-button>
      <el-radio-button label="1">正常记录</el-radio-button>
    </el-radio-group>
    <div style="margin-bottom: 10px">
      <el-select v-model="queryParams.institutionId" placeholder="请选择平台" style="margin-right: 10px">
        <el-option
          v-for="item in platformList"
          :key="item.id"
          :label="item.institutionalName"
          :value="item.id">
        </el-option>
      </el-select>
      <el-input
        v-model="queryParams.idcard"
        placeholder="请输入身份证号"
        clearable
        style="width: 300px;margin-right: 10px"
      />
      <el-date-picker
        v-model="dateValue"
        value-format="yyyy-MM-dd HH:mm:ss"
        type="datetimerange"
        range-separator="-"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        style="width: 380px"
      ></el-date-picker>
      <el-button
        size="small"
        type="primary"
        style="margin-bottom: 10px;margin-left: 20px"
        @click="handleQuery()"
      >查询
      </el-button>
      <el-button
        size="small"
        type="primary"
        style="margin-bottom: 10px"
        @click="resetQuery()"
      >重置
      </el-button>
    </div>
    <el-table v-loading="loading" :data="expertList" :row-class-name="tableAddClass">
      <el-table-column label="记录编号" align="center" prop="id" />
      <el-table-column label="身份证号" align="center" prop="idcard" :show-overflow-tooltip="true" />
      <el-table-column label="上报平台" align="center" prop="institutionName" />
      <el-table-column label="所属培训机构" align="center" prop="trainOrgName" />
      <el-table-column label="班级批次" align="center" prop="batchName" />
      <el-table-column label="课程" align="center" prop="courseName" />
      <el-table-column label="章节" align="center" prop="chapterName" />
      <el-table-column label="学习时长" align="center" prop="durationDesc" />
      <el-table-column label="是否彻底完成" align="center" prop="finishStatus" >
        <template #default="scope">
          {{scope.row.finishStatus == 0 ? '未完成' : '已完成' }}
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button
            size="mini"
            type="text"
            style="color: #1890ff"
            @click="handleView(scope.row)"
          >查看详细记录</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <detail-dialog ref="detailDialogRef" @getList = "getList"></detail-dialog>
  </div>
</template>
 
<script>
import detailDialog from './components/detailDialog.vue'
import { listRecord, listStudent } from '@/api/onlineEducation/student'
import Cookies from 'js-cookie'
import {listPlatSelect} from "@/api/onlineEducation/plat";
export default {
  name: "nPeopleManage",
  dicts: [],
  components: { detailDialog},
  data() {
    return {
      loading: false,
      single: true,
      multiple: true,
      showSearch: true,
      addForm: false,
      total: 0,
      expertTypes: [],
      expertList: [],
      platformList: [],
      dateValue: [],
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        status: 0,
        institutionId: null,
        idcard: '',
        startTime: '',
        endTime: ''
      },
    };
  },
  created() {
      this.getList()
      this.getPlat()
  },
  methods: {
    getList(){
      this.loading = true
      this.queryParams.startTime = this.dateValue[0]?this.dateValue[0]:''
      this.queryParams.endTime = this.dateValue[1]?this.dateValue[1]:''
      listRecord( this.queryParams).then((res) => {
        if (res.code == 200) {
          this.expertList = res.rows
          this.total = res.total
          this.loading = false
        }
      })
    },
    getPlat() {
      listPlatSelect().then((res) => {
        if (res.code == 200) {
          this.platformList = res.data
        }
      })
    },
    changeTimeStatus(val) {
      this.getList()
    },
    tableAddClass({ row, rowIndex }) {
      if (row.difference < row.duration) {
        return "tr-red";
      }
      return "";
    },
    handleChange(){
 
    },
    handleQuery(){
      this.queryParams.pageNum = 1
      this.getList();
    },
    resetQuery(){
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        status: 0,
        institutionId: null,
        idcard: '',
        startTime: '',
        endTime: ''
      }
      this.dateValue = []
      this.getList()
    },
    handleView(data){
      this.$refs.detailDialogRef.openDialog(data);
    }
  }
};
</script>
 
<style scoped>
.app-container /deep/ .el-table .tr-red {
  color: red !important;
}
</style>