addPfmScheme.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. var g = null;
  2. function f_initGrid() {
  3. g = $("#maingrid").ligerGrid({
  4. columns:
  5. [{ display: '指标ID', name: 'target_id', type: 'text',isSort: false, hide: true,width:100},
  6. { display: '指标分类', name: 'class_name', type: 'text',isSort: false,width:200},
  7. { display: '指标名称', name: 'target_name', type: 'text',isSort: false,width:200},
  8. { display: '描述', name: 'description', type: 'text',isSort: false,width:450},
  9. { display: '分数上限', name: 'max_score', type: 'text',isSort: false,width:150,type:"int",editor:{type:"int"},render:function(item){
  10. if(!item.max_score){
  11. return "0";
  12. }
  13. return item.max_score;
  14. }}
  15. ],
  16. data:{Rows:[]},
  17. enabledEdit: true,
  18. checkbox : true,
  19. rownumbers:true,
  20. whenRClickToSelect:true,
  21. width :'99.8%',
  22. usePager: false,
  23. height : '95%'
  24. });
  25. }
  26. //添加考核指标
  27. function f_import(){
  28. var obj = window.top;
  29. if (obj != undefined && obj != null) {
  30. obj.$.ligerDialog.open({
  31. title : '添加考核指标',
  32. width : 1000,
  33. height : 400,
  34. url : 'hrPerformanceTargetAction.do?task=toDialogList',
  35. buttons : [ {
  36. text : '确定',
  37. onclick : f_importOK
  38. }, {
  39. text : '关闭',
  40. onclick : f_importCancel
  41. } ]
  42. });
  43. }
  44. }
  45. //选择存货确定
  46. function f_importOK(item, dialog){
  47. var rows = dialog.frame.f_select();
  48. for (var i = 0; i < rows.length; i++)
  49. {
  50. g.addRow(rows[i]);
  51. }
  52. dialog.close();
  53. }
  54. //取消选择
  55. function f_importCancel(item, dialog){
  56. dialog.close();
  57. }
  58. //删除选中行的信息
  59. function deleteRow() {
  60. g.deleteSelectedRow();
  61. }