123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- /**
- * 功能:
- *
- *
- * @author HXB
- * @date 2015/09/18
- */
- //部门id
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- //部门名称
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
- var _this = this;
- _this.listGrid = null;// 数据列表
- ReportInputPlan = function() {
- /** 定义变量* */
-
- _this.searchPanel = null; // 查询面板
- $queryForm = null;// 查询区域表单
- $searchButt = null;// 查询按钮
- $more = null; // 更多
- _this.loadParams = null;// 列表加载参数
- /** 私有方法* */
-
- // // 查询
- // function search(obj) {
- // //var queryFormValue = $queryForm.serialize();
- // var area_id = $("#GPS_AREA_ID_610_show").val();
- // var year = $("#GPS_YEAR_610").attr("reltext");
- // var endtime = $("#END_TIME_610").attr("reltext");
- // var month = $("#GPS_MONTH").attr("reltext");
- // /**********表格头部*****************/
- // year = !year?"":year;
- // endtime = !endtime?"":endtime;
- // month = !month?"":month;
- // var penelTitle = "";
- // var title = "保供电任务统计表";
- // if(month==""){
- // penelTitle = area_id + " "+title +"("+ year + "年" + endtime +")";
- // }else{
- // penelTitle = area_id + " "+title +"("+ year + "年" + month +"月)";
- // }
- // $("#searchPanel1").attr("panelTitle",penelTitle);
- // $("#searchPanel1").render();
- // /**********表格头部*****************/
- // var queryParams = getQueryFormParams($queryForm);
- // var params = concatJson({}, [ _this.loadParams, queryParams ]);
- // var dept_id = params.GPS_AREA_ID_610;
- // var year = params.GPS_YEAR_610;
- // var endtime = params.END_TIME_610;
- // var month = params.GPS_MONTH;
- // queryTask(dept_id,year,endtime,month);
- // /*_this.listGrid.setNewPage(1);
- // _this.listGrid.loadData();// 加载数据*/
- // }
-
-
- // 查询
- function search(obj) {
- var area_id = $("#GPS_AREA_ID_610_show").val();
- var startime = $("#beginTime").val();
- var endTime = $("#endTime").val();
- if(startime==""){
- startime = getDateTime();
- $("#beginTime").val(startime);
- }
- if(endTime==""){
- endTime = getDateTime();
- $("#endTime").val(endTime);
- }
- if(startime>endTime){
- top.Dialog.alert("任务时间选择不正确,开始日期应小于结束日期!");
- return;
- }
- /**********表格头部*****************/
- var penelTitle = "";
- var title = "保供电任务统计表";
- penelTitle = area_id + " "+title +"("+ startime + " ~ " + endTime +")";
- $("#searchPanel1").attr("panelTitle",penelTitle);
- $("#searchPanel1").render();
- /**********表格头部*****************/
- var dept_id = $("#GPS_AREA_ID_610").val();
- queryTask(dept_id,startime,endTime);
- }
-
-
- /***
- * 导出
- */
- function exportGridData() {
- var titlte = $("#searchPanel1").attr("panelTitle");
- var winname = window.open('', '_blank', 'top=10000');
- //获得页面上需要导出的数据内容
- var strHTML = document.all.grid.innerHTML; //其中tableExcel是需要导出数据的div的id或者表的id
- winname.document.open('text/html', 'replace');
- winname.document.writeln(strHTML);
- winname.document.execCommand('saveas','',titlte+'.xls'); //excel是导出excel的默认名称
- winname.close();
- };
- /**
- * 打印
- */
- function printGridData() {
- $("#searchPanel1").jqprint();
- };
- return {
- init : function() {
- $queryForm = $("#queryForm");
- /** 绑定查询面板的按钮点击事件* */
- $searchButt = $("#searchButt");// 查询按钮
- $searchButt.bind('click', function() {
- search();
- });
- $("#exportButt").bind('click', function() {
- exportGridData();
- });
- $("#PrintButt").bind('click', function() {
- printGridData();
- });
- $("#toMXButt").bind('click', function() {
- $(top.document.body).find("iframe").attr("src","/nwyj/page/business/gps/queryStatistics/list/quaryStatic.jsp");
- });
- /*// 列表加载参数
- _this.loadParams = {
- "GPS_AREA_ID_610" : deptId,
- "GPS_YEAR_610" : currDate,
- "END_TIME_610" : ""
- };*/
- /** grid载入数据* */
- _this.listGrid = $("#dataGrid").quiGrid({
- columns : [{
- display : '单位',
- name : 'unit',
- align : 'center',
- width : "20%",
- showTitle:true
- }, {
- display : '特级(项)',
- name : 'tjx',
- align : 'center',
- width : "10%",
- showTitle:true
- }, {
- display : '特级(天数)',
- name : 'tjt',
- align : 'center',
- width : "10%",
- isSort : true
- }, {
- display : '一级(项)',
- name : 'yjx',
- align : 'center',
- width : "10%",
- showTitle:true
- }, {
- display : '一级(天数)',
- name : 'yjt',
- align : 'center',
- width : "10%",
- showTitle:true
- }, {
- display : '二级(项)',
- name : 'ejx',
- align : 'center',
- width : "10%"
- }, {
- display : '二级(天数)',
- name : 'ejt',
- align : 'center',
- width : "10%"
- }, {
- display : '三级(项)',
- name : 'sjx',
- align : 'center',
- width : "10%"
- }, {
- display : '三级(天数)',
- name : 'sjt',
- align : 'center',
- width : "10%",
- showTitle:true
- }],
- /*url : $.pathname() + '/ws/taskStatistics/BGDStatisticsService/gpsstatistics',
- params :_this.loadParams,*/
- data:"",
- sortOrder : 'desc', // 排序方式
- rownumbers : true,
- width : '100%',
- usePager:false,
- percentWidthMode : true
- });
- }
- };
- }();
- function queryTask(dept_id,startime,endtime){
- var url = $.pathname() + '/ws/taskStatistics/BGDStatisticsService/gpsstatistics?';
- params = {
- "GPS_AREA_ID_610" : dept_id,
- /* "GPS_YEAR_610" : year,
- "END_TIME_610" : end_time,*/
- "startime":startime,
- "endtime":endtime,
- };
- $.ajax({
- url : url,
- type : 'post',
- data : params,
- dataType : 'json',
- success : function(data) {
- _this.listGrid.setOptions({data:JSON.parse(data.rows)});
- //top.Dialog.alert("查询成功!");
- },
- error : function(e) {
- $.messager.alert( '访问服务失败!', 'error');
- }
- }).done(function(){
- $(top.document.body).find("#frmright").height($(window.document.body).height());
- });
- }
- $(function() {
- ReportInputPlan.init();
- $(".l-grid2").attr("id","grid");
- //queryTask(deptId,currDate);
- });
- //获得当前系统时间:年月
- function getDateTime(){
- var s="";
- var d = allGetServerTime();
- var vYear = d.getFullYear();
- var vMon = d.getMonth() + 1;
- /*var vDay = d.getDate();
- var h = d.getHours();
- var m = d.getMinutes();
- var se = d.getSeconds(); */
- s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)/*+"-"+(vDay<10 ? "0"+ vDay : vDay)+" "+(h<10 ? "0"+ h : h)+":"+(m<10 ? "0" + m : m)+":"+(se<10 ? "0" +se : se)*/;
- return s;
- }
|