apiChannelplanMemberEduction.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. ];
  25. };
  26. /**
  27. * 检查是否选中
  28. */
  29. ChannelplanMemberEduction.check = function () {
  30. var selected = $('#' + this.id).bootstrapTable('getSelections');
  31. if(selected.length == 0){
  32. Feng.info("请先选中表格中的某一记录!");
  33. return false;
  34. }else{
  35. ChannelplanMemberEduction.seItem = selected[0];
  36. return true;
  37. }
  38. };
  39. /**
  40. * 点击添加channelplanMemberEducation
  41. */
  42. ChannelplanMemberEduction.openAddChannelplanMemberEduction = function () {
  43. var index = layer.open({
  44. type: 2,
  45. title: '添加channelplanMemberEducation',
  46. area: ['800px', '420px'], //宽高
  47. fix: false, //不固定
  48. maxmin: true,
  49. content: Feng.ctxPath + '/api/channelplanMemberEduction/channelplanMemberEduction_add'
  50. });
  51. this.layerIndex = index;
  52. };
  53. /**
  54. * 打开查看channelplanMemberEducation详情
  55. */
  56. ChannelplanMemberEduction.openChannelplanMemberEductionDetail = function () {
  57. if (this.check()) {
  58. var index = layer.open({
  59. type: 2,
  60. title: 'channelplanMemberEducation详情',
  61. area: ['800px', '420px'], //宽高
  62. fix: false, //不固定
  63. maxmin: true,
  64. content: Feng.ctxPath + '/api/channelplanMemberEduction/channelplanMemberEduction_update/' + ChannelplanMemberEduction.seItem.id
  65. });
  66. this.layerIndex = index;
  67. }
  68. };
  69. /**
  70. * 删除channelplanMemberEducation
  71. */
  72. ChannelplanMemberEduction.delete = function () {
  73. if (this.check()) {
  74. var ajax = new $ax(Feng.ctxPath + "/api/channelplanMemberEduction/delete", function (data) {
  75. Feng.success("删除成功!");
  76. ChannelplanMemberEduction.table.refresh();
  77. }, function (data) {
  78. Feng.error("删除失败!" + data.responseJSON.message + "!");
  79. });
  80. ajax.set("channelplanMemberEductionId",this.seItem.id);
  81. ajax.start();
  82. }
  83. };
  84. /**
  85. * 查询channelplanMemberEducation列表
  86. */
  87. ChannelplanMemberEduction.search = function () {
  88. var queryData = {};
  89. queryData['condition'] = $("#condition").val();
  90. ChannelplanMemberEduction.table.refresh({query: queryData});
  91. };
  92. $(function () {
  93. var defaultColunms = ChannelplanMemberEduction.initColumn();
  94. var table = new BSTable(ChannelplanMemberEduction.id, "/api/channelplanMemberEduction/list", defaultColunms);
  95. table.setPaginationType("server");
  96. ChannelplanMemberEduction.table = table.init();
  97. });