lion 2 years ago
parent 85118e4411
commit 480a4c3c77

@ -0,0 +1,59 @@
import request from "@/utils/request";
function customParamsSerializer(params) {
let result = '';
for (let key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
params[key].forEach((item,index) => {
if(item.key){
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
}else{
result +=`${key}[${index}]=${item}&`
}
});
} else {
result += `${key}=${params[key]}&`;
}
}
}
return result.slice(0, -1);
}
export function index(params,isLoading = false) {
return request({
method: "get",
url: "/api/admin/course-appointment-total/index",
params,
paramsSerializer: customParamsSerializer,
isLoading
})
}
export function show(params, isLoading = true) {
return request({
method: "get",
url: "/api/admin/course-appointment-total/show",
params,
isLoading
})
}
export function save(data) {
return request({
method: "post",
url: "/api/admin/course-appointment-total/save",
data
})
}
export function destroy(params) {
return request({
method: "get",
url: "/api/admin/course-appointment-total/destroy",
params
})
}

@ -171,6 +171,10 @@ export default {
id: 3,
value: '取消',
type: 'info'
}, {
id: 4,
value: '失败',
type: 'info'
}],
// 考勤
keep_options: [{

@ -35,14 +35,23 @@
<template v-slot:real_name>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>小程序展示名称
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>实际名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.real_name" placeholder="请输入小程序展示名称" clearable style="width: 100%;"></el-input>
<el-input v-model="form.real_name" placeholder="请输入实际名称" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:address>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>所在楼层
</div>
<div class="xy-table-item-content">
<el-input v-model="form.address" placeholder="请输入所在楼层" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:appointment_type_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
@ -180,6 +189,7 @@
sort:0,
name: '',
real_name:'',
address:'',
appointment_type_id:'',
content: '',
total: '',

@ -24,7 +24,7 @@
<div class="xy-table-item-content">
<el-select v-model="form.user_id" @change="changeUser" style="width:100%"
:multiple="type==='more'?true:false" filterable remote reserve-keyword
:placeholder="type==='more'?'请选择无需预约的学员,不选则全部预约':'请选择学员'"
:placeholder="type==='more'?'请选择无需预约的学员,不选则全部预约':'请选择学员或查找学员'"
:remote-method="remoteMethod" :loading="loading">
<el-option v-for="item in user_options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
@ -52,7 +52,7 @@
</div>
</div>
</template>
<template v-slot:date>
<!-- <template v-slot:date>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>预约日期
@ -63,17 +63,17 @@
</el-date-picker>
</div>
</div>
</template>
</template> -->
<template v-slot:timeRange>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>时间
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>预约时间
</div>
<div class="xy-table-item-content">
<el-time-picker is-range v-model="form.timeRange" style="width:100%" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围" value-format="HH:mm:ss"
format="HH:mm:ss">
</el-time-picker>
<el-date-picker type="datetimerange" @change="changeTimeRange" v-model="form.timeRange" style="width:100%" range-separator=""
start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围" value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</div>
</div>
</template>
@ -182,10 +182,10 @@
// required: true,
// message: ''
// }],
date: [{
required: true,
message: '请选择预约日期'
}],
// date: [{
// required: true,
// message: ''
// }],
mobile: [{
required: true,
message: '请输入联系方式'
@ -206,11 +206,24 @@
this.getUserList('')
this.getSites()
},
methods: {
methods: {
changeTimeRange(e){
console.log(e)
if(e){
this.form.start_time = e[0]
this.form.end_time = e[1]
this.form.date = this.formatDate(e[0])
console.log(this.form.date,this.form.start_time,this.form.end_time)
}else{
this.form.start_time = ''
this.form.end_time = ''
this.form.date = ''
this.form.timeRange = ''
}
},
submit(status) {
this.form.status = 1
this.form.start_time = this.form.date + " " + this.form.timeRange[0]
this.form.end_time = this.form.date + " " + this.form.timeRange[1]
console.log(this.form)
if (this.type === 'add') {
if (this.base.isNull(this.form.user_id) && this.base.isNull(this.form.name)) {
@ -260,7 +273,7 @@
this.form = this.base.requestToForm(res, this.form)
this.form.status = res.status ? res.status : 0
this.form.site = res.site?parseInt(res.site):''
this.form.timeRange = [this.formatHH(res.start_time), this.formatHH(res.end_time)]
this.form.timeRange = [res.start_time, res.end_time]
})
},
formatHH(val) {
@ -269,6 +282,13 @@
} else {
return ''
}
},
formatDate(val) {
if (val) {
return this.$moment(val).format("YYYY-MM-DD")
} else {
return ''
}
},
changeUser(e) {
if (e) {

@ -1,14 +1,56 @@
<template>
<div>
<xy-dialog ref="dialog" :width="30" :is-show.sync="isShow" :type="'form'" title="预约次数调整"
:form="form" :rules='rules' @submit="submit">
<template v-slot:appointment_total>
<xy-dialog ref="dialog" :width="50" :is-show.sync="isShow" :type="'form'" title="预约次数调整" :form="form" :rules='rules'
@submit="submit">
<template v-slot:course_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>所属课程
</div>
<div class="xy-table-item-content">
{{form.course_id}}
</div>
</div>
</template>
<template v-slot:user_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>姓名
</div>
<div class="xy-table-item-content">
{{form.user_id}}
</div>
</div>
</template>
<template v-slot:total>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>可预约总数
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>可预约
</div>
<div class="xy-table-item-content">
<el-input type="number" v-model="form.appointment_total"></el-input>
<div class="xy-table-item-content">
<el-input type="number" style="width:100%" v-model="form.total"></el-input>
</div>
</div>
</template>
<template v-slot:start_time>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>开始日期
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.start_time" style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:end_time>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>结束日期
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.end_time" style="width:100%" format="yyyy-MM-dd" value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
</el-date-picker>
</div>
</div>
</template>
@ -18,9 +60,14 @@
</div>
</template>
<script>
<script>
// import {
// save
// } from "@/api/student/index.js"
import {save} from "@/api/student/index.js"
import {
save
} from '@/api/book/count.js'
export default {
components: {
@ -28,20 +75,23 @@
data() {
return {
isShow: false,
form: {
appointment_total: '',
},
form: {
course_id:'',
user_id:"",
total: '',
start_time: '',
end_time: '',
},
rules: {
appointment_total: [{
total: [{
required: true,
message: '请填写总次数'
message: '请填可预约次数'
}]
}
}
},
created() {
},
created() {},
methods: {
submit() {
save({
@ -57,12 +107,12 @@
},
setRow(row) {
this.form = this.base.requestToForm(row,this.form)
},
this.form = this.base.requestToForm(row, this.form)
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (newVal) {
} else {
this.$refs['dialog'].reset()
@ -74,7 +124,5 @@
</script>
<style scoped lang="scss">
::v-deep .teacher_id{
flex-basis: 100%;
}
</style>

@ -10,12 +10,12 @@
<div class="xy-table-item-content" style="flex-grow:1;text-align:center">
<div class="bookInfo">
<div>
<span>预约日期</span>
<span>{{submitObj.date}}</span>
<span>预约开始时间</span>
<span>{{submitObj.start_time}}</span>
</div>
<div>
<span>时间</span>
<span>{{formatHH(submitObj.start_time)}}-{{formatHH(submitObj.end_time)}}</span>
<span>预约结束时间</span>
<span>{{submitObj.end_time}}</span>
</div>
<div>
<span>预约事项</span>

@ -10,26 +10,22 @@
<div>
<div>
<el-input v-model="select.name" placeholder="请输入姓名"></el-input>
</div>
<!-- <div>
<el-input v-model="select.course_name" placeholder="请输入课程名称"></el-input>
</div> -->
<div>
<el-select clearable v-model="select.course_id" placeholder="请选择课程">
<el-option
v-for="item in course_options"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<!-- <div>
<el-input v-model="select.course_name" placeholder="请输入课程名称"></el-input>
</div> -->
<div>
<el-select clearable v-model="select.course_id" placeholder="请选择课程">
<el-option v-for="item in course_options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
<div>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
<el-button type="primary" size="small" @click="resetSelect"></el-button>
<el-button type="primary" size="small" @click="select.page=1,getList()"></el-button>
<el-button type="primary" size="small" @click="resetSelect"></el-button>
</div>
</div>
</div>
</div>
@ -39,8 +35,26 @@
<div>
<xy-table :list="list" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :total="total"
:table-item="table_item">
<template v-slot:appointments_count>
:table-item="table_item">
<template v-slot:start_time>
<el-table-column align='center' label="开始日期" header-align="center" width="120">
<template slot-scope="scope">
<div v-if="scope.row.start_time">
{{scope.row.start_time.substring(0,10)}}
</div>
</template>
</el-table-column>
</template>
<template v-slot:end_time>
<el-table-column align='center' label="结束日期" header-align="center" width="120">
<template slot-scope="scope">
<div v-if="scope.row.end_time">
{{scope.row.end_time.substring(0,10)}}
</div>
</template>
</el-table-column>
</template>
<!-- <template v-slot:appointments_count>
<el-table-column align='center' label="已预约次数" header-align="center" width="120">
<template slot-scope="scope">
<div @click="showCounts(scope.row.name)" v-if="scope.row.appointments_count>0"
@ -57,16 +71,16 @@
</div>
</template>
</el-table-column>
</template>
<template v-slot:course_list>
<el-table-column align='left' label="课程名称" header-align="center">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.courses">
<div>{{item.name}}</div>
</div>
</template>
</el-table-column>
</template>
</template>
<template v-slot:course_list>
<el-table-column align='left' label="课程名称" header-align="center">
<template slot-scope="scope">
<div v-for="(item,index) in scope.row.course_signs">
<div>{{item.course.name}}</div>
</div>
</template>
</el-table-column>
</template> -->
<template v-slot:btns>
<el-table-column align='center' label="操作" fixed="right" width="80" header-align="center">
@ -86,64 +100,72 @@
import addCount from './components/addCount.vue';
import showCount from './components/showCount.vue';
import {
indexStudy
} from '@/api/student/index.js'
import {
index as courseIndex
index
} from '@/api/book/count.js'
import {
index as courseIndex
} from "@/api/course/index.js"
export default {
components: {
addCount,
addCount,
showCount
},
data() {
return {
select: {
name: '',
course_name:'',
course_id:'',
name: '',
course_name: '',
course_id: '',
page: 1,
page_size: 10,
},
course_options:[{
label:'进行中',
value:1
},{
label:'其他',
value:0
}],
list: [],
total:0,
table_item: [{
prop: 'course_list',
label: '课程名称',
align: 'left',
},{
prop: 'username',
label: '预约人',
align: 'center',
width:120
}, {
prop: 'appointment_total',
label: '可预约总数',
align: 'center',
width:120
}, {
prop: 'appointments_count',
label: '已预约次数',
align: 'center',
width:120
}, {
prop: 'appointments_can',
label: '预约剩余次数',
align: 'center',
width:120
}]
},
course_options: [],
list: [],
total: 0,
table_item: [{
prop: 'course.name',
label: '课程名称',
align: 'left',
}, {
prop: 'user.name',
label: '姓名',
align: 'center',
width: 120
}, {
prop: 'total',
label: '可预约次数',
align: 'center',
width: 120
},
{
prop: 'start_time',
label: '开始日期',
align: 'center',
width: 120,
},
{
prop: 'end_time',
label: '结束日期',
align: 'center',
width: 120
},
// {
// prop: 'appointments_count',
// label: '',
// align: 'center',
// width:120
// }, {
// prop: 'appointments_can',
// label: '',
// align: 'center',
// width:120
// }
]
}
},
created() {
this.getList()
this.getList()
this.getCourseList()
},
methods: {
@ -155,34 +177,36 @@
this.select.page_size = e
this.select.page = 1
this.getList()
},
async getCourseList() {
const res = await courseIndex({
page: 1,
page_size: 999,
sort_name: 'id',
sort_type: 'DESC',
})
this.course_options = res.data
},
resetSelect(){
this.select.name = ''
this.select.course_name = ''
this.select.course_id=''
this.select.page=1
this.getList()
},
async getCourseList() {
const res = await courseIndex({
page: 1,
page_size: 999,
sort_name: 'start_date',
sort_type: 'DESC',
})
this.course_options = res.data
},
resetSelect() {
this.select.name = ''
this.select.course_id = ''
this.select.page = 1
this.getList()
},
async getList() {
const res = await indexStudy({
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
page_size: this.select.page_size,
filter:[{
key:'course_id',
op:'eq',
value:this.select.course_id
}],
name: this.select.name,
course_name:this.select.course_name,
course_id: this.select.course_id
show_relation:['user','course']
})
this.list = res.list.data
this.total = res.list.total
this.list = res.data
this.total = res.total
},
editCount(row) {
this.$refs.addCount.setRow(row)

@ -55,13 +55,13 @@
</template>
</el-table-column>
</template>
<template v-slot:timerange>
<el-table-column align='center' label="预约时段" width="120" header-align="center">
<!-- <template v-slot:timerange>
<el-table-column align='center' label="预约时段" width="360" header-align="center">
<template slot-scope="scope">
{{formateHH(scope.row.start_time)}}-{{formateHH(scope.row.end_time)}}
{{scope.row.start_time}}-{{scope.row.end_time}}
</template>
</el-table-column>
</template>
</template> -->
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="操作" width="240" header-align="center">
@ -70,10 +70,11 @@
@click="checkBook('show',scope.row.id)">查看</el-button>
<el-button type="primary" size="small" v-if="scope.row.status===0"
@click="checkBook('check',scope.row.id)">审核</el-button>
<el-popconfirm style="margin-left:10px" v-if="scope.row.status!=3" @confirm="cancelBook(scope.row)" title="确定取消吗?">
<el-popconfirm style="margin-left:10px" v-if="scope.row.status!=3" @confirm="cancelBook(scope.row)"
title="确定取消吗?">
<el-button type="primary" size="small" slot="reference">取消</el-button>
</el-popconfirm>
<el-button type="primary" size="small" v-if="scope.row.status===3"
<el-button type="primary" size="small" v-if="scope.row.status===3 ||scope.row.status===4"
@click="editBook('editor',scope.row.id,)">编辑</el-button>
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
@ -96,7 +97,7 @@
import addBook from './components/addBook.vue';
import {
index,
destroy,
destroy,
save
} from "@/api/book/index.js"
import {
@ -124,15 +125,15 @@
list: [],
total: 0,
table_item: [{
prop: 'date',
label: '预约日期',
align: 'left',
width: 120,
prop: 'start_time',
label: '预约开始时间',
align: 'center',
width: 240,
}, {
prop: 'timerange',
label: '预约时段',
prop: 'end_time',
label: '预约结束时间',
align: 'center',
width: 120,
width: 240,
}, {
prop: 'content',
label: '预约事项',
@ -294,18 +295,18 @@
console.log(error)
reject(error)
})
},
cancelBook(row){
save({
...row,
status:3
}).then(res => {
this.$message({
type: 'success',
message: '取消成功'
})
this.getList()
})
},
cancelBook(row) {
save({
...row,
status: 3
}).then(res => {
this.$message({
type: 'success',
message: '取消成功'
})
this.getList()
})
}
}
}

@ -320,7 +320,11 @@
this.selectids = []
}
},
updateAllStatus(status) {
updateAllStatus(status) {
if(this.base.isNull(this.subjectObj.date)){
this.$message.warning("请先设置该课程的开课日期后再进行审核")
return
}
if (this.selectids.length < 1) {
this.$message.warning("请先选择要审核的学员")
return
@ -335,7 +339,11 @@
this.getList()
})
},
showDetail(type, row) {
showDetail(type, row) {
if(this.base.isNull(this.subjectObj.date)){
this.$message.warning("请先设置该课程的开课日期后再进行审核")
return
}
this.$refs.studentDetail.subjectObj = this.subjectObj
this.$refs.studentDetail.id = row.id
this.$refs.studentDetail.row = row

@ -354,7 +354,9 @@
this.$refs.studentDetail.isShow = true
},
exportExcel() {
let _export = {}
let _export = {
'course_signs.0.course.name':'课程名称'
}
this.selectFormList.map(item => {
if(item.prop==='index'){

Loading…
Cancel
Save