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.

Form.js 2.4 KiB

4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 acceptClick;
  8. var keyValue = request('keyValue');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. $('.lr-form-wrap').lrscroll();
  14. page.bind();
  15. page.initData();
  16. },
  17. bind: function () {
  18. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' });
  19. $('#MeasurerID').lrselect({
  20. allowSearch: true,
  21. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=BaseUser',
  22. value: "f_account",
  23. text: "f_realname"
  24. });
  25. $('#PersonBeingMeasured').lrselect({
  26. allowSearch: true,
  27. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=StuInfoBasic',
  28. value: "stuno",
  29. text: "stuname"
  30. });
  31. $('#Status').lrDataItemSelect({ code: 'TemperatureMeasure' });
  32. $('#MeasureTime').lrDataItemSelect({ code: 'MeasureTime' });
  33. },
  34. initData: function () {
  35. if (!!keyValue) {
  36. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/Thermography/GetFormData?keyValue=' + keyValue, function (data) {
  37. for (var id in data) {
  38. if (!!data[id].length && data[id].length > 0) {
  39. $('#' + id ).jfGridSet('refreshdata', data[id]);
  40. }
  41. else {
  42. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  43. }
  44. }
  45. });
  46. }
  47. }
  48. };
  49. // 保存数据
  50. acceptClick = function (callBack) {
  51. if (!$('body').lrValidform()) {
  52. return false;
  53. }
  54. var postData = {
  55. strEntity: JSON.stringify($('body').lrGetFormData())
  56. };
  57. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Thermography/SaveForm?keyValue=' + keyValue, postData, function (res) {
  58. // 保存成功后才回调
  59. if (!!callBack) {
  60. callBack();
  61. }
  62. });
  63. };
  64. page.init();
  65. }