courseList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <div class='cl-container'>
  3. <!-- 搜索类型 -->
  4. <el-form :inline="true"
  5. class="searchForm"
  6. v-model="searchForm">
  7. <el-form-item label="课程类型">
  8. <el-select v-model="searchForm.courseStatus"
  9. clearable
  10. placeholder="课程类型">
  11. <el-option label="基础技能班"
  12. value="HIGH"></el-option>
  13. <el-option label="综合课"
  14. value="COMPREHENSIVE"></el-option>
  15. <el-option label="课堂课"
  16. value="CLASSROOM"></el-option>
  17. <el-option label="合奏课"
  18. value="MIX"></el-option>
  19. <el-option label="集训合奏课"
  20. value="TRAINING_MIX"></el-option>
  21. <el-option label="集训单技课"
  22. value="TRAINING_SINGLE"></el-option>
  23. <el-option label="单技课"
  24. value="SINGLE"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="课程状态">
  28. <el-select v-model="searchForm.classStatus"
  29. clearable
  30. placeholder="课程状态">
  31. <el-option label="未开始"
  32. value="NOT_START"></el-option>
  33. <el-option label="进行中"
  34. value="UNDERWAY"></el-option>
  35. <el-option label="已结束"
  36. value="OVER"></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item label="选择日期">
  40. <el-date-picker v-model="searchForm.timer"
  41. style="width:420px;"
  42. type="daterange"
  43. value-format="yyyy-MM-dd"
  44. range-separator="至"
  45. start-placeholder="开始日期"
  46. end-placeholder="结束日期">
  47. </el-date-picker>
  48. </el-form-item>
  49. <el-form-item>
  50. <div class='searchBtn'
  51. @click="search">搜索</div>
  52. </el-form-item>
  53. </el-form>
  54. <!-- 列表 -->
  55. <div class="tableWrap">
  56. <el-table :data='tableList'
  57. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  58. <el-table-column align='center'
  59. label="时间">
  60. <template slot-scope="scope">
  61. {{ scope.row.classDate }} {{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 5) : '' }}-{{ scope.row.endClassTime ? scope.row.endClassTime.substr(0, 5) : '' }}
  62. </template>
  63. </el-table-column>
  64. <el-table-column align='center'
  65. prop="classGroupName"
  66. label="班级名称">
  67. </el-table-column>
  68. <!-- <el-table-column align='center'
  69. prop="mixClassGroupName"
  70. label="合奏班">
  71. </el-table-column> -->
  72. <el-table-column align='center'
  73. prop="courseScheduleType"
  74. label="课程类型">
  75. <template slot-scope="scope">
  76. <div>
  77. {{ scope.row.courseScheduleType | coursesType}}
  78. </div>
  79. </template>
  80. </el-table-column>
  81. <el-table-column align='center'
  82. prop="courseScheduleStatus"
  83. label="课程状态">
  84. <template slot-scope="scope">
  85. <div>
  86. {{ scope.row.courseScheduleStatus | coursesStatus }}
  87. </div>
  88. </template>
  89. </el-table-column>
  90. <el-table-column align='center'
  91. label="老师签到">
  92. <template slot-scope="scope">
  93. <div>
  94. {{ scope.row.signInStatus | attendanceType}}
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column align='center'
  99. label="老师签退">
  100. <template slot-scope="scope">
  101. <div>
  102. {{ scope.row.signOutStatus | attendanceOutType}}
  103. </div>
  104. </template>
  105. </el-table-column>
  106. <el-table-column align='center'
  107. prop="masterTeacherName"
  108. label="指导老师">
  109. </el-table-column>
  110. <!-- <el-table-column align='center'
  111. prop="subTeacherName"
  112. label="助教老师">
  113. </el-table-column> -->
  114. <el-table-column align='center'
  115. label="操作">
  116. <template slot-scope="scope">
  117. <div>
  118. <el-button v-if="scope.row.courseScheduleStatus != 'OVER'"
  119. type="text"
  120. @click="resetClass(scope.row)">调整</el-button>
  121. </div>
  122. </template>
  123. </el-table-column>
  124. </el-table>
  125. <pagination :total="rules.total"
  126. :page.sync="rules.page"
  127. :limit.sync="rules.limit"
  128. :page-sizes="rules.page_size"
  129. @pagination="getList" />
  130. </div>
  131. <el-dialog title="课程调整"
  132. width="400px"
  133. :before-close="handleClose"
  134. :visible.sync="courseVisible">
  135. <el-form :model="maskForm"
  136. ref="maskForm"
  137. :rules="maskRules"
  138. label-position="right"
  139. label-width="80px;"
  140. :inline="true">
  141. <el-form-item label="主教老师"
  142. prop="teacher">
  143. <el-select v-model="maskForm.teacher"
  144. filterable>
  145. <el-option v-for="(item,index) in teacherList"
  146. :key="index"
  147. :value="item.id"
  148. :label="item.realName"></el-option>
  149. </el-select>
  150. </el-form-item>
  151. <el-form-item label="助教老师"
  152. prop="assistant">
  153. <el-select v-model="maskForm.assistant"
  154. filterable
  155. multiple
  156. collapse-tags>
  157. <el-option v-for="(item,index) in teacherList"
  158. :key="index"
  159. :value="item.id"
  160. :label="item.realName"></el-option>
  161. </el-select>
  162. </el-form-item>
  163. <el-form-item label="上课日期"
  164. prop="date">
  165. <el-date-picker v-model="maskForm.date"
  166. type="date"
  167. value-format="yyyy-MM-dd"
  168. placeholder="选择日期">
  169. </el-date-picker>
  170. </el-form-item>
  171. <el-form-item label="开始时间"
  172. prop="startTime">
  173. <el-time-select placeholder="起始时间"
  174. v-model="maskForm.startTime"
  175. :picker-options="{
  176. start: '04:30',
  177. step: '00:05',
  178. end: '23:30'
  179. }">
  180. </el-time-select>
  181. </el-form-item>
  182. <el-form-item label="结束时间"
  183. prop="endTime">
  184. <el-time-select placeholder="结束时间"
  185. v-model="maskForm.endTime"
  186. :picker-options="{
  187. start: '04:30',
  188. step: '00:05',
  189. end: '23:30',
  190. minTime: maskForm.startTime
  191. }">
  192. </el-time-select>
  193. </el-form-item>
  194. </el-form>
  195. <div slot="footer"
  196. class="dialog-footer">
  197. <el-button @click="courseVisible = false">取 消</el-button>
  198. <el-button type="primary"
  199. @click="submitResetClass">确 定</el-button>
  200. </div>
  201. </el-dialog>
  202. </div>
  203. </template>
  204. <script>
  205. import pagination from '@/components/Pagination/index'
  206. import { getCourseList, findMusicGroupClassTeacher, resetCourse, getTeacher } from '@/api/buildTeam'
  207. export default {
  208. props: {
  209. teamid: {
  210. type: String,
  211. required: true
  212. },
  213. },
  214. data () {
  215. return {
  216. courseVisible: false,
  217. searchForm: {
  218. courseStatus: '', // 课程类型
  219. classStatus: '', // 课程状态
  220. timer: [] // 时间
  221. },
  222. tableList: [],
  223. searchLsit: [],
  224. rules: {
  225. // 分页规则
  226. limit: 10, // 限制显示条数
  227. page: 1, // 当前页
  228. total: 0, // 总条数
  229. page_size: [10, 20, 40, 50] // 选择限制显示条数
  230. },
  231. maskForm: {
  232. teacher: '',
  233. assistant: '',
  234. date: '',
  235. startTime: '',
  236. endTime: '',
  237. id: ''
  238. },
  239. maskRules: {
  240. teacher: [{ required: true, message: '请选择主教老师名称', trigger: 'blur' },],
  241. date: [{ required: true, message: '请选择上课时间', trigger: 'blur' },],
  242. startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
  243. endTime: [{ required: true, message: '请选择上课结束时间', trigger: 'blur' },],
  244. },
  245. teacherList: []
  246. }
  247. },
  248. components: {
  249. pagination
  250. },
  251. mounted () {
  252. this.getList();
  253. // 获取所有老师
  254. // findMusicGroupClassTeacher({ musicGroupId: this.teamid }).then(res => {
  255. // if (res.code == 200) {
  256. // this.teacherList = res.data;
  257. // }
  258. // })
  259. getTeacher().then(res => {
  260. if (res.code == 200) {
  261. this.teacherList = res.data;
  262. }
  263. })
  264. },
  265. methods: {
  266. /**
  267. * courseStatus: '', // 课程类型
  268. classStatus: '', // 课程状态
  269. timer:[] // 时间
  270. *
  271. */
  272. search () {
  273. this.rules.page = 1;
  274. this.getList();
  275. },
  276. getList () {
  277. if (!this.searchForm.timer) {
  278. this.searchForm.timer = []
  279. }
  280. let obj = {
  281. classScheduleStatus: this.searchForm.classStatus || null,
  282. classScheduleType: this.searchForm.courseStatus || null,
  283. musicGroupId: this.teamid,
  284. startTime: this.searchForm.timer[0] || null,
  285. endTime: this.searchForm.timer[1] || null,
  286. page: this.rules.page, rows: this.rules.limit
  287. }
  288. getCourseList(obj).then(res => {
  289. if (res.code == 200) {
  290. this.tableList = res.data.rows;
  291. this.rules.total = res.data.total;
  292. }
  293. })
  294. },
  295. resetClass (row) {
  296. this.maskForm.teacher = parseInt(row.masterTeacherId);
  297. this.maskForm.assistant = []
  298. for (let i in row.teachingTeachers) {
  299. if (row.teachingTeachers[i].teacherRole == 'TEACHING') {
  300. this.maskForm.assistant.push(row.teachingTeachers[i].userId)
  301. }
  302. }
  303. this.maskForm.date = row.classDate;
  304. this.maskForm.startTime = row.startClassTimeStr;
  305. this.maskForm.endTime = row.endClassTimeStr;
  306. this.maskForm.id = row.courseScheduleId;
  307. // 修改课时
  308. this.courseVisible = true;
  309. // let obj = {
  310. // actualTeacherId: this.maskForm.teacher,
  311. // classDate: this.maskForm.date,
  312. // classGroupId: row.id
  313. // }
  314. },
  315. submitResetClass () {
  316. let obj = {
  317. actualTeacherId: this.maskForm.teacher,
  318. startClassTimeStr: this.maskForm.startTime,
  319. endClassTimeStr: this.maskForm.endTime,
  320. id: this.maskForm.id,
  321. teachingTeacherIdList: this.maskForm.assistant.join(',') || null,
  322. classDate: this.maskForm.date
  323. }
  324. resetCourse(obj).then(res => {
  325. if (res.code == 200) {
  326. this.$message.success('修改成功')
  327. this.getList();
  328. this.courseVisible = false;
  329. }
  330. })
  331. },
  332. handleClose () {
  333. this.courseVisible = false;
  334. this.$refs['maskForm'].resetFields()
  335. }
  336. }
  337. }
  338. </script>
  339. <style lang="scss" scope>
  340. .cl-container {
  341. .topFrom {
  342. margin: 20px 30px 0;
  343. .classlist {
  344. display: flex;
  345. flex-direction: row;
  346. justify-content: flex-start;
  347. align-items: center;
  348. ul {
  349. li {
  350. list-style: none;
  351. }
  352. }
  353. }
  354. }
  355. .searchForm {
  356. margin: 0 30px;
  357. }
  358. }
  359. </style>