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.
 
 
 
 
 
 

236 lines
9.8 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 isStudent = request('isStudent');
  10. var Crowning = request('Crowning');
  11. var bootstrap = function ($, learun) {
  12. "use strict";
  13. var page = {
  14. init: function () {
  15. $('.lr-form-wrap').lrscroll();
  16. page.bind();
  17. page.initData();
  18. page.hide();
  19. },
  20. hide: function () {
  21. if (isStudent == "1") {
  22. $("#StuName").parent().hide();
  23. $("#IdentityCardNo").parent().hide();
  24. $("#StuNo").parent().hide();
  25. $("#ClassNo").parent().hide();
  26. $("#MajorNo").parent().hide();
  27. $("#EduSystem").parent().hide();
  28. $("#F_SchoolId").parent().hide();
  29. $("#StuCode").parent().hide();
  30. $("#ksh").parent().hide();
  31. $("#NoticeNo").parent().hide();
  32. $("#HealthStatusNo").parent().hide();
  33. $("#ResidenceNo").parent().hide();
  34. $("#F_ProvinceId").parent().parent().hide();
  35. $("#Photo").parent().hide();
  36. $("#DeptNo").parent().hide();
  37. $("#FamilyOriginNo").parent().hide();
  38. $("#OverseasChineseNo").parent().hide();
  39. $("#Grade").parent().hide();
  40. $("#GraduateNo").parent().hide();
  41. $("#EduSystem").parent().hide();
  42. $("#RegisterDate").parent().hide();
  43. $("#StudyModality").parent().hide();
  44. $("#GraduateYear").parent().hide();
  45. $("#EntranceDate").parent().hide();
  46. $("#JoinPartyDate").parent().hide();
  47. $("#JoinLeagueDate").parent().hide();
  48. $("#InSchoolAddress").parent().hide();
  49. $("#InSchoolTelephone").parent().hide();
  50. $("#Remark").parent().hide();
  51. $("#DiplomaRemark").parent().hide();
  52. $("#GoodAt").parent().hide();
  53. $("#InSchoolAddress").parent().hide();
  54. $("#InSchoolTelephone").parent().hide();
  55. $("#JoinLeagueDate").parent().hide();
  56. }
  57. if (Crowning == "0") {
  58. $('#KshId').show();
  59. $('#ksh').attr('isvalid', 'yes');
  60. $('#ksh').attr('checkexpession', 'NotNull');
  61. $('#CodeId').hide();
  62. $('#StuCode').removeAttr('isvalid');
  63. $('#StuCode').removeAttr('NotNull');
  64. } else {
  65. $('#CodeId').show();
  66. $('#StuCode').attr('isvalid', 'yes');
  67. $('#StuCode').attr('checkexpession', 'NotNull');
  68. $('#KshId').hide();
  69. $('#ksh').removeAttr('isvalid');
  70. $('#ksh').removeAttr('NotNull');
  71. }
  72. },
  73. bind: function () {
  74. $('#DepositBank').lrDataItemSelect({ code: 'DepositBank' });
  75. $('#StuPlaceCode').lrDataSourceSelect({ code: 'DIC_PROVINCE', value: 'pcode', text: 'pname' });
  76. $('#IsArchives').lrDataItemSelect({ code: 'YesOrNoInt' });
  77. $('#PieceCultivateWay').lrDataItemSelect({ code: 'EducationLevel' });
  78. $('#F_ProvinceId').lrDataSourceSelect({
  79. code: 'DIC_PROVINCE', value: 'pcode', text: 'pname',
  80. select: function (item) {
  81. if (item) {
  82. $('#F_CityId').lrselectRefresh({
  83. url: top.$.rootUrl + "/DIC_CITY/GetListByProvinceCode",
  84. param: { ProvinceCode: item.pcode },
  85. value: 'CCODE',
  86. text: 'CNAME'
  87. });
  88. } else {
  89. $('#F_CityId').lrselectRefresh({
  90. url: "",
  91. data: []
  92. });
  93. }
  94. $('#F_CountyId').lrselectRefresh({
  95. url: "",
  96. data: []
  97. });
  98. }
  99. });
  100. $('#F_CityId').lrselect({
  101. value: 'ccode', text: 'cname',
  102. select: function (item) {
  103. if (item) {
  104. $('#F_CountyId').lrselectRefresh({
  105. url: top.$.rootUrl + "/DIC_AREA/GetAreasListByCityCode",
  106. param: { cityCode: item.CCODE },
  107. value: 'ACODE',
  108. text: 'ANAME'
  109. });
  110. }
  111. }
  112. });
  113. $('#F_CountyId').lrselect({
  114. value: 'ACODE', text: 'ANAME'
  115. });
  116. $('#ClassNo').lrselect({
  117. value: "classno",
  118. text: "classname"
  119. });
  120. $('#Grade').lrselect({
  121. url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear',
  122. value: 'value',
  123. text: 'text'
  124. });
  125. $('#HealthStatus').lrDataItemSelect({ code: 'QRCodeHealthStatus' });
  126. $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' });
  127. $('#NationalityNo').lrDataItemSelect({ code: 'National' });
  128. $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
  129. $('#PartyFaceNo').lrDataItemSelect({ code: 'BCdPartyFace' });
  130. $('#HealthStatusNo').lrDataItemSelect({ code: 'BCdHealthStatus' });
  131. $('#Photo').lrUploader();
  132. $('#FamilyOriginNo').lrDataItemSelect({ code: 'BCdFamilyOrigin' });
  133. $('#OverseasChineseNo').lrDataItemSelect({ code: 'BCdOverseasChinese' });
  134. $('#GraduateNo').lrDataItemSelect({ code: 'CollegeType' });
  135. $('#EduSystem').lrDataItemSelect({ code: 'EduSystem' });
  136. $('#StudyModality').lrDataItemSelect({ code: 'StudyModality' });
  137. $('#ResidenceNo').lrDataItemSelect({ code: 'ResidenceNo' });
  138. $('#DeptNo').lrselect({
  139. value: "deptno",
  140. text: "deptname",
  141. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
  142. select: function (item) {
  143. if (item) {
  144. $('#MajorNo').lrselectRefresh({
  145. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  146. param: { code: "CdMajorInfo", strWhere: "DeptNo='" + item.deptno + "'" }
  147. });
  148. }
  149. else {
  150. $('#MajorNo').lrselectRefresh({
  151. url: "",
  152. data: []
  153. });
  154. }
  155. $('#ClassNo').lrselectRefresh({
  156. url: "",
  157. data: []
  158. });
  159. }
  160. });
  161. $('#MajorNo').lrselect({
  162. value: "majorno",
  163. text: "majorname",
  164. select: function (item) {
  165. if (item) {
  166. $('#ClassNo').lrselectRefresh({
  167. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  168. param: { code: "bjsj", strWhere: "DeptNo='" + item.deptno + "' and majorno='" + item.majorno + "'" }
  169. });
  170. }
  171. }
  172. });
  173. $('#MajorNo').on("click",
  174. function () {
  175. var data = $('#DeptNo').lrselectGet();
  176. if (!data) {
  177. learun.alert.error('请先选择系');
  178. }
  179. });
  180. $('#ClassNo').on("click",
  181. function () {
  182. var data1 = $('#DeptNo').lrselectGet();
  183. var data2 = $('#MajorNo').lrselectGet();
  184. if (!data1 || !data2) {
  185. learun.alert.error('请先选择系和专业');
  186. }
  187. });
  188. $('#IsSingle').lrDataItemSelect({ code: 'YesOrNoBit' });
  189. //监听身份证号,绑定出生日期
  190. $("#IdentityCardNo").blur(function () {
  191. var cardNo = $(this).val().trim();
  192. if (cardNo) {
  193. var date = cardNo.slice(6, 10) + "-" + cardNo.slice(10, 12) + "-" + cardNo.slice(12, 14);
  194. $("#Birthday").val(date);
  195. }
  196. });
  197. },
  198. initData: function () {
  199. if (!!keyValue) {
  200. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetFormData?keyValue=' + keyValue, function (data) {
  201. for (var id in data) {
  202. if (!!data[id].length && data[id].length > 0) {
  203. $('#' + id).jfGridSet('refreshdata', data[id]);
  204. }
  205. else {
  206. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  207. }
  208. }
  209. });
  210. }
  211. }
  212. };
  213. // 保存数据
  214. acceptClick = function (callBack) {
  215. if (!$('body').lrValidform()) {
  216. return false;
  217. }
  218. var data = $('body').lrGetFormData();
  219. data["Crowning"] = Crowning;
  220. var postData = {
  221. strEntity: JSON.stringify(data)
  222. };
  223. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SaveForm?keyValue=' + keyValue, postData, function (res) {
  224. // 保存成功后才回调
  225. if (!!callBack) {
  226. callBack();
  227. }
  228. });
  229. };
  230. page.init();
  231. }