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.
 
 
 
 
 
 

164 lines
7.6 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 startTime;
  11. var endTime;
  12. var page = {
  13. init: function () {
  14. page.initGird();
  15. page.bind();
  16. },
  17. bind: function () {
  18. // 时间搜索框
  19. $('#datesearch').lrdate({
  20. dfdata: [
  21. { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  22. { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  23. { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
  24. { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
  25. ],
  26. // 月
  27. mShow: false,
  28. premShow: false,
  29. // 季度
  30. jShow: false,
  31. prejShow: false,
  32. // 年
  33. ysShow: false,
  34. yxShow: false,
  35. preyShow: false,
  36. yShow: false,
  37. // 默认
  38. dfvalue: '1',
  39. selectfn: function (begin, end) {
  40. startTime = begin;
  41. endTime = end;
  42. page.search();
  43. }
  44. });
  45. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  46. page.search(queryJson);
  47. }, 100, 400);
  48. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo',value: 'deptno',text: 'deptname' });
  49. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo',value: 'majorno',text: 'majorname' });
  50. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj',value: 'classno',text: 'classname' });
  51. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo',value: 'lessonno',text: 'lessonname' });
  52. // 刷新
  53. $('#lr_refresh').on('click', function () {
  54. location.reload();
  55. });
  56. // 出库
  57. $('#lr_edit').on('click', function () {
  58. var keyValue = $('#gridtable').jfGridValue('ID');
  59. if (learun.checkrow(keyValue)) {
  60. learun.layerForm({
  61. id: 'form',
  62. title: '出库',
  63. url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/Form?keyValue=' + keyValue,
  64. width: 1000,
  65. height: 800,
  66. callBack: function (id) {
  67. var res = false;
  68. // 验证数据
  69. res = top[id].validForm();
  70. // 保存数据
  71. if (res) {
  72. res = top[id].save('', function () {
  73. page.search();
  74. });
  75. }
  76. return res;
  77. }
  78. });
  79. }
  80. });
  81. // 查看
  82. $('#lr_view').on('click', function () {
  83. var keyValue = $('#gridtable').jfGridValue('ID');
  84. if (learun.checkrow(keyValue)) {
  85. learun.layerForm({
  86. id: 'formview',
  87. title: '查看',
  88. url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormView?keyValue=' + keyValue,
  89. width: 1000,
  90. height: 700,
  91. btn: null,
  92. });
  93. }
  94. });
  95. // 删除
  96. $('#lr_delete').on('click', function () {
  97. var keyValue = $('#gridtable').jfGridValue('ID');
  98. if (learun.checkrow(keyValue)) {
  99. learun.layerForm({
  100. id: 'formdelete',
  101. title: '删除明细',
  102. url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormDelete?keyValue=' + keyValue,
  103. width: 1000,
  104. height: 700,
  105. btn: null,
  106. });
  107. }
  108. });
  109. },
  110. // 初始化列表
  111. initGird: function () {
  112. $('#gridtable').lrAuthorizeJfGrid({
  113. url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList',
  114. headData: [
  115. { label: '库存单号', name: 'BookCode', width: 200, align: "left" },
  116. {
  117. label: "课程", name: "LessonNo", width: 150, align: "left",
  118. formatterAsync: function (callback, value, row, op, $cell) {
  119. learun.clientdata.getAsync('custmerData', {
  120. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  121. key: value,
  122. keyId: 'lessonno',
  123. callback: function (_data) {
  124. callback(_data['lessonname']);
  125. }
  126. });
  127. }
  128. },
  129. { label: '教材名称', name: 'TextBookName', width: 200, align: "left" },
  130. { label: '教材号', name: 'TextBookNo', width: 200, align: "left" },
  131. { label: '出版号', name: 'PublishNo', width: 200, align: "left" },
  132. { label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" },
  133. { label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" },
  134. { label: '出版社', name: 'Publisher', width: 200, align: "left" },
  135. { label: '版次', name: 'Edition', width: 200, align: "left" },
  136. { label: '印次', name: 'Impression', width: 200, align: "left" },
  137. { label: '创建人', name: 'CreateTime', width: 200, align: "left" },
  138. { label: '创建用户', name: 'CrateUserID', width: 200, align: "left" },
  139. { label: '修改人', name: 'UpTime', width: 200, align: "left" },
  140. { label: '修改用户', name: 'UpUserID', width: 200, align: "left" },
  141. { label: '当前数量', name: 'FinallyNum', width: 200, align: "left" },
  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.StartTime = startTime;
  153. param.EndTime = endTime;
  154. param.SqlParameter = ' and IsSubmit =1 ';
  155. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  156. }
  157. };
  158. refreshGirdData = function () {
  159. $('#gridtable').jfGridSet('reload');
  160. };
  161. page.init();
  162. }