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.
 
 
 
 
 
 

163 lines
7.1 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 acceptClick;
  8. var keyValue = request('keyValue');
  9. // 设置权限
  10. var setAuthorize;
  11. // 设置表单数据
  12. var setFormData;
  13. // 验证数据是否填写完整
  14. var selectedRow;
  15. var refreshGirdData;
  16. var tempdatra = new Array();
  17. var bootstrap = function ($, learun) {
  18. "use strict";
  19. // 设置权限
  20. setAuthorize = function (data) {
  21. };
  22. var page = {
  23. init: function () {
  24. //$('.lr-form-wrap').lrscroll();
  25. page.bind();
  26. page.initData();
  27. },
  28. bind: function () {
  29. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  30. $('#TextBookOut').jfGrid({
  31. headData: [
  32. { label: '出库单', name: 'BookCode', width: 180, align: 'left' },
  33. {
  34. label: "专业部", name: "DeptNo", width: 100, align: "left",
  35. formatterAsync: function (callback, value, row, op, $cell) {
  36. learun.clientdata.getAsync('custmerData', {
  37. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  38. key: value,
  39. keyId: 'deptno',
  40. callback: function (_data) {
  41. callback(_data['deptname']);
  42. }
  43. });
  44. }
  45. },
  46. {
  47. label: "专业", name: "MajorNo", width: 120, align: "left",
  48. formatterAsync: function (callback, value, row, op, $cell) {
  49. learun.clientdata.getAsync('custmerData', {
  50. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  51. key: value,
  52. keyId: 'majorno',
  53. callback: function (_data) {
  54. callback(_data['majorname']);
  55. }
  56. });
  57. }
  58. },
  59. {
  60. label: "课程", name: "LessonNo", width: 150, align: "left",
  61. formatterAsync: function (callback, value, row, op, $cell) {
  62. learun.clientdata.getAsync('custmerData', {
  63. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  64. key: value,
  65. keyId: 'lessonno',
  66. callback: function (_data) {
  67. callback(_data['lessonname']);
  68. }
  69. });
  70. }
  71. },
  72. {
  73. label: "班级", name: "ClassNo", width: 100, align: "left",
  74. formatterAsync: function (callback, value, row, op, $cell) {
  75. learun.clientdata.getAsync('custmerData', {
  76. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  77. key: value,
  78. keyId: 'classno',
  79. callback: function (_data) {
  80. callback(_data['classname']);
  81. }
  82. });
  83. }
  84. },
  85. { label: '学年', name: 'AcademicYearNo', width: 80, align: 'left' },
  86. { label: '学期', name: 'Semester', width: 80, align: 'left' },
  87. { label: '领用人', name: 'Recipient', width: 100, align: 'left' },
  88. { label: '出库数量', name: 'Variate', width: 100, align: 'left' },
  89. { label: '出库时间', name: 'CreateTime', width: 200, align: 'left' },
  90. { label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' },
  91. { label: '备注', name: 'Remark', width: 100, align: 'left' },
  92. ],
  93. height: 400,
  94. mainId: 'CreateTime desc',
  95. reloadSelected: false,
  96. });
  97. $("#detaildel").on('click', function () {
  98. var NewkeyValue = $('#TextBookOut').jfGridValue('ID');
  99. if (learun.checkrow(NewkeyValue)) {
  100. learun.layerConfirm('是否确认删除该项!', function (res, index) {
  101. if (res) {
  102. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/DeleteForm', { keyValue: NewkeyValue }, function () {
  103. var index = top.layer.getFrameIndex(window.name);
  104. console.log('index', index);
  105. top.layer.close(index);
  106. });
  107. }
  108. });
  109. }
  110. });
  111. },
  112. initData: function () {
  113. if (!!keyValue) {
  114. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?keyValue=' + keyValue, function (data) {
  115. for (var id in data) {
  116. if (!!data[id].length && data[id].length > 0) {
  117. $('#' + id).jfGridSet('refreshdata', data[id]);
  118. }
  119. else {
  120. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  121. }
  122. }
  123. });
  124. }
  125. }
  126. };
  127. refreshGirdData = function (temprow) {
  128. var ifnewrow = true;
  129. $.each(tempdatra, function (key, val) {
  130. if (tempdatra[key].BookCode === temprow.InOutBook) {
  131. tempdatra[key] = temprow;
  132. ifnewrow = false;
  133. }
  134. });
  135. if (ifnewrow) {
  136. tempdatra.push(temprow);
  137. }
  138. $('#TextBookOut').jfGridSet('refreshdata', tempdatra);
  139. };
  140. // 设置表单数据
  141. setFormData = function (processId, param, callback) {
  142. if (!!processId) {
  143. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormDataByProcessId?processId=' + processId, function (data) {
  144. for (var id in data) {
  145. if (!!data[id] && data[id].length > 0) {
  146. $('#' + id).jfGridSet('refreshdata', data[id]);
  147. }
  148. else {
  149. if (id == 'TextBookOut' && data[id]) {
  150. keyValue = data[id].ID;
  151. }
  152. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  153. }
  154. }
  155. });
  156. }
  157. callback && callback();
  158. }
  159. page.init();
  160. }