马宇豪
2025-03-07 db905ecd14f63dba9337b4f4715584ef2d7e8c7e
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
<template>
  <el-dialog
    title="学员"
    :visible.sync="dialogVisible"
    :modal-append-to-body="false"
    :close-on-click-modal="false"
    width="850px"
    :before-close="handleClose"
  >
    <el-table
      height="250"
      :data="learningTable"
      style="width: 100%;">
      <el-table-column
        prop="name"
        label="姓名"
        align="center"
      >
      </el-table-column>
      <el-table-column
        label="身份证号"
        prop="idcard"
        align="center"
        width="180" :show-overflow-tooltip="true">
      </el-table-column>
      <el-table-column
        prop="lessonTocal"
        label="总学时"
        align="center"
      >
        <template #default="scope">
          {{type == 'batch' ? scope.row.batchLessonNum : scope.row.courseLessonNum}}
        </template>
      </el-table-column>
      <el-table-column
        prop="lessonNum"
        label="已学学时"
        align="center"
      ></el-table-column>
      <el-table-column
        prop="finishStatus"
        label="是否已结束培训"
        width="175"
        align="center"
      >
        <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
            v-if="scope.row.finishStatus == 1"
            size="mini"
            type="text"
            style="color: #1890ff"
            @click="viewLessonReport(scope.row.url)"
          >查看学时报告</el-button>
        </template>
      </el-table-column>
      <el-table-column label="未达标短信提醒" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button
            v-if="scope.row.finishStatus == 0"
            size="mini"
            type="text"
            style="color: #1890ff"
            @click="sendMessage(scope.row)"
          >短信提醒</el-button>
        </template>
      </el-table-column>
    </el-table>
<!--    <pagination-->
<!--      v-show="total>0"-->
<!--      :total="total"-->
<!--      :page.sync="queryParams.pageIndex"-->
<!--      :limit.sync="queryParams.pageSize"-->
<!--      @pagination="getList"-->
<!--    />-->
    <lessonReport ref="lessonRef"></lessonReport>
  </el-dialog>
</template>
 
<script >
import lessonReport from '@/views/onlineEducation/studentSupervision/compontents/lessonReport.vue'
import { sendMessage, studentCourseDetail, studentDetail } from '@/api/onlineEducation/student'
import { listCourse } from '@/api/onlineEducation/course'
export default {
  name: 'addUser',
  components: {
    lessonReport
  },
  data() {
    return {
      dialogVisible: false,
      dialogStatus: '',
      dataForm: {},
      uuid: '',
      total: 0,
      type: '',
      queryParams: {
        pageIndex: 1,
        pageSize: 10
      },
      learningTable: [
        {
          name: '张三',
          idCard: '320154199811153355',
          totalTime: '2h',
          learnedTime: '1h',
          courseTime: '2h',
          learningTime: '1h',
          isEnd: '否'
        },
        {
          name: '李四',
          idCard: '320154194511153355',
          totalTime: '2h',
          learnedTime: '2h',
          courseTime: '2h',
          learningTime: '1h',
          isEnd: '是'
        },
      ]
    }
  },
  created() {
  },
  methods: {
    getList() {
      this.loading = true;
      if(this.type === 'course'){
        studentCourseDetail( this.uuid).then((res) => {
          if (res.code == 200) {
            this.learningTable = res.data
            this.loading = false;
            // this.total = res.data.total
          }
        })
      }else {
        studentDetail( this.uuid).then((res) => {
          if (res.code == 200) {
            this.learningTable = res.data
            this.loading = false;
            // this.total = res.data.total
          }
        })
      }
 
    },
    openDialog (data,type) {
      this.type = type;
      this.uuid = data.uuid;
      this.getList();
      this.dialogVisible = true;
    },
 
    handleClose() {
      this.dialogVisible = false;
      this.$emit("getList");
    },
    viewLessonReport(data){
      this.$refs.lessonRef.openDialog(data)
    },
    sendMessage(row){
      this.$confirm('此操作将向该学员发送短信, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        sendMessage(row.idcard).then((res) => {
          if (res.code == 200) {
            this.$message({
              message: '发送成功',
              type: 'success'
            })
            this.handleClose()
          }else {
            this.$message({
              message: res.msg,
              type: 'warning'
            })
          }
        })
      }).catch(() => {
 
      });
    }
  }
}
 
</script>
<style scoped>
 
</style>