You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

508 lines
10 KiB

  1. <template>
  2. <view class="page">
  3. <view class="timeTable_sec3">
  4. <view class="tSec3Box">
  5. <view class="tSec3Time"><text></text> {{ pageInfo.LessonDate }} 第{{ pageInfo.LessonTime.substring(1) }}节 <text></text></view>
  6. </view>
  7. </view>
  8. <view class="timeTable_sec4">
  9. <view class="tSec4Box">
  10. <view class="tSec4T">
  11. <div>{{ pageInfo.LessonName }}</div>
  12. </view>
  13. <view class="tSec4Con">
  14. <view class="studSeeSec2Txt" id="shouldArrive">
  15. <text class="text-xxl cuIcon cuIcon-profile"></text> {{ pageInfo.EmpName }}
  16. <text class="text-xxl cuIcon cuIcon-locationfill" style="margin-left: 10px;"></text> {{ pageInfo.ClassroomName }}
  17. <view><text>应到</text> {{ weekData.records }} </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="statusType">
  23. <view>
  24. <view class="statusTypeLi sStatue1"><text></text>准时</view>
  25. <view class="statusTypeLi sStatue2"><text></text>早退</view>
  26. <view class="statusTypeLi sStatue3"><text></text>旷课</view>
  27. <view class="statusTypeLi sStatue4"><text></text>病假</view>
  28. <view class="statusTypeLi sStatue5"><text></text>迟到</view>
  29. <view class="statusTypeLi sStatue6"><text></text>事假</view>
  30. </view>
  31. </view>
  32. <view class="timeTable_sec2">
  33. <view class="timeTableList">
  34. <view v-if="weekData.rows.length == 0">暂时没有信息</view>
  35. <view v-if="weekData.rows.length != 0">
  36. <view
  37. :class="timeTableClass(k.Sort)"
  38. class="timeTableLi" v-for="(k, i) in weekData.rows"
  39. :key="k.StuNo"
  40. @click="tapTimeTable(i, timeTableClass(k.Sort))"
  41. >
  42. <view>{{ k.StuName }} <text class="text-xxl cuIcon cuIcon-ellipse"></text></view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="timeTableAlert" :class="flag? 'active' : ''">
  48. <view class="timeTableAlertTop">
  49. <view class="timeTableAlertT">{{ weekData.rows[ind].StuName }}</view>
  50. <view class="timeTableAlertTxt">学号: {{ weekData.rows[ind].StuNo }} </view>
  51. </view>
  52. <view class="timeTableAlertList">
  53. <view
  54. v-for="(n, i) in Statue"
  55. :key="i"
  56. :class="n.className == className? 'active ' + n.className : n.className"
  57. class="timeTableAlertLi"
  58. @click="tapStatus(i)"
  59. ><text></text>{{ n.txt }}</view>
  60. </view>
  61. </view>
  62. <view class="timeTableAlertZ" v-show="flag" @click="flag = false"></view>
  63. <view class="timeTableBtn" @click="tapBtn">确定</view>
  64. </view>
  65. </template>
  66. <script>
  67. export default{
  68. data() {
  69. return {
  70. pageInfo: {},
  71. weekData: {},
  72. flag: false,
  73. data: {},
  74. className: '',
  75. ind: 0,
  76. Statue: [
  77. {
  78. className: 'sStatue1',
  79. num: '0',
  80. txt: '准时'
  81. },
  82. {
  83. className: 'sStatue5',
  84. num: '1',
  85. txt: '迟到'
  86. },
  87. {
  88. className: 'sStatue2',
  89. num: '2',
  90. txt: '早退'
  91. },
  92. {
  93. className: 'sStatue4',
  94. num: '3',
  95. txt: '病假'
  96. },
  97. {
  98. className: 'sStatue6',
  99. num: '4',
  100. txt: '事假'
  101. },
  102. {
  103. className: 'sStatue3',
  104. num: '5',
  105. txt: '旷课'
  106. }
  107. ]
  108. }
  109. },
  110. methods:{
  111. init() {
  112. let _this = this;
  113. let _postParam = {
  114. pagination: {
  115. rows: "1000",
  116. page: "1",
  117. sidx: 'ClassNo',
  118. sord: 'DESC'
  119. },
  120. queryJson: JSON.stringify({
  121. year: _this.pageInfo.AcademicYear,
  122. semester: _this.pageInfo.Semester,
  123. empno: _this.pageInfo.EmpNo,
  124. lessonNo: _this.pageInfo.LessonNo,
  125. teachClassNo: _this.pageInfo.TeachClassNo,
  126. lessonTime: _this.pageInfo.LessonTime,
  127. LessonSortNo: _this.pageInfo.LessonSortNo,
  128. })
  129. };
  130. _this.LOADING('加载数据中…');
  131. _this.HTTP_GET('/teachattendance/students', _postParam, '加载数据时出错').then(res => {
  132. this.HIDE_LOADING();
  133. console.log(res);
  134. _this.weekData = _this.COPY(res);
  135. });
  136. },
  137. tapTimeTable(num, str) {
  138. this.className = str;
  139. this.ind = num;
  140. this.flag = true;
  141. },
  142. tapStatus(num) {
  143. this.weekData.rows[this.ind].Sort = this.Statue[num].txt;
  144. this.weekData.rows[this.ind].kqType = this.Statue[num].num;
  145. this.flag = false;
  146. },
  147. tapBtn() {
  148. let _this = this;
  149. _this.weekData.rows.forEach((n, i) => {
  150. n.kqType = n.kqType != null? n.kqType : '0'
  151. });
  152. _this.CONFIRM('数字化校园提示', '无法获取小程序登录授权码', true).then(res => {
  153. // console.log(_this.weekData.rows)
  154. if(res){
  155. _this.LOADING('保存数据中…');
  156. _this.HTTP_POST('/Learun/adms/EducationalAdministration/StuAttendanceLeave/apply',
  157. {
  158. lessonTime: _this.pageInfo.LessonTime,
  159. lessonDate: _this.pageInfo.LessonDate,
  160. classRoomNo: _this.pageInfo.ClassRoomNo,
  161. dataJson: JSON.stringify(_this.weekData.rows)
  162. }, '加载数据时出错').then(res => {
  163. _this.HIDE_LOADING();
  164. console.log(res);
  165. if (res) {
  166. _this.TOAST('删除成功', 'success');
  167. _this.init();
  168. }
  169. });
  170. }
  171. })
  172. }
  173. },
  174. computed: {
  175. timeTableClass() {
  176. return str => {
  177. return !str ? 'sStatue1' : str == "准时" ? 'sStatue1' : str == "早退" ? 'sStatue2' : str == "旷课" ? 'sStatue3' : str == "病假" ? 'sStatue4' : str == "迟到" ? 'sStatue5' : 'sStatue6';
  178. };
  179. }
  180. },
  181. created() {
  182. this.pageInfo = this.GET_PARAM(); //获取页面传递参数
  183. this.init();
  184. }
  185. }
  186. </script>
  187. <style lang="less" scoped>
  188. #semester2 {
  189. margin-bottom: 10px;
  190. }
  191. #weekTime2 text {
  192. margin: 0 10px;
  193. }
  194. .timeTable_sec2 {
  195. margin-bottom: 30px;
  196. background-color: #fff;
  197. }
  198. .noHtml {
  199. height: 100%;
  200. line-height: 60px;
  201. text-align: center;
  202. font-size: 14px;
  203. }
  204. .timeTable_sec3 {
  205. padding: 0px 12px 1px;
  206. text-align: center;
  207. background: #0c86d8;
  208. height: 35px;
  209. }
  210. .tSec3Time {
  211. text-align: center;
  212. line-height: 24px;
  213. font-size: 14px;
  214. color: #fff;
  215. }
  216. .tSec3Time text {
  217. display: inline-block;
  218. background-color: #b8e2ff;
  219. width: 6px;
  220. height: 6px;
  221. border-radius: 50%;
  222. vertical-align: middle;
  223. position: relative;
  224. top: -2px;
  225. margin: 0 10px;
  226. }
  227. .timeTable_sec4 {
  228. padding: 0 12px;
  229. /* margin-top: -65px; */
  230. margin-bottom: 10px;
  231. background: #0075c4;
  232. }
  233. .tSec4T {
  234. /* text-align: center; */
  235. margin-bottom: 10px;
  236. overflow: hidden;
  237. font-size: 16px;
  238. color: #fff;
  239. padding-top: 10px;
  240. }
  241. .tSec4Con {
  242. padding-bottom: 10px;
  243. }
  244. .tSec4Con .studSeeSec2Line {
  245. height: 25px;
  246. width: 1px;
  247. background: #d6dfe2;
  248. margin: 0 40px;
  249. }
  250. .tSec4Con .studSeeSec2Txt {
  251. color: #4fb1f3;
  252. font-size: 14px;
  253. }
  254. .tSec4Con .studSeeSec2Txt .text-xxl {
  255. margin-right: 5px;
  256. font-size: 16px;
  257. }
  258. .tSec4Con .studSeeSec2Txt view {
  259. float: right;
  260. font-size: 20px;
  261. margin-top: -2px;
  262. }
  263. .tSec4Con .studSeeSec2Txt view text {
  264. display: inline-block;
  265. line-height: 20px;
  266. font-size: 12px;
  267. padding: 0 10px;
  268. position: relative;
  269. background: #4fb1f3;
  270. color: #0075c4;
  271. border-radius: 2px;
  272. top: -3px;
  273. margin-right: 10px;
  274. }
  275. .tSec4Con .studSeeSec2Txt view text:after {
  276. content: '';
  277. position: absolute;
  278. border: 3px solid #4fb1f3;
  279. border-right-color: transparent;
  280. border-top-color: transparent;
  281. border-bottom-color: transparent;
  282. right: -6px;
  283. top: 50%;
  284. margin-top: -3px;
  285. }
  286. .timeTableList {
  287. overflow: hidden;
  288. padding: 3px 7px 18px;
  289. }
  290. .timeTableLi {
  291. width: 33.333333%;
  292. float: left;
  293. font-size: 14px;
  294. line-height: 16px;
  295. margin-top: 14px;
  296. padding: 0 7px;
  297. }
  298. .timeTableLi view {
  299. border: 1px solid #daeffd;
  300. padding: 13px 0;
  301. text-align: center;
  302. overflow: hidden;
  303. }
  304. .timeTableLi text {
  305. font-size: 12px;
  306. border-radius: 50%;
  307. height: 14px;
  308. width: 14px;
  309. line-height: 12px;
  310. position: relative;
  311. top: -1px;
  312. margin-left: 6px;
  313. }
  314. .timeTableBtn {
  315. font-size: 16px;
  316. margin: 10px 12px 20px;
  317. background: #0c86d8;
  318. border-radius: 4px;
  319. text-align: center;
  320. line-height: 40px;
  321. height: 40px;
  322. color: #fff;
  323. }
  324. .statusType {
  325. padding: 10px 12px;
  326. background: #fff;
  327. overflow: hidden;
  328. margin-bottom: 10px;
  329. }
  330. .statusTypeLi {
  331. width: 16.666667%;
  332. float: left;
  333. /* text-align: center; */
  334. font-size: 14px;
  335. line-height: 16px;
  336. }
  337. .statusType text {
  338. display: inline-block;
  339. color: #fff;
  340. line-height: 14px;
  341. font-size: 12px;
  342. border: 1px solid #cacaca;
  343. border-radius: 50%;
  344. height: 9px;
  345. width: 9px;
  346. line-height: 12px;
  347. margin-right: 5px;
  348. position: relative;
  349. top: 0px;
  350. }
  351. /*正常*/
  352. .sStatue1 text {
  353. background: #0089fe;
  354. color: #0089fe;
  355. border-color: #0089fe;
  356. }
  357. /*早退*/
  358. .sStatue2 text {
  359. background: #f2b60a;
  360. color: #f2b60a;
  361. border-color: #f2b60a;
  362. }
  363. /*3旷课*/
  364. .sStatue3 text {
  365. background: #e24545;
  366. color: #e24545;
  367. border-color: #e24545;
  368. }
  369. /*病假*/
  370. .sStatue4 text {
  371. background: #29cf41;
  372. color: #29cf41;
  373. border-color: #29cf41;
  374. }
  375. /*迟到*/
  376. .sStatue5 text {
  377. background: #ad5151;
  378. color: #ad5151;
  379. border-color: #ad5151;
  380. }
  381. /*事假*/
  382. .sStatue6 text {
  383. background: #84f193;
  384. color: #84f193;
  385. border-color: #84f193;
  386. }
  387. .timeTableAlertZ {
  388. width: 100%;
  389. height: 100%;
  390. z-index: 99;
  391. position: fixed;
  392. top: 0;
  393. left: 0;
  394. right: 0;
  395. bottom: 0;
  396. background-color: rgba(0, 0, 0, 0.5);
  397. // display: none;
  398. }
  399. .timeTableAlert {
  400. z-index: -1;
  401. position: fixed;
  402. top: 0;
  403. left: 0;
  404. right: 0;
  405. bottom: 0;
  406. margin: auto;
  407. width: 80%;
  408. height: 70%;
  409. background: #fff;
  410. border-radius: 4px;
  411. filter: alpha(opacity=0);
  412. -moz-opacity: 0;
  413. -khtml-opacity: 0;
  414. opacity: 0;
  415. transition: all 0.3s;
  416. -moz-transition: all 0.3s;
  417. -ms-transition: all 0.3s;
  418. -o-transition: all 0.3s;
  419. -webkit-transition: all 0.3s;
  420. overflow: hidden;
  421. }
  422. .timeTableAlert.active {
  423. z-index: 999;
  424. filter: alpha(opacity=100);
  425. -moz-opacity: 1;
  426. -khtml-opacity: 1;
  427. opacity: 1;
  428. }
  429. .timeTableAlertTop {
  430. background-color: #0c86d8;
  431. padding: 10px 12px;
  432. }
  433. .timeTableAlertT {
  434. color: #fff;
  435. font-size: 16px;
  436. }
  437. .timeTableAlertTxt {
  438. font-size: 14px;
  439. color: #b8e2ff;
  440. text-align: right;
  441. margin-top: 5px;
  442. }
  443. .timeTableAlertList {
  444. overflow: auto;
  445. max-height: calc(100% - 62px);
  446. }
  447. .timeTableAlertLi {
  448. line-height: 40px;
  449. text-align: center;
  450. font-size: 14px;
  451. color: #1a1a1a;
  452. }
  453. .timeTableAlertLi.active {
  454. background-color: #d1ecff !important;
  455. }
  456. .timeTableAlertLi:nth-child(2n) {
  457. background-color: #fbfdff;
  458. }
  459. .timeTableAlertLi:nth-child(2n - 1) {
  460. background-color: #ffffff;
  461. }
  462. </style>