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.
 
 
 
 
 
 

161 lines
6.1 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-08-08 17:21
  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. $("#GenderNo").lrDataItemSelect({ code: 'usersex' });
  19. $("#PartyFaceNo").lrDataItemSelect({ code: 'BCdPartyFace' });
  20. $("#FamilyOriginNo").lrDataItemSelect({ code: 'ExamineeCategory' });
  21. $("#NationalityNo").lrDataItemSelect({ code: 'National' });
  22. $("#TestStuSortNo").lrDataItemSelect({ code: 'ExamineeType' });
  23. $("#TestStuSubjectNo").lrDataItemSelect({ code: 'SubjectType' });
  24. $("#HighTestSortNo").lrDataItemSelect({ code: 'GraduateCategory' });
  25. $("#MatriculateSort").lrDataItemSelect({ code: 'EnrollStyle' });
  26. $('#ResidenceNo').lrDataItemSelect({ code: 'ResidenceNo' });
  27. $('#IsPoor').lrDataItemSelect({ code: 'YesOrNoInt' });
  28. $('#StuInfoFreshFamily').jfGrid({
  29. headData: [
  30. {
  31. label: '姓名', name: 'Name', width: 100, align: 'left'
  32. , edit: {
  33. type: 'input'
  34. }
  35. },
  36. {
  37. label: '与本人关系', name: 'Relation', width: 100, align: 'left'
  38. , edit: {
  39. type: 'select',
  40. datatype: 'dataItem',
  41. code: 'FamilyRelation'
  42. }
  43. },
  44. {
  45. label: '性别', name: 'Sex', width: 100, align: 'left'
  46. , edit: {
  47. type: 'select',
  48. datatype: 'dataItem',
  49. code: 'usersex'
  50. }
  51. },
  52. {
  53. label: '年龄', name: 'Age', width: 100, align: 'left'
  54. , edit: {
  55. type: 'input'
  56. }
  57. },
  58. {
  59. label: '政治面貌', name: 'Politicy', width: 100, align: 'left'
  60. , edit: {
  61. type: 'select',
  62. datatype: 'dataItem',
  63. code: 'PolityStatus'
  64. }
  65. },
  66. {
  67. label: '身份证号', name: 'IdCard', width: 100, align: 'left'
  68. , edit: {
  69. type: 'input'
  70. }
  71. },
  72. ],
  73. isEdit: false,
  74. height: 200
  75. });
  76. $('#StuInfoFreshEmergePeople').jfGrid({
  77. headData: [
  78. {
  79. label: '姓名', name: 'Name', width: 100, align: 'left'
  80. , edit: {
  81. type: 'input'
  82. }
  83. },
  84. {
  85. label: '与本人关系', name: 'Relation', width: 100, align: 'left'
  86. , edit: {
  87. type: 'input'
  88. }
  89. },
  90. {
  91. label: '手机号码', name: 'Mobile', width: 100, align: 'left'
  92. , edit: {
  93. type: 'input'
  94. }
  95. },
  96. {
  97. label: '座机电话', name: 'Telephone', width: 100, align: 'left'
  98. , edit: {
  99. type: 'input'
  100. }
  101. },
  102. {
  103. label: '联系地址', name: 'Address', width: 100, align: 'left'
  104. , edit: {
  105. type: 'input'
  106. }
  107. },
  108. ],
  109. isEdit: false,
  110. height: 200
  111. });
  112. //拍照
  113. $("#photoBtn").on('click', function () {
  114. takeImg();
  115. });
  116. },
  117. initData: function () {
  118. if (!!keyValue) {
  119. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetFormData?keyValue=' + keyValue, function (data) {
  120. for (var id in data) {
  121. if (id == 'Url') {
  122. //头像地址
  123. $('#photoBox').find('img').attr('src', data[id]);
  124. } else {
  125. if (!!data[id].length && data[id].length > 0) {
  126. $('#' + id).jfGridSet('refreshdata', data[id]);
  127. }
  128. else {
  129. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  130. }
  131. }
  132. }
  133. });
  134. }
  135. }
  136. };
  137. // 保存数据
  138. acceptClick = function (callBack) {
  139. if (!$('body').lrValidform()) {
  140. return false;
  141. }
  142. var postData = {};
  143. postData.strEntity = JSON.stringify($('[data-table="StuInfoFresh"]').lrGetFormData());
  144. postData.strstuInfoFreshEmergePeopleList = JSON.stringify($('#StuInfoFreshEmergePeople').jfGridGet('rowdatas'));
  145. postData.strstuInfoFreshFamilyList = JSON.stringify($('#StuInfoFreshFamily').jfGridGet('rowdatas'));
  146. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) {
  147. // 保存成功后才回调
  148. if (!!callBack) {
  149. callBack();
  150. }
  151. });
  152. };
  153. page.init();
  154. }