lectureRecord.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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: 88rpx;
  192. line-height: 88rpx;
  193. position: fixed;
  194. top: 88rpx;
  195. left: 0;
  196. right: 0;
  197. .date {
  198. flex: 1;
  199. display: flex;
  200. align-items: center;
  201. justify-content: center;
  202. .text {
  203. margin-right: 8rpx;
  204. }
  205. }
  206. .course {
  207. display: flex;
  208. flex: 1;
  209. align-items: center;
  210. justify-content: center;
  211. .text {
  212. margin-right: 8rpx;
  213. }
  214. }
  215. }
  216. ::v-deep.u-divider {
  217. margin-top: 12px !important;
  218. }
  219. .main {
  220. margin-top: 64rpx;
  221. padding: 24rpx 32rpx;
  222. text-align: center;
  223. .details-box {
  224. margin-top: 12px;
  225. background-color: #fff;
  226. padding: 12px 12px 0;
  227. border-radius: 12px;
  228. .title-number {
  229. display: flex;
  230. justify-content: space-between;
  231. align-items: center;
  232. .title {
  233. color: rgba(51, 51, 51, 1);
  234. font-size: 18px;
  235. font-weight: bold;
  236. }
  237. .number {
  238. color: rgba(119, 119, 119, 1);
  239. font-size: 16px;
  240. text {
  241. display: inline-block;
  242. text-align: center;
  243. width: 20px;
  244. line-height: 20px;
  245. border-radius: 4px;
  246. background-color: rgba(13, 186, 199, 1);
  247. color: rgba(255, 255, 255, 1);
  248. font-size: 14px;
  249. margin-left: 4px;
  250. }
  251. }
  252. }
  253. .location-time {
  254. display: flex;
  255. margin-top: 8px;
  256. .location,
  257. .time {
  258. line-height: 20px;
  259. border-radius: 4px;
  260. background-color: rgba(241, 243, 244, 1);
  261. color: rgba(136, 133, 133, 1);
  262. padding: 0px 8px;
  263. margin-right: 8px;
  264. }
  265. }
  266. }
  267. .circumstance {
  268. display: flex;
  269. margin-top: 8px;
  270. .date {
  271. color: rgba(51, 51, 51, 1);
  272. margin-right: 18px;
  273. }
  274. .details {
  275. display: flex;
  276. flex: 1;
  277. // justify-content: space-between;
  278. justify-content: space-evenly;
  279. .details-item {
  280. display: flex;
  281. align-items: center;
  282. .num-box {
  283. display: inline-block;
  284. width: 16px;
  285. height: 16px;
  286. line-height: 16px;
  287. border-radius: 4px;
  288. background-color: rgba(153, 153, 153, 1);
  289. color: rgba(255, 255, 255, 1);
  290. font-size: 12px;
  291. margin-left: 4px;
  292. }
  293. }
  294. }
  295. }
  296. .check-more {
  297. display: flex;
  298. text-align: center;
  299. font-size: 16px;
  300. margin-top: 17px;
  301. border-top: 1px solid rgba(229, 231, 234, 1);
  302. line-height: 38px;
  303. .history {
  304. flex: 1;
  305. color: rgba(119, 119, 119, 1);
  306. border-right: 1px solid rgba(229, 231, 234, 1);
  307. }
  308. .call-name {
  309. flex: 1;
  310. color: rgba(13, 186, 199, 1);
  311. }
  312. }
  313. }
  314. </style>