9538bda8e5c9f6060d2378c2e676ac45a0e20754.svn-base 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. //var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  2. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  3. //数据表格
  4. var g;
  5. var myCols = [{
  6. display: '企业公文', name: 'enpdoc', width: "20%", align: 'center'
  7. },{
  8. display: '企业制度 ', name: 'enpsys', width: "20%", align: 'center'
  9. },{
  10. display: '其它', name: 'enpard', width: "20%", align: 'center'
  11. }];
  12. var columns = [{display : '所属单位',"name" : 'name',id : 'name',width : "20%",dept_id:'dept_id',align : 'center',render: addStatus},
  13. {display: '企业公文分类', columns: myCols, width: "60%"},
  14. {display: '合计', name: 'num', width: "20%", align: 'center'}
  15. ];
  16. var json ="";
  17. var loadData;
  18. //柱状图
  19. var option = {
  20. title : {
  21. text: '企业公文统计图',
  22. subtext: '/条'
  23. },
  24. tooltip : {
  25. trigger: 'axis'
  26. },
  27. legend: {
  28. y : 'bottom',
  29. data:['企业公文','企业制度','其它']
  30. },
  31. toolbox: {
  32. show : true,
  33. feature : {
  34. mark : {show: true},
  35. dataView : {show: true, readOnly: false},
  36. magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
  37. restore : {show: true},
  38. saveAsImage : {show: true}
  39. }
  40. },
  41. calculable : true,
  42. xAxis : [
  43. {
  44. type : 'category',
  45. data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
  46. }
  47. ],
  48. yAxis : [
  49. {
  50. type : 'value'
  51. }
  52. ],
  53. series : [
  54. {
  55. name:'企业公文',
  56. type:'bar',
  57. data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3]
  58. },
  59. {
  60. name:'企业制度',
  61. type:'bar',
  62. data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
  63. },
  64. {
  65. name:'其它',
  66. type:'bar',
  67. data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
  68. }
  69. ]
  70. };
  71. function changeBarOption(data){
  72. var legendData=[];
  73. var seriesData=[];
  74. var data1=[];
  75. var data2=[];
  76. var data3=[];
  77. for(var i=0;i<data.rows.length-1;i++){
  78. //alert(data.rows[i].name);
  79. legendData[i]=data.rows[i].name;
  80. data1[i]=data.rows[i].enpdoc;
  81. data2[i]=data.rows[i].enpsys;
  82. data3[i]=data.rows[i].enpard;
  83. }
  84. var series1={ name:'企业公文',
  85. type:'bar',
  86. data:data1
  87. };
  88. var series2={ name:'企业制度',
  89. type:'bar',
  90. data:data2
  91. };
  92. var series3={ name:'其它',
  93. type:'bar',
  94. data:data3
  95. };
  96. seriesData=[series1,series2,series3];
  97. option.xAxis[0].data=legendData;
  98. option.series=seriesData;
  99. }
  100. function changeBarOption2(data){
  101. var legendData=[];
  102. var seriesData=[];
  103. var data1=[];
  104. var data2=[];
  105. var data3=[];
  106. for(var i=0;i<data.rows.length-1;i++){
  107. //alert(data.rows[i].name);
  108. legendData[i]=data.rows[i].name;
  109. data1[i]=data.rows[i].enpdoc;
  110. data2[i]=data.rows[i].enpsys;
  111. data3[i]=data.rows[i].enpard;
  112. }
  113. var series1={ name:'企业公文',
  114. type:'bar',
  115. data:data1
  116. };
  117. var series2={ name:'企业制度',
  118. type:'bar',
  119. data:data2
  120. };
  121. var series3={ name:'其它',
  122. type:'bar',
  123. data:data3
  124. };
  125. //seriesData=[series1,series2,series3,series4,series5];
  126. option.legend.data=$("#CLASSES_241").attr("relText").split(",");
  127. var getInput=$("#CLASSES_241").attr("relText").split(",");
  128. var j=0;
  129. if($.inArray('企业公文',getInput)!=-1){
  130. seriesData[j]=series1;
  131. j++;
  132. }
  133. if($.inArray('企业制度',getInput)!=-1){
  134. seriesData[j]=series2;
  135. j++;
  136. }
  137. if($.inArray('其它',getInput)!=-1){
  138. seriesData[j]=series3;
  139. j++;
  140. }
  141. option.xAxis[0].data=legendData;
  142. option.series=seriesData;
  143. }
  144. //折线图option1
  145. var option1 = {
  146. title : {
  147. text: '企业公文统计图',
  148. subtext: '/条'
  149. },
  150. tooltip : {
  151. trigger: 'axis'
  152. },
  153. legend: {
  154. y:'bottom',
  155. data:['企业公文','企业制度','其它']
  156. },
  157. toolbox: {
  158. show : true,
  159. feature : {
  160. mark : {show: true},
  161. dataView : {show: false, readOnly: false},
  162. magicType : {show: false, type: ['line', 'bar', 'stack', 'tiled']},
  163. restore : {show: true},
  164. saveAsImage : {show: true}
  165. }
  166. },
  167. calculable : true,
  168. xAxis : [
  169. {
  170. type : 'category',
  171. boundaryGap : false,
  172. data : ['总体预案','专项预案','现场处置方案','部门预案']
  173. }
  174. ],
  175. yAxis : [
  176. {
  177. type : 'value'
  178. }
  179. ],
  180. series : [
  181. {
  182. name:'企业公文',
  183. type:'line',
  184. data:[20, 30, 50,40]
  185. },
  186. {
  187. name:'企业制度',
  188. type:'line',
  189. data:[10, 18, 19, 24]
  190. },
  191. {
  192. name:'其它',
  193. type:'line',
  194. data:[15, 22, 20, 15]
  195. }
  196. ]
  197. };
  198. function changeLineOption(data){
  199. var legendData=[];
  200. var seriesData=[];
  201. var data1=[];
  202. var data2=[];
  203. var data3=[];
  204. for(var i=0;i<data.rows.length-1;i++){
  205. //alert(data.rows[i].name);
  206. legendData[i]=data.rows[i].name;
  207. data1[i]=data.rows[i].enpdoc;
  208. data2[i]=data.rows[i].enpsys;
  209. data3[i]=data.rows[i].enpard;
  210. }
  211. var series1={ name:'企业公文',
  212. type:'line',
  213. data:data1
  214. };
  215. var series2={ name:'企业制度',
  216. type:'line',
  217. data:data2
  218. };
  219. var series3={ name:'其它',
  220. type:'line',
  221. data:data3
  222. };
  223. seriesData=[series1,series2,series3];
  224. option1.xAxis[0].data=legendData;
  225. option1.series=seriesData;
  226. }
  227. function changeLineOption2(data){
  228. var legendData=[];
  229. var seriesData=[];
  230. var data1=[];
  231. var data2=[];
  232. var data3=[];
  233. var data4=[];
  234. for(var i=0;i<data.rows.length-1;i++){
  235. //alert(data.rows[i].name);
  236. legendData[i]=data.rows[i].name;
  237. data1[i]=data.rows[i].enpdoc;
  238. data2[i]=data.rows[i].enpsys;
  239. data3[i]=data.rows[i].enpard;
  240. }
  241. var series1={ name:'企业公文',
  242. type:'line',
  243. data:data1
  244. };
  245. var series2={ name:'企业制度',
  246. type:'line',
  247. data:data2
  248. };
  249. var series3={ name:'其它',
  250. type:'line',
  251. data:data3
  252. };
  253. option1.legend.data=$("#CLASSES_241").attr("relText").split(",");
  254. var getInput=$("#CLASSES_241").attr("relText").split(",");
  255. var j=0;
  256. if($.inArray('企业公文',getInput)!=-1){
  257. seriesData[j]=series1;
  258. j++;
  259. }
  260. if($.inArray('企业制度',getInput)!=-1){
  261. seriesData[j]=series2;
  262. j++;
  263. }
  264. if($.inArray('其它',getInput)!=-1){
  265. seriesData[j]=series3;
  266. j++;
  267. }
  268. //seriesData=[series1,series2,series3,series4,series5];
  269. option1.xAxis[0].data=legendData;
  270. option1.series=seriesData;
  271. }
  272. //饼图option2
  273. var option2 = {
  274. title : {
  275. text: '企业公文统计图',
  276. subtext: '/条'
  277. },
  278. tooltip : {
  279. trigger: 'item',
  280. formatter: "{a} <br/>{b} : {c} ({d}%)"
  281. },
  282. legend: {
  283. y : 'bottom',
  284. data:['企业公文','企业制度','其它']
  285. },
  286. toolbox: {
  287. show : true,
  288. feature : {
  289. mark : {show: true},
  290. dataView : {show: false, readOnly: false},
  291. magicType : {
  292. show: false,
  293. type: ['pie', 'funnel'],
  294. option: {
  295. funnel: {
  296. x: '25%',
  297. width: '50%',
  298. funnelAlign: 'left',
  299. max: 1548
  300. }
  301. }
  302. },
  303. restore : {show: true},
  304. saveAsImage : {show: true}
  305. }
  306. },
  307. calculable : true,
  308. series : [
  309. {
  310. name:'企业公文信息',
  311. type:'pie',
  312. radius : '55%',
  313. center: ['50%', '55%'],
  314. data:[
  315. {value:335, name:'企业公文'},
  316. {value:310, name:'企业制度'},
  317. {value:234, name:'其它'}
  318. ]
  319. }
  320. ]
  321. };
  322. function changePieOption3(data){
  323. //option2.legend.data=['总体预案','专项预案','现场处置方案','部门预案'];
  324. option2.legend.data=$("#CLASSES_241").attr("relText").split(",");
  325. var getInput=$("#CLASSES_241").attr("relText").split(",");
  326. var index=data.rows.length-1;
  327. var seriesJson=[];
  328. var j=0;
  329. if($.inArray('企业公文',getInput)!=-1){
  330. var json={value:data.rows[index]["enpdoc"],name:'企业公文'};
  331. seriesJson[j]=json;
  332. j++;
  333. }
  334. if($.inArray('企业制度',getInput)!=-1){
  335. var json={value:data.rows[index]["enpsys"],name:'企业制度'};
  336. seriesJson[j]=json;
  337. j++;
  338. }
  339. if($.inArray('其它',getInput)!=-1){
  340. var json={value:data.rows[index]["enpard"],name:'其它'};
  341. seriesJson[j]=json;
  342. j++;
  343. }
  344. option2.series[0].data=seriesJson;
  345. }
  346. function changePieOption2(data){
  347. /*************************************************** 初始化解析饼图数据 start**********************************************************/
  348. //option2.legend.data=['总体预案','专项预案','现场处置方案','部门预案'];
  349. var index=data.rows.length-1;
  350. var seriesJson=[];
  351. var j=0;
  352. if(data.rows[index]["enpdoc"]!=undefined){
  353. var json={value:data.rows[index]["enpdoc"],name:'企业公文'};
  354. seriesJson[j]=json;
  355. j++;
  356. }
  357. if(data.rows[index]["enpsys"]!=undefined){
  358. var json={value:data.rows[index]["enpsys"],name:'企业制度'};
  359. seriesJson[j]=json;
  360. j++;
  361. }
  362. if(data.rows[index]["enpard"]!=undefined){
  363. var json={value:data.rows[index]["enpard"],name:'其它'};
  364. seriesJson[j]=json;
  365. j++;
  366. }
  367. option2.series[0].data=seriesJson;
  368. /*************************************************** 初始化解析饼图数据 end **********************************************************/
  369. }
  370. //初始化方法
  371. $(function(){
  372. $("body").eq(0).showLoading();
  373. $.post($.pathname()+ "/ws/DOCUPOLL/DocService/getDocu",{id : deptName},function (data){
  374. json = data;
  375. //给表格数据赋值
  376. loadData= data;
  377. //初始化表格
  378. initCompletes(json);
  379. $("body").eq(0).hideLoading();
  380. changeBarOption(data);
  381. changeLineOption(data);
  382. changePieOption2(data);
  383. var myChart1 = echarts.init(document.getElementById('main1'));
  384. myChart1.setOption(option);
  385. $(".basicTab").bind('actived',function(e,i){
  386. if(i==0){
  387. /***************************************** 加载柱状图 *********************************************************/
  388. var myChart1 = echarts.init(document.getElementById('main1'));
  389. myChart1.setOption(option);
  390. // initmyGraphic(data);
  391. }else if(i == 1){
  392. /***************************************** 加载折线图 *********************************************************/
  393. var myChart5 = echarts.init(document.getElementById('main2'));
  394. myChart5.setOption(option1);
  395. }else if(i==2){
  396. /***************************************** 加载饼图 *********************************************************/
  397. var myChart2 = echarts.init(document.getElementById('main3'));
  398. myChart2.setOption(option2);
  399. }
  400. });
  401. },"json" );
  402. });
  403. function initCompletes(json){
  404. g = $("#maingrid").quiGrid({
  405. columns: columns,
  406. data:json,
  407. rownumbers : true,
  408. usePager : false
  409. });
  410. //重设高度
  411. $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
  412. $(top.document.body).find("iframe").height($(window.document.body).height()+30);
  413. /*重新绑定父页面事件方法*/
  414. //绑定点击时样式变化事件
  415. $(parent.document.body).find(".leftnav").live("click",parent.checkedCurrent);
  416. //定期报送组点击事件
  417. $(parent.document.body).find(".baosong").live("click",parent.changebaosong);
  418. //定期维护组点击事件
  419. $(parent.document.body).find(".weihu").live("click",parent.changeweihu);
  420. $(parent.document.body).find(".weihu1").live("click",parent.changeweihu1);
  421. /*重新绑定父页面事件方法*/
  422. }
  423. function addStatus(rowdata, rowindex, value, column){
  424. if("总计"==rowdata.name || deptName==rowdata.dept_id){
  425. return value;
  426. }else{
  427. var comp_id='"'+rowdata.dept_id+'"';
  428. var name = '"'+value+'"';
  429. return "<a href='javascript:newHtml("+comp_id+","+name+")'>" + value +" </a>";
  430. }
  431. }
  432. function newHtml(comp_id,name){
  433. if(name=="总计"){
  434. return;
  435. }else if(deptName==comp_id){
  436. return;
  437. }else{
  438. // window.open("/nwyj/page/business/am/fileManager/document/document_poll1.jsp?"+comp_id);
  439. $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/document/document_poll1.jsp?"+comp_id);
  440. }
  441. }
  442. //返回
  443. function goBack() {
  444. window.location.href="document.jsp";
  445. }
  446. //重置
  447. function resetSearch(){
  448. document.location.reload();
  449. }
  450. function export_report() {
  451. var sql = {
  452. "report_type" : "qywj",
  453. "json" : JSON.stringify(g.getData())
  454. };
  455. excelExport(undefined, sql, "企业文件信息统计", ['dept_id', 'isParent', 'open'], "企业文件信息统计", 'rcpoll');
  456. }
  457. $.messager=top.Dialog;
  458. /**************************************查询*******************************************/
  459. //发送请求,从后台获取数据
  460. function getNewValue(){
  461. //印发日期
  462. var pushStartTime = $('#beginTime1').val();
  463. var pushEndTime = $('#endTime1').val();
  464. //保密级别
  465. var mimi = $('#SECRECY_LEVEL_241').attr("relValue");
  466. //状态
  467. var level = $('#STATE_241').attr("relValue");
  468. //分类
  469. var chunengType = $('#CLASSES_241').attr("relValue");
  470. //取所属单位
  471. var units = $('#UNITE_241').val();
  472. //保密级别
  473. var mimiLevel = null;
  474. if(mimi.length>0){
  475. var temp0 = mimi.split(",");
  476. var tempLevel0="";
  477. for(var i=0; i<temp0.length; i++){
  478. tempLevel0 +="'"+ temp0[i] + "',";
  479. }
  480. mimiLevel = tempLevel0.substring(0,tempLevel0.length-1);
  481. }
  482. //状态
  483. var tempLevel = null;
  484. if(level.length>0){
  485. var temp = level.split(",");
  486. var tempLevel1="";
  487. for(var i=0; i<temp.length; i++){
  488. tempLevel1 +="'"+ temp[i] + "',";
  489. }
  490. tempLevel = tempLevel1.substring(0,tempLevel1.length-1);
  491. }
  492. //分类转换
  493. var temp2 = chunengType.split(",");
  494. var valueType1 = "";
  495. for(var i=0; i<temp2.length; i++){
  496. if(temp2[i]=="enpdoc"){
  497. valueType1+= "'" + "1" +"'" +",";
  498. }
  499. if(temp2[i]=="enpsys"){
  500. valueType1+= "'" + "2" +"'" +",";
  501. }
  502. if(temp2[i]=="enpard"){
  503. valueType1+= "'" + "3" +"'" +",";
  504. }
  505. }
  506. var valueType = null;
  507. if(chunengType.length>0){
  508. valueType = valueType1.substring(0,valueType1.length-1);
  509. }
  510. //单位整理
  511. var leng = units.length;
  512. var deptId = null;
  513. if(leng>0){
  514. var deptIdsTemp = units.split(",");
  515. var arrFF = "";
  516. for(var i=0; i<deptIdsTemp.length; i++){
  517. arrFF+="'"+deptIdsTemp[i]+"'"+",";
  518. }
  519. deptId = arrFF.substring(0,arrFF.length-1);
  520. }
  521. $.post($.pathname()+ "/ws/DOCUPOLL/DocService/getDocu",
  522. {id : deptName,StartTime:pushStartTime,EndTime:pushEndTime,mimiLevel:mimiLevel,tempLevel:tempLevel,valueType:valueType,deptId:deptId},
  523. function (data){
  524. json = data;
  525. //给表格数据赋值
  526. loadData= data;
  527. //初始化表格
  528. initCompletes(json);
  529. changeBarOption(data);
  530. changeLineOption(data);
  531. changePieOption2(data);
  532. var myChart1 = echarts.init(document.getElementById('main1'));
  533. myChart1.setOption(option);
  534. $(".basicTab").bind('actived',function(e,i){
  535. if(i==0){
  536. /***************************************** 加载柱状图 *********************************************************/
  537. var myChart1 = echarts.init(document.getElementById('main1'));
  538. myChart1.setOption(option);
  539. // initmyGraphic(data);
  540. }else if(i == 1){
  541. /***************************************** 加载折线图 *********************************************************/
  542. var myChart5 = echarts.init(document.getElementById('main2'));
  543. myChart5.setOption(option1);
  544. }else if(i==2){
  545. /***************************************** 加载饼图 *********************************************************/
  546. var myChart2 = echarts.init(document.getElementById('main3'));
  547. myChart2.setOption(option2);
  548. }
  549. });
  550. },"json" );
  551. }
  552. //点击统计按钮触发的事件
  553. function getCount(){
  554. getNewValue();
  555. //状态
  556. var level = $('#STATE_241').attr("relValue");
  557. //分类
  558. var chunengType = $('#CLASSES_241').attr("relValue");
  559. //取所属单位
  560. var units = $('#UNITE_241').val();
  561. var column = level + "," + chunengType + "," + units;
  562. var temp = column.split(",");
  563. var column1 = "";
  564. for(var i=0; i<temp.length; i++){
  565. column1+=temp[i]+ ",";
  566. }
  567. //所属单位
  568. var url=$.pathname()+ "/ws/Amyjyan/AmyjyanCount/getEditColumns";
  569. $.ajax({
  570. url : url,
  571. type : 'post',
  572. timeout : 15000,
  573. async : false,
  574. data : {
  575. name : "EMC_AM_BUSINESS_DOCUMENT",column:chunengType+","
  576. },
  577. dataType : 'text',
  578. success : function(data) {
  579. columns=eval('('+ data+')');
  580. //给表格数据赋值
  581. loadData= eval('('+ data+')');
  582. //初始化表格
  583. initCompletes(json);
  584. },
  585. error : function(e) {
  586. $.messager.alert('查询表头失败!', '访问服务失败!', 'error');
  587. }
  588. });
  589. }