channelplanMemberEduction.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /**
  2. * channelplanMemberEducation管理初始化
  3. */
  4. var ChannelplanMemberEduction = {
  5. id: "ChannelplanMemberEductionTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. ChannelplanMemberEduction.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '唯一标识', field: 'id', visible: false, align: 'center', valign: 'middle'},
  17. {title: '成员ID', field: 'memberId', visible: false, align: 'center', valign: 'middle'},
  18. {title: '学位(加注英文)', field: 'degree', visible: true, align: 'center', valign: 'middle'},
  19. {title: '开始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle'},
  20. {title: '结束时间', field: 'endTime', visible: true, align: 'center', valign: 'middle'},
  21. {title: '国家', field: 'country', visible: true, align: 'center', valign: 'middle'},
  22. {title: '院校', field: 'college', visible: true, align: 'center', valign: 'middle'},
  23. {title: '专业', field: 'major', visible: true, align: 'center', valign: 'middle'},
  24. {title: '备注', field: 'descriptione', visible: true, align: 'center', valign: 'middle'}
  25. ];
  26. };
  27. /**
  28. * 检查是否选中
  29. */
  30. ChannelplanMemberEduction.check = function () {
  31. var selected = $('#' + this.id).bootstrapTable('getSelections');
  32. if(selected.length == 0){
  33. Feng.info("请先选中表格中的某一记录!");
  34. return false;
  35. }else{
  36. ChannelplanMemberEduction.seItem = selected[0];
  37. return true;
  38. }
  39. };
  40. /**
  41. * 点击添加channelplanMemberEducation
  42. */
  43. ChannelplanMemberEduction.openAddChannelplanMemberEduction = function () {
  44. var index = layer.open({
  45. type: 2,
  46. title: '添加channelplanMemberEducation',
  47. area: ['800px', '420px'], //宽高
  48. fix: false, //不固定
  49. maxmin: true,
  50. content: Feng.ctxPath + '/channelplanMemberEduction/channelplanMemberEduction_add'
  51. });
  52. this.layerIndex = index;
  53. };
  54. /**
  55. * 打开查看channelplanMemberEducation详情
  56. */
  57. ChannelplanMemberEduction.openChannelplanMemberEductionDetail = function () {
  58. if (this.check()) {
  59. var index = layer.open({
  60. type: 2,
  61. title: 'channelplanMemberEducation详情',
  62. area: ['800px', '420px'], //宽高
  63. fix: false, //不固定
  64. maxmin: true,
  65. content: Feng.ctxPath + '/channelplanMemberEduction/channelplanMemberEduction_update/' + ChannelplanMemberEduction.seItem.id
  66. });
  67. this.layerIndex = index;
  68. }
  69. };
  70. /**
  71. * 删除channelplanMemberEducation
  72. */
  73. ChannelplanMemberEduction.delete = function () {
  74. if (this.check()) {
  75. var ajax = new $ax(Feng.ctxPath + "/channelplanMemberEduction/delete", function (data) {
  76. Feng.success("删除成功!");
  77. ChannelplanMemberEduction.table.refresh();
  78. }, function (data) {
  79. Feng.error("删除失败!" + data.responseJSON.message + "!");
  80. });
  81. ajax.set("channelplanMemberEductionId",this.seItem.id);
  82. ajax.start();
  83. }
  84. };
  85. /**
  86. * 查询channelplanMemberEducation列表
  87. */
  88. ChannelplanMemberEduction.search = function () {
  89. var queryData = {};
  90. queryData['condition'] = $("#condition").val();
  91. ChannelplanMemberEduction.table.refresh({query: queryData});
  92. };
  93. $(function () {
  94. var defaultColunms = ChannelplanMemberEduction.initColumn();
  95. var table = new BSTable(ChannelplanMemberEduction.id, "/channelplanMemberEduction/list", defaultColunms);
  96. table.setPaginationType("server");
  97. ChannelplanMemberEduction.table = table.init();
  98. });