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.
 
 
 
 
 
 

372 lines
17 KiB

  1. var refreshGirdData;
  2. var StuId;
  3. var bootstrap = function ($, learun) {
  4. "use strict";
  5. var page = {
  6. init: function () {
  7. page.initGird();
  8. page.bind();
  9. },
  10. bind: function () {
  11. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  12. page.search(queryJson);
  13. }, 220, 400);
  14. $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
  15. $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
  16. // 刷新
  17. $('#lr_refresh').on('click', function () {
  18. location.reload();
  19. });
  20. $("#lr_photo").on('click', function () {
  21. StuId = $("#gridtable").jfGridValue('StuId');
  22. if (learun.checkrow(StuId)) {
  23. takeImg();
  24. }
  25. });
  26. // 新增
  27. $('#lr_add').on('click', function () {
  28. learun.layerForm({
  29. id: 'form',
  30. title: '新增',
  31. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Form',
  32. width: 800,
  33. height: 600,
  34. callBack: function (id) {
  35. return top[id].acceptClick(refreshGirdData);
  36. }
  37. });
  38. });
  39. // 编辑
  40. $('#lr_edit').on('click', function () {
  41. var keyValue = $('#gridtable').jfGridValue('StuId');
  42. if (learun.checkrow(keyValue)) {
  43. if (keyValue.indexOf(',') != -1) {
  44. learun.alert.warning("只能选择一条记录进行编辑!");
  45. return;
  46. }
  47. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  48. if (CheckMark === "1") {
  49. learun.alert.warning("当前项目已审核不能编辑!");
  50. return;
  51. }
  52. learun.layerForm({
  53. id: 'form',
  54. title: '编辑',
  55. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Form?keyValue=' + keyValue,
  56. width: 800,
  57. height: 600,
  58. callBack: function (id) {
  59. return top[id].acceptClick(refreshGirdData);
  60. }
  61. });
  62. }
  63. });
  64. // 删除
  65. $('#lr_delete').on('click', function () {
  66. var keyValue = $('#gridtable').jfGridValue('StuId');
  67. if (learun.checkrow(keyValue)) {
  68. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  69. if (CheckMark.indexOf('1') != -1) {
  70. learun.alert.warning("选中记录中包含已审核项目,已审核不能删除!");
  71. return;
  72. }
  73. learun.layerConfirm('是否确认删除该项!', function (res) {
  74. if (res) {
  75. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/DeleteForm', { keyValue: keyValue }, function () {
  76. refreshGirdData();
  77. });
  78. }
  79. });
  80. }
  81. });
  82. //查看
  83. $('#lr_view').on('click', function () {
  84. var keyValue = $('#gridtable').jfGridValue('StuId');
  85. if (learun.checkrow(keyValue)) {
  86. if (keyValue.indexOf(',') != -1) {
  87. learun.alert.warning("只能选择一条记录进行查看!");
  88. return;
  89. }
  90. learun.layerForm({
  91. id: 'form',
  92. title: '编辑',
  93. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/FormView?keyValue=' + keyValue,
  94. width: 1162,
  95. height: 600,
  96. btn: null
  97. });
  98. }
  99. });
  100. // 打印
  101. $('#lr_print').on('click', function () {
  102. $('#gridtable').jqprintTable();
  103. });
  104. //审核
  105. $('#check').on('click', function () {
  106. var keyValue = $('#gridtable').jfGridValue('StuId');
  107. if (learun.checkrow(keyValue)) {
  108. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  109. if (CheckMark.indexOf('1') != -1) {
  110. learun.alert.warning("选中记录中包含已审核项目!");
  111. return;
  112. }
  113. learun.layerConfirm('是否确认审核该项?', function (res) {
  114. if (res) {
  115. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Check', { keyValue: keyValue }, function () {
  116. refreshGirdData();
  117. });
  118. }
  119. });
  120. }
  121. });
  122. //去审
  123. $('#uncheck').on('click', function () {
  124. var keyValue = $('#gridtable').jfGridValue('StuId');
  125. if (learun.checkrow(keyValue)) {
  126. var CheckMark = $('#gridtable').jfGridValue('CheckMark');
  127. var CheckMarkArr = CheckMark.split(',');
  128. if ($.inArray('0', CheckMarkArr) != -1 || $.inArray('', CheckMarkArr) != -1) {
  129. learun.alert.warning("选中记录中包含未审核项目!");
  130. return;
  131. }
  132. learun.layerConfirm('是否确认取消审核该项?', function (res) {
  133. if (res) {
  134. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/UnCheck', { keyValue: keyValue }, function () {
  135. refreshGirdData();
  136. });
  137. }
  138. });
  139. }
  140. });
  141. //审核全部
  142. $('#checkall').on('click', function () {
  143. learun.layerConfirm('是否确认全部审核?', function (res) {
  144. if (res) {
  145. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/CheckAll', {}, function () {
  146. refreshGirdData();
  147. });
  148. }
  149. });
  150. });
  151. //生成帐号
  152. $('#lr_generate').on('click', function () {
  153. learun.layerConfirm('是否确认生成帐号?', function (res) {
  154. if (res) {
  155. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Generate', {}, function () {
  156. refreshGirdData();
  157. });
  158. }
  159. });
  160. });
  161. $('#lr_update').on('click', function () {
  162. learun.layerConfirm('是否确认更新帐号?', function (res) {
  163. if (res) {
  164. learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/UpdateAccount', {}, function () {
  165. refreshGirdData();
  166. })
  167. }
  168. })
  169. })
  170. //查看异动
  171. $("#lr_searchChange").on('click', function () {
  172. var keyValue = $('#gridtable').jfGridValue('StuId');
  173. if (learun.checkrow(keyValue)) {
  174. if (keyValue.indexOf(',') != -1) {
  175. learun.alert.warning("只能选择一条记录!");
  176. return;
  177. }
  178. learun.layerForm({
  179. id: 'form',
  180. title: '异动记录',
  181. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic_ChangeLog/Index?keyValue=' + keyValue,
  182. width: 800,
  183. height: 600,
  184. btn: null
  185. });
  186. }
  187. })
  188. //同步照片
  189. $('#lr_synPhoto').on('click', function () {
  190. learun.loading(true, '正在同步,请稍后')
  191. learun.httpAsync('get', top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/SynPhoto', {}, function (res) {
  192. learun.loading(false)
  193. })
  194. })
  195. //打印简历表
  196. $('#lr_printInfo').on('click', function () {
  197. var keyValue = $('#gridtable').jfGridValue('StuId');
  198. if (learun.checkrow(keyValue)) {
  199. if (keyValue.indexOf(',') != -1) {
  200. learun.alert.warning("只能选择一条记录进行查看!");
  201. return;
  202. }
  203. learun.layerForm({
  204. id: 'print',
  205. title: '学生简历表',
  206. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/Print?keyValue=' + keyValue,
  207. width: 1100,
  208. height: 800,
  209. btn: null
  210. });
  211. }
  212. });
  213. },
  214. // 初始化列表
  215. initGird: function () {
  216. $('#gridtable').lrAuthorizeJfGrid({
  217. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList',
  218. headData: [
  219. { label: "学号", name: "StuNo", width: 100, align: "left" },
  220. { label: "学籍号", name: "StuCode", width: 100, align: "left" },
  221. { label: "姓名", name: "StuName", width: 100, align: "left" },
  222. {
  223. label: "性别", name: "GenderNo", width: 80, align: "left",
  224. formatter: function (cellvalue) {
  225. return cellvalue == true ? "男" : "女";
  226. }
  227. },
  228. { label: "出生日期", name: "Birthday", width: 100, align: "left" },
  229. { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" },
  230. {
  231. label: "民族", name: "NationalityNo", width: 100, align: "left",
  232. formatterAsync: function (callback, value, row, op, $cell) {
  233. learun.clientdata.getAsync('custmerData', {
  234. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdNationality',
  235. key: value,
  236. keyId: 'nationalityno',
  237. callback: function (_data) {
  238. callback(_data['nationality']);
  239. }
  240. });
  241. }
  242. },
  243. {
  244. label: "政治面貌", name: "PartyFaceNo", width: 100, align: "left",
  245. formatterAsync: function (callback, value, row, op, $cell) {
  246. learun.clientdata.getAsync('custmerData', {
  247. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdPartyFace',
  248. key: value,
  249. keyId: 'partyfaceno',
  250. callback: function (_data) {
  251. callback(_data['partyface']);
  252. }
  253. });
  254. }
  255. },
  256. {
  257. label: "专业", name: "MajorNo", width: 100, align: "left",
  258. formatterAsync: function (callback, value, row, op, $cell) {
  259. learun.clientdata.getAsync('custmerData', {
  260. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  261. key: value,
  262. keyId: 'majorno',
  263. callback: function (_data) {
  264. callback(_data['majorname']);
  265. }
  266. });
  267. }
  268. },
  269. {
  270. label: "班级", name: "ClassNo", width: 100, align: "left",
  271. formatterAsync: function (callback, value, row, op, $cell) {
  272. learun.clientdata.getAsync('custmerData', {
  273. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  274. key: value,
  275. keyId: 'classno',
  276. callback: function (_data) {
  277. callback(_data['classname']);
  278. }
  279. });
  280. }
  281. },
  282. { label: "年级", name: "Grade", width: 100, align: "left" },
  283. {
  284. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  285. learun.clientdata.getAsync('dataItem', {
  286. key: value,
  287. code: 'EduSystem',
  288. callback: function (_data) {
  289. callback(_data.text);
  290. }
  291. });
  292. }
  293. },
  294. {
  295. label: "身体状态", name: "HealthStatus", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  296. learun.clientdata.getAsync('dataItem', {
  297. key: value,
  298. code: 'QRCodeHealthStatus',
  299. callback: function (_data) {
  300. callback(_data.text);
  301. }
  302. });
  303. }
  304. },
  305. {
  306. label: "学习形式", name: "StudyModality", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  307. learun.clientdata.getAsync('dataItem', {
  308. key: value,
  309. code: 'StudyModality',
  310. callback: function (_data) {
  311. callback(_data.text);
  312. }
  313. });
  314. }
  315. },
  316. { label: "报到日期", name: "RegisterDate", width: 100, align: "left" },
  317. { label: "入学年月", name: "EntranceDate", width: 100, align: "left" },
  318. { label: "余额", name: "Balance", width: 100, align: "left" },
  319. { label: "通信地址", name: "MailAddress", width: 100, align: "left" },
  320. { label: "联系电话", name: "mobile", width: 100, align: "left" },
  321. { label: "户口所在地", name: "FatherUnit", width: 100, align: "left" },
  322. { label: "档案所在地", name: "MatherUnit", width: 100, align: "left" },
  323. {
  324. label: "异动状态", name: "AbmormityMoveMark", width: 80, align: "center",
  325. formatter: function (cellvalue) {
  326. return cellvalue == "1" ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  327. }
  328. },
  329. {
  330. label: "审核状态", name: "CheckMark", width: 80, align: "center",
  331. formatter: function (cellvalue) {
  332. return cellvalue == "1" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
  333. }
  334. }
  335. ],
  336. mainId: 'StuId',
  337. isPage: true,
  338. isMultiselect: true,
  339. //onSelectRow: function (rowdata) {
  340. // if (rowdata.CheckMark == "1") {
  341. // $("#check").hide();
  342. // $("#uncheck").show();
  343. // $("#lr_edit").hide();
  344. // $("#lr_delete").hide();
  345. // } else {
  346. // $("#uncheck").hide();
  347. // $("#check").show();
  348. // $("#lr_edit").show();
  349. // $("#lr_delete").show();
  350. // }
  351. //}
  352. });
  353. page.search();
  354. },
  355. search: function (param) {
  356. param = param || {};
  357. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  358. }
  359. };
  360. refreshGirdData = function () {
  361. page.search();
  362. };
  363. page.init();
  364. }