StaffEdit.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. //加载
  2. $(function () {
  3. $("#profileExpander").closest("tr")
  4. .next().css("display", "")
  5. .next().css("display", "")
  6. .next().css("display", "none")
  7. .next().css("display", "none")
  8. .next().css("display", "none")
  9. .next().css("display", "none")
  10. .next().css("display", "none");
  11. $("#profileExpander").attr("expanded", "1");
  12. $("#otherExpander").closest("tr")
  13. .next().css("display", "")
  14. .next().css("display", "none")
  15. .next().css("display", "none")
  16. .next().css("display", "none")
  17. .next().css("display", "none")
  18. .next().css("display", "none")
  19. .next().css("display", "none")
  20. .next().css("display", "none")
  21. .next().css("display", "none")
  22. .next().css("display", "none")
  23. .next().css("display", "")
  24. .next().css("display", "");
  25. $("#otherExpander").attr("expanded", "1");
  26. });
  27. //点击收缩(扩展信息)
  28. function swapProfile() {
  29. if ($("#profileExpander").attr("expanded") == "1") {
  30. $("#profileExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  31. $("#profileExpander").closest("tr")
  32. .next().css("display", "")
  33. .next().css("display", "")
  34. .next().css("display", "")
  35. .next().css("display", "")
  36. .next().css("display", "")
  37. .next().css("display", "")
  38. .next().css("display", "");
  39. $("#profileExpander").attr("expanded", "0");
  40. } else {
  41. $("#profileExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  42. $("#profileExpander").closest("tr")
  43. .next().css("display", "")
  44. .next().css("display", "")
  45. .next().css("display", "none")
  46. .next().css("display", "none")
  47. .next().css("display", "none")
  48. .next().css("display", "none")
  49. .next().css("display", "none");
  50. $("#profileExpander").attr("expanded", "1");
  51. }
  52. }
  53. //点击收缩(其它信息)
  54. function swapOther() {
  55. if ($("#otherExpander").attr("expanded") == "1") {
  56. $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -50px 0");
  57. $("#otherExpander").closest("tr")
  58. .next().css("display", "")
  59. .next().css("display", "")
  60. .next().css("display", "")
  61. .next().css("display", "")
  62. .next().css("display", "")
  63. .next().css("display", "")
  64. .next().css("display", "")
  65. .next().css("display", "")
  66. .next().css("display", "")
  67. .next().css("display", "")
  68. .next().css("display", "")
  69. .next().css("display", "");
  70. $("#otherExpander").attr("expanded", "0");
  71. } else {
  72. $("#otherExpander").css("background", "url('../../Content/Bowin.Control.Core/themes/metro-blue/images/tree_icons.png') no-repeat -32px 0");
  73. $("#otherExpander").closest("tr")
  74. .next().css("display", "")
  75. .next().css("display", "none")
  76. .next().css("display", "none")
  77. .next().css("display", "none")
  78. .next().css("display", "none")
  79. .next().css("display", "none")
  80. .next().css("display", "none")
  81. .next().css("display", "none")
  82. .next().css("display", "none")
  83. .next().css("display", "none")
  84. .next().css("display", "")
  85. .next().css("display", "");
  86. $("#otherExpander").attr("expanded", "1");
  87. }
  88. }
  89. //保存
  90. function Staff_Save() {
  91. var certificatesType = $("#CertificatesType").combobox("getValue");
  92. var certificatesNum = $.trim($("#CertificatesNum").val());
  93. if (certificatesNum != "") {
  94. if (certificatesType == "" || certificatesType == "-1" || certificatesType == null) {
  95. $.messager.alert("系统提示", "请选择对应的证件类型。");
  96. return;
  97. }
  98. }
  99. var oldCollegeID = $("#CollegeDropdown").val();
  100. var oldDepartmentID = $("#DepartmentDropdown").val();
  101. var collegeID = $("#CollegeID").combogridX("getValue");
  102. var departmentID = $("#DepartmentID").combogridX("getValue");
  103. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Staff/Verification', { collegeID: collegeID, departmentID: departmentID }, function (data) {
  104. if (data == true) {
  105. if (oldCollegeID == "" || oldCollegeID == "-1" || oldCollegeID == null) {
  106. //新增、复制新增
  107. $(document.forms[0]).submit();
  108. } else {
  109. //修改
  110. if (collegeID == "" || collegeID == "-1" || collegeID == null) {
  111. //院系所为空
  112. $(document.forms[0]).submit();
  113. } else {
  114. if (collegeID != oldCollegeID) {
  115. //院系所变动
  116. $.messager.confirm("系统提示", "修改教师的" + college + "会重置教师个人的数据范围(" + college + "、教研室),是否继续?", function (r) {
  117. if (r) {
  118. $(document.forms[0]).submit();
  119. }
  120. })
  121. } else {
  122. if (oldDepartmentID == "" || oldDepartmentID == "-1" || oldDepartmentID == null) {
  123. //教研室为空
  124. if (departmentID == oldDepartmentID) {
  125. $(document.forms[0]).submit();
  126. } else {
  127. $.messager.confirm("系统提示", "修改教师的教研室会重置教师个人的数据范围(教研室),是否继续?", function (r) {
  128. if (r) {
  129. $(document.forms[0]).submit();
  130. }
  131. })
  132. }
  133. } else {
  134. if (departmentID != oldDepartmentID) {
  135. $.messager.confirm("系统提示", "修改教师的教研室会重置教师个人的数据范围(教研室),是否继续?", function (r) {
  136. if (r) {
  137. $(document.forms[0]).submit();
  138. }
  139. })
  140. } else {
  141. $(document.forms[0]).submit();
  142. }
  143. }
  144. }
  145. }
  146. }
  147. } else {
  148. $.messager.alert("系统提示", "所属教研室和" + college + "不匹配,请核查。");
  149. }
  150. });
  151. }
  152. //删除照片(单个删除)
  153. function delPhoto() {
  154. var userID = $("#UserID").val();
  155. $.postWithLoading(CMS_SystemConfig.VirtualDirectoryPath + '/Staff/DeletePhoto', { userID: userID }, function (data) {
  156. if (data.IsSuccess) {
  157. $.messager.alert("系统提示", data.Message);
  158. $("#imgPhoto").attr('src', '');
  159. } else {
  160. $.messager.alert("系统提示", data.Message);
  161. }
  162. });
  163. }
  164. //联动查询
  165. function queryCollege(data) {
  166. var campusID = $("#CampusID").combogridX("getValue");
  167. var collegeID = $("#CollegeID").combogridX("getValue");
  168. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  169. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  170. $("#DepartmentID").combogridX("setValue", "-1");
  171. $("#DepartmentID").combogridX("reload", eval(jsonString));
  172. }
  173. function queryDepartment(data) {
  174. var campusID = $("#CampusID").combogridX("getValue");
  175. var collegeID = $("#CollegeID").combogridX("getValue");
  176. var jsonString = "({'QueryParamsDatas':'CampusDropdown|*|" + campusID + "|@|";
  177. jsonString += "CollegeDropdown|*|" + collegeID + "|@|'})";
  178. $("#DepartmentID").combogridX("reload", eval(jsonString));
  179. }