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.
 
 
 
 
 
 

120 lines
5.1 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-11-18 15:56
  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. $('#lr_refresh').on('click', function () {
  18. location.reload();
  19. });
  20. // 新增
  21. $('#lr_add').on('click', function () {
  22. learun.layerForm({
  23. id: 'form',
  24. title: '新增',
  25. url: top.$.rootUrl + '/EducationalAdministration/TMOrder/Form',
  26. width: 600,
  27. height: 400,
  28. callBack: function (id) {
  29. return top[id].acceptClick(refreshGirdData);
  30. }
  31. });
  32. });
  33. // 编辑
  34. $('#lr_edit').on('click', function () {
  35. var keyValue = $('#gridtable').jfGridValue('TMOID');
  36. if (learun.checkrow(keyValue)) {
  37. learun.layerForm({
  38. id: 'form',
  39. title: '编辑',
  40. url: top.$.rootUrl + '/EducationalAdministration/TMOrder/Form?keyValue=' + keyValue,
  41. width: 600,
  42. height: 400,
  43. callBack: function (id) {
  44. return top[id].acceptClick(refreshGirdData);
  45. }
  46. });
  47. }
  48. });
  49. // 删除
  50. $('#lr_delete').on('click', function () {
  51. var keyValue = $('#gridtable').jfGridValue('TMOID');
  52. if (learun.checkrow(keyValue)) {
  53. learun.layerConfirm('是否确认删除该项!', function (res) {
  54. if (res) {
  55. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TMOrder/DeleteForm', { keyValue: keyValue}, function () {
  56. refreshGirdData();
  57. });
  58. }
  59. });
  60. }
  61. });
  62. // 打印
  63. $('#lr_print').on('click', function () {
  64. $('#gridtable').jqprintTable();
  65. });
  66. },
  67. // 初始化列表
  68. initGird: function () {
  69. $('#gridtable').lrAuthorizeJfGrid({
  70. url: top.$.rootUrl + '/EducationalAdministration/TMOrder/GetPageList',
  71. headData: [
  72. { label: "学年", name: "TMYear", width: 100, align: "left" },
  73. {
  74. label: "专业", name: "TMMajor", width: 100, align: "left",
  75. formatterAsync: function (callback, value, row, op, $cell) {
  76. learun.clientdata.getAsync('custmerData', {
  77. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  78. key: value,
  79. keyId: 'majorno',
  80. callback: function (_data) {
  81. callback(_data['majorname']);
  82. }
  83. });
  84. } },
  85. {
  86. label: "课程", name: "TMLesson", width: 100, align: "left",
  87. formatterAsync: function (callback, value, row, op, $cell) {
  88. learun.clientdata.getAsync('custmerData', {
  89. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo',
  90. key: value,
  91. keyId: 'lessonno',
  92. callback: function (_data) {
  93. callback(_data['lessonname']);
  94. }
  95. });
  96. } },
  97. { label: "书名", name: "TMBookName", width: 100, align: "left" },
  98. { label: "出版社", name: "TMPress", width: 100, align: "left" },
  99. { label: "主编", name: "TMChiefEditor", width: 100, align: "left" },
  100. { label: "书号", name: "TMBookNumber", width: 100, align: "left" },
  101. { label: "单价", name: "TMPrice", width: 100, align: "left" },
  102. { label: "数量", name: "TMNumber", width: 100, align: "left" },
  103. { label: "总价格", name: "TMOPrice", width: 100, align: "left" },
  104. ],
  105. mainId:'TMOID',
  106. isPage: true
  107. });
  108. page.search();
  109. },
  110. search: function (param) {
  111. param = param || {};
  112. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  113. }
  114. };
  115. refreshGirdData = function () {
  116. page.search();
  117. };
  118. page.init();
  119. }