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.
 
 
 
 
 
 

189 lines
8.9 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-03-01 17:26
  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. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 250, 400);
  19. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  20. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' });
  21. $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  22. $('#ClassNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
  23. $('#AcademicYearNo').lrselect({
  24. placeholder: "请选择学年",
  25. allowSearch: true,
  26. url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear',
  27. value: 'value',
  28. text: 'text'
  29. });
  30. //学期
  31. $('#Semester').lrselect({
  32. placeholder: "请选择学年",
  33. allowSearch: true,
  34. url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester',
  35. value: 'value',
  36. text: 'text'
  37. });
  38. // 刷新
  39. $('#lr_refresh').on('click', function () {
  40. location.reload();
  41. });
  42. // 编辑
  43. $('#lr_edit').on('click', function () {
  44. var keyValue = $('#gridtable').jfGridValue('ID');
  45. if (learun.checkrow(keyValue)) {
  46. learun.layerForm({
  47. id: 'form',
  48. title: '编辑',
  49. url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/Form?keyValue=' + keyValue,
  50. width: 1000,
  51. height: 700,
  52. callBack: function (id) {
  53. return top[id].acceptClick(refreshGirdData);
  54. }
  55. });
  56. }
  57. });
  58. // 删除
  59. $('#lr_delete').on('click', function () {
  60. var keyValue = $('#gridtable').jfGridValue('ID');
  61. if (learun.checkrow(keyValue)) {
  62. learun.layerConfirm('是否确认删除该项!', function (res) {
  63. if (res) {
  64. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/DeleteForm', { keyValue: keyValue}, function () {
  65. refreshGirdData();
  66. });
  67. }
  68. });
  69. }
  70. });
  71. // 查看
  72. $('#lr_view').on('click', function () {
  73. var keyValue = $('#gridtable').jfGridValue('ID');
  74. if (learun.checkrow(keyValue)) {
  75. learun.layerForm({
  76. id: 'formview',
  77. title: '查看',
  78. url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/Form?keyValue=' + keyValue,
  79. width: 1000,
  80. height: 700,
  81. btn: null,
  82. });
  83. }
  84. });
  85. // 打印
  86. $('#lr_print').on('click', function () {
  87. $('#gridtable').jqprintTable();
  88. });
  89. },
  90. // 初始化列表
  91. initGird: function () {
  92. $('#gridtable').jfGrid({
  93. url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/GetPageList',
  94. headData: [
  95. //{ label: "主键", name: "ID", width: 200, align: "left" },
  96. {
  97. label: "专业部", name: "DeptNo", width: 100, align: "left",
  98. formatterAsync: function (callback, value, row, op, $cell) {
  99. learun.clientdata.getAsync('custmerData', {
  100. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  101. key: value,
  102. keyId: 'deptno',
  103. callback: function (_data) {
  104. callback(_data['deptname']);
  105. }
  106. });
  107. }
  108. },
  109. {
  110. label: "专业", name: "MajorNo", width: 120, align: "left",
  111. formatterAsync: function (callback, value, row, op, $cell) {
  112. learun.clientdata.getAsync('custmerData', {
  113. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  114. key: value,
  115. keyId: 'majorname',
  116. callback: function (_data) {
  117. callback(_data['majorname']);
  118. }
  119. });
  120. }
  121. },
  122. {
  123. label: "课程", name: "LessonNo", width: 150, align: "left",
  124. formatterAsync: function (callback, value, row, op, $cell) {
  125. learun.clientdata.getAsync('custmerData', {
  126. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  127. key: value,
  128. keyId: 'lessonno',
  129. callback: function (_data) {
  130. callback(_data['lessonname']);
  131. }
  132. });
  133. }
  134. },
  135. { label: "学年", name: "AcademicYearNo", width: 100, align: "left" },
  136. { label: "学期", name: "Semester", width: 100, align: "left" },
  137. { label: "教材名称", name: "TextBookName", width: 200, align: "left" },
  138. { label: "书号(物料号)", name: "PublishNo", width: 150, align: "left" },
  139. { label: "作者", name: "FirstAuthor", width: 100, align: "left" },
  140. { label: "其他作者", name: "OtherAuthor", width: 150, align: "left" },
  141. { label: "出版社", name: "Publisher", width: 100, align: "left" },
  142. { label: "版次", name: "Edition", width: 100, align: "left" },
  143. { label: "单价", name: "Price", width: 100, align: "left" },
  144. { label: "订购数量", name: "OrderNum", width: 100, align: "left" },
  145. { label: "备注", name: "Remark", width: 200, align: "left" },
  146. //{
  147. // label: "状态", name: "Status", width: 100, align: "left",
  148. // formatter: function (cellvalue) {
  149. // if (cellvalue == '0') {
  150. // return '<span class=\"label label-success\">草稿</span>';
  151. // } else if (cellvalue == '1') {
  152. // return '<span class=\"label label-danger\">审批中</span>';
  153. // } else if (cellvalue == '2') {
  154. // return '<span class=\"label label-info\">审批通过</span>';
  155. // }
  156. // }
  157. //},
  158. { label: "录入时间", name: "CreateTime", width: 100, align: "left" },
  159. {
  160. label: "创建用户", name: "CreateUserID", width: 100, align: "left",
  161. formatterAsync: function (callback, value, row, op, $cell) {
  162. learun.clientdata.getAsync('user', {
  163. key: value,
  164. callback: function (_data) {
  165. callback(_data.name);
  166. }
  167. });
  168. }
  169. },
  170. ],
  171. mainId: 'ID',
  172. sidx: 'CreateTime desc,Status desc',
  173. isPage: true
  174. });
  175. page.search();
  176. },
  177. search: function (param) {
  178. param = param || {};
  179. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  180. }
  181. };
  182. refreshGirdData = function () {
  183. $('#gridtable').jfGridSet('reload');
  184. };
  185. page.init();
  186. }