addCompound.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <template>
  2. <div class="fixedBox">
  3. <el-card>
  4. <div class="boxWrap">
  5. <p>
  6. 待处理课程列表<span style="color: red">
  7. {{ compoundList.length }}
  8. </span>
  9. </p>
  10. <el-popover placement="top" v-model="isLook" trigger="click">
  11. <div>
  12. <p class="title">
  13. 待处理课程列表<i
  14. class="el-icon-minus minus"
  15. @click="isLook = false"
  16. ></i>
  17. </p>
  18. <el-divider></el-divider>
  19. </div>
  20. <el-button type="text" style="float: right" @click="clearCom"
  21. >清空列表</el-button
  22. >
  23. <div>
  24. <el-table
  25. :data="dataList"
  26. height="300px"
  27. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  28. >
  29. <el-table-column align="center" label="课程编号" width="110">
  30. <template slot-scope="scope">
  31. <div>{{ scope.row.id }}</div>
  32. </template>
  33. </el-table-column>
  34. <el-table-column
  35. align="center"
  36. width="180px"
  37. label="课程名称"
  38. prop="name"
  39. ></el-table-column>
  40. <el-table-column align="center" label="课程类型">
  41. <template slot-scope="scope">
  42. <div>{{ scope.row.type | coursesType }}</div>
  43. </template>
  44. </el-table-column>
  45. <el-table-column
  46. align="center"
  47. width="180px"
  48. prop="teacherName"
  49. label="指导老师"
  50. >
  51. <template slot-scope="scope">
  52. <div>
  53. {{ scope.row.teacherName }}({{
  54. scope.row.actualTeacherId
  55. }})
  56. </div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column align="center" width="200px" label="上课时间">
  60. <template slot-scope="scope"
  61. >{{
  62. scope.row.startClassTime
  63. ? scope.row.startClassTime.substr(0, 16)
  64. : ""
  65. }}-{{
  66. scope.row.endClassTime
  67. ? scope.row.endClassTime.substr(11, 5)
  68. : ""
  69. }}</template
  70. >
  71. </el-table-column>
  72. <el-table-column align="center" width="100px" label="是否结算">
  73. <template slot-scope="scope">
  74. <div>
  75. {{ scope.row.isSettlement ? "是" : "否" }}
  76. </div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column align="center" label="操作">
  80. <template slot-scope="scope">
  81. <el-button type="text" @click="cancleCom(scope.row)"
  82. >取消</el-button
  83. >
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. </div>
  88. <div class="addBtnList">
  89. <el-button
  90. v-permission="'courseSchedule/batchDelete?page=teamCourseList'"
  91. @click="removeCourse"
  92. :disabled="!dataList.length > 0"
  93. type="primary"
  94. size="mini"
  95. >批量删除</el-button
  96. >
  97. <el-button
  98. type="primary"
  99. @click="submitClass"
  100. size="mini"
  101. >课程合并</el-button
  102. >
  103. </div>
  104. <i class="el-icon-copy-document" slot="reference"></i>
  105. </el-popover>
  106. </div>
  107. </el-card>
  108. <el-dialog
  109. :visible.sync="show"
  110. title="临时合课信息"
  111. append-to-body
  112. width="800px"
  113. >
  114. <compoundClass
  115. :show="show"
  116. v-if="show"
  117. @closeReset="closeReset"
  118. :isDisabled="true"
  119. @getList="getList"
  120. :idList="idList"
  121. :dataList='dataList'
  122. />
  123. </el-dialog>
  124. </div>
  125. </template>
  126. <script>
  127. import compoundClass from "./compoundClass";
  128. export default {
  129. props: ["compoundList"],
  130. components: { compoundClass },
  131. data() {
  132. return {
  133. radio: "",
  134. dataList: this.compoundList,
  135. isLook: false,
  136. show: false,
  137. idList: "",
  138. };
  139. },
  140. methods: {
  141. cancleCom(row) {
  142. this.$emit("cancleCompound", row);
  143. },
  144. clearCom() {
  145. this.$emit("clearCom");
  146. },
  147. submitClass() {
  148. // if (!this.radio) {
  149. // this.$message.error("请选择一节主课");
  150. // return;
  151. // }
  152. // let arr = []
  153. let idList = [];
  154. this.dataList.forEach((com) => {
  155. // arr.push(com.type)
  156. idList.push(com.id);
  157. });
  158. // arr = [... new Set(arr)]
  159. // if (arr.length != 1) {
  160. // this.$message.error('请选择相同的课程类型')
  161. // return
  162. // }
  163. if (this.dataList.length <= 1) {
  164. this.$message.error("请至少选择2节课程");
  165. return;
  166. }
  167. // 做判断
  168. this.idList = idList.join(",");
  169. this.show = true;
  170. this.isLook = false;
  171. },
  172. getList() {},
  173. closeReset() {
  174. this.clearCom();
  175. this.show = false;
  176. this.$emit("getList");
  177. },
  178. removeCourse() {
  179. this.$emit("removeCourse");
  180. },
  181. },
  182. watch: {
  183. compoundList(val) {
  184. console.log(val);
  185. this.dataList = val;
  186. },
  187. },
  188. };
  189. </script>
  190. <style lang="scss" scoped>
  191. .title {
  192. line-height: 44px;
  193. }
  194. .fixedBox {
  195. position: fixed;
  196. bottom: 20px;
  197. right: 10px;
  198. z-index: 100;
  199. width: 200px;
  200. background-color: #fff;
  201. font-size: 14px;
  202. .boxWrap {
  203. display: flex;
  204. flex-direction: row;
  205. justify-content: space-between;
  206. i {
  207. font-size: 18px;
  208. cursor: pointer;
  209. }
  210. }
  211. }
  212. /deep/.el-divider--horizontal {
  213. margin: 0 !important;
  214. }
  215. .minus {
  216. float: right;
  217. line-height: 44px;
  218. padding-right: 20px;
  219. font-size: 20px;
  220. cursor: pointer;
  221. }
  222. .addBtnList {
  223. display: flex;
  224. flex-direction: row;
  225. align-items: center;
  226. justify-content: flex-end;
  227. margin-top: 15px;
  228. padding-bottom: 10px;
  229. }
  230. </style>