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.
 
 
 
 
 
 

193 lines
8.4 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-04-16 15:52
  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. // 刷新
  19. $('#lr_refresh').on('click', function () {
  20. location.reload();
  21. });
  22. //生成上午批次的测量体温人员
  23. //$('#lr_morning').on('click', function () {
  24. // learun.httpAsync('post', top.$.rootUrl + '/EducationalAdministration/Thermography/CreateMorningStudents', { timeType: "0" }, function (res) {
  25. // page.search({ MeasureTime: '0', CreateTime: "" });
  26. // })
  27. //});
  28. //提交上午测温
  29. $('#lr_morning').on('click', function () {
  30. var datas = $('#gridtable').jfGridGet('rowdatas');
  31. if (datas.length > 0) {
  32. learun.layerConfirm('是否确认提交上午测温!', function (res) {
  33. if (res) {
  34. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Thermography/DoSave', { measureTime: '0', rowdatas: JSON.stringify(datas) }, function () {
  35. refreshGirdData();
  36. });
  37. }
  38. });
  39. }
  40. });
  41. //提交中午测温
  42. $('#lr_noon').on('click', function () {
  43. var datas = $('#gridtable').jfGridGet('rowdatas');
  44. if (datas.length > 0) {
  45. learun.layerConfirm('是否确认提交中午测温!', function (res) {
  46. if (res) {
  47. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Thermography/DoSave', { measureTime: '1', rowdatas: JSON.stringify(datas) }, function () {
  48. refreshGirdData();
  49. });
  50. }
  51. });
  52. }
  53. });
  54. //提交晚上测温
  55. $('#lr_neight').on('click', function () {
  56. var datas = $('#gridtable').jfGridGet('rowdatas');
  57. if (datas.length > 0) {
  58. learun.layerConfirm('是否确认提交晚上测温!', function (res) {
  59. if (res) {
  60. learun.postForm(top.$.rootUrl + '/EducationalAdministration/Thermography/DoSave', { measureTime: '2', rowdatas: JSON.stringify(datas) }, function () {
  61. refreshGirdData();
  62. });
  63. }
  64. });
  65. }
  66. });
  67. },
  68. // 初始化列表
  69. initGird: function () {
  70. $('#gridtable').lrAuthorizeJfGrid({
  71. url: top.$.rootUrl + '/EducationalAdministration/Thermography/GetPageListOfStudent',
  72. headData: [
  73. {
  74. label: "系", name: "DeptNo", width: 100, align: "left",
  75. formatterAsync: function (callback, value, row, op, $cell) {
  76. learun.clientdata.getAsync('custmerData', {
  77. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  78. key: value,
  79. keyId: 'deptno',
  80. callback: function (_data) {
  81. callback(_data['deptname']);
  82. }
  83. });
  84. }
  85. },
  86. {
  87. label: "专业", name: "MajorNo", width: 100, align: "left",
  88. formatterAsync: function (callback, value, row, op, $cell) {
  89. learun.clientdata.getAsync('custmerData', {
  90. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  91. key: value,
  92. keyId: 'majorno',
  93. callback: function (_data) {
  94. callback(_data['majorname']);
  95. }
  96. });
  97. }
  98. },
  99. {
  100. label: "班级", name: "ClassNo", width: 100, align: "left",
  101. formatterAsync: function (callback, value, row, op, $cell) {
  102. learun.clientdata.getAsync('custmerData', {
  103. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  104. key: value,
  105. keyId: 'classno',
  106. callback: function (_data) {
  107. callback(_data['classname']);
  108. }
  109. });
  110. }
  111. },
  112. {
  113. label: "测温人", name: "MeasurerID", width: 100, align: "left",
  114. formatterAsync: function (callback, value, row, op, $cell) {
  115. learun.clientdata.getAsync('custmerData', {
  116. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
  117. key: value,
  118. keyId: 'f_account',
  119. callback: function (_data) {
  120. callback(_data['f_realname']);
  121. }
  122. });
  123. }
  124. },
  125. {
  126. label: "被测温人学号", name: "PersonBeingMeasured", width: 100, align: "left"
  127. },
  128. {
  129. label: "被测温人", name: "PersonBeingMeasuredName", width: 100, align: "left",
  130. formatterAsync: function (callback, value, row, op, $cell) {
  131. learun.clientdata.getAsync('custmerData', {
  132. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
  133. key: row.PersonBeingMeasured,
  134. keyId: 'f_account',
  135. callback: function (_data) {
  136. callback(_data['f_realname']);
  137. }
  138. });
  139. }
  140. },
  141. {
  142. label: "状态", name: "Status", width: 80, align: "left",
  143. edit: {
  144. type: 'select',
  145. datatype: 'dataItem',
  146. code: 'TemperatureMeasure'
  147. }
  148. },
  149. {
  150. label: "温度", name: "Temperature", width: 100, align: "left",
  151. edit: {
  152. type: 'input',
  153. inputType: 'number'
  154. }
  155. },
  156. {
  157. label: "处理结果", name: "ProcessingResult", width: 100, align: "left",
  158. edit: {
  159. type: 'input',
  160. }
  161. },
  162. {
  163. label: "备注", name: "Remark", width: 100, align: "left",
  164. edit: {
  165. type: 'input',
  166. }
  167. },
  168. ],
  169. mainId: 'ID',
  170. isPage: false
  171. });
  172. page.search();
  173. },
  174. search: function (param) {
  175. var loginInfo = top.learun.clientdata.get(['userinfo']);
  176. param = param || {};
  177. param.StartTime = startTime;
  178. param.EndTime = endTime;
  179. param.MeasurerID = loginInfo.account;
  180. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  181. }
  182. };
  183. refreshGirdData = function () {
  184. page.search();
  185. };
  186. page.init();
  187. }