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.
 
 
 
 
 
 

147 lines
6.8 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 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. // 查询
  17. $('#btn_Search').on('click', function () {
  18. var keyword = $('#txt_Keyword').val();
  19. page.search({ keyword: keyword });
  20. });
  21. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  22. // 刷新
  23. $('#lr_refresh').on('click', function () {
  24. location.reload();
  25. });
  26. // 新增
  27. $('#lr_add').on('click', function () {
  28. learun.layerForm({
  29. id: 'form',
  30. title: '新增',
  31. url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/Form',
  32. width: 700,
  33. height: 500,
  34. callBack: function (id) {
  35. return top[id].acceptClick(refreshGirdData);
  36. }
  37. });
  38. });
  39. // 编辑
  40. $('#lr_edit').on('click', function () {
  41. var keyValue = $('#gridtable').jfGridValue('ID');
  42. if (learun.checkrow(keyValue)) {
  43. var IsSubmit = $('#gridtable').jfGridValue('IsSubmit');
  44. if (IsSubmit == 1) {
  45. learun.alert.warning("当前项目已提交,不可编辑!");
  46. return;
  47. }
  48. learun.layerForm({
  49. id: 'form',
  50. title: '编辑',
  51. url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/Form?keyValue=' + keyValue,
  52. width: 700,
  53. height: 500,
  54. callBack: function (id) {
  55. return top[id].acceptClick(refreshGirdData);
  56. }
  57. });
  58. }
  59. });
  60. // 删除
  61. $('#lr_delete').on('click', function () {
  62. var keyValue = $('#gridtable').jfGridValue('ID');
  63. if (learun.checkrow(keyValue)) {
  64. var IsSubmit = $('#gridtable').jfGridValue('IsSubmit');
  65. if (IsSubmit == 1) {
  66. learun.alert.warning("当前项目已提交,不可删除!");
  67. return;
  68. }
  69. learun.layerConfirm('是否确认删除该项!', function (res) {
  70. if (res) {
  71. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/DeleteForm', { keyValue: keyValue }, function () {
  72. });
  73. }
  74. });
  75. }
  76. });
  77. $('#lr_submit').on('click', function () {
  78. var keyValue = $('#gridtable').jfGridValue('ID');
  79. if (learun.checkrow(keyValue)) {
  80. var IsSubmit = $('#gridtable').jfGridValue('IsSubmit');
  81. if (IsSubmit == 1) {
  82. learun.alert.warning("当前项目已提交,请勿重复提交!");
  83. return;
  84. }
  85. learun.layerConfirm('是否确认提交该项!', function (res) {
  86. if (res) {
  87. learun.postForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/SubmitForm', { keyValue: keyValue }, function (res) {
  88. refreshGirdData(res, {});
  89. });
  90. }
  91. });
  92. }
  93. });
  94. },
  95. initGird: function () {
  96. $('#gridtable').lrAuthorizeJfGrid({
  97. url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList',
  98. headData: [
  99. { label: '库存单号', name: 'BookCode', width: 200, align: "left" },
  100. {
  101. label: "课程", name: "LessonNo", width: 150, align: "left",
  102. formatterAsync: function (callback, value, row, op, $cell) {
  103. learun.clientdata.getAsync('custmerData', {
  104. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  105. key: value,
  106. keyId: 'lessonno',
  107. callback: function (_data) {
  108. callback(_data['lessonname']);
  109. }
  110. });
  111. }
  112. },
  113. { label: '教材名称', name: 'TextBookName', width: 200, align: "left" },
  114. { label: '教材号', name: 'TextBookNo', width: 200, align: "left" },
  115. { label: '出版号', name: 'PublishNo', width: 200, align: "left" },
  116. { label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" },
  117. { label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" },
  118. //{ label: '出版日期', name: 'Pubdate', width: 200, align: "left" },
  119. { label: '出版社', name: 'Publisher', width: 200, align: "left" },
  120. { label: '版次', name: 'Edition', width: 200, align: "left" },
  121. { label: '印次', name: 'Impression', width: 200, align: "left" },
  122. { label: '创建人', name: 'CreateTime', width: 200, align: "left" },
  123. { label: '创建用户', name: 'CrateUserID', width: 200, align: "left" },
  124. { label: '修改人', name: 'UpTime', width: 200, align: "left" },
  125. { label: '修改用户', name: 'UpUserID', width: 200, align: "left" },
  126. { label: '当前数量', name: 'FinallyNum', width: 200, align: "left" },
  127. { label: '备注', name: 'Remark', width: 200, align: "left" },
  128. ],
  129. mainId: 'ID',
  130. isPage: true,
  131. sidx: 'CreateTime desc'
  132. });
  133. page.search();
  134. },
  135. search: function (param) {
  136. param = param || {};
  137. param.SqlParameter = 'and IsDel = 0 ';
  138. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  139. }
  140. };
  141. refreshGirdData = function () {
  142. $('#gridtable').jfGridSet('reload');
  143. };
  144. page.init();
  145. }