123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>导入数据文件列表</title>
- <!--框架必需start-->
- <script type="text/javascript" src="${ctx}/qui/libs/js/jquery.js"></script>
- <script type="text/javascript" src="${ctx}/qui/libs/js/framework.js"></script>
- <link href="${ctx}/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
- <link rel="stylesheet" type="text/css" id="skin" prePath="${ctx}/qui/"/>
- <link rel="stylesheet" type="text/css" id="customSkin"/>
- <!--框架必需end-->
- <!--数据表格start-->
- <script src="${ctx}/qui/libs/js/table/quiGrid.js" type="text/javascript"></script>
- <!--数据表格end-->
- <!--箭头分页start-->
- <script type="text/javascript" src="${ctx}/qui/libs/js/nav/pageArrow.js"></script>
- <!--箭头分页end-->
- <!--表单异步提交start-->
- <script src="${ctx}/qui/libs/js/form/form.js" type="text/javascript"></script>
- <!--表单异步提交end-->
- <script type="text/javascript">
- var g_pageNo = 1;
- var g_pageSize = 10;
- //刷新记忆
- var checkedArray = [];
-
- //定时刷新页面
- // var iID=setInterval("searchHandler()",5000);
-
- //数据表格使用
- var g;
- var gridData;
- function initComplete(){
- g = $("#maingrid").quiGrid({
- columns: [
- { display: '文件名', name: 'fileName', align: 'center', width: "16%"},
- { display: '文件大小', name: 'fileSize', align: 'center', width: "5%"},
- { display: '导入类型', name: 'showImportType', align: 'center', width: "8%"},
- { display: '上传时间', name: 'uploadTime', align: 'center', width: "5%"},
- { display: '数据年度信息', name: 'year', align: 'center', width: "8%"},
- { display: '数据状态', name: 'showImportStatus', align: 'center', width: "8%"},
- { display: '状态描述', name: 'statusDescription', align: 'center', width: "20%"
- ,render: function (rowdata, rowindex, value, column){
- if(rowdata.dataStatus=='in_import'){
- return '<span>'+value+'<img src="${ctx}/image/loading.gif" style="height:15px;width:15px;vertical-align:middel;"></span>';
- }else{
- return value;
- }
- }
- },
- { display: '创建人', name: 'showCreater', align: 'center', width: "5%"},
- { display: '创建时间', name: 'createTime', align: 'center', width: "8%"},
- { display: '操作', isAllowHide: false, align: 'center', width:"10%"
- ,render: function (rowdata, rowindex, value, column){
- var str =
- '<div class="padding_top4 padding_left20">'
- <@pop_perm url="/import/delete.do">
- + '<a href="#" onclick="onDelete('+ rowdata.importId+')"><span class="icon_remove">删除</span></a>'
- </@pop_perm>
- '</div>';
- if(rowdata.importType=='user_water_info'){
- str =
- '<div class="padding_top4 padding_left20">'
- <@pop_perm url="/import/delete.do">
- + '<a href="#" onclick="onDelete('+ rowdata.importId+')"><span class="icon_remove">删除</span></a>'
- </@pop_perm>
- <@pop_perm url="/import/delThisImport.do">
- + '<a href="#" onclick="delThisImport('+ rowdata.importId+')"><span class="icon_delete">删除数据</span></a>'
- </@pop_perm>
- '</div>';
- }
- return str;
- }
- }
- ],
- toolbar:{
- items:[
- <@pop_perm url="/import/importOrgInfo.do">
- {line:true},
- {text:'导入单位基本信息',click:importOrgInfo, iconClass:'icon_add'},
- </@pop_perm>
- <@pop_perm url="/import/importUserWaterInfo.do">
- {line:true},
- {text:'导入单位月用水量信息(mdb)',click:importUserWaterInfo, iconClass:'icon_add'},
- {line:true},
- {text:'导入单位月用水量信息(exce)',click:importExceWaterInfo, iconClass:'icon_add'},
- {line:true},
- {text:'同步oracle单位信息',click:importOracleOrgData, iconClass:'icon_add'},
- {line:true},
- {text:'同步oracle抄表',click:importOracleWaterData, iconClass:'icon_add'},
- </@pop_perm>
-
- <@pop_perm url="/import/delete.do">
- {line:true},
- {text:'批量删除',click:batchDelete, iconClass:'icon_delete'},
- </@pop_perm>
- {line:true}
- ]
- },
- data:[], sortName: 'importId',rownumbers:true,checkbox:true,usePager: false,height: '100%', width:"100%",heightDiff:-40,pageSize:g_pageSize,
- onChangeSort : function(){
- getData(g.options.sortName,g.options.sortOrder,g_pageNo,g_pageSize);
- return false;
- },isChecked:checkedHandler,onCheckRow: checkRowHandler, onCheckAllRow: checkAllRowHandler
- });
-
- //点击分页触发
- }
- $(function(){
- getData(g_pageNo,g_pageSize);
- })
-
- /**初始时通过向后台传递排序id、排序顺序、初始页码、每页条数**/
- function getData(pageNo,pageSize){
- jQuery.post("${ctx}/import/listPage.do",
- getFormParams(pageNo,pageSize),
- function(result){
- gridData = result;
- //刷新表格
- g.loadData(gridData);
- //设置左边内容页
- var content ="共有" + gridData["pager.totalRows"] + "条记录";
- $("#letfContent").html("");
- $("#letfContent").html(content);
- //取得分页组件
- var pager=$("#pager");
- //设置总页页数
- pager.attr("total",gridData["pager.totalRows"]);
- pager.render();
- //绑定翻页事件
- pager.unbind("pageChange");
- pager.bind("pageChange",function(e,index){
- g_pageNo = index + 1;
- getData(g_pageNo,g_pageSize);
- });
- //绑定选择每页显示记录数事件
- pager.bind("sizeChange",function(e,num){
- g_pageSize = num;
- getData(g_pageNo,g_pageSize);
- });
- },"json");
- }
-
-
- //查询
- function searchHandler(){
- // checkedArray.length = 0;
- //重新加载数据,设置当前页面为1
- getData(g_pageNo,g_pageSize);
- }
-
- /**获得查询表单的提交查询的值**/
- function getFormParams(pageNo,pageSize){
- $("#pageNo").val(pageNo);
- $("#pageSize").val(pageSize);
- return $("#searchForm").formToArray();
- }
-
- /**重置于查询表单,然后重新加载表格数据**/
- function resetSearch(){
- $("#searchForm")[0].reset();
- //重新加载数据,设置当前页面为1
- getData(g_pageNo,g_pageSize);
- }
- //单条记录删除
- function onDelete(rowid){
- top.Dialog.confirm("确定要删除该记录吗?",function(){
- //删除记录
- jQuery.post("${ctx}/import/delete.do",
- {"ids":rowid},
- function(responseText){
- if(responseText.status=="y"){
- top.Dialog.alert(responseText.info);
- resetSearch();
- }else{
- top.Dialog.alert(responseText.info);
- }
-
- },
- "json");
- });
- }
- //删除该批次下导入的数据
- function delThisImport(rowid){
- top.Dialog.confirm("确定要删除数据吗?",function(){
- //删除记录
- jQuery.post("${ctx}/import/delThisImport.do",
- {"ids":rowid},
- function(responseText){
- if(responseText.status=="y"){
- top.Dialog.alert(responseText.info);
- resetSearch();
- }else{
- top.Dialog.alert(responseText.info);
- }
-
- },
- "json");
- });
- }
- //批量删除
- function batchDelete() {
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if(rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- top.Dialog.confirm("确定要删除吗?",function(){
- jQuery.post("${ctx}/import/delete.do",
- //获取所有选中行
- getSelectId(g),
- function(responseText){
- if(responseText.status=="y"){
- top.Dialog.alert(responseText.info);
- resetSearch();
- }else{
- top.Dialog.alert(responseText.info);
- return false;
- }
- },
- "json");
- });
-
- //获取所有选中行获取选中行的id 格式为 ids=1&ids=2
- function getSelectId(grid) {
- var selectedRows = grid.getSelectedRows();
- var selectedRowsLength = selectedRows.length;
- var ids = "";
- for(var i = 0;i<selectedRowsLength;i++) {
- ids += selectedRows[i].importId + ",";
- }
- return {"ids":ids};
- }
- }
-
- function importOrgInfo(){
- top.Dialog.open({
- URL:"${ctx}/import/importOrgInfo.do",
- Title:"导入单位基本信息",
- Width:750,
- Height:200
- });
- }
- function importOracleOrgData(){
- // alert("?");
- top.Dialog.open({
- URL:"${ctx}/import/importOracleOrgData.do",
- Title:"导入oracle单位信息",
- Width:750,
- Height:200
- });
- }
- function importOracleWaterData(){
- top.Dialog.open({
- URL:"${ctx}/import/importOracleWaterData.do",
- Title:"导入oracle抄表信息",
- Width:750,
- Height:200
- });
- }
-
-
- function importUserWaterInfo(){
- //alert("??");
- top.Dialog.open({
- URL:"${ctx}/import/importUserWaterInfo.do",
- Title:"导入单位月用水量信息",
- Width:750,
- Height:200
- });
- }
- function importExceWaterInfo(){
- //alert("??");
- top.Dialog.open({
- URL:"${ctx}/import/importExceWaterInfo.do",
- Title:"导入单位月用水量信息(exce)",
- Width:750,
- Height:200
- });
- }
-
- function findCheckedArray(id){
- for(var i =0;i<checkedArray.length;i++){
- if(checkedArray[i] == id) return i;
- }
- return -1;
- }
- function addCheckedArray(id,name){
- if(findCheckedArray(id) == -1){
- checkedArray.push(id);
- }
- }
- function removeCheckedArray(id){
- var i = findCheckedArray(id);
- if(i==-1) return;
- checkedArray.splice(i,1);
- }
- function checkedHandler(rowdata){
- if (findCheckedArray(rowdata.importId) == -1)
- return false;
- return true;
- }
- function checkRowHandler(checked, data){
- if (checked) addCheckedArray(data.importId,data.name);
- else removeCheckedArray(data.importId,data.name);
- }
- function checkAllRowHandler(checked){
- for (var rowid in this.records){
- if(checked){
- addCheckedArray(this.records[rowid]['importId'],this.records[rowid]['name']);
- }else{
- removeCheckedArray(this.records[rowid]['importId'],this.records[rowid]['name']);
- }
- }
- }
- </script>
- </head>
- <body>
- <div style="display:none;">
- <form action="" id="searchForm" method="post">
- <input type="hidden" id="pageNo" name="pageNo" value="1"/>
- <input type="hidden" id="pageSize" name="pageSize" value="10"/>
- </form>
- </div>
- <div id="scrollContent">
- <div class="padding_right5">
- <div id="maingrid"></div>
- </div>
- </div>
- <!-- 分页组件 -->
- <div style="height:35px;">
- <div id="letfContent" class="float_left padding5"></div>
- <div class="float_right padding5">
- <div id="pager" total="0" class="pageArrow" showSelect="true" inputPosition="right"></div>
- </div>
- <div class="clear"></div>
- </div>
- </body>
- </html>
|