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.
 
 
 
 
 
 

116 lines
5.2 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-08-31 11:22
  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. }, 220, 400);
  19. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  20. $('#ApplyUserId').lrDataSourceSelect({ code: 'teacheruserdata',value: 'f_userid',text: 'f_realname' });
  21. // 刷新
  22. $('#lr_refresh').on('click', function () {
  23. location.reload();
  24. });
  25. // 新增
  26. $('#lr_add').on('click', function () {
  27. learun.layerForm({
  28. id: 'form',
  29. title: '新增',
  30. url: top.$.rootUrl + '/EducationalAdministration/TE_ConsumerGoodsApply/Form',
  31. width: 600,
  32. height: 400,
  33. callBack: function (id) {
  34. return top[id].acceptClick(refreshGirdData);
  35. }
  36. });
  37. });
  38. // 编辑
  39. $('#lr_edit').on('click', function () {
  40. var keyValue = $('#gridtable').jfGridValue('Id');
  41. if (learun.checkrow(keyValue)) {
  42. learun.layerForm({
  43. id: 'form',
  44. title: '编辑',
  45. url: top.$.rootUrl + '/EducationalAdministration/TE_ConsumerGoodsApply/Form?keyValue=' + keyValue,
  46. width: 600,
  47. height: 400,
  48. callBack: function (id) {
  49. return top[id].acceptClick(refreshGirdData);
  50. }
  51. });
  52. }
  53. });
  54. // 删除
  55. $('#lr_delete').on('click', function () {
  56. var keyValue = $('#gridtable').jfGridValue('Id');
  57. if (learun.checkrow(keyValue)) {
  58. learun.layerConfirm('是否确认删除该项!', function (res) {
  59. if (res) {
  60. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TE_ConsumerGoodsApply/DeleteForm', { keyValue: keyValue}, function () {
  61. refreshGirdData();
  62. });
  63. }
  64. });
  65. }
  66. });
  67. },
  68. // 初始化列表
  69. initGird: function () {
  70. $('#gridtable').lrAuthorizeJfGrid({
  71. url: top.$.rootUrl + '/EducationalAdministration/TE_ConsumerGoodsApply/GetPageList',
  72. headData: [
  73. { label: "专业部", name: "DeptNo", width: 100, align: "left",
  74. formatterAsync: function (callback, value, row, op,$cell) {
  75. learun.clientdata.getAsync('custmerData', {
  76. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  77. key: value,
  78. keyId: 'deptno',
  79. callback: function (_data) {
  80. callback(_data['deptname']);
  81. }
  82. });
  83. }},
  84. { label: "实训室名称", name: "TrainName", width: 100, align: "left"},
  85. { label: "设备名称", name: "EquipmentName", width: 100, align: "left"},
  86. { label: "数量", name: "EquipmentNum", width: 100, align: "left"},
  87. { label: "预算价格", name: "BudgetPrice", width: 100, align: "left"},
  88. { label: "申报人", name: "ApplyUserId", width: 100, align: "left",
  89. formatterAsync: function (callback, value, row, op,$cell) {
  90. learun.clientdata.getAsync('custmerData', {
  91. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata',
  92. key: value,
  93. keyId: 'f_userid',
  94. callback: function (_data) {
  95. callback(_data['f_realname']);
  96. }
  97. });
  98. }},
  99. { label: "申报时间", name: "ApplyTime", width: 100, align: "left"},
  100. ],
  101. mainId:'Id',
  102. isPage: true
  103. });
  104. page.search();
  105. },
  106. search: function (param) {
  107. param = param || {};
  108. $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
  109. }
  110. };
  111. refreshGirdData = function () {
  112. $('#gridtable').jfGridSet('reload');
  113. };
  114. page.init();
  115. }