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.

FormDelete.js 7.2 KiB

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