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.
 
 
 
 
 
 

113 lines
5.1 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-03-02 10:37
  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. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  19. $('#TextBookName').lrGirdSelect({
  20. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=TextBookInfo',
  21. param: { strWhere: " IsDel = '0' and IsValid ='true' " },
  22. height: 800,
  23. width: 1100,
  24. selectWord: 'textbookname',
  25. value: 'textbookname',
  26. text: 'textbookname',
  27. headData:
  28. [
  29. { label: "教材号", name: "publishno", width: 150, align: "left" },
  30. { label: "教材编码", name: "textbookno", width: 150, align: "left" },
  31. { label: "教材名称", name: "textbookname", width: 150, align: "left" },
  32. { label: "作者", name: "firstauthor", width: 150, align: "left" },
  33. { label: "其他作者", name: "otherauthor", width: 100, align: "left" },
  34. { label: "出版日期", name: "pubdate", width: 100, align: "left" },
  35. { label: "出版社", name: "publisher", width: 100, align: "left" },
  36. {
  37. label: "教材类型", name: "textbooktype", width: 100, align: "left",
  38. formatterAsync: function (callback, value, row, op, $cell) {
  39. learun.clientdata.getAsync('dataItem', {
  40. key: value,
  41. code: 'TextBookType',
  42. callback: function (_data) {
  43. callback(_data.text);
  44. }
  45. });
  46. }
  47. },
  48. {
  49. label: "教材性质", name: "textbooknature", width: 100, align: "left",
  50. formatterAsync: function (callback, value, row, op, $cell) {
  51. learun.clientdata.getAsync('dataItem', {
  52. key: value,
  53. code: 'TextBookNature',
  54. callback: function (_data) {
  55. callback(_data.text);
  56. }
  57. });
  58. }
  59. },
  60. { label: "价格", name: "price", width: 50, align: "left" },
  61. { label: "版次", name: "edition", width: 100, align: "left" },
  62. { label: "印次", name: "impression", width: 100, align: "left" },
  63. ],
  64. select: function (item) {
  65. ////赋值
  66. $("#Price").val(item.price);
  67. $("#PublishNo").val(item.publishno);
  68. $("#TextBookNo").val(item.textbookno);
  69. $("#TextBookName").val(item.textbookname);
  70. $("#FirstAuthor").val(item.firstauthor);
  71. $("#OtherAuthor").val(item.otherauthor);
  72. $("#Publisher").val(item.publisher);
  73. $("#Edition").val(item.edition);
  74. $("#Impression").val(item.impression);
  75. }
  76. });
  77. },
  78. initData: function () {
  79. if (!!keyValue) {
  80. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetFormData?keyValue=' + keyValue, function (data) {
  81. for (var id in data) {
  82. if (!!data[id].length && data[id].length > 0) {
  83. $('#' + id).jfGridSet('refreshdata', data[id]);
  84. }
  85. else {
  86. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  87. }
  88. }
  89. });
  90. } else {
  91. $("#BookCode").val(BookCode);
  92. }
  93. }
  94. };
  95. // 保存数据
  96. acceptClick = function (callBack) {
  97. if (!$('body').lrValidform()) {
  98. return false;
  99. }
  100. var postData = {
  101. strEntity: JSON.stringify($('body').lrGetFormData())
  102. };
  103. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/SaveForm?keyValue=' + keyValue, postData, function (res) {
  104. // 保存成功后才回调
  105. if (!!callBack) {
  106. callBack();
  107. }
  108. });
  109. };
  110. page.init();
  111. }