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.
 
 
 
 
 
 

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