{layout:simple} {class:Shop.Admin.storeConfig.Transport_Price_Edit_window}
<lbbody>
    <form action="javascript:SaveObj();" novalidate>
        <div class="modal-header">
            <h4 class="modal-title"><%=Tag("编辑配送价格")%></h4>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
        </div>
        <div class="modal-body" style="max-height:500px;overflow-y:auto;">
            <div class="form-group">
                <label for="IsCanofflinePay"><%=Tag("货到付款")%>：</label>
                <div class="input-group">
                    <label class="custom-control custom-radio m-r-20">
                        <input type="radio" id="IsCanofflinePay_1" name="IsCanofflinePay" value="1" class="custom-control-input" shop="true" <%=model.IsCanofflinePay==1?"checked":"" %>>
                        <span class="custom-control-label"><%=Tag("开启")%></span>
                    </label>
                    <label class="custom-control custom-radio">
                        <input type="radio" id="IsCanofflinePay_0" name="IsCanofflinePay" value="0" class="custom-control-input" shop="true" <%=model.IsCanofflinePay==0?"checked":"" %>>
                        <span class="custom-control-label"><%=Tag("关闭")%></span>
                    </label>
                </div>
            </div>
            <div class="row">
                <div class="form-group col-sm-6">
                    <label for="OrderMoney"><%=Tag("订单金额")%>>=：</label>
                    <div class="input-group">
                        <input type="text" id="OrderMoney" name="OrderMoney" value="<%=model.OrderMoney %>" class="form-control" shop="true" required>
                    </div>
                </div>
                <div class="form-group col-sm-6">
                    <label for="Price_OrderMoneyOK"><%=Tag("运费")%>=：</label>
                    <div class="input-group">
                        <input type="text" id="Price_OrderMoneyOK" name="Price_OrderMoneyOK" value="<%=model.Price_OrderMoneyOK %>" class="form-control" shop="true" required>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label for="IsOnePrice"><%=Tag("定额运费")%>：</label>
                <div class="input-group">
                    <label class="custom-control custom-radio m-r-20">
                        <input type="radio" id="IsOnePrice_1" name="IsOnePrice" value="1" class="custom-control-input" shop="true" onclick="ChangePayType(1)" <%=model.IsOnePrice==1?"checked":"" %>>
                        <span class="custom-control-label"><%=Tag("是")%></span>
                    </label>
                    <label class="custom-control custom-radio">
                        <input type="radio" id="IsOnePrice_0" name="IsOnePrice" value="0" class="custom-control-input" shop="true" onclick="ChangePayType(0)" <%=model.IsOnePrice==0?"checked":"" %>>
                        <span class="custom-control-label"><%=Tag("否")%></span>
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label for="Price"><%=Tag("基准运费")%>：</label>
                <input type="text" id="Price" name="Price" value="<%=FormatMoney(model.Price," Number") %>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d\.\-]/g,'')">
            </div>
            <div id="muti">
                <%if (tmodel.Type_id_TransportType == 331){ %>
                <h5 class="box-title m-t-20"><%=Tag("货柜")%></h5>
                <div class="table-responsive">
                    <table class="table table-hover no-wrap">
                        <thead>
                            <tr>
                                <th style="width: 40px" class="selectAll">
                                    <a href="javascript:void(0);" onclick="$('input[name=\'Containerid\']').attr('checked',!$(this).attr('checked'));$(this).attr('checked',!$(this).attr('checked'));"><%=Tag("全选")%></a>
                                </th>
                                <th>
                                    <%=Tag("货柜名称")%>
                                </th>
                                <th style="width: 100px">
                                    <%=Tag("运费")%>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <%=Containestr %>
                        </tbody>
                    </table>
                </div>
                <%}else{ %>
                <div class="form-group">
                    <label for="Weight_Start"><%=Tag("起始重量")%>：</label>
                    <input type="text" id="Weight_Start" name="Weight_Start" value="<%=model.Weight_Start %>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d\.]/g,'')" required>
                </div>
                <div class="form-group">
                    <label for="Weight_Step"><%=Tag("递进重量")%>：</label>
                    <input type="text" id="Weight_Step" name="Weight_Step" value="<%=model.Weight_Step %>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d\.]/g,'')" required>
                </div>
                <div class="form-group">
                    <label for="Price_Step"><%=Tag("递进价格")%>：</label>
                    <input type="text" id="Price_Step" name="Price_Step" value="<%=FormatMoney(model.Price_Step," Number") %>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d\.]/g,'')" required>
                </div>
                <%} %>
            </div>
            <%if (model.id == 0){ %>
            <h5 class="box-title m-t-20"><%=Tag("配送地区")%></h5>
            <div class="form-group">
                <div class="row" id="proBox" style="overflow:hidden">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-header">
                                <a class="btn btn-success btn-xs btn-sm" href="javascript:void(0);" onclick="SelectArea(0,0);"><i class="ti-plus"></i> <%=Tag("添加")%></a>
                                <a class="btn btn-danger btn-xs btn-sm" href="javascript:void(0);" onclick="delitem();"><i class="ti-close"></i> <%=Tag("删除")%></a>
                                <a class="btn btn-danger btn-xs btn-sm" href="javascript:void(0);" onclick="remove();"><i class="ti-trash"></i> <%=Tag("清空")%></a>
                            </div>
                            <div class="card-body b-t">
                                <div class="multi-list" id="Area_idsList"><ul></ul></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div id="Area_names"></div>
            </div>
            <%} %>
            <div class="form-group">
                <label for="Description"><%=Tag("货运描述")%>：</label>
                <textarea id="Description" name="Description" class="form-control" style="height: 60px;" shop="true"><%=model.Description%></textarea>
                <div class="button-group m-t-5">
                    <button type="button" class="btn btn-default btn-xs btn-sm" onclick="javascript:resizeEditor('Description',100);"><%=Tag("展开")%></button>
                    <button type="button" class="btn btn-default btn-xs btn-sm" onclick="javascript:resizeEditor('Description',-100);"><%=Tag("收缩")%></button>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal"><i class="ti-close"></i> <%=Tag("关闭")%></button>
            <button type="submit" class="btn btn-success"><i class="ti-check"></i> <%=Tag("保存")%></button>
        </div>
    </form>
    <script>
        ! function (window, document, $) {
            "use strict";
            $("input,select,textarea").not("[type=submit]").jqBootstrapValidation()
        }(window, document, jQuery);
        $('#Area_idsList ul').selectedElement({ css: 'on' });
        function remove() {
            $('#Area_idsList ul li').remove();
            //        $('#Area_ids').val("");
        }
        function delitem() {
            $('#Area_idsList ul li[selectedElement]').remove();
        }
        function SaveObj() {
            $("#EditModal").modal("hide");
            var postData = GetFormJsonData("shop");
            var url = "<%=site.AdminPath %>/ajax/ajax_site.aspx?__Action=Transport_Price_Edit&id=<%=model.id %>&tid=<%=tmodel.id %>";
            RequestAjax(url, postData, function () { MsgBox(1, "<%=Tag("操作成功")%>", "?") });
        }
        function SelectArea(pid, notid) {
            var title_ = "<%=Tag("编辑配送地区")%>";
            if (pid == 0) title_ = "<%=Tag("添加配送地区")%>";
            $("#EditsubModal").modal("show");
            $.ajax({
                url: "area_window.aspx",
                type: "GET",
                cache: false,
                data: { pid: pid, notid: notid, title: title_ },
            }).done(function (result) {
                $("#EditsubModal .modal-content").html(result);
            });
        }
        function ChangePayType(t) {
            if (t == 1) {
                $("#muti").hide();
                //$("#once").show();
            } else {
                $("#muti").show();
                //$("#once").hide();
            }
        }
        ChangePayType(<%=model.IsOnePrice %>);
    </script>
</lbbody>