<!DOCTYPE html>
<!--[if IE 8]>
<html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html>
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <base href="#springUrl('/assets/adminlte/')"/>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>工作台</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="plugins/ionicons/css/ionicons.min.css">

    <!-- DataTables -->
    <link rel="stylesheet" href="plugins/datatables/dataTables.bootstrap.css">

    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="plugins/iCheck/flat/blue.css">
    <!-- Date Picker -->
    <link rel="stylesheet" href="plugins/datepicker/datepicker3.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker-bs3.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <!--validate css-->
    <link rel="stylesheet" href="plugins/jquery-validation/css/validate.css">
    <!--fileinput css-->
    <link rel="stylesheet" href="plugins/bootstrap-fileinput/bootstrap-fileinput.css">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<!-- END HEAD -->
<body class="hold-transition skin-blue sidebar-mini">

<div class="wrapper">
    <div class="content-wrapper" style="margin-left:0;">

        <section class="content-header">
            <h1>
                支付记录管理
                <small>支付记录</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>首页</a></li>
                <li><a class="active">支付记录</a></li>
            </ol>
        </section>


        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <!-- general form elements disabled -->
                    <div class="box box-primary">
                        <form role="form" id="myForm">
                            <input name="id" value="$!{data.id}" hidden="true"/>
                            <div class="box-body">
                                <div class="form-group form-md-line-input">
                                    <label>来源系统ID</label>
                                    <input type="text"
                                           class="form-control" name="srcid"
                                           id="srcid"
                                           maxlength="32" placeholder="来源系统ID"
                                           value="$!{data.srcid}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>来源系统类型</label>
                                    <input type="text"
                                           class="form-control" name="srctype"
                                           id="srctype"
                                           maxlength="20" placeholder="来源系统类型"
                                           value="$!{data.srctype}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>商户号</label>
                                    <input type="text"
                                           class="form-control" name="mch_id"
                                           id="mch_id"
                                           maxlength="30" placeholder="商户号"
                                           value="$!{data.mch_id}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>错误码</label>
                                    <input type="text"
                                           class="form-control" name="err_code"
                                           id="err_code"
                                           maxlength="20" placeholder="错误码"
                                           value="$!{data.err_code}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>错误描述</label>
                                    <input type="text"
                                           class="form-control" name="err_code_des"
                                           id="err_code_des"
                                           maxlength="200" placeholder="错误描述"
                                           value="$!{data.err_code_des}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>openid</label>
                                    <input type="text"
                                           class="form-control" name="openid"
                                           id="openid"
                                           maxlength="32" placeholder="openid"
                                           value="$!{data.openid}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>交易类型</label>
                                    <input type="text"
                                           class="form-control" name="trade_type"
                                           id="trade_type"
                                           maxlength="30" placeholder="交易类型"
                                           value="$!{data.trade_type}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>是否关注</label>
                                    <input type="text"
                                           class="form-control" name="is_subscribe"
                                           id="is_subscribe"
                                           maxlength="4" placeholder="是否关注"
                                           value="$!{data.is_subscribe}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>付款银行</label>
                                    <input type="text"
                                           class="form-control" name="bank_type"
                                           id="bank_type"
                                           maxlength="30" placeholder="付款银行"
                                           value="$!{data.bank_type}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>总金额（分）</label>
                                    <input type="text"
                                           class="form-control" name="total_fee"
                                           id="total_fee"
                                           maxlength="20" placeholder="总金额"
                                           value="$!{data.total_fee}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>货币种类</label>
                                    <input type="text"
                                           class="form-control" name="fee_type"
                                           id="fee_type"
                                           maxlength="20" placeholder="货币种类"
                                           value="$!{data.fee_type}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>现金支付金额（分）</label>
                                    <input type="text"
                                           class="form-control" name="cash_fee"
                                           id="cash_fee"
                                           maxlength="30" placeholder="现金支付金额"
                                           value="$!{data.cash_fee}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>现金支付货币类型</label>
                                    <input type="text"
                                           class="form-control" name="cash_fee_type"
                                           id="cash_fee_type"
                                           maxlength="20" placeholder="现金支付货币类型"
                                           value="$!{data.cash_fee_type}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>微信支付订单号</label>
                                    <input type="text"
                                           class="form-control" name="transaction_id"
                                           id="transaction_id"
                                           maxlength="32" placeholder="微信支付订单号"
                                           value="$!{data.transaction_id}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>商户订单号</label>
                                    <input type="text"
                                           class="form-control" name="out_trade_no"
                                           id="out_trade_no"
                                           maxlength="32" placeholder="商户订单号"
                                           value="$!{data.out_trade_no}"
                                           readonly
                                    >

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>商家数据包</label>
                                    <textarea
                                            class="form-control" name="attach"
                                            id="attach"
                                            placeholder="商家数据包"

                                            readonly
                                    >$!{data.attach}</textarea>

                                </div>
                                <div class="form-group form-md-line-input">
                                    <label>支付完成时间</label>

                                    <input type="text"
                                           class="form-control" name="time_end"
                                           id="time_end"
                                           maxlength="32" placeholder="支付时间"
                                           value="$!{data.time_end}"
                                           readonly
                                    >


                                </div>
                            </div>

                            <div class="box-footer">
                                <!--#if($shiro.hasPermission("qy:payRecord:edit"))-->
                                <!--<input class="btn btn-primary" id="save" value="保存" hidden="true" type="submit">-->
                                <!--#end-->
                                <a href="#springUrl('/a/payRecord/list')" class="btn btn-default">取消</a>
                            </div>
                        </form>
                        <!-- /.box-body -->
                    </div><!-- /.box -->


                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->


    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>
