lookCourse.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <div>
  3. <el-form :inline="true">
  4. <!-- <el-form-item>
  5. <div class="newBand"
  6. @click="gotoPlan">新增</div>
  7. </el-form-item> -->
  8. <el-form-item label="课程类型">
  9. <el-select v-model.trim="classScheduleType"
  10. @change="chioseList">
  11. <el-option v-for='(item,index) in courseType'
  12. :key="index"
  13. :value="item.value"
  14. :label="item.label"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item>
  18. <!-- <el-button type='danger'
  19. @click="removeAllCourse">清空课表</el-button> -->
  20. </el-form-item>
  21. </el-form>
  22. <el-table :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  23. :data="tableList">
  24. <el-table-column prop="classDate"
  25. label="日期"
  26. align="center"
  27. width="180">
  28. <template slot-scope="scope">
  29. <div>
  30. {{ scope.row.classDate | formatTimer }}
  31. </div>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="上课时间"
  35. align="center"
  36. width="180">
  37. <template slot-scope="scope">
  38. <div>
  39. {{ scope.row.startClassTimeStr+ '-'+ scope.row.endClassTimeStr}}
  40. </div>
  41. </template>
  42. </el-table-column>
  43. </el-table-column>
  44. <el-table-column label="课程类型"
  45. align="center"
  46. width="180">
  47. <template slot-scope="scope">
  48. <div>
  49. {{scope.row.courseScheduleType |coursesType }}
  50. </div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="classGroupName"
  54. align="center"
  55. label="班级名称">
  56. </el-table-column>
  57. <!-- <el-table-column prop="classGroupName"
  58. align="center"
  59. label="课程名称">
  60. </el-table-column> -->
  61. <!-- <el-table-column label="上课时间"
  62. align="left"
  63. width="180">
  64. <template slot-scope="scope">
  65. <div>
  66. {{ scope.row.startClassTimeStr+ '-'+ scope.row.endClassTimeStr}}
  67. </div>
  68. </template>
  69. </el-table-column> -->
  70. <el-table-column>
  71. </el-table-column>
  72. <el-table-column>
  73. </el-table-column>
  74. </el-table>
  75. <pagination :total="rules.total"
  76. :page.sync="rules.page"
  77. :limit.sync="rules.limit"
  78. :page-sizes="rules.page_size"
  79. @pagination="getList" />
  80. <!-- <div class="btnWrap">
  81. <div class="setBtn"
  82. @click="gotoNext">下一步</div>
  83. </div> -->
  84. </div>
  85. </template>
  86. <script>
  87. import { deteleAllCourse, getCourseSchedule } from '@/api/buildTeam'
  88. import pagination from "@/components/Pagination/index";
  89. export default {
  90. name: 'lookCourse',
  91. props: {
  92. isSetSalary: {
  93. type: Boolean,
  94. required: true
  95. }
  96. },
  97. components: { pagination },
  98. data () {
  99. return {
  100. teamid: '',
  101. maxClassList: [],
  102. classScheduleType: null,
  103. tableList: [],
  104. courseType: [
  105. { label: "声部课", value: "SINGLE" },
  106. { label: "合奏课", value: "MIX" },
  107. { label: "基础技能课", value: "HIGH" },
  108. { label: "线上基础技能课", value: "HIGH_ONLINE" },
  109. { label: "综合课", value: "COMPREHENSIVE" },
  110. { label: "集训声部课", value: "TRAINING_SINGLE" },
  111. { label: "集训合奏课", value: "TRAINING_MIX" },
  112. { label: "课堂课", value: "CLASSROOM" },
  113. ],
  114. rules: {
  115. // 分页规则
  116. limit: 10, // 限制显示条数
  117. page: 1, // 当前页
  118. total: 0, // 总条数
  119. page_size: [10, 20, 40, 50] // 选择限制显示条数
  120. },
  121. }
  122. }, mounted () {
  123. this.init()
  124. },
  125. activated () {
  126. this.init()
  127. }, methods: {
  128. init () {
  129. localStorage.setItem('setStep', 2)
  130. localStorage.setItem('resetCode', 4)
  131. this.teamid = this.$route.query.id;
  132. this.getList()
  133. },
  134. getList () {
  135. // musicGroupId: this.teamid,
  136. getCourseSchedule({ classScheduleType: this.classScheduleType, musicGroupId: this.teamid, rows: this.rules.limit, page: this.rules.page }).then(res => {
  137. if (res.code == 200) {
  138. this.tableList = res.data.rows;
  139. this.rules.total = res.data.total;
  140. }
  141. })
  142. },
  143. gotoPlan () {
  144. if (this.isSetSalary) {
  145. this.$message.error('课酬确认后无法编辑')
  146. return;
  147. }
  148. this.$router.push({ path: '/business/coursePlan', query: { id: this.teamid } })
  149. },
  150. gotoNext () {
  151. if (this.isSetSalary) {
  152. this.$message.error('课酬确认后无法编辑')
  153. return;
  154. }
  155. // 获取课程类型 3.0跳小班课 2.0跳课酬
  156. let type = localStorage.getItem('chargeTypeId');
  157. type == 3 ? this.$emit('gotoNav', 3) : this.$emit('gotoNav', 4)
  158. },
  159. chioseList (val) {
  160. this.classScheduleType = val;
  161. this.getList();
  162. },
  163. // 删除乐团所有未上课程
  164. removeAllCourse () {
  165. if (this.isSetSalary) {
  166. this.$message.error('课酬确认后无法编辑')
  167. return;
  168. }
  169. this.$confirm('是否清除所有课程?', '提示', {
  170. confirmButtonText: '确定',
  171. cancelButtonText: '取消',
  172. type: 'warning'
  173. }).then(() => {
  174. deteleAllCourse({ musicGroupId: this.teamid }).then(res => {
  175. if (res.code == 200) {
  176. this.$message.success('删除成功');
  177. this.getList();
  178. }
  179. })
  180. })
  181. },
  182. }
  183. }
  184. </script>
  185. <style lang="scss" scoped>
  186. .setBtn {
  187. width: 120px;
  188. height: 40px;
  189. line-height: 40px;
  190. text-align: center;
  191. border-radius: 4px;
  192. color: #fff;
  193. background-color: #444;
  194. cursor: pointer;
  195. margin: 20px 0;
  196. }
  197. </style>