channelplanEnterpriseIncome.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /**
  2. * channelplan管理初始化
  3. */
  4. var ChannelplanEnterpriseIncome = {
  5. id: "ChannelplanEnterpriseIncomeTable", //表格id
  6. seItem: null, //选中的条目
  7. table: null,
  8. layerIndex: -1
  9. };
  10. /**
  11. * 初始化表格的列
  12. */
  13. ChannelplanEnterpriseIncome.initColumn = function () {
  14. return [
  15. {field: 'selectItem', radio: true},
  16. {title: '唯一标志', field: 'id', visible: true, align: 'center', valign: 'middle'},
  17. {title: '海峡计划申报ID', field: 'cpid', visible: true, align: 'center', valign: 'middle'},
  18. {title: '年度', field: 'year', visible: true, align: 'center', valign: 'middle'},
  19. {title: '研发投入(万元)', field: 'researchIn', visible: true, align: 'center', valign: 'middle'},
  20. {title: '核心产品年销售额(万元)', field: 'coreProduct', visible: true, align: 'center', valign: 'middle'},
  21. {title: '研发投入占销售收入的比重(%)', field: 'proportion', visible: true, align: 'center', valign: 'middle'},
  22. {title: '增值税(万元)', field: 'addTax', visible: true, align: 'center', valign: 'middle'},
  23. {title: '所得税(万元)', field: 'incomeTax', visible: true, align: 'center', valign: 'middle'},
  24. {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle'},
  25. {title: '创建时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'},
  26. {title: '创建用户', field: 'createUser', visible: true, align: 'center', valign: 'middle'},
  27. {title: '更新时间', field: 'updateTime', visible: true, align: 'center', valign: 'middle'},
  28. {title: '更新用户', field: 'updateUser', visible: true, align: 'center', valign: 'middle'}
  29. ];
  30. };
  31. /**
  32. * 检查是否选中
  33. */
  34. ChannelplanEnterpriseIncome.check = function () {
  35. var selected = $('#' + this.id).bootstrapTable('getSelections');
  36. if(selected.length == 0){
  37. Feng.info("请先选中表格中的某一记录!");
  38. return false;
  39. }else{
  40. ChannelplanEnterpriseIncome.seItem = selected[0];
  41. return true;
  42. }
  43. };
  44. /**
  45. * 点击添加channelplan
  46. */
  47. ChannelplanEnterpriseIncome.openAddChannelplanEnterpriseIncome = function () {
  48. var index = layer.open({
  49. type: 2,
  50. title: '添加channelplan',
  51. area: ['800px', '420px'], //宽高
  52. fix: false, //不固定
  53. maxmin: true,
  54. content: Feng.ctxPath + '/channelplanEnterpriseIncome/channelplanEnterpriseIncome_add'
  55. });
  56. this.layerIndex = index;
  57. };
  58. /**
  59. * 打开查看channelplan详情
  60. */
  61. ChannelplanEnterpriseIncome.openChannelplanEnterpriseIncomeDetail = function () {
  62. if (this.check()) {
  63. var index = layer.open({
  64. type: 2,
  65. title: 'channelplan详情',
  66. area: ['800px', '420px'], //宽高
  67. fix: false, //不固定
  68. maxmin: true,
  69. content: Feng.ctxPath + '/channelplanEnterpriseIncome/channelplanEnterpriseIncome_update/' + ChannelplanEnterpriseIncome.seItem.id
  70. });
  71. this.layerIndex = index;
  72. }
  73. };
  74. /**
  75. * 删除channelplan
  76. */
  77. ChannelplanEnterpriseIncome.delete = function () {
  78. if (this.check()) {
  79. var ajax = new $ax(Feng.ctxPath + "/channelplanEnterpriseIncome/delete", function (data) {
  80. Feng.success("删除成功!");
  81. ChannelplanEnterpriseIncome.table.refresh();
  82. }, function (data) {
  83. Feng.error("删除失败!" + data.responseJSON.message + "!");
  84. });
  85. ajax.set("channelplanEnterpriseIncomeId",this.seItem.id);
  86. ajax.start();
  87. }
  88. };
  89. /**
  90. * 查询channelplan列表
  91. */
  92. ChannelplanEnterpriseIncome.search = function () {
  93. var queryData = {};
  94. queryData['condition'] = $("#condition").val();
  95. ChannelplanEnterpriseIncome.table.refresh({query: queryData});
  96. };
  97. $(function () {
  98. var defaultColunms = ChannelplanEnterpriseIncome.initColumn();
  99. var table = new BSTable(ChannelplanEnterpriseIncome.id, "/channelplanEnterpriseIncome/list", defaultColunms);
  100. table.setPaginationType("client");
  101. ChannelplanEnterpriseIncome.table = table.init();
  102. });