editAssessGroup.js 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. var g_to_people = null;
  2. var g_by_people =null;
  3. function f_initToGrid() {
  4. var weight_type=$("#weight_type").val();
  5. var columns=[
  6. { display: '考核人ID', name: 'to_people_id', type: 'text',isSort: false, hide: true,width:10,
  7. render:function(item){
  8. return item.uid;
  9. }
  10. },
  11. { display: '考核人', name: 'user_name', type: 'text',isSort: false,width:100},
  12. { display: '部门', name: 'groupname', type: 'text',isSort: false,width:200},
  13. { display: '职位', name: 'posname', type: 'text',isSort: false,width:200}
  14. ];
  15. if(weight_type=="2"){
  16. columns.push({ display: '权重%', name: 'weightiness', type: 'int',isSort: false,width:250,editor:{type:"int"}});
  17. }
  18. columns.push({ display: '评分次序', name: 'priority', type: 'int',isSort: false,width:200,editor:{type:"int"}});
  19. columns.push({ display: '操作', width:150,render:function(item,rowindex){
  20. return "<a href='javascript:to_deleteRow("+rowindex+","+item.universalid+")'>删除</a>";
  21. }});
  22. g_to_people = $("#maingrid_to_people").ligerGrid({
  23. columns:columns,
  24. url:'pfmAssessGroupAction.do?task=to_pagelist&group_id='+$("#group_id").val(),
  25. pageSize : 20,
  26. pageParmName : 'p',
  27. pagesizeParmName : 'pSize',
  28. enabledEdit: true,
  29. rownumbers:true,
  30. width :'99.8%',
  31. height : '300'
  32. });
  33. }
  34. function f_initByGrid() {
  35. g_by_people = $("#maingrid_by_people").ligerGrid({
  36. columns:
  37. [
  38. { display: '被考核人ID', name: 'uid', type: 'text',isSort: false, hide: true,width:10,
  39. render:function(item){
  40. return item.uid;
  41. }
  42. },
  43. { display: '被考核人', name: 'user_name', type: 'text',isSort: false,width:200},
  44. { display: '部门', name: 'groupname', type: 'text',isSort: false,width:200},
  45. { display: '职位', name: 'posname', type: 'text',isSort: false,width:200},
  46. { display: '考核方案', name: 'scheme_id', type: 'select',isSort: false,width:350,
  47. editor: { type: 'select', data: scheme, valueField: 'universalid', textField: 'scheme_name' },
  48. render : function(item, rowindex, value) {;
  49. for (var i = 0; i < scheme.length; i++)
  50. {
  51. if (scheme[i]['universalid'] == item.scheme_id)
  52. return scheme[i]['scheme_name'];
  53. }
  54. return "方案已停用";
  55. }
  56. },
  57. { display: '操作',width:150,render:function(item,rowindex){
  58. return "<a href='javascript:by_deleteRow("+rowindex+","+item.universalid+")'>删除</a>";
  59. }}
  60. ],
  61. url:'pfmAssessGroupAction.do?task=by_pagelist&group_id='+$("#group_id").val(),
  62. pageSize : 20,
  63. pageParmName : 'p',
  64. pagesizeParmName : 'pSize',
  65. enabledEdit: true,
  66. rownumbers:true,
  67. width :'99.8%',
  68. height : '300'
  69. });
  70. }
  71. function to_deleteRow(rowindex,universalid){
  72. g_to_people.deleteRow(rowindex);
  73. }
  74. function by_deleteRow(rowindex,universalid){
  75. g_by_people.deleteRow(rowindex);
  76. }