studentRollCall.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div>
  3. <el-form :inline="true" class="workForm" style="padding: 0 25px">
  4. <el-form-item label="学生总数" >
  5. <!-- <el-input disabled
  6. :value="studentNum"></el-input> -->
  7. <div class="inputStyle">{{studentNum}}</div>
  8. </el-form-item>
  9. <el-form-item label="实际上课学生数">
  10. <!-- <el-input disabled
  11. :value="signInNum"></el-input> -->
  12. <div class="inputStyle">{{signInNum}}</div>
  13. </el-form-item>
  14. <el-form-item label="请假学生数">
  15. <!-- <el-input disabled
  16. :value="leaveNum"></el-input> -->
  17. <div class="inputStyle">{{leaveNum}}</div>
  18. </el-form-item>
  19. <el-form-item label="旷课学生数">
  20. <!-- <el-input disabled
  21. :value="leaveNum"></el-input> -->
  22. <div class="inputStyle">{{truantNum}}</div>
  23. </el-form-item>
  24. </el-form>
  25. <div class="tableWrap">
  26. <el-table :data='tableList'
  27. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  28. <el-table-column align='center'
  29. prop="username"
  30. label="学生姓名">
  31. <template slot-scope="scope">
  32. <div>
  33. {{scope.row.username}}
  34. <span style="color: #f56c6c">({{scope.row.userId}})</span>
  35. </div>
  36. </template>
  37. </el-table-column>
  38. <el-table-column align='center'
  39. prop="phone"
  40. label="手机号">
  41. </el-table-column>
  42. <el-table-column align='center'
  43. prop="signInTime"
  44. label="签到时间">
  45. <template slot-scope="scope">
  46. <div>
  47. {{scope.row.signInTime | dateForMinFormat}}
  48. </div>
  49. </template>
  50. </el-table-column>
  51. <el-table-column align='center'
  52. prop="signOutTime"
  53. label="签退时间">
  54. <template slot-scope="scope">
  55. <div>
  56. {{scope.row.signOutTime | dateForMinFormat}}
  57. </div>
  58. </template>
  59. </el-table-column>
  60. <el-table-column align='center'
  61. prop="status"
  62. label="考勤状态">
  63. <template slot-scope="scope">
  64. <div v-if="scope.row.courseSchedule && scope.row.courseSchedule.status != 'NOT_START'">
  65. <p v-if="scope.row.status">{{scope.row.status | studentRecord}}</p>
  66. <p v-else>未签到</p>
  67. </div>
  68. </template>
  69. </el-table-column>
  70. <el-table-column align="center" label="是否回访">
  71. <template slot-scope="scope">
  72. <div>{{ scope.row.visitFlag | yesOrNo }}</div>
  73. </template>
  74. </el-table-column>
  75. <el-table-column align='center'
  76. prop="ctrls"
  77. v-if="permission('visit/add?page=teamCourseList')"
  78. label="操作">
  79. <template slot-scope="scope">
  80. <el-button
  81. type="text"
  82. @click="addVisit(scope.row)"
  83. >新增回访</el-button>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. <pagination :total="rules.total"
  88. :page.sync="rules.page"
  89. :limit.sync="rules.limit"
  90. @pagination="getList" />
  91. </div>
  92. <el-dialog title="新增回访" width="500px" :visible.sync="visitVisible" append-to-body>
  93. <visit
  94. v-if="visitVisible && detail"
  95. :detail="detail"
  96. :username="detail.username"
  97. @close="visitVisible = false"
  98. @submited="getList"
  99. :isMainGo="isMainGo"
  100. />
  101. </el-dialog>
  102. </div>
  103. </template>
  104. <script>
  105. import { findStudentAttendance, sumStudentAttendance } from '@/api/buildTeam'
  106. import pagination from '@/components/Pagination/index'
  107. import { permission } from '@/utils/directivePage'
  108. import visit from '@/views/withdrawal-application/modals/visit'
  109. export default {
  110. props: ['courseScheduleId','isMainGo'],
  111. components: { pagination, visit },
  112. data () {
  113. return {
  114. tableList: [],
  115. visitVisible: false,
  116. detail: null,
  117. rules: {
  118. // 分页规则
  119. limit: 10, // 限制显示条数
  120. page: 1, // 当前页
  121. total: 0, // 总条数
  122. },
  123. studentNum: null,
  124. signInNum: null,
  125. leaveNum: null,
  126. truantNum: null
  127. }
  128. },
  129. mounted () {
  130. this.init()
  131. },
  132. activated () {
  133. this.init()
  134. },
  135. methods: {
  136. permission,
  137. init () {
  138. console.log(this.courseScheduleId)
  139. this.getList()
  140. // 发请求获取学生签到信息
  141. },
  142. addVisit(row) {
  143. this.visitVisible = true
  144. this.detail = row
  145. },
  146. getList () {
  147. findStudentAttendance({
  148. search: this.courseScheduleId, rows: this.rules.limit,
  149. page: this.rules.page,
  150. }).then(res => {
  151. if (res.code == 200) {
  152. this.tableList = res.data.rows;
  153. this.rules.total = res.data.total
  154. }
  155. })
  156. sumStudentAttendance({ courseScheduleId: this.courseScheduleId }).then(res => {
  157. if (res.code == 200) {
  158. this.studentNum = res.data.studentNum;
  159. this.signInNum = res.data.signInNum;
  160. this.leaveNum = res.data.leaveNum
  161. this.truantNum = res.data.truantNum
  162. }
  163. })
  164. }
  165. }
  166. }
  167. </script>
  168. <style lang="scss" scoped>
  169. .inputStyle {
  170. width: 100px;
  171. text-align: center;
  172. }
  173. .workForm {
  174. /deep/.el-form-item {
  175. margin-bottom: 10px !important;
  176. }
  177. }
  178. </style>