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.

Index.js 7.6 KiB

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