|
|
|
|
@ -10,7 +10,7 @@
|
|
|
|
|
<el-input v-model="select.name" placeholder="请输入课程名称"></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-date-picker @change="changeDateRange" v-model="dateRange" type="daterange" range-separator="至"
|
|
|
|
|
<el-date-picker unlink-panels @change="changeDateRange" v-model="dateRange" type="daterange" range-separator="至"
|
|
|
|
|
value-format="yyyy-MM-dd" format="yyyy-MM-dd" start-placeholder="开课日期" end-placeholder="结束日期">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
@ -26,6 +26,12 @@
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
<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>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" size="small" @click="select.page=1,getList()">查询</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
@ -125,6 +131,7 @@
|
|
|
|
|
dateRange: '',
|
|
|
|
|
type: "",
|
|
|
|
|
course_status: '',
|
|
|
|
|
is_chart: '',
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 10,
|
|
|
|
|
},
|
|
|
|
|
@ -193,38 +200,62 @@
|
|
|
|
|
this.select.name = ''
|
|
|
|
|
this.select.type = ''
|
|
|
|
|
this.select.course_status = ''
|
|
|
|
|
this.select.is_chart = ''
|
|
|
|
|
this.select.dateRange = ''
|
|
|
|
|
this.select.page=1
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
async getList() {
|
|
|
|
|
const filter = []
|
|
|
|
|
|
|
|
|
|
if (this.select.name) {
|
|
|
|
|
filter.push({
|
|
|
|
|
key: 'name',
|
|
|
|
|
op: 'like',
|
|
|
|
|
value: this.select.name
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.select.type !== '' && this.select.type !== null) {
|
|
|
|
|
filter.push({
|
|
|
|
|
key: 'type',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: this.select.type
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.select.course_status !== '' && this.select.course_status !== null) {
|
|
|
|
|
filter.push({
|
|
|
|
|
key: 'course_status',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: this.select.course_status
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.select.dateRange) {
|
|
|
|
|
filter.push({
|
|
|
|
|
key: 'start_date',
|
|
|
|
|
op: 'range',
|
|
|
|
|
value: this.select.dateRange
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 只有 is_chart 不为空时才添加(0 和 1 都需要传递)
|
|
|
|
|
if (this.select.is_chart !== '' && this.select.is_chart !== null && this.select.is_chart !== undefined) {
|
|
|
|
|
filter.push({
|
|
|
|
|
key: 'is_chart',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: this.select.is_chart
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const res = await index({
|
|
|
|
|
page: this.select.page,
|
|
|
|
|
page_size: this.select.page_size,
|
|
|
|
|
show_relation: ['type_detail'],
|
|
|
|
|
sort_name: 'start_date',
|
|
|
|
|
sort_type: 'DESC',
|
|
|
|
|
// course_status:this.select.course_status,
|
|
|
|
|
filter: [{
|
|
|
|
|
key: 'name',
|
|
|
|
|
op: 'like',
|
|
|
|
|
value: this.select.name
|
|
|
|
|
}, {
|
|
|
|
|
key: 'type',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: this.select.type
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'course_status',
|
|
|
|
|
op: 'eq',
|
|
|
|
|
value: this.select.course_status
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: 'start_date',
|
|
|
|
|
op: 'range',
|
|
|
|
|
value: this.select.dateRange
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
filter: filter
|
|
|
|
|
})
|
|
|
|
|
this.list = res.data
|
|
|
|
|
this.total = res.total
|
|
|
|
|
|