js引入路径

 

<% include("../../common/head.html"){} %>
    <script src="layer/layer.min.js"></script>
  <script type="text/javascript" src="layer/layer.min.js"></script>
<form name="form1" id="form1">
    <div id="fieldset_condition" style="margin: 0px;">
        <fieldset>
            <legend id="fieldset_legend" οnclick="fieldsetToggle('fieldset_legend','${!(kind_framework_ms_urls_resource)}/');" style="cursor: pointer;" title="点击:显示/隐藏">
                <img src='${!(kind_framework_ms_urls_resource)}/images/DHTMLSuite_minus.gif' />查询条件
            </legend>
            <table style="width: 100%;" id="fieldset_data">
                <tr>
                    <td>
                    姓名:<input name="QNAME" id="QNAME" type="text" size="15" class="txtitem" /> 
                    <input name="DATA_FLAG" id="DATA_FLAG" type="hidden" value='1' /> <a href="#" class="easyui-linkbutton btn_query" data-options="iconCls:'icon-search'" οnclick='queryData()'>查询</a>
                    <input name="DATA_FLAG" id="DATA_FLAG" type="hidden" value='1' /> <a href="#" class="easyui-linkbutton btn_query" data-options="iconCls:'icon-search'" οnclick='exportExcel()'>測試</a>
                    
                    </td>
                </tr>
            </table>
        </fieldset>
    </div>
    <div style="margin: 2px;">
        <div title="人员信息" style="padding: 1px">
            <table id="dg" title="" >
                <thead>
                    <tr>
                        <th data-options="field:'PERSONID',hidden:true,width:150,align:'left',halign:'center'">人员id</th>
                        <th data-options="field:'PERSONNAME',width:150,align:'left',halign:'center',sortable:true">姓名</th>
                        <th data-options="field:'SEX',width:100,align:'left',halign:'center',sortable:true">性别</th>
                        <th data-options="field:'IDCARD',width:150,align:'left',halign:'center',sortable:true">身份证号码</th>
                        <th data-options="field:'NATION',width:100,align:'left',halign:'center',sortable:true">民族</th>
                        <th data-options="field:'HOMETOWN',width:100,align:'left',halign:'center',sortable:true">籍贯</th>
                        <th data-options="field:'BIRTHDATE',width:90,align:'center',formatter:formatterdate,halign:'center',sortable:true">出生年月</th>
                        <th data-options="field:'BIRTHPLACE',width:200,align:'left',halign:'center',sortable:true">出生地</th>
                        <th data-options="field:'WORKDATE',width:90,align:'center',formatter:formatterdate,halign:'center',sortable:true">参加工作时间</th>
                        <th data-options="field:'HEALTHSTATUS',width:100,align:'left',halign:'center',sortable:true">健康状况</th>
                        <th data-options="field:'SPECIALTY',width:90,align:'center',formatter:formatterdate,halign:'center',sortable:true">离职时间</th>
                        <th data-options="field:'POLITICALSTATUS',width:100,align:'left',halign:'center',sortable:true">政治面貌</th>
                        <th data-options="field:'JOINPARTYTIME',width:90,align:'center',formatter:formatterdate,halign:'center',sortable:true">入党时间</th>
                        <th data-options="field:'ENTRYDATE',width:90,align:'center',formatter:formatterdate,halign:'center',sortable:true">到集团本部时间</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>
</form>

    <form id="myform" name="myform" target="myiframe"  style="display: none">
    <input type="hidden" name="action" value="perbasess_main"> 
    <input type="hidden" name="name" id="name"/>

