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.
 
 
 
 
 
 

174 lines
6.8 KiB

  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2.  * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3.  * 创建人:超级管理员
  4.  * 日  期:2021-06-15 17:30
  5.  * 描  述:新生报名
  6.  */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var MajorNo;
  10. var bootstrap = function ($, learun) {
  11. "use strict";
  12. var page = {
  13. init: function () {
  14. $('.lr-form-wrap').lrscroll();
  15. page.bind();
  16. page.initData();
  17. },
  18. bind: function () {
  19. $('#IdCardPto1').lrUploader();
  20. $('#IdCardPto2').lrUploader();
  21. $('#MidDiplomaPto').lrUploader();
  22. $('#MidAchievementPto').lrUploader();
  23. $('#Gender').lrDataItemSelect({ code: 'usersexbit' });
  24. $('#Nationals').lrDataItemSelect({ code: 'National' });
  25. $('#SubjectNo').lrselect({
  26. type: 'multiple',
  27. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ExamSubject',
  28. value: 'subjectno',
  29. text: 'subjectname',
  30. maxHeight: 200
  31. });
  32. //地市
  33. $('#City').lrselect({
  34. allowSearch: true,
  35. //type: 'multiple',
  36. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY',
  37. param: { strWhere: "1=1 and cparent='650000'" },
  38. value: "ccode",
  39. text: "cname",
  40. maxHeight: 200,
  41. //select: function (item) {
  42. // if (item) {
  43. // var code = $("#City").lrselectGet();
  44. // //县区
  45. // $('#County').lrselectRefresh({
  46. // allowSearch: true,
  47. // //type: 'multiple',
  48. // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA',
  49. // param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " },
  50. // value: "acode",
  51. // text: "aname",
  52. // maxHeight: 200,
  53. // });
  54. // }
  55. //}
  56. });
  57. //县区
  58. $('#County').lrselect({
  59. allowSearch: true,
  60. //type: 'multiple',
  61. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA',
  62. param: { strWhere: "1=1 " },
  63. value: "acode",
  64. text: "aname",
  65. maxHeight: 200,
  66. //select: function (item) {
  67. // if (item) {
  68. // var countyCode = $("#County").lrselectGet();
  69. // //专业
  70. // $('#MajorNo').lrselectRefresh({
  71. // url: top.$.rootUrl +
  72. // '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  73. // param: {
  74. // //strWhere: "1=1 and Area='" + countyCode + "'"
  75. // strWhere: "1=1"
  76. // },
  77. // value: "id",
  78. // text: "majorname",
  79. // maxHeight: 200,
  80. // });
  81. // if (MajorNo) {
  82. // $('#MajorNo').lrselectSet(MajorNo);
  83. // MajorNo = '';
  84. // }
  85. // }
  86. //}
  87. });
  88. //专业
  89. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' });
  90. $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
  91. //计算中考总分
  92. $('#scoreDiv').on('change',
  93. '.SEMidExamScore',
  94. function () {
  95. var scoreSum = 0;
  96. $.each($("#scoreDiv .SEMidExamScore"),
  97. function (i, item) {
  98. if (!!item.value) {
  99. scoreSum += parseFloat(item.value);
  100. }
  101. });
  102. if (scoreSum > 0) {
  103. $('#MidTermExam').val(scoreSum.toFixed(2));
  104. }
  105. });
  106. },
  107. initData: function () {
  108. if (!!keyValue) {
  109. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetFormData?keyValue=' + keyValue, function (data) {
  110. for (var id in data) {
  111. if (!!data[id].length && data[id].length > 0) {
  112. $('#' + id).jfGridSet('refreshdata', data[id]);
  113. }
  114. else {
  115. $('#form').lrSetFormData(data[id]);
  116. }
  117. }
  118. MajorNo = data.StuEnroll.MajorNo;
  119. var str = '';
  120. if (!!data.StuEnrollMidExamScore) {
  121. $.each(data.StuEnrollMidExamScore,
  122. function (i, item) {
  123. var score = item.score > 0 ? item.score : '';
  124. str += '<div class="col-xs-6 lr-form-item" data-table="StuEnrollMidExamScore">';
  125. str += '<div class="lr-form-item-title">' + item.subjectName + '</div>';
  126. str += '<input id="' + item.Id + '" type="text" class="form-control SEMidExamScore" value="' + score + '" />';
  127. str += '</div>';
  128. });
  129. $('#scoreDiv').html(str);
  130. }
  131. });
  132. }
  133. }
  134. };
  135. // 保存数据
  136. acceptClick = function (callBack) {
  137. if (!$('body').lrValidform()) {
  138. return false;
  139. }
  140. var scoreList = [];
  141. $.each($("#scoreDiv .SEMidExamScore"),
  142. function (i, item) {
  143. var entity = {
  144. Id: item.id,
  145. score: item.value
  146. };
  147. scoreList.push(entity);
  148. });
  149. var entity = $('body').lrGetFormData();
  150. //entity.MajorName = $('#MajorNo').lrselectGetText();
  151. var postData = {
  152. strEntity: JSON.stringify(entity),
  153. scoreList: JSON.stringify(scoreList)
  154. };
  155. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollPhone/SaveForm?keyValue=' + keyValue, postData, function (res) {
  156. // 保存成功后才回调
  157. if (!!callBack) {
  158. callBack();
  159. }
  160. });
  161. };
  162. page.init();
  163. }