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.
 
 
 
 
 
 

127 line
5.5 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-03-09 15:33
  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. //监听学号
  19. $("#StuNo").on('blur', function () {
  20. var StuNo = $(this).val();
  21. if (StuNo) {
  22. learun.httpAsync('get', top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetStuInfo?Account=' + StuNo, '', function (data) {
  23. if (data) {
  24. $("#StuNo").val(data.StuNo);
  25. $("#StuName").val(data.StuName);
  26. $("#Gender").lrselectSet(data.GenderNo);
  27. $("#Birthday").val(data.Birthday);
  28. $("#DeptNo").lrselectSet(data.DeptNo);
  29. $("#Major").lrselectSet(data.MajorNo);
  30. $("#ClassNo").lrselectSet(data.ClassNo);
  31. } else {
  32. learun.alert.warning("学生不存在!");
  33. }
  34. });
  35. }
  36. });
  37. $('#Gender').lrDataItemSelect({ code: 'usersexbit' });
  38. $('#DeptNo').lrselect({
  39. allowSearch: true,
  40. value: "deptno",
  41. text: "deptname",
  42. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  43. select: function (item) {
  44. if (item) {
  45. $('#MajorNo').lrselectRefresh({
  46. allowSearch: true,
  47. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  48. param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
  49. });
  50. } else {
  51. $('#MajorNo').lrselectRefresh({
  52. allowSearch: true,
  53. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  54. param: { strWhere: "1=1 AND CheckMark=1" }
  55. });
  56. }
  57. }
  58. });
  59. $('#Major').lrselect({
  60. allowSearch: true,
  61. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  62. value: "majorno",
  63. text: "majorname",
  64. param: { strWhere: "1=1 AND CheckMark=1" },
  65. select: function (item) {
  66. if (item) {
  67. $('#ClassNo').lrselectRefresh({
  68. allowSearch: true,
  69. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  70. param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" }
  71. });
  72. } else {
  73. $('#ClassNo').lrselectRefresh({
  74. allowSearch: true,
  75. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  76. param: { strWhere: "1=1 AND CheckMark=1" }
  77. });
  78. }
  79. }
  80. });
  81. $('#ClassNo').lrselect({
  82. allowSearch: true,
  83. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
  84. param: { strWhere: "1=1 AND CheckMark=1" },
  85. value: "classno",
  86. text: "classname"
  87. });
  88. $('#Destination').lrDataSourceSelect({ code: 'DIC_CITY', value: 'ccode', text: 'cname' });
  89. $('#CreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId;
  90. $('#CreateUserId').val(learun.clientdata.get(['userinfo']).realName);
  91. $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss'));
  92. },
  93. initData: function () {
  94. if (!!keyValue) {
  95. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuCardInfo/GetFormData?keyValue=' + keyValue, function (data) {
  96. for (var id in data) {
  97. if (!!data[id].length && data[id].length > 0) {
  98. $('#' + id ).jfGridSet('refreshdata', data[id]);
  99. }
  100. else {
  101. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  102. }
  103. }
  104. });
  105. }
  106. $('#Status').val('0');
  107. }
  108. };
  109. // 保存数据
  110. acceptClick = function (callBack) {
  111. if (!$('body').lrValidform()) {
  112. return false;
  113. }
  114. var postData = {
  115. strEntity: JSON.stringify($('body').lrGetFormData())
  116. };
  117. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuCardInfo/SaveForm?keyValue=' + keyValue, postData, function (res) {
  118. // 保存成功后才回调
  119. if (!!callBack) {
  120. callBack();
  121. }
  122. });
  123. };
  124. page.init();
  125. }