resetComponent.vue 10 KB

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