resetComponent.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <div>
  3. <div class="tableWrap"
  4. v-if='tableList.length>0'>
  5. <el-table :data="tableList"
  6. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  7. <el-table-column align="center"
  8. prop="organName"
  9. label="分部名称"></el-table-column>
  10. <el-table-column align="center"
  11. width="130px"
  12. prop="musicGroupId"
  13. label="乐团/课程组编号"></el-table-column>
  14. <el-table-column align="center"
  15. prop="id"
  16. label="课程编号"></el-table-column>
  17. <el-table-column align="center"
  18. width="200px"
  19. label="上课时间">
  20. <template slot-scope="scope">{{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 16) : '' }}-{{ scope.row.endClassTime ? scope.row.endClassTime.substr(11,5) : ''}}</template>
  21. </el-table-column>
  22. <el-table-column align="center"
  23. prop="subjectName"
  24. label="声部"></el-table-column>
  25. <el-table-column align="center"
  26. prop="name"
  27. label="课程名称"></el-table-column>
  28. <el-table-column align="center"
  29. width="150px"
  30. label="课程类型">
  31. <template slot-scope="scope">
  32. <div>{{ scope.row.type | coursesType}}</div>
  33. </template>
  34. </el-table-column>
  35. <el-table-column align="center"
  36. label="教学模式">
  37. <template slot-scope="scope">
  38. <div>{{ scope.row.teachMode | teachMode}}</div>
  39. </template>
  40. </el-table-column>
  41. <el-table-column align="center"
  42. prop="schoolName"
  43. label="教学点">
  44. <template slot-scope="scope">
  45. <div>{{scope.row.schoolName?scope.row.schoolName:'网络教室'}}</div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column align="center"
  49. prop="courseScheduleStatus"
  50. label="课程状态">
  51. <template slot-scope="scope">
  52. <div>{{ scope.row.status | coursesStatus }}</div>
  53. </template>
  54. </el-table-column>
  55. <el-table-column align="center"
  56. label="考勤申诉">
  57. <template slot-scope="scope">
  58. <div>{{ scope.row.isComplaints==1?'是':'否'}}</div>
  59. </template>
  60. </el-table-column>
  61. <el-table-column align="center"
  62. prop="isLock"
  63. label="是否冻结">
  64. <template slot-scope="scope">{{ scope.row.isLock ? '是' : '否' }}</template>
  65. </el-table-column>
  66. <el-table-column align="center"
  67. prop="newCourseId"
  68. label="合并类型"
  69. width="130px">
  70. <template slot-scope="scope">
  71. <!-- {{ scope.row.newCourseId > 0 ? '是' : '否' }} -->
  72. {{ scope.row.newCourseId > 0 && scope.row.newCourseId == scope.row.id ? '合并课' : null }}
  73. {{ scope.row.newCourseId > 0 && scope.row.newCourseId != scope.row.id ? '被合并课' : null }}
  74. </template>
  75. </el-table-column>
  76. <el-table-column align="center"
  77. prop="isCallNames"
  78. label="是否点名"
  79. fixed="right">
  80. <template slot-scope="scope">{{ scope.row.isCallNames ? '是' : '否' }}</template>
  81. </el-table-column>
  82. <el-table-column align="center"
  83. label="操作"
  84. fixed="right"
  85. width="180px">
  86. <template slot-scope="scope">
  87. <!-- v-if="permission('teamCourseList/details')" -->
  88. <div>
  89. <el-button v-if="!scope.row.isSettlement && permission('courseSchedule/classStartDateAdjust')&&scope.row.groupType ==='MUSIC'"
  90. type="text"
  91. @click="resetClass(scope.row)">调整</el-button>
  92. <el-button v-if="!scope.row.isSettlement && permission('courseSchedule/classStartDateAdjust')&&scope.row.groupType ==='VIP'"
  93. type="text"
  94. @click="resetClass(scope.row)">调整</el-button>
  95. <el-button type="text"
  96. v-if="!scope.row.isSettlement && permission('courseSchedule/practiceCourseAdjust')&&scope.row.groupType==='PRACTICE'"
  97. @click="resetClass(scope.row)">调整</el-button>
  98. <el-button type="text"
  99. v-if="scope.row.groupType==='PRACTICE'&&scope.row.status == 'NOT_START'&&scope.row.practiceGroup['type']!='TRIAL'&& permission('courseSchedule/practiceCourseTeacherAdjust')"
  100. @click="resetTeacher(scope.row)">更换老师</el-button>
  101. </div>
  102. </template>
  103. </el-table-column>
  104. </el-table>
  105. <pagination :total="rules.total"
  106. :page.sync="rules.page"
  107. :limit.sync="rules.limit"
  108. :page-sizes="rules.page_size"
  109. @pagination="getList" />
  110. </div>
  111. <!-- 老师调整 -->
  112. <el-dialog title="老师调整"
  113. width="400px"
  114. :visible.sync="teacherVisible">
  115. <el-form :model="teacherForm"
  116. ref="teacherForm"
  117. :rules="teacherRules"
  118. label-position="right"
  119. label-width="80px;"
  120. :inline="true">
  121. <el-form-item label="指导老师">
  122. <el-select v-model.trim="teacherForm.teacher"
  123. filterable
  124. clearable>
  125. <el-option v-for="(item,index) in teacherList"
  126. :key="index"
  127. :value="item.id"
  128. :label="item.realName"></el-option>
  129. </el-select>
  130. </el-form-item>
  131. </el-form>
  132. <div slot="footer"
  133. class="dialog-footer">
  134. <el-button @click="teacherVisible = false">取 消</el-button>
  135. <el-button type="primary"
  136. @click="subresetTeacher">确 定</el-button>
  137. </div>
  138. </el-dialog>
  139. <el-dialog :visible.sync="show"
  140. width="400px">
  141. <resetClass :show="show"
  142. @closeReset='closeReset'
  143. @getList='getList'
  144. :id='id'
  145. :isDisabled='true' />
  146. </el-dialog>
  147. </div>
  148. </template>
  149. <script>
  150. import { superFindCourseSchedules, getTeacher, resetCourse, practiceCourseAdjus, practiceCourseTeacherAdjust } from "@/api/buildTeam";
  151. import { setDate, getCurrentMonthFirst, getCurrentMonthLast } from "@/utils/date"
  152. import { getTeachSchool } from "@/api/teacherManager";
  153. import pagination from "@/components/Pagination/index";
  154. import { permission } from "@/utils/directivePage";
  155. import resetClass from '@/views/teamDetail/componentCourse/resetClass'
  156. import dayjs from 'dayjs'
  157. export default {
  158. components: { pagination, resetClass },
  159. props: ['startTimes'],
  160. data () {
  161. return {
  162. startCourseTime: '',
  163. endCourseTime: '',
  164. startTime: this.startTimes,
  165. endTime: this.startTimes,
  166. teacherVisible: false,
  167. teacherList: [],
  168. teacherForm: {
  169. teacher: null,
  170. courseScheduleId: null
  171. },
  172. teacherRules: {
  173. teacher: [{ required: true, message: "请选择老师", trigger: "blur" }],
  174. educationalTeacherId: [{ required: true, message: "请选择乐团主管", trigger: "blur" }]
  175. },
  176. tableList: [],
  177. rules: {
  178. // 分页规则
  179. limit: 10, // 限制显示条数
  180. page: 1, // 当前页
  181. total: 0, // 总条数
  182. page_size: [10, 20, 40, 50] // 选择限制显示条数
  183. },
  184. show: false,
  185. id: null,
  186. teacherIdList: null
  187. }
  188. },
  189. mounted () {
  190. this.teacherIdList = this.$route.query.teacherId
  191. this.value = new Date()
  192. this.getList()
  193. getTeacher().then(res => {
  194. if (res.code == 200) {
  195. this.teacherList = res.data;
  196. }
  197. });
  198. },
  199. methods: {
  200. getList () {
  201. // this.startTime = setDate(this.value)
  202. // this.endTime = setDate(this.value)
  203. this.$emit('getCalendatList')
  204. if (!this.startTime || !this.endTime) return
  205. superFindCourseSchedules({
  206. teacherIdList: this.teacherIdList, page: this.rules.page,
  207. rows: this.rules.limit, startTime: this.startTime, endTime: this.endTime
  208. }).then(res => {
  209. if (res.code == 200) {
  210. this.tableList = res.data.rows
  211. this.rules.total = res.data.total
  212. }
  213. })
  214. },
  215. setCourseList (val) {
  216. console.LOG(val)
  217. // this.getCalendatList()
  218. },
  219. closeReset () {
  220. this.show = false
  221. },
  222. permission (str, parent) {
  223. return permission(str, parent);
  224. },
  225. resetClass (row) {
  226. this.id = row.id
  227. this.show = true
  228. this.value = new Date(row.classDate.replace(/-/g, '/'))
  229. },
  230. resetTeacher (row) {
  231. this.teacherForm.teacher = row.actualTeacherId;
  232. this.teacherForm.courseScheduleId = row.id;
  233. this.teacherVisible = true;
  234. },
  235. subresetTeacher () {
  236. this.$refs.teacherForm.validate(some => {
  237. if (some) {
  238. // 修改单节课老师
  239. practiceCourseTeacherAdjust({
  240. courseScheduleId: this.teacherForm.courseScheduleId,
  241. teacherId: this.teacherForm.teacher
  242. }).then(res => {
  243. if (res.code == 200) {
  244. this.$message.success("修改成功");
  245. this.teacherVisible = false;
  246. this.getList()
  247. }
  248. })
  249. } else {
  250. return;
  251. }
  252. });
  253. }
  254. },
  255. watch: {
  256. startTimes (val) {
  257. this.startTime = val;
  258. this.endTime = val;
  259. this.getList()
  260. }
  261. }
  262. }
  263. </script>
  264. <style lang="scss" scoped>
  265. </style>