studentRollCall.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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
  27. :data="tableList"
  28. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  29. >
  30. <el-table-column align="center" prop="username" label="学生姓名">
  31. <template slot-scope="scope">
  32. <div>
  33. {{ scope.row.username }}
  34. <span>({{ scope.row.userId }})</span>
  35. <!-- style="color: #f56c6c" -->
  36. </div>
  37. </template>
  38. </el-table-column>
  39. <el-table-column align="center" prop="phone" label="手机号">
  40. </el-table-column>
  41. <el-table-column align="center" prop="signInTime" label="签到时间">
  42. <template slot-scope="scope">
  43. <div>
  44. {{ scope.row.signInTime | dateForMinFormat }}
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column align="center" prop="signOutTime" label="签退时间">
  49. <template slot-scope="scope">
  50. <div>
  51. {{ scope.row.signOutTime | dateForMinFormat }}
  52. </div>
  53. </template>
  54. </el-table-column>
  55. <el-table-column align="center" prop="status" label="考勤状态">
  56. <template slot-scope="scope">
  57. <div
  58. v-if="
  59. scope.row.courseSchedule &&
  60. scope.row.courseSchedule.status != 'NOT_START'
  61. "
  62. >
  63. <p v-if="scope.row.status" :class="scope.row.status == 'NORMAL'?'green':'red'">
  64. {{ scope.row.status | studentRecord }}
  65. </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" prop="leaveNum" label="本月请假次数"></el-table-column> -->
  76. <el-table-column
  77. align="center"
  78. prop="ctrls"
  79. label="操作"
  80. >
  81. <template slot-scope="scope">
  82. <div>
  83. <el-button
  84. type="text"
  85. @click="addVisit(scope.row)"
  86. v-if="!scope.row.visitFlag&&permission('visit/add?page=teamCourseList')"
  87. >新增回访</el-button
  88. >
  89. <el-button
  90. type="text"
  91. @click="lookVisit(scope.row)"
  92. v-if="(scope.row.visitFlag)&&permission('visit/queryPage?page=teamCourseList')"
  93. >查看回访</el-button
  94. >
  95. </div>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. <pagination
  100. :total="rules.total"
  101. :page.sync="rules.page"
  102. :limit.sync="rules.limit"
  103. @pagination="getList"
  104. />
  105. </div>
  106. <el-dialog
  107. title="新增回访"
  108. width="500px"
  109. :visible.sync="visitVisible"
  110. append-to-body
  111. >
  112. <visit
  113. v-if="visitVisible && detail"
  114. :detail="detail"
  115. :username="detail.username"
  116. @close="visitVisible = false"
  117. @submited="getList"
  118. :isMainGo="true"
  119. />
  120. </el-dialog>
  121. </div>
  122. </template>
  123. <script>
  124. import { findStudentAttendance, sumStudentAttendance } from "@/api/buildTeam";
  125. import pagination from "@/components/Pagination/index";
  126. import { permission } from "@/utils/directivePage";
  127. import visit from "@/views/withdrawal-application/modals/visit";
  128. export default {
  129. props: ["courseScheduleId", "isMainGo"],
  130. components: { pagination, visit },
  131. data() {
  132. return {
  133. tableList: [],
  134. visitVisible: false,
  135. detail: null,
  136. rules: {
  137. // 分页规则
  138. limit: 10, // 限制显示条数
  139. page: 1, // 当前页
  140. total: 0, // 总条数
  141. },
  142. studentNum: null,
  143. signInNum: null,
  144. leaveNum: null,
  145. truantNum: null,
  146. };
  147. },
  148. mounted() {
  149. this.init();
  150. },
  151. activated() {
  152. this.init();
  153. },
  154. methods: {
  155. permission,
  156. init() {
  157. this.getList();
  158. // 发请求获取学生签到信息
  159. },
  160. addVisit(row) {
  161. this.visitVisible = true;
  162. this.detail = row;
  163. },
  164. lookVisit(row){
  165. this.$router.push({path:'/studentManager/returnVisitList',query:{search:row.id}})
  166. },
  167. getList() {
  168. findStudentAttendance({
  169. search: this.courseScheduleId,
  170. rows: this.rules.limit,
  171. page: this.rules.page,
  172. }).then((res) => {
  173. if (res.code == 200) {
  174. this.tableList = res.data.rows;
  175. this.rules.total = res.data.total;
  176. }
  177. });
  178. sumStudentAttendance({ courseScheduleId: this.courseScheduleId }).then(
  179. (res) => {
  180. if (res.code == 200) {
  181. this.studentNum = res.data.studentNum;
  182. this.signInNum = res.data.signInNum;
  183. this.leaveNum = res.data.leaveNum;
  184. this.truantNum = res.data.truantNum;
  185. }
  186. }
  187. );
  188. },
  189. },
  190. };
  191. </script>
  192. <style lang="scss" scoped>
  193. .inputStyle {
  194. width: 100px;
  195. text-align: center;
  196. }
  197. .workForm {
  198. /deep/.el-form-item {
  199. margin-bottom: 10px !important;
  200. }
  201. }
  202. .red {
  203. color: red;
  204. }
  205. .green {
  206. color: #14928a;
  207. }
  208. .orgin {
  209. color: #E6A23C;
  210. }
  211. </style>