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.
 
 
 
 
 
 

196 lines
8.0 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. $('#GraduateType').lrDataItemSelect({ code: 'GraduateType' });
  30. $('#Province').lrselect({
  31. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_PROVINCE',
  32. //param: { strWhere: " cparent= 650000 " },
  33. value: 'pcode',
  34. text: 'pname',
  35. maxHeight: 200,
  36. allowSearch: true,
  37. select: function (item) {
  38. var Citys = $("#Province").lrselectGet();
  39. if (Citys != null && Citys != "" && Citys != undefined) {
  40. $('#City').lrselectRefresh({
  41. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY',
  42. param: { strWhere: " 1=1 and cparent in (" + Citys + ")" },
  43. allowSearch: true,
  44. value: "ccode",
  45. text: "cname",
  46. maxHeight: 200
  47. });
  48. } else {
  49. $('#City').lrselectRefresh({
  50. url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY',
  51. param: { strWhere: " 1=1 and cparent ='' " },
  52. value: "ccode",
  53. text: "cname",
  54. maxHeight: 200
  55. });
  56. }
  57. }
  58. })
  59. $("#City").lrselect();
  60. $('#StuInfoFreshFamily').jfGrid({
  61. headData: [
  62. {
  63. label: '姓名', name: 'Name', width: 100, align: 'left'
  64. , edit: {
  65. type: 'input'
  66. }
  67. },
  68. {
  69. label: '与本人关系', name: 'Relation', width: 100, align: 'left'
  70. , edit: {
  71. type: 'select',
  72. datatype: 'dataItem',
  73. code: 'FamilyRelation'
  74. }
  75. },
  76. {
  77. label: '性别', name: 'Sex', width: 100, align: 'left'
  78. , edit: {
  79. type: 'select',
  80. datatype: 'dataItem',
  81. code: 'usersex'
  82. }
  83. },
  84. {
  85. label: '年龄', name: 'Age', width: 100, align: 'left'
  86. , edit: {
  87. type: 'input'
  88. }
  89. },
  90. {
  91. label: '政治面貌', name: 'Politicy', width: 100, align: 'left'
  92. , edit: {
  93. type: 'select',
  94. datatype: 'dataItem',
  95. code: 'PolityStatus'
  96. }
  97. },
  98. //{
  99. // label: '身份证号', name: 'IdCard', width: 100, align: 'left'
  100. // , edit: {
  101. // type: 'input'
  102. // }
  103. //},
  104. ],
  105. isEdit: true,
  106. height: 200
  107. });
  108. $('#StuInfoFreshEmergePeople').jfGrid({
  109. headData: [
  110. {
  111. label: '姓名', name: 'Name', width: 100, align: 'left'
  112. , edit: {
  113. type: 'input'
  114. }
  115. },
  116. {
  117. label: '与本人关系', name: 'Relation', width: 100, align: 'left'
  118. , edit: {
  119. type: 'input'
  120. }
  121. },
  122. {
  123. label: '手机号码', name: 'Mobile', width: 100, align: 'left'
  124. , edit: {
  125. type: 'input'
  126. }
  127. },
  128. {
  129. label: '座机电话', name: 'Telephone', width: 100, align: 'left'
  130. , edit: {
  131. type: 'input'
  132. }
  133. },
  134. {
  135. label: '联系地址', name: 'Address', width: 100, align: 'left'
  136. , edit: {
  137. type: 'input'
  138. }
  139. },
  140. ],
  141. isEdit: true,
  142. height: 200
  143. });
  144. //拍照
  145. $("#photoBtn").on('click', function () {
  146. takeImg();
  147. });
  148. },
  149. initData: function () {
  150. if (!!keyValue) {
  151. $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetFormData?keyValue=' + keyValue, function (data) {
  152. for (var id in data) {
  153. if (id == 'Url') {
  154. //头像地址
  155. $('#photoBox').find('img').attr('src', data[id]);
  156. } else {
  157. if (!!data[id].length && data[id].length > 0) {
  158. $('#' + id).jfGridSet('refreshdata', data[id]);
  159. }
  160. else {
  161. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  162. }
  163. }
  164. }
  165. });
  166. }
  167. }
  168. };
  169. // 保存数据
  170. acceptClick = function (callBack) {
  171. if (!$('body').lrValidform()) {
  172. return false;
  173. }
  174. var Score1 = $('#ChineseScore').val();
  175. var Score2 = $('#MathScore').val();
  176. var Score3 = $('#ForeignLangScore').val();
  177. var Score4 = $('#ComprehensiveScore').val();
  178. $('#HighAmountScore').val(Number(Score1) + Number(Score2) + Number(Score3) + Number(Score4));
  179. var postData = {};
  180. postData.strEntity = JSON.stringify($('[data-table="StuInfoFresh"]').lrGetFormData());
  181. postData.strstuInfoFreshEmergePeopleList = JSON.stringify($('#StuInfoFreshEmergePeople').jfGridGet('rowdatas'));
  182. postData.strstuInfoFreshFamilyList = JSON.stringify($('#StuInfoFreshFamily').jfGridGet('rowdatas'));
  183. $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) {
  184. // 保存成功后才回调
  185. if (!!callBack) {
  186. callBack();
  187. }
  188. });
  189. };
  190. page.init();
  191. }