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.

FormView.js 5.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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').lrDataSourceSelect({ code: 'BCdNationality', value: 'nationalityno', text: 'nationality' });
  67. $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' });
  68. $('#PartyFaceNo').lrDataSourceSelect({ code: 'BCdPartyFace', value: 'partyfaceno', text: 'partyface' });
  69. $('#HealthStatusNo').lrDataSourceSelect({ code: 'BCdHealthStatus', value: 'healthstatusno', text: 'healthstatus' });
  70. $('#Photo').lrUploader();
  71. $('#FamilyOriginNo').lrDataSourceSelect({ code: 'BCdFamilyOrigin', value: 'familyoriginno', text: 'familyorigin' });
  72. $('#OverseasChineseNo').lrDataSourceSelect({ code: 'BCdOverseasChinese', value: 'overseaschineseno', text: 'overseaschinesename' });
  73. $('#GraduateNo').lrDataItemSelect({ code: 'CollegeType' });
  74. $('#MajorNo').lrselect({
  75. value: "majorno",
  76. text: "majorname",
  77. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
  78. select: function (item) {
  79. if (item) {
  80. $('#ClassNo').lrselectRefresh({
  81. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable',
  82. param: { code: "bjsj", strWhere: "majorno=" + item.majorno }
  83. });
  84. }
  85. }
  86. });
  87. $('#ClassNo').lrselect({
  88. value: "classid",
  89. text: "classname"
  90. });
  91. $('#ClassNo').on("click",
  92. function () {
  93. var data2 = $('#MajorNo').lrselectGet();
  94. if (!data2) {
  95. learun.alert.error('请先选择系和专业');
  96. }
  97. });
  98. $("#lrUploader_uploadBtn_Photo").hide();
  99. },
  100. initData: function () {
  101. if (!!keyValue) {
  102. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetFormData?keyValue=' + keyValue, function (data) {
  103. for (var id in data) {
  104. if (!!data[id].length && data[id].length > 0) {
  105. $('#' + id).jfGridSet('refreshdata', data[id]);
  106. }
  107. else {
  108. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  109. }
  110. }
  111. });
  112. }
  113. }
  114. };
  115. // 保存数据
  116. acceptClick = function (callBack) {
  117. if (!$('body').lrValidform()) {
  118. return false;
  119. }
  120. var postData = {
  121. strEntity: JSON.stringify($('body').lrGetFormData())
  122. };
  123. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SaveForm?keyValue=' + keyValue, postData, function (res) {
  124. // 保存成功后才回调
  125. if (!!callBack) {
  126. callBack();
  127. }
  128. });
  129. };
  130. page.init();
  131. }