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.
 
 
 
 
 
 

129 lines
5.7 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-03-03 10:15
  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_edit').on('click', function () {
  25. var keyValue = $('#gridtable').jfGridValue('ID');
  26. if (learun.checkrow(keyValue)) {
  27. learun.layerForm({
  28. id: 'form',
  29. title: '编辑',
  30. url: top.$.rootUrl + '/EducationalAdministration/TextBookIn/Form?keyValue=' + keyValue,
  31. width: 800,
  32. height: 800,
  33. callBack: function (id) {
  34. var res = false;
  35. // 验证数据
  36. res = top[id].validForm();
  37. // 保存数据
  38. if (res) {
  39. res = top[id].save('', function () {
  40. page.search();
  41. });
  42. }
  43. return res;
  44. }
  45. });
  46. }
  47. });
  48. // 查看
  49. $('#lr_view').on('click', function () {
  50. var keyValue = $('#gridtable').jfGridValue('ID');
  51. if (learun.checkrow(keyValue)) {
  52. learun.layerForm({
  53. id: 'formview',
  54. title: '查看',
  55. url: top.$.rootUrl + '/EducationalAdministration/TextBookIn/FormView?keyValue=' + keyValue,
  56. width: 1000,
  57. height: 700,
  58. btn: null,
  59. });
  60. }
  61. });
  62. // 删除
  63. $('#lr_delete').on('click', function () {
  64. var keyValue = $('#gridtable').jfGridValue('ID');
  65. if (learun.checkrow(keyValue)) {
  66. learun.layerForm({
  67. id: 'formdelete',
  68. title: '删除明细',
  69. url: top.$.rootUrl + '/EducationalAdministration/TextBookIn/FormDelete?keyValue=' + keyValue,
  70. width: 1000,
  71. height: 700,
  72. btn: null,
  73. });
  74. }
  75. });
  76. },
  77. // 初始化列表
  78. initGird: function () {
  79. $('#gridtable').lrAuthorizeJfGrid({
  80. url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList',
  81. headData: [
  82. { label: '库存单号', name: 'BookCode', width: 200, align: "left" },
  83. {
  84. label: "课程", name: "LessonNo", width: 150, align: "left",
  85. formatterAsync: function (callback, value, row, op, $cell) {
  86. learun.clientdata.getAsync('custmerData', {
  87. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  88. key: value,
  89. keyId: 'lessonno',
  90. callback: function (_data) {
  91. callback(_data['lessonname']);
  92. }
  93. });
  94. }
  95. },
  96. { label: '教材名称', name: 'TextBookName', width: 200, align: "left" },
  97. { label: '教材号', name: 'TextBookNo', width: 200, align: "left" },
  98. { label: '出版号', name: 'PublishNo', width: 200, align: "left" },
  99. { label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" },
  100. { label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" },
  101. { label: '出版社', name: 'Publisher', width: 200, align: "left" },
  102. { label: '版次', name: 'Edition', width: 200, align: "left" },
  103. { label: '印次', name: 'Impression', width: 200, align: "left" },
  104. { label: '创建人', name: 'CreateTime', width: 200, align: "left" },
  105. { label: '创建用户', name: 'CrateUserID', width: 200, align: "left" },
  106. { label: '修改人', name: 'UpTime', width: 200, align: "left" },
  107. { label: '修改用户', name: 'UpUserID', width: 200, align: "left" },
  108. { label: '当前数量', name: 'FinallyNum', width: 200, align: "left" },
  109. { label: '备注', name: 'Remark', width: 200, align: "left" },
  110. ],
  111. mainId: 'ID',
  112. isPage: true,
  113. sidx: 'CreateTime desc'
  114. });
  115. page.search();
  116. },
  117. search: function (param) {
  118. param = param || {};
  119. param.SqlParameter = ' and IsSubmit =1 ';
  120. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  121. }
  122. };
  123. refreshGirdData = function () {
  124. $('#gridtable').jfGridSet('reload');
  125. };
  126. page.init();
  127. }