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.
 
 
 
 
 
 

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