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.
 
 
 
 
 
 

155 lines
7.3 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-03-05 11:17
  5. * 描 述:TextBookOut
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 200, 400);
  19. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo',value: 'deptno',text: 'deptname' });
  20. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo',value: 'majorno',text: 'majorname' });
  21. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' });
  22. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo',value: 'lessonno',text: 'lessonname' });
  23. // 刷新
  24. $('#lr_refresh').on('click', function () {
  25. location.reload();
  26. });
  27. // 出库
  28. $('#lr_edit').on('click', function () {
  29. var keyValue = $('#gridtable').jfGridValue('ID');
  30. if (learun.checkrow(keyValue)) {
  31. learun.layerForm({
  32. id: 'form',
  33. title: '出库',
  34. url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/Form?keyValue=' + keyValue,
  35. width: 1000,
  36. height: 800,
  37. callBack: function (id) {
  38. var res = false;
  39. // 验证数据
  40. res = top[id].validForm();
  41. // 保存数据
  42. if (res) {
  43. res = top[id].save('', function () {
  44. page.search();
  45. });
  46. }
  47. return res;
  48. }
  49. });
  50. }
  51. });
  52. // 查看
  53. $('#lr_view').on('click', function () {
  54. var keyValue = $('#gridtable').jfGridValue('ID');
  55. if (learun.checkrow(keyValue)) {
  56. learun.layerForm({
  57. id: 'formview',
  58. title: '查看',
  59. url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormView?keyValue=' + keyValue,
  60. width: 1000,
  61. height: 700,
  62. btn: null,
  63. });
  64. }
  65. });
  66. // 删除
  67. $('#lr_delete').on('click', function () {
  68. var keyValue = $('#gridtable').jfGridValue('ID');
  69. if (learun.checkrow(keyValue)) {
  70. learun.layerForm({
  71. id: 'formdelete',
  72. title: '删除明细',
  73. url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormDelete?keyValue=' + keyValue,
  74. width: 1000,
  75. height: 700,
  76. btn: null,
  77. });
  78. }
  79. });
  80. },
  81. // 初始化列表
  82. initGird: function () {
  83. $('#gridtable').lrAuthorizeJfGrid({
  84. url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList',
  85. headData: [
  86. { label: '库存单号', name: 'BookCode', width: 200, align: "left" },
  87. {
  88. label: "课程", name: "LessonNo", width: 150, align: "left",
  89. formatterAsync: function (callback, value, row, op, $cell) {
  90. learun.clientdata.getAsync('custmerData', {
  91. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  92. key: value,
  93. keyId: 'lessonno',
  94. callback: function (_data) {
  95. callback(_data['lessonname']);
  96. }
  97. });
  98. }
  99. },
  100. { label: '教材名称', name: 'TextBookName', width: 200, align: "left" },
  101. { label: '教材号', name: 'TextBookNo', width: 200, align: "left" },
  102. { label: '出版号', name: 'PublishNo', width: 200, align: "left" },
  103. { label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" },
  104. { label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" },
  105. { label: '出版社', name: 'Publisher', width: 200, align: "left" },
  106. { label: '版次', name: 'Edition', width: 200, align: "left" },
  107. { label: '印次', name: 'Impression', width: 200, align: "left" },
  108. { label: '创建时间', name: 'CreateTime', width: 200, align: "left" },
  109. {
  110. label: '创建用户', name: 'CrateUserID', width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  111. learun.clientdata.getAsync('custmerData', {
  112. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
  113. key: value,
  114. keyId: 'f_userid',
  115. callback: function (_data) {
  116. callback(_data['f_realname']);
  117. }
  118. });
  119. }
  120. },
  121. { label: '修改人', name: 'UpTime', width: 200, align: "left" },
  122. {
  123. label: '修改用户', name: 'UpUserID', width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  124. learun.clientdata.getAsync('custmerData', {
  125. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
  126. key: value,
  127. keyId: 'f_userid',
  128. callback: function (_data) {
  129. callback(_data['f_realname']);
  130. }
  131. });
  132. }
  133. },
  134. { label: '当前数量', name: 'FinallyNum', width: 200, align: "left" },
  135. { label: '备注', name: 'Remark', width: 200, align: "left" },
  136. ],
  137. mainId: 'ID',
  138. isPage: true,
  139. sidx: 'CreateTime desc'
  140. });
  141. page.search();
  142. },
  143. search: function (param) {
  144. param = param || {};
  145. param.SqlParameter = ' and IsSubmit =1 ';
  146. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  147. }
  148. };
  149. refreshGirdData = function () {
  150. $('#gridtable').jfGridSet('reload');
  151. };
  152. page.init();
  153. }