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.
 
 
 
 
 
 

160 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: 'PolityStatus' });
  20. $("#FamilyOriginNo").lrDataItemSelect({ code: 'ExamineeCategory' });
  21. $('#NationalityNo').lrDataSourceSelect({ code: 'BCdNationality', value: 'nationalityno', text: 'nationality' });
  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. $('#StuInfoFreshFamily').jfGrid({
  28. headData: [
  29. {
  30. label: '姓名', name: 'Name', width: 100, align: 'left'
  31. , edit: {
  32. type: 'input'
  33. }
  34. },
  35. {
  36. label: '与本人关系', name: 'Relation', width: 100, align: 'left'
  37. , edit: {
  38. type: 'select',
  39. datatype: 'dataItem',
  40. code: 'FamilyRelation'
  41. }
  42. },
  43. {
  44. label: '性别', name: 'Sex', width: 100, align: 'left'
  45. , edit: {
  46. type: 'select',
  47. datatype: 'dataItem',
  48. code: 'usersex'
  49. }
  50. },
  51. {
  52. label: '年龄', name: 'Age', width: 100, align: 'left'
  53. , edit: {
  54. type: 'input'
  55. }
  56. },
  57. {
  58. label: '政治面貌', name: 'Politicy', width: 100, align: 'left'
  59. , edit: {
  60. type: 'select',
  61. datatype: 'dataItem',
  62. code: 'PolityStatus'
  63. }
  64. },
  65. {
  66. label: '身份证号', name: 'IdCard', width: 100, align: 'left'
  67. , edit: {
  68. type: 'input'
  69. }
  70. },
  71. ],
  72. isEdit: true,
  73. height: 200
  74. });
  75. $('#StuInfoFreshEmergePeople').jfGrid({
  76. headData: [
  77. {
  78. label: '姓名', name: 'Name', width: 100, align: 'left'
  79. , edit: {
  80. type: 'input'
  81. }
  82. },
  83. {
  84. label: '与本人关系', name: 'Relation', width: 100, align: 'left'
  85. , edit: {
  86. type: 'input'
  87. }
  88. },
  89. {
  90. label: '手机号码', name: 'Mobile', width: 100, align: 'left'
  91. , edit: {
  92. type: 'input'
  93. }
  94. },
  95. {
  96. label: '座机电话', name: 'Telephone', width: 100, align: 'left'
  97. , edit: {
  98. type: 'input'
  99. }
  100. },
  101. {
  102. label: '联系地址', name: 'Address', width: 100, align: 'left'
  103. , edit: {
  104. type: 'input'
  105. }
  106. },
  107. ],
  108. isEdit: true,
  109. height: 200
  110. });
  111. //拍照
  112. $("#photoBtn").on('click', function () {
  113. takeImg();
  114. });
  115. },
  116. initData: function () {
  117. if (!!keyValue) {
  118. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetFormData?keyValue=' + keyValue, function (data) {
  119. for (var id in data) {
  120. if (id == 'Url') {
  121. //头像地址
  122. $('#photoBox').find('img').attr('src', data[id]);
  123. } else {
  124. if (!!data[id].length && data[id].length > 0) {
  125. $('#' + id).jfGridSet('refreshdata', data[id]);
  126. }
  127. else {
  128. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  129. }
  130. }
  131. }
  132. });
  133. }
  134. }
  135. };
  136. // 保存数据
  137. acceptClick = function (callBack) {
  138. if (!$('body').lrValidform()) {
  139. return false;
  140. }
  141. var postData = {};
  142. postData.strEntity = JSON.stringify($('[data-table="StuInfoFresh"]').lrGetFormData());
  143. postData.strstuInfoFreshEmergePeopleList = JSON.stringify($('#StuInfoFreshEmergePeople').jfGridGet('rowdatas'));
  144. postData.strstuInfoFreshFamilyList = JSON.stringify($('#StuInfoFreshFamily').jfGridGet('rowdatas'));
  145. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) {
  146. // 保存成功后才回调
  147. if (!!callBack) {
  148. callBack();
  149. }
  150. });
  151. };
  152. page.init();
  153. }