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.
 
 
 
 
 
 

389 line
18 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. // 初始化列表
  216. initGird: function () {
  217. $('#gridtable').lrAuthorizeJfGrid({
  218. url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetPageList',
  219. headData: [
  220. { label: "学号", name: "StuNo", width: 100, align: "left" },
  221. { label: "学籍号", name: "StuCode", width: 100, align: "left" },
  222. { label: "姓名", name: "StuName", width: 100, align: "left" },
  223. {
  224. label: "性别", name: "GenderNo", width: 80, align: "left",
  225. formatter: function (cellvalue) {
  226. return cellvalue == true ? "男" : "女";
  227. }
  228. },
  229. { label: "出生日期", name: "Birthday", width: 100, align: "left" },
  230. { label: "身份证号", name: "IdentityCardNo", width: 100, align: "left" },
  231. {
  232. label: "民族", name: "NationalityNo", width: 100, align: "left",
  233. formatterAsync: function (callback, value, row, op, $cell) {
  234. learun.clientdata.getAsync('custmerData', {
  235. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdNationality',
  236. key: value,
  237. keyId: 'nationalityno',
  238. callback: function (_data) {
  239. callback(_data['nationality']);
  240. }
  241. });
  242. }
  243. },
  244. {
  245. label: "政治面貌", name: "PartyFaceNo", width: 100, align: "left",
  246. formatterAsync: function (callback, value, row, op, $cell) {
  247. learun.clientdata.getAsync('custmerData', {
  248. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BCdPartyFace',
  249. key: value,
  250. keyId: 'partyfaceno',
  251. callback: function (_data) {
  252. callback(_data['partyface']);
  253. }
  254. });
  255. }
  256. },
  257. {
  258. label: "系所", name: "DeptNo", width: 100, align: "left",
  259. formatterAsync: function (callback, value, row, op, $cell) {
  260. learun.clientdata.getAsync('custmerData', {
  261. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo',
  262. key: value,
  263. keyId: 'deptno',
  264. callback: function (_data) {
  265. callback(_data['deptname']);
  266. }
  267. });
  268. }
  269. },
  270. {
  271. label: "专业", name: "MajorNo", width: 100, align: "left",
  272. formatterAsync: function (callback, value, row, op, $cell) {
  273. learun.clientdata.getAsync('custmerData', {
  274. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo',
  275. key: value,
  276. keyId: 'majorno',
  277. callback: function (_data) {
  278. callback(_data['majorname']);
  279. }
  280. });
  281. }
  282. },
  283. {
  284. label: "班级", name: "ClassNo", width: 100, align: "left",
  285. formatterAsync: function (callback, value, row, op, $cell) {
  286. learun.clientdata.getAsync('custmerData', {
  287. url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
  288. key: value,
  289. keyId: 'classno',
  290. callback: function (_data) {
  291. callback(_data['classname']);
  292. }
  293. });
  294. }
  295. },
  296. { label: "年级", name: "Grade", width: 100, align: "left" },
  297. {
  298. label: "学制", name: "EduSystem", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  299. learun.clientdata.getAsync('dataItem', {
  300. key: value,
  301. code: 'EduSystem',
  302. callback: function (_data) {
  303. callback(_data.text);
  304. }
  305. });
  306. }
  307. },
  308. {
  309. label: "身体状态", name: "HealthStatus", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  310. learun.clientdata.getAsync('dataItem', {
  311. key: value,
  312. code: 'QRCodeHealthStatus',
  313. callback: function (_data) {
  314. callback(_data.text);
  315. }
  316. });
  317. }
  318. },
  319. {
  320. label: "学习形式", name: "StudyModality", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) {
  321. learun.clientdata.getAsync('dataItem', {
  322. key: value,
  323. code: 'StudyModality',
  324. callback: function (_data) {
  325. callback(_data.text);
  326. }
  327. });
  328. }
  329. },
  330. { label: "报到日期", name: "RegisterDate", width: 100, align: "left" },
  331. { label: "入学年月", name: "EntranceDate", width: 100, align: "left" },
  332. { label: "余额", name: "Balance", width: 100, align: "left" },
  333. { label: "通信地址", name: "MailAddress", width: 100, align: "left" },
  334. { label: "联系电话", name: "mobile", width: 100, align: "left" },
  335. { label: "户口所在地", name: "FatherUnit", width: 100, align: "left" },
  336. { label: "档案所在地", name: "MatherUnit", width: 100, align: "left" },
  337. {
  338. label: "异动状态", name: "AbmormityMoveMark", width: 80, align: "center",
  339. formatter: function (cellvalue) {
  340. return cellvalue == "1" ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  341. }
  342. },
  343. {
  344. label: "审核状态", name: "CheckMark", width: 80, align: "center",
  345. formatter: function (cellvalue) {
  346. return cellvalue == "1" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
  347. }
  348. },
  349. { label: '开户银行', name: 'DepositBank', width: 100, align: "left" },
  350. { label: '银行卡账号', name: 'BankCard', width: 150, align: "left" },
  351. { label: '开户网点', name: 'BankLocation', width: 200, align: "left" },
  352. ],
  353. mainId: 'StuId',
  354. isPage: true,
  355. isMultiselect: true,
  356. //onSelectRow: function (rowdata) {
  357. // if (rowdata.CheckMark == "1") {
  358. // $("#check").hide();
  359. // $("#uncheck").show();
  360. // $("#lr_edit").hide();
  361. // $("#lr_delete").hide();
  362. // } else {
  363. // $("#uncheck").hide();
  364. // $("#check").show();
  365. // $("#lr_edit").show();
  366. // $("#lr_delete").show();
  367. // }
  368. //}
  369. });
  370. page.search();
  371. },
  372. search: function (param) {
  373. param = param || {};
  374. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  375. }
  376. };
  377. refreshGirdData = function () {
  378. page.search();
  379. };
  380. page.init();
  381. }