@{
    ViewBag.Title = "";
    Layout = "~/Views/Shared/_LayoutTable.cshtml";
}
<div class="wrapper wrapper-content animated fadeInDown">
    <div class="ibox float-e-margins">
        <div class="ibox-content">

            <table id="newConfigurationTable" class="table table-bordered table-striped table-hover">
                <tr style="height: 40px">
                    <td style="text-align: right">有货库存标准：</td>
                    <td>
                        <input type="text" id="txt1" value="">
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right">无货库存标准：</td>
                    <td>
                        <input type="text" id="txt2" value="">
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td style="text-align: left; height: 60px">
                        <button id="btnSubmit" class="btn btn-default" onclick="SaveTags()"><i class="glyphicon glyphicon-ok"></i>保存</button>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">

    //保存库存标准
    function SaveTags() {
        $.ajax({
            url: "../WLTManage/SaveStockStandard",
            data: {
                value1: $.trim($("#txt1").val()),
                value2: $.trim($("#txt2").val()),
                typeid: parent.$("#hidPtypeid").val()
            },
            datatype: "text",
            type: "post",
            success: function (data) {
                if (data == "保存成功！") {
                    parent.$('#CommoditiesTable').bootstrapTable('refresh');
                    parent.layer.msg(data, { time: 2000 })
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                } else {
                    layer.msg(data, { time: 2000 });
                }
            }
        })
    }

    $(function () {
        if (parent.$("#hid1").val() != "null") {
            $("#txt1").val(parent.$("#hid1").val());
        }
        else {
            $("#txt1").val('');
        }
        if (parent.$("#hid2").val() != "null")
            $("#txt2").val(parent.$("#hid2").val());
        else
            $("#txt2").val('');

    });
</script>
