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.
 
 
 
 
 
 

97 lines
4.0 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-03-01 17:26
  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. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' });
  20. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  21. $('#AcademicYearNo').lrselect({
  22. placeholder: "请选择学年",
  23. allowSearch: true,
  24. url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear',
  25. value: 'value',
  26. text: 'text'
  27. });
  28. //学期
  29. $('#Semester').lrselect({
  30. placeholder: "请选择学期",
  31. allowSearch: true,
  32. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  33. value: 'value',
  34. text: 'text'
  35. });
  36. $('#TextBookSolSubDetail').jfGrid({
  37. headData: [
  38. {
  39. label: "班级", name: "ClassNo", width: 100, align: "left",
  40. formatterAsync: function (callback, value, row, op, $cell) {
  41. learun.clientdata.getAsync('custmerData', {
  42. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  43. key: value,
  44. keyId: 'classno',
  45. callback: function (_data) {
  46. callback(_data['classname']);
  47. }
  48. });
  49. }
  50. },
  51. { label: '教师人数', name: 'TeachSum', width: 80, align: 'left' },
  52. { label: '学生人数', name: 'StuSum', width: 80, align: 'left' },
  53. { label: '备注', name: 'Remark', width: 100, align: 'left' },
  54. ],
  55. height: 400,
  56. mainId: 'ID,IndentID',
  57. reloadSelected: false,
  58. });
  59. $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss'));
  60. $('#CreateUserID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId;
  61. $('#CreateUserID').val(learun.clientdata.get(['userinfo']).realName);
  62. },
  63. initData: function () {
  64. if (!!keyValue) {
  65. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/GetFormData?keyValue=' + keyValue, function (data) {
  66. for (var id in data) {
  67. if (!!data[id].length && data[id].length > 0) {
  68. $('#' + id ).jfGridSet('refreshdata', data[id]);
  69. }
  70. else {
  71. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  72. }
  73. }
  74. });
  75. }
  76. }
  77. };
  78. // 保存数据
  79. acceptClick = function (callBack) {
  80. if (!$('body').lrValidform()) {
  81. return false;
  82. }
  83. var postData = {
  84. strEntity: JSON.stringify($('body').lrGetFormData())
  85. };
  86. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/SaveForm?keyValue=' + keyValue, postData, function (res) {
  87. // 保存成功后才回调
  88. if (!!callBack) {
  89. callBack();
  90. }
  91. });
  92. };
  93. page.init();
  94. }