cc87a0bce9e3b0cfa280adef23da3fb58cfa6ec6.svn-base 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. var g;
  2. var myCols = [{
  3. display: '保供电任务名称', name: 'TASK_NAME_615', width: 150, align: 'left' ,editor: { type: 'text'}
  4. },{
  5. display: '任务时间', name: 'TASK_TIME_615', width: 150, align: 'left' ,editor: { type: 'text'}
  6. },{
  7. display: '投入人员(人次)', name: 'INPUT_MEM_615', width: 150, align: 'left' ,editor: { type: 'text'}
  8. },{
  9. display: '投入车辆(台次) ', name: 'INPUT_CAR_615', width: 150, align: 'left' ,editor: { type: 'text'}
  10. },{
  11. display: '级别', name: 'LEVEL_615', width: 150, align: 'left' ,editor: { type: 'text'}
  12. },{
  13. display: '单位', name: 'DEPT_615', width: 150, align: 'left' ,editor: { type: 'text'}
  14. }
  15. ];
  16. function initComplete(){
  17. initGrid();
  18. }
  19. function initGrid(){
  20. g = $("#maingrid").quiGrid({
  21. columns: [
  22. { name: 'FD_OBJECTID615', hide : true},
  23. { display: '保供电查询统计明细表', columns: myCols, width: "100%"}
  24. ],
  25. url :$.pathname() + '/ws/service0/BGDmingxibiao/importExpert',
  26. //params : {fileName:"C:\Users\云涛\Desktop"},
  27. pageSize: 10,
  28. sortName: '',
  29. rownumbers:true,
  30. height: '100%',
  31. width:"100%",
  32. checkbox:true,
  33. multihead:true,
  34. enabledEdit: true, //编辑用
  35. percentWidthMode:true,
  36. toolbar:{
  37. items:[
  38. {text: '批量保存', click: saveAll, iconClass: 'icon_add'},
  39. { line : true }
  40. ]
  41. }
  42. });
  43. }
  44. function saveAll(){
  45. var rows=g.getSelectedRows();
  46. var rowsLength = rows.length;
  47. if (rowsLength == 0) {
  48. top.Dialog.alert("请选中要导入的信息!");
  49. return;
  50. }
  51. // alert(JSON.stringify(rows));
  52. var json=JSON.stringify(rows);
  53. // $("#infotab").init();
  54. var url = $.pathname()
  55. + "/ws/service0/BGDmingxibiao/saveBGDmingxibiao";
  56. // alert(url);
  57. var params = {
  58. classId : '615',
  59. json:json
  60. };
  61. $.ajax({
  62. url : url,
  63. type : 'post',
  64. timeout : 15000,
  65. data : params,
  66. dataType : 'json',
  67. success : function(data) {
  68. // $.messager.alert('保存成功', null, null);
  69. window.location.href="List.jsp";
  70. // var url = "/nwyj/page/business/am/resource/ledger/generator-car.jsp";
  71. // window.parent.parent.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  72. // window.history.back();
  73. },
  74. error : function(e) {
  75. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  76. }
  77. });
  78. }