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.

FormIn.js 1.7 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-03-03 10:15
  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. },
  19. initData: function () {
  20. if (!!keyValue) {
  21. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/GetFormData?keyValue=' + keyValue, function (data) {
  22. for (var id in data) {
  23. if (!!data[id].length && data[id].length > 0) {
  24. $('#' + id).jfGridSet('refreshdata', data[id]);
  25. }
  26. else {
  27. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  28. }
  29. }
  30. });
  31. } else {
  32. $("#BookCode").val(InBookCode);
  33. }
  34. }
  35. };
  36. // 保存数据
  37. acceptClick = function (callBack) {
  38. if (!$('body').lrValidform()) {
  39. return false;
  40. }
  41. var postData = $('body').lrGetFormData();
  42. if (!!keyValue) {
  43. if (!!selectedRow) {
  44. postData.ID = selectedRow.ID;
  45. }
  46. } else {
  47. postData.ID = learun.newGuid();
  48. }
  49. if (!!callBack) {
  50. callBack(postData);
  51. return true;
  52. }
  53. };
  54. page.init();
  55. }