61a07aa8bbd54d1b0176a54b0753fc46306f4664.svn-base 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905
  1. var g;
  2. var mycol;
  3. var testData;
  4. var fd_id;
  5. // 下拉框的值
  6. var val;
  7. // var login_name = top.com.sinosoft.lz.system.user.LoginInfo.();
  8. // 获取用户部门
  9. var corpId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  10. // 获取用户Id
  11. var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  12. var corpName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  13. var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
  14. var currDate = getNowFormatDate();
  15. var role = "R002105430210";
  16. var headType = "xq";
  17. var role1 = '"' + role + '"';
  18. var headType1 = '"' + headType + '"';
  19. var Prourl = $.pathname()
  20. + "/ws/xianlutingyun/XianlutingyunService/getProjectName";
  21. function initTree1($dom, setting, nodes) {
  22. $.fn.zTree.init($dom, setting, nodes);
  23. }
  24. $(function() {
  25. // ****布局
  26. var layout = $("#layout1").layout({
  27. leftWidth : 250,
  28. space : 10
  29. });
  30. function customHeightSet(contentHeight) {
  31. $(".layout_content").height(contentHeight - 30);
  32. }
  33. $("#layout1").layout({
  34. onEndResize : function() {
  35. var wi = $(".l-layout-content").width();
  36. wi = wi * 0.85;
  37. $(".accordition").css("width", (wi + 45) + "px");
  38. $(".leftnav").css("width", (wi + 5) + 'px');
  39. $(".parentNavDiv").css("width", wi + "px");
  40. }
  41. });
  42. $("#layout1").find(".l-layout-header-toggle").on("click",function(){
  43. $("#layout1").find(".l-layout-collapse-left-toggle").attr("tempW",$("#maingrid").find(".l-grid2").width());
  44. $("#maingrid").find(".l-grid2").css({width:"100%"});
  45. });
  46. $("#layout1").find(".l-layout-collapse-left-toggle").on("click",function(){
  47. $("#maingrid").find(".l-grid2").css({width:$(this).attr("tempW")});
  48. });
  49. function customHeightSet(contentHeight) {
  50. $(".cusBoxContent").height(contentHeight - 20);
  51. }
  52. var setting1 = {
  53. view : {
  54. selectedMulti : false
  55. },
  56. async : {
  57. dataType : 'JSON',
  58. contentType : "application/json"
  59. },
  60. callback : {
  61. onClick : nodeNick,
  62. onExpand: checkExpand
  63. }
  64. };
  65. var url = $.pathname() + "/ws/ReportHuiZong/HuiZongService/getYuAnTree";
  66. var nodes = getThing(url, {"comp_id":corpId});
  67. initTree1($("#reportTree"), setting1, nodes);
  68. $("#warningNumber").on("change",function() {
  69. var fdVal = $(this).val();
  70. if (fdVal) {
  71. var url = $.pathname()
  72. + "/ws/xianlutingyun/XianlutingyunService/getProjectTime";
  73. var params = {
  74. fd_id : fdVal
  75. };
  76. getProjectNames(url, params, "时间");
  77. } else {
  78. // $("#warningTime1").render();
  79. // $("#dateSelect").val("");
  80. $("#show").hide();
  81. $("#show1").hide();
  82. /*if ($("#show1").is(":hidden")) {
  83. $("#show1").show();
  84. $("#show2").hide();
  85. $("#show").hide();
  86. }*/
  87. }
  88. });
  89. var params = getParams(role,"1");
  90. getProjectNames(Prourl, params, "计划");
  91. showTitle("线路停运及恢复情况");
  92. totalShow("1", role, 'xq');
  93. //数据比对
  94. $("#compare").on("click",function(){
  95. var url = "/nwyj/page/business/em/report/DataCompare.html";
  96. var tp = $("#sel").val();
  97. url = encodeURI(url+"?corpName="+corpName+"?type="+tp+"?roleId="+role+"?corpId="+corpId);
  98. window.open(url);
  99. });
  100. $("#fullScreen").on("click",function(){
  101. });
  102. });
  103. // 树节点单击方法
  104. function nodeNick(event, treeId, treeNode) {
  105. if (!treeNode.isParent) {
  106. $("#sel").val(treeNode.id);
  107. role = treeNode.parentId.split("_")[0];
  108. headType = treeNode.type;
  109. role1 = '"' + treeNode.parentId.split("_")[0] + '"';
  110. headType1 = '"' + treeNode.type + '"';
  111. showTitle(treeNode.name);
  112. totalShow(treeNode.id, role, treeNode.type);
  113. clearTime();
  114. }
  115. }
  116. // 初始化表格
  117. function init(cols) {
  118. g = null;
  119. g = $("#maingrid")
  120. .quiGrid(
  121. {
  122. columns : eval('(' + cols + ')'),
  123. data : testData,
  124. // data:eval('('+testData+')'),
  125. /*height : '90%',*/
  126. width : "100%",
  127. alternatingRow : false,
  128. rowAttrRender : function(rowdata, rowid) {
  129. return "总计" == rowdata.COMP_NAME ? "style=\"background-color:#f2f2f2;\""
  130. : '';
  131. },
  132. rownumbers : true,
  133. usePager : false,
  134. enabledSort : false,
  135. onAfterShowData:function(){
  136. setContentHeight();
  137. }
  138. });
  139. }
  140. function print() {
  141. var report_types = $("#sel").val();
  142. var flag = $("#show").is(":hidden");
  143. var selectDate = "";
  144. if (flag) {
  145. selectDate = $("#warningTime1").val();
  146. } else {
  147. selectDate = $("#dateSelect").val() + " " + $("#warningTime2").val();
  148. }
  149. var condition = "REPORT_ID = '" + fd_id + "'";
  150. var sql = {
  151. /*"listId" : findId(report_types),*/
  152. "condition" : condition,
  153. "report_type" : report_types,
  154. "date" : selectDate,
  155. "id" : corpId,
  156. "json" : JSON.stringify(g.getData()),
  157. "flag" : "huizong",
  158. "warning_number" : $("#warningNumber").attr("relText")
  159. };
  160. var Columns = findColumn(report_types);
  161. var columns_sub = Columns.substring(0, Columns.lastIndexOf(","));
  162. if ('7' == report_types) {
  163. printExcelExport("", sql, "导出" + $("#title").text(), [
  164. 'FD_OBJECTID', 'REPORT_ID', 'TEST', columns_sub ], $("#title")
  165. .text(), 'yjxy');
  166. } else {
  167. printExcelExport("", sql, "导出" + $("#title").text(), [
  168. 'FD_OBJECTID', 'REPORT_ID', 'TEST', columns_sub ], $("#title")
  169. .text(), 'report');
  170. }
  171. }
  172. /**
  173. * 获取报表表头
  174. * @param val 报表类型
  175. * @param type 报表分类(统计、明细)
  176. */
  177. function getColumns(val, type) {
  178. //alert(val+":"+type);
  179. var urls = $.pathname()
  180. + "/ws/xianlutingyun/XianlutingyunService/getHuizongColumns";
  181. $.ajax({
  182. url : urls,
  183. type : 'post',
  184. timeout : 15000,
  185. async : false,
  186. data : {
  187. report_type : val,
  188. type : type
  189. },
  190. dataType : 'text',
  191. success : function(data) {
  192. mycol = data;
  193. },
  194. error : function(e) {
  195. $.messager.alert('查询失败!', '访问服务失败!', 'error');
  196. }
  197. });
  198. }
  199. /**
  200. * 获取行信息
  201. * @param value 报表类型
  202. * @param roleId
  203. */
  204. function getRows(value, roleId) {
  205. testData = null;
  206. var urls = $.pathname() + "/ws/xianlutingyun/XianlutingyunService/huizong";
  207. $.ajax({
  208. url : urls,
  209. type : 'post',
  210. timeout : 15000,
  211. async : false,
  212. data : {
  213. comp_id : corpId,
  214. report_type : value,
  215. roleId : roleId
  216. },
  217. dataType : 'json',
  218. success : function(data) {
  219. testData = data;
  220. fd_id = data.rows[0].REPORT_ID;
  221. },
  222. error : function(e) {
  223. $.messager.alert('查询失败!', '访问服务失败!', 'error');
  224. }
  225. });
  226. }
  227. /**
  228. * 获取响应编号
  229. * @param url
  230. * @param params
  231. * @param type
  232. */
  233. function getProjectNames(url, params, type) {
  234. $.ajax({
  235. url : url,
  236. type : 'post',
  237. timeout : 15000,
  238. async : false,
  239. data : params,
  240. dataType : 'json',
  241. success : function(data) {
  242. if (type == "计划") {
  243. $("#warningNumber").data("data", data);
  244. $("#warningNumber").render();
  245. } else if (type == "时间") {
  246. // $("#dateSelect").val("");
  247. if (data[0].timeType == "周期性") {
  248. $("#show").show();
  249. $("#show1").hide();
  250. $("#show2").show();
  251. $("#warningTime2").data("data", data);
  252. $("#warningTime2").render();
  253. } else {
  254. $("#show").hide();
  255. $("#warningTime1").data("data", data);
  256. $("#warningTime1").render();
  257. $("#show1").show();
  258. $("#show2").hide();
  259. }
  260. }
  261. },
  262. error : function(e) {
  263. $.messager.alert('删除失败!', '删除失败!', 'error');
  264. }
  265. });
  266. }
  267. /**
  268. * 查询
  269. */
  270. function checkMsg() {
  271. var newDataurl = $.pathname()
  272. + "/ws/xianlutingyun/XianlutingyunService/huizong";
  273. var project = $("#warningNumber").val();
  274. exportId = project;
  275. var flag = $("#show2").is(":hidden");
  276. //临时性
  277. var protime1 = $("#warningTime1").val();
  278. var protime2 = $("#warningTime2").val();
  279. var date = $("#dateSelect").val();
  280. var newDataParams = "";
  281. var reportType = $("#sel").val();
  282. var newTjParams = "";
  283. if (reportType != "7") {
  284. if (project=="" && date=="") {
  285. top.Dialog.alert('请选择编号或者填报时间再查询');
  286. return;
  287. }
  288. if(project=="" && date!=""){
  289. if (headType == "xq") {
  290. newDataParams = {
  291. report_type : reportType,
  292. comp_id : corpId,
  293. warning_number : "",
  294. date : date,
  295. roleId : role
  296. };
  297. }else{
  298. newTjParams = {
  299. compId : corpId,
  300. report_type : reportType,
  301. report_id : "",
  302. date : date
  303. };
  304. }
  305. }else if (project != "") {
  306. var reportId = $("#warningNumber").attr("relValue");
  307. if(flag){
  308. selectDate = protime1;
  309. }else if(!flag && date==""){
  310. selectDate = protime2;
  311. }else{
  312. selectDate = $("#dateSelect").val() + " " + $("#warningTime2").val();
  313. }
  314. if (headType == "xq") {
  315. newDataParams = {
  316. report_type : reportType,
  317. comp_id : corpId,
  318. warning_number : reportId,
  319. date : selectDate,
  320. roleId : role
  321. };
  322. } else {
  323. newTjParams = {
  324. compId : corpId,
  325. report_type : reportType,
  326. report_id : reportId,
  327. date : selectDate
  328. };
  329. }
  330. }
  331. } else {
  332. var time1 = $("#time1").val();
  333. var time2 = $("#time2").val();
  334. var time3 = "";
  335. var totalTime = "";
  336. if (time1 == "") {
  337. top.Dialog.alert("请选择起始时间");
  338. return;
  339. } else if (time2 == "") {
  340. time3 = getNowFormatDate();
  341. totalTime = time1 + ";" + time3;
  342. } else if (time1 != "" && time2 != "") {
  343. totalTime = time1 + ";" + time2;
  344. }
  345. newDataParams = {
  346. report_type : reportType,
  347. date : totalTime,
  348. roleId : role
  349. };
  350. }
  351. if (headType == "xq") {
  352. getNewData(newDataurl, newDataParams);
  353. init(mycol);
  354. } else {
  355. tjInit(mycol, newTjParams);
  356. }
  357. };
  358. function getNewData(url, params) {
  359. $.ajax({
  360. url : url,
  361. type : 'post',
  362. timeout : 15000,
  363. async : false,
  364. data : params,
  365. dataType : 'json',
  366. success : function(data) {
  367. testData = data;
  368. fd_id = data.rows[0].REPORT_ID;
  369. },
  370. error : function(e) {
  371. $.messager.alert('查询失败!', '访问服务失败!', 'error');
  372. }
  373. });
  374. }
  375. function clearTime() {
  376. $("#warningNumber").render();
  377. $("#warningTime2").render();
  378. $("#dateSelect").val("");
  379. if ($("#show1").is(":hidden")) {
  380. $("#show1").show();
  381. $("#show2").hide();
  382. $("#show").hide();
  383. }
  384. }
  385. /**
  386. * 汇总查询页面-导出功能
  387. */
  388. function export_report() {
  389. var report_types = $("#sel").val();
  390. var flag = $("#show").is(":hidden");
  391. var selectDate = "";
  392. if (flag) {
  393. selectDate = $("#warningTime1").val();
  394. } else {
  395. selectDate = $("#dateSelect").val() + " " + $("#warningTime2").val();
  396. }
  397. var condition = "REPORT_ID = '" + fd_id + "'";
  398. var sql = {
  399. /*"listId" : findId(report_types),*/
  400. "condition" : condition,
  401. "report_type" : report_types,
  402. "date" : selectDate,
  403. "id" : corpId,
  404. "json" : JSON.stringify(g.getData()),
  405. "flag" : "huizong",
  406. "warning_number" : $("#warningNumber").attr("relText")
  407. };
  408. var Columns = findColumn(report_types);
  409. var columns_sub = Columns.substring(0, Columns.lastIndexOf(","));
  410. if ('7' == report_types) {
  411. excelExport("", sql, "导出" + $("#title").text(), [
  412. 'FD_OBJECTID', 'REPORT_ID', 'TEST', columns_sub ], $("#title")
  413. .text(), 'yjxy');
  414. } else {
  415. excelExport("", sql, "导出" + $("#title").text(), [
  416. 'FD_OBJECTID', 'REPORT_ID', 'TEST', columns_sub ], $("#title")
  417. .text(), 'report');
  418. }
  419. }
  420. /**
  421. * 查询报表中不可用的字段
  422. * @param type 报表类型
  423. * @returns {String}
  424. */
  425. function findColumn(type) {
  426. var column = "";
  427. $.ajax({
  428. url : $.pathname() + "/ws/getReportId/ExportExcelService/getColumn",
  429. type : 'post',
  430. timeout : 15000,
  431. async : false,
  432. data : {
  433. report_type : type
  434. },
  435. dataType : 'json',
  436. success : function(data) {
  437. for (var i = 0; i < data.rows.length; i++) {
  438. column += data.rows[i].TABLE_COLUMN + ",";
  439. }
  440. },
  441. error : function(e) {
  442. $.messager.alert('获取列失败!', '访问服务失败!', 'error');
  443. }
  444. });
  445. return column;
  446. }
  447. function showDetail(Goindex, name, val, display, comp) {
  448. if (val == "未填报" || val == "0") {
  449. return;
  450. }
  451. else {
  452. var showType = $("#sel").val();
  453. if (showType == "1" || showType == "3" || showType == "5"
  454. || showType == "8" || showType=="4" || showType == "101") {
  455. if (showType == "8") {
  456. if (display.indexOf("人") == -1) {
  457. return;
  458. }
  459. }
  460. if (comp == "总计") {
  461. Goindex = "";
  462. var totalData = testData;
  463. if (totalData != "") {
  464. for (var i = 0; i < totalData["rows"].length - 1; i++) {
  465. Goindex += "'" + totalData["rows"][i]["FD_OBJECTID"]
  466. + "',";
  467. }
  468. Goindex = Goindex.substring(0, Goindex.lastIndexOf(","));
  469. }
  470. }
  471. var diag = new parent.Dialog();// 定义一个窗口对象
  472. diag.Top = 10;
  473. diag.Title = "详情查看";// 窗口标题
  474. diag.URL = "/nwyj/page/business/em/report/Data/Report1.html";// 窗口对应的页面
  475. diag.Height = 590;
  476. diag.Width = 1150;
  477. diag.showOkButton = false;
  478. diag.showCancelButton = false;
  479. diag.CancelEvent = function(){
  480. //$(parent.document.body).find("#frmright").height(bodyheight+30);
  481. $(parent.document.body).find("#frmrightChild").height($(window.document.body).height()+30);
  482. $(top.document.body).find("#frmright").height($(parent.document.body).height()+30);
  483. diag.close();
  484. };
  485. diag.ShowMaxButton = true;
  486. diag.show();// 显示窗口
  487. /**/
  488. diag.OnLoad = function() {
  489. diag.innerFrame.contentWindow.showDeatilMsg(Goindex, name,
  490. showType, display, comp);
  491. };
  492. }
  493. }
  494. return false;
  495. }
  496. function showMsg(rowdata, rowindex, value, column) {
  497. var display = column.display.replace("\<br\/\>", '');
  498. if (value == undefined || value == "undefined") {
  499. value = "";
  500. }
  501. return '<a href="javascript:void(0)" ' + 'title="'+value+'"' + 'onclick=showDetail("'
  502. + rowdata.FD_OBJECTID + '",' + '"' + column.name + '",' + '"'
  503. + value + '",' + '"' + display + '",' + '"' + rowdata.COMP_NAME
  504. + '")>' + value + '</a>';
  505. }
  506. // 跳转方法
  507. function _addStatus(rowdata, rowindex, value, column) {
  508. if (value == undefined || value == "undefined") {
  509. value = "";
  510. }
  511. var comp_id = '"' + rowdata.COMP_ID + '"';
  512. var name = '"' + value + '"';
  513. if ($("#sel").val() == "1") {
  514. if (rowdata.COMP_NAME == "总计") {
  515. return " <div style='background-color: #f2f2f2;font-color:white'><a href='javascript:newHtml("
  516. + comp_id
  517. + ","
  518. + name
  519. + ","
  520. + role1
  521. + ","
  522. + headType1
  523. + ")'>" + value + " </a></div>";
  524. } else {
  525. return " <div style='background-color: #dde5f0;'><a href='javascript:newHtml("
  526. + comp_id
  527. + ","
  528. + name
  529. + ","
  530. + role1
  531. + ","
  532. + headType1
  533. + ")'" +"title='"+value+"'>" + value + " </a></div>";
  534. }
  535. } else {
  536. if (rowdata.COMP_NAME == "总计") {
  537. return " <div style='background-color: #f2f2f2;font-color:white'><a href='javascript:newHtml1("
  538. + comp_id
  539. + ","
  540. + name
  541. + ","
  542. + role1
  543. + ","
  544. + headType1
  545. + ")'>" + value + " </a></div>";
  546. } else {
  547. return " <div style='background-color: #dde5f0;'><a href='javascript:newHtml1("
  548. + comp_id
  549. + ","
  550. + name
  551. + ","
  552. + role1
  553. + ","
  554. + headType1
  555. + ")'" +"title='"+value+"'>" + value + " </a></div>";
  556. }
  557. }
  558. }
  559. function getAlertMsg(comp_id) {
  560. window
  561. .open("/nwyj/page/business/em/report/baobiaoye/Report_Line_StoppageAndRecovery2.jsp?compId="
  562. + comp_id
  563. + "&reportType=7&compName&role="
  564. + role
  565. + "&headType=" + headType);
  566. }
  567. // 跳转页面
  568. function newHtml(comp_id, name, role, headType) {
  569. if (name == "总计") {
  570. return;
  571. } else {
  572. if (comp_id != corpId) {
  573. var goType = $("#sel").val();
  574. var url = "/nwyj/page/business/em/report/baobiaoye/Report_Line_StoppageAndRecovery1.jsp?compId="
  575. + comp_id
  576. + "&reportType="
  577. + goType
  578. + "&compName="
  579. + encodeURI(encodeURI(name))
  580. + "&role="
  581. + role
  582. + "&headType=" + headType;
  583. window.open(url);
  584. }
  585. }
  586. }
  587. function newHtml1(comp_id, name, role, headType) {
  588. if (name == "总计") {
  589. return;
  590. } else {
  591. if (comp_id != corpId) {
  592. var goType = $("#sel").val();
  593. window
  594. .open("/nwyj/page/business/em/report/baobiaoye/Report_Line_StoppageAndRecovery1.jsp?compId="
  595. + comp_id
  596. + "&reportType="
  597. + goType
  598. + "&compName="
  599. + encodeURI(encodeURI(name))
  600. + "&role="
  601. + role
  602. + "&headType=" + headType);
  603. }
  604. }
  605. }
  606. function checkYJ(rowdata, rowindex, value, column) {
  607. var compLevel = '';
  608. if ("网公司" == value) {
  609. compLevel = '1';
  610. }
  611. if ("省公司" == value) {
  612. compLevel = '2';
  613. }
  614. if ("地市局" == value) {
  615. compLevel = '3';
  616. }
  617. if ("县区局" == value) {
  618. compLevel = '4';
  619. }
  620. // return '1111';
  621. return " <div style='background-color: #dde5f0;'><a href='javascript:getAlertMsg("
  622. + compLevel + ")'"+"title='"+value+"'"+">" + value + " </a></div>";
  623. }
  624. var stat = "xq";
  625. //var typeStat = "";
  626. function totalShow(val, roleId, type) {
  627. $("body").eq(0).showLoading();
  628. if(type=="xq" && val!="7"){
  629. $("#compare").show();
  630. }else{
  631. $("#compare").hide();
  632. }
  633. var params = getParams(roleId,val);
  634. getProjectNames(Prourl, params, "计划");
  635. /*if (typeStat != val) {*/
  636. getColumns(val, type);// 获取表头
  637. /*}*/
  638. if (type == "xq") {
  639. /*if (typeStat != val) {*/
  640. getRows(val, roleId);// 获取行
  641. init(mycol);// 初始化表格
  642. //typeStat = val;
  643. /*}
  644. */
  645. if (stat == "") {
  646. stat = "xq";
  647. }
  648. /*if ($("#exportMsg").is(":hidden")) {
  649. $("#exportMsg").show();
  650. $("#compare").show();
  651. }*/
  652. $("#maingrid").show();
  653. $("#maingridx").hide();
  654. } else {
  655. /* var reportT = $("#sel").val(); */
  656. var Initparams = {
  657. compId : corpId,
  658. report_type : val,
  659. report_id : "",
  660. date : ""
  661. };
  662. /* if (typeStat != val) {*/
  663. tjInit(mycol, Initparams);
  664. //var params = getParams(roleId);
  665. /**/
  666. //getProjectNames(Prourl, params, "计划");
  667. //typeStat = val;
  668. /*}*/
  669. /*if (!$("#exportMsg").is(":hidden")) {
  670. $("#compare").hide();
  671. $("#exportMsg").hide();
  672. }*/
  673. $("#maingrid").hide();
  674. $("#maingridx").show();
  675. stat = "";
  676. }
  677. if (val == "7") {
  678. /*$("._buttons").css("top","55px");*/
  679. $(".showWarn").hide();
  680. $("#hideWarn").show();
  681. var timeVal = $("#time1").val();
  682. var timeVal2 = $("#time2").val();
  683. if (timeVal) {
  684. $("#time1").val("");
  685. }
  686. if (timeVal2) {
  687. $("#time2").val("");
  688. }
  689. } else {
  690. $(".showWarn").show();
  691. $("#hideWarn").hide();
  692. }
  693. $("body").eq(0).hideLoading();
  694. }
  695. function showTitle(val) {
  696. $("#title").html("");
  697. $("#title").html(corpName + val);
  698. }
  699. /**
  700. * 明细表初始化
  701. * @param cols 表头
  702. * @param Initparams
  703. */
  704. function tjInit(cols, Initparams) {
  705. g = null;
  706. g = $("#maingridx")
  707. .quiGrid(
  708. {
  709. columns : eval('(' + cols + ')'),
  710. url : $.pathname()
  711. + "/ws/ReportHuiZong/HuiZongService/getSearchResult",
  712. params : Initparams,
  713. /*height : '95%',*/
  714. width : "100%",
  715. percentWidthMode : true,
  716. usePager : false,
  717. enabledSort : false,
  718. groupColumnName : "COMP_NAME",
  719. groupRender : function(groupValue, groupData,
  720. groupColumnDisplay) {
  721. var reportDeptId = '"' + groupData[0].COMP_ID + '"';
  722. var reportComp = '"' + groupData[0].COMP_NAME + '"';
  723. var checkLevel = getThing($.pathname() +"/ws/ReportHuiZong/HuiZongService/checkLevel",{compId:groupData[0].COMP_ID},'text');
  724. if(checkLevel=="true"){
  725. text = "<span id='groupValue' class='groupValue' title='点击钻取' onclick=showDeptMsg("+reportDeptId+","+reportComp+")>填报部门:"+groupValue+"</span>";
  726. }else{
  727. text = "<span id='groupValue' class='groupValue'>填报部门:"+groupValue+"</span>";
  728. }
  729. return text;
  730. },
  731. onAfterShowData:function(){
  732. setContentHeight();
  733. }
  734. });
  735. // setContentHeight();
  736. }
  737. function showDeptMsg(id, name) {
  738. var reportT = $("#sel").val();
  739. window
  740. .open("/nwyj/page/business/em/report/baobiaoye/Report_Line_StoppageAndRecovery1.jsp?compId="
  741. + id
  742. + "&reportType="
  743. + reportT
  744. + "&compName="
  745. + encodeURI(encodeURI(name))
  746. + "&role="
  747. + role
  748. + "&headType=" + headType);
  749. }
  750. function checkExpand(event, treeId, treeNode){
  751. if(treeNode["flag"]=="true"){
  752. var treeObj = $.fn.zTree.getZTreeObj("reportTree");
  753. var allData = treeObj.getNodes();
  754. for(var i=0;i<allData.length;i++){
  755. var childNode = allData[i];
  756. if(childNode["open"]=="true" || childNode["open"]==true){
  757. if(childNode["id"]!=treeNode.id){
  758. treeObj.expandNode(childNode,false);
  759. break;
  760. }
  761. }
  762. }
  763. }
  764. }
  765. function getParams(roleId,report_type){
  766. var params = "";
  767. if ("8F6F2D6B24494CB6B1F1E0931E7AF87D" == corpId) {
  768. params = {
  769. compId : corpId,
  770. roleId : "",
  771. report_type:report_type
  772. };
  773. } else {
  774. params = {
  775. compId : corpId,
  776. roleId : roleId,
  777. report_type:report_type
  778. };
  779. }
  780. return params;
  781. }
  782. function setContentHeight(){
  783. $("#plan_detail").height($("#maingrid").height()+200);
  784. var contentHeight = $("#plan_detail").height();
  785. var height = contentHeight+30;
  786. $(window.document.body).find("#layout1").height(height);
  787. $(top.document.body).find("#frmright").height(height);
  788. }