|
|
@@ -3,63 +3,61 @@
|
|
|
:visible.sync="dialogvisible"
|
|
|
@opened="dialogOpen"
|
|
|
@closed="dialogClose"
|
|
|
- width="60%">
|
|
|
+ width="30%">
|
|
|
<el-form size="mini"
|
|
|
:model="course"
|
|
|
- label-width="120px"
|
|
|
+ label-width="80px"
|
|
|
ref="courseForm">
|
|
|
- <el-row class="courseaddformcss">
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="标题"
|
|
|
- prop="Title">
|
|
|
- <el-input v-model="course.Title"
|
|
|
- placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="学年"
|
|
|
- prop="Year">
|
|
|
- <el-input v-model="course.Year"
|
|
|
- placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
-
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="班级"
|
|
|
- prop="title">
|
|
|
- <el-input v-model="course.Class"
|
|
|
- placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="学期"
|
|
|
- prop="title">
|
|
|
- <el-input v-model="course.Term"
|
|
|
- placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row class="courseaddformcss">
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="教学周"
|
|
|
- prop="title">
|
|
|
- <el-input v-model="course.CourseWeek"
|
|
|
- placeholder="请输入"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label="状态"
|
|
|
- label-width="120px"
|
|
|
- style="margin-top:-5px;">
|
|
|
- <el-radio-group v-model="course.Status">
|
|
|
- <el-radio class="radio"
|
|
|
- label="1">发布</el-radio>
|
|
|
- <el-radio class="radio"
|
|
|
- label="0">草稿</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <el-form-item label="标题"
|
|
|
+ prop="Title">
|
|
|
+ <el-input v-model="course.Title"
|
|
|
+ placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="教学周"
|
|
|
+ prop="title">
|
|
|
+ <el-input v-model="course.CourseWeek"
|
|
|
+ placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="学年"
|
|
|
+ prop="Year">
|
|
|
+ <el-select v-model="course.Year"
|
|
|
+ placeholder="请选择年级学年">
|
|
|
+ <el-option v-for="item in years"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="班级"
|
|
|
+ prop="title">
|
|
|
+ <el-select v-model="course.Class"
|
|
|
+ placeholder="请选择班级">
|
|
|
+ <el-option v-for="item in activitiesclass"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="学期"
|
|
|
+ prop="title">
|
|
|
+ <el-select v-model="course.Term">
|
|
|
+ <el-option v-for="item in term"
|
|
|
+ :key="item.ItemName"
|
|
|
+ :label="item.ItemName"
|
|
|
+ :value="item.ItemValue">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态">
|
|
|
+ <el-radio-group v-model="course.Status">
|
|
|
+ <el-radio class="radio"
|
|
|
+ label="1">发布</el-radio>
|
|
|
+ <el-radio class="radio"
|
|
|
+ label="0">草稿</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<span slot="footer">
|
|
|
@@ -75,12 +73,18 @@
|
|
|
<script>
|
|
|
|
|
|
import CourseApi from '@/api/course'
|
|
|
+import ClassApi from '@/api/class'
|
|
|
+import itemDetailApi from '@/api/sysadmin/itemdetail'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'courseInfoDialog',
|
|
|
props: {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ term: [],
|
|
|
+ activitiesclass: [],
|
|
|
+ years: [],
|
|
|
checkAll: false,
|
|
|
dialogvisible: false,
|
|
|
fileList: [],
|
|
|
@@ -89,18 +93,54 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
+ var myDate = new Date()
|
|
|
+ var year = myDate.getFullYear()// 获取当前年
|
|
|
+ this.initSelectYear(year)
|
|
|
+ this.initDatas_class()
|
|
|
+ this.getTerm()
|
|
|
this.getData()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取字典表
|
|
|
+ getTerm () {
|
|
|
+ itemDetailApi.getItemDetailByItemCode({ ItemCode: 'Term' })
|
|
|
+ .then(res => {
|
|
|
+ this.term = res
|
|
|
+ // this.initDatas()
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // class
|
|
|
+ initDatas_class () {
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currpage,
|
|
|
+ _size: this.size
|
|
|
+ }
|
|
|
+ ClassApi.getAllClass(params)
|
|
|
+ .then(res => {
|
|
|
+ for (let i = 0; i < res.records.length; i++) {
|
|
|
+ this.activitiesclass.push({ value: (res.records[i].Id), label: (res.records[i].Year + '_' + res.records[i].Name) })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initSelectYear (year) {
|
|
|
+ this.years = []
|
|
|
+ for (let i = 0; i < 30; i++) {
|
|
|
+ this.years.push({ value: (year - i), label: (year - i) + '年' })
|
|
|
+ }
|
|
|
+ },
|
|
|
dialogOpen () {
|
|
|
this.course = {}
|
|
|
- console.log("courseId:" + this.courseId)
|
|
|
+ console.log('courseId:' + this.courseId)
|
|
|
this.$refs.courseForm.resetFields()
|
|
|
this.getData()
|
|
|
},
|
|
|
dialogClose () {
|
|
|
this.course = {}
|
|
|
- console.log("courseId:" + this.courseId)
|
|
|
+ console.log('courseId:' + this.courseId)
|
|
|
this.$refs.courseForm.resetFields()
|
|
|
this.$emit('handleClose')
|
|
|
this.dialogVisible = false
|
|
|
@@ -118,11 +158,10 @@ export default {
|
|
|
console.error(err)
|
|
|
})
|
|
|
} else {
|
|
|
- console.log("error submit!!");
|
|
|
- return false;
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
}
|
|
|
- });
|
|
|
-
|
|
|
+ })
|
|
|
},
|
|
|
// 编辑修改
|
|
|
getData () {
|
|
|
@@ -147,8 +186,4 @@ export default {
|
|
|
padding: 0;
|
|
|
float: right;
|
|
|
}
|
|
|
-
|
|
|
-.courseaddformcss .el-col-8 {
|
|
|
- height: 58px;
|
|
|
-}
|
|
|
</style>
|