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.
 
 
 
 
 
 

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