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.0 KiB

4 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-02-03 14:44
  5. * 描 述:疫情详细信息
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var EID = request('EID');
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. $('.lr-form-wrap').lrscroll();
  15. page.bind();
  16. page.initData();
  17. },
  18. bind: function () {
  19. $('#Gender').lrDataItemSelect({ code: 'usersex' });
  20. $('#QTType').lrDataItemSelect({ code: 'QuarantineType' });
  21. $('#Fever').lrDataItemSelect({ code: 'YesOrNoInt' });
  22. },
  23. initData: function () {
  24. if (!!keyValue) {
  25. $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/ContactsDetails/GetFormData?keyValue=' + keyValue, function (data) {
  26. for (var id in data) {
  27. if (!!data[id].length && data[id].length > 0) {
  28. $('#' + id).jfGridSet('refreshdata', data[id]);
  29. }
  30. else {
  31. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  32. }
  33. }
  34. });
  35. }
  36. }
  37. };
  38. // 保存数据
  39. acceptClick = function (callBack) {
  40. if (!$('body').lrValidform()) {
  41. return false;
  42. }
  43. var bodyForm = $('body').lrGetFormData();
  44. if (EID) {
  45. bodyForm.EID = EID;
  46. }
  47. var postData = {
  48. strEntity: JSON.stringify(bodyForm)
  49. };
  50. $.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/ContactsDetails/SaveForm?keyValue=' + keyValue, postData, function (res) {
  51. // 保存成功后才回调
  52. if (!!callBack) {
  53. callBack();
  54. }
  55. });
  56. };
  57. page.init();
  58. }