lion 1 year ago
parent c9ff8138e0
commit bc3fee3ba0

@ -14,6 +14,8 @@
</script>
<script type="text/javascript" src='https://webapi.amap.com/maps?v=1.4.11&key=795a757114c371f42cee1f8efa527684&plugin=AMap.PlaceSearch'></script>
<script src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script src="/filejs/FileSaver.min.js"></script>
<script src="/filejs/xlsx.full.min.js"></script>
</head>
<body>
<noscript>

@ -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/appointment-configs/index",
params,
paramsSerializer: customParamsSerializer,
isLoading
})
}
export function show(params, isLoading = true) {
return request({
method: "get",
url: "/api/admin/appointment-configs/show",
params,
isLoading
})
}
export function save(data) {
return request({
method: "post",
url: "/api/admin/appointment-configs/save",
data
})
}
export function destroy(params) {
return request({
method: "get",
url: "/api/admin/appointment-configs/destroy",
params
})
}

@ -49,6 +49,15 @@ export function show(params, isLoading = true) {
})
}
export function save(data) {
return request({
method: "post",
url: "/api/admin/users/save",
data
})
}
export function destroy(params) {
return request({
method: "get",

@ -1,14 +1,14 @@
export default {
data() {
return {
types_status:[{
return {
types_status: [{
id: 0,
value: '禁用',
type:'info'
value: '禁用',
type: 'info'
}, {
id: 1,
value: '启用',
type:''
value: '启用',
type: ''
}],
false_or_true: [{
id: 0,
@ -32,20 +32,20 @@ export default {
}],
fee_status_list: [{
id: 0,
value: '待缴费',
type:''
value: '待缴费',
type: ''
}, {
id: 3,
value: '待确认',
type:'info'
value: '待确认',
type: 'info'
}, {
id: 1,
value: '缴费成功',
type:'success'
value: '缴费成功',
type: 'success'
}, {
id: 2,
value: '缴费失败',
type:'warning'
value: '缴费失败',
type: 'warning'
}],
// 课程
course_type: [{
@ -121,24 +121,24 @@ export default {
id: 3,
value: '取消',
type: 'info'
}],
// 考勤
keep_options:[{
id:'',
value:'全部'
},{
id:1,
value:'正常',
type:'success'
},{
id:0,
value:'缺勤',
type:'warning'
}],
// 考勤
keep_options: [{
id: '',
value: '全部'
}, {
id: 1,
value: '正常',
type: 'success'
}, {
id: 0,
value: '缺勤',
type: 'warning'
}],
// 自定义表单的 固定字段
defaultFormList: [{
name: '姓名',
field: 'name',
field: 'username',
rule: 'required',
edit_input: "text",
help: '基础字段'
@ -149,8 +149,8 @@ export default {
edit_input: "text",
help: '基础字段'
}, {
name: '出生日期',
field: 'birth',
name: '身份证号',
field: 'idcard',
rule: 'required',
edit_input: "text",
help: '基础字段'
@ -160,6 +160,12 @@ export default {
rule: 'required',
edit_input: "text",
help: '基础字段'
}, {
name: '出生日期',
field: 'birthday',
rule: '',
edit_input: "text",
help: '基础字段'
}, {
name: '邮箱',
field: 'email',
@ -168,11 +174,64 @@ export default {
help: '基础字段'
}, {
name: '公司名称',
field: 'company',
rule: 'required',
field: 'company_name',
rule: '',
edit_input: "text",
help: '基础字段'
}],
}, {
name: '职务',
field: 'company_position',
rule: '',
edit_input: "text",
help: '基础字段'
}],
// 自定义表单的 扩展字段 可填可不填
selectFormList:[{
name: '企业性质',
field: 'company_type',
rule: '',
edit_input: "text",
help: '可选择是否需要学员填写',
need_fill:0,
belong_user:1,
is_open:false, // 控制开启关闭的 参数不做保存
},{
name: '所在区域',
field: 'company_area',
rule: '',
edit_input: "text",
help: '可选择是否需要学员填写',
need_fill:0,
belong_user:1,
is_open:false
},{
name: '所属行业',
field: 'company_industry',
rule: '',
edit_input: "text",
help: '可选择是否需要学员填写',
need_fill:0,
belong_user:1,
is_open:false
},{
name: '人才类型',
field: '',
rule: '',
edit_input: "text",
help: '可选择是否需要学员填写',
need_fill:0,
belong_user:1,
is_open:false
},{
name: '学历',
field: 'education',
rule: '',
edit_input: "text",
help: '可选择是否需要学员填写',
need_fill:0,
belong_user:1,
is_open:false
}]
}
},
computed: {},

@ -8,6 +8,27 @@ import { Loading, Message } from "element-ui";
*/
let loading;
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 async function download(url, method = "get", info, filename) {
loading = Loading.service({
lock: true,
@ -30,7 +51,7 @@ export async function download(url, method = "get", info, filename) {
};
if (method === "get") {
Object.defineProperty(options, "params", {
value: info,
value: customParamsSerializer(info),
enumerable: true,
writable: false,
});

@ -0,0 +1,171 @@
<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>
<el-button type="primary" size="small" @click="getList"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editAppointment('add')"></el-button>
</div>
</div>
</div>
</lx-header>
</div>
</div>
<div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
:table-item="table_item">
<template v-slot:status>
<el-table-column align='center' label="状态" width="120" header-align="center">
<template slot-scope="scope">
<div v-for="item in types_status">
<el-tag :type="item.type" v-if="scope.row.status===item.id">{{item.value}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editAppointment('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>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<addAppointment ref="addAppointment" @refresh="getList"></addAppointment>
</div>
</template>
<script>
import myMixins from "@/mixin/selectMixin.js";
import addAppointment from './components/addAppointment.vue';
import {
index,
destroy
} from "@/api/book/appointment.js"
export default {
mixins: [myMixins],
components: {
addAppointment
},
data() {
return {
select: {
name: '',
page: 1,
page_size: 10,
},
list: [],
total: 0,
table_item: [{
prop: 'no',
label: '编号',
align: 'center',
width: 120,
},{
prop: 'name',
label: '场地名称',
align: 'left',
width: 120,
}, {
prop: 'content',
label: '场地简介',
align: 'center'
}, {
prop: 'total',
label: '场地容纳人数',
align: 'center',
width: 120,
}, {
prop: 'status',
label: '状态',
align: 'center',
width: 120,
}]
}
},
created() {
this.getList()
},
methods: {
pageIndexChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.select.page = 1
this.getList()
},
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
filter: [{
key: 'name',
op: 'like',
value: this.select.name
}]
})
this.list = res.data
this.total = res.total
},
editAppointment(type, id) {
if (id) {
this.$refs.addAppointment.id = id
}
this.$refs.addAppointment.type = type
this.$refs.addAppointment.isShow = true
},
deleteList(id) {
var that = this;
destroy({
id: id,
}).then(response => {
this.$Message.success('删除成功');
this.getList()
}).catch(error => {
console.log(error)
reject(error)
})
},
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
margin-right: 10px;
span {
min-width: 70px;
}
}
}
</style>

@ -0,0 +1,195 @@
<template>
<div>
<xy-dialog ref="dialog" :width="70" :is-show.sync="isShow" :type="'form'" :title="type === 'add' ? '新增课程' : '编辑课程'"
:form="form" :rules='rules' @submit="submit">
<template v-slot:no>
<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.no" placeholder="请输入场地编号" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot: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>场地名称
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" placeholder="请输入场地名称" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:content>
<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.content" type="textarea" placeholder="请输入场地简介" clearable
style="width: 100%;"></el-input>
</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>场地容纳人数
</div>
<div class="xy-table-item-content">
<el-input v-model="form.total" placeholder="请输入场地容纳人数" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:status>
<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-select v-model="form.status" placeholder="请选择状态" style="width: 100%;">
<el-option v-for="item in types_status" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:use_student>
<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-select v-model="form.status" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in false_or_true" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:file_ids>
<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-upload :action="action" multiple class='upload-demo' list-type="picture-card" :file-list="fileList"
ref="pictureUpload" :auto-upload="true" :on-success="uploadSuccesspublic" :on-remove="uploadRemovepublic">
<i class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import myMixins from "@/mixin/selectMixin.js";
import {
show,
save
} from "@/api/book/appointment.js"
export default {
mixins: [myMixins],
components: {},
data() {
return {
isShow: false,
type: 'add',
id: '',
form: {
no: '',
name: '',
content: '',
total: '',
status: 1,
use_student: 1,
file_ids:[]
},
action: `${process.env.VUE_APP_UPLOAD_API}`,
fileList: [],
rules: {
name: [{
required: true,
message: '请输入场地名称'
}],
},
}
},
created() {},
methods: {
uploadSuccesspublic(response, file, fileList) {
this.fileList = fileList
},
uploadRemovepublic(file, fileList) {
this.fileList = fileList
},
submit() {
if (this.id) {
this.form.id = this.id
}else{
this.form.id = ''
}
let _files = []
if (this.fileList.length > 0) {
this.fileList.map(item => {
if (item.response) {
_files.push(item.response.id)
} else {
_files.push(item.id)
}
})
}
this.form.file_ids = _files
save({
...this.form
}).then(res => {
this.$message({
type: 'success',
message: '保存预约场地成功'
})
this.isShow = false
this.$emit('refresh')
// this.active = 1
})
},
getDetail() {
show({
id: this.id
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.fileList = res.files
this.form.status = res.status?res.status:0
this.form.use_student = res.use_student?res.use_student:0
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}
} else {
this.id = ''
this.fileList = []
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,295 @@
<template>
<div>
<xy-dialog ref="dialog" :width="60" @reset="resetForm" :is-show.sync="isShow" :type="'form'" :title="typeName"
:form="form" @submit="submit" :rules='rules' :okText="'预约并通过'">
<template v-slot:course_id v-if="type==='more'">
<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-select v-model="form.course_id" @change="changeCourse" style="width:100%" placeholder="可选择课程获取学员">
<el-option v-for="item in course_options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</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">
<el-select v-model="form.user_id" style="width:100%" :multiple="type==='more'?true:false" filterable remote
reserve-keyword placeholder="请输入姓名查找学员" :remote-method="remoteMethod" :loading="loading">
<el-option v-for="item in user_options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<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>预约日期
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.date" type="date" style="width:100%" placeholder="预约日期"
value-format="yyyy-MM-dd" format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</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>时间段
</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>
</div>
</div>
</template>
<template v-slot:site>
<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-select v-model="form.site" placeholder="请选择预约场地" clearable style="width:100%">
<el-option v-for="item in site_options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:content v-if="type==='add'">
<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.content" placeholder="请输入预约事项" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:plate>
<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.plate" placeholder="请输入车牌,多个车牌中间以英文,分隔" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:accompany_total v-if="type==='add'">
<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.accompany_total" type="number" placeholder="请输入同行人数" clearable
style="width: 100%;"></el-input>
</div>
</div>
</template>
<!-- <template v-slot:footerContent>
<Button type="primary" @click="submit"></Button>
<Button type="primary" @click="isShow = false">取消</Button>
</template> -->
</xy-dialog>
</div>
</template>
<script>
import myMixins from "@/mixin/selectMixin.js";
import {
show,
save
} from "@/api/book/index.js"
import {
indexStudy
} from '@/api/student/index.js'
import {
index as courseIndex
} from "@/api/course/index.js"
export default {
mixins: [myMixins],
components: {
},
data() {
return {
isShow: false,
type: 'add',
typeName: '手动预约',
id: '',
form: {
course_id: '',
user_id: '',
date: '',
timeRange: '',
start_time: '',
end_time: '',
content: '',
site: '',
plate: '',
accompany_total: 0,
status: 1,
reason: ''
},
loading: false,
user_options: [],
site_options: [],
course_options: [],
rules: {
user_id: [{
required: true,
message: '请选择预约人'
}],
date: [{
required: true,
message: '请选择预约日期'
}],
timeRange: [{
required: true,
message: '请选择时间段'
}],
site: [{
required: true,
message: '请选择预约场地'
}],
}
}
},
created() {
this.getCourseList()
this.getUserList('')
},
methods: {
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==='more'){
let _arr = this.base.deepCopy(this.form.user_id)
this.form.user_id = _arr.join(",")
}
save(this.form).then(res => {
if(res.success<res.total){
this.$Message.warning(res.err.join("。"))
}else{
this.$message({
type: 'success',
message: '预约成功'
})
}
this.isShow = false
this.$emit('refresh')
})
},
getDetail() {
show({
id: this.id,
show_relation: ['user', 'appointmentConfig']
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.status = res.status ? res.status : 0
})
},
remoteMethod(query) {
if (query !== '') {
this.loading = true;
this.getUserList(query)
} else {
this.user_options = [];
}
},
async getUserList(query) {
const res = await indexStudy({
page: 1,
page_size: 99999,
name: query,
course_id: this.form.course_id,
})
this.user_options = res.list.data
this.loading = false
},
changeCourse(e) {
if (e) {
this.form.course_id = e
this.getUserList('')
} else {
this.form.course_id = ''
this.getUserList('')
}
},
async getCourseList() {
const res = await courseIndex({
page: 1,
page_size: 9999
})
this.course_options = res.data
},
resetForm() {
this.form.timeRange = ""
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
this.typeName = '编辑'
} else if (this.type === 'more') {
this.typeName = '批量预约'
} else {
this.typeName = '手动预约'
}
} else {
this.id = ''
this.type = "add"
this.typeName = '手动预约'
this.course_id = ''
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .name {
flex-basis: 100%;
}
.bookInfo {
&>div {
span {
display: inline-block;
}
span:first-child {
width: 20%;
text-align: right;
}
span:last-child {
width: 80%;
text-align: left;
}
}
}
</style>

@ -0,0 +1,80 @@
<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>
<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 type="number" v-model="form.appointment_total"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {save} from "@/api/student/index.js"
export default {
components: {
},
data() {
return {
isShow: false,
form: {
appointment_total: '',
},
rules: {
appointment_total: [{
required: true,
message: '请填写总次数'
}]
}
}
},
created() {
},
methods: {
submit() {
save({
...this.form
}).then(res => {
this.$message({
type: 'success',
message: '调整成功'
})
this.isShow = false
this.$emit('refresh')
})
},
setRow(row) {
this.form = this.base.requestToForm(row,this.form)
},
},
watch: {
isShow(newVal) {
if (newVal) {
} else {
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .teacher_id{
flex-basis: 100%;
}
</style>

@ -50,11 +50,15 @@
<span>状态</span>
<span>
<template v-for="item in book_status">
<el-tag :type="item.type" v-if="submitObj.status===item.id">{{item.value}}</el-tag>
</template>
</span>
</div>
<div v-if="type==='show'">
<span>审核意见</span>
<span>
{{submitObj.reason}}
</span>
</div>
</div>
<div v-if="type=='check'">

@ -0,0 +1,175 @@
<template>
<div>
<xy-dialog ref="dialog" :width="80" :is-show.sync="isShow" :type="'form'" title="预约详情" :form="form">
<template v-slot:show>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold;display: none;">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style="width:100%">
<div>预约人{{select.user_name}}</div>
<xy-table :list="list" :total="total" :isPage="false" :height="450" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
:table-item="table_item">
<template v-slot:status>
<el-table-column align='center' label="状态" width="120" header-align="center">
<template slot-scope="scope">
<div v-for="item in book_status">
<el-tag :type="item.type" v-if="scope.row.status===item.id">{{item.value}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:timerange>
<el-table-column align='center' label="预约时段" width="120" header-align="center">
<template slot-scope="scope">
{{formateHH(scope.row.start_time)}}-{{formateHH(scope.row.end_time)}}
</template>
</el-table-column>
</template>
<template v-slot:opr>
<el-table-column align='center' label="预约操作" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.admin_id"></div>
<div v-else></div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<div></div>
</template>
</xy-table>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
index
} from "@/api/book/index.js"
import myMixins from "@/mixin/selectMixin.js";
export default {
mixins: [myMixins],
components: {
},
data() {
return {
isShow: false,
select: {
user_name: '',
page: 1,
page_size: 999,
},
form: {
show: '',
},
list: [],
total: 0,
table_item: [{
prop: 'date',
label: '预约日期',
align: 'left',
width: 120,
}, {
prop: 'timerange',
label: '预约时段',
align: 'center',
width: 120,
}, {
prop: 'content',
label: '预约事项',
align: 'center',
width: 120,
}, {
prop: 'appointment_config.name',
label: '预约场地',
align: 'center',
width: 120,
}, {
prop: 'plate',
label: '车牌',
align: 'center',
// width: 180,
}, {
prop: 'accompany_total',
label: '同行人数',
align: 'center',
width: 120,
}, {
prop: 'user.username',
label: '预约人',
align: 'center',
width: 120,
}, {
prop: 'status',
label: '状态',
align: 'center',
width: 120,
}, {
prop: 'opr',
label: '预约操作',
align: 'center',
width: 120,
}]
}
},
created() {},
methods: {
setName(name) {
this.select.user_name = name
this.getList()
},
pageIndexChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.select.page = 1
this.getList()
},
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
user_name: this.select.user_name,
show_relation: ['user', 'appointmentConfig'],
})
this.list = res.data
this.total = res.total
},
formateHH(val) {
if (val) {
return this.$moment(val).format("HH:mm")
} else {
return ''
}
},
},
watch: {
isShow(newVal) {
if (newVal) {
} else {
this.row = {}
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .show {
flex-basis: 100%;
width:100%;
}
</style>

@ -0,0 +1,150 @@
<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>
<div>
<el-input v-model="select.name" placeholder="请输入姓名"></el-input>
</div>
</div>
<div>
<el-button type="primary" size="small" @click="getList"></el-button>
</div>
</div>
</div>
</lx-header>
</div>
</div>
<div>
<xy-table :list="list" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :total="total"
:table-item="table_item">
<template v-slot:appointments_count>
<el-table-column align='center' label="已预约次数" header-align="center">
<template slot-scope="scope">
<div @click="showCounts(scope.row.name)" v-if="scope.row.appointments_count>0"
style="color:#0077CC;text-decoration: underline;cursor: pointer;">{{scope.row.appointments_count}}</div>
<div v-else>{{scope.row.appointments_count}}</div>
</template>
</el-table-column>
</template>
<template v-slot:appointments_can>
<el-table-column align='center' label="预约剩余次数" header-align="center">
<template slot-scope="scope">
<div>
{{scope.row.appointment_total - scope.row.appointments_count>0?scope.row.appointment_total - scope.row.appointments_count:0}}
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="操作" fixed="right" width="80" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editCount(scope.row)"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<addCount ref="addCount" @refresh="getList"></addCount>
<showCount ref="showCount"></showCount>
</div>
</template>
<script>
import addCount from './components/addCount.vue';
import showCount from './components/showCount.vue';
import {
indexStudy
} from '@/api/student/index.js'
export default {
components: {
addCount,
showCount
},
data() {
return {
select: {
name: '',
page: 1,
page_size: 10,
},
list: [],
total:0,
table_item: [{
prop: 'name',
label: '预约人',
align: 'center',
}, {
prop: 'appointment_total',
label: '可预约总数',
align: 'center',
}, {
prop: 'appointments_count',
label: '已预约次数',
align: 'center',
}, {
prop: 'appointments_can',
label: '预约剩余次数',
align: 'center',
}]
}
},
created() {
this.getList()
},
methods: {
pageIndexChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.select.page = 1
this.getList()
},
async getList() {
const res = await indexStudy({
page: this.select.page,
page_size: this.select.page_size,
name: this.select.name,
courses_ing: 1
})
this.list = res.list.data
this.total = res.list.total
},
editCount(row) {
this.$refs.addCount.setRow(row)
this.$refs.addCount.isShow = true
},
showCounts(name) {
this.$refs.showCount.setName(name)
this.$refs.showCount.isShow = true
},
}
}
</script>
<style lang="scss" scoped>
.searchwrap {
display: flex;
align-items: center;
&>div {
display: flex;
align-items: center;
&>div {
margin-right: 10px;
}
}
}
</style>

@ -7,8 +7,8 @@
<div slot="content">
<div class="searchwrap" style="display: flex;align-items: center;">
<div>
<el-date-picker v-model="select.daterange" type="daterange" range-separator="" start-placeholder=""
value-format="yyyy-MM-dd" format="yyyy-MM-dd" end-placeholder="结束日期">
<el-date-picker @change="changeDate" v-model="select.date" type="date" placeholder="预约日期"
value-format="yyyy-MM-dd" format="yyyy-MM-dd">
</el-date-picker>
</div>
<div>
@ -16,13 +16,19 @@
</div>
<div>
<el-select v-model="select.site" placeholder="请选择预约场地" clearable>
<el-option v-for="item in site_options" :key="item.id" :label="item.name" :value="item.key">
<el-option v-for="item in site_options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-button type="primary" size="small" @click="getList"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editBook('add')"></el-button>
</div>
<div>
<el-button type="primary" size="small" @click="editBook('more')"></el-button>
</div>
</div>
</div>
@ -31,7 +37,8 @@
</div>
<div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :table-item="table_item">
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
:table-item="table_item">
<template v-slot:status>
<el-table-column align='center' label="状态" width="120" header-align="center">
<template slot-scope="scope">
@ -40,21 +47,28 @@
</div>
</template>
</el-table-column>
</template>
<template v-slot:timerange>
<el-table-column align='center' label="预约时段" width="120" header-align="center">
<template slot-scope="scope">
{{formateHH(scope.row.start_time)}}-{{formateHH(scope.row.end_time)}}
</template>
</el-table-column>
</template>
</template>
<template v-slot:timerange>
<el-table-column align='center' label="预约时段" width="120" header-align="center">
<template slot-scope="scope">
{{formateHH(scope.row.start_time)}}-{{formateHH(scope.row.end_time)}}
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<el-table-column align='center' label="操作" width="220" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" v-if="scope.row.status>0"
@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-button type="primary" size="small" @click="checkBook('show',scope.row.id)"></el-button>
<el-button type="primary" size="small" v-if="scope.row.status===0"
@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>
</el-popconfirm>
</template>
</el-table-column>
</template>
@ -62,28 +76,31 @@
</div>
<check-book ref="checkBook" @refresh="getList"></check-book>
<addBook ref="addBook" @refresh="getList"></addBook>
</div>
</template>
<script>
import myMixins from "@/mixin/selectMixin.js";
import checkBook from './components/checkBook.vue';
import addBook from './components/addBook.vue';
import {
index
} from "@/api/book/index.js"
import {
index as configIndex
} from "@/api/info/configs.js"
index as getAppointment
} from "@/api/book/appointment.js"
export default {
mixins: [myMixins],
components: {
checkBook
checkBook,
addBook
},
data() {
return {
select: {
user_name: '',
daterange: '',
date: '',
site: '',
page: 1,
page_size: 10,
@ -107,7 +124,7 @@
align: 'center',
width: 120,
}, {
prop: 'site',
prop: 'appointment_config.name',
label: '预约场地',
align: 'center',
width: 120,
@ -137,26 +154,29 @@
},
created() {
this.getList()
this.getSite()
this.getSites()
},
methods: {
pageIndexChange(e){
this.select.page = e
this.getList()
},
pageSizeChange(e){
this.select.page_size = e
this.select.page = 1
this.getList()
methods: {
pageIndexChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.select.page = 1
this.getList()
},
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
user_name: this.select.user_name,
show_relation:['user'],
user_name: this.select.user_name,
show_relation: ['user', 'appointmentConfig'],
filter: [{
key: 'date',
op: 'eq',
value: this.select.date ? this.select.date : ''
}, {
key: 'site',
op: 'eq',
value: this.select.site
@ -165,30 +185,47 @@
this.list = res.data
this.total = res.total
},
async getSite() {
const res = await configIndex({
async getSites() {
const res = await getAppointment({
page: 1,
page_size: 999,
filter: [{
key: 'key',
op: 'like',
value: 'appointment'
key: 'status',
op: 'eq',
value: 1
}]
})
this.site_options = res.data
},
formateHH(val){
if(val){
return this.$moment(val).format("HH:mm")
}else{
return ''
}
},
changeDate(e) {
console.log(e)
if (e) {
this.select.date = e
} else {
this.select.date = ''
}
console.log("this.select.date", this.select.date)
},
formateHH(val) {
if (val) {
return this.$moment(val).format("HH:mm")
} else {
return ''
}
},
checkBook(type, id) {
this.$refs.checkBook.id = id
this.$refs.checkBook.type = type
this.$refs.checkBook.isShow = true
}
},
editBook(type, id) {
if (id) {
this.$refs.addBook.id = id
}
this.$refs.addBook.type = type
this.$refs.addBook.site_options = this.site_options
this.$refs.addBook.isShow = true
},
}
}
</script>

@ -1,20 +1,21 @@
<template>
<div>
<el-dialog :visible.sync="dialogVisible" title="数据导入" width="740px">
<el-dialog :visible.sync="dialogVisible" title="数据导入" width="740px" top="1vh">
<div class="title">模板下载</div>
<el-button style="margin-top: 10px" size="small" type="primary"
@click="exportExcel(new Date().getTime().toString())">模板下载</el-button>
<div style="color: red; margin-top: 10px">
导入的时候请勿修改模版的标题名称
导入的时候请勿修改模版表单各列栏目名称
</div>
<el-upload style="margin-top: 10px" drag :action="action" :data="{
table_name: tableName,
course_id: course_id ? course_id : '',
...tableData
}" :headers="{
}" :headers="{
Authorization: `Bearer ${getToken()}`,
}" :on-success="uploadSuccess" :on-error="uploadFail">
}" :on-success="uploadSuccess" :on-error="uploadFail"
:file-list="fileList">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传xls/xlsx文件</div>
@ -62,7 +63,8 @@
tableData: {},
headers: [],
tableList: [],
table: [],
table: [],
fileList:[]
};
},
methods: {
@ -121,7 +123,7 @@
type: "error",
});
},
uploadSuccess(response) {
uploadSuccess(response,file,fileList) {
if(this.tableName==='course_keeps'){
response.map(item=>{
console.log("item",item)
@ -129,6 +131,7 @@
})
}
this.tableList = response;
this.fileList = fileList
this.$message({
message: `上传成功`,
type: "success",
@ -198,7 +201,8 @@
this.tableList = []
this.table = []
this.headers = []
this.tableData = []
this.tableData = []
this.fileList = []
}
}
},

@ -159,11 +159,8 @@
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
filter: [ {
key: 'name',
op: 'like',
value: this.select.name
},{
name:this.select.name,
filter: [{
key: 'course_id',
op: 'eq',
value: this.select.course_id

@ -27,12 +27,7 @@
</div>
<div class="schedule" id="print">
<!-- <xy-table :list="list" :isPage="false" :table-item="table_item" :height="'100%'">
<template v-slot:btns>
<div></div>
</template>
</xy-table> -->
<el-table :data="list" border style="width: 100%">
<el-table :data="list" border style="width: 100%;height:300px;overflow: scroll;">
<el-table-column v-for="item in table_item" :prop="item.prop" :label="item.label"
:width="item.width?item.width:''" :align="item.align">
</el-table-column>
@ -130,7 +125,11 @@
this.getCousreContent()
},
//
changeContentStatus() {
changeContentStatus() {
if(this.list.length===0){
this.$Message.warning("请先导入课表")
return
}
this.subjectObj.course_content_status = 1
save(this.subjectObj).then(res => {
this.$Message.success("发布成功")

@ -32,7 +32,7 @@
</div>
<div class="xy-table-item-content">
<el-select v-model="form.type" @change="changeType" placeholder="请选择类别" clearable style="width: 100%;">
<el-option v-for="item in course_type" :key="item.id" :label="item.value" :value="item.id">
<el-option v-for="item in courseTypesList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
@ -41,7 +41,7 @@
<template v-slot:dateRange v-if="active===0">
<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-date-picker @change="changeDateRange" style="width: 100%;" v-model="form.dateRange" type="daterange"
@ -51,6 +51,19 @@
</div>
</div>
</template>
<template v-slot:signRange v-if="active===0">
<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 @change="changeSignRange" style="width: 100%;" v-model="form.signRange" type="daterange"
range-separator="至" value-format="yyyy-MM-dd" format="yyyy-MM-dd" start-placeholder="报名开始日期"
end-placeholder="报名截止日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:total v-if="active===0">
<div class="xy-table-item">
@ -131,7 +144,7 @@
<template v-slot:content v-if="active===0">
<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">
<my-tinymce v-if="showTinymce" @input="saveContent" :value="form.content"></my-tinymce>
@ -196,6 +209,7 @@
show,
save
} from "@/api/course/index.js"
import {
index as formIndex
} from "@/api/course/form";
@ -218,6 +232,7 @@
id: '',
action: `${process.env.VUE_APP_UPLOAD_API}`,
showTinymce: false,
courseTypesList: [],
imgList: [],
publicizeList: [],
form: {
@ -225,8 +240,9 @@
name: '',
type: '',
dateRange: '',
signRange: '',
total: '',
status: '',
status: 0,
is_arrange: '',
is_fee: '',
image_id: '',
@ -247,14 +263,10 @@
required: true,
message: '请上传课程封面'
}],
content: [{
required: true,
message: '请输入课程简介'
}],
dateRange: [{
required: true,
message: '请选择开课日期'
}]
// content: [{
// required: true,
// message: ''
// }],
},
//
selectForm: {
@ -268,6 +280,7 @@
},
created() {},
methods: {
changeType(e) {
if (e == 1) {
this.form.is_arrange = 1
@ -289,6 +302,15 @@
this.form.end_date = ''
}
},
changeSignRange(e) {
if (e) {
this.form.sign_start_date = e[0]
this.form.sign_end_date = e[1]
} else {
this.form.sign_start_date = ''
this.form.sign_end_date = ''
}
},
beforeUpload(file) {
console.log(file)
const isImage = file.type.includes('image');
@ -343,7 +365,7 @@
}
})
}
this.form.publicize_ids = pubFiles
this.form.publicize_ids = pubFiles
this.form.publicize = []
save({
...this.form
@ -364,15 +386,17 @@
},
getDetail() {
show({
id: this.id,
show_relation:['image']
id: this.id,
show_relation: ['image']
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
if (res.image) {
this.imgList.push(res.image)
}
}
this.publicizeList = res.publicize
this.form.dateRange = [res.start_date, res.end_date]
this.form.signRange = [res.sign_start_date, res.sign_end_date]
this.form.status = res.status ? res.status : 0
this.showTinymce = true
})
},
@ -395,10 +419,27 @@
...this.selectForm
})
this.formList = res.data
this.updateObjects(this.selectFormList, this.formList)
console.log("this.selectFormList", this.selectFormList, this.formList)
},
updateObjects(a, b) {
// b
b.forEach((objB, index) => {
// afield
const match = a.find(objA => objA.field === objB.field);
if (match) {
// a
Object.assign(match, objB);
// b
b.splice(index, 1);
}
});
},
//
editForm(type, id) {
this.$refs.applyForm.formList = deepCopy(this.formList)
this.$refs.applyForm.canSelectForm = deepCopy(this.selectFormList)
this.$refs.applyForm.course_id = this.id
this.$refs.applyForm.dialogVisible = true
}
@ -421,21 +462,7 @@
this.publicizeList = []
this.active = 0
this.formList = []
this.form = {
step: '', //
name: '',
type: '',
dateRange: '',
total: '',
status: '',
is_arrange: '',
is_fee: '',
image_id: '',
publicize_ids: [],
content: '',
applylabel: ''
},
this.$refs['dialog'].reset()
this.$refs['dialog'].reset()
}
},
}

@ -18,7 +18,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>是否启用
</div>
<div class="xy-table-item-content">
<el-select v-model="form.status" placeholder="请选择状态" clearable style="width: 100%;">
<el-select v-model="form.status" placeholder="请选择状态" style="width: 100%;">
<el-option v-for="item in types_status" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
@ -99,7 +99,7 @@
id: '',
form: {
name:'',
status:'',
status:1,
wait_tip:"",
pass_tip:"",
fault_tip:'',
@ -139,7 +139,7 @@
id: this.id
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.status = res.status?res.status:0
})
},
@ -162,22 +162,5 @@
</script>
<style scoped lang="scss">
::v-deep .content,
::v-deep .step,
::v-deep .applylabel,
::v-deep .image_id,
::v-deep .publicize_ids {
flex-basis: 100%;
}
::v-deep .status,
::v-deep .is_arrange,
::v-deep .is_fee,
{
flex-basis: 33%;
}
::v-deep .el-step.is-simple .el-step__head {
display: flex
}
</style>

@ -25,7 +25,22 @@
i.rule ? !!i.rule.includes('required') : false
" v-for="(i, index) in defaultFormList">
<el-input placeholder="基础字段" :disabled="true"></el-input>
</el-form-item>
</el-form-item>
<el-divider>选填字段</el-divider>
<el-form-item :label="i.name" :required="
i.rule ? !!i.rule.includes('required') : false
" v-for="(i, index) in canSelectForm">
<el-input style="width:60%;margin-right:10px" :placeholder="i.help" :disabled="true"></el-input>
<el-switch
@change="(e)=>{changeSelect(e,i)}"
v-model="i.need_fill?true:false"
active-color="#0077CC"
inactive-color="#ccc">
</el-switch>
</el-form-item>
<el-divider>自定义字段</el-divider>
<draggable :value="formList" group="items" @change="changeHandler"
style="display: flex;flex-wrap: wrap;width:100%">
@ -65,7 +80,9 @@
config
} from "@/api/system/customFormField";
import {
index
index,
save,
destroy
} from "@/api/course/form";
import {
deepCopy
@ -95,7 +112,8 @@
splitL: 0.13,
splitR: 0.7,
selectedForm: {},
selectedIndex: 0,
selectedIndex: 0,
canSelectForm:[] // idmixins
}
},
created() {
@ -123,7 +141,24 @@
}],
...this.select
})
this.formList = res.data
this.formList = res.data
this.updateObjects(this.canSelectForm, this.formList)
console.log("this.selectFormList", this.canSelectForm, this.formList)
},
updateObjects(a, b) {
// b
b.forEach((objB, index) => {
// afield
const match = a.find(objA => objA.field === objB.field);
if (match) {
// a
// Object.assign(match, objB);
// b
b.splice(index, 1);
}
});
},
//
changeHandler(e) {
@ -175,12 +210,42 @@
} else if (e === 'Del') {
this.formList.splice(index, 1)
}
},
changeSelect(e,item){
console.log(e,item)
if(e){
item.is_open = true
item.need_fill = 1
item.course_id = this.course_id
this.saveSelect(item)
}else{
item.is_open = false
item.need_fill = 0
this.delSelect(item)
}
},
//
saveSelect(item){
save(item).then(res=>{
this.$Message.success('启用成功')
this.getFormList()
})
},
delSelect(item){
destroy({
id:item.id
}).then(res=>{
// item.id = ''
// console.log("del",item)
this.getFormList()
this.$Message.success('禁用成功')
})
}
},
watch: {
dialogVisible(newval) {
if (newval) {
console.log("this.course_id", this.course_id)
console.log("this.course_id", this.course_id,this.canSelectForm)
} else {
this.course_id = ''
this.$emit("refresh")

@ -166,16 +166,8 @@ export default {
saveField() {
this.selectedForm.select_item = []
console.log("this.selectItem",this.selectItem)
this.selectedForm.select_item = this.selectItem
// this.selectItem.map(i => {
// this.selectedForm.select_item.push({
// i.key : i.value
// })
// })
this.selectedForm.rule = this.validation.join(",")
console.log("this.selectedForm",this.selectedForm)
// return
save(this.selectedForm).then(res=>{
console.log("res",res)

@ -11,14 +11,12 @@
</div>
<div>
<el-date-picker @change="changeDateRange" v-model="dateRange" type="daterange" range-separator=""
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
start-placeholder="开课日期" end-placeholder="结束日期">
value-format="yyyy-MM-dd" format="yyyy-MM-dd" start-placeholder="开课日期" end-placeholder="结束日期">
</el-date-picker>
</div>
<div>
<el-select v-model="select.type" placeholder="请选择类别" clearable>
<el-option v-for="item in course_type" :key="item.id" :label="item.value" :value="item.id">
<el-option v-for="item in courseTypesList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
@ -42,7 +40,8 @@
</div>
<div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :table-item="table_item">
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
:table-item="table_item">
<template v-slot:dateRange>
<el-table-column align='center' label="开课日期" width="200" header-align="center">
<template slot-scope="scope">
@ -50,23 +49,14 @@
</template>
</el-table-column>
</template>
<template v-slot:type>
<el-table-column align='center' label="类别" width="120" header-align="center">
<template v-slot:date_status>
<el-table-column align='center' label="课程状态" width="120" header-align="center">
<template slot-scope="scope">
<div v-for="item in course_type">
<div v-if="scope.row.type===item.id">{{item.value}}</div>
<div v-for="item in course_date">
<el-tag :type="item.type" v-if="scope.row.date_status===item.value">{{item.value}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:date_status>
<el-table-column align='center' label="课程状态" width="120" header-align="center">
<template slot-scope="scope">
<div v-for="item in course_date">
<el-tag :type="item.type" v-if="scope.row.date_status===item.value">{{item.value}}</el-tag>
</div>
</template>
</el-table-column>
</template>
<template v-slot:status>
<el-table-column align='center' label="发布状态" width="120" header-align="center">
@ -85,7 +75,8 @@
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
<el-button type="primary" size="small" @click="toTxl(scope.row)"></el-button>
<el-button type="primary" size="small" v-if="scope.row.is_fee===1" @click="toPay(scope.row)"></el-button>
<el-button type="primary" size="small" v-if="scope.row.is_fee===1"
@click="toPay(scope.row)">缴费</el-button>
<el-button type="primary" size="small" @click="showQrCode(scope.row)"></el-button>
</template>
</el-table-column>
@ -105,7 +96,10 @@
import {
index,
destroy
} from "@/api/course/index.js"
} from "@/api/course/index.js"
import {
index as indexType
} from "@/api/course/courseType.js"
export default {
mixins: [myMixins],
components: {
@ -114,7 +108,8 @@
},
data() {
return {
dateRange: [],
dateRange: [],
courseTypesList:[],
select: {
name: '',
dateRange: '',
@ -135,7 +130,12 @@
align: 'center',
width: 180,
}, {
prop: 'type',
prop: 'sign_end_date',
label: '报名截止日期',
align: 'center',
width: 120,
}, {
prop: 'type_detail.name',
label: '类别',
align: 'center',
width: 180,
@ -154,22 +154,34 @@
}
},
created() {
this.getList()
this.getList()
this.getTypes()
},
methods: {
pageIndexChange(e){
this.select.page = e
this.getList()
},
pageSizeChange(e){
this.select.page_size = e
this.select.page = 1
this.getList()
getTypes() {
indexType({
page: 1,
page_size: 999
}).then(res => {
this.courseTypesList = res.data.filter(item => item.status === 1)
})
},
pageIndexChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e) {
this.select.page_size = e
this.select.page = 1
this.getList()
},
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
show_relation: ['typeDetail'],
sort_name:'sign_status',
sort_type:'DESC',
filter: [{
key: 'name',
op: 'like',
@ -200,49 +212,49 @@
},
editCourse(type, id) {
if(id){
this.$refs.addCourse.id = id
if (id) {
this.$refs.addCourse.id = id
}
this.$refs.addCourse.type = type
this.$refs.addCourse.type = type
this.$refs.addCourse.courseTypesList = this.courseTypesList
this.$refs.addCourse.isShow = true
},
showQrCode(row) {
let value = ''
this.course_type.map(item=>{
if(item.id==row.type){
value = item.value
}
})
this.$refs.showCode.row = {
type_value:value,
...row
showQrCode(row) {
let value = ''
this.course_type.map(item => {
if (item.id == row.type) {
value = item.value
}
})
this.$refs.showCode.row = {
type_value: value,
...row
}
this.$refs.showCode.isShow = true
},
toTxl(row) {
let value = ''
this.course_type.map(item=>{
if(item.id==row.type){
value = item.value
}
})
toTxl(row) {
let value = row.type_detail.name
this.$router.push({
path: '/course/txl',
query: { title: row.name, id:row.id, date: row.start_date+'至'+row.end_date,leibie:value }
path: '/course/txl',
query: {
title: row.name,
id: row.id,
date: row.start_date + '至' + row.end_date,
leibie: value
}
})
},
toPay(row) {
let value = ''
this.course_type.map(item=>{
if(item.id==row.type){
value = item.value
}
})
toPay(row) {
let value = row.type_detail.name
this.$router.push({
path: '/course/pay',
query: { title: row.name, id:row.id, date: row.start_date+'至'+row.end_date,leibie:value }
path: '/course/pay',
query: {
title: row.name,
id: row.id,
date: row.start_date + '至' + row.end_date,
leibie: value
}
})
},
deleteList(id) {

@ -21,10 +21,10 @@
</el-select>
</div>
<div>
<el-button type="primary" size="small">查询</el-button>
<el-button type="primary" size="small" @click="getList"></el-button>
</div>
<div>
<el-button type="primary" size="small">导出</el-button>
<el-button type="primary" size="small" @click="exportExcel"></el-button>
</div>
<div v-if="url_type=='pay'">
<el-popconfirm @confirm="updateAllFee" title="确定要批量核对吗?">
@ -44,7 +44,7 @@
</div>
<div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :showIndex='false' :table-item="table_item"
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange" :table-item="table_item"
@selection-change="selectionChange">
<template v-slot:fee_status>
<el-table-column align='center' label="状态" width="120" header-align="center">
@ -183,6 +183,13 @@
this.getList()
},
methods: {
exportExcel(){
this.$Export.excel({
title: '123',
columns: this.table_item,
data: this.list
});
},
pageIndexChange(e){
this.select.page = e
this.getList()
@ -197,7 +204,7 @@
page: this.select.page,
page_size: this.select.page_size,
filter: [ {
key: 'name',
key: 'username',
op: 'like',
value: this.select.name
},{

@ -105,8 +105,13 @@
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect
handler: function(route) {
if(route.query && route.query.redirect==='/'){
this.redirect = '/dashboard'
}else{
this.redirect = route.query && route.query.redirect
}
},
immediate: true
}

Loading…
Cancel
Save