|
- /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
- * Copyright (c) 2013-2018 北京泉江科技有限公司
- * 创建人:超级管理员
- * 日 期:2020-04-16 15:52
- * 描 述:班级自诊打卡
- */
- var refreshGirdData;
- var bootstrap = function ($, learun) {
- "use strict";
- var startTime;
- var endTime;
- var page = {
- init: function () {
-
- page.initGird();
- page.bind();
- },
- bind: function () {
- // 刷新
- $('#lr_refresh').on('click', function () {
- location.reload();
- });
-
- //生成上午批次的测量体温人员
- //$('#lr_morning').on('click', function () {
- // learun.httpAsync('post', top.$.rootUrl + '/EducationalAdministration/Thermography/CreateMorningStudents', { timeType: "0" }, function (res) {
- // page.search({ MeasureTime: '0', CreateTime: "" });
-
- // })
- //});
-
- //提交上午测温
- $('#lr_morning').on('click', function () {
- var datas = $('#gridtable').jfGridGet('rowdatas');
- if (datas.length > 0) {
- learun.layerConfirm('是否确认提交上午测温!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Thermography/DoSave', { measureTime: '0', rowdatas: JSON.stringify(datas) }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //提交中午测温
- $('#lr_noon').on('click', function () {
- var datas = $('#gridtable').jfGridGet('rowdatas');
- if (datas.length > 0) {
- learun.layerConfirm('是否确认提交中午测温!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Thermography/DoSave', { measureTime: '1', rowdatas: JSON.stringify(datas) }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- //提交晚上测温
- $('#lr_neight').on('click', function () {
- var datas = $('#gridtable').jfGridGet('rowdatas');
- if (datas.length > 0) {
- learun.layerConfirm('是否确认提交晚上测温!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Thermography/DoSave', { measureTime: '2', rowdatas: JSON.stringify(datas) }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
-
- //提交测温
- $('#lr_submit').on('click', function () {
- var datas = $('#gridtable').jfGridGet('rowdatas');
- if (datas.length > 0) {
- learun.layerConfirm('是否确认提交测温!', function (res) {
- if (res) {
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/Thermography/DoSave', { measureTime: '-1', rowdatas: JSON.stringify(datas) }, function () {
- refreshGirdData();
- });
- }
- });
- }
- });
- },
- // 初始化列表
- initGird: function () {
- $('#gridtable').lrAuthorizeJfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/Thermography/GetPageListOfStudent',
- headData: [
- {
- label: "系", name: "DeptNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
- key: value,
- keyId: 'deptno',
- callback: function (_data) {
- callback(_data['deptname']);
- }
- });
- }
- },
- {
- label: "专业", name: "MajorNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
- key: value,
- keyId: 'majorno',
- callback: function (_data) {
- callback(_data['majorname']);
- }
- });
- }
- },
- {
- label: "班级", name: "ClassNo", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
- key: value,
- keyId: 'classno',
- callback: function (_data) {
- callback(_data['classname']);
- }
- });
- }
- },
- {
- label: "测温人", name: "MeasurerID", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
- key: value,
- keyId: 'f_account',
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
- },
- {
- label: "被测温人学号", name: "PersonBeingMeasured", width: 100, align: "left"
- },
- {
- label: "被测温人", name: "PersonBeingMeasuredName", width: 100, align: "left",
- formatterAsync: function (callback, value, row, op, $cell) {
- learun.clientdata.getAsync('custmerData', {
- url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
- key: row.PersonBeingMeasured,
- keyId: 'f_account',
- callback: function (_data) {
- callback(_data['f_realname']);
- }
- });
- }
- },
- {
- label: "状态", name: "Status", width: 80, align: "left",
- edit: {
- type: 'select',
- datatype: 'dataItem',
- code: 'TemperatureMeasure'
- }
- },
- {
- label: "温度", name: "Temperature", width: 100, align: "left",
- edit: {
- type: 'input',
- inputType: 'number'
- }
- },
- {
- label: "处理结果", name: "ProcessingResult", width: 100, align: "left",
- edit: {
- type: 'input',
- }
- },
- {
- label: "备注", name: "Remark", width: 100, align: "left",
- edit: {
- type: 'input',
- }
- },
- ],
- mainId: 'ID',
- isPage: false
- });
- page.search();
- },
- search: function (param) {
- var loginInfo = top.learun.clientdata.get(['userinfo']);
- param = param || {};
- param.StartTime = startTime;
- param.EndTime = endTime;
- param.MeasurerID = loginInfo.account;
- $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
- }
- };
- refreshGirdData = function () {
- page.search();
- };
- page.init();
- }
|