xs 5 年之前
父节点
当前提交
df5f75a232

+ 119 - 0
src/main/webapp/webpage/modules/sg/financial/project/projectForm.jsp

@@ -0,0 +1,119 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>工程表单管理</title>
+	<meta name="decorator" content="ani"/>
+	<script type="text/javascript">
+
+		$(document).ready(function() {
+
+	        $('#beginDate').datetimepicker({
+				 format: "YYYY-MM-DD HH:mm:ss"
+		    });
+	        $('#endDate').datetimepicker({
+				 format: "YYYY-MM-DD HH:mm:ss"
+		    });
+		});
+		function save() {
+            var isValidate = jp.validateForm('#inputForm');//校验表单
+            if(!isValidate){
+                return false;
+			}else{
+                jp.loading();
+                jp.post("${ctx}/sg/financial/project/save",$('#inputForm').serialize(),function(data){
+                    if(data.success){
+                        jp.getParent().refresh();
+                        var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
+                        parent.layer.close(dialogIndex);
+                        jp.success(data.msg)
+
+                    }else{
+                        jp.error(data.msg);
+                    }
+                })
+			}
+
+        }
+	</script>
+</head>
+<body class="bg-white">
+		<form:form id="inputForm" modelAttribute="project" class="form-horizontal">
+		<form:hidden path="id"/>	
+		<table class="table table-bordered">
+			<tbody>
+				<tr>
+					<td class="width-15 active"><label class="pull-right" style="float: left">类型:</label></td>
+					<td class="width-35">
+						<form:input path="type" htmlEscape="false" class="form-control required"/>
+					</td>
+					<td class="width-15 active"><label class="pull-right">需求提出单位:</label></td>
+					<td class="width-35">
+						<form:input path="demandUnit" htmlEscape="false"   class="form-control required"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">变电站名称:</label></td>
+					<td class="width-35">
+						<form:input path="bdzName" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">线路名称:</label></td>
+					<td class="width-35">
+						<form:input path="lineName" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">项目需求名称:</label></td>
+					<td class="width-35">
+						<form:input path="requireName" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">建设理由分类:</label></td>
+					<td class="width-35">
+						<form:input path="bulidClassificationResons" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">建设理由:</label></td>
+					<td class="width-35">
+						<form:textarea path="bulbidResons" htmlEscape="false" rows="4"    class="form-control "/>
+					</td>
+					<td class="width-15 active"><label class="">设备基本情况:</label></td>
+					<td class="width-35">
+						<form:input path="asicEquipment" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">运行班:</label></td>
+					<td class="width-35">
+						<form:input path="runTheClass" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">项目组:</label></td>
+					<td class="width-35">
+						<form:input path="projectTeam" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">费用估算:</label></td>
+					<td class="width-35">
+						<form:input path="costEstimate" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">是否迎风期度夏项目:</label></td>
+					<td class="width-35">
+						<form:input path="whetherRheUpwind" htmlEscape="false"    class="form-control"/>
+					</td>
+				</tr>
+				<tr>
+					<td class="width-15 active"><label class="">确定下达时间:</label></td>
+					<td class="width-35">
+						<form:input path="sureDaDate" htmlEscape="false"    class="form-control"/>
+					</td>
+					<td class="width-15 active"><label class="">备注:</label></td>
+					<td class="width-35">
+						<form:textarea path="textRemark" htmlEscape="false" rows="4"    class="form-control "/>
+					</td>
+				</tr>
+			</tbody>
+		</table>
+	</form:form>
+</body>
+</html>

+ 311 - 0
src/main/webapp/webpage/modules/sg/financial/project/projectList.js

@@ -0,0 +1,311 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#projectTable').bootstrapTable({
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	           showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 5,
+               //可供选择的每页的行数(*)    
+               pageList: [5,10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/sg/financial/project/data",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onContextMenuItem: function(row, $el){
+                   if($el.data("item") == "edit"){
+                   		edit(row.id);
+                   }else if($el.data("item") == "view"){
+                       view(row.id);
+                   } else if($el.data("item") == "delete"){
+                        jp.confirm('确认要删除该请假表单记录吗?', function(){
+                       	jp.loading();
+                       	jp.get("${ctx}/sg/financial/project/delete?id="+row.id, function(data){
+                   	  		if(data.success){
+                   	  			$('#projectTable').bootstrapTable('refresh');
+                   	  			jp.success(data.msg);
+                   	  		}else{
+                   	  			jp.error(data.msg);
+                   	  		}
+                   	  	})
+                   	   
+                   	});
+                      
+                   } 
+               },
+              
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [{
+		        checkbox: true
+		       
+		    }
+			,{
+		        field: 'type',
+		        title: '类型',
+		        sortName: 'type'
+		        ,formatter:function(value, row , index){
+
+			   if(value == null || value ==""){
+				   value = "-";
+			   }
+			   <c:choose>
+				   <c:when test="${fns:hasPermission('sg:financial:project:edit')}">
+				      return "<a href='javascript:edit(\""+row.id+"\")'>"+value+"</a>";
+			      </c:when>
+				  <c:when test="${fns:hasPermission('sg:financial:project:view')}">
+				      return "<a href='javascript:view(\""+row.id+"\")'>"+value+"</a>";
+			      </c:when>
+				  <c:otherwise>
+				      return value;
+			      </c:otherwise>
+			   </c:choose>
+
+		        }
+		       
+		    }
+			,{
+		        field: 'demandUnit',
+		        title: '需求提出单位',
+		        sortName: 'demandUnit'
+		       
+		    }
+			,{
+		        field: 'bdzName',
+		        title: '变电站名称',
+		        sortName: 'bdzName'
+		       
+		    }
+			,{
+		        field: 'lineName',
+		        title: '线路名称',
+		        sortName: 'lineName'
+		       
+		    }
+			,{
+		        field: 'requireName',
+		        title: '项目需求名称',
+		        sortName: 'requireName'
+		       
+		    }
+			,{
+		        field: 'bulidClassificationResons',
+		        title: '建设理由分类',
+		        sortable: true,
+		        sortName: 'bulidClassificationResons'
+		       
+		    }
+                   ,{
+                       field: 'bulbidResons',
+                       title: '建设理由',
+                       sortName: 'bulbidResons'
+
+                   }
+                   ,{
+                       field: 'asicEquipment',
+                       title: '设备基本情况',
+                       sortName: 'asicEquipment'
+
+                   }
+                   ,{
+                       field: 'runTheClass',
+                       title: '运行班',
+                       sortName: 'runTheClass'
+
+                   }
+                   ,{
+                       field: 'projectTeam',
+                       title: '项目组',
+                       sortName: 'projectTeam'
+
+                   }
+                   ,{
+                       field: 'costEstimate',
+                       title: '费用估算',
+                       sortName: 'costEstimate'
+
+                   }
+                   ,{
+                       field: 'whetherRheUpwind',
+                       title: '是否迎风期度夏项目',
+                       sortName: 'whetherRheUpwind'
+
+                   }
+                   ,{
+                       field: 'sureDaDate',
+                       title: '确定下达时间',
+                       sortName: 'sureDaDate'
+
+                   }
+                   ,{
+                       field: 'textRemark',
+                       title: '备注',
+                       sortName: 'textRemark'
+                   }
+		     ]
+		
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#projectTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#projectTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#projectTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#projectTable').bootstrapTable('getSelections').length!=1);
+        });
+		  
+		$("#btnImport").click(function(){
+			jp.open({
+			    type: 2,
+                area: [500, 200],
+                auto: true,
+			    title:"导入数据",
+			    content: "${ctx}/tag/importExcel" ,
+			    btn: ['确定', '关闭'],
+			    	btn1: function(index, layero){
+				        var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+						iframeWin.contentWindow.importExcel('${ctx}/sg/financial/project/import', function (data) {
+							if(data.success){
+								jp.success(data.msg);
+								refresh();
+							}else{
+								jp.error(data.msg);
+							}
+                            jp.close(index);
+						});//调用保存事件
+						return false;
+				  	},
+
+				  btn2: function(index){
+					//  jp.close(index);
+	    	       }
+			}); 
+		});
+		
+		
+	 $("#export").click(function(){//导出Excel文件
+			jp.downloadFile('${ctx}/sg/financial/project/export');
+	  });
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#projectTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#projectTable').bootstrapTable('refresh');
+		});
+		
+		$('#beginBeginDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		$('#endBeginDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		$('#endDate').datetimepicker({
+			 format: "YYYY-MM-DD HH:mm:ss"
+		});
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#projectTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+
+		jp.confirm('确认要删除该项目管理表单记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/sg/financial/project/deleteAll?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#projectTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#projectTable').bootstrapTable('refresh');
+  }
+  
+   function add(){
+	  jp.openSaveDialog('新增项目管理表单', "${ctx}/sg/financial/project/form",'800px', '500px');
+  }
+
+
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑项目管理表单', "${ctx}/sg/financial/project/form?id=" + id, '800px', '500px');
+  }
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看项目管理表单', "${ctx}/sg/financial/project/form?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 89 - 0
src/main/webapp/webpage/modules/sg/financial/project/projectList.jsp

