<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改商品订单')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-commodityorder-edit" th:object="${commodityOrder}">
        <input name="orderId" th:field="*{orderId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>订单编号：</label>
            <div class="col-sm-8">
                <input th:value="${commodityOrder.orderId}" class="form-control" type="text" readonly>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>用户姓名：</label>
            <div class="col-sm-8">
                <input th:value="${commodityOrder.userName}" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>用户电话：</label>
            <div class="col-sm-8">
                <input th:value="${commodityOrder.userPhone}" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>订单金额：</label>
            <div class="col-sm-8">
                <input id="orderMoney" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label"><span style="color: red; ">*</span>订单数量：</label>
            <div class="col-sm-8">
                <input th:value="${commodityOrder.commodityCount}" class="form-control" type="text" readonly>
                <span class="help-block m-b-none"><i
                        class="fa fa-info-circle"></i> 提示：退款直接通过feign调用bussiness模块，集成分布式事务，及订单状态与产品数量一致性</span>
            </div>
        </div>


    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    var orderMoney = '[[${commodityOrder.orderMoney}]]';
    $(function(){
        $("#orderMoney").val((parseFloat(orderMoney) / 100).toFixed(2));
    })

    var prefix = ctx + "bussiness/commodityorder";
    $("#form-commodityorder-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-commodityorder-edit').serialize());
        }
    }

    $("input[name='updateTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>