|
@@ -60,6 +60,8 @@
|
|
<Button v-if="row.weeklies.MON.status == 1" class="toggle-status-btn" @click="showSetCus(row,'MON')" ghost type="default">
|
|
<Button v-if="row.weeklies.MON.status == 1" class="toggle-status-btn" @click="showSetCus(row,'MON')" ghost type="default">
|
|
{{row.weeklies.MON.status == 1 ? '设置课程':'设置课程'}}
|
|
{{row.weeklies.MON.status == 1 ? '设置课程':'设置课程'}}
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <p>{{row.weeklies.MON.courseName}}</p>
|
|
|
|
+ <p>{{row.weeklies.MON.teacher}}</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期二-->
|
|
<!--星期二-->
|
|
@@ -68,6 +70,8 @@
|
|
<Button v-if="row.weeklies.TUE.status == 1" class="toggle-status-btn" @click="showSetCus(row,'TUE')" ghost type="default">
|
|
<Button v-if="row.weeklies.TUE.status == 1" class="toggle-status-btn" @click="showSetCus(row,'TUE')" ghost type="default">
|
|
{{row.weeklies.TUE.status == 1 ? '设置课程':'设置课程'}}
|
|
{{row.weeklies.TUE.status == 1 ? '设置课程':'设置课程'}}
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <p>{{row.weeklies.TUE.courseName}}</p>
|
|
|
|
+ <p>{{row.weeklies.TUE.teacher}}</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期三-->
|
|
<!--星期三-->
|
|
@@ -76,6 +80,8 @@
|
|
<Button v-if="row.weeklies.WED.status == 1" class="toggle-status-btn" @click="showSetCus(row,'WED')" ghost type="default">
|
|
<Button v-if="row.weeklies.WED.status == 1" class="toggle-status-btn" @click="showSetCus(row,'WED')" ghost type="default">
|
|
{{row.weeklies.WED.status == 1 ? '设置课程':'设置课程'}}
|
|
{{row.weeklies.WED.status == 1 ? '设置课程':'设置课程'}}
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <p>{{row.weeklies.WED.courseName}}</p>
|
|
|
|
+ <p>{{row.weeklies.WED.teacher}}</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期四-->
|
|
<!--星期四-->
|
|
@@ -84,6 +90,8 @@
|
|
<Button v-if="row.weeklies.THU.status == 1" class="toggle-status-btn" @click="showSetCus(row,'THU')" ghost type="default">
|
|
<Button v-if="row.weeklies.THU.status == 1" class="toggle-status-btn" @click="showSetCus(row,'THU')" ghost type="default">
|
|
{{row.weeklies.THU.status == 1 ? '设置课程':'设置课程'}}
|
|
{{row.weeklies.THU.status == 1 ? '设置课程':'设置课程'}}
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <p>{{row.weeklies.THU.courseName}}</p>
|
|
|
|
+ <p>{{row.weeklies.THU.teacher}}</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期五-->
|
|
<!--星期五-->
|
|
@@ -92,6 +100,8 @@
|
|
<Button v-if="row.weeklies.FRI.status == 1" class="toggle-status-btn" @click="showSetCus(row,'FRI')" ghost type="default">
|
|
<Button v-if="row.weeklies.FRI.status == 1" class="toggle-status-btn" @click="showSetCus(row,'FRI')" ghost type="default">
|
|
{{row.weeklies.FRI.status == 1 ? '设置课程':'设置课程'}}
|
|
{{row.weeklies.FRI.status == 1 ? '设置课程':'设置课程'}}
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <p>{{row.weeklies.FRI.courseName}}</p>
|
|
|
|
+ <p>{{row.weeklies.FRI.teacher}}</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期六-->
|
|
<!--星期六-->
|
|
@@ -100,6 +110,8 @@
|
|
<Button v-if="row.weeklies.SAT.status == 1" class="toggle-status-btn" @click="showSetCus(row,'SAT')" ghost type="default">
|
|
<Button v-if="row.weeklies.SAT.status == 1" class="toggle-status-btn" @click="showSetCus(row,'SAT')" ghost type="default">
|
|
{{row.weeklies.SAT.status == 1 ? '设置课程':'设置课程'}}
|
|
{{row.weeklies.SAT.status == 1 ? '设置课程':'设置课程'}}
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <p>{{row.weeklies.SAT.courseName}}</p>
|
|
|
|
+ <p>{{row.weeklies.SAT.teacher}}</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<!--星期日-->
|
|
<!--星期日-->
|
|
@@ -108,6 +120,8 @@
|
|
<Button v-if="row.weeklies.SUN.status == 1" class="toggle-status-btn" @click="showSetCus(row,'SUN')" ghost type="default">
|
|
<Button v-if="row.weeklies.SUN.status == 1" class="toggle-status-btn" @click="showSetCus(row,'SUN')" ghost type="default">
|
|
{{row.weeklies.SUN.status == 1 ? '设置课程':'设置课程'}}
|
|
{{row.weeklies.SUN.status == 1 ? '设置课程':'设置课程'}}
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <p>{{row.weeklies.SUN.courseName}}</p>
|
|
|
|
+ <p>{{row.weeklies.SUN.teacher}}</p>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</Table>
|
|
</Table>
|
|
@@ -128,13 +142,13 @@
|
|
@on-ok="confirmSetCus">
|
|
@on-ok="confirmSetCus">
|
|
<Form :model="cusItem" :label-width="90">
|
|
<Form :model="cusItem" :label-width="90">
|
|
<FormItem label="课程名称">
|
|
<FormItem label="课程名称">
|
|
- <Select v-model="cusItem.courseCode">
|
|
|
|
- <Option v-for="(item,index) in courseList" :value="item.courseCode">{{item.courseName}}</Option>
|
|
|
|
|
|
+ <Select v-model="cusItem.courseId">
|
|
|
|
+ <Option v-for="(item,index) in courseList" :value="item.id">{{item.courseName}}</Option>
|
|
</Select>
|
|
</Select>
|
|
</FormItem>
|
|
</FormItem>
|
|
<FormItem label="授课老师">
|
|
<FormItem label="授课老师">
|
|
<Select v-model="cusItem.teacher">
|
|
<Select v-model="cusItem.teacher">
|
|
- <Option v-for="(item,index) in $store.state.teachers.teacherList" :value="item.code">{{item.name}}</Option>
|
|
|
|
|
|
+ <Option v-for="(item,index) in cusTeaList" :value="item.id">{{item.name}}</Option>
|
|
</Select>
|
|
</Select>
|
|
</FormItem>
|
|
</FormItem>
|
|
</Form>
|
|
</Form>
|
|
@@ -151,10 +165,13 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ coursePlan: {},
|
|
courseList:[],
|
|
courseList:[],
|
|
cusItem: {
|
|
cusItem: {
|
|
- courseCode: '',
|
|
|
|
- teacher:'孔子'
|
|
|
|
|
|
+ courseId: '',
|
|
|
|
+ teacher: '',
|
|
|
|
+ row: {},
|
|
|
|
+ day:''
|
|
},
|
|
},
|
|
excelData:[],
|
|
excelData:[],
|
|
headerKeys:['classroomCode','courseName','courseCode','MON','TUE','WED','THU','FRI','SAT','SUN'],
|
|
headerKeys:['classroomCode','courseName','courseCode','MON','TUE','WED','THU','FRI','SAT','SUN'],
|
|
@@ -268,10 +285,39 @@
|
|
},
|
|
},
|
|
//确认设置课程
|
|
//确认设置课程
|
|
confirmSetCus() {
|
|
confirmSetCus() {
|
|
|
|
+ let requestData = {
|
|
|
|
+ courseId: this.cusItem.courseId,
|
|
|
|
+ classroomCode: this.classListShow[this.curClassIndex].classroomCode,
|
|
|
|
+ code: this.cusItem.teacher,
|
|
|
|
+ courseTime: {
|
|
|
|
+ label: this.cusItem.row.label,
|
|
|
|
+ time: this.cusItem.row.time,
|
|
|
|
+ day: this.cusItem.day,
|
|
|
|
+ //type:0
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.$api.courseMgmt.upsertAllPlan([requestData]).then(
|
|
|
|
+ (res) => {
|
|
|
|
+ this.tableData[this.cusItem.row._index].weeklies[this.cusItem.day].courseName = this.courseList.filter((item) => {
|
|
|
|
+ return item.id == this.cusItem.courseId
|
|
|
|
+ })[0].courseName
|
|
|
|
|
|
|
|
+ this.tableData[this.cusItem.row._index].weeklies[this.cusItem.day].teacher = this.cusTeaList.filter((item) => {
|
|
|
|
+ return item.id == this.cusItem.teacher
|
|
|
|
+ })[0].name
|
|
|
|
+ console.log('-----')
|
|
|
|
+ console.log(this.tableData)
|
|
|
|
+ },
|
|
|
|
+ (err) => {
|
|
|
|
+ console.log('error')
|
|
|
|
+ }
|
|
|
|
+ )
|
|
},
|
|
},
|
|
//显示设置课程对话框
|
|
//显示设置课程对话框
|
|
- showSetCus() {
|
|
|
|
|
|
+ showSetCus(row, day) {
|
|
|
|
+ console.log(row, day)
|
|
|
|
+ this.cusItem.row = row
|
|
|
|
+ this.cusItem.day = day
|
|
this.setCusStatus = true
|
|
this.setCusStatus = true
|
|
},
|
|
},
|
|
//处理表格导入的数据
|
|
//处理表格导入的数据
|
|
@@ -317,6 +363,9 @@
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getCourseList()
|
|
this.getCourseList()
|
|
|
|
+ this.$store.dispatch('teachers/getTeacherList').then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ })
|
|
this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
|
|
this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
|
|
this.classList = this.$store.state.schoolBaseInfo.classroomList
|
|
this.classList = this.$store.state.schoolBaseInfo.classroomList
|
|
this.classListShow = [...this.classList]
|
|
this.classListShow = [...this.classList]
|
|
@@ -324,7 +373,8 @@
|
|
this.tableData = this.$store.state.schoolBaseInfo.schoolBaseInfo.timetable.filter((item, index) => {
|
|
this.tableData = this.$store.state.schoolBaseInfo.schoolBaseInfo.timetable.filter((item, index) => {
|
|
return item.type == 1
|
|
return item.type == 1
|
|
})
|
|
})
|
|
- console.log(this.$store.state.schoolBaseInfo.schoolBaseInfo)
|
|
|
|
|
|
+ console.log('tabledata')
|
|
|
|
+ console.log(this.tableData)
|
|
for (let item of this.$store.state.schoolBaseInfo.schoolBaseInfo.period) {
|
|
for (let item of this.$store.state.schoolBaseInfo.schoolBaseInfo.period) {
|
|
let root = {
|
|
let root = {
|
|
value: item.periodCode,
|
|
value: item.periodCode,
|
|
@@ -348,6 +398,21 @@
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
console.log(this.$refs['impXls'])
|
|
console.log(this.$refs['impXls'])
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ cusTeaList() {
|
|
|
|
+ let curCourse = this.courseList.filter((item) => {
|
|
|
|
+ return item.id == this.cusItem.courseId
|
|
|
|
+ })
|
|
|
|
+ if (curCourse.length > 0) {
|
|
|
|
+ return this.$store.state.teachers.teacherList.filter((item) => {
|
|
|
|
+ return curCourse[0].teachers.indexOf(item.id) !== -1
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|