lectureRecord.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <view>
  3. <u-navbar title="授课记录"></u-navbar>
  4. <view class="screen">
  5. <view class="date" @click="show = true">
  6. <view class="text">
  7. {{teachTime}}
  8. </view>
  9. <view class="icon">
  10. <u-icon name="arrow-down-fill" color="#999999" size="10"></u-icon>
  11. </view>
  12. </view>
  13. <u-picker mode="time" :defaultTime="defaultTime" v-model="show" :params="params" @confirm="confirm">
  14. </u-picker>
  15. <view class="course" @click="classShow = true">
  16. <view class="text">
  17. {{className}}
  18. </view>
  19. <view class="icon">
  20. <u-icon name="arrow-down-fill" color="#999999" size="10"></u-icon>
  21. </view>
  22. </view>
  23. <u-select v-model="classShow" mode="single-column" :list="classList" @confirm="classConfirm"></u-select>
  24. </view>
  25. <view class="main">
  26. <view class="details-box" v-for="(item,index) in callList" :key="index"
  27. v-if="classId == item.classId || classId == ''">
  28. <view class="title-number">
  29. <view class="title">
  30. {{item.className}}
  31. </view>
  32. <view class="number">
  33. 学员数 <text>{{item.studentNum}}</text>
  34. </view>
  35. </view>
  36. <view class="location-time">
  37. <view class="location">
  38. {{item.classroomN}}
  39. </view>
  40. <view class="time">
  41. {{item.coursePeriods}}
  42. </view>
  43. </view>
  44. <view class="circumstance">
  45. <view class="date">
  46. {{item.courseDate}}
  47. </view>
  48. <view class="details">
  49. <view class="details-item">
  50. <text>到课</text>
  51. <text class="num-box">{{item.dkNum!=null?item.dkNum:'0'}}</text>
  52. </view>
  53. <view class="details-item">
  54. <text>请假</text>
  55. <text class="num-box">{{item.qjNum!=null?item.qjNum:'0'}}</text>
  56. </view>
  57. <!-- <view class="details-item">
  58. <text>旷课</text>
  59. <text class="num-box">1</text>
  60. </view> -->
  61. <view class="details-item">
  62. <text>停课</text>
  63. <text class="num-box">{{item.tkNum!=null?item.tkNum:'0'}}</text>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="check-more">
  68. <view class="history" @click="gotoUrl('pages/teacher/callNames/callHistory')">
  69. 历史记录
  70. </view>
  71. <!-- <view class="call-name" @click="gotoUrl('pages/teacher/callNames/classCall')">
  72. 点名签到
  73. </view> -->
  74. </view>
  75. </view>
  76. </view>
  77. <u-divider>没有更多数据了</u-divider>
  78. </view>
  79. </template>
  80. <script>
  81. import * as callNamesApi from '@/apis/teacher/callNames.js'
  82. import * as myClassApi from '@/apis/teacher/myClass.js'
  83. export default {
  84. data() {
  85. return {
  86. classShow: false,
  87. classList: [],
  88. classId: '',
  89. className: '所有班级',
  90. teachTime: '',
  91. params: {
  92. year: true,
  93. month: true,
  94. day: false,
  95. hour: false,
  96. minute: false,
  97. second: false
  98. },
  99. show: false,
  100. defaultTime: '',
  101. queryDateStart: '',
  102. queryDateEnd: '',
  103. callList: [],
  104. }
  105. },
  106. onLoad() {
  107. var date = new Date();
  108. var year = date.getFullYear();
  109. var month = date.getMonth() + 1;
  110. var day = date.getDate();
  111. if (month >= 1 && month <= 9) {
  112. month = '0' + month;
  113. }
  114. this.defaultTime = year + '-' + month;
  115. this.teachTime = this.defaultTime;
  116. this.queryDateStart = year + '-' + month + '-' + '01';
  117. this.queryDateEnd = year + '-' + month + '-' + (new Date(year,month,0).getDate());
  118. this.getCallList();
  119. this.getLoadMyClass();
  120. },
  121. methods: {
  122. classConfirm(e) {
  123. this.classId = e[0].value;
  124. this.className = e[0].label;
  125. },
  126. getLoadMyClass() {
  127. this.classList = [];
  128. uni.showLoading({
  129. title: "加载中",
  130. mask: true,
  131. })
  132. myClassApi.loadMyClass().then((res) => {
  133. uni.hideLoading();
  134. var list = res.data;
  135. this.classList.push({
  136. value: '',
  137. label: '所有班级'
  138. });
  139. for (var i = 0; i < list.length; i++) {
  140. this.classList.push({
  141. value: list[i].classId,
  142. label: list[i].className
  143. });
  144. }
  145. }).catch(error => {
  146. uni.showToast({
  147. title: error,
  148. icon: "none"
  149. })
  150. })
  151. },
  152. confirm(params) {
  153. this.teachTime = params.year + '-' + params.month;
  154. this.queryDateStart = params.year + '-' + params.month + '-' + '01';
  155. this.queryDateEnd = params.year + '-' + params.month + '-' + (new Date(params.year,params.month,0).getDate());
  156. this.getCallList();
  157. },
  158. getCallList() {
  159. this.callList = [];
  160. uni.showLoading({
  161. title: "加载中",
  162. mask: true,
  163. })
  164. callNamesApi.rollCallList({
  165. queryDateStart: this.queryDateStart,
  166. queryDateEnd: this.queryDateEnd
  167. }).then((response) => {
  168. uni.hideLoading();
  169. var list = response.data.dataList;
  170. for (var i = 0; i < list.length; i++) {
  171. if (list[i].dkNum != 0) {
  172. this.callList.push(list[i]);
  173. }
  174. }
  175. }).catch(error => {
  176. uni.showToast({
  177. title: error,
  178. icon: "none"
  179. })
  180. })
  181. },
  182. }
  183. }
  184. </script>
  185. <style lang="scss" scoped>
  186. .screen {
  187. background-color: #fff;
  188. display: flex;
  189. justify-content: space-between;
  190. text-align: center;
  191. height: 44px;
  192. line-height: 44px;
  193. .date {
  194. flex: 1;
  195. display: flex;
  196. align-items: center;
  197. justify-content: center;
  198. .text {
  199. margin-right: 8rpx;
  200. }
  201. }
  202. .course {
  203. display: flex;
  204. flex: 1;
  205. align-items: center;
  206. justify-content: center;
  207. .text {
  208. margin-right: 8rpx;
  209. }
  210. }
  211. }
  212. /deep/.u-divider {
  213. margin-top: 12px !important;
  214. }
  215. .main {
  216. padding: 12px 16px;
  217. text-align: center;
  218. .details-box {
  219. margin-top: 12px;
  220. background-color: #fff;
  221. padding: 12px 12px 0;
  222. border-radius: 12px;
  223. .title-number {
  224. display: flex;
  225. justify-content: space-between;
  226. align-items: center;
  227. .title {
  228. color: rgba(51, 51, 51, 1);
  229. font-size: 18px;
  230. font-weight: bold;
  231. }
  232. .number {
  233. color: rgba(119, 119, 119, 1);
  234. font-size: 16px;
  235. text {
  236. display: inline-block;
  237. text-align: center;
  238. width: 20px;
  239. line-height: 20px;
  240. border-radius: 4px;
  241. background-color: rgba(13, 186, 199, 1);
  242. color: rgba(255, 255, 255, 1);
  243. font-size: 14px;
  244. margin-left: 4px;
  245. }
  246. }
  247. }
  248. .location-time {
  249. display: flex;
  250. margin-top: 8px;
  251. .location,
  252. .time {
  253. line-height: 20px;
  254. border-radius: 4px;
  255. background-color: rgba(241, 243, 244, 1);
  256. color: rgba(136, 133, 133, 1);
  257. padding: 0px 8px;
  258. margin-right: 8px;
  259. }
  260. }
  261. }
  262. .circumstance {
  263. display: flex;
  264. margin-top: 8px;
  265. .date {
  266. color: rgba(51, 51, 51, 1);
  267. margin-right: 18px;
  268. }
  269. .details {
  270. display: flex;
  271. flex: 1;
  272. // justify-content: space-between;
  273. justify-content: space-evenly;
  274. .details-item {
  275. display: flex;
  276. align-items: center;
  277. .num-box {
  278. display: inline-block;
  279. width: 16px;
  280. height: 16px;
  281. line-height: 16px;
  282. border-radius: 4px;
  283. background-color: rgba(153, 153, 153, 1);
  284. color: rgba(255, 255, 255, 1);
  285. font-size: 12px;
  286. margin-left: 4px;
  287. }
  288. }
  289. }
  290. }
  291. .check-more {
  292. display: flex;
  293. text-align: center;
  294. font-size: 16px;
  295. margin-top: 17px;
  296. border-top: 1px solid rgba(229, 231, 234, 1);
  297. line-height: 38px;
  298. .history {
  299. flex: 1;
  300. color: rgba(119, 119, 119, 1);
  301. border-right: 1px solid rgba(229, 231, 234, 1);
  302. }
  303. .call-name {
  304. flex: 1;
  305. color: rgba(13, 186, 199, 1);
  306. }
  307. }
  308. }
  309. </style>