签到记录

master
lion 3 months ago
parent 6cfd7b7c87
commit 163f25875b

@ -95,14 +95,17 @@
<!-- 数据表格 --> <!-- 数据表格 -->
<div class="table-section"> <div class="table-section">
<h3><i class="el-icon-s-grid" /> 签到记录</h3> <h3><i class="el-icon-s-grid" /> 签到记录
<span style="color: #999;font-size: 16px;margin-left: 10px;">已签到<span style="color: #409EFF;">{{ course_content_check_count }}</span>未签到<span style="color: red;">{{ course_content_check_count_no }}</span></span>
</h3>
<xy-table <xy-table
ref="signTable" ref="signTable"
:height="400" :height="400"
:action="getSignList" :list="list"
:req-opt="tableReqOpt" :req-opt="tableReqOpt"
:table-item="tableColumns" :table-item="tableColumns"
:is-page="true" :is-page="true"
:total="total"
/> />
</div> </div>
</el-dialog> </el-dialog>
@ -135,7 +138,11 @@ export default {
data() { data() {
return { return {
isShow: false, isShow: false,
course_content_check_count:0,
course_content_check_count_no:0,
searchForm: { searchForm: {
page: 1,
page_size: 10,
name: '', name: '',
mobile: '', mobile: '',
has_check: '' has_check: ''
@ -144,6 +151,8 @@ export default {
course_id: this.courseId, course_id: this.courseId,
course_content_id: this.courseContentId || '' course_content_id: this.courseContentId || ''
}, },
list:[],
total:0,
tableColumns: [ tableColumns: [
{ {
prop: 'user.name', prop: 'user.name',
@ -176,7 +185,7 @@ export default {
{ {
prop: 'course_content_check.created_at', prop: 'course_content_check.created_at',
label: '签到时间', label: '签到时间',
align: 'center', align: 'center'
// width: 180 // width: 180
} }
] ]
@ -271,6 +280,8 @@ export default {
// //
resetForm() { resetForm() {
this.searchForm = { this.searchForm = {
page: 1,
page_size: 10,
name: '', name: '',
mobile: '', mobile: '',
has_check: '' has_check: ''
@ -279,14 +290,20 @@ export default {
// //
refreshTable() { refreshTable() {
if (this.$refs.signTable) { this.fetchSignList()
this.$refs.signTable.getTableData(true)
}
}, },
// //
getSignList(params) { async fetchSignList(params) {
return getSignList(params) const res = await getSignList({
...this.searchForm,
course_id: this.courseId,
course_content_id: this.courseContentId || '',
})
this.list = res.list.data
this.course_content_check_count = res.course_content_check_count
this.course_content_check_count_no = res.list.total - res.course_content_check_count
this.total = res.list.total
} }
} }
} }

Loading…
Cancel
Save