企业换绑卡程序中应用

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="header :: header">
</head>
<style type="text/css">
    .easyui-dialog {
    }
</style>
<body style="margin:0px;">

<table id="dg" class="easyui-datagrid" title="账户管理 — 企业换卡审核" singleSelect="true" fitColumns="true" nowrap="false" striped="true"
       SelectOnCheck="true" CheckOnSelect="true" rownumbers="true" pagination="true" pageSize="50" pageList="[50, 100, 200]" toolbar="#tb" fit="true">
    <thead>
    <tr>
        <th field="ck" checkbox="true"></th>
        <th field="accountId" align="center" width="9%">账户ID</th>
        <th field="enterpriseRole" width="5%" align="center" formatter="showenterpriseRole">账户类型</th>
        <th field="enterpriseName" width="5%" align="center">企业名称</th>
        <th field="oldBankName" width="8%" align="center">原银行名称</th>
        <th field="odlCardNo" width="10%" align="center" formatter="showOldCardNo">原银行卡号</th>
        <!--<th field="oldBankSubName" width="8%" align="center">原支行信息</th>-->
        <th field="newBankName" width="6%" align="center">新银行名称</th>
        <th field="newCardNo" width="10%" align="center" formatter="showNewCardNo">新银行卡号</th>
        <th field="newUnionCode" width="6%" align="center">新卡联行号</th>
        <th field="enterpriseChangeCardImg" width="5%" align="center" formatter="showPicture">银行印鉴卡</th>
        <th field="recordStatus" width="5%" align="center" formatter="showRecordStatus">状态</th>
        <th field="auditContent" width="5%" align="center">审核信息</th>
        <th field="createTime" width="8%" align="center" formatter="timeStamp2DateTime">创建时间</th>
        <th field="modifyTime" width="8%" align="center" formatter="timeStamp2DateTime">更新时间</th>
    </tr>
    </thead>
</table>
<div id="tb" style="padding:2px 5px;">
    <form id="formSearch">
        <input type="hidden" name="pageSize" id="pageSize"/>
        <input type="hidden" name="pageNumber" id="pageNumber"/>
        <div width="100%" style="margin:4px">
            <div width="100%" style="margin:4px">
                经办人手机号:<input type="text" id="searchMobile" name="searchMobile" class="easyui-textbox" maxlength="20" style="width:150px" value=""  onfocus="if(this.value==this.defaultValue){this.value=''}" onblur="if(this.value==''){this.value=this.defaultValue}"/>&nbsp;&nbsp;
                创建时间:<input class="easyui-datebox" id="createTimeStart" name="createTimeStart" type="text" editable = "false"> -
                <input class="easyui-datebox" id="createTimeEnd" name="createTimeEnd" type="text" editable = "false">&nbsp;&nbsp;
                状态:<select class="easyui-combobox" id="searchRecordStatus" name="searchRecordStatus" panelHeight="auto" editable="false" style="width:100px">
                <option value="550" selected>待审核</option>
                <option value="">全部</option>
                <option value="100">新建</option>
                <option value="600">审核通过</option>
                <option value="800">审核拒绝</option>
                <option value="200,300,400,500">审核中</option>
            </select>&nbsp;&nbsp;
                <a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="btnSearch()">搜索</a>&nbsp;&nbsp;
            </div>
            <div>
                <a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="showEnterpriseChangeBankCardAudit()">换卡审核</a>&nbsp;&nbsp;
            </div>
        </div>
    </form>
</div>


