amountStandard.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /**
  2. * 人才津贴配置管理初始化
  3. */
  4. var AmountStandard = {
  5. id: "AmountStandardTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. AmountStandard.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '人才类型', field: 'type', visible: true, align: 'center', valign: 'middle',
  17. formatter: function (value, row, index) {
  18. if (value == 1) {
  19. return "晋江市现代产业体系人才";
  20. }
  21. if (value == 2) {
  22. return "集成电路优秀人才";
  23. }
  24. if (value == 5) {
  25. return "卫健人才";
  26. }
  27. if (value == 6) {
  28. return "高教人才";
  29. }
  30. }
  31. },
  32. {title: '津贴类别', field: 'allowanceType', visible: true, align: 'center', valign: 'middle',
  33. formatter: function (value, row, index) {
  34. if (value == 1) {
  35. return "工作津贴";
  36. }
  37. if (value == 2) {
  38. return "一次性交通津贴";
  39. }
  40. if (value == 3) {
  41. return "购房补贴";
  42. }
  43. }
  44. },
  45. {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle'},
  46. {title: '金额', field: 'money', visible: true, align: 'center', valign: 'middle'},
  47. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle'}
  48. ];
  49. };
  50. /**
  51. * 检查是否选中
  52. */
  53. AmountStandard.check = function () {
  54. var selected = $('#' + this.id).bootstrapTable('getSelections');
  55. if (selected.length == 0) {
  56. Feng.info("请先选中表格中的某一记录!");
  57. return false;
  58. } else {
  59. AmountStandard.seItem = selected[0];
  60. return true;
  61. }
  62. };
  63. /**
  64. * 点击添加人才津贴配置
  65. */
  66. AmountStandard.openAddAmountStandard = function () {
  67. var index = layer.open({
  68. type: 2,
  69. title: '添加人才津贴配置',
  70. area: ['800px', '420px'], //宽高
  71. fix: false, //不固定
  72. maxmin: true,
  73. content: Feng.ctxPath + '/admin/amountStandard/add'
  74. });
  75. this.layerIndex = index;
  76. };
  77. /**
  78. * 打开查看人才津贴配置详情
  79. */
  80. AmountStandard.openAmountStandardDetail = function () {
  81. if (this.check()) {
  82. var index = layer.open({
  83. type: 2,
  84. title: '人才津贴配置详情',
  85. area: ['800px', '420px'], //宽高
  86. fix: false, //不固定
  87. maxmin: true,
  88. content: Feng.ctxPath + '/admin/amountStandard/edit/id/' + AmountStandard.seItem.id
  89. });
  90. this.layerIndex = index;
  91. }
  92. };
  93. /**
  94. * 删除人才津贴配置
  95. */
  96. AmountStandard.delete = function () {
  97. if (this.check()) {
  98. var operation = function () {
  99. var ajax = new $ax(Feng.ctxPath + "/admin/amountStandard/delete", function (data) {
  100. if (data.code == 200) {
  101. AmountStandard.table.refresh();
  102. Feng.success(data.msg);
  103. } else {
  104. Feng.info(data.msg);
  105. }
  106. }, function (data) {
  107. Feng.error("删除失败!" + data.responseJSON.message + "!");
  108. });
  109. ajax.set("id", AmountStandard.seItem.id);
  110. ajax.start();
  111. };
  112. Feng.confirm("确定要删除吗?", operation);
  113. }
  114. };
  115. /**
  116. * 查询表单提交参数对象
  117. * @returns {{}}
  118. */
  119. AmountStandard.formParams = function () {
  120. var queryData = {};
  121. queryData['type'] = $("#type").val();
  122. queryData['allowanceType'] = $("#allowanceType").val();
  123. return queryData;
  124. }
  125. /**
  126. * 查询批次管理列表
  127. */
  128. AmountStandard.search = function () {
  129. AmountStandard.table.refresh({query: AmountStandard.formParams()});
  130. };
  131. /**
  132. * 重置
  133. */
  134. AmountStandard.reset = function () {
  135. $("#type").val("");
  136. $("#allowanceType").val("");
  137. }
  138. $(function () {
  139. var defaultColunms = AmountStandard.initColumn();
  140. var table = new BSTable(AmountStandard.id, "/admin/amountStandard/list", defaultColunms);
  141. table.setPaginationType("server");
  142. AmountStandard.table = table.init();
  143. });