You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

396 lines
14 KiB

2 years ago
<template>
<div>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-input v-model="select.name" placeholder="请输入课程名称"></el-input>
</div>
<div>
4 months ago
<el-date-picker unlink-panels @change="changeDateRange" v-model="select.dateRange" type="daterange" range-separator=""
2 years ago
value-format="yyyy-MM-dd" format="yyyy-MM-dd" start-placeholder="开课日期" end-placeholder="结束日期">
2 years ago
</el-date-picker>
</div>
<div>
4 months ago
<el-select filterable v-model="select.type" placeholder="请选择课程体系" clearable>
2 years ago
<el-option v-for="item in courseTypesList" :key="item.id" :label="item.name" :value="item.id">
2 years ago
</el-option>
</el-select>
</div>
4 months ago
<div>
<el-select v-model="select.is_chart" placeholder="课程是否统计" clearable style="width: 150px;">
<el-option label="否" :value="0"></el-option>
<el-option label="是" :value="1"></el-option>
</el-select>
</div>
2 years ago
<div>
6 months ago
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
2 years ago
<el-button type="primary" size="small" @click="resetSelect"></el-button>
2 years ago
</div>
</div>
</div>
</lx-header>
</div>
</div>
<div>
4 months ago
<div v-if="statisticsTotal" class="statistics-row" style="margin: 15px 0; padding: 15px; background: #f5f7fa; border-radius: 4px; display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 50px;">
4 months ago
<div v-for="item in statisticsFields" :key="item.prop" class="stat-item" style="text-align: center;">
<div style="font-size: 14px; color: #909399; margin-bottom: 5px;">{{ item.label }}</div>
<div style="font-size: 18px; font-weight: bold; color: #409EFF;">{{ statisticsTotal[item.prop] || 0 }}</div>
</div>
</div>
6 months ago
<xy-table :list="list" :total="total" :showIndexFixed="'left'"
2 years ago
@pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :table-item="table_item">
2 years ago
<template v-slot:dateRange>
<el-table-column align='center' label="开课日期" width="200" header-align="center">
6 months ago
<template slot-scope="scope">
<div>
{{scope.row.start_date?scope.row.start_date+'至'+scope.row.end_date:''}}
2 years ago
</div>
2 years ago
</template>
</el-table-column>
</template>
2 years ago
<template v-slot:course_signs_count>
2 years ago
<el-table-column align='center' label="目前报名人数" width="120" header-align="center">
<template slot-scope="scope">
2 years ago
<div v-if="scope.row.course_signs_count && scope.row.course_signs_count>0" style="cursor: pointer;color:blue;text-decoration:underline"
2 years ago
@click="toApply(scope.row,'')">
2 years ago
{{scope.row.course_signs_count}}
6 months ago
</div>
2 years ago
<div v-else style="cursor: pointer;text-decoration:underline" @click="toApply(scope.row,'')">0</div>
2 years ago
</template>
</el-table-column>
6 months ago
</template>
<template v-slot:sign_wait_total>
<el-table-column align='center' label="待审核人数" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.sign_wait_total && scope.row.sign_wait_total>0" style="cursor: pointer;color:blue;text-decoration:underline"
@click="toApply(scope.row,0)">
{{scope.row.sign_wait_total}}
</div>
<div v-else style="cursor: pointer;text-decoration:underline" @click="toApply(scope.row,0)">0</div>
</template>
</el-table-column>
2 years ago
</template>
2 years ago
<template v-slot:sign_pass_total>
2 years ago
<el-table-column align='center' label="审核通过人数" width="120" header-align="center">
<template slot-scope="scope">
2 years ago
<div v-if="scope.row.sign_pass_total && scope.row.sign_pass_total>0" style="cursor: pointer;color:blue;text-decoration:underline"
6 months ago
@click="toApply(scope.row,1)">{{scope.row.sign_pass_total}}</div>
2 years ago
<div v-else style="cursor: pointer;text-decoration:underline" @click="toApply(scope.row,1)">0</div>
2 years ago
</template>
</el-table-column>
</template>
2 years ago
<template v-slot:sign_fault_total>
2 years ago
<el-table-column align='center' label="审核不通过人数" width="120" header-align="center">
<template slot-scope="scope">
2 years ago
<div v-if="scope.row.sign_fault_total && scope.row.sign_fault_total>0" style="cursor: pointer;color:blue;text-decoration:underline"
2 years ago
@click="toApply(scope.row,2)">
2 years ago
{{scope.row.sign_fault_total}}
6 months ago
</div>
2 years ago
<div v-else style="cursor: pointer;text-decoration:underline" @click="toApply(scope.row,2)">0</div>
2 years ago
</template>
</el-table-column>
6 months ago
</template>
<template v-slot:sign_prepare_total>
3 weeks ago
<el-table-column align='center' label="面试候选人数" width="120" header-align="center">
6 months ago
<template slot-scope="scope">
<div v-if="scope.row.sign_prepare_total && scope.row.sign_prepare_total>0" style="cursor: pointer;color:blue;text-decoration:underline"
@click="toApply(scope.row,3)">
{{scope.row.sign_prepare_total}}
</div>
<div v-else style="cursor: pointer;text-decoration:underline" @click="toApply(scope.row,3)">0</div>
</template>
</el-table-column>
</template>
<template v-slot:sign_cancel_total>
<el-table-column align='center' label="已取消人数" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.sign_cancel_total && scope.row.sign_cancel_total>0" style="cursor: pointer;color:blue;text-decoration:underline"
@click="toApply(scope.row,4)">
{{scope.row.sign_cancel_total}}
</div>
<div v-else style="cursor: pointer;text-decoration:underline" @click="toApply(scope.row,4)">0</div>
</template>
</el-table-column>
</template>
<template v-slot:sign_give_up_total>
<el-table-column align='center' label="主动放弃人数" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.sign_give_up_total && scope.row.sign_give_up_total>0" style="cursor: pointer;color:blue;text-decoration:underline"
@click="toApply(scope.row,5)">
{{scope.row.sign_give_up_total}}
</div>
<div v-else style="cursor: pointer;text-decoration:underline" @click="toApply(scope.row,5)">0</div>
</template>
</el-table-column>
</template>
<template v-slot:sign_black_total>
<el-table-column align='center' label="黑名单人数" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.sign_black_total && scope.row.sign_black_total>0" style="cursor: pointer;color:blue;text-decoration:underline"
@click="toApply(scope.row,6)">
{{scope.row.sign_black_total}}
</div>
<div v-else style="cursor: pointer;text-decoration:underline" @click="toApply(scope.row,6)">0</div>
</template>
</el-table-column>
2 years ago
</template>
2 years ago
2 years ago
<template v-slot:btns>
<div></div>
</template>
2 years ago
</xy-table>
</div>
</div>
</template>
<script>
2 years ago
import myMixins from "@/mixin/selectMixin.js";
import {
index
6 months ago
} from "@/api/course/index.js"
import {
index as indexType
2 years ago
} from "@/api/course/courseType.js"
2 years ago
export default {
2 years ago
mixins: [myMixins],
components: {},
2 years ago
data() {
return {
6 months ago
dateRange: [],
2 years ago
courseTypesList:[],
2 years ago
select: {
name: '',
2 years ago
dateRange: '',
type: "",
4 months ago
is_chart: '',
2 years ago
page: 1,
page_size: 10,
2 years ago
},
2 years ago
list: [],
2 years ago
total: 0,
4 months ago
statisticsTotal: null,
statisticsFields: [
{
prop: 'course_signs_count',
label: '目前报名人数'
},
{
prop: 'sign_wait_total',
label: '待审核人数'
},
{
prop: 'sign_pass_total',
label: '审核通过人数'
},
{
prop: 'sign_fault_total',
label: '审核不通过人数'
},
{
prop: 'sign_prepare_total',
3 weeks ago
label: '面试候选人数'
4 months ago
},
{
prop: 'sign_cancel_total',
label: '已取消人数'
},
{
prop: 'sign_give_up_total',
label: '主动放弃人数'
},
{
prop: 'sign_black_total',
label: '黑名单人数'
}
],
2 years ago
table_item: [{
2 years ago
prop: 'name',
label: '课程名称',
6 months ago
align: 'left',
2 years ago
fixed:'left'
2 years ago
}, {
prop: 'dateRange',
label: '开课日期',
align: 'center',
width: 180,
}, {
2 years ago
prop: 'type_detail.name',
2 years ago
label: '课程体系',
2 years ago
align: 'center',
width: 180,
}, {
prop: 'total',
label: '拟开课人数',
align: 'center',
width: 120,
}, {
2 years ago
prop: 'course_signs_count',
2 years ago
label: '目前报名人数',
align: 'center',
2 years ago
width: 120
6 months ago
},
{
prop: 'sign_wait_total',
label: '待审核人数',
align: 'center',
width: 120
2 years ago
},
{
2 years ago
prop: 'sign_pass_total',
2 years ago
label: '审核通过人数',
align: 'center',
2 years ago
width: 120
2 years ago
},
{
2 years ago
prop: 'sign_fault_total',
2 years ago
label: '审核不通过人数',
align: 'center',
2 years ago
width: 120
6 months ago
},
{
prop: 'sign_prepare_total',
3 weeks ago
label: '面试候选人数',
6 months ago
align: 'center',
width: 120
},
{
prop: 'sign_cancel_total',
label: '已取消人数',
align: 'center',
width: 120
},
{
prop: 'sign_give_up_total',
label: '主动放弃人数',
align: 'center',
width: 120
},
{
prop: 'sign_black_total',
label: '黑名单人数',
align: 'center',
width: 120
2 years ago
}]
2 years ago
}
},
created() {
6 months ago
this.getList()
2 years ago
this.getTypes()
2 years ago
},
6 months ago
methods: {
pageIndexChange(e){
this.select.page = e
this.getList()
},
pageSizeChange(e){
this.select.page_size = e
this.select.page = 1
this.getList()
},
resetSelect(){
this.select.name = ''
this.select.type = ''
this.select.dateRange = ''
4 months ago
this.select.is_chart = ''
6 months ago
this.select.page=1
this.getList()
2 years ago
},
2 years ago
async getList() {
4 months ago
const filter = [{
key: 'name',
op: 'like',
value: this.select.name
}, {
key: 'type',
op: 'eq',
value: this.select.type
}, {
key: 'start_date',
op: 'range',
value: this.select.dateRange?this.select.dateRange.join(","):''
}]
// 只有当 is_chart 不为空时才添加该查询条件
if (this.select.is_chart !== '') {
filter.push({
key: 'is_chart',
op: 'eq',
value: this.select.is_chart
})
}
2 years ago
const res = await index({
page: this.select.page,
6 months ago
page_size: this.select.page_size,
show_relation: ['typeDetail'],
sort_name:'start_date',
2 years ago
sort_type:'DESC',
4 months ago
filter: filter
2 years ago
})
this.list = res.data
this.total = res.total
4 months ago
// 保存统计数据
if (res.statistics_total) {
this.statisticsTotal = res.statistics_total
} else {
this.statisticsTotal = null
}
6 months ago
},
getTypes() {
indexType({
page: 1,
page_size: 999,
sort_name:'id',
sort_type:'ASC',
}).then(res => {
// this.courseTypesList = res.data.filter(item => item.status === 1)
this.courseTypesList = res.data
})
2 years ago
},
changeDateRange(e) {
if (e) {
6 months ago
this.select.dateRange = e
2 years ago
} else {
this.select.dateRange = ''
}
},
2 years ago
toApply(row,status) {
2 years ago
this.$router.push({
path: '/course/apply_list',
6 months ago
query: {
2 years ago
status:status,
2 years ago
title: row.name,
id: row.id,
2 years ago
date: row.start_date?row.start_date + '至' + row.end_date:'',
2 years ago
leibie: row.type_detail.name
2 years ago
}
})
2 years ago
},
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
6 months ago
</style>