<!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="panel panel-primary">
                                    <div class="panel-heading">编码信息</div>

                                    <div class="panel-body">
                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>物流单编码</label>
                                            <input type="text"
                                                   class="form-control" id="number" name="number"
                                                   maxlength="500" placeholder="物流单编码"
                                                   value="$!{data.number}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>顺丰运单号</label>
                                            <input type="text"
                                                   class="form-control" id="waybillNo" name="waybillNo"
                                                   maxlength="500" placeholder="顺丰运单号"
                                                   value="$!{data.waybillNo}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>咨询单编码</label>
                                            <input type="text"
                                                   class="form-control" id="consultSheetCode" name="consultSheetCode"
                                                   maxlength="500" placeholder="顺丰运单号"
                                                   value="$!{data.consultSheetCode}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>订单编码</label>
                                            <input type="text"
                                                   class="form-control" id="orderCode" name="consultSheetCode"
                                                   maxlength="500" placeholder="订单编码"
                                                   value="$!{data.orderCode}" readonly>
                                        </div>
                                    </div>
                                </div>

                                <div class="panel panel-primary">
                                    <div class="panel-heading">联系人信息</div>

                                    <div class="panel-body">
                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>粉丝名称</label>
                                            <input type="text"
                                                   class="form-control" id="nickName" name="nickName"
                                                   maxlength="500" placeholder="粉丝名称"
                                                   value="$!{data.nickName}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>联系人</label>
                                            <input type="text"
                                                   class="form-control" id="contact" name="contact"
                                                   maxlength="500" placeholder="联系人"
                                                   value="$!{data.contact}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>联系人手机号</label>
                                            <input type="text"
                                                   class="form-control" id="mobile" name="mobile"
                                                   maxlength="500" placeholder="联系人手机号"
                                                   value="$!{data.mobile}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>省份</label>
                                            <input type="text"
                                                   class="form-control" id="province" name="province"
                                                   maxlength="500" placeholder="省份"
                                                   value="$!{data.province}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>城市</label>
                                            <input type="text"
                                                   class="form-control" id="city" name="city"
                                                   maxlength="500" placeholder="城市"
                                                   value="$!{data.city}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>县/区级行政区名称</label>
                                            <input type="text"
                                                   class="form-control" id="county" name="county"
                                                   maxlength="500" placeholder="县/区级行政区名称"
                                                   value="$!{data.county}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>详细地址</label>
                                            <!--<input type="text"-->
                                                   <!--class="form-control" id="address" name="address"-->
                                                   <!--maxlength="500" placeholder="详细地址"-->
                                                   <!--value="$!{data.address}" readonly>-->

                                            <textarea class="form-control" id="address" name="address" rows="3" readonly>$!{data.address}</textarea>
                                        </div>
                                    </div>
                                </div>

                                <div class="panel panel-primary">
                                    <div class="panel-heading">物流信息</div>

                                    <div class="panel-body">
                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>物流状态</label>
                                            <input type="text"
                                                   class="form-control" id="status" name="status"
                                                   maxlength="500" placeholder="物流状态"
                                                   value="#if( $!{data.status} == '0') 已发货
                                           #elseif($!{data.status} == '1') 待收货
                                           #elseif($!{data.status} == '2') 已完成 #end" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>配送温度范围</label>
                                            <input type="text"
                                                   class="form-control" id="temperatureRange" name="temperatureRange"
                                                   maxlength="500" placeholder="配送温度范围"
                                                   value="#if( $!{data.temperatureRange} == '0') 常温
                                           #elseif($!{data.temperatureRange} == '1') 冷藏
                                           #elseif($!{data.temperatureRange} == '3') 冷冻 #end" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>订单员名称</label>
                                            <input type="text"
                                                   class="form-control" id="storageManageName" name="storageManageName"
                                                   maxlength="500" placeholder="订单员名称"
                                                   value="$!{data.storageManageName}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>发件时间</label>
                                            <input type="text"
                                                   class="form-control" id="sendExpressDate" name="sendExpressDate"
                                                   maxlength="500" placeholder="发件时间"
                                                   value="$!{data.sendExpressDate}" readonly>
                                        </div>

                                        <div class="form-group form-md-line-input col-xs-5">
                                            <label>收件时间</label>
                                            <input type="text"
                                                   class="form-control" id="acceptExpressDate" name="acceptExpressDate"
                                                   maxlength="500" placeholder="收件时间"
                                                   value="$!{data.acceptExpressDate}" readonly>
                                        </div>
                                    </div>
                                </div>

                            </div>

                            <div class="box-footer">
                                #if($shiro.hasPermission("qy:waybill:edit"))
                                <input class="btn btn-primary" id="save" value="保存" type="submit">
                                #end
                                <a href="#springUrl('/a/waybill/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>
    $().ready(function () {
        Cfapp.init();
        recdTypeAdd.init();
    });


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

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

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