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.
 
 
 
 
 
 

165 lines
6.4 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-02-21 16:53
  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. $('#F_ProvinceId').lrDataSourceSelect({
  19. code: 'DIC_PROVINCE', value: 'pcode', text: 'pname',
  20. select: function (item) {
  21. if (item) {
  22. $('#F_CityId').lrselectRefresh({
  23. url: top.$.rootUrl +"/DIC_CITY/GetListByProvinceCode",
  24. param: { ProvinceCode: item.pcode },
  25. value: 'CCODE',
  26. text: 'CNAME'
  27. });
  28. } else {
  29. $('#F_CityId').lrselectRefresh({
  30. url: "",
  31. data:[]
  32. });
  33. }
  34. $('#F_CountyId').lrselectRefresh({
  35. url: "",
  36. data: []
  37. });
  38. }
  39. });
  40. $('#F_CityId').lrselect({
  41. value: 'ccode', text: 'cname',
  42. select: function (item) {
  43. if (item) {
  44. $('#F_CountyId').lrselectRefresh({
  45. url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode",
  46. param: { cityCode: item.CCODE },
  47. value: 'ACODE',
  48. text: 'ANAME'
  49. });
  50. }
  51. }
  52. });
  53. $('#F_CountyId').lrselect({
  54. value: 'ACODE', text: 'ANAME'
  55. });
  56. $('#ClassNo').lrselect({
  57. value: "classid",
  58. text: "classname"
  59. });
  60. $('#Grade').lrselect({
  61. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  62. value: 'value',
  63. text: 'text'
  64. });
  65. $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
  66. $('#NationalityNo').lrDataItemSelect({ code: 'National' });
  67. $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
  68. $('#PartyFaceNo').lrDataItemSelect({ code: 'BCdPartyFace' });
  69. $('#HealthStatusNo').lrDataItemSelect({ code: 'BCdHealthStatus' });
  70. $('#Photo').lrUploader();
  71. $('#FamilyOriginNo').lrDataItemSelect({ code: 'BCdFamilyOrigin' });
  72. $('#OverseasChineseNo').lrDataItemSelect({ code: 'BCdOverseasChinese' });
  73. $('#GraduateNo').lrDataItemSelect({ code: 'CollegeType' });
  74. $('#DeptNo').lrselect({
  75. value: "deptno",
  76. text: "deptname",
  77. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  78. select: function (item) {
  79. if (item) {
  80. $('#MajorNo').lrselectRefresh({
  81. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  82. param: { code: "CdMajorInfo", strWhere: "DeptNo=" + item.deptno }
  83. });
  84. }
  85. else {
  86. $('#MajorNo').lrselectRefresh({
  87. url: "",
  88. data: []
  89. });
  90. }
  91. $('#ClassNo').lrselectRefresh({
  92. url: "",
  93. data: []
  94. });
  95. }
  96. });
  97. $('#MajorNo').lrselect({
  98. value: "majorno",
  99. text: "majorname",
  100. select: function (item) {
  101. if (item) {
  102. $('#ClassNo').lrselectRefresh({
  103. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  104. param: { code: "bjsj", strWhere: "DeptNo=" + item.deptno + " and majorno=" + item.majorno }
  105. });
  106. }
  107. }
  108. });
  109. $('#ClassNo').lrselect({
  110. value: "classid",
  111. text: "classname"
  112. });
  113. $('#MajorNo').on("click",
  114. function () {
  115. var data = $('#DeptNo').lrselectGet();
  116. if (!data) {
  117. learun.alert.error('请先选择系');
  118. }
  119. });
  120. $('#ClassNo').on("click",
  121. function () {
  122. var data1 = $('#DeptNo').lrselectGet();
  123. var data2 = $('#MajorNo').lrselectGet();
  124. if (!data1 || !data2) {
  125. learun.alert.error('请先选择系和专业');
  126. }
  127. });
  128. $("#lrUploader_uploadBtn_Photo").hide();
  129. },
  130. initData: function () {
  131. if (!!keyValue) {
  132. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetFormData?keyValue=' + keyValue, function (data) {
  133. for (var id in data) {
  134. if (!!data[id].length && data[id].length > 0) {
  135. $('#' + id).jfGridSet('refreshdata', data[id]);
  136. }
  137. else {
  138. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  139. }
  140. }
  141. });
  142. }
  143. }
  144. };
  145. // 保存数据
  146. acceptClick = function (callBack) {
  147. if (!$('body').lrValidform()) {
  148. return false;
  149. }
  150. var postData = {
  151. strEntity: JSON.stringify($('body').lrGetFormData())
  152. };
  153. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SaveForm?keyValue=' + keyValue, postData, function (res) {
  154. // 保存成功后才回调
  155. if (!!callBack) {
  156. callBack();
  157. }
  158. });
  159. };
  160. page.init();
  161. }