<div id="dlgAudit" class="easyui-dialog" title="企业换卡审核" width="700px" height="440px" closed="true" buttons="#dlgAudit-Buttons" style="padding:10px" modal="true">
    <tr>
        <table id="dgEnterpriseAudit" singleSelect="true" fitColumns="true" nowrap="false" striped="true" cellpadding="1" cellspacing="10"
               SelectOnCheck="true" CheckOnSelect="true" rownumbers="true" pagination="false" pageSize="50" pageList="[50, 100, 200]" toolbar="#tbEnterpriseAudit">
            <tr>
                <td width="200px" align="right">
                    <label class="easyui-label">企业名称:</label>&nbsp;&nbsp;
                </td>
                <td width="200px" align="left">
                    <span id="enterpriseName"></span>&nbsp;&nbsp;
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td width="100px" align="right">
                    <label class="easyui-label">原银行名称:</label>&nbsp;&nbsp;
                </td>
                <td width="200px" align="left">
                    <span id="oldBankName"></span>&nbsp;&nbsp;
                </td>
                <td width="100px" align="right">
                    <label class="easyui-label">新银行名称:</label>&nbsp;&nbsp;
                </td>
                <td width="200px" align="left">
                    <span id="newBankName"></span>&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td width="100px" align="right">
                    <label class="easyui-label">原银行卡号:</label>&nbsp;&nbsp;
                </td>
                <td width="200px" align="left">
                    <span id="odlCardNo"></span>&nbsp;&nbsp;
                </td>
                <td width="100px" align="right">
                    <label class="easyui-label">新银行卡号:</label>&nbsp;&nbsp;
                </td>
                <td width="200px" align="left">
                    <span id="newCardNo"></span>&nbsp;&nbsp;
                </td>
            </tr>
            <!--<tr>
                <td width="100px" align="right">
                    <label class="easyui-label">原支行信息:</label>&nbsp;&nbsp;
                </td>
                <td width="200px" align="left">
                    <span id="oldBankSubName"></span>&nbsp;&nbsp;
                </td>
            </tr>-->
            <tr>
                <td width="100px" align="right">
                    <label class="easyui-label">创建时间:</label>&nbsp;&nbsp;
                </td>
                <td width="200px" align="left">
                    <span id="createTime"></span>&nbsp;&nbsp;
                </td>
                <td width="100px" align="right">
                    <label class="easyui-label">新卡联行号:</label>&nbsp;&nbsp;
                </td>
                <td width="200px" align="left">
                    <span id="newUnionCode"></span>&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td width="200px" align="right">
                    <label class="easyui-label">银行印鉴卡:</label>&nbsp;&nbsp;
                </td>
                <td width="300px">
                    <span><img width="180%" id="srcImg" src="" alt="该企业无上传银行印鉴卡"/></span>&nbsp;&nbsp;
                </td>
            </tr>

            <tr>
                <td width="200px" align="right">
                    <label class="easyui-label">审核意见:</label>&nbsp;&nbsp;
                </td>
                <td colspan="3">
                    <span><input id="verifyRemark" name="verifyRemark" class="easyui-textbox"  labelPosition="top" multiline="true" style="width:470px" required="true"></span>&nbsp;&nbsp;
                </td>
            </tr>
        </table>
    </tr>
    </form>
</div>
<div id="dlgAudit-Buttons" style="text-align: center">
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="btnVerifyPass()" iconcls="icon-save">审核通过</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="btnVerifyDeny()" iconcls="icon-save">审核拒绝</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:$('#dlgAudit').dialog('close')" iconcls="icon-cancel">取消</a>
</div>

<div id="alertMessage1" class="easyui-dialog" title="点击换卡审核判断" width="300px" height="150px" closed="true" buttons="#alertMessage1-button" style="padding:10px" modal="true">
    <form id="alertMessageForm" method="post">
        <table align="center" width="90%" cellpadding="2" cellspacing="2">
            <tr>
                <td>
                    请选择需要操作的项目
                </td>
            </tr>
        </table>
    </form>
</div>
<div id="alertMessage1-button" style="text-align: center">
    <a href="javascript:void(0)"  class="easyui-linkbutton" onclick="javascript:$('#alertMessage1').dialog('close')" iconcls="icon-cancel">关闭</a>
</div>

<div id="alertMessage2" class="easyui-dialog" title="点击换卡审核判断" width="300px" height="150px" closed="true" buttons="#alertMessage2-button" style="padding:10px" modal="true">
    <form id="alertMessageForm2" method="post">
        <table align="center" width="90%" cellpadding="2" cellspacing="2">
            <tr>
                <td>
                    选中的记录不是待审核状态,请重新选择
                </td>
            </tr>
        </table>
    </form>
</div>
<div id="alertMessage2-button" style="text-align: center">
    <a href="javascript:void(0)"  class="easyui-linkbutton" onclick="javascript:$('#alertMessage2').dialog('close')" iconcls="icon-cancel">关闭</a>