</div><!-- ./wrapper -->

<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables/extensions/i18n/lanauage_ch.js"></script>
<script src="plugins/datatables/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="plugins/fastclick/fastclick.min.js"></script>
<!--fileinput js-->
<script src="plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.min.js"></script>
<script src="plugins/bootstrap-maxlength/bootstrap-maxlength.min.js" type="text/javascript"></script>
<script src="plugins/security/sha256.js" type="text/javascript"></script>
<script src="plugins/jquery-validation/js/jquery.validate.min.js"></script>
<script src="js/jquery.form.min.js"></script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/lang/zh-cn/zh-cn.js"></script>
<script src="common/js/cfapp.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<script>

    function formatDates(now) {
        var now = new Date(now);
        var year = now.getFullYear();
        var month = now.getMonth() + 1;
        var date = now.getDate();
        var hour = now.getHours();
        var minute = now.getMinutes();
        var second = now.getSeconds();
        return year + "-" + month + "-" + date + "   " + hour + ":"
            + minute + ":" + second;
    }

    $().ready(function () {
        Cfapp.init();
        recdTypeAdd.init();
        $("#time_end").val(formatDates($("#time_end").val(), "yyyy-MM-dd HH:mm:ss"));
    });


    var recdTypeAdd = function () {
        var initForm = function () {
            var initFormCtrl = function () {
                bindEvent();
            };
            var bindEvent = function () {

                $("#myForm").validate({
                    rules: {},
                    messages: {},
                    submitHandler: function (form) {
                        $("#save").attr("disabled", true);
                        $.getJSON("#springUrl('/a/payRecord/formData')", $("#myForm").serialize(), function (returnobj) {
                            $("#save").attr("disabled", false);
                            if (returnobj.errorNo == 2) {  //保存成功
                                Cfapp.confirm({
                                    message: "添加成功",
                                    btnoktext: "继续添加",
                                    btncanceltext: "关闭",
                                    success: function () {
                                        location.href = "#springUrl('/a/payRecord/form')";
                                    },
                                    cancel: function () {
                                        location.href = "#springUrl('/a/payRecord/list')";
                                    }
                                });
                            } else if (returnobj.errorNo == 0) {  //修改成功
                                Cfapp.alert({
                                    message: "更新成功",
                                    btntext: "确定",
                                    success: function () {
                                        location.href = "#springUrl('/a/payRecord/list')";
                                    }
                                });
                            } else {
                                Cfapp.alert({
                                    message: "创建失败",
                                    btntext: "确定",
                                    success: function () {
                                        location.href = "#springUrl('/a/payRecord/list')";
                                    }
                                });
                            }
                        });
                    }
                })
            }
            initFormCtrl();
        }
        return {

            //main function to initiate the module
            init: function () {
                initForm();
            }

        };
    }();
</script>
</body>
<!-- END BODY -->
</html>