teacherRecord.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. <template >
  2. <div>
  3. <!-- 头部展示 -->
  4. <div class="headWrap">
  5. <div class="left">
  6. <div class="headItem">
  7. <p>未上课时:<span>{{ totalClassTimes }}</span></p>
  8. </div>
  9. <div class="headItem">
  10. <p>已上课时:<span>{{ currentClassTimes }}</span></p>
  11. </div>
  12. <div class="headItem">
  13. <p>已结算:<span>{{ isSalaryNum }}</span></p>
  14. </div>
  15. <div class="headItem">
  16. <p>被投诉:<span>{{ complaintsNum }}</span></p>
  17. </div>
  18. </div>
  19. <div class="right">
  20. </div>
  21. </div>
  22. <!-- 搜索标题 -->
  23. <el-form :inline="true"
  24. label-position="right"
  25. label-width="120px"
  26. class="searchForm"
  27. v-model="searchForm">
  28. <el-form-item>
  29. <el-select v-model="searchForm.type"
  30. clearable
  31. placeholder="课程类型">
  32. <el-option label="线上课"
  33. value="ONLINE"></el-option>
  34. <el-option label="线下课"
  35. value="OFFLINE"></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item>
  39. <el-select v-model="searchForm.status"
  40. clearable
  41. placeholder="课程状态">
  42. <el-option label="未开始"
  43. value="NOT_START"></el-option>
  44. <el-option label="进行中"
  45. value="UNDERWAY"></el-option>
  46. <el-option label="已结束"
  47. value="OVER"></el-option>
  48. </el-select>
  49. </el-form-item>
  50. <el-form-item>
  51. <el-date-picker v-model="searchForm.time"
  52. style="width:400px"
  53. type="daterange"
  54. value-format="yyyy-MM-dd"
  55. range-separator="至"
  56. start-placeholder="开始日期"
  57. end-placeholder="结束日期">
  58. </el-date-picker>
  59. </el-form-item>
  60. <el-form-item>
  61. <el-button @click="search">搜索</el-button>
  62. </el-form-item>
  63. </el-form>
  64. <!-- 列表 -->
  65. <div class="tableWrap">
  66. <el-table :data='tableList'>
  67. <el-table-column align='center'
  68. label="上课时间"
  69. width="300px"
  70. prop="startClassTime">
  71. <template slot-scope="scope">
  72. <!-- {{ scope.row.classDate }} {{ scope.row.startClassTime ? scope.row.startClassTime.substr(0, 5) : '' }}-{{ scope.row.endClassTime ? scope.row.endClassTime.substr(0, 5) : '' }} -->
  73. <div>
  74. <p>{{ scope.row.startClassTime }}-{{ scope.row.endClassTime | endTime }}</p>
  75. </div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column align='center'
  79. label="课程类型"
  80. prop="teachMode">
  81. <template slot-scope="scope">
  82. <div>
  83. <p>{{scope.row.teachMode | fitterTeachMode }}</p>
  84. </div>
  85. </template>
  86. </el-table-column>
  87. <el-table-column align='center'
  88. label="教学点"
  89. prop='schoolName'>
  90. <template slot-scope="scope">
  91. <div>
  92. {{scope.row.schoolName?scope.row.schoolName:'网络教室'}}
  93. </div>
  94. </template>
  95. </el-table-column>
  96. <el-table-column align='center'
  97. label="上课学员数"
  98. prop="attendanceNum">
  99. </el-table-column>
  100. <el-table-column align='center'
  101. prop="status"
  102. label="课程状态">
  103. <template slot-scope="scope">
  104. <div>
  105. <p>{{scope.row.status | fitterStatus }}</p>
  106. </div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column align='center'
  110. prop="isSalary"
  111. label="结算状态">
  112. <template slot-scope="scope">
  113. <div>
  114. <p>{{scope.row.isSalary | fitterisSalary }}</p>
  115. </div>
  116. </template>
  117. </el-table-column>
  118. <el-table-column align='center'
  119. label="操作">
  120. <template slot-scope="scope">
  121. <div>
  122. <el-button type="text"
  123. v-permission="'vipGroupManage/findVipGroupAttendanceStudents'"
  124. @click="lookStudents(scope.row)">查看学员</el-button>
  125. <!-- <el-button type="text" v-permission="'vipGroupManage/classStartDateAdjust'"
  126. @click="resetClass(scope.row)">课程调整</el-button> -->
  127. </div>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. </div>
  132. <pagination :total="rules.total"
  133. :page.sync="rules.page"
  134. :limit.sync="rules.limit"
  135. :page-sizes="rules.page_size"
  136. @pagination="getList" />
  137. <el-dialog title="上课学员"
  138. :visible.sync="studentVisible"
  139. width="30%"
  140. :before-close="handleClose">
  141. <span v-for="(item,index) in studentList"
  142. :key="index"
  143. style="margin-left:10px;">{{item}}</span>
  144. <span slot="footer"
  145. class="dialog-footer">
  146. <el-button type="primary"
  147. @click="studentVisible = false">确 定</el-button>
  148. </span>
  149. </el-dialog>
  150. <el-dialog title="课程调整"
  151. :visible.sync="courseVisible"
  152. width="420px">
  153. <el-form :model="maskForm"
  154. :rules="maskrules"
  155. label-width="120px"
  156. label-position="right"
  157. ref='maskForm'>
  158. <el-form-item label="选择上课日期"
  159. prop="date">
  160. <el-date-picker type="date"
  161. value-format="yyyy-MM-dd"
  162. v-model="maskForm.date"
  163. placeholder="选择日期"></el-date-picker>
  164. </el-form-item>
  165. <el-form-item label="开始时间"
  166. prop="startTime">
  167. <el-time-picker v-model="maskForm.startTime"
  168. format='HH:mm'
  169. value-format='HH:mm'
  170. :picker-options="{
  171. selectableRange: '00:00:00 - 23:59:00'
  172. }"
  173. placeholder="选择时间">
  174. </el-time-picker>
  175. </el-form-item>
  176. <el-form-item label="结束时间"
  177. prop="endTime">
  178. <el-time-picker v-model="maskForm.endTime"
  179. format='HH:mm'
  180. value-format='HH:mm'
  181. :picker-options="{
  182. selectableRange: '00:00:00 - 23:59:00'
  183. }"
  184. placeholder="选择时间">
  185. </el-time-picker>
  186. </el-form-item>
  187. <!-- 新增教学点 -->
  188. <el-form-item label="教学点"
  189. prop="cooperation"
  190. v-if='activeRow&&activeRow.teachMode == "OFFLINE"'>
  191. <el-select v-model="maskForm.cooperation">
  192. <el-option v-for='(item,index) in cooperationList'
  193. :key="index"
  194. :value="item.id"
  195. :label="item.name"></el-option>
  196. </el-select>
  197. </el-form-item>
  198. </el-form>
  199. <span slot="footer"
  200. class="dialog-footer">
  201. <el-button type="primary"
  202. @click="resetCourse">确 定</el-button>
  203. </span>
  204. </el-dialog>
  205. </div>
  206. </template>
  207. <script>
  208. import pagination from '@/components/Pagination/index'
  209. import { getSchool } from '@/api/systemManage'
  210. import { findVipGroupTeachingRecord, getStudyStudents, resetVipClass } from '@/api/vipSeting'
  211. export default {
  212. components: { pagination },
  213. name: 'teacherRecord',
  214. data () {
  215. return {
  216. searchForm: {
  217. type: '',
  218. status: '',
  219. time: []
  220. },
  221. searchLsit: [],
  222. tableList: [],
  223. id: '',
  224. complaintsNum: '', //投诉数
  225. currentClassTimes: '', //当前课数
  226. isSalaryNum: '', // 已结算
  227. totalClassTimes: '',// 未上课数
  228. studentVisible: false, // 查看上课学员数的弹窗
  229. courseVisible: false, // 课时调整弹窗
  230. studentList: [],
  231. cooperationList: [],
  232. maskForm: {
  233. data: '',
  234. startTime: '',
  235. endTime: '',
  236. status: '',
  237. type: '',
  238. cooperation: ''
  239. },
  240. activeId: '',
  241. activeRow: null, //
  242. maskrules: {
  243. date: [{ required: true, message: '请选择修改日期', trigger: 'blur' }],
  244. startTime: [{ required: true, message: '请选择开始', trigger: 'blur' }],
  245. endTime: [{ required: true, message: '请选择结束', trigger: 'blur' }]
  246. },
  247. rules: {
  248. // 分页规则
  249. limit: 10, // 限制显示条数
  250. page: 1, // 当前页
  251. total: 0, // 总条数
  252. page_size: [10, 20, 40, 50] // 选择限制显示条数
  253. },
  254. }
  255. },
  256. mounted () {
  257. let id = this.$route.query.id;
  258. this.id = id;
  259. // 获取vip教学记录
  260. this.getList()
  261. // 获取分部教学点
  262. getSchool({ organId: null }).then(res => {
  263. if (res.code == 200) {
  264. this.cooperationList = res.data;
  265. }
  266. })
  267. }, methods: {
  268. search () {
  269. this.rules.page = 1;
  270. this.getList()
  271. },
  272. getList () {
  273. let startTime;
  274. let endTime;
  275. if (this.searchForm.time) {
  276. startTime = this.searchForm.time[0]
  277. endTime = this.searchForm.time[1]
  278. } else {
  279. startTime = '';
  280. endTime = '';
  281. }
  282. let obj = {
  283. vipGroupId: this.id,
  284. page: this.rules.page,
  285. rows: this.rules.limit,
  286. status: this.searchForm.status || null,
  287. teachMode: this.searchForm.type || null,
  288. startTime,
  289. endTime
  290. }
  291. findVipGroupTeachingRecord(obj).then(res => {
  292. if (res.code == 200) {
  293. this.complaintsNum = res.data.baseInfo.complaintsNum;
  294. // 当前课数
  295. this.currentClassTimes = res.data.baseInfo.courseEndNum;
  296. this.isSalaryNum = res.data.baseInfo.isSalaryNum;
  297. // 未上课数
  298. this.totalClassTimes = res.data.baseInfo.courseNoStartNum;
  299. // this.totalClassTimes = res.data.baseInfo.totalClassTimes - this.currentClassTimes;
  300. this.tableList = res.data.pageInfo.rows;
  301. this.rules.total = res.data.pageInfo.total
  302. }
  303. })
  304. },
  305. lookStudents (row) {
  306. let id = row.id;
  307. getStudyStudents({ courseScheduleId: id }).then(res => {
  308. if (res.code == 200) {
  309. this.studentList = res.data;
  310. this.studentVisible = true;
  311. }
  312. })
  313. },
  314. handleClose () {
  315. this.studentList = [];
  316. this.studentVisible = false;
  317. },
  318. resetClass (row) {
  319. this.courseVisible = true;
  320. // 弹出弹窗
  321. this.activeId = row.id;
  322. this.activeRow = row;
  323. // resetVipClass().then()
  324. },
  325. resetCourse () {
  326. // 点击弹窗效验
  327. this.$refs['maskForm'].validate(valid => {
  328. if (valid) {
  329. // 效验成功
  330. resetVipClass({ id: this.activeId, classDate: this.maskForm.date, startClassTime: this.maskForm.date + ' ' + this.maskForm.startTime, endClassTime: this.maskForm.date + ' ' + this.maskForm.endTime, schoolId: this.maskForm.cooperation }).then(
  331. res => {
  332. if (res.code == 200) {
  333. this.$message.success('调整成功')
  334. this.getList()
  335. this.courseVisible = false;
  336. this.$refs['maskForm'].resetFields();
  337. } else {
  338. this.$message.error(res.msg)
  339. }
  340. }
  341. )
  342. }
  343. })
  344. }
  345. },
  346. filters: {
  347. fitterisSalary (val) {
  348. let arr = ['未结算', '已结算'];
  349. return arr[val]
  350. },
  351. fitterTeachMode (val) {
  352. if (val == 'ONLINE') {
  353. return '线上课'
  354. } else if (val == 'OFFLINE') {
  355. return '线下课'
  356. }
  357. },
  358. fitterStatus (val) {
  359. if (val == 'NOT_START') {
  360. return '未开始'
  361. } else if (val == 'UNDERWAY') {
  362. return '进行中'
  363. } else if (val == 'OVER') {
  364. return '已结束'
  365. }
  366. },
  367. endTime (val) {
  368. if (val) {
  369. return val.split(' ')[1]
  370. } else {
  371. return val
  372. }
  373. }
  374. }
  375. }
  376. </script>
  377. <style lang="scss" scope>
  378. </style>