| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <!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=GBK">
- <title>科目列表</title>
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
- <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"
- type="text/javascript"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/yw/fm/subject/subjectTree.js"></script>
- <script type="text/javascript">
- var grid = null;
- var height=400;
- $(document).ready(function(){
- $("#layout1").ligerLayout({
- leftWidth : 250,
- height : '99%'
- });
- initSubjectGrid();
- $("#leftTree").height(height);
- });
- var grid = null;
- var checkValue = new Array(); //定义一个数组
- var i = 0;
- function initSubjectGrid(params) {
- var checkbox = false;
- if ("true" == 'false' || "true" == '') {
- checkbox = false;
- } else {
- checkbox = true;
- }
- var columns = [
- {
- display : '上级科目',
- name : 'pid_name',
- width : 100
- }, {
- display : '科目编号',
- name : 'subject_number',
- width : 160
- }, {
- display : '科目名称',
- name : 'subject_name',
- width : 160
- }, {
- display : '收支类型',
- name : 'balance_dire_name',
- width : 160
- },{
- display : '状态',
- name : 'state_name',
- width : 100
- } ];
- columns
- .push({
- display : '操作',
- width : 120,
- isAllowHide : false,
- render : function(row) {
- var html = '<a href=\"#\" onclick=\"editSubject('+ row.universalid +','+ row.pid +')\">编辑</a> ';
- html += '<a href=\"#\" onclick=\"delSubject('+ row.universalid+','+ row.pid +')\">删除</a> ';
- return html;
- }
- });
- grid = $("#maingrid4")
- .ligerGrid(
- {
- columns : columns,
- pageSize : 20,
- url : 'fmSubjectAction.do?task=subjectList&time=' + new Date().getTime() + params,
- pageParmName : 'p', //页索引参数名,(提交给服务器)
- pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
- width : '99.9%',
- checkbox:checkbox,
- // single :true,
- // allowHideColumn: false, rownumbers: true, colDraggable: true, rowDraggable: true,
- height : '98%',
- isChecked: f_isChecked,
- onCheckRow: function(checked, rowdata, rowindex) {
- for (var rowid in this.records){
- this.unselect(rowid);
- }
- if(checked){
- this.select(rowindex);
- }else{
- this.unselect(rowindex);
- }
- }
- });
- $("#pageloading").hide();
- $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
- }
- //默认选中
- function f_isChecked(rowdata){
- if(checkValue != "" && typeof (checkValue) != "undefined"){
- if(checkValue[i]==rowdata.sid){
- i++;
- return true;
- }
- return false;
- }
- }
- //查询
- function searchByKword(tree) {
- var s = "";
- var universalid ="";
- if(tree=="tree"){
- universalid = $("#universalid").val();
- }else{
- universalid = $("#_universalid").val();
- }
- universalid= $("#universalid").val()
- if (universalid != "" && typeof (universalid) != "undefined") {
- s += "&universalid=" + universalid;
- }
- //alert(universalid);
- var subject_name2 = $("#subject_name2").val();//规则名称
- if (subject_name2 != "" && typeof (subject_name2) != "undefined") {
- s += "&subject_name=" + encodeURI(encodeURI(subject_name2));
- }
- //alert(subject_name2);
- var state = $("#state").val();
- // alert(state);
- if (state != "" && typeof (state) != "undefined") {
- s += "&state=" + state;
- }
- grid.set("newPage","1");
- initSubjectGrid(s);
- }
-
- function f_select() {
- var rows = grid.getCheckedRows();
- return rows;
- }
-
- //删除科目信息
- function delSubject(universalid,pid){
- // if (window.confirm("确定要删除科目信息吗?")){
- // addTab('delSubject' + getCurrentTabId(), '删除科目信息', '${pageContext.request.contextPath }/hrSubjectAction.do?task=delCourse&universalid='
- // + universalid + '&tabid=' + getCurrentTabId(),true,true);
- // }
- var param={'universalid':universalid,
- 'pid':pid
- };
- //alert(universalid);
- // alert(pid);
- if (window.confirm("确定要删除科目分类信息吗?")){
- sendAjaxParam(param,"fmSubjectAction.do?task=delSubjectType",'json',delTypeProcess);
- }
- }
- function delTypeProcess(data){
- //alert(data.result);
- if(data.result>0){
- $.ligerDialog.success("删除科目分类信息成功");
- // universalid="";
- // $("#universalid").val("");
- // initSubjectGrid();
- searchByKword();
- }else if(data.result==0){
- $.ligerDialog.warn("科目分类已被引用,不可删除");
- }else if(data.result==-1){
- $.ligerDialog.error("删除科目分类信息失败");
- }
- loadTree();
-
- }
- //编辑科目信息
- function editSubject(universalid,pid){
- var s=$("#status").val();
- // alert(s);
- if(s=='2'){
- alert("该科目父类已被停用,请先启用!")
- return;
- }
- // alert(pid);
- // addTab('editCourse' + getCurrentTabId(), '编辑科目信息', '${pageContext.request.contextPath }/hrTrainCourseAction.do?task=toEditCourse&universalid='
- // + universalid + '&tabid=' + getCurrentTabId(),true,true);
- dialog = $.ligerDialog.open({ height: 260,
- width:500,
- url: 'fmSubjectAction.do?task=toEditSubject&universalid='+universalid+'&pid='+pid+'&status='+s,
- allowClose:false,
- title:'编辑科目分类',
- buttons : [ {
- text : '保存',
- onclick : function(item,dialog){
- dialog.frame.editSubjectType();
- }
- },{
- text : '关闭',
- onclick : addSubjectCloseOk
- }]
- });
- }
- function addSubjectCloseOk(item,dialog){
- dialog.close();
- loadTree();
- }
- function addTabe(){
- var universalid=$("#universalid").val();
- if(universalid=="" || universalid==null ){
- alert("请先选择科目子类别!");
- return ;
- }
- if(universalid=="1"){
- alert("是根目录,请选择科目子类别!");
- return;
- }
- addTab('addCourse'+getCurrentTabId(), '新增科目', '${pageContext.request.contextPath }/hrTrainCourseAction.do?task=toAddCourse&tabid=' + getCurrentTabId()+'&universalid='+universalid,true,true);
- }
- function up()
- {
-
- var row = grid.getSelected();
- if(row=="undefined" || row==null || row==""){
- alert("请先选中科目分类!")
- }
- grid.up(row);
- // alert(row.universalid+"dd:"+row.pid);
-
- }
- function down()
- {
- var row = grid.getSelected();
-
- if(row=="undefined" || row==null || row==""){
- alert("请先选中科目分类!")
- }
- grid.down(row);
-
- }
- function endEdit()
- {
- grid.endEdit();
- var subject=JSON.stringify(grid.getData());
-
- $("#subject_data").val(subject);
- $("#addSubjectOrder").submit();
-
- }
- // 导入
- var importDlg;
- function importExcel(){
- var type="fmSubject";
- importDlg = $.ligerDialog.open({
- height: 120,
- width:440,
- url: 'fmSubjectImportAction.do?task=toImport&type='+type,
- allowClose:false,
- title:'导入科目数据',
- buttons : [ {
- text : '导入',
- onclick : function(item,dialog){
- dialog.frame.importExcel(window);
- }
- },{
- text : '关闭',
- onclick : function(item,dialog){
- importDlg.close();
- refreshWindow();
- window.parent.loadTree();
- grid.loadData();
- }
- }]
- });
- }
- // //新增科目表单配置
- // function addSubjectConfig(){
- // dialog = $.ligerDialog.open({ height: 340,width:700, title:"科目表单配置",url: 'fmSubjectAction.do?task=toSubjectConfigList'});
- // }
- </script>
- <style type="text/css">
- body {
- padding: 5px;
- margin: 0;
- }
- #layout1 {
- width: 99.5%;
- margin: 0;
- padding: 0;
- }
- .l-button {
- margin-left: 1px;
- }
- /* #deptBtn { */
- /* /* width: 100%; */ */
- /* background: #e5ecf9; */
- /* text-align: center; */
- /* height: 25px; */
- /* padding-top: 3px */
- /* } */
- .l-layout-left {
- overflow-y: auto;
- }
- </style>
- </head>
- <BODY>
- <%@ include file="/include/button.jsp"%>
- <%@ include file="/include/message.jsp"%>
- <div class="l-content">
- <div id="layout1">
- <form action="fmSubjectAction.do?task=addSubjectOrder" id="addSubjectOrder" method="post">
- <input type="hidden" name="subject_data" id="subject_data" />
- <input type="hidden" name="tabid" id="tabid" value="fmSubjectAction.do?task=toList" />
- </form>
- <input type="hidden" name="typeRootId" id="typeRootId" value="${typeRootId }"/>
- <input type="hidden" name="asset_search_type" id="asset_search_type" value=""/>
- <div position="left" title="科目分类" class="user-tree-style">
- <div id="deptBtn">
- <!-- <input type="button" value="修改" class="l-button" onclick="editSubjectType()" id="editSubjectTypeBtn" style="width:50px;" /> -->
- <!-- <input type="button" value="删除" class="l-button" onclick="delSubjectType()" id="delSubjectTypeBtn" style="width:50px;"/> -->
- </div>
- <div id="leftTree" style="overflow:auto;position:relative;">
- <ul id="subjectTree" class="tree" style="margin-top: 3px;"></ul>
- </div>
- </div>
- <div position="center" id="assetList" title="科目列表">
- <div id="deptBtn" style="text-align:left;">
- <input type="button" value="新增科目" class="l-button" onclick="addSubjectType()" id="addSubjectTypeBtn" style="width:90px;margin-left:10px;"/>
- <!-- <a class="l-button" onclick="up()">上移</a> -->
- <!-- <a class="l-button" onclick="down()" >下移</a> -->
- <input id="l-button" type="button" value="上移" class="l-button" onclick="up()" style="width: 50px;margin-left:30px;"/>
- <input id="l-button" type="button" value="下移" class="l-button" onclick="down()" style="width: 50px;"/>
- <input type="button" class="l-button" value="保存" onclick="endEdit()" />
-
- <!-- <input type="button" class="l-button" value="科目表单配置" onclick="addSubjectConfig()" style="width:90px;margin-left:30px;"/> -->
-
- <input type="button" value="导入" class="l-button" onclick="importExcel()" id="importExcelBtn" style="margin-left:60px;"/>
- <!-- <input id="menuUp" type="button" value="上移" class="l-button" onclick="saveUp()"/> -->
- <!-- <input id="menuDown" type="button" value="下移" class="l-button" onclick="saveDown()"/> -->
-
- </div>
- <div class="default_search" style="margin: 0;">
- <!-- <ul class="list_search"> -->
- <!-- <li class="title">类别:</li> -->
- <!-- <li class="text"> -->
- <!-- <select id="_universalid" name="_universalid" style="width:100px;"> -->
- <!-- <option value="" selected="selected">-请选择-</option> -->
- <%-- <c:forEach items="${courseClass }" var="item"> --%>
- <%-- <option value="${item.universalid }" >${item.class_name }</option> --%>
- <%-- </c:forEach> --%>
- <!-- </select> -->
- <!-- </li> -->
- <!-- </ul> -->
- <ul class="list_search">
- <li class="title"> 科目名称:</li>
- <li class="text">
- <input type="text" style="width:130px;"name="subject_name2" id="subject_name2"> </input>
- <input type="hidden" name="universalid" id="universalid" value="${universalid}"/>
- <input type="hidden" name="status" id="status" value="${status}"/>
-
-
- </li>
- </ul>
- <ul style="width: 250px;">
- <li class="title" >状态:</li>
- <li class="text" >
- <select id="state" name="state" style="width:100px;">
- <option value="" selected="selected">-请选择-</option>
- <c:forEach items="${statusList}" var="item">
- <option value="${item.dvalue }" >${item.dname}</option>
- </c:forEach>
- </select>
- </li>
- </ul>
- <ul>
- <li class="search-button"><input type="button" class='l-button'
- name="search" onclick="searchByKword()" value="查询" /></li>
- </ul>
- </div>
- <div style="overflow: hidden; clear: both;">
- <div id="maingrid4" style="margin: 0; padding: 0"></div>
- </div>
- </div>
- </div>
- </div>
- </BODY>
- </HTML>
|