From 5fdf8645f25a533363ec1c22913873507ad05a50 Mon Sep 17 00:00:00 2001
From: lion <120344285@qq.com>
Date: Thu, 12 Sep 2024 20:18:31 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/component/imports.vue | 13 +-
src/views/course/apply_list.vue | 20 ++-
src/views/course/attendance.vue | 6 +-
src/views/course/class.vue | 9 +-
src/views/course/components/addClass.vue | 26 ++-
src/views/course/components/applyForm.vue | 199 +++++++++++-----------
src/views/course/txl.vue | 2 +-
src/views/student/components/detail.vue | 4 +-
8 files changed, 160 insertions(+), 119 deletions(-)
diff --git a/src/views/component/imports.vue b/src/views/component/imports.vue
index 97a99ca..472c809 100644
--- a/src/views/component/imports.vue
+++ b/src/views/component/imports.vue
@@ -129,7 +129,7 @@
// 学员 + 课程
if (this.tableName === 'users') {
b.unshift({
- key: 'status',
+ key: 'status_name',
title: '审核状态',
width: 120
});
@@ -196,12 +196,11 @@
})
}
// 学员导入
- if (this.tableName === 'users') {
- response.map(item => {
- item.is_schoolmate = 1
- item.username = item.name
- })
- }
+ // if (this.tableName === 'users') {
+ // response.map(item => {
+ // item.username = item.name
+ // })
+ // }
this.tableList = response;
this.fileList = fileList
this.$message({
diff --git a/src/views/course/apply_list.vue b/src/views/course/apply_list.vue
index fb7645f..7e0e91e 100644
--- a/src/views/course/apply_list.vue
+++ b/src/views/course/apply_list.vue
@@ -86,7 +86,7 @@
课程名称:{{subjectObj.title}}
-
开课日期:{{subjectObj.date}}
+
开课日期:{{subjectObj.date?subjectObj.date:'开课待定'}}
课程体系:{{subjectObj.leibie}}
课程名称:{{subjectObj.title}}
-
开课日期:{{subjectObj.date}}
+
开课日期:{{subjectObj.date?subjectObj.date:'开课待定'}}
课程体系:{{subjectObj.leibie}}
班主任:{{subjectObj.teacher}}
@@ -239,6 +239,10 @@
key: 'date',
op: 'eq',
value: this.select.date ? this.select.date : ''
+ }, {
+ key: 'course_id',
+ op: 'eq',
+ value: this.select.course_id
}],
})
this.list = res.data
diff --git a/src/views/course/class.vue b/src/views/course/class.vue
index 1dc3f89..655792d 100644
--- a/src/views/course/class.vue
+++ b/src/views/course/class.vue
@@ -217,7 +217,12 @@
},
goAttendance(row) {
let value = row.type_detail.name
- let teacher = row.teacher ? row.teacher.name : ''
+ let teacher = []
+ if(row.teacher_detail.length>0){
+ row.teacher_detail.map(item=>{
+ teacher.push(item.name)
+ })
+ }
this.$router.push({
path: '/course/attendance',
query: {
@@ -225,7 +230,7 @@
id: row.id,
date: row.start_date ? row.start_date + '至' + row.end_date : '',
leibie: value,
- teacher: teacher
+ teacher: teacher.join(",")
}
})
},
diff --git a/src/views/course/components/addClass.vue b/src/views/course/components/addClass.vue
index 8d73556..8890bf9 100644
--- a/src/views/course/components/addClass.vue
+++ b/src/views/course/components/addClass.vue
@@ -7,7 +7,7 @@
课程体系:{{subjectObj.type_detail?subjectObj.type_detail.name:''}}
-
班主任:{{subjectObj.teacher?subjectObj.teacher.name:''}}
+
班主任:{{subjectObj.teacherList?subjectObj.teacherList:''}}
课表状态:{{subjectObj.course_content_status===1?'已发布':'未发布'}}
@@ -53,7 +53,10 @@
index,
sendSms,
destroy
- } from '@/api/course/courseContent.js'
+ } from '@/api/course/courseContent.js'
+ import {
+ index as teacherIndex
+ } from "@/api/info/teachers.js"
import {
show,
save
@@ -130,14 +133,22 @@
show_relation: ['teacher', 'type_detail']
})
this.subjectObj = {}
- this.subjectObj = this.base.requestToForm(res, this.subjectObj)
+ this.subjectObj = this.base.requestToForm(res, this.subjectObj)
+ let teacher = []
+ if(res.teacher_detail.length>0){
+ res.teacher_detail.map(item=>{
+ teacher.push(item.name)
+ })
+ }
+ this.subjectObj.teacherList = teacher.join(",")
},
// 导入
importTable() {
this.$refs.imports.show()
},
refreshData() {
- this.$emit('refresh')
+ this.$emit('refresh')
+ this.getTeachers()
this.getCourseDetail()
this.getCousreContent()
},
@@ -182,6 +193,13 @@
this.$refs.editClass.id = id
this.$refs.editClass.setTeachers(this.teacher_options)
this.$refs.editClass.isShow = true
+ },
+ async getTeachers() {
+ const res = await teacherIndex({
+ page: 1,
+ page_size: 999
+ })
+ this.teacher_options = res.data
},
deleteList(id) {
var that = this;
diff --git a/src/views/course/components/applyForm.vue b/src/views/course/components/applyForm.vue
index 1d31181..49de096 100644
--- a/src/views/course/components/applyForm.vue
+++ b/src/views/course/components/applyForm.vue
@@ -3,12 +3,13 @@
-
-
创建报名表单
-
-
-
-
+
@@ -41,16 +42,15 @@
" v-for="(i, index) in defaultFormList">
-->
-
-
-
-
+
+
+
+
-
-
- 是否确认克隆{{hasCourseName}}的报名表单,克隆后将覆盖原有课程的报名表单,请谨慎操作。
-
+
+
+
+ 是否确认克隆{{hasCourseName}}的报名表单,克隆后将覆盖原有课程的报名表单,请谨慎操作。
+
@@ -105,11 +103,12 @@
import {
index,
save,
- destroy,
+ destroy,
cloneForm
- } from "@/api/course/form";
- import {
- index as courseIndex
+ } from "@/api/course/form";
+ import {
+ index as courseIndex,
+ show as courseShow
} from "@/api/course/index.js"
import {
deepCopy
@@ -124,19 +123,19 @@
},
data() {
return {
- course_id: "",
- course_signs_count:0,
+ course_id: "",
+ course_signs_count: 0,
select: {
page: 1,
page_size: 999,
sort_name: 'sort',
sort_type: 'ASC'
},
- dialogVisible: false,
- showTips:false,
- hasCourseId:'',
- hasCourseName:'',
- hasCourseList:[],
+ dialogVisible: false,
+ showTips: false,
+ hasCourseId: '',
+ hasCourseName: '',
+ hasCourseList: [],
formList: [],
types: [],
rules: {},
@@ -148,53 +147,63 @@
}
},
created() {
- this.getConfig()
+ this.getConfig()
this.getCourseList()
},
- methods: {
- // 获取有 自定义表单的 课程
- async getCourseList(){
- const res = await courseIndex({
- page:1,
- page_size:999,
- has_course_forms:1,
- sort_name:'id',
- sort_type:'ASC',
- })
-
- this.hasCourseList = res.data.filter((item)=>{return item.id!=this.course_id})
- },
- changeCourse(e){
- console.log("course-e",e)
- if(this.course_signs_count>0){
- this.$message({
- type:'warning',
- duration:4000,
- message:'当前课程已有人员报名,不可进行报名表单克隆操作'
- })
- // this.$Message.warning("当前课程已有人员报名,不可进行报名表单克隆操作")
- return
- }
- if(e){
- this.hasCourseList.map(item=>{
- if(item.id===e){
- this.hasCourseId = e
- this.hasCourseName = item.name
- this.showTips = true
- }
- })
- }
- },
- // 复制表单数据
- copyForms(){
- cloneForm({
- from_course_id:this.hasCourseId,
- to_course_id:this.course_id
- }).then(res=>{
- this.$Message.success('克隆成功')
- this.showTips = false
- this.getFormList()
- })
+ methods: {
+ // 获取有 自定义表单的 课程
+ async getCourseList() {
+ const res = await courseIndex({
+ page: 1,
+ page_size: 999,
+ has_course_forms: 1,
+ sort_name: 'id',
+ sort_type: 'ASC',
+ })
+
+ this.hasCourseList = res.data.filter((item) => {
+ return item.id != this.course_id
+ })
+ },
+ changeCourse(e) {
+ console.log("course-e", e)
+ if (e) {
+ this.getDetail(e)
+ }
+ },
+ getDetail(e) {
+ courseShow({
+ id: this.course_id,
+ }).then(res => {
+ // this.course_signs_count = res.course_signs_count
+ if (this.course_signs_count > 0) {
+ this.$message({
+ type: 'warning',
+ duration: 4000,
+ message: '当前课程已有人员报名,不可进行报名表单克隆操作'
+ })
+ // this.$Message.warning("当前课程已有人员报名,不可进行报名表单克隆操作")
+ return
+ }
+ this.hasCourseList.map(item => {
+ if (item.id === e) {
+ this.hasCourseId = e
+ this.hasCourseName = item.name
+ this.showTips = true
+ }
+ })
+ })
+ },
+ // 复制表单数据
+ copyForms() {
+ cloneForm({
+ from_course_id: this.hasCourseId,
+ to_course_id: this.course_id
+ }).then(res => {
+ this.$Message.success('克隆成功')
+ this.showTips = false
+ this.getFormList()
+ })
},
//获取 左侧 formitem类型
async getConfig() {
@@ -220,9 +229,9 @@
})
this.formList = res.data
// this.updateObjects(this.selectFormList, this.formList)
- // let _arr = this.removeMatchingItems(this.selectFormList, this.formList)
- // this.formList.push(..._arr)
- // this.selectFormList = _arr
+ // let _arr = this.removeMatchingItems(this.selectFormList, this.formList)
+ // this.formList.push(..._arr)
+ // this.selectFormList = _arr
// console.log("_arr",_arr)
console.log("this.selectFormList", this.selectFormList, this.formList)
@@ -282,13 +291,13 @@
newIndex,
oldIndex
} = e.moved;
- element.sort = newIndex;
- console.log(element)
- if(element.id){
- this.saveSelect(element)
- }else{
- this.formList.splice(oldIndex, 1);
- this.formList.splice(newIndex, 0, element);
+ element.sort = newIndex;
+ console.log(element)
+ if (element.id) {
+ this.saveSelect(element)
+ } else {
+ this.formList.splice(oldIndex, 1);
+ this.formList.splice(newIndex, 0, element);
}
// if (element) {
@@ -299,7 +308,7 @@
// 选中的 表单数据
selectPick(i, index) {
this.$refs.editPane.selectedIndex = index
- this.$refs.editPane.selectedForm = deepCopy(i)
+ this.$refs.editPane.selectedForm = deepCopy(i)
this.$refs.editPane.formList = deepCopy(this.formList)
this.$refs.editPane.showForm = true
},
@@ -349,9 +358,9 @@
if (newval) {
this.getFormList()
} else {
- this.course_id = ''
- this.course_signs_count = 0
- this.hasCourseId = ''
+ this.course_id = ''
+ this.course_signs_count = 0
+ this.hasCourseId = ''
this.hasCourseName = ''
this.selectFormList.map(item => {
item.is_open = false
diff --git a/src/views/course/txl.vue b/src/views/course/txl.vue
index 4a3365a..6e36903 100644
--- a/src/views/course/txl.vue
+++ b/src/views/course/txl.vue
@@ -77,7 +77,7 @@
课程名称:{{subjectObj.title}}
-
开课日期:{{subjectObj.date}}
+
开课日期:{{subjectObj.date?subjectObj.date:'开课待定'}}
课程体系:{{subjectObj.leibie}}
课程名称:{{subjectObj.title}}
-
开课日期:{{subjectObj.date}}
+
开课日期:{{subjectObj.date?subjectObj.date:'开课待定'}}
课程体系:{{subjectObj.leibie}}