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.
 
 
 
 
 
 

113 lines
4.6 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-03-30 14:14
  5. * 描 述:家庭情况
  6. */
  7. var refreshGirdData;
  8. var empId = request('empId');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. page.initGird();
  14. page.bind();
  15. },
  16. bind: function () {
  17. // 刷新
  18. $('#lr_refresh').on('click', function () {
  19. location.reload();
  20. });
  21. // 新增
  22. $('#lr_add').on('click', function () {
  23. learun.layerForm({
  24. id: 'formInPM_FamilySituation',
  25. title: '新增',
  26. url: top.$.rootUrl + '/EducationalAdministration/PM_FamilySituation/Form?empId=' + empId,
  27. width: 600,
  28. height: 400,
  29. callBack: function (id) {
  30. return top[id].acceptClick(refreshGirdData);
  31. }
  32. });
  33. });
  34. // 编辑
  35. $('#lr_edit').on('click', function () {
  36. var keyValue = $('#gridtable').jfGridValue('ID');
  37. if (learun.checkrow(keyValue)) {
  38. learun.layerForm({
  39. id: 'formInPM_FamilySituation',
  40. title: '编辑',
  41. url: top.$.rootUrl + '/EducationalAdministration/PM_FamilySituation/Form?keyValue=' + keyValue + '&empId=' + empId,
  42. width: 600,
  43. height: 400,
  44. callBack: function (id) {
  45. return top[id].acceptClick(refreshGirdData);
  46. }
  47. });
  48. }
  49. });
  50. // 删除
  51. $('#lr_delete').on('click', function () {
  52. var keyValue = $('#gridtable').jfGridValue('ID');
  53. if (learun.checkrow(keyValue)) {
  54. learun.layerConfirm('是否确认删除该项!', function (res) {
  55. if (res) {
  56. learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/PM_FamilySituation/DeleteForm', { keyValue: keyValue }, function () {
  57. refreshGirdData();
  58. });
  59. }
  60. });
  61. }
  62. });
  63. },
  64. // 初始化列表
  65. initGird: function () {
  66. $('#gridtable').lrAuthorizeJfGrid({
  67. url: top.$.rootUrl + '/EducationalAdministration/PM_FamilySituation/GetPageList',
  68. headData: [
  69. {
  70. label: "称谓", name: "Application", width: 100, align: "left",
  71. formatterAsync: function (callback, value, row, op, $cell) {
  72. learun.clientdata.getAsync('dataItem', {
  73. key: value,
  74. code: 'FamilyRelation',
  75. callback: function (_data) {
  76. callback(_data.text);
  77. }
  78. });
  79. }
  80. },
  81. { label: "姓名", name: "Name", width: 100, align: "left" },
  82. { label: "出生日期", name: "Birthday", width: 130, align: "left" },
  83. {
  84. label: "政治面貌", name: "PoliticalAffiliation", width: 100, align: "left",
  85. formatterAsync: function (callback, value, row, op, $cell) {
  86. learun.clientdata.getAsync('dataItem', {
  87. key: value,
  88. code: 'PolityStatus',
  89. callback: function (_data) {
  90. callback(_data.text);
  91. }
  92. });
  93. }
  94. },
  95. { label: "工作单位及职务", name: "UnitAndPost", width: 100, align: "left" },
  96. ],
  97. mainId: 'ID',
  98. isPage: true
  99. });
  100. page.search();
  101. },
  102. search: function (param) {
  103. param = param || {};
  104. param.EmpId = empId;
  105. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  106. }
  107. };
  108. refreshGirdData = function () {
  109. page.search();
  110. };
  111. page.init();
  112. }