@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<style>
    #ISO {
        width: 10px;
    }
</style>
<link href="~/Content/js/select2/select2.min.css" rel="stylesheet" />
<script src="~/Content/js/select2/select2.min.js"></script>
<script>
    var ID = $.request("ID");
    var ColCode = $.request("ColCode");
    var ColName = decodeURI($.request("ColName"));
    var Enable = decodeURI($.request("Enable"));
    $(function () {
        if (ID != "") {
            $("#ColCode").val(ColCode);
            $("#ColName").val(ColName);
            if (Enable=='是') {
                $("#StatusYes").prop("checked", true);
            } else {
                $("#StatusNo").prop("checked", true);
            }
        }
    });


    function submitForm() {
        var ColCode = $("#ColCode").val();
        var ColName = $("#ColName").val();
        var Enable = $('input[name="State"]:checked').val();
        if (ColCode == "" || ColCode == undefined) {
            $.modalAlertNew("WMS00019");
            return;
        }
        if (ColName == "" || ColName == undefined) {
            $.modalAlertNew("WMS00026");
            return;
        }
        if (Enable == "" || Enable == undefined) {
            $.modalAlertNew("WMS00020");
            return;
        }
        var objArr = {
            ID:ID,
            ColCode: ColCode,
            ColName: ColName,
            Enable: Enable
        }
        debugger;
        if (ID!="") {
            $.submitForm({
                url: "/WMS/BasicSettings/UpdateICSExtensionEnable" + "?" + Math.random(),
                param: { keyValue: JSON.stringify(objArr) },
                success: function () {
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                }
            })
        } else {
            $.submitForm({
                url: "/WMS/BasicSettings/InsertICSExtensionEnable" + "?" + Math.random(),
                param: { keyValue: JSON.stringify(objArr) },
                success: function () {
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                }
            })
        }
    }

    //function ChcekboxChange() {
    //    debugger;
    //    $("#changechaeckbox").find("input[type='checkbox']").each(function (i, n) {
    //        if ($(this).prop('checked') == false) {
    //            $(this).val("");
    //        }

    //    });

</script>

<form id="form1">
    <div style="padding-top: 20px; margin-right: 20px;">
        <table class="form">
            <tr>
                <th class="formTitle">列编码:</th>
                <td class="formValue">
                    <input id="ColCode" name="ColCode" type="text" class="form-control required" style="width: 300px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="列编码" />
                </td>
            </tr>
            <tr>
                <th class="formTitle">列名称:</th>
                <td class="formValue">
                    <input id="ColName" name="ColName" type="text" class="form-control required" style="width: 300px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="列名称" />
                </td>
            </tr>
            <tr>
                <td>
                    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;是否隐藏:</label>
                </td>
                <td>
                    <div class="input-group" id="changechaeckbox">
                        <input type="radio" name="State" value="1" id="StatusYes" style="width:30px" /><label for="cb-NoQuotedPrice">是</label>
                        <label style="width:85px"></label>
                        <input type="radio" name="State" value="0" id="StatusNo" style="width:30px"  /><label for="cb-QuotedPrice">否</label>
                    </div>

                </td>
              
            </tr>


        </table>
    </div>
</form>