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.
 
 
 
 
 
 

139 lines
6.1 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-06-12 10:06
  5. * 描 述:书籍信息
  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. }, 220, 400);
  19. // 刷新
  20. $('#lr_refresh').on('click', function () {
  21. location.reload();
  22. });
  23. // 新增
  24. $('#lr_add').on('click', function () {
  25. learun.layerForm({
  26. id: 'form',
  27. title: '新增',
  28. url: top.$.rootUrl + '/EducationalAdministration/BookInfo/Form',
  29. width: 600,
  30. height: 400,
  31. callBack: function (id) {
  32. return top[id].acceptClick(refreshGirdData);
  33. }
  34. });
  35. });
  36. // 编辑
  37. $('#lr_edit').on('click', function () {
  38. var keyValue = $('#gridtable').jfGridValue('ID');
  39. if (learun.checkrow(keyValue)) {
  40. learun.layerForm({
  41. id: 'form',
  42. title: '编辑',
  43. url: top.$.rootUrl + '/EducationalAdministration/BookInfo/Form?keyValue=' + keyValue,
  44. width: 600,
  45. height: 400,
  46. callBack: function (id) {
  47. return top[id].acceptClick(refreshGirdData);
  48. }
  49. });
  50. }
  51. });
  52. // 删除
  53. $('#lr_delete').on('click', function () {
  54. var keyValue = $('#gridtable').jfGridValue('ID');
  55. if (learun.checkrow(keyValue)) {
  56. learun.layerConfirm('是否确认删除该项!', function (res) {
  57. if (res) {
  58. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/BookInfo/DeleteForm', { keyValue: keyValue }, function () {
  59. refreshGirdData();
  60. });
  61. }
  62. });
  63. }
  64. });
  65. // 打印
  66. $('#lr_print').on('click', function () {
  67. $('#gridtable').jqprintTable();
  68. });
  69. },
  70. // 初始化列表
  71. initGird: function () {
  72. $('#gridtable').lrAuthorizeJfGrid({
  73. url: top.$.rootUrl + '/EducationalAdministration/BookInfo/GetPageList',
  74. headData: [
  75. { label: "书籍名称", name: "BookName", width: 100, align: "left" },
  76. { label: "书籍提要", name: "Collation", width: 100, align: "left" },
  77. { label: "书籍ISBN", name: "ISBN", width: 100, align: "left" },
  78. {
  79. label: "书籍类别号", name: "BookType", width: 100, align: "left",
  80. formatterAsync: function (callback, value, row, op, $cell) {
  81. learun.clientdata.getAsync('custmerData', {
  82. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BookClass',
  83. key: value,
  84. keyId: 'id',
  85. callback: function (_data) {
  86. callback(_data['typename']);
  87. }
  88. });
  89. }
  90. },
  91. { label: "书籍作者", name: "Author", width: 100, align: "left" },
  92. { label: "书籍出版社", name: "Publisher", width: 100, align: "left" },
  93. { label: "书籍编号", name: "BookCode", width: 100, align: "left" },
  94. { label: "出版时间", name: "PublishTime", width: 100, align: "left" },
  95. { label: "入库时间", name: "AddTime", width: 100, align: "left" },
  96. { label: "书籍价格", name: "Price", width: 100, align: "left" },
  97. {
  98. label: "存放位置", name: "BookLocation", width: 100, align: "left",
  99. formatterAsync: function (callback, value, row, op, $cell) {
  100. learun.clientdata.getAsync('custmerData', {
  101. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BookLocation',
  102. key: value,
  103. keyId: 'id',
  104. callback: function (_data) {
  105. callback(_data['booklocation']);
  106. }
  107. });
  108. }
  109. },
  110. {
  111. label: "审核标志", name: "CheckMark", width: 100, align: "left",
  112. formatterAsync: function (callback, value, row, op, $cell) {
  113. learun.clientdata.getAsync('dataItem', {
  114. key: value,
  115. code: 'BookStatus',
  116. callback: function (_data) {
  117. callback(_data.text);
  118. }
  119. });
  120. }
  121. },
  122. { label: "备注", name: "Remark", width: 100, align: "left" },
  123. ],
  124. mainId: 'ID',
  125. isPage: true
  126. });
  127. page.search();
  128. },
  129. search: function (param) {
  130. param = param || {};
  131. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  132. }
  133. };
  134. refreshGirdData = function () {
  135. page.search();
  136. };
  137. page.init();
  138. }