|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
- * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- * 创建人:超级管理员
- * 日 期:2020-08-28 18:09
- * 描 述:授课考勤明细统计
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var startTime;
- var endTime;
- var page = {
- init: function () {
- page.initGird();
- page.bind();
- },
- bind: function () {
- $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
- page.search(queryJson);
- }, 250, 400);
- // 时间搜索框
- $('#datesearch').lrdate({
- dfdata: [
- { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
- { 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') } },
- { 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') } },
- { 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') } }
- ],
- // 月
- mShow: false,
- premShow: false,
- // 季度
- jShow: false,
- prejShow: false,
- // 年
- ysShow: false,
- yxShow: false,
- preyShow: false,
- yShow: false,
- // 默认
- dfvalue: '0',
- selectfn: function (begin, end) {
- startTime = begin;
- endTime = end;
- }
- });
- //当前年
- //var now = learun.formatDate(new Date(), 'yyyy-MM-dd');
- //$('#Date').val(now);
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
- // 部门选择
- $('#F_DepartmentId').lrselect({
- type: 'tree',
- // 是否允许搜索
- allowSearch: true,
- // 访问数据接口地址
- url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
- // 访问数据接口参数
- param: { parentId: '0' }
- });
- //考勤状态
- $('#ClockStatus').lrDataItemSelect({ code: 'ADStatus' });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/TeachAttendance/GetStatisticDetailList',
- headData: [
- { label: "姓名", name: "EmpNameInArrange", width: 100, align: "left" },
- { label: "职工编号", name: "EmpNoInArrange", width: 100, align: "left" },
- {
- label: "部门", name: "F_DepartmentId", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata',
- key: value,
- keyId: 'id',
- callback: function (_data) {
- callback(_data['name']);
- }
- });
- }
- },
- {
- label: "日期", name: "LessonDate", width: 100, align: "left", sort: true, formatter: function (cellvalue) {
- return cellvalue;
- }
- },
- { label: "学年", name: "AcademicYearNo", width: 60, align: "left", sort: true },
- { label: "学期", name: "Semester", width: 60, align: "left", sort: true },
- { label: "课程编号", name: "LessonNo", width: 100, align: "left", sort: true },
- { label: "课程名称", name: "LessonName", width: 100, align: "left", sort: true },
- { label: "教室编号", name: "ClassroomNo", width: 100, align: "left", sort: true },
- { label: "节次", name: "LessonTime", width: 60, align: "left", sort: true },
- { label: "时间段", name: "TimePeriod", width: 150, align: "left", sort: true },
- {
- label: "上课状态", name: "ADStatusWork", width: 60, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'ADStatus',
- callback: function (_data) {
- if (_data.text) {
- if (_data.text == "正常") {
- callback('<span class=\"label label-success\">' + _data.text + '</span>');
- } else if (_data.text == "缺勤") {
- callback('<span class=\"label label-danger\">' + _data.text + '</span>');
- } else {
- callback('<span class=\"label label-warning\">' + _data.text + '</span>');
- }
- }
-
- }
- });
- }, sort: true
- },
- {
- label: "下课状态", name: "ADStatusClose", width: 60, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('dataItem', {
- key: value,
- code: 'ADStatus',
- callback: function (_data) {
- if (_data.text) {
- if (_data.text == "正常") {
- callback('<span class=\"label label-success\">' + _data.text + '</span>');
- } else if (_data.text == "缺勤") {
- callback('<span class=\"label label-danger\">' + _data.text + '</span>');
- } else {
- callback('<span class=\"label label-warning\">' + _data.text + '</span>');
- }
- }
-
- }
- });
- }, sort: true
- },
- { label: "签到时间", name: "ClockTimeWork", width: 80, align: "left", sort: true },
- { label: "签退时间", name: "ClockTimeClose", width: 80, align: "left", sort: true},
- {
- label: "人脸检测", name: "IsFitstr", width: 80, align: "left", sort: true,
- formatterAsync: function (callback, value, row, op, $cell) {
- if (value!='True,True') {
- callback('<span class=\"label label-warning\">异常</span>');
- } else {
- callback('<span class=\"label label-success\">通过</span>');
- }
- }
- },
- {
- label: "人脸详情", name: "Img", width: 80, align: "left", sort: true,
- formatterAsync: function (callback, value, row, op, $cell) {
- callback("<span onclick=detail(\'" + row.Photo + "\',\'" + value + "\',\'" + row.IsFitstr + "\',\'" + row.EmpNameInArrange + "\',\'" + row.EmpNoInArrange+"\')>查看</span>");
- }
- },
- { label: "迟到(分钟)", name: "ChidaoMinutes", width: 80, align: "left", sort: true },
- { label: "早退(分钟)", name: "ZaoTuiMinutes", width: 80, align: "left", sort: true},
- { label: "出勤(分钟)", name: "ChuQinMinutes", width: 80, align: "left", sort: true },
- //{ label: "缺勤(分钟)", name: "QueQinMinutes", width: 80, align: "left",sort: true },
- { label: "工作(分钟)", name: "WorkMinutes", width: 80, align: "left",sort: true },
- { label: "休息(分钟)", name: "RestMinutes", width: 80, align: "left", sort: true },
- ],
- mainId: '',
- isPage: true,
- sidx: 'EmpNo,EmpName,LessonTime'
- });
- page.search();
- },
- search: function (param) {
- param = param || {};
- param.startTime = startTime;
- param.endTime = endTime;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- $('#gridtable').jfGridSet('reload');
- };
- page.init();
- }
- function detail(ADPhoto,photos,isfits,username,teachno) {
-
- //op.learun.layerForm({
- // id: 'PreviewForm',
- // title: '文件预览',
- // url: top.$.rootUrl + '/LR_Desktop/EnrollData/PreviewFile?folderid=' + ADPhoto,
- // width: 1080,
- // height: 850,
- // btn: null,
- // callBack: function (id) {
- // return top[id].acceptClick(refreshGirdData);
- // }
- //);
- var strs = photos.split(',')
- var strs1 = isfits.split(',')
- var html = '<div style="padding:20px"><p>检测人员:' + username+'</p>';
- html += ' <div style="display:flex;text-align:center;">';
- html += ' <div style="margin:50px">';
- //html += ' <image src="'+ADPhoto+'" style="width:150px">';
- if (ADPhoto) {
- html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + ADPhoto + '" style="width:150px">';
- }
- html += ' <p>对比照片</p>';
- html += ' </div>';
- html += ' <div style="margin:50px">';
- if(strs[0]){
- html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + strs[0] + '" style="width:150px">';
- } else {
- if (strs1[0].indexOf("True") >= 0) {
- $.ajax({
- url: "/EducationalAdministration/TeachAttendance/GetStatisticDetailimg?TeachNo=" + teachno,
- method: "get",
- data: {},
- async: false,
- success: function (res) {
- if (res.info) {
- html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + res.info + '" style="width:150px">';
- } else {
- html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + ADPhoto + '" style="width:150px">';
- }
- }
- })
- }
- }
- if (strs1[0].indexOf("False") >= 0 || strs1[0]=='') {
- html += ' <p>上班打卡 未通过</p>';
- } else {
- html += ' <p>上班打卡 通过</p>';
- }
- html += ' </div>';
- html += ' <div style="margin:50px">';
- if(strs[1]){
- html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + strs[1] + '" style="width:150px">';
- }else{
- if (strs1[1].indexOf("True") >= 0) {
- $.ajax({
- url: "/EducationalAdministration/TeachAttendance/GetStatisticDetailimg?TeachNo=" + teachno,
- method: "get",
- data: {},
- async: false,
- success: function (res) {
- if (res.info) {
- html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + res.info + '" style="width:150px">';
- } else {
- html += ' <image src="/LR_Desktop/EnrollData/PreviewFile?folderid=' + ADPhoto + '" style="width:150px">';
- }
- }
- })
- }
- }
- if (strs1[1].indexOf("False") >= 0 || strs1[1] == '') {
- html += ' <p>下班打卡 未通过</p>';
- } else {
- html += ' <p>下班打卡 通过</p>';
- }
- html += ' </div>';
- html += '</div></div>';
- top.layer.open({
- type: 1,
- closeBtn: 2,
- title: "人脸检测",
- area: ['800px', '60%'],
- content: html
- });
- }
|