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.
 
 
 
 
 
 

155 lines
5.9 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: 'stuType' });
  21. $("#NationalityNo").lrDataItemSelect({ code: 'National' });
  22. $("#TestStuSortNo").lrDataItemSelect({ code: 'ExamineeType' });
  23. $("#TestStuSubjectNo").lrDataItemSelect({ code: 'SubjectType' });
  24. $("#HighTestSortNo").lrDataItemSelect({ code: 'GraduateCategory' });
  25. $("#MatriculateSort").lrDataItemSelect({ code: 'enrollType' });
  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. isEdit: false,
  68. height: 200
  69. });
  70. $('#StuInfoFreshEmergePeople').jfGrid({
  71. headData: [
  72. {
  73. label: '姓名', name: 'Name', width: 100, align: 'left'
  74. , edit: {
  75. type: 'input'
  76. }
  77. },
  78. {
  79. label: '与本人关系', name: 'Relation', width: 100, align: 'left'
  80. , edit: {
  81. type: 'input'
  82. }
  83. },
  84. {
  85. label: '手机号码', name: 'Mobile', width: 100, align: 'left'
  86. , edit: {
  87. type: 'input'
  88. }
  89. },
  90. {
  91. label: '座机电话', name: 'Telephone', width: 100, align: 'left'
  92. , edit: {
  93. type: 'input'
  94. }
  95. },
  96. {
  97. label: '联系地址', name: 'Address', width: 100, align: 'left'
  98. , edit: {
  99. type: 'input'
  100. }
  101. },
  102. ],
  103. isEdit: false,
  104. height: 200
  105. });
  106. //拍照
  107. $("#photoBtn").on('click', function () {
  108. takeImg();
  109. });
  110. },
  111. initData: function () {
  112. if (!!keyValue) {
  113. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetFormData?keyValue=' + keyValue, function (data) {
  114. for (var id in data) {
  115. if (id == 'Url') {
  116. //头像地址
  117. $('#photoBox').find('img').attr('src', data[id]);
  118. } else {
  119. if (!!data[id].length && data[id].length > 0) {
  120. $('#' + id).jfGridSet('refreshdata', data[id]);
  121. }
  122. else {
  123. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  124. }
  125. }
  126. }
  127. });
  128. }
  129. }
  130. };
  131. // 保存数据
  132. acceptClick = function (callBack) {
  133. if (!$('body').lrValidform()) {
  134. return false;
  135. }
  136. var postData = {};
  137. postData.strEntity = JSON.stringify($('[data-table="StuInfoFresh"]').lrGetFormData());
  138. postData.strstuInfoFreshEmergePeopleList = JSON.stringify($('#StuInfoFreshEmergePeople').jfGridGet('rowdatas'));
  139. postData.strstuInfoFreshFamilyList = JSON.stringify($('#StuInfoFreshFamily').jfGridGet('rowdatas'));
  140. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) {
  141. // 保存成功后才回调
  142. if (!!callBack) {
  143. callBack();
  144. }
  145. });
  146. };
  147. page.init();
  148. }