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
4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-12-31 10:38
  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. $('#Gender').lrDataItemSelect({ code: 'usersex' });
  19. $('#IsInJob').lrDataItemSelect({ code: 'YesOrNoInt' });
  20. $('#Nation').lrDataItemSelect({ code: 'National' });
  21. $('#Education').lrDataSourceSelect({ code: 'BCdCultureDegree', value: 'culturedegreeno', text: 'culturedegree' });
  22. },
  23. initData: function () {
  24. if (!!keyValue) {
  25. $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/PMMembership/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 postData = {
  44. strEntity: JSON.stringify($('body').lrGetFormData())
  45. };
  46. $.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/PMMembership/SaveForm?keyValue=' + keyValue, postData, function (res) {
  47. // 保存成功后才回调
  48. if (!!callBack) {
  49. callBack();
  50. }
  51. });
  52. };
  53. page.init();
  54. }