<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrganManage.aspx.cs" Inherits="M_Main.SysNew.OrganManage" %>

<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
    <title></title>
    <script src="../jscript/jquery-1.11.3.min.js"></script>
    <script src="../jscript/jquery.tool.js" type="text/javascript"></script>
    <script src="../jscript/JSClient.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/themes/icon.css">
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="../Jscript-Ui/jquery-easyui-1.4.4/jquery.extend.js"></script>
    <link rel="stylesheet" type="text/css" href="../Jscript-Ui/jquery-easyui-1.4.4/demo/demo.css">
    <script src="../jscript/ToPinYin.js"></script>
    <script src="../jscript/Dialog.js" type="text/javascript"></script>
    <link href="../css/button.css" type="text/css" rel="stylesheet" />
    <script src="../jscript/MapData/CityJson.js" type="text/javascript"></script>
    <script src="../jscript/MapData/ProJson.js" type="text/javascript"></script>
    <script src="../jscript/MapData/DistrictJson.js" type="text/javascript"></script>
    <script src="../jscript/Dialog.js" type="text/javascript"></script>
    <style type="text/css">
        body {
            margin: 0px;
            margin-top: 0px;
            overflow: hidden;
            background-color: #ffffff;
            padding: 5px;
        }

        .Container {
            width: 100%;
            height: auto;
            margin-top: 5px;
            font-size: 12px;
            font-family: 微软雅黑;
        }

            .Container ul {
                margin: 0px auto;
                clear: both;
            }

                .Container ul .InputTitle {
                    list-style-type: none;
                    float: left;
                    text-align: center;
                    margin-bottom: 10px;
                    min-height: 22px;
                    line-height: 22px;
                    width: 80px;
                    text-align: right;
                }

                .Container ul .TextareaTitle {
                    list-style-type: none;
                    float: left;
                    text-align: right;
                    margin-bottom: 10px;
                    width: 80px;
                    text-align: right;
                }

                .Container ul .Content {
                    list-style-type: none;
                    float: left;
                    text-align: left;
                    margin-bottom: 10px;
                    width: 80%;
                }

                .Container ul .ContentBlank {
                    list-style-type: none;
                    float: left;
                    width: 80%;
                    text-align: left;
                    margin-bottom: 10px;
                }

                .Container ul .Submit {
                    list-style-type: none;
                    text-align: center;
                    padding-top: 4px;
                    width: 80%;
                    height: 40px;
                }

            .Container .Content textarea {
                width: 70%;
                height: 100px;
                overflow: scroll;
                resize: none;
                border: 1px solid #cccccc;
                padding-left: 2px;
            }

            .Container .Content input {
                width: 99%;
                border: 1px solid #cccccc;
                height: 22px;
                padding-left: 2px;
            }

            .Container .Content select {
                height: 22px;
            }
    </style>
</head>
<body>
    <form id="frmForm" runat="server">
        <div class="Container">
            <ul>
                <li class="InputTitle">机构名称：</li>
                <li class="Content">
                    <input id="OrganName" name="OrganName" runat="server" class="easyui-validatebox" data-options="required:true,validType:['chinese']">
                </li>
            </ul>
            <ul>
                <li class="InputTitle">排列序号：</li>
                <li class="Content">
                    <input id="Num" name="Num" runat="server" class="easyui-validatebox " data-options="required:true">
                </li>
            </ul>
            <ul>
                <li class="InputTitle">是否公司：</li>
                <li class="Content" style="width: auto">
                    <select id="IsComp" name="IsComp" runat="server" class="easyui-validatebox " data-options="required:true">
                        <option value="0">否</option>
                        <option value="1">是</option>
                    </select>
                </li>

                <li class="InputTitle" style="width: 120px; float: left;">是否区域：</li>
                <li class="Content" style="width: auto; float: left;">
                    <select id="IsOrganComp" name="IsOrganComp" runat="server" class="easyui-validatebox " data-options="required:true">
                        <option value="0">否</option>
                        <option value="1">是</option>
                    </select>
                </li>

                <li class="InputTitle" style="width: 120px; float: left;">是否片区：</li>
                <li class="Content" style="width: auto; float: left;">
                    <select name="IsArea" id="IsArea" class="easyui-validatebox " runat="server" data-options="required:true">
                        <option value="0">否</option>
                        <option value="1">是</option>
                    </select>
                </li>

            </ul>
            <ul>
                <li class="InputTitle">所属公司：</li>
                <li class="Content">
                    <select id="CityCompany" name="CityCompany" runat="server"></select>
                </li>
            </ul>
            <ul style="display: none;">
                <li class="InputTitle">印章编码：</li>
                <li class="Content" style="width: auto">
                    <input id="txtYz" name="txtYz" style="width: 200px" runat="server" class="easyui-validatebox" data-options="required:true,validType:['length[0,10]','english']">
                </li>
                <li class="InputTitle" style="width: 120px">证照编码：</li>
                <li class="Content" style="width: auto">
                    <input id="txtZz" name="txtZz" style="width: 200px" runat="server" class="easyui-validatebox" data-options="required:true,validType:['length[0,10]','english']">
                </li>
            </ul>
            <ul style="display: none;">
                <li class="InputTitle" style="width: 120px">往年追缴率目标：</li>
                <li class="Content" style="width: auto">
                    <input id="RecoveryRate" name="RecoveryRate" style="width: 80px" runat="server">%
                </li>
                <li class="InputTitle" style="width: 120px">本年收费率目标：</li>
                <li class="Content" style="width: auto">
                    <input id="ChargeRate" name="ChargeRate" style="width: 80px" runat="server">%
                </li>
                <li class="InputTitle" style="width: 120px">本年追缴率目标：</li>
                <li class="Content" style="width: auto">
                    <input id="ArrearsRecoveryRate" name="ArrearsRecoveryRate" style="width: 80px" runat="server">%
                </li>
            </ul>
            <ul>
                <li class="Submit">
                    <input type="button" class="button" value="保存" id="BtnSave" />
                </li>
            </ul>
        </div>
        <input type="hidden" id="CommID" name="CommID" runat="server" />
        <input type="hidden" id="OrganCode" name="OrganCode" runat="server" />
        <input type="hidden" id="OpType" name="OpType" value="edit" runat="server" />
        <script type="text/javascript">
            $(function () {
                $("#OrganName").blur(function () {
                    Edit();
                });
                Edit();
            });

            function Edit() {
                var s = getPinYinByName($("#OrganName").val());
                if (s.length > 10) {
                    s = s.substring(0, 10);
                }
                if ($("#txtYz").val() == "") {
                    $("#txtYz").val(s);
                }
                if ($("#txtZz").val() == "") {
                    $("#txtZz").val(s);
                }
            }
            //更新小区代码
            $("#BtnSave").click(function () {
                Update();
            });
            function Update() {
                $.tool.DataPostChk('frmForm', 'Organ', 'SaveOrgan', $('#frmForm').serialize(),
                    function Init() {
                    },
                    function callback(_Data) {
                        if (_Data == 'false') {
                            HDialog.Info(_Data);
                        }
                        else {
                            $("#OpType").val("edit");
                            varObjects = eval("(" + _Data.replace(/\\/g, "/") + ")"); //转换为json对象
                            if (varObjects.length > 0) {
                                $("#OrganCode").val(varObjects[0].OrganCode);
                                parent.window.frames["OrganTree"].window.RefreshLeftTree(varObjects[0].OrganCode, varObjects[0].CommID);
                            }
                        }
                    },
                    function completeCallback() {
                    },
                    function errorCallback() {
                    });
            }

        </script>
    </form>
</body>
</html>
