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.

IndexPersonnel.js 4.8 KiB

3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
  2. * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2022-02-23 10:46
  5. * 描 述:人事模板配置
  6. */
  7. var refreshGirdData;
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var page = {
  11. init: function () {
  12. page.initGird();
  13. page.bind();
  14. },
  15. bind: function () {
  16. $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
  17. page.search(queryJson);
  18. }, 220, 400);
  19. // 刷新
  20. $('#lr_refresh').on('click', function () {
  21. location.reload();
  22. });
  23. // 新增
  24. $('#lr_add').on('click', function () {
  25. learun.layerForm({
  26. id: 'form',
  27. title: '新增',
  28. url: top.$.rootUrl + '/LR_Desktop/EnrollTemplate/Form?type=2',
  29. width: 600,
  30. height: 400,
  31. callBack: function (id) {
  32. return top[id].acceptClick(refreshGirdData);
  33. }
  34. });
  35. });
  36. // 编辑
  37. $('#lr_edit').on('click', function () {
  38. var keyValue = $('#gridtable').jfGridValue('Id');
  39. if (learun.checkrow(keyValue)) {
  40. learun.layerForm({
  41. id: 'form',
  42. title: '编辑',
  43. url: top.$.rootUrl + '/LR_Desktop/EnrollTemplate/Form?type=2&keyValue=' + keyValue,
  44. width: 600,
  45. height: 400,
  46. callBack: function (id) {
  47. return top[id].acceptClick(refreshGirdData);
  48. }
  49. });
  50. }
  51. });
  52. // 删除
  53. $('#lr_delete').on('click', function () {
  54. var keyValue = $('#gridtable').jfGridValue('Id');
  55. if (learun.checkrow(keyValue)) {
  56. learun.layerConfirm('是否确认删除该项!', function (res) {
  57. if (res) {
  58. learun.deleteForm(top.$.rootUrl + '/LR_Desktop/EnrollTemplate/DeleteForm', { keyValue: keyValue }, function () {
  59. refreshGirdData();
  60. });
  61. }
  62. });
  63. }
  64. });
  65. // 打印
  66. $('#lr_print').on('click', function () {
  67. $('#gridtable').jqprintTable();
  68. });
  69. //文件预览
  70. $('#lr-preview').on('click', function () {
  71. var keyValue = $("#gridtable").jfGridValue("Id");
  72. var Path = $("#gridtable").jfGridValue("Path");
  73. if (keyValue) {
  74. learun.layerForm({
  75. id: 'PreviewForm',
  76. title: '文件预览',
  77. url: top.$.rootUrl + '/LR_Desktop/EnrollData/PreviewFile?folderid=' + Path,
  78. width: 1080,
  79. height: 850,
  80. btn: null,
  81. callBack: function (id) {
  82. return top[id].acceptClick(refreshGirdData);
  83. }
  84. });
  85. } else {
  86. learun.alert.warning('请选择要预览的文件!');
  87. }
  88. });
  89. },
  90. // 初始化列表
  91. initGird: function () {
  92. $('#gridtable').jfGrid({
  93. url: top.$.rootUrl + '/LR_Desktop/EnrollTemplate/GetPageList',
  94. headData: [
  95. { label: "模板名称", name: "Name", width: 200, align: "left" },
  96. { label: "文件名称", name: "F_FileName", width: 200, align: "left" },
  97. //{ label: "模板上传", name: "Path", width: 100, align: "left"},
  98. {
  99. label: "是否启用", name: "Enabled", width: 100, align: "left",
  100. formatter: function (cellvalue) {
  101. return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>";
  102. }
  103. },
  104. { label: "备注", name: "Remark", width: 200, align: "left" },
  105. ],
  106. mainId: 'Id',
  107. isPage: true
  108. });
  109. page.search();
  110. },
  111. search: function (param) {
  112. param = param || {};
  113. param.Type = 2;
  114. $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
  115. }
  116. };
  117. refreshGirdData = function () {
  118. $('#gridtable').jfGridSet('reload');
  119. };
  120. page.init();
  121. }