lion 2 years ago
parent bd1fc8cc0f
commit e1ab0bc0f8

@ -9,3 +9,8 @@ export default {
name: 'App'
}
</script>
<style lang="scss">
#app .sidebar-container.has-logo .el-scrollbar{
height: calc(100% - 60px)!important;
}
</style>

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

@ -8,52 +8,56 @@ export default {
field: 'username',
rule: 'required',
edit_input: "text",
help: '基础字段'
help: '请输入姓名'
}, {
name: '性别',
field: 'sex',
rule: 'required',
edit_input: "text",
help: '基础字段'
}, {
name: '身份证号',
field: 'idcard',
rule: 'required',
edit_input: "text",
help: '基础字段'
}, {
help: '请选择性别'
},{
name: '联系方式',
field: 'mobile',
rule: 'required',
edit_input: "text",
help: '基础字段'
help: '请输入联系方式'
}, {
name: '出生日期',
field: 'birthday',
rule: '',
edit_input: "text",
help: '基础字段'
help: '请选择出生日期'
}, {
name: '邮箱',
field: 'email',
rule: '',
edit_input: "text",
help: '基础字段'
help: '请输入邮箱'
}, {
name: '公司名称',
field: 'company_name',
rule: '',
edit_input: "text",
help: '基础字段'
help: '请输入公司名称'
}, {
name: '职务',
field: 'company_position',
rule: '',
edit_input: "text",
help: '基础字段'
help: '请选择职务'
}],
// 自定义表单的 扩展字段 可填可不填
selectFormList: [{
selectFormList: [ {
name: '身份证号',
field: 'idcard',
rule: 'idcard',
edit_input: "text",
help: '请输入身份证号',
need_fill: 0,
belong_user: 1,
select_item: [],
is_open: false,
}, {
name: '企业性质',
field: 'company_type',
rule: '',

@ -24,7 +24,7 @@
</div>
<div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
<xy-table :list="list" :total="total" :showIndex="false" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
:table-item="table_item">
<template v-slot:status>
<el-table-column align='center' label="状态" width="120" header-align="center">
@ -84,6 +84,11 @@
list: [],
total: 0,
table_item: [{
prop: 'sort',
label: '排序',
align: 'center',
width: 80,
},{
prop: 'no',
label: '编号',
align: 'center',
@ -93,11 +98,13 @@
label: '场地名称',
align: 'left',
width: 120,
}, {
prop: 'content',
label: '场地简介',
align: 'center'
}, {
},{
prop: 'appointment_type.name',
label: '场地类型',
align: 'center',
width: 120,
},
{
prop: 'total',
label: '场地容纳人数',
align: 'center',
@ -112,7 +119,11 @@
label: '状态',
align: 'center',
width: 120,
}]
}, {
prop: 'content',
label: '场地简介',
align: 'left'
},]
}
},
@ -133,7 +144,10 @@
async getList() {
const res = await index({
page: this.select.page,
page_size: this.select.page_size,
page_size: this.select.page_size,
show_relation:['appointment_type'],
sort_name:'sort',
sort_type:'ASC',
filter: [{
key: 'name',
op: 'like',

@ -11,6 +11,16 @@
<el-input v-model="form.no" placeholder="请输入场地编号" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:sort>
<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.sort" type="number" placeholder="请输入排序" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:name>
<div class="xy-table-item">
@ -21,6 +31,19 @@
<el-input v-model="form.name" 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">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>场地类型:
</div>
<div class="xy-table-item-content">
<el-select v-model="form.appointment_type_id" placeholder="请选择场地类型" style="width: 100%;">
<el-option v-for="item in types_options" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
@ -75,7 +98,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>可预约时间段:
</div>
<div class="xy-table-item-content">
<el-time-picker @change="changeDateRange" value-format="HH:mm" format="HH:mm" is-range v-model="form.dateRange" range-separator="至"
<el-time-picker style="width:100%" @change="changeDateRange" value-format="HH:mm" format="HH:mm" is-range v-model="form.dateRange" range-separator="至"
start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围">
</el-time-picker>
</div>
@ -96,8 +119,29 @@
</el-upload>
</div>
</div>
</template>
</template>
<!-- <template v-slot:door>
<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">
<div>{{form.door}}</div>
</div>
</div>
</template>
<template v-slot:room>
<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">
<div>{{form.room}}</div>
</div>
</div>
</template> -->
</xy-dialog>
</div>
@ -108,7 +152,10 @@
import {
show,
save
} from "@/api/book/appointment.js"
} from "@/api/book/appointment.js"
import {
index as typeIndex
} from "@/api/book/type.js"
export default {
mixins: [myMixins],
components: {},
@ -118,8 +165,10 @@
type: 'add',
id: '',
form: {
no: '',
name: '',
no: '',
sort:0,
name: '',
appointment_type_id:'',
content: '',
total: '',
status: 1,
@ -127,9 +176,12 @@
dateRange: ['08:30','17:30'],
file_ids: [],
start_time:'08:30',
end_time:'17:30'
end_time:'17:30',
// door:'',
// room:''
},
action: `${process.env.VUE_APP_UPLOAD_API}`,
action: `${process.env.VUE_APP_UPLOAD_API}`,
types_options:[],
fileList: [],
rules: {
name: [{
@ -139,8 +191,17 @@
},
}
},
created() {},
methods: {
created() {
this.getList()
},
methods: {
async getList() {
const res = await typeIndex({
page: 1,
page_size: 999,
})
this.types_options = res.data
},
changeDateRange(e) {
console.log(e)
if (e) {
@ -192,10 +253,13 @@
id: this.id
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.fileList = res.files
this.fileList = res.files
this.form.sort = res.sort?res.sort:0
this.form.status = res.status ? res.status : 0
this.form.use_student = res.use_student ? res.use_student : 0
this.form.dateRange = res.start_time?[res.start_time,res.end_time]:['','']
this.form.dateRange = res.start_time?[res.start_time,res.end_time]:['','']
// this.form.door = res.door?JSON.parse(res.door):''
// this.form.room = res.room?JSON.parse(res.room):''
})
},

@ -19,17 +19,39 @@
<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>预约人:
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>{{type==='more'?'无需预约人':'预约人'}}:
</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-select v-model="form.user_id" @change="changeUser" style="width:100%"
:multiple="type==='more'?true:false" filterable remote reserve-keyword
:allow-create="type==='more'?false:true" :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>
</el-select>
</div>
</div>
</template>
<template v-slot:name 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 @change="changeInput" v-model="form.name" placeholder="请输入预约人姓名"></el-input>
</div>
</div>
</template>
<template v-slot:mobile 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.mobile" placeholder="请输入预约人联系方式"></el-input>
</div>
</div>
</template>
<template v-slot:date>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
@ -135,6 +157,8 @@
form: {
course_id: '',
user_id: '',
name: '',
mobile: '',
date: '',
timeRange: '',
start_time: '',
@ -151,14 +175,18 @@
site_options: [],
course_options: [],
rules: {
user_id: [{
required: true,
message: '请选择预约人'
}],
// user_id: [{
// required: true,
// message: '请选择预约人'
// }],
date: [{
required: true,
message: '请选择预约日期'
}],
mobile: [{
required: true,
message: '请输入联系方式'
}],
timeRange: [{
required: true,
message: '请选择时间段'
@ -179,24 +207,38 @@
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(",")
}
if(this.type==="editor"){
this.form.status = 0
console.log(this.form)
if (this.type === 'add') {
if (this.base.isNull(this.form.user_id) && this.base.isNull(this.form.name)) {
this.$Message.warning('请选择学员或输入预约人姓名')
return
}
}
save(this.form).then(res => {
if(res.success<res.total){
this.$Message.warning(res.err.join("。"))
}else{
this.$message({
type: 'success',
message: '预约成功'
})
if (this.type === 'more') {
let _arr = []
if (this.base.isNull(this.form.user_id)) {
this.user_options.map(item => {
_arr.push(item.id)
})
} else {
_arr = this.user_options.filter(item => !this.form.user_id.includes(item.id))
_arr = _arr.map(item => item.id)
}
console.log("_arr", _arr)
this.form.user_id = _arr.join(",")
}
if (this.type === "editor") {
this.form.status = 0
}
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')
})
@ -208,16 +250,38 @@
show_relation: ['user', 'appointmentConfig']
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.form.status = res.status ? res.status : 0
this.form.timeRange = [this.formatHH(res.start_time),this.formatHH(res.end_time)]
this.form.status = res.status ? res.status : 0
this.form.timeRange = [this.formatHH(res.start_time), this.formatHH(res.end_time)]
})
},
formatHH(val){
if(val){
return this.$moment(val).format("HH:mm:ss")
}else{
return ''
},
formatHH(val) {
if (val) {
return this.$moment(val).format("HH:mm:ss")
} else {
return ''
}
},
changeUser(e) {
if (e) {
this.form.user_id = e
this.form.name = ''
if (this.type === "add") {
this.user_options.map(item => {
if (item.id === e) {
this.form.mobile = item.mobile
}
})
}
}
console.log(this.form.user_id, this.form.name)
},
changeInput(e) {
console.log("input", e)
if(e){
this.form.name = e
this.form.user_id = ''
}
console.log(this.form.user_id, this.form.name)
},
remoteMethod(query) {
if (query !== '') {
@ -234,7 +298,10 @@
name: query,
course_id: this.form.course_id,
})
this.user_options = res.list.data
this.user_options = res.list.data
if(this.user_options.length===0){
this.$Message.warning("当前课程下还没有学员")
}
this.loading = false
},
changeCourse(e) {
@ -282,10 +349,6 @@
</script>
<style scoped lang="scss">
::v-deep .name {
flex-basis: 100%;
}
.bookInfo {
&>div {
span {

@ -0,0 +1,168 @@
<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: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:introduce>
<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.introduce" type="textarea" placeholder="请输入简介" clearable
style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:dateRange>
<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 style="width:100%" @change="changeDateRange" value-format="HH:mm" format="HH:mm" is-range v-model="form.dateRange" range-separator="至"
start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围">
</el-time-picker>
</div>
</div>
</template>
<template v-slot:image_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-upload :action="action" multiple class='upload-demo'
accept=".PNG,.jpg,.jpeg,.bmp,.svg"
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/type.js"
export default {
mixins: [myMixins],
components: {},
data() {
return {
isShow: false,
type: 'add',
id: '',
form: {
name: '',
introduce: '',
dateRange: ['08:30','17:30'],
image_id: [],
start_time:'08:30',
end_time:'17:30'
},
action: `${process.env.VUE_APP_UPLOAD_API}`,
fileList: [],
rules: {
name: [{
required: true,
message: '请输入类型名称'
}],
},
}
},
created() {},
methods: {
changeDateRange(e) {
console.log(e)
if (e) {
this.form.start_time = e[0]
this.form.end_time = e[1]
} else {
this.form.start_time = ''
this.form.end_time = ''
}
},
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.image_id = _files
save({
...this.form
}).then(res => {
this.$message({
type: 'success',
message: '保存场地类型成功'
})
this.isShow = false
this.$emit('refresh')
})
},
getDetail() {
show({
id: this.id
}).then(res => {
this.form = this.base.requestToForm(res, this.form)
this.fileList = res.image
this.form.dateRange = res.start_time?[res.start_time,res.end_time]:['','']
})
},
},
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">
::v-deep .image_id{
flex-basis: 100%;
}
</style>

@ -50,7 +50,7 @@
<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>
<el-tag style="width:auto" :type="item.type" v-if="submitObj.status===item.id">{{item.value}}</el-tag>
</template>
</span>
</div>

@ -10,6 +10,19 @@
<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 v-model="select.courses_ing" placeholder="请选择课程状态">
<el-option
v-for="item in course_options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<div>
@ -25,7 +38,7 @@
<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">
<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"
style="color:#0077CC;text-decoration: underline;cursor: pointer;">{{scope.row.appointments_count}}</div>
@ -34,14 +47,24 @@
</el-table-column>
</template>
<template v-slot:appointments_can>
<el-table-column align='center' label="预约剩余次数" header-align="center">
<el-table-column align='center' label="预约剩余次数" header-align="center" width="120">
<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>
<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 v-slot:btns>
<el-table-column align='center' label="操作" fixed="right" width="80" header-align="center">
<template slot-scope="scope">
@ -70,28 +93,45 @@
data() {
return {
select: {
name: '',
name: '',
course_name:'',
courses_ing:1,
page: 1,
page_size: 10,
},
},
course_options:[{
label:'进行中',
value:1
},{
label:'其他',
value:0
}],
list: [],
total:0,
table_item: [{
table_item: [{
prop: 'course_list',
label: '课程名称',
align: 'left',
},{
prop: 'username',
label: '预约人',
align: 'center',
align: 'center',
width:120
}, {
prop: 'appointment_total',
label: '可预约总数',
align: 'center',
align: 'center',
width:120
}, {
prop: 'appointments_count',
label: '已预约次数',
align: 'center',
align: 'center',
width:120
}, {
prop: 'appointments_can',
label: '预约剩余次数',
align: 'center',
align: 'center',
width:120
}]
}
@ -113,8 +153,9 @@
const res = await indexStudy({
page: this.select.page,
page_size: this.select.page_size,
name: this.select.name,
courses_ing: 1
name: this.select.name,
course_name:this.select.course_name,
courses_ing: this.select.courses_ing
})
this.list = res.list.data
this.total = res.list.total

@ -177,7 +177,7 @@
page: this.select.page,
page_size: this.select.page_size,
user_name: this.select.user_name,
show_relation: ['user', 'appointmentConfig'],
show_relation: ['user', 'appointmentConfig', 'third_appointment_logs','third_plate_logs'],
filter: [{
key: 'date',
op: 'eq',
@ -235,9 +235,12 @@
exportExcel() {
let _export = {}
this.table_item.map(item => {
if (item.prop === 'status') {
_export['status_text'] = item.label
}else if (item.prop === 'date') {
_export['start_time'] = '预约开始时间'
}else if (item.prop === 'timerange') {
_export['end_time'] = '预约结束时间'
} else {
_export[item.prop] = item.label
}
@ -247,6 +250,7 @@
'get', {
user_name: this.select.user_name,
export_fields: _export,
show_relation: ['user', 'appointmentConfig'],
filter: [{
key: 'date',
op: 'eq',

@ -0,0 +1,156 @@
<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="select.page=1,getList()">查询</el-button>
</div> -->
<div>
<el-button type="primary" size="small" @click="editAppointmentType('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:dateRange>
<el-table-column align='center' label="可预约时间段" width="120" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.start_time">
{{scope.row.start_time}}~{{scope.row.end_time}}
</div>
<div v-else></div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="操作" width="180" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editAppointmentType('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>
<addType ref="addType" @refresh="getList"></addType>
</div>
</template>
<script>
import myMixins from "@/mixin/selectMixin.js";
import addType from './components/addType.vue';
import {
index,
destroy
} from "@/api/book/type.js"
export default {
mixins: [myMixins],
components: {
addType
},
data() {
return {
select: {
name: '',
page: 1,
page_size: 10,
},
list: [],
total: 0,
table_item: [{
prop: 'name',
label: '类型名称',
align: 'left',
width: 120,
}, {
prop: 'dateRange',
label: '可预约时间段',
align: 'center',
width: 120,
}, {
prop: 'introduce',
label: '简介',
align: 'left'
}]
}
},
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,
})
this.list = res.data
this.total = res.total
},
editAppointmentType(type, id) {
if (id) {
this.$refs.addType.id = id
}
this.$refs.addType.type = type
this.$refs.addType.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>

@ -112,6 +112,13 @@
item.key = 'status_name'
}
})
}
// 学员 + 课程
if (this.tableName === 'users') {
b.unshift({
key: 'course_name',
title: '课程名字'
});
}
this.table = this.headers = b
@ -137,12 +144,18 @@
this.fileList = []
this.tableList = []
return
}
}
// 考勤导入
if (this.tableName === 'course_keeps') {
response.map(item => {
console.log("item", item)
item.status_name = item.status === 1 ? '正常' : '缺勤'
})
}
// 学员导入
if (this.tableName === 'users') {
response.map(item => {
item.is_schoolmate = 1
})
}
this.tableList = response;
this.fileList = fileList
@ -154,7 +167,7 @@
},
exportExcel(sheetName) {
const data = [this.headers.map((header) => header.title)];
const data = [this.headers.map((header) =>header.title)];
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
@ -211,23 +224,28 @@
let changeTableName = this.tableName.replace('_', '-')
this.action = `${process.env.VUE_APP_BASE_API}/api/admin/${changeTableName}/excel-show`
this.import_action = `/api/admin/${changeTableName}/import`
// 学员导入
// 学员导入
if(this.tableName==='users'){
this.import_action = `/api/admin/${changeTableName}/import-study`
this.table = this.headers = this.formInfo.map((i) => {
if(i.prop){
return {
key: i.prop,
title: i.label,
};
}
}
// if(this.tableName==='users'){
// this.import_action = `/api/admin/${changeTableName}/import-study`
// this.table = this.headers = this.formInfo.map((i) => {
});
console.log("this.table",this.headers)
}else{
// if(i.prop){
// console.log("i.prop",i.prop)
// return {
// key: i.prop,
// title: i.label,
// };
// }
// });
// console.log("this.table",this.headers)
// }else{
this.getHeaders()
}
// }
console.log("action", this.action, this.import_action)
} else {

@ -24,6 +24,16 @@
</el-select>
</div>
</div>
</template>
<template v-slot:mobile>
<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.mobile" placeholder="请输入联系方式" clearable style="width: 100%;"></el-input>
</div>
</div>
</template>
<template v-slot:introduce>
<div class="xy-table-item">
@ -60,7 +70,8 @@
id: '',
form: {
name: '',
sex: '',
sex: '',
mobile:'',
introduce: ''
},
sex_options:[{
@ -78,6 +89,10 @@
sex:[{
required:true,
message:'请选择性别'
}],
mobile:[{
required:true,
message:'请输入联系方式'
}]
}
}

@ -83,6 +83,11 @@
align: 'center',
width: 180,
}, {
prop: 'mobile',
label: '联系方式',
align: 'center',
width: 180,
},{
prop: 'introduce',
label: '介绍',
align: 'left',

@ -56,8 +56,9 @@
</template>
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="操作" width="80" header-align="center">
<template slot-scope="scope">
<el-button type="primary" v-if="scope.row.status===0" size="small"
<template slot-scope="scope">
<!-- -->
<el-button type="primary" size="small" v-if="scope.row.status===0"
@click="showDetail('check',scope.row)">审核</el-button>
<el-button type="primary" v-if="scope.row.status>0" size="small"
@click="showDetail('checkshow',scope.row)">查看</el-button>

@ -58,15 +58,12 @@
</template>
</el-table-column>
</template>
<template v-slot:user_nosign_total>
<template v-slot:user_lack_sign_total>
<el-table-column align='center' label="缺勤人数" width="120" header-align="center">
<template slot-scope="scope">
<div @click="showAttendance(scope.row,0)"
v-if="scope.row.course_keeps_count>0 && scope.row.user_sign_total>0"
style="cursor: pointer;color:blue;text-decoration:underline">
{{scope.row.course_keeps_count - scope.row.user_sign_total}}
<div @click="showAttendance(scope.row,0)">
{{scope.row.user_lack_sign_total}}
</div>
<div v-else>0</div>
</template>
</el-table-column>
</template>
@ -150,7 +147,7 @@
width: 120,
},
{
prop: 'user_nosign_total',
prop: 'user_lack_sign_total',
label: '缺勤人数',
align: 'center',
width: 120,
@ -217,9 +214,10 @@
_export[item.prop] = item.label
})
download(
'/api/admin/course-keeps/index',
'/api/admin/course-contents/index',
'get', {
export_fields: _export,
show_relation: ['teacher'],
filter: [{
key: 'course_id',
op: 'eq',

@ -51,30 +51,42 @@
</div>
</div>
</template>
<template v-slot:signRange v-if="active===0">
<template v-slot:total 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="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-input style="width: 100%;" v-model="form.total" placeholder="请输入开课人数" clearable></el-input>
</div>
</div>
</template>
<template v-slot:sign_start_date 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 style="width: 100%;" v-model="form.sign_start_date" type="date" value-format="yyyy-MM-dd"
format="yyyy-MM-dd" placeholder="报名开始日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:total v-if="active===0">
<template v-slot:sign_end_date 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-input style="width: 100%;" v-model="form.total" placeholder="请输入开课人数" clearable></el-input>
<el-date-picker style="width: 100%;" v-model="form.sign_end_date" type="date" value-format="yyyy-MM-dd"
format="yyyy-MM-dd" placeholder="报名截止日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:status v-if="active===0">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
@ -175,11 +187,10 @@
i.rule ? !!i.rule.includes('required') : false
" v-for="(i, index) in defaultFormList">
<el-input placeholder="基础字段" :disabled="true"></el-input>
</el-form-item>
<el-divider>选填字段</el-divider>
<el-form-item :label="i.name"
v-for="(i, index) in selectFormList">
<el-input placeholder="选填字段" :disabled="true"></el-input>
</el-form-item>
<el-divider>选填字段</el-divider>
<el-form-item :label="i.name" v-for="(i, index) in selectFormList">
<el-input placeholder="选填字段" :disabled="true"></el-input>
</el-form-item>
<el-divider>自定义字段</el-divider>
<el-form-item style="flex-basis: 100%;" :label="i.name || '字段名称'" :required="
@ -209,7 +220,7 @@
</template>
<script>
import myMixins from "@/mixin/selectMixin.js";
import myMixins from "@/mixin/selectMixin.js";
import formMixins from "@/mixin/formMixin.js";
import {
show,
@ -225,7 +236,7 @@
import applyForm from "../components/applyForm.vue";
import formSlotRender from "@/views/system/components/formSlotRender.vue";
export default {
mixins: [myMixins,formMixins],
mixins: [myMixins, formMixins],
components: {
applyForm,
formSlotRender
@ -246,8 +257,10 @@
name: '',
type: '',
dateRange: '',
signRange: '',
total: '',
sign_start_date: '',
sign_end_date: '',
status: 0,
is_arrange: 1,
is_fee: 1,
@ -265,6 +278,10 @@
required: true,
message: '请选择课程类别'
}],
sign_start_date: [{
required: true,
message: '请选择报名开始日期'
}],
// image_id: [{
// required: true,
// message: '请上传课程封面'
@ -308,15 +325,6 @@
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');
@ -356,23 +364,23 @@
},
checkSubmit() {
this.$refs.dialog.submit(true)
},
compareTime(date,sign){
let date1 = this.$moment(date)
let sign1 = this.$moment(sign)
return sign1.isBefore(date1)
},
compareTime(date, sign) {
let date1 = this.$moment(date)
let sign1 = this.$moment(sign)
return sign1.isBefore(date1)
},
submit() {
if (this.id) {
this.form.id = this.id
}
// 报名截止时间 不能晚于 日程开始时间
if(this.form.start_date && this.form.sign_end_date){
if(!this.compareTime(this.form.start_date,this.form.sign_end_date)){
this.$Message.warning("报名截止时间不能晚于课程开始时间")
return
}
}
}
// 报名截止时间 不能晚于 日程开始时间
if (this.form.start_date && this.form.sign_end_date) {
if (!this.compareTime(this.form.start_date, this.form.sign_end_date)) {
this.$Message.warning("报名截止时间不能晚于课程开始时间")
return
}
}
// return
let pubFiles = []
if (this.publicizeList.length > 0) {
@ -394,7 +402,7 @@
message: '保存课程成功'
})
this.id = res.id
this.$emit('refresh')
this.$emit('refresh')
this.active = 1
// this.active = 1
@ -415,9 +423,8 @@
}
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.form.is_arrange = res.is_arrange ? res.is_arrange : 0
this.form.status = res.status ? res.status : 0
this.form.is_arrange = res.is_arrange ? res.is_arrange : 0
this.form.is_fee = res.is_fee ? res.is_fee : 0
this.showTinymce = true
})
@ -466,21 +473,22 @@
this.imgList = []
this.publicizeList = []
this.active = 0
this.formList = []
this.form = {
step: '', // 控制课程 课表
name: '',
type: '',
dateRange: '',
signRange: '',
total: '',
status: 0,
is_arrange: 1,
is_fee: 1,
image_id: '',
publicize_ids: [],
content: '',
applylabel: ''
this.formList = []
this.form = {
step: '', // 控制课程 课表
name: '',
type: '',
dateRange: '',
total: '',
sign_start_date: '',
sign_end_date: '',
status: 0,
is_arrange: 1,
is_fee: 1,
image_id: '',
publicize_ids: [],
content: '',
applylabel: ''
}
this.$refs['dialog'].reset()
}

@ -24,14 +24,14 @@
<el-form-item :label="i.name" :required="
i.rule ? !!i.rule.includes('required') : false
" v-for="(i, index) in defaultFormList">
<el-input placeholder="基础字段" :disabled="true"></el-input>
<el-input :placeholder="i.help?i.help:'基础字段'" :disabled="true"></el-input>
</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 selectFormList">
<el-input style="width:60%;margin-right:10px" :placeholder="i.help" :disabled="true"></el-input>
<el-input style="width:60%;margin-right:10px" :placeholder="i.help?i.help:'选填字段'" :disabled="true"></el-input>
<el-switch @change="(e)=>{changeSelect(e,i)}" v-model="i.is_open" active-color="#0077CC"
inactive-color="#ccc">
</el-switch>

@ -48,7 +48,16 @@
{{scope.row.start_date?scope.row.start_date:""}}{{scope.row.end_date?'至'+scope.row.end_date:''}}
</template>
</el-table-column>
</template>
</template>
<template v-slot:signDate>
<el-table-column align='center' label="报名日期" width="200" header-align="center">
<template slot-scope="scope">
{{scope.row.sign_start_date?scope.row.sign_start_date:''}}
{{scope.row.sign_end_date?"至"+scope.row.end_date:'起'}}
</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">
@ -130,8 +139,8 @@
align: 'center',
width: 180,
}, {
prop: 'sign_end_date',
label: '报名截止日期',
prop: 'signDate',
label: '报名日期',
align: 'center',
width: 120,
}, {

@ -95,10 +95,10 @@
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' fixed="right" label="操作" width="80" header-align="center">
<el-table-column align='left' fixed="right" label="操作" width="180" header-align="center">
<template slot-scope="scope">
<!-- <el-button type="primary" v-if="scope.row.status===0" size="small"
@click="showDetail('check',scope.row)">审核</el-button> -->
<el-button type="primary" v-if="scope.row.status>0" size="small"
@click="showDetail('setPosition',scope.row)">设置班委</el-button>
<el-button type="primary" v-if="scope.row.status>0" size="small"
@click="showDetail('checkshow',scope.row)">查看</el-button>
@ -138,7 +138,8 @@
company_position: '',
company_area: '',
company_type: '',
company_industry: '',
company_industry: '',
education:'',
status: '',
apply_status: '',
page: 1,
@ -187,6 +188,11 @@
align: 'center',
width: 120,
}, {
prop: 'position',
label: '本班职务',
align: 'center',
width: 120,
},{
prop: 'score',
label: '评分',
align: 'center',
@ -231,7 +237,8 @@
company_position: this.select.company_position,
company_area: this.select.company_area,
company_type: this.select.company_type,
company_industry: this.select.company_industry,
company_industry: this.select.company_industry,
education:this.select.education,
filter: [{
key: 'course_id',
op: 'eq',
@ -266,7 +273,14 @@
download(
'/api/admin/course-signs/index',
'get', {
name: this.select.name,
name: this.select.name,
mobile: this.select.mobile,
company_name: this.select.company_name,
company_position: this.select.company_position,
company_area: this.select.company_area,
company_type: this.select.company_type,
company_industry: this.select.company_industry,
education:this.select.education,
export_fields: _export,
filter: [{
key: 'course_id',

@ -53,7 +53,7 @@
</template>
{{student_info.email?student_info.email:''}}
</el-descriptions-item>
<el-descriptions-item>
<el-descriptions-item :span="2">
<template slot="label">
公司名称
</template>
@ -64,7 +64,14 @@
职务
</template>
{{student_info.company_position?student_info.company_position:''}}
</el-descriptions-item>
</el-descriptions-item>
<el-descriptions-item v-if="type==='check' || type==='checkshow' || type==='setPosition'">
<template slot="label">
本班职务
</template>
{{sign_result.position?sign_result.position:''}}
</el-descriptions-item>
<!-- <el-descriptions-item :span="3">
<template slot="label">
证件照
@ -100,10 +107,10 @@
</div>
<template v-if="sign_info.length>0">
<lx-header v-if="type==='check' || type==='checkshow'" icon="" text="报名信息"
<lx-header v-if="type==='check' || type==='checkshow' || type==='setPosition'" icon="" text="报名信息"
style="margin-bottom: 10px; border: 0px; margin-top: 15px">
</lx-header>
<div v-if="type==='check' || type==='checkshow'">
<div v-if="type==='check' || type==='checkshow' || type==='setPosition'">
<el-descriptions class="margin-top" :column="2" border>
<template v-for="item in sign_info">
<el-descriptions-item :span="2" v-if="item.submit_files && item.submit_files.length>0">
@ -128,7 +135,8 @@
</el-descriptions>
</div>
</template>
<!-- 审核查看 -->
<lx-header v-if="type=='checkshow' || type=='check'" icon="" text="审核结果" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
</lx-header>
@ -164,8 +172,7 @@
</div>
</div>
</template>
<!-- 审核 -->
<template v-slot:status v-if="type=='check'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
@ -214,13 +221,24 @@
<el-input type="textarea" v-model="form.reason" placeholder="请输入备注"></el-input>
</div>
</div>
</template>
<!-- 设置班委 -->
<template v-slot:position v-if="type=='setPosition'">
<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="text" v-model="form.position" placeholder="请输入班委名称(如:班长)"></el-input>
</div>
</div>
</template>
<template v-slot:footerContent>
<el-button type="primary" style='margin-left:5px;margin-bottom:5px;' v-if="type=='check'"
<el-button type="primary" style='margin-left:5px;margin-bottom:5px;' v-if="type=='check' || type=='setPosition'"
@click="submit">确认</el-button>
<el-button type="primary" plain style='margin-left:5px;margin-bottom:5px;' v-else-if="type=='check'"
<el-button type="primary" plain style='margin-left:5px;margin-bottom:5px;' v-else-if="type=='check'|| type=='setPosition'"
@click="isShow=false">取消</el-button>
<el-button type="primary" plain style='margin-left:5px;margin-bottom:5px;' v-else-if="type=='show'||type=='checkshow'"
@click="isShow=false">关闭</el-button>
@ -266,7 +284,8 @@
status: 0,
score: '',
file_ids: [],
reason: '',
reason: '',
position:''
},
}
},
@ -305,11 +324,12 @@
status: this.form.status,
reason: this.form.reason,
score: this.form.score,
file_ids:this.form.file_ids
file_ids:this.form.file_ids,
position:this.form.position
}).then(res => {
this.$message({
type: 'success',
message: '审核成功'
message: this.type==='check' ? '审核成功' : '设置成功'
})
this.isShow = false
this.$emit('refresh')
@ -349,10 +369,16 @@
if (this.type === 'show') {
this.typeName = "查看个人明细"
this.getDetail()
console.log("row", this.row)
} else if (this.type === 'check' || this.type === 'checkshow') {
this.getSignDetail()
this.typeName = this.type === 'check' ? '审核' : '查看'
} else if (this.type === 'check' || this.type === 'checkshow' || this.type==='setPosition') {
this.getSignDetail()
if(this.type==='check'){
this.typeName = '审核'
}else if(this.type==='setPosition'){
this.typeName = '设置班委'
}else{
this.typeName = '查看'
}
}
} else {
this.id = ''

@ -135,7 +135,7 @@
</div>
<student-detail ref="studentDetail"></student-detail>
<imports ref="imports" :formInfo="table_item" :table-name="'users'" @refresh="getList"></imports>
<imports ref="imports" :table-name="'users'" @refresh="getList"></imports>
</div>
</template>

Loading…
Cancel
Save