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.

StatisticDetailIndex.js 13 KiB

пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-08-28 18:09
  5. * 描 述:授课考勤明细统计
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var startTime;
  11. var endTime;
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  19. page.search(queryJson);
  20. }, 250, 400);
  21. // 时间搜索框
  22. $('#datesearch').lrdate({
  23. dfdata: [
  24. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  25. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  26. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  27. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
  28. ],
  29. // 月
  30. mShow: false,
  31. premShow: false,
  32. // 季度
  33. jShow: false,
  34. prejShow: false,
  35. // 年
  36. ysShow: false,
  37. yxShow: false,
  38. preyShow: false,
  39. yShow: false,
  40. // 默认
  41. dfvalue: '0',
  42. selectfn: function (begin, end) {
  43. startTime = begin;
  44. endTime = end;
  45. }
  46. });
  47. //当前年
  48. //var now = learun.formatDate(new Date(), 'yyyy-MM-dd');
  49. //$('#Date').val(now);
  50. // 刷新
  51. $('#lr_refresh').on('click', function () {
  52. location.reload();
  53. });
  54. // 部门选择
  55. $('#F_DepartmentId').lrselect({
  56. type: 'tree',
  57. // 是否允许搜索
  58. allowSearch: true,
  59. // 访问数据接口地址
  60. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
  61. // 访问数据接口参数
  62. param: { parentId: '0' }
  63. });
  64. //考勤状态
  65. $('#ClockStatus').lrDataItemSelect({ code: 'ADStatus' });
  66. },
  67. // 初始化列表
  68. initGird: function () {
  69. $('#gridtable').jfGrid({
  70. url: top.$.rootUrl + '/EducationalAdministration/TeachAttendance/GetStatisticDetailList',
  71. headData: [
  72. { label: "姓名", name: "EmpNameInArrange", width: 100, align: "left" },
  73. { label: "职工编号", name: "EmpNoInArrange", width: 100, align: "left" },
  74. {
  75. label: "部门", name: "F_DepartmentId", width: 100, align: "left",
  76. formatterAsync: function (callback, value, row, op, $cell) {
  77. learun.clientdata.getAsync('custmerData', {
  78. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
  79. key: value,
  80. keyId: 'id',
  81. callback: function (_data) {
  82. callback(_data['name']);
  83. }
  84. });
  85. }
  86. },
  87. {
  88. label: "日期", name: "LessonDate", width: 100, align: "left", sort: true, formatter: function (cellvalue) {
  89. return cellvalue;
  90. }
  91. },
  92. { label: "学年", name: "AcademicYearNo", width: 60, align: "left", sort: true },
  93. { label: "学期", name: "Semester", width: 60, align: "left", sort: true },
  94. { label: "课程编号", name: "LessonNo", width: 100, align: "left", sort: true },
  95. { label: "课程名称", name: "LessonName", width: 100, align: "left", sort: true },
  96. { label: "教室编号", name: "ClassroomNo", width: 100, align: "left", sort: true },
  97. { label: "节次", name: "LessonTime", width: 60, align: "left", sort: true },
  98. { label: "时间段", name: "TimePeriod", width: 150, align: "left", sort: true },
  99. {
  100. label: "上课状态", name: "ADStatusWork", width: 60, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  101. learun.clientdata.getAsync('dataItem', {
  102. key: value,
  103. code: 'ADStatus',
  104. callback: function (_data) {
  105. if (_data.text) {
  106. if (_data.text == "正常") {
  107. callback('<span class=\"label label-success\">' + _data.text + '</span>');
  108. } else if (_data.text == "缺勤") {
  109. callback('<span class=\"label label-danger\">' + _data.text + '</span>');
  110. } else {
  111. callback('<span class=\"label label-warning\">' + _data.text + '</span>');
  112. }
  113. }
  114. }
  115. });
  116. }, sort: true
  117. },
  118. {
  119. label: "下课状态", name: "ADStatusClose", width: 60, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  120. learun.clientdata.getAsync('dataItem', {
  121. key: value,
  122. code: 'ADStatus',
  123. callback: function (_data) {
  124. if (_data.text) {
  125. if (_data.text == "正常") {
  126. callback('<span class=\"label label-success\">' + _data.text + '</span>');
  127. } else if (_data.text == "缺勤") {
  128. callback('<span class=\"label label-danger\">' + _data.text + '</span>');
  129. } else {
  130. callback('<span class=\"label label-warning\">' + _data.text + '</span>');
  131. }
  132. }
  133. }
  134. });
  135. }, sort: true
  136. },
  137. { label: "签到时间", name: "ClockTimeWork", width: 80, align: "left", sort: true },
  138. { label: "签退时间", name: "ClockTimeClose", width: 80, align: "left", sort: true},
  139. {
  140. label: "人脸检测", name: "IsFitstr", width: 80, align: "left", sort: true,
  141. formatterAsync: function (callback, value, row, op, $cell) {
  142. if (value!='True,True') {
  143. callback('<span class=\"label label-warning\">异常</span>');
  144. } else {
  145. callback('<span class=\"label label-success\">通过</span>');
  146. }
  147. }
  148. },
  149. {
  150. label: "人脸详情", name: "Img", width: 80, align: "left", sort: true,
  151. formatterAsync: function (callback, value, row, op, $cell) {
  152. callback("<span onclick=detail(\'" + row.Photo + "\',\'" + value + "\',\'" + row.IsFitstr + "\',\'" + row.EmpNameInArrange + "\',\'" + row.EmpNoInArrange+"\')>查看</span>");
  153. }
  154. },
  155. { label: "迟到(分钟)", name: "ChidaoMinutes", width: 80, align: "left", sort: true },
  156. { label: "早退(分钟)", name: "ZaoTuiMinutes", width: 80, align: "left", sort: true},
  157. { label: "出勤(分钟)", name: "ChuQinMinutes", width: 80, align: "left", sort: true },
  158. //{ label: "缺勤(分钟)", name: "QueQinMinutes", width: 80, align: "left",sort: true },
  159. { label: "工作(分钟)", name: "WorkMinutes", width: 80, align: "left",sort: true },
  160. { label: "休息(分钟)", name: "RestMinutes", width: 80, align: "left", sort: true },
  161. ],
  162. mainId: '',
  163. isPage: true,
  164. sidx: 'EmpNo,EmpName,LessonTime'
  165. });
  166. page.search();
  167. },
  168. search: function (param) {
  169. param = param || {};
  170. param.startTime = startTime;
  171. param.endTime = endTime;
  172. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  173. }
  174. };
  175. refreshGirdData = function () {
  176. $('#gridtable').jfGridSet('reload');
  177. };
  178. page.init();
  179. }
  180. function detail(ADPhoto,photos,isfits,username,teachno) {
  181. //op.learun.layerForm({
  182. // id: 'PreviewForm',
  183. // title: '文件预览',
  184. // url: top.$.rootUrl + '/LR_Desktop/EnrollData/PreviewFile?folderid=' + ADPhoto,
  185. // width: 1080,
  186. // height: 850,
  187. // btn: null,
  188. // callBack: function (id) {
  189. // return top[id].acceptClick(refreshGirdData);
  190. // }
  191. //);
  192. var strs = photos.split(',')
  193. var strs1 = isfits.split(',')
  194. var html = '<div style="padding:20px"><p>检测人员:' + username+'</p>';
  195. html += ' <div style="display:flex;text-align:center;">';
  196. html += ' <div style="margin:50px">';
  197. //html += ' <image src="'+ADPhoto+'" style="width:150px">';
  198. if (ADPhoto) {
  199. html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + ADPhoto + '" style="width:150px">';
  200. }
  201. html += ' <p>对比照片</p>';
  202. html += ' </div>';
  203. html += ' <div style="margin:50px">';
  204. if(strs[0]){
  205. html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + strs[0] + '" style="width:150px">';
  206. } else {
  207. if (strs1[0].indexOf("True") >= 0) {
  208. $.ajax({
  209. url: "/EducationalAdministration/TeachAttendance/GetStatisticDetailimg?TeachNo=" + teachno,
  210. method: "get",
  211. data: {},
  212. async: false,
  213. success: function (res) {
  214. if (res.info) {
  215. html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + res.info + '" style="width:150px">';
  216. } else {
  217. html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + ADPhoto + '" style="width:150px">';
  218. }
  219. }
  220. })
  221. }
  222. }
  223. if (strs1[0].indexOf("False") >= 0 || strs1[0]=='') {
  224. html += ' <p>上班打卡 未通过</p>';
  225. } else {
  226. html += ' <p>上班打卡 通过</p>';
  227. }
  228. html += ' </div>';
  229. html += ' <div style="margin:50px">';
  230. if(strs[1]){
  231. html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + strs[1] + '" style="width:150px">';
  232. }else{
  233. if (strs1[1].indexOf("True") >= 0) {
  234. $.ajax({
  235. url: "/EducationalAdministration/TeachAttendance/GetStatisticDetailimg?TeachNo=" + teachno,
  236. method: "get",
  237. data: {},
  238. async: false,
  239. success: function (res) {
  240. if (res.info) {
  241. html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + res.info + '" style="width:150px">';
  242. } else {
  243. html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + ADPhoto + '" style="width:150px">';
  244. }
  245. }
  246. })
  247. }
  248. }
  249. if (strs1[1].indexOf("False") >= 0 || strs1[1] == '') {
  250. html += ' <p>下班打卡 未通过</p>';
  251. } else {
  252. html += ' <p>下班打卡 通过</p>';
  253. }
  254. html += ' </div>';
  255. html += '</div></div>';
  256. top.layer.open({
  257. type: 1,
  258. closeBtn: 2,
  259. title: "人脸检测",
  260. area: ['800px', '60%'],
  261. content: html
  262. });
  263. }