</form>
<script>
    //初始化加载
    $(function() {
            $('#dg').datagrid();
            var pager = $('#dg').datagrid('getPager');//获取表格分页
            var s_tmp_toolbar;
            eval("s_tmp_toolbar=stoolbar");
            pager.pagination({
                buttons : s_tmp_toolbar
            });
    });
    
    function CnStatus(val ,row){
        if(val==0){
            return '正常'+(row.ISEND==1?'(结束)':'');
        }
        if(val==1){
            return '挂起'+(row.ISEND==1?'(结束)':'');
        }
        if(val==2){
            return '终止'+(row.ISEND==1?'(结束)':'');
        }
        return val+"(未知状态)";            
    }
    
       //自动缩放
    $(window).resize(function() {
        $('#dg').resizeDataGrid($("#fieldset_condition").height()+4, 4, 0, 0);
    });
    
    //查询
    function queryData() {        
        var s_url = "restful?action=personnel_query_list";        
        $('#dg').datagrid({
            url : s_url,
            pageNumber:1,striped:true,
            queryParams : $('#form1').serializeObject(),
            onLoadSuccess:function(data){
                //成功验证是否有无出错
                if(data.g_result=="0"){
                    showMsg(data.g_message);
                }
            },
            onDblClickRow : function(rowIndex, rowData) {
                
                openExecWflow('打开流程',rowData.ACTIVITY_UUID,rowData.WORKFLOW_UUID);
                
            }
        });
        
        var pager = $('#dg').datagrid('getPager');//获取表格分页
        pager.pagination({
            buttons : eval("stoolbar")
        });
    }
    
    //刷新查询
    function refreshQueryData(jsondata) {
        if (jsondata.g_result && jsondata.g_result == '1') {
            if (!jsondata.showMsgFlag) {
                //没有显示过的,显示
                showMsg(jsondata.g_message);
            }
            queryData();
        }else{
            if(jsondata.g_message){
                showMsg(jsondata.g_message);
            }
        }
    }
    
    //刷新查询
    function refreshQueryData1(jsondata) {
        if (jsondata.g_result && jsondata.g_result == '1') {
            if (!jsondata.showMsgFlag) {
                //没有显示过的,显示
                showMsg(jsondata.g_message);
            }
            queryData();        
        }
    }
    
    //新增流程
    function gotepersonalinfo(title,id){
        //新增后,跳转到我的已办中
        openWindow(title, 'do?action=per_baseinfo_edit&PERSONID='+id, 2000, 2000, "refreshQueryData1");
    }
    
    
    //底部按钮
    var stoolbar = [ {
        text : '新增',
        iconCls : 'icon-ok',
        handler : function() {
            gotepersonalinfo('新增人事信息',"");
        }
    },'-', {
        text : '修改',
        iconCls : 'icon-edit',
        handler : function() {
            var rows = $('#dg').datagrid('getSelections');
            if (rows.length != 1) {
                showMsgAndExecFn("请选择一条数据!", "");
                return;
            }            
            gotepersonalinfo('修改人事信息',rows[0].PERSONID);
        }
    },'-', {
        text : '删除',
        iconCls : 'icon-no',
        handler : function() {
            var rows = $('#dg').datagrid('getSelections');
            if (rows.length != 1) {
                showMsgAndExecFn("请选择一条数据!", "");
                return;
            }            
            postAjax("restful","action=personnels_delete&PERSONID="+rows[0].PERSONID,"refreshQueryData");
        }
    }];

    //检查是否可以撤回
    function getCheckWithdrawResult(json){
        if(json.g_result==0){
            showErrorMsg(json.g_message);
            return;
        }
    
        var rows = $('#dg').datagrid('getSelections');
        if (rows.length != 1) {
            showMsgAndExecFn("请选择一条数据!", "");
            return;
        }
        postAjax("restful","action=workflow_withdraw&WF_ACTIVITY_UUID="+rows[0].ACTIVITY_UUID,"getWithdrawResult");
    }
    
    //撤回
    function getWithdrawResult(json){
        var msg=json.g_message;
        if(msg.indexOf('成功')>-1){
            showMsg(msg);
        }else{
            showErrorMsg(msg);
        }
        
        if(json.g_result=='1'){
            //成功刷新列表
            queryData();
        }
    }
    
    
    function exportExcel() {
        
        $("#name").val($("#QNAME").val());
        layer.confirm('确认要导出Excel吗?', {icon: 3, title:'系统提示'}, function(index){
                $("#myform").submit();
                $("#myform").attr("action" , ""); 
                layer.close(index);
            }); 
        
    };
</script>

<% include("../../common/end.html"){} %>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值