@@ -0,0 +1,89 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>工程表单管理</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="projectList.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">工程表单列表</h3>
+	</div>
+	<div class="panel-body">
+		<!-- 搜索 -->
+		<div id="search-collapse" class="collapse">
+			<div class="accordion-inner">
+				<form:form id="searchForm" modelAttribute="project" class="form form-horizontal well clearfix">
+					<div class="col-xs-12 col-sm-6 col-md-4">
+						<label class="label-item single-overflow pull-left" title="项目需求名称:">项目需求名称:</label>
+						<form:input path="requireName" htmlEscape="false" maxlength="100"  class=" form-control"/>
+					</div>
+					<div class="col-xs-12 col-sm-6 col-md-4">
+						<div style="margin-top:26px">
+							<a  id="search" class="btn btn-primary btn-rounded  btn-bordered btn-sm"><i class="fa fa-search"></i> 查询</a>
+							<a  id="reset" class="btn btn-primary btn-rounded  btn-bordered btn-sm" ><i class="fa fa-refresh"></i> 重置</a>
+						</div>
+					</div>
+				</form:form>
+			</div>
+		</div>
+	
+	<!-- 工具栏 -->
+	<div id="toolbar">
+			<%--<shiro:hasPermission name="test:one:dialog:leave1:add">--%>
+				<button id="add" class="btn btn-primary" onclick="add()">
+					<i class="glyphicon glyphicon-plus"></i> 新建
+				</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:one:dialog:leave1:edit">--%>
+			    <button id="edit" class="btn btn-success" disabled onclick="edit()">
+	            	<i class="glyphicon glyphicon-edit"></i> 修改
+	        	</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:one:dialog:leave1:del">--%>
+				<button id="remove" class="btn btn-danger" disabled onclick="deleteAll()">
+	            	<i class="glyphicon glyphicon-remove"></i> 删除
+	        	</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:one:dialog:leave1:import">--%>
+				<button id="btnImport" class="btn btn-info"><i class="fa fa-folder-open-o"></i> 导入</button>
+			<%--</shiro:hasPermission>--%>
+			<%--<shiro:hasPermission name="test:one:dialog:leave1:export">--%>
+	        		<button id="export" class="btn btn-warning">
+					<i class="fa fa-file-excel-o"></i> 导出
+				</button>
+			 <%--</shiro:hasPermission>--%>
+	                 <%--<shiro:hasPermission name="test:one:dialog:leave1:view">--%>
+				<button id="view" class="btn btn-default" disabled onclick="view()">
+					<i class="fa fa-search-plus"></i> 查看
+				</button>
+			<%--</shiro:hasPermission>--%>
+		    </div>
+		
+	<!-- 表格 -->
+	<table id="projectTable"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+    <ul id="context-menu" class="dropdown-menu">
+    	<%--<shiro:hasPermission name="test:one:dialog:leave1:view">--%>
+        <li data-item="view"><a>查看</a></li>
+        <%--</shiro:hasPermission>--%>
+    	<%--<shiro:hasPermission name="test:one:dialog:leave1:edit">--%>
+        <li data-item="edit"><a>编辑</a></li>
+        <%--</shiro:hasPermission>--%>
+        <%--<shiro:hasPermission name="test:one:dialog:leave1:del">--%>
+        <li data-item="delete"><a>删除</a></li>
+        <%--</shiro:hasPermission>--%>
+        <li data-item="action1"><a>取消</a></li>
+    </ul>  
+	</div>
+	</div>
+	</div>
+</body>
+</html>