</div>
<input type="hidden" name="hiddenSubjectListOption" id="hiddenSubjectListOption"/>
<input type="hidden" name="requestNo" id="requestNo" />
<input type="hidden" name="applyUserId" id="applyUserId" />
<input type="hidden" name="originalStatus" id="originalStatus" />
<input type="hidden" name="remark" id="remark" />

</body>

<footer th:replace="footer :: footer"></footer>

<script type="text/javascript">

    $(function () {
        $("#createTimeStart").datebox("setValue", currNDate(0));//默认1天前
        $("#createTimeEnd").datebox("setValue", currNDate(0));//默认1天前

        $("#dg").datagrid({
            onClickRow: function (index, row) {
                document.getElementById("srcImg").src = row.enterpriseChangeCardImg;
                $("#requestNo").val(row.requestNo);
                $("#applyUserId").val(row.applyUserId);
                $("#adjustStatus").val(row.adjustStatus);
                $("#originalStatus").val(row.recordStatus);
                $("#auditContent").val(row.auditContent);
            },
            onCheck: function (index, row) {
                document.getElementById("srcImg").src = row.enterpriseChangeCardImg;
                $("#requestNo").val(row.requestNo);
                $("#applyUserId").val(row.applyUserId);
                $("#originalStatus").val(row.recordStatus);
                $("#adjustStatus").val(row.adjustStatus);
                $("#auditContent").val(row.auditContent);
            }
        });
        $("#dg").datagrid().datagrid("getPager").pagination({
            //改变pageSize会执行 onChangePageSize,onSelectPage
            //点上一页或下一页只会执行 onSelectPage
            //刷新会执行 onSelectPage,onRefresh
            onChangePageSize: function(pageSize) {
                $("#pageSize").val(pageSize);
            },
            onSelectPage: function(pageNumber, pageSize) {
                $("#pageSize").val(pageSize);
                $("#pageNumber").val(pageNumber);
                datagridBindOnSelectPage();
            },
            beforePageText: '第',
            afterPageText: '共{pages}页',
            displayMsg: '显示{from}到{to}条记录,共{total}条记录&nbsp;&nbsp;&nbsp;&nbsp;'
        });
        //隐藏表头的复选框
        $("#dg").parent().find("div.datagrid-header-check").children("input[type='checkbox']").eq(0).attr("style", "display:none;");
        $("#srcImg").click(function() {
            var _this = $(this);//将当前的pimg元素作为_this传入函数
            showPictureOnNewPage(this.currentSrc);
        });
        datagridBind();
    });

    //获取n天前 yyyy-MM-dd
    function currNDate(n) {
        var date = new Date();//获取当前时间
        date.setDate(date.getDate() - n);//设置n天前
        var currTime = dateTimeFormat(date);
        return currTime.substring(0, 10);
    }

    function datagridBindOnSelectPage() {
        $("#dg").datagrid("loading");
        $.get("enterpriseChangeBankCardList.htm", $("#formSearch").serialize(), function (pager) {
            if (pager.total==0) {
                $.messager.confirm("确认", "没有符合条件的记录", function (r) {
                    window.location.href = "/htm/enterpriseChangeBankCardAudit.htm";
                });
            }
            $("#dg").datagrid("loadData", {"total": pager.total, rows: pager.pageData});
            $("#dg").datagrid("loaded");
            $("#requestNo").val("");
            $("#applyUserId").val("");
            $("#adjustStatus").val("");
            $("#remark").val("");
        });
    }
    function datagridBind() {
        $("#dg").datagrid("loading");
        $.get("enterpriseChangeBankCardList.htm", $("#formSearch").serialize(), function (pager) {
            $("#dg").datagrid("loadData", {"total": pager.total, rows: pager.pageData});
            $("#dg").datagrid("loaded");
        });
        $("#requestNo").val("");
        $("#applyUserId").val("");
        $("#adjustStatus").val("");
        $("#remark").val("");
    }
    function btnSearch() {
        $("#pageNumber").val(0);
        datagridBindOnSelectPage();
    }


    function showEnterpriseChangeBankCardAudit() {
        var row = $('#dg').datagrid('getSelected');
        if(row){
            $("#enterpriseName").text(row.enterpriseName);
            $("#oldBankName").text(row.oldBankName);
            $("#newBankName").text(row.newBankName);
            $("#oldBankSubName").text(row.oldBankSubName);
            $("#createTime").text(timeStamp2DateTime(row.createTime));
            $("#odlCardNo").text(row.odlCardNo);
            $("#newCardNo").text(row.newCardNo);
            $("#newUnionCode").text(row.newUnionCode);
            $("#verifyRemark").textbox("setValue", "");
            if(row.recordStatus == 550){
                $('#dlgAudit').dialog("open").dialog("setTitle", "企业换卡审核");
            }else{
                $('#alertMessage2').dialog("open").dialog("setTitle", "提示");
            }
        }else if(row == null){
            $('#alertMessage1').dialog("open").dialog("setTitle", "提示");
        }

    }
    function btnVerifyPass() {
        verify(true);
    }

    function btnVerifyDeny() {
        verify(false);
    }

    function verify(status) {
        var action = "拒绝";
        if (status) {
            action = "通过";
        }
        var requestNo = $("#requestNo").val();
        var applyUserId = $("#applyUserId").val();
        var originalStatus = $("#originalStatus").val();
        var remark =  $("#verifyRemark").textbox("getValue");
        if(remark == null || remark == ""){
            $.messager.alert("信息","请输入审核意见","info");
            return ;
        }
        if (requestNo > 0) {
            $.messager.confirm("确认", "确认审核"+action+"吗?", function (r) {
                if (r) {
                    $.post("enterpriseChangeBankCardManualAudit.htm",
                        {
                            requestNo: requestNo,
                            applyUserId: applyUserId,
                            status: status,
                            originalStatus: originalStatus,
                            remark: remark
                        }, function (data) {
                            if (data.status) {
                                var message = "审核"+action+"成功!";
                                $.messager.alert("信息", message, "info");
                                $('#dlgAudit').dialog('close');
                                $("#verifyRemark").textbox('setValue', "");
                                datagridBind();
                            } else {
                                var message = "审核"+action+"失败!";
                                if (data.message != null) {
                                    message = data.message;
                                }
                                $.messager.alert("信息", message, "error");
                                $('#dlgAudit').dialog('close');
                                datagridBind();
                            }
                        }, "json");
                }
            });
        } else {
            $.messager.alert("信息", "请选择需要审核的记录", "info");
        }
    }

    function showPicture(value) {
        if(value === "") {
            return "无上传的图片";
        }else{
            return "<a id='showlinkBankLicenseImgAliOSSPath' href='javascript:void(0)' onclick='showPictureOnNewPage(\"" + value + "\")'>点击查看</a>";
        }
    }

    function showPictureOnNewPage(value) {
        if (value != ""&&value != null&&value != undefined) {
            window.open(value, "", "location=no, toolbar=no");
        } else {
            return;
        }
    }

    function showOldCardNo(value){
        var reg = /^(\d{3})\d+(\d{5})$/;
        value = value.replace(reg, "$1****$2");
        return value;
    }

    function showNewCardNo(value){
        var reg = /^(\d{3})\d+(\d{5})$/;
        value = value.replace(reg, "$1****$2");
        return value;
    }

    function showenterpriseRole(value){
        if(value == 100){
            return "平台账户";
        }else if(value == 300){
            return "借款人";
        }else if(value == 400){
            return "担保人/机构";
        }else if(value == 500){
            return "企业商户";
        }else{
            return value;
        }
    }

    function showRecordStatus(value,row) {
        if (value == 100) {
            return "新建";
        } else if (value == 200 || value == 300 || value == 400 || value == 500) {
            return "审核中";
        } else if (value == "550") {
            return "待审核";
        } else if (value == 600) {
            return "审核通过";
        } else if (value == 700) {
            return "审核通过存管失败";
        } else if (value == 800) {
            return "审核拒绝";
        } else if (value == 900) {
            return "审核拒绝存管失败";
        } else {
            return row.recordStatus;
        }
    }
</script>
</html>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值