8bc3ceb124cafbd7a87d0c872cdb7783c71cc309.svn-base 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. //报表类型
  2. var type;
  3. var mycol;
  4. var testData={"rows":[{}]};
  5. var g;
  6. //报表名
  7. var report_name;
  8. var dept ;
  9. var tableObj = getThing($.pathname() +"/ws/xianlutingyun/XianlutingyunService/getTableObj",{},'text');
  10. //var deptLevel = getThing($.pathname() +"/ws/xianlutingyun/XianlutingyunService/getDeptLevel",{"comp_id":compId},"text");
  11. tableObj = eval('('+tableObj+')');
  12. var url = decodeURI(window.location.href);
  13. // 获取(表头)
  14. function initComplete() {
  15. if(url.indexOf("?")>-1 ){
  16. var data = url.split("?");
  17. if(data.length>2){
  18. type = data[1];
  19. report_name = data[2];
  20. $("#type").val(type);
  21. $("#report_name").val(report_name);
  22. }else{
  23. var getType = data[1].split("&");
  24. if(getType.length==3 && data[1].indexOf("deptLevel")==-1){
  25. type = getType[0].split("=")[1];
  26. }else{
  27. var reportName = getType[0].split("=")[1];
  28. var deptLevel = getType[2].split("=")[1];
  29. if(reportName=="变电站停运及恢复情况统计表"){
  30. if(deptLevel=="1" || deptLevel=="2"){
  31. reportName = "变电站停运及恢复统计表";
  32. }else{
  33. reportName = "变电站停运及恢复情况表";
  34. }
  35. }
  36. console.log(type);
  37. type = tableObj[reportName];
  38. $(".pic").hide();
  39. }
  40. }
  41. }
  42. getColumns(type);
  43. init(mycol,testData);
  44. }
  45. function init(cols,data) {
  46. g = $("#maingrid").quiGrid({
  47. columns : cols,
  48. data : data,
  49. usePager:false,
  50. sortName : 'id',
  51. rownumbers : true,
  52. enabledEdit : true, // 编辑用
  53. height : '100%',
  54. width : "100%",
  55. multihead : true
  56. });
  57. }
  58. function getColumns(type) {
  59. if(type=="100"){
  60. mycol=[{hide:"true",name:"FD_OBJECTID"},
  61. {display:"支援单位",name:"COMP_NAME",id:"COMP_ID",width:'80'},
  62. // {display:"支援单位",name:"COMP_NAME",id:"COMP_ID",minWidth:'100'/*,editor:{type:"text",inputMode:"positiveDecimal",maxlength:"20"}*/},
  63. {display:"被支援单位",name:"BZYDW_ID",editor:{type:"text",inputMode:"text",maxlength:"15"},width:'11%'},
  64. {display:"500kV线路",columns:[
  65. {
  66. display:"累计完成",columns:[
  67. {display:"组塔(基)",name:"LJWCZT_500",isCount:"0",width:'5%'},
  68. {display:"架线(km)",name:"LJWCJX_500",isCount:"0",width:'5%'}
  69. ]
  70. }
  71. ]},
  72. {display:"220kV线路",columns:[
  73. {
  74. display:"累计完成",columns:[
  75. {display:"组塔(基)",name:"LJWCZT_220",isCount:"0",width:'5%'},
  76. {display:"架线(km)",name:"LJWCJX_220",isCount:"0",width:'5%'}
  77. ]
  78. }
  79. ]},
  80. {display:"110kV线路",columns:[
  81. {
  82. display:"累计完成",columns:[
  83. {display:"组塔(基)",name:"LJWCZT_110",isCount:"0",width:'5%'},
  84. {display:"立杆(根)",name:"LJWCLG_110",isCount:"0",width:'5%'},
  85. {display:"架线(km)",name:"LJWCJX_110",isCount:"0",width:'5%'}
  86. ]
  87. }
  88. ]},
  89. {display:"10kV线路",columns:[
  90. {
  91. display:"今日完成",columns:[
  92. {display:"组塔(基)",name:"JRWCZT_10",isCount:"0",width:'5%'},
  93. {display:"扶杆(根)",name:"JRWCFG_10",isCount:"0",width:'5%'},
  94. {display:"立杆(根)",name:"JRWCLG_10",isCount:"0",width:'5%'},
  95. {display:"架线(km)",name:"JRWCJX_10",isCount:"0",width:'5%'}
  96. ]
  97. },
  98. {
  99. display:"累计完成",columns:[
  100. {display:"组塔(基)",name:"LJWCZT_10",isCount:"0",width:'5%'},
  101. {display:"扶杆(根)",name:"LJWCFG_10",isCount:"0",width:'5%'},
  102. {display:"立杆(根)",name:"LJWCLG_10",isCount:"0",width:'5%'},
  103. {display:"架线(km)",name:"LJWCJX_10",isCount:"0",width:'5%'}
  104. ]
  105. }
  106. ]},
  107. {display:"低压线路",columns:[
  108. {
  109. display:"今日完成",columns:[
  110. {display:"扶杆(根)",name:"JRWCFG_DY",isCount:"0",width:'5%'},
  111. {display:"立杆(根)",name:"JRWCLG_DY",isCount:"0",width:'5%'},
  112. {display:"架线(km)",name:"JRWCJX_DY",isCount:"0",width:'5%'}
  113. ]
  114. },
  115. {
  116. display:"累计完成",columns:[
  117. {display:"扶杆(根)",name:"LJWCFG_DY",isCount:"0",width:'5%'},
  118. {display:"立杆(根)",name:"LJWCLG_DY",isCount:"0",width:'5%'},
  119. {display:"架线(km)",name:"LJWCJX_DY",isCount:"0",width:'5%'}
  120. ]
  121. }]},
  122. {display:"配变",columns:[
  123. {
  124. display:"今日完成",columns:[
  125. {display:"修复(台)",name:"JRWCXF_PB",isCount:"0",width:'5%'}
  126. ]
  127. },
  128. {
  129. display:"累计完成",columns:[
  130. {display:"修复(台)",name:"LJWCXF_PB",isCount:"0",width:'5%'}
  131. ]
  132. }
  133. ]},
  134. {display:"累计完成比例",name:"LJWCBL",width:'5%'},
  135. {display:"今日完成其他工作",name:"WCQTGZ",width:'5%'},
  136. {display:"遗留问题",name:"YLWT",width:'5%'}
  137. ];
  138. }else{
  139. var urls = $.pathname()
  140. + "/ws/xianlutingyun/XianlutingyunService/getNoEditColumns";
  141. $.ajax({
  142. url : urls,
  143. type : 'post',
  144. timeout : 15000,
  145. async : false,
  146. data : {
  147. "report_type" : type,
  148. },
  149. dataType : 'text',
  150. success : function(data) {
  151. mycol=eval('('+ data+')');
  152. },
  153. error : function(e) {
  154. $.messager.alert('查询失败!', '访问服务失败!', 'error');
  155. }
  156. });
  157. }
  158. }
  159. function _addStatus(rowdata, rowindex, value, column){
  160. return "<div style='background-color: #dde5f0'>"+''+"</div>";
  161. }
  162. function goback(){
  163. if(url.indexOf("&")==-1){
  164. window.parent.document.getElementById("frmright").setAttribute("src", encodeURI("/nwyj/page/business/em/report/Show_Type.html?"+$("#type").val()+"?"+$("#report_name").val()));
  165. }else{
  166. var urlData = url.split("?")[1].split("&");
  167. if(urlData.length==3){
  168. var fd_objectid = urlData[1].split("=")[1];
  169. var go = urlData[2].split("=")[1];
  170. if(go=="yj"){
  171. window.parent.document.getElementById("frmright").setAttribute("src", encodeURI("/nwyj/page/business/em/report/ReportRequireData.html?fd_id="+fd_objectid));
  172. }else {
  173. window.parent.document.getElementById("frmright").setAttribute("src", encodeURI("/nwyj/page/business/em/report/reportDept/ReportRequireData.html?fd_id="+fd_objectid));
  174. }
  175. }
  176. }
  177. }