tranPlanCourse.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div>
  3. <el-dialog
  4. title="班级排课"
  5. append-to-body
  6. width="800px"
  7. :visible.sync="transPlanVisible"
  8. >
  9. <div v-if="transPlanVisible">
  10. <el-collapse v-model="activeNames" class="statisticsCollapse" accordion>
  11. <el-collapse-item
  12. name="1"
  13. v-for="(item, index) in form.classList"
  14. :key="index"
  15. >
  16. <template slot="title">
  17. <div class="titleWrap">
  18. <div class="titleWrapText">
  19. <p>{{ item.name }}</p>
  20. <p class="secend">
  21. 已拍课<span style="color: red">{{
  22. item.courseScheduleList.length
  23. }}</span
  24. >节
  25. </p>
  26. </div>
  27. <el-button class="gotoPlan" type="text" @click.stop="gotoPlan(item)">排课</el-button>
  28. </div>
  29. </template>
  30. <tranCourseItem
  31. :details="item.courseScheduleList"
  32. class="tranCourseItem"
  33. />
  34. </el-collapse-item>
  35. </el-collapse>
  36. <courseItem v-if="activeRow" :surplustime="form.courseConvertSum.courseMinute" :activeType="'HIGH_ONLINE'" :teacherList="teacherList" :cooperationList="teacherList" :coreid="activeRow.coreTeacher" :type='"HIGH_ONLINE"' :prices="prices"
  37. :holidays="holidays"/>
  38. </div>
  39. <div slot="footer" class="dialog-footer">
  40. <el-button @click="transClassVisible = false">取 消</el-button>
  41. <el-button type="primary" @click="gotoNext">下一步</el-button>
  42. </div>
  43. </el-dialog>
  44. </div>
  45. </template>
  46. <script>
  47. import tranCourseItem from "./tranCourseItem";
  48. import courseItem from '../modals/classroom-setting-item.vue'
  49. import { getSysTenantConfig } from "@/views/courseRulersManager/api";
  50. import { queryByOrganIdAndCourseType } from "@/views/resetTeaming/api";
  51. export default {
  52. props: ["form",'teacherList'],
  53. components: {
  54. tranCourseItem,
  55. courseItem
  56. },
  57. data() {
  58. return {
  59. transPlanVisible: false,
  60. activeNames: [],
  61. activeRow:null,
  62. prices:[],
  63. holidays:[]
  64. };
  65. },
  66. mounted() {},
  67. methods: {
  68. async openDialog() {
  69. // 获取列表
  70. this.init()
  71. this.transPlanVisible = true;
  72. },
  73. async init() {
  74. try {
  75. await MusicStore.dispatch("getBaseInfo", {
  76. data: { musicGroupId: this.musicGroupId },
  77. });
  78. const res = await queryByOrganIdAndCourseType({
  79. organId: this.musicGroup.organId,
  80. });
  81. const res1 = await getSysTenantConfig({
  82. group: "holiday",
  83. });
  84. this.holidays = JSON.parse(
  85. res1.data[0].paranValue ? res1.data[0].paranValue : "[]"
  86. );
  87. this.prices = res.data;
  88. let arr = [];
  89. if (JSON.stringify(this.prices) == "{}") {
  90. // 课程时长
  91. arr.push("teamCourseTimer");
  92. }
  93. if (this.holidays.length <= 0) {
  94. arr.push("holiday");
  95. }
  96. //
  97. if (arr.length > 0) {
  98. this.$bus.$emit("showguide", arr);
  99. return;
  100. }
  101. } catch (error) {
  102. console.log(error);
  103. }
  104. },
  105. gotoNext() {},
  106. gotoPlan(item){
  107. // 判断一下 如果班级数大于1 就进入次数排课
  108. this.activeRow = item;
  109. },
  110. },
  111. };
  112. </script>
  113. <style lang="scss" scoped>
  114. .statisticsCollapse {
  115. margin-bottom: 20px;
  116. }
  117. ::v-deep .el-collapse-item__header {
  118. background: rgb(237, 238, 240);
  119. border-bottom: none !important;
  120. }
  121. // ::v-deep .el-collapse {
  122. // border-top:none!important;
  123. // border-bottom:none!important
  124. // }
  125. // ::v-deep .el-collapse-item__arrow {
  126. // display: none!important;
  127. // }
  128. .titleWrap{
  129. padding-left: 20px;
  130. font-weight: bold;
  131. display: flex;
  132. flex-direction: row;
  133. align-items: center;
  134. width: 100%;
  135. .titleWrapText {
  136. padding-right: 20px;
  137. font-weight: bold;
  138. display: flex;
  139. flex-direction: row;
  140. align-items: center;
  141. width: 100%;
  142. .secend {
  143. margin-left: 20px;
  144. font-weight: 400;
  145. }
  146. }
  147. .gotoPlan {
  148. margin-right: 20px;
  149. }
  150. }
  151. .tranCourseItem {
  152. margin-top: 10px;
  153. }
  154. </style>