add: onLineCourse

main
hcj 4 months ago
parent 5e238fb6e0
commit ed5c395643
  1. 2
      .env.development
  2. 1
      README.md
  3. BIN
      admin_test.zip
  4. 4
      src/api/trainService/index.js
  5. 5
      src/views/components/ToolEdit.vue
  6. 3
      src/views/trainService/attendanceList.vue
  7. 260
      src/views/trainService/courseManage.vue
  8. 15
      src/views/trainService/signInInfoList.vue
  9. 197
      src/views/trainService/signlist.vue
  10. 92
      src/views/trainService/signupStudent.vue

@ -5,7 +5,7 @@ ENV = 'development'
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/prod-api'
# VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/test-api' # VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/test-api'
VUE_APP_BASE_TARGET = 'http://192.168.0.230:9999' VUE_APP_BASE_TARGET = 'http://192.168.0.229:9999'
# VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/prod-api' # VUE_APP_BASE_TARGET = 'http://www.bjkeyware.com/prod-api'
# VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999' # VUE_APP_BASE_TARGET = 'http://192.168.0.129:9999'

@ -12,6 +12,7 @@ npm install
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 # 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npm.taobao.org npm install --registry=https://registry.npm.taobao.org
npm install --registry=https://registry.npmjs.org/
# 启动服务 # 启动服务
npm run dev npm run dev

Binary file not shown.

@ -317,10 +317,12 @@ export function exportAttendance(id) {
}) })
} }
// 导出所有签到信息 // 导出所有签到信息
export function exportSignIn(id) { export function exportSignIn(id,params) {
console.log(params);
return request({ return request({
url: '/course/admin/importSignIn/course/' + id, url: '/course/admin/importSignIn/course/' + id,
method: 'get', method: 'get',
params,
responseType: 'blob' responseType: 'blob'
}) })
} }

@ -33,14 +33,15 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="软件包" prop="packagePath" v-if="form.deliverType == 'License'"> <el-form-item label="软件包" prop="packagePath" v-if="form.deliverType == 'License'">
<el-input v-model="form.packagePath" v-show="false" :limit="1"></el-input> <el-input v-model="form.packagePath" placeholder="请输入软件包地址"></el-input>
<!-- <el-input v-model="form.packagePath" v-show="false" :limit="1"></el-input>
<nonimage-upload <nonimage-upload
ref="packageUpload" ref="packageUpload"
:limitRemark="',文件请选用压缩包格式'" :limitRemark="',文件请选用压缩包格式'"
:limit="1" :limit="1"
@setImgPath="setPackagePath" @setImgPath="setPackagePath"
imageType="zip|rar" imageType="zip|rar"
/> /> -->
</el-form-item> </el-form-item>
<el-form-item label="安装手册" prop="installDocPath" v-if="form.deliverType == 'License'"> <el-form-item label="安装手册" prop="installDocPath" v-if="form.deliverType == 'License'">
<el-input v-model="form.installDocPath" v-show="false" :limit="1"></el-input> <el-input v-model="form.installDocPath" v-show="false" :limit="1"></el-input>

@ -7,8 +7,9 @@
<el-table-column label="序号" type="index" /> <el-table-column label="序号" type="index" />
<el-table-column label="学生姓名" prop="studentName" align="center" /> <el-table-column label="学生姓名" prop="studentName" align="center" />
<el-table-column label="学号" prop="studentCode" align="center" /> <el-table-column label="学号" prop="studentCode" align="center" />
<el-table-column label="专业" prop="major" align="center" />
<el-table-column label="手机号" prop="mobile" align="center"> </el-table-column> <el-table-column label="手机号" prop="mobile" align="center"> </el-table-column>
<!-- <el-table-column label="签到次数" prop="createTime" align="center"></el-table-column> --> <el-table-column label="签到次数" prop="totalSign" align="center"></el-table-column>
<el-table-column label="实际签到次数" prop="signCount" align="center"></el-table-column> <el-table-column label="实际签到次数" prop="signCount" align="center"></el-table-column>
</el-table> </el-table>

@ -1,16 +1,9 @@
<template> <template>
<div class="container" style="padding: 30px"> <div class="container" style="padding: 30px">
<el-form <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"
:model="queryParams" style="display: flex; margin-left: 5px">
ref="queryForm"
:inline="true"
label-width="68px"
style="display: flex; margin-left: 5px"
>
<div style="margin-top: 5px; margin-bottom: 20px; margin-right: 5px"> <div style="margin-top: 5px; margin-bottom: 20px; margin-right: 5px">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="option({}, 'add')" <el-button type="primary" icon="el-icon-plus" size="mini" @click="option({}, 'add')">新增课程</el-button>
>新增课程</el-button
>
</div> </div>
<el-form-item label="课程" prop="courseId"> <el-form-item label="课程" prop="courseId">
<el-input v-model="queryParams.courseName"></el-input> <el-input v-model="queryParams.courseName"></el-input>
@ -32,12 +25,8 @@
<el-table-column label="上课时间" align="center" prop="courseTime" /> <el-table-column label="上课时间" align="center" prop="courseTime" />
<el-table-column label="课程资料" align="center"> <el-table-column label="课程资料" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div <div v-for="name in scope.row.attachments" :key="name.fileId" @click="downLoadSource(name)"
v-for="name in scope.row.attachments" class="sourceItem">
:key="name.fileId"
@click="downLoadSource(name)"
class="sourceItem"
>
{{ name.fileName }} {{ name.fileName }}
</div> </div>
</template> </template>
@ -57,91 +46,103 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
v-show="total > 0" :limit.sync="queryParams.pageSize" @pagination="getList" />
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog <el-dialog class="diaform" :title="title" :visible.sync="visibleopen" :close-on-click-modal="false"
class="diaform" append-to-body width="700px" @open="openDia" @close="closeDia">
:title="title"
:visible.sync="visibleopen"
:close-on-click-modal="false"
append-to-body
width="700px"
@open="openDia"
@close="closeDia"
>
<div v-if="optionType == 'signIn'"> <div v-if="optionType == 'signIn'">
<vueQr :signInInfo="JSON.stringify(signInInfo)"></vueQr> <vueQr :signInInfo="JSON.stringify(signInInfo)"></vueQr>
</div> </div>
<el-form v-else :model="courseForm" :rules="rules" ref="form" label-width="150px" text-align:center> <el-form v-else :model="courseForm" :rules="rules" ref="courseForm" label-width="150px" text-align:center>
<el-form-item label="所属班级" prop="classId"> <el-form-item label="所属班级" prop="classId">
<el-select v-model="courseForm.classId" placeholder="请选择班级" clearable> <el-select v-model="courseForm.classId" filterable placeholder="请选择" @change="classChange">
<el-option <el-option v-for="item in classList" :key="item.trainClassId" :label="item.trainClassName"
v-for="item in classList" :value="item.trainClassId">
:key="item.trainClassId" </el-option>
:label="item.trainClassName"
:value="item.trainClassId"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="课程名称" prop="courseName"> <el-form-item label="课程名称" prop="courseName">
<el-input class="courseName" v-model="courseForm.courseName"></el-input> <el-input class="courseName" placeholder="请输入课堂名称" v-model="courseForm.courseName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="课堂老师" prop="instructor"> <el-form-item label="课堂老师" prop="instructor" v-if="classType != 4">
<el-select v-model="courseForm.instructor" placeholder="请选择老师" clearable> <el-select v-model="courseForm.instructor" placeholder="请选择老师" clearable>
<el-option <el-option v-for="item in teacherList" :key="item.talent_id" :label="item.name"
v-for="item in teacherList" :value="item.name"></el-option>
:key="item.talent_id"
:label="item.name"
:value="item.name"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="职称" prop="title" v-if="classType == 4">
<el-input class="courseName" v-model="courseForm.title" placeholder="请输入职称"></el-input>
</el-form-item>
<el-form-item label="授课老师" prop="instructor" v-if="classType == 4">
<el-autocomplete class="inline-input" v-model="courseForm.instructor"
:fetch-suggestions="querySearch" placeholder="请输入授课老师" @select="handleSelect">
<template slot-scope="{ item }">
<span class="addr">{{ item.name }}</span>
</template></el-autocomplete>
</el-form-item>
<el-form-item label="上课时间" prop="courseTime"> <el-form-item label="上课时间" prop="courseTime">
<el-date-picker <el-date-picker v-model="courseForm.courseTime" type="datetime" format="yyyy-MM-dd HH:mm:ss"
v-model="courseForm.courseTime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间">
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="课程资料" prop="attachments"> <el-form-item label="授课内容" prop="courseContent" v-if="classType == 4">
<el-input v-model="courseForm.courseContent" placeholder="请输入授课内容" type="textarea"
:rows="2"></el-input>
</el-form-item>
<el-form-item label="授课链接" prop="url" v-if="classType == 4">
<el-input class="courseName" v-model="courseForm.url" placeholder="请输入授课链接"></el-input>
</el-form-item>
<el-form-item label="是否付费" prop="isPay" v-if="classType == 4">
<!-- <el-cascader v-model="courseForm.isPay" :options="payOptions"
@change="payHandleChange"></el-cascader> -->
<el-select v-model="courseForm.isPay" placeholder="请选择是否付费">
<el-option label="付费" value="1"></el-option>
<el-option label="免费" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="支付方式" prop="payMethods" v-if="classType == 4 && courseForm.isPay == 1">
<!-- <el-cascader v-model="courseForm.isPay" :options="payOptions"
@change="payHandleChange"></el-cascader> -->
<el-select v-model="courseForm.payMethods" placeholder="请选择是否付费">
<el-option label="费用" value="1"></el-option>
<el-option label="口令" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item label="费用" prop="amount"
v-if="classType == 4 && courseForm.isPay == 1 && courseForm.payMethods == '1'">
<el-input v-model="courseForm.amount" type="number" placeholder="请输入费用"></el-input>
</el-form-item>
<el-form-item label="口令" prop="password"
v-if="classType == 4 && courseForm.isPay == 1 && courseForm.payMethods == '2'">
<el-input v-model="courseForm.password" placeholder="请输入口令"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark" v-if="classType == 4">
<el-input v-model="courseForm.remark" placeholder="请输入备注"></el-input>
</el-form-item>
<el-form-item label="课程资料" prop="attachments" v-if="classType != 4">
<div> <div>
<fileUpload <fileUpload ref="fileUpload" v-model="courseForm.attachments" listtype="picture-card"
ref="fileUpload" :fileType="['rar']" class="widthFix" fileName="publicize" :limit="3" />
v-model="courseForm.attachments"
listtype="picture-card"
:fileType="['rar']"
class="widthFix"
fileName="publicize"
:limit="3"
/>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item style="margin-top: 80px; text-align: center; margin-left: -150px"> <el-form-item style="margin-top: 80px; text-align: center; margin-left: -150px">
<el-button <el-button type="primary" style="width: 135px; font-size: 16px; height: 39px; line-height: 11px"
type="primary" @click="submitto('confirm')">确认</el-button>
style="width: 135px; font-size: 16px; height: 39px; line-height: 11px" <el-button style="width: 135px; font-size: 16px; height: 39px; line-height: 11px; margin-left: 30px"
@click="submitto('confirm')" @click="closeDia">取消</el-button>
>确认</el-button
>
<el-button
style="width: 135px; font-size: 16px; height: 39px; line-height: 11px; margin-left: 30px"
@click="closeDia"
>取消</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
@ -173,6 +174,13 @@ const courseRule = {
classId: [{ required: true, message: '请选择班级', trigger: 'change' }], classId: [{ required: true, message: '请选择班级', trigger: 'change' }],
instructor: [{ required: true, message: '请选择任课老师', trigger: 'change' }], instructor: [{ required: true, message: '请选择任课老师', trigger: 'change' }],
courseTime: [{ required: true, trigger: 'change', message: '请输入上课时间' }], courseTime: [{ required: true, trigger: 'change', message: '请输入上课时间' }],
courseContent: [{ required: true, message: '请输入课程内容', trigger: 'blur' }],
password: [{ required: true, message: '请输入口令', trigger: 'blur' }],
amount: [{ required: true, message: '请输入付款金额', trigger: 'blue' }],
isPay: [{ required: true, message: '请输入选择授课方法', trigger: 'change' }],
url: [{ required: true, message: '请输入课程链接', trigger: 'blur' }],
title: [{ required: true, message: '请输入职称', trigger: 'blur' }],
payMethods: [{ required: true, message: '请输入支付方式', trigger: 'change' }]
} }
export default { export default {
components: { fileUpload, vueQr }, components: { fileUpload, vueQr },
@ -219,9 +227,46 @@ export default {
title: '', title: '',
visibleopen: false, visibleopen: false,
rules: courseRule, rules: courseRule,
classType: 0,
// payOptions: [
// {
// value: '1',
// label: '',
// children: [{
// key: '0',
// value: '1-1',
// label: ''
// }, {
// key: '0',
// value: '1-2',
// label: ''
// }]
// },
// {
// value: '0',
// label: '',
// }],
payMethods: '0'
} }
}, },
methods: { methods: {
querySearch(queryString, cb) {
var restaurants = this.teacherList;
console.log(restaurants);
var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
// callback
cb(results);
},
createFilter(queryString) {
return (restaurant) => {
return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},
handleSelect(item) {
this.courseForm.instructor = item.name
console.log(item);
},
async getList() { async getList() {
const res = await getCourseList(this.queryParams) const res = await getCourseList(this.queryParams)
this.total = res.total this.total = res.total
@ -236,6 +281,23 @@ export default {
} }
this.getList() this.getList()
}, },
// payHandleChange(e) {
// this.courseForm.isPay = e[0]
// if (e[1]) {
// this.payMethods = e[1]
// }
// console.log(e);
// },
classChange(e) {
const result = this.classList.find(item => {
console.log(item);
return item.trainClassId == e
})
if (result) {
this.classType = result.classType
}
console.log(this.courseForm);
},
downLoadSource(params) { downLoadSource(params) {
const url = params.filePath const url = params.filePath
if (!url) { if (!url) {
@ -250,7 +312,15 @@ export default {
switch (type) { switch (type) {
case 'motify': case 'motify':
this.courseForm = deepClone(row) this.courseForm = deepClone(row)
this.initDialog() this.initDialog(this.courseForm.classId)
// 线
// console.log(this.classList);
// const result = this.classList.find(item => {
// console.log(item);
// return item.trainClassId == this.courseForm.classId
// })
// console.log(result);
// this.classType = result.classType
break break
case 'delete': case 'delete':
this.deleteRow(row) this.deleteRow(row)
@ -263,10 +333,11 @@ export default {
break break
case 'siginList': case 'siginList':
// this.id = row.courseId // this.id = row.courseId
console.log(row);
this.$router.push({ this.$router.push({
path: '/signInInfoList', path: '/signInInfoList',
query: { query: {
name: row.className, name: row.courseName,
id: row.courseId, id: row.courseId,
}, },
}) })
@ -278,7 +349,7 @@ export default {
}, },
// //
submitto() { submitto() {
this.$refs['form'].validate((valid) => { this.$refs['courseForm'].validate((valid) => {
if (valid) { if (valid) {
this.submit() this.submit()
} else { } else {
@ -289,6 +360,15 @@ export default {
}, },
async submit() { async submit() {
const data = deepClone(this.courseForm) const data = deepClone(this.courseForm)
if (data.amount) {
data.amount = data.amount * 1
}
if (this.classType == 4) {
data.classType = '4'
delete data.payMethods
}
if (this.courseForm.courseId) { if (this.courseForm.courseId) {
const res = await putCourseItem(data) const res = await putCourseItem(data)
res.code == 200 && this.$message.success('修改成功') res.code == 200 && this.$message.success('修改成功')
@ -300,11 +380,16 @@ export default {
this.getList() this.getList()
}, },
// dialog init // dialog init
async initDialog() { async initDialog(val) {
console.log(val);
const classRes = await getClassList() const classRes = await getClassList()
this.classList = classRes.data
if (val) {
this.classChange(val)
}
const teacherRes = await listTeacherAll() const teacherRes = await listTeacherAll()
this.teacherList = teacherRes this.teacherList = teacherRes
this.classList = classRes.data
}, },
openDia() { openDia() {
if (this.optionType === 'motify') { if (this.optionType === 'motify') {
@ -313,14 +398,19 @@ export default {
}, },
// //
closeDia() { closeDia() {
this.$refs['form']?.resetFields() this.$refs['courseForm']?.resetFields()
Object.keys(this.courseForm).forEach((item) => { Object.keys(this.courseForm).forEach((item) => {
if (Array.isArray(this.courseForm[item])) { if (Array.isArray(this.courseForm[item])) {
this.courseForm[item] = [] if (item == 'remark') {
this.courseForm[item] = ''
} else {
this.courseForm[item] = []
}
} else { } else {
this.courseForm[item] = '' this.courseForm[item] = ''
} }
}) })
this.classType = 0
this.$refs.fileUpload?.reset() this.$refs.fileUpload?.reset()
this.visibleopen = false this.visibleopen = false
}, },
@ -361,11 +451,13 @@ export default {
.courseName { .courseName {
width: 220px; width: 220px;
} }
.sourceItem { .sourceItem {
color: #1890ff; color: #1890ff;
cursor: pointer; cursor: pointer;
text-decoration: underline; text-decoration: underline;
} }
.sourceItem:hover { .sourceItem:hover {
color: #0e4272; color: #0e4272;
cursor: pointer; cursor: pointer;

@ -12,13 +12,12 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px" @click="excelExport" <el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px" @click="excelExport">导出为excel</el-button>
>导出为excel</el-button
>
<el-table v-loading="loading" :data="signinList"> <el-table v-loading="loading" :data="signinList">
<el-table-column label="序号" type="index" /> <el-table-column label="序号" type="index" />
<el-table-column label="学生姓名" prop="studenName" align="center" /> <el-table-column label="学生姓名" prop="studenName" align="center" />
<el-table-column label="学号" prop="studenCode" align="center" /> <el-table-column label="学号" prop="studenCode" align="center" />
<el-table-column label="专业" prop="major" align="center" />
<el-table-column label="手机号" prop="mobile" align="center"> </el-table-column> <el-table-column label="手机号" prop="mobile" align="center"> </el-table-column>
<el-table-column label="时间" prop="createTime" align="center"></el-table-column> <el-table-column label="时间" prop="createTime" align="center"></el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
@ -62,6 +61,10 @@ export default {
studenName: '', studenName: '',
studenCode: '', studenCode: '',
}, },
exportParams: {
studenName: '',
studenCode: '',
},
} }
}, },
methods: { methods: {
@ -72,9 +75,9 @@ export default {
this.signinList = res.rows this.signinList = res.rows
}, },
async excelExport() { async excelExport() {
const res = await exportSignIn(this.id) const res = await exportSignIn(this.id,this.exportParams)
const blob = new Blob([res]) const blob = new Blob([res])
saveAs(blob, this.name + '签到记录.xlsx') saveAs(blob, this.name + '-签到记录.xlsx')
//this.$route.query.name //this.$route.query.name
// this.download(res) // this.download(res)
}, },
@ -95,6 +98,8 @@ export default {
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.signIninit() this.signIninit()
this.exportParams.studenName = this.queryParams.studenName
this.exportParams.studenCode = this.queryParams.studenCode
}, },
resetQuery() { resetQuery() {
this.resetForm('queryForm') this.resetForm('queryForm')

@ -1,31 +1,17 @@
<template> <template>
<div class="container" style="padding: 30px"> <div class="container" style="padding: 30px">
<el-form <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px"
:model="queryParams" style="display: flex; justify-content: space-between">
ref="queryForm"
:inline="true"
label-width="68px"
style="display: flex; justify-content: space-between"
>
<div style="display: flex"> <div style="display: flex">
<el-form-item label="学校名称" prop="schoolName"> <el-form-item label="学校名称" prop="schoolName">
<!-- <el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable size="small" /> --> <!-- <el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable size="small" /> -->
<el-select v-model="queryParams.schoolName"> <el-select v-model="queryParams.schoolName">
<el-option <el-option v-for="it in schoolList" :key="it.schoolId" :label="it.schoolName"
v-for="it in schoolList" :value="it.schoolName"></el-option>
:key="it.schoolId"
:label="it.schoolName"
:value="it.schoolName"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班级名称" prop="trainClassName"> <el-form-item label="班级名称" prop="trainClassName">
<el-input <el-input v-model="queryParams.trainClassName" placeholder="请输入班级名称" clearable size="small" />
v-model="queryParams.trainClassName"
placeholder="请输入班级名称"
clearable
size="small"
/>
</el-form-item> </el-form-item>
<el-form-item label="班级类型" prop="classType"> <el-form-item label="班级类型" prop="classType">
<!-- <el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable size="small" /> --> <!-- <el-input v-model="queryParams.schoolName" placeholder="请输入学校名称" clearable size="small" /> -->
@ -35,6 +21,7 @@
<el-option label="线下培训进阶班" :value="1"></el-option> <el-option label="线下培训进阶班" :value="1"></el-option>
<el-option label="可靠性人才培训班" :value="2"></el-option> <el-option label="可靠性人才培训班" :value="2"></el-option>
<el-option label="师资培训班" :value="3"></el-option> <el-option label="师资培训班" :value="3"></el-option>
<el-option label="线上培训班" :value="4"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -71,6 +58,7 @@
{{ (scope.row.registrationEndTime && scope.row.registrationEndTime.slice(0, 10)) || '未录入' }} {{ (scope.row.registrationEndTime && scope.row.registrationEndTime.slice(0, 10)) || '未录入' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="培训开始时间" align="center" prop="trainStartTime"> <el-table-column label="培训开始时间" align="center" prop="trainStartTime">
<template slot-scope="scope"> <template slot-scope="scope">
{{ (scope.row.trainStartTime && scope.row.trainStartTime.slice(0, 10)) || '未录入' }} {{ (scope.row.trainStartTime && scope.row.trainStartTime.slice(0, 10)) || '未录入' }}
@ -105,59 +93,39 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="200"> <el-table-column label="操作" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" v-if="scope.row.classType == 3" @click="setSignTab(scope.row)" <el-button size="mini" type="text" v-if="scope.row.classType == 3"
>配置报名表</el-button @click="setSignTab(scope.row)">配置报名表</el-button>
>
<el-button size="mini" type="text" @click="modify(scope.row)">修改</el-button> <el-button size="mini" type="text" @click="modify(scope.row)">修改</el-button>
<el-button size="mini" type="text" @click="delrow(scope.row)">删除</el-button> <el-button size="mini" type="text" @click="delrow(scope.row)">删除</el-button>
<el-button size="mini" type="text" @click="option(scope.row)">考勤</el-button> <el-button size="mini" type="text" @click="option(scope.row)">考勤</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
v-show="total > 0" :limit.sync="queryParams.pageSize" @pagination="getList" />
:total="total" <el-dialog class="diaform" :title="title" :visible.sync="visibleopen" :close-on-click-modal="false"
:page.sync="queryParams.pageNum" width="800px" append-to-body @close="colsedia">
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog
class="diaform"
:title="title"
:visible.sync="visibleopen"
:close-on-click-modal="false"
width="800px"
append-to-body
@close="colsedia"
>
<el-form :model="form" :rules="rules" ref="form" label-width="120px" inline> <el-form :model="form" :rules="rules" ref="form" label-width="120px" inline>
<!-- 类型 --> <!-- 类型 -->
<el-form-item label="培训班类型" prop="classType"> <el-form-item label="培训班类型" prop="classType">
<el-select v-model="form.classType"> <el-select v-model="form.classType" @change="classTypeChange">
<el-option label="校企合作班" :value="0"></el-option> <el-option label="校企合作班" :value="0"></el-option>
<el-option label="线下培训进阶班" :value="1"></el-option> <el-option label="线下培训进阶班" :value="1"></el-option>
<el-option label="可靠性人才培训班" :value="2"></el-option> <el-option label="可靠性人才培训班" :value="2"></el-option>
<el-option label="师资培训班" :value="3"></el-option> <el-option label="师资培训班" :value="3"></el-option>
<el-option label="线上培训班" :value="4"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="培训教师" prop="teacherName"> <el-form-item label="培训教师" prop="teacherName" v-if="form.classType != 4">
<el-select allow-create filterable v-model="form.teacherName"> <el-select allow-create filterable v-model="form.teacherName">
<el-option <el-option v-for="it in teacherList" :key="it.talent_id" :label="it.name"
v-for="it in teacherList" :value="it.name"></el-option>
:key="it.talent_id"
:label="it.name"
:value="it.name"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="学校名称" prop="schoolId" v-if="form.classType == 0"> <el-form-item label="学校名称" prop="schoolId" v-if="form.classType == 0">
<el-select v-model="form.schoolId"> <el-select v-model="form.schoolId">
<el-option <el-option v-for="it in schoolList" :key="it.schoolId" :label="it.schoolName"
v-for="it in schoolList" :value="it.schoolId"></el-option>
:key="it.schoolId"
:label="it.schoolName"
:value="it.schoolId"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班级代号" prop="trainClassCode" v-if="form.classType == 0"> <el-form-item label="班级代号" prop="trainClassCode" v-if="form.classType == 0">
@ -167,7 +135,7 @@
<el-form-item label="班级名称" prop="trainClassName"> <el-form-item label="班级名称" prop="trainClassName">
<el-input v-model="form.trainClassName" placeholder="请输入班级名称" clearable size="small" /> <el-input v-model="form.trainClassName" placeholder="请输入班级名称" clearable size="small" />
</el-form-item> </el-form-item>
<el-form-item label="班级等级" prop="classLevel" v-if="form.classType != 0"> <el-form-item label="班级等级" prop="classLevel" v-if="(form.classType != 0) && (form.classType != 4)">
<el-select v-model="form.classLevel"> <el-select v-model="form.classLevel">
<el-option label="初级" :value="0"></el-option> <el-option label="初级" :value="0"></el-option>
<el-option label="中级" :value="1"></el-option> <el-option label="中级" :value="1"></el-option>
@ -175,98 +143,56 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="班级人数" prop="classSize"> <el-form-item label="班级人数" prop="classSize" v-if="form.classType != 4">
<el-input v-model="form.classSize" placeholder="请输入班级人数" clearable size="small" /> <el-input v-model="form.classSize" placeholder="请输入班级人数" clearable size="small" />
</el-form-item> </el-form-item>
<!-- 是否限制人数 --> <!-- 是否限制人数 -->
<el-form-item label="是否限制人数" prop="limitApply" class="limitApply"> <el-form-item label="是否限制人数" prop="limitApply" class="limitApply" v-if="form.classType != 4">
<el-radio-group v-model="form.limitApply"> <el-radio-group v-model="form.limitApply">
<el-radio label="1"></el-radio> <el-radio label="1"></el-radio>
<el-radio label="0"></el-radio> <el-radio label="0"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="报名开始时间" prop="registrationStartTime"> <el-form-item label="报名开始时间" prop="registrationStartTime" v-if="form.classType != 4">
<el-date-picker <el-date-picker clearable size="small" v-model="form.registrationStartTime" type="date"
clearable value-format="yyyy-MM-dd HH:mm:ss" placeholder="报名开始时间">
size="small"
v-model="form.registrationStartTime"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="报名开始时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="报名结束时间" prop="registrationEndTime"> <el-form-item label="报名结束时间" prop="registrationEndTime" v-if="form.classType != 4">
<el-date-picker <el-date-picker clearable size="small" v-model="form.registrationEndTime" type="date"
clearable value-format="yyyy-MM-dd HH:mm:ss" placeholder="报名结束时间">
size="small"
v-model="form.registrationEndTime"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="报名结束时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="培训开始时间" prop="trainStartTime"> <el-form-item label="培训开始时间" prop="trainStartTime">
<el-date-picker <el-date-picker clearable size="small" v-model="form.trainStartTime" type="date"
clearable value-format="yyyy-MM-dd HH:mm:ss" placeholder="培训开始时间">
size="small"
v-model="form.trainStartTime"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="培训开始时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="培训结束时间" prop="trainEndTime"> <el-form-item label="培训结束时间" prop="trainEndTime">
<el-date-picker <el-date-picker clearable size="small" v-model="form.trainEndTime" type="date"
clearable value-format="yyyy-MM-dd HH:mm:ss" placeholder="培训结束时间">
size="small"
v-model="form.trainEndTime"
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="培训结束时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item label="资料" prop="attachment" v-if="form.classType == 0"> <el-form-item label="资料" prop="attachment" v-if="form.classType == 0">
<el-input v-model="form.attachment" v-show="false" :limit="1"></el-input> <el-input v-model="form.attachment" v-show="false" :limit="1"></el-input>
<nonimage-upload <nonimage-upload ref="packageUpload" :limitRemark="',文件请选用压缩包格式'" :limit="1"
ref="packageUpload" @setImgPath="setPackagePath" imageType="zip|rar" />
:limitRemark="',文件请选用压缩包格式'"
:limit="1"
@setImgPath="setPackagePath"
imageType="zip|rar"
/>
</el-form-item> </el-form-item>
<!-- 编辑json --> <!-- 编辑json -->
<el-form-item style="padding-left: 170px"> <el-form-item style="padding-left: 170px">
<el-button <el-button type="primary" style="width: 135px; font-size: 16px; height: 39px; line-height: 11px"
type="primary" @click="submitto('confirm')">确认</el-button>
style="width: 135px; font-size: 16px; height: 39px; line-height: 11px" <el-button style="width: 135px; font-size: 16px; height: 39px; line-height: 11px; margin-left: 30px"
@click="submitto('confirm')" @click="colsedia">取消</el-button>
>确认</el-button
>
<el-button
style="width: 135px; font-size: 16px; height: 39px; line-height: 11px; margin-left: 30px"
@click="colsedia"
>取消</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
<!-- 详细学生信息弹层 --> <!-- 详细学生信息弹层 -->
<el-dialog <el-dialog class="diaform" title="报名学生信息" :visible.sync="studentOpen" :close-on-click-modal="false"
class="diaform" width="1200px" append-to-body>
title="报名学生信息"
:visible.sync="studentOpen"
:close-on-click-modal="false"
width="1200px"
append-to-body
>
<el-table :data="studentList"> <el-table :data="studentList">
<el-table-column label="序号" align="center" type="index" /> <el-table-column label="序号" align="center" type="index" />
<el-table-column label="学号" align="center" prop="studentCode" v-if="activeR.classType == 0" /> <el-table-column label="学号" align="center" prop="studentCode" v-if="activeR.classType == 0" />
@ -276,22 +202,11 @@
<el-table-column label="手机号" align="center" prop="mobile" /> <el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="报名时间" align="center" prop="registrationTime" /> <el-table-column label="报名时间" align="center" prop="registrationTime" />
</el-table> </el-table>
<pagination <pagination v-show="totals > 0" :total="totals" :page.sync="queryParamss.pageNum"
v-show="totals > 0" :limit.sync="queryParamss.pageSize" @pagination="getStudentList" />
:total="totals"
:page.sync="queryParamss.pageNum"
:limit.sync="queryParamss.pageSize"
@pagination="getStudentList"
/>
</el-dialog> </el-dialog>
<!-- json弹层 --> <!-- json弹层 -->
<el-dialog <el-dialog title="报名表配置" :visible.sync="signTable" :close-on-click-modal="false" width="800px" append-to-body>
title="报名表配置"
:visible.sync="signTable"
:close-on-click-modal="false"
width="800px"
append-to-body
>
<JsonTool ref="jsontool" /> <JsonTool ref="jsontool" />
<div> <div>
name为标题type为类型(input输入框;radio单选框;textarea文本域)key为标题标识须一致value为单选框选项 name为标题type为类型(input输入框;radio单选框;textarea文本域)key为标题标识须一致value为单选框选项
@ -376,7 +291,7 @@ export default {
} }
}, },
mounted() {}, mounted() { },
methods: { methods: {
// json // json
setSignTab(row) { setSignTab(row) {
@ -407,7 +322,7 @@ export default {
this.getList() this.getList()
this.signTable = false this.signTable = false
}) })
.catch((error) => {}) .catch((error) => { })
} else { } else {
this.$message.warning('请检查JSON数据格式') this.$message.warning('请检查JSON数据格式')
} }
@ -445,6 +360,14 @@ export default {
this.title = '修改班级' this.title = '修改班级'
this.visibleopen = true this.visibleopen = true
this.form = row this.form = row
// 线
if (row.classType == 4) {
this.rules.trainStartTime = []
this.rules.trainEndTime = []
} else {
this.rules.trainStartTime = [{ required: true, message: '培训开始时间', trigger: 'blur' }]
this.rules.trainEndTime = [{ required: true, message: '培训结束时间', trigger: 'blur' }]
}
// //
if (row.attachment) { if (row.attachment) {
let packageFile = [ let packageFile = [
@ -481,7 +404,7 @@ export default {
this.$message.success('删除成功') this.$message.success('删除成功')
}) })
}) })
.catch(() => {}) .catch(() => { })
}, },
// //
async submitto() { async submitto() {
@ -538,6 +461,16 @@ export default {
this.studentList = res.rows this.studentList = res.rows
this.totals = res.total this.totals = res.total
}, },
classTypeChange(e) {
console.log(e);
if (e == 4) {
this.rules.trainStartTime = []
this.rules.trainEndTime = []
} else {
this.rules.trainStartTime = [{ required: true, message: '培训开始时间', trigger: 'blur' }]
this.rules.trainEndTime = [{ required: true, message: '培训结束时间', trigger: 'blur' }]
}
}
}, },
created() { created() {
this.getList() this.getList()

@ -16,31 +16,52 @@
<el-form-item label="专业" prop="majorName" v-if="$route.query.type == 0"> <el-form-item label="专业" prop="majorName" v-if="$route.query.type == 0">
<el-input v-model="queryParamss.majorName" placeholder="请输入专业" clearable size="small" /> <el-input v-model="queryParamss.majorName" placeholder="请输入专业" clearable size="small" />
</el-form-item> </el-form-item>
<el-form-item label="结课报告" prop="majorName" v-if="$route.query.type == 0">
<el-select v-model="queryParamss.major" placeholder="" style="width: 100px;">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px" @click="exporExcel" <el-button icon="el-icon-download" type="warning" size="small" style="margin-bottom: 20px"
>导出为excel</el-button @click="exporExcel">导出为excel</el-button>
> <el-button icon="el-icon-download" type="primary" size="small" style="margin-bottom: 20px"
@click="downloadReport('multify')">下载</el-button>
<!-- 详细学生信息弹层 --> <!-- 详细学生信息弹层 -->
<el-table v-if="$route.query.type != 3" :data="studentList" v-loading="loading"> <el-table v-if="$route.query.type != 3" :data="studentList" v-loading="loading"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="序号" align="center" type="index" /> <el-table-column label="序号" align="center" type="index" />
<el-table-column label="学号" align="center" prop="studentCode" v-if="$route.query.type == 0" /> <el-table-column label="学号" align="center" prop="studentCode" v-if="$route.query.type == 0" />
<el-table-column label="姓名" align="center" prop="studentName" /> <el-table-column label="姓名" align="center" prop="studentName" />
<el-table-column label="性别" align="center" prop="sex">
<template slot-scope="scope">
<div v-show="scope.row.sex === '0'"></div>
<div v-show="scope.row.sex === '1'"></div>
</template>
</el-table-column>
<!-- <el-table-column label="所属学院" align="center" prop="homeCollege" v-if="$route.query.type == 0" /> --> <!-- <el-table-column label="所属学院" align="center" prop="homeCollege" v-if="$route.query.type == 0" /> -->
<el-table-column label="专业名称" align="center" prop="majorName" v-if="$route.query.type == 0" /> <el-table-column label="专业名称" align="center" prop="majorName" v-if="$route.query.type == 0" />
<el-table-column label="手机号" align="center" prop="mobile" /> <el-table-column label="手机号" align="center" prop="mobile" />
<el-table-column label="辅导员" align="center" prop="counsellor" v-if="$route.query.type == 0" /> <el-table-column label="辅导员" align="center" prop="counsellor" v-if="$route.query.type == 0" />
<el-table-column label="辅导员联系方式" align="center" prop="counsellorTel" v-if="$route.query.type == 0" /> <el-table-column label="辅导员联系方式" align="center" prop="counsellorTel" v-if="$route.query.type == 0" />
<el-table-column label="报名时间" align="center" prop="registrationTime" /> <el-table-column label="报名时间" align="center" prop="registrationTime" />
<el-table-column label="结课报告" align="center" prop="registrationTime">
<template slot-scope="scope">
<div style="color: #1890ff;cursor: pointer;" @click="downloadReport(scope.row.reportAttachment)">{{
scope.row.reportName ? scope.row.reportName : '' }}
</div>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" v-if="scope.row.remark" @click="editRemark(scope.row)" <el-button size="mini" type="text" v-if="scope.row.remark"
>修改备注</el-button @click="editRemark(scope.row)">修改备注</el-button>
>
<el-button size="mini" type="text" v-else @click="addRemark(scope.row)">添加备注</el-button> <el-button size="mini" type="text" v-else @click="addRemark(scope.row)">添加备注</el-button>
<el-button size="mini" type="text" @click="delRow(scope.row)">删除</el-button> <el-button size="mini" type="text" @click="delRow(scope.row)">删除</el-button>
</template> </template>
@ -51,31 +72,18 @@
<el-table-column v-for="it in headerList" :key="it" :label="headerData[it]" align="center" :prop="it" /> <el-table-column v-for="it in headerList" :key="it" :label="headerData[it]" align="center" :prop="it" />
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" v-if="scope.row.remark" @click="editRemark(scope.row)" <el-button size="mini" type="text" v-if="scope.row.remark"
>修改备注</el-button @click="editRemark(scope.row)">修改备注</el-button>
>
<el-button size="mini" type="text" v-else @click="addRemark(scope.row)">添加备注</el-button> <el-button size="mini" type="text" v-else @click="addRemark(scope.row)">添加备注</el-button>
<el-button size="mini" type="text" @click="delRow(scope.row)">删除</el-button> <el-button size="mini" type="text" @click="delRow(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="totals > 0" :total="totals" :page.sync="queryParamss.pageNum"
v-show="totals > 0" :limit.sync="queryParamss.pageSize" @pagination="getStudentList" />
:total="totals"
:page.sync="queryParamss.pageNum"
:limit.sync="queryParamss.pageSize"
@pagination="getStudentList"
/>
<!-- 弹层 --> <!-- 弹层 -->
<el-dialog <el-dialog class="diaform" :title="title" :visible.sync="visibleopen" :close-on-click-modal="false"
class="diaform" width="500px" append-to-body @close="colsedia">
:title="title"
:visible.sync="visibleopen"
:close-on-click-modal="false"
width="500px"
append-to-body
@close="colsedia"
>
<el-form :model="form" :rules="rules" ref="form"> <el-form :model="form" :rules="rules" ref="form">
<!-- 类型 --> <!-- 类型 -->
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
@ -99,6 +107,7 @@ export default {
return { return {
loading: false, loading: false,
// //
multipleSelection: [],
queryParamss: { queryParamss: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
@ -109,19 +118,23 @@ export default {
counsellorTel: null, counsellorTel: null,
}, },
totals: 0, totals: 0,
options: [
{ value: 0, label: '是' },
{ value: 1, label: '否' }
],
studentList: [], studentList: [],
// //
title: '添加备注', title: '添加备注',
visibleopen: false, visibleopen: false,
form: {}, form: {},
rules: { rules: {
remark: [{ required: true, message: '请输入备注', trigger: 'blur' }], // remark: [{ required: true, message: '', trigger: 'blur' }],
}, },
rowId: null, rowId: null,
teacherList: [], // teacherList: [], //
// //
headerList: [], headerList: [],
base: process.env.VUE_APP_BASE,
headerData: {}, headerData: {},
} }
}, },
@ -210,7 +223,7 @@ export default {
this.$message.success('删除成功') this.$message.success('删除成功')
}) })
}) })
.catch(() => {}) .catch(() => { })
}, },
// //
addRemark(row) { addRemark(row) {
@ -250,10 +263,25 @@ export default {
saveAs(blob, this.$route.query.name + '报名表.xlsx') saveAs(blob, this.$route.query.name + '报名表.xlsx')
}) })
}, },
handleSelectionChange(val) {
this.multipleSelection = val;
},
downloadReport(val) {
if (val === 'multify') {
const self = this
this.multipleSelection.forEach(item => {
if (item.reportAttachment) {
console.log(item.reportAttachment);
window.open(this.base + item.reportAttachment)
}
})
} else if (val) {
window.open(this.base + val)
}
}
}, },
created() {}, created() { },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

Loading…
Cancel
Save