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
4.9 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2021-09-24 17:38
  5. * 描 述:奖励惩罚管理
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. $('.lr-form-wrap').lrscroll();
  14. page.bind();
  15. page.initData();
  16. },
  17. bind: function () {
  18. $('#NatureType').lrGirdSelect({
  19. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=AwardSource',
  20. selectWord: 'id',
  21. value: 'id',
  22. text: 'awardname',
  23. headData:
  24. [
  25. { label: "奖励类型", name: "awardname", width: 100, align: "left" },
  26. {
  27. label: '奖励属性', name: 'naturetype', width: 100, align: "left",
  28. formatter: function (val) {
  29. if (val == '0') { return '集体'; }
  30. else { return '个人'; }
  31. }
  32. },
  33. {
  34. label: "奖励级别", name: "awardtype", width: 100, align: "left",
  35. formatterAsync: function (callback, value) {
  36. learun.clientdata.getAsync('dataItem', {
  37. key: value, code: 'EncouragementDegree',
  38. callback: function (_data) { callback(_data.text); }
  39. });
  40. },
  41. }
  42. ],
  43. select: function (item) {
  44. $("#NatureType").val(item.awardname);
  45. $("#shuxing").val(item.naturetype);
  46. $("#awardtype").val(item.awardtype);
  47. }
  48. });
  49. $('#RewardObjects').lrGirdSelect({
  50. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=StuInfoBasic',
  51. selectWord: 'stuname',
  52. value: 'stuno',
  53. text: 'stuname',
  54. headData:
  55. [
  56. { label: "学号", name: "stuno", width: 100, align: "left" },
  57. { label: "姓名", name: "stuname", width: 100, align: "left" },
  58. {
  59. label: "班级", name: "classno", width: 100, align: "left",
  60. formatterAsync: function (callback, value, row, op, $cell) {
  61. learun.clientdata.getAsync('custmerData', {
  62. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  63. key: value,
  64. keyId: 'classno',
  65. callback: function (_data) {
  66. callback(_data['classname']);
  67. }
  68. });
  69. }
  70. },
  71. ],
  72. select: function (item) {
  73. $("#StuId").val(item.stuno);
  74. $("#RewardObjects").val(item.stuname);
  75. $("#ClassNo").val(item.classno);
  76. }
  77. });
  78. $('#FileAddress').lrUploader();
  79. $('#Adddate').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss'));
  80. $('#AddUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId;
  81. $('#AddUser').val(learun.clientdata.get(['userinfo']).realName);
  82. },
  83. initData: function () {
  84. if (!!keyValue) {
  85. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/AwardPunishInfo/GetFormData?keyValue=' + keyValue, function (data) {
  86. for (var id in data) {
  87. if (!!data[id].length && data[id].length > 0) {
  88. $('#' + id).jfGridSet('refreshdata', data[id]);
  89. }
  90. else {
  91. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  92. }
  93. }
  94. });
  95. }
  96. $('#IsVaild').val('0');
  97. }
  98. };
  99. // 保存数据
  100. acceptClick = function (callBack) {
  101. if (!$('body').lrValidform()) {
  102. return false;
  103. }
  104. var postData = {
  105. strEntity: JSON.stringify($('body').lrGetFormData())
  106. };
  107. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/AwardPunishInfo/SaveForm?keyValue=' + keyValue, postData, function (res) {
  108. // 保存成功后才回调
  109. if (!!callBack) {
  110. callBack();
  111. }
  112. });
  113. };
  114. page.init();
  115. }