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.
 
 
 
 
 
 

58 lines
2.3 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-01-24 12:19
  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. //$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  19. $('#TextBookType').lrDataItemSelect({ code: 'TextBookType' });
  20. $('#TextBookNature').lrDataItemSelect({ code: 'TextBookNature' });
  21. $('#IsWorkBook').lrDataItemSelect({ code: 'YesOrNoBit' });
  22. $('#IsTeachConsult').lrDataItemSelect({ code: 'YesOrNoBit' });
  23. $('#CreateUserID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId;
  24. $('#CreateUserID').val(learun.clientdata.get(['userinfo']).realName);
  25. $('#Createdate').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss'));
  26. },
  27. initData: function () {
  28. if (!!keyValue) {
  29. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookInfo/GetFormData?keyValue=' + keyValue, function (data) {
  30. for (var id in data) {
  31. if (!!data[id].length && data[id].length > 0) {
  32. $('#' + id).jfGridSet('refreshdata', data[id]);
  33. }
  34. else {
  35. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  36. }
  37. }
  38. });
  39. }
  40. }
  41. };
  42. // 保存数据
  43. acceptClick = function (callBack) {
  44. if (!$('body').lrValidform()) {
  45. return false;
  46. }
  47. var postData = {
  48. strEntity: JSON.stringify($('body').lrGetFormData())
  49. };
  50. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookInfo/SaveForm?keyValue=' + keyValue, postData, function (res) {
  51. // 保存成功后才回调
  52. if (!!callBack) {
  53. callBack();
  54. }
  55. });
  56. };
  57. page.init();
  58. }