`
zengshaotao
  • 浏览: 792578 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

功能参考

 
阅读更多

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

  <head>

    <base href="<%=basePath%>">

    

    <title>评分卡管理</title>

    

<meta http-equiv="pragma" content="no-cache">

<meta http-equiv="cache-control" content="no-cache">

<meta http-equiv="expires" content="0">    

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

<meta http-equiv="description" content="This is my page">

 

    

<link rel="stylesheet" type="text/css" href="css/common.css" />

<script type="text/javascript" src="js/jquery-easyui-1.2.6/jquery-1.7.2.min.js"></script>

<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.2.6/themes/default/easyui.css" />

<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.2.6/themes/icon.css" />

<script type="text/javascript" src="js/jquery-easyui-1.2.6/jquery.easyui.min.js"></script>

<script type="text/javascript" src="js/jquery-easyui-1.2.6/locale/easyui-lang-zh_CN.js"></script>

<!-- <script type="text/javascript" src="js/commons.js"></script> -->

 

<style type="text/css">

#issueAnaForm{

            margin:0;

            padding:10px 20px;

        }

        .ftitle{

            font-size:14px;

            font-weight:bold;

            padding:5px 0;

            margin-bottom:10px;

            border-bottom:1px solid #ccc;

        }

        .fitem{

            margin-bottom:5px;

        }

        .fitem label{

            display:inline-block;

            width:80px;

        }

        .fitem input{

            width:160px;

        }

        /* .datagrid-td-rownumber{

        display:none;

        } */

</style>

<script type="text/javascript">

$(function(){

 

$('#estimateCard').datagrid({

/* idField:'id' , */

title:'评分卡管理' ,//没有内容,就会少一个div的标题内容

//width:1300 ,

fit:true ,

height:420 ,

singleSelect:false,

url:'<%=request.getContextPath()%>/EstimateCard.do?method=estimateCardInitAndQuery' ,

fitColumns:true ,

rownumbers:false,//显示序号,默认是true

selectOnCheck: true,

checkOnSelect: true,

striped: true ,//隔行变色特性 

//nowrap: false ,//折行显示

loadMsg: '数据正在加载,请耐心的等待...' ,

//rownumbers:true ,

rowStyler: function(index ,record){

 

} ,

frozenColumns:[[//冻结列特性 ,不要与fitColumns 特性一起使用 

{

field:'ck' ,

width:30 ,

checkbox: true

}

]],

columns:[[

{

field:'FOLDER_ID' ,//FOLDER_ID 

title:'评分卡ID' ,

width:40,

hidden: true

},{

field:'FOLDER_NAME' ,

title:'评分卡名称' ,

width:100,

hiddden:false

},{

field:'FOLDER_DESC' ,

title:'评分卡描述' ,

width:200 ,

hidden: false

},{

field:'STATUS' , 

title:'状态' ,

formatter:function(value , record , index){

if(value == '1'){

return '<span>启用</span>';

} else if( value == '0'){

return '<span>禁用</span>';

} else if( value == '2'){

return '<span>新建</span>';

} else {

return '<span>其它</span>';

}

},

width:30,

hidden:false

},{

field:'FREQUENCY' , 

title:'检查频度' ,

width:40,

hidden:false,

formatter:function(value , record , index){

if(value == '01'){

return '<span>日</span>';

} else if( value == '02'){

return '<span>周</span>';

} else if( value == '03'){

return '<span>月</span>';

} else if( value == '04'){

return '<span>季</span>';

} else if( value == '05'){

return '<span>半年</span>';

} else if( value == '06'){

return '<span>年</span>';

} else {

return '<span>其它</span>';

}

}

},{

field:'WEIGHT' ,

title:'权重' ,

width:50 ,

hidden: true

},{

field:'CREATE_OPER' ,

title:'创建人' ,

width:70 ,

hidden: false

},{

field:'START_DT' ,

title:'开始日期' ,

width:100 ,

hidden: false

},{

field:'END_DT' ,

title:'结束日期时间' ,

width:100 ,

hidden: true

}

]] ,

 

toolbar:[

{  

                 text:'新增',iconCls:'icon-edit',handler:estimateCardAdd

             },{

            text:'删除',iconCls:'icon-cancel',handler:estimateCardDelete

             },{

            text:'修改',iconCls:'icon-edit',handler:estimateCardEdit  

             },{

            text:'启用',iconCls:'icon-ok',handler:estimateCardStart 

             },{

            text:'禁用',iconCls:'icon-no',handler:estimateCardStop  

             },{

            text:'查看',iconCls:'icon-search',handler:estimateCardDetail  

             },{

            text:'权重查看',iconCls:'icon-edit',handler:weigthSet 

             }

            ],  

pagination: true , 

pageSize: 10 ,

pageList:[10,15,20,50]

});//table data init block

 

$('#searchbtn').click(function(){

$('#estimateCard').datagrid('reload',serializeForm($('#mysearch')));

});

 

$('#freqFlagId').combobox({

data:[

{"id":'01' ,"name":'日'},

{"id":'02' ,"name":'周'},

{"id":'03' ,"name":'月'},

{"id":'04' ,"name":'季'},

{"id":'05' ,"name":'半年'},

{"id":'06' ,"name":'年'}

],

idField:'id', // ID字段

textField:'name', // 显示的字段

fitColumns: true,

striped: true,

editable:false// 不可编辑,只能选择

});

 

$('#freqEditId').combobox({

data:[

{"id":'01' ,"name":'日'},

{"id":'02' ,"name":'周'},

{"id":'03' ,"name":'月'},

{"id":'04' ,"name":'季'},

{"id":'05' ,"name":'半年'},

{"id":'06' ,"name":'年'}

],

idField:'id', // ID字段

textField:'name', // 显示的字段

fitColumns: true,

striped: true,

editable:false// 不可编辑,只能选择

});

 

});//jquery init block

 

    

    function weigthSet(){

   

    var rows = $("#estimateCard").datagrid("getSelections");

if (rows==null || rows==""){

$.messager.alert("提 示","请选择需要的记录!","icon-cancel");

return false;

}

if(rows.length>1){

$.messager.alert("提 示","只能设置单条评分卡的权重!","icon-cancel");

return false;

}

   var row = $("#estimateCard").datagrid("getSelected");

    var timeD = new Date();

    var cardId = row.FOLDER_ID;

    var cardName = row.FOLDER_NAME;

   

    var ESTIMATE_CARD_INFO = "&cardId="+cardId+"&cardName="+cardName;

    //window.showModalDialog("<%=request.getContextPath()%>/jsp/estiscore/card_weight_set.jsp?time="+timeD+ESTIMATE_CARD_INFO,window,"dialogHeight=600px;dialogWidth=1200px;scroll:yes");

    window.open("<%=request.getContextPath()%>/jsp/estiscore/card_weight_set.jsp?time="+timeD+ESTIMATE_CARD_INFO,"","");

    }

    

// 表单字段信息的收集

function serializeForm(form){

var obj = {};

$.each(form.serializeArray(),function(index){

// 下面的this是一个表单域的对象

if(obj[this['name']]){

obj[this['name']] = obj[this['name']] + ','+this['value'];

} else {

obj[this['name']] =this['value'];

}

});

return obj;

}

 

//评分卡详细查看

function estimateCardDetail(){

$("#estimateCardFormCheck").form("clear");

var rows = $("#estimateCard").datagrid("getSelections");

if (rows==null || rows==""){

$.messager.alert("提 示","请选择需要查看的记录!","icon-cancel");

return false;

}

if(rows.length>1){

$.messager.alert("提 示","只能查看单条评分卡记录!","icon-cancel");

return false;

}

    var row = $("#estimateCard").datagrid("getSelected");

    if (row){

        $("#estimateCard_check").dialog("open").dialog("setTitle","评分卡查看");

        $("#estimateCardFormCheck").form('load',row);

     //频度字段和状态字段显示 

     //评分卡查看时下拉框

$('#FREQUENCY').combobox({

data:[

{"id":'01' ,"name":'日'},

{"id":'02' ,"name":'周'},

{"id":'03' ,"name":'月'},

{"id":'04' ,"name":'季'},

{"id":'05' ,"name":'半年'},

{"id":'06' ,"name":'年'}

],

idField:'id', // ID字段

textField:'name', // 显示的字段

fitColumns: true,

striped: true,

editable:false// 不可编辑,只能选择

});

//状态  

$('#STATUS').combobox({

data:[

{"id":'1' ,"name":'启用'},

{"id":'2' ,"name":'新建'},

{"id":'3' ,"name":'历史'},

{"id":'0' ,"name":'禁用'}

],

idField:'id', // ID字段

textField:'name', // 显示的字段

fitColumns: true,

striped: true,

editable:false// 不可编辑,只能选择

}); 

        $("#STATUS").combobox("setValue",row.STATUS);

$("#FREQUENCY").combobox("setValue",row.FREQUENCY); 

    }

}

//评分卡新增

function estimateCardAdd(){

$("#estimateCard_add").dialog("open").dialog("setTitle","评分卡新增");

 

$("#estimateCard_addForm").form("clear");

$('#freqFlagId').combobox('setValue','03');

}

 

function estimateCardAddSave(oper){

 

    $("#estimateCard_addForm").form('submit',{

        url: '<%=request.getContextPath()%>/EstimateCard.do?method=estimateCardAdd&operFlag='+oper,

        onSubmit: function(){

        //表单提交之前进行校验

        return $(this).form('validate');

        },

        success: function(result){

            //转换成JSON大对象

          var result = eval('('+result+')');

          $.messager.alert("提示",result.resultInfo,"icon-ok");

              $("#estimateCard_add").dialog('close');        // close the dialog

              $("#estimateCard").datagrid('reload');    // reload the user data

              

               //重新加载左边的树

            self.parent.frames["treeLeft"].reloadTree('');

        }

    });

}

//评分卡修改 

function estimateCardEdit(oper){

var estimateCardNos = [];

var rows = $("#estimateCard").datagrid("getSelections");

if (rows==null || rows==""){

$.messager.alert("提 示","请选择需要修改的记录!","icon-cancel");

return false;

}

if(rows.length>1){

$.messager.alert("提 示","只能修改单条评分卡记录!","icon-cancel");

return false;

}

 

var row = $("#estimateCard").datagrid("getSelected");

 

    if (row.STATUS==0){

    $.messager.alert("提 示","只能修改新建和启用状态的评分卡记录!","icon-cancel");

return false;

   

    }else{

    $("#estimateCardEdit").dialog("open").dialog("setTitle","评分卡修改");

    $("#estimateCardEditForm").form("load",{

    FOLDER_ID  :row.FOLDER_ID,

    FOLDER_NAME : row.FOLDER_NAME,

FOLDER_DESC :row.FOLDER_DESC,

status :row.STATUS,

FREQUENCY : row.FREQUENCY

    });

    //$("#freqEditId").combobox("setValue","03");

    }

}

//评分卡修改

function estimateCardModifySave(oper){

$("#estimateCardEditForm").form('submit',{

        url: '<%=request.getContextPath()%>/EstimateCard.do?method=estimateCardModify&operFlag='+oper,

        onSubmit: function(param){

        //除了表单的元素,再提交自定义的参数

            return true;

        },

        success: function(result){

        

          var result = eval('('+result+')');

            if (result.resultFlag=="fail"){

                $.messager.alert("错误提示",result.resultInfo,"icon-ok");

            } else {

            $.messager.alert("成功提示",result.resultInfo,"icon-ok");

                $("#estimateCardEdit").dialog("close");  

                $("#estimateCard").datagrid("reload"); 

                

                //重新加载左边的树

            self.parent.frames["treeLeft"].reloadTree('');

            }

        }

    });

}

 

//删除评分卡

function estimateCardDelete(){

var estimateCardNos = [];

var rows = $("#estimateCard").datagrid("getSelections");

if (rows==null || rows==""){

$.messager.alert("提 示","请选择需要删除的记录!","icon-cancel");

return false;

}

var ids = '';

var continueFlag = true;

for(var i=0;i<rows.length;i++){

estimateCardNos.push(rows[i].FOLDER_ID);

ids += rows[i].MAP_ID + ',';

if(rows[i].STATUS==1){

continueFlag = false;

$.messager.alert('提示信息!','只能删除新建或已禁用的评分卡,请重新选择!','warning');

break;

}

}

if (continueFlag){

        $.messager.confirm("确认","确定删除所选择的记录吗?",function(r){

            if (r){

            //这里传入json参数格式为{issueNoParams:issueNos.join(",")},issuesNos是数组,一定要拼接成字符串

            $.post('<%=request.getContextPath()%>/EstimateCard.do?method=estimateCardDelete',{estimateCardNoParams:estimateCardNos.join(",")},

            function(result){

           $.messager.alert("提示",result.resultInfo,"icon-ok");

               $("#estimateCard").datagrid("reload"); 

               //重新加载左边的树

    self.parent.frames["treeLeft"].reloadTree('');

                },'json');

            }

        });

    }

   

}

 

//启用评分卡

function  estimateCardStart(){

var estimateCardNos = [];

var rows = $("#estimateCard").datagrid("getSelections");

if (rows==null || rows==""){

$.messager.alert("提 示","请选择需要启用的记录!","icon-cancel");

return false;

}

 

var ids = '';

var continueFlag = true;

for(var i=0;i<rows.length;i++){

estimateCardNos.push(rows[i].FOLDER_ID);

ids += rows[i].MAP_ID + ',';

if(rows[i].STATUS==1){

continueFlag = false;

$.messager.alert('提示信息!','只能启用新建或禁用的评分卡,请重新选择!','warning');

break;

}

}

if (continueFlag){

        $.messager.confirm("确认","确定启用所选择的记录吗?",function(r){

            if (r){

            //这里传入json参数格式为{issueNoParams:issueNos.join(",")},issuesNos是数组,一定要拼接成字符串

            $.post('<%=request.getContextPath()%>/EstimateCard.do?method=estimateCardStart',{estimateCardNoParams:estimateCardNos.join(",")},

            function(result){

           $.messager.alert("提示",result.resultInfo,"icon-ok");

               $("#estimateCard").datagrid("reload"); 

               //重新加载左边的树

    self.parent.frames["treeLeft"].reloadTree('');

                },'json');

            }

        });

    }

}

 

//禁用评分卡

function estimateCardStop(){

var estimateCardNos = [];

var rows = $("#estimateCard").datagrid("getSelections");

if (rows==null || rows==""){

$.messager.alert("提 示","请选择需要禁用的记录!","icon-cancel");

return false;

}

var ids = '';

var continueFlag = true;

for(var i=0;i<rows.length;i++){

estimateCardNos.push(rows[i].FOLDER_ID);

ids += rows[i].MAP_ID + ',';

if(rows[i].STATUS!=1){

continueFlag = false;

$.messager.alert('提示信息!','只能禁用已启用的规则组,请重新选择!','warning');

break;

}

}

if (continueFlag){

        $.messager.confirm("确认","确定禁用所选择的记录吗?",function(r){

            if (r){

            //这里传入json参数格式为{issueNoParams:issueNos.join(",")},issuesNos是数组,一定要拼接成字符串

            $.post('<%=request.getContextPath()%>/EstimateCard.do?method=estimateCardStop',{estimateCardNoParams:estimateCardNos.join(",")},

            function(result){

           $.messager.alert("提示",result.resultInfo,"icon-ok");

               $("#estimateCard").datagrid("reload"); 

               //重新加载左边的树

    self.parent.frames["treeLeft"].reloadTree('');

                },'json');

            }

        });

    }

}

 

</script>

  </head>

  

  <body>

<div id="lay" class="easyui-layout" style="width: 100%;height:100%" >

<div region="north" title="条件过滤" collapsed=false style="height:60px;padding-top:5px" >

<form id="mysearch" method="post">&nbsp;&nbsp;&nbsp;&nbsp;

<input name="searchFlag" type="hidden" value="1" />

评分卡名称:<input name=FOLDER_NAME class="easyui-validatebox"  style="width:100px" value="" />&nbsp

<a id="searchbtn" class="easyui-linkbutton" style="margin-left:20px">查询</a>

</form>

</div>

<div region="center" >

<table id="estimateCard"></table>

</div>

</div>

<!--新增评分卡  -->

    <div id="estimateCard_add" class="easyui-dialog" style="width:400px;height:200px;padding:10px 20px"

            closed="true" buttons="#estimateCard_add_buttons">

        <div class="ftitle"></div>

        <form id="estimateCard_addForm" method="post">

        <input name="ESTIMATE_CARD_ID" class="" type="hidden" value="">

            <div class="fitem">

                <label>评分卡名称:</label><input name="FOLDER_NAME" class="easyui-validatebox" required="true">

            </div>

            <div class="fitem">

                <label>评分卡描述:</label><input name="FOLDER_DESC" class="easyui-validatebox" >

            </div>

           <div class="fitem">

                <label>检查频度:</label><input  id="freqFlagId" name="FREQUENCYADD"   class="easyui-combobox" valueField="id" textField="name" value="">

            </div>

             

        </form>

    </div>

    <!--修改评分卡信息  -->

    <div id="estimateCardEdit" class="easyui-dialog" style="width:350px;height:240px;padding:10px 20px"

            closed="true" buttons="#estimateCard_Edit_buttons">

        <div class="ftitle"></div>

         <form id="estimateCardEditForm" method="post">

        <input name="FOLDER_ID" class="" type="hidden" value="">

        <input name="status" class="" type="hidden" value="">

            <div class="fitem">

               <!--  <label>评分卡ID:</label><input name="ESTIMATE_CARD_ID" class="easyui-textbox" readonly> -->

                <label>评分卡名称:</label><input name="FOLDER_NAME" class="easyui-textbox" >

             </div>

             <div class="fitem">

                <label>评分卡描述:</label><input name="FOLDER_DESC" class="easyui-textbox" >

            </div>

            

            <div class="fitem">

                <label>检查频度:</label><input  id="freqEditId" name="FREQUENCY"  class="easyui-combobox" valueField="id" textField="name" value="">

            </div>

             

        </form>

    </div>

    <!-- 评分卡的查看,所有的属性都是readonly的 -->

    <div id="estimateCard_check" class="easyui-dialog" style="width:600px;height:180px;padding:10px 20px"

            closed="true" buttons="#estimateCard_check_buttons">

        <div class="ftitle"><!-- title信息,根据增加和修改按钮动态变化 --></div>

        <form id="estimateCardFormCheck" method="post">

            <div class="fitem">

               <!--  <label>评分卡ID:</label><input name="ESTIMATE_CARD_ID"  readonly class="easyui-textbox" readonly> -->

                <label>评分卡名称:</label><input name="FOLDER_NAME" class="easyui-textbox" readonly>

                <label>评分卡描述:</label><input name="FOLDER_DESC" class="easyui-textbox" readonly>

            </div>

            <div class="fitem">

                <label>创建人:</label><input name="CREATE_OPER" readonly class="easyui-textbox" readonly>

                <label>创建时间:</label><input name="START_DT" readonly class="easyui-textbox" readonly>

            </div>

             

            <div class="fitem">

                <label>状态:</label><input id = "STATUS" name="STATUS" readonly  class="easyui-combobox" valueField="id" textField="name" value="">

               <label>检查频度:</label><input id="FREQUENCY" name="FREQUENCY" readonly  class="easyui-combobox" valueField="id" textField="name" value="">

            </div> 

             

        </form>

    </div>

    

    <div id="issue_sql" class="easyui-dialog" style="width:500px;height:300px;padding:10px 20px"

            closed="true" buttons="">

            <div class="ftitle"></div>

     </div>

     

     <!-- 评分卡增加的按钮 -->

    <div id="estimateCard_add_buttons" style="text-align:center">

    <!-- a的style不能加入width,否则出现按钮有空隙的评分卡 -->

        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="estimateCardAddSave('submit')" style="">提 交</a>

        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-undo" onclick="javascript:$('#estimateCard_add').dialog('close')" style="">关  闭</a>

    </div>

    <!-- 评分卡修改的按钮 -->

     <div id="estimateCard_Edit_buttons" style="text-align:center">

        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="estimateCardModifySave('submit')" style="">提 交</a>

        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-undo" onclick="javascript:$('#estimateCardEdit').dialog('close')" style="">关  闭</a>

    </div>

    

    <!-- 删除评分卡 -->

    <div id="estimateCard_check_buttons" style="text-align:center">

        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-undo" onclick="javascript:$('#estimateCard_check').dialog('close')" style="">关  闭</a>

    </div>

    

  </body>

</html>

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics