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.
 
 
 
 
 
 

143 lines
5.8 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2023-03-13 10:37
  5. * 描 述:定制功能助学金
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var Step = request('Step');//第几步
  10. var Types = request('Types');//助学金类型:1国家助学金,2校级助学金
  11. if (Types != null && Types != undefined && Types != "") {
  12. $('#Types').val(Types);
  13. }
  14. var bootstrap = function ($, learun) {
  15. "use strict";
  16. var page = {
  17. init: function () {
  18. $('.lr-form-wrap').lrscroll();
  19. page.hide();
  20. page.bind();
  21. page.initData();
  22. },
  23. hide: function () {
  24. if (Step == "2") {//第二步:二级学院审核,时附件显示且必填;
  25. $('#FilesDiv').show();
  26. $('#Files').attr('isvalid', 'yes');
  27. $('#Files').attr('checkexpession', 'NotNull');
  28. $('#Files').prev().html('附件<font face="宋体">*</font>');
  29. } else {
  30. $('#Files').removeAttr('isvalid');
  31. $('#Files').removeAttr('checkexpession');
  32. $('#Files').prev().html('附件');
  33. $('#FilesDiv').hide();
  34. }
  35. },
  36. bind: function () {
  37. $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
  38. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
  39. $('#IdCardType').lrDataItemSelect({ code: 'IdCardType' });
  40. $('#IdCardType').lrselectSet("01");
  41. $('#OpenBank').lrDataItemSelect({ code: 'DepositBank' });
  42. //根据登录用户自动带出内容:姓名 院系 班级 身份证件号 开户银行 开户卡账号
  43. var timer = setTimeout(function () {
  44. $("#StuNo").val(StuNo);
  45. $("#StuName").val(StuName);
  46. $("#DeptNo").lrselectSet(DeptNo);
  47. $("#ClassNo").lrselectSet(ClassNo);
  48. $("#IdentityCardNo").val(IdentityCardNo);
  49. $("#OpenBank").lrselectSet(OpenBank);
  50. $("#OpenAccount").val(OpenAccount);
  51. clearTimeout(timer);
  52. }, 10);
  53. //判断助学金类型:1国家助学金,2校级助学金
  54. if (Types == "1") {
  55. $('#SubsidizeType').lrDataItemSelect({
  56. code: 'StateStipend',
  57. select: function (item) {
  58. //系统自动带出标准、应发金额和实发金额
  59. if (item != null && item != undefined) {
  60. $("#FunderNationStandard").val(item.id);
  61. $("#FinalPayingAmount").val(item.id);
  62. $("#AmountPayable").val(item.id);
  63. }
  64. }
  65. });
  66. } else if (Types == "2") {
  67. $('#SubsidizeType').lrDataItemSelect({
  68. code: 'SchoolStipend',
  69. select: function (item) {
  70. //系统自动带出标准、应发金额和实发金额
  71. if (item != null && item != undefined) {
  72. $("#FunderNationStandard").val(item.id);
  73. $("#FinalPayingAmount").val(item.id);
  74. $("#AmountPayable").val(item.id);
  75. }
  76. }
  77. });
  78. }
  79. //申请时间:默认当天
  80. $('#ApplyDate').val(getNowDate());
  81. $('#Files').lrUploader();
  82. },
  83. initData: function () {
  84. if (!!keyValue) {
  85. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuFellowship/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. if (data[id].IdCardType == null || data[id].IdCardType == "" || data[id].IdCardType == undefined) {
  95. $('#IdCardType').lrselectSet("01");
  96. }
  97. }
  98. });
  99. }
  100. }
  101. };
  102. // 保存数据
  103. acceptClick = function (callBack) {
  104. if (!$('#form').lrValidform()) {
  105. return false;
  106. }
  107. var postData = $('#form').lrGetFormData();
  108. var postDatas = {
  109. strEntity: JSON.stringify(postData)
  110. };
  111. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuFellowship/SaveForm?keyValue=' + keyValue, postDatas, function (res) {
  112. // 保存成功后才回调
  113. if (!!callBack) {
  114. callBack();
  115. }
  116. });
  117. };
  118. page.init();
  119. }
  120. //获取当前时间
  121. function getNowDate() {
  122. var myDate = new Date;
  123. var year = myDate.getFullYear(); //获取当前年
  124. var mon = myDate.getMonth() + 1; //获取当前月
  125. var date = myDate.getDate(); //获取当前日
  126. var h = myDate.getHours();//获取当前小时数(0-23)
  127. var m = myDate.getMinutes();//获取当前分钟数(0-59)
  128. var s = myDate.getSeconds();//获取当前秒
  129. var week = myDate.getDay();
  130. var weeks = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
  131. //console.log(year, mon, date, weeks[week])
  132. var result = year + "-" + mon + "-" + date;
  133. return result;
  134. }