@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<script>
    layui.use(['jquery', 'form', 'laydate', 'common', 'optimizeSelectOption'], function () {
        var form = layui.form,
            $ = layui.$,
            common = layui.common,
            laydate = layui.laydate;
        var keyValue = $.request("keyValue");
        //权限字段
        common.authorizeFields('adminform');
        $(function () {
            initControl();
            if (!!keyValue) {
                common.ajax({
                    url: "/SystemOrganize/Organize/GetFormJson",
                    dataType: "json",
                    data: { keyValue: keyValue },
                    async: false,
                    success: function (data) {
                        common.val('adminform', data);
                        common.setReadOnly('adminform');
                    }
                });
            }
            form.render();
        });
        wcLoading.close();
        function initControl() {
            $("#F_ParentId").bindSelect({
                url: "/SystemOrganize/Organize/GetTreeSelectJson",
            });
            $("#F_CategoryId").bindSelect({
                data: top.clients.dataItems["OrganizeCategory"],
                id: '',
            });
        }
    });
    function search(fileds) {
        layui.use(['jquery', 'form', 'common'], function () {
            var form = layui.form,
                $ = layui.$,
                common = layui.common;
            //不同弹窗
            if (fileds == '用户') {
                common.modalOpen({
                    title: "选择用户",
                    url: "/SystemOrganize/User/AddForm?name=" + "F_ManagerName" + "&value=" + "F_ManagerId" + "&ids=" + $('#F_ManagerId').val(),
                    width: "650px",
                    height: "600px",
                });
            }
            else {
                return false;
            }
        });
    }
</script>
<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <div class="layui-form layuimini-form" lay-filter="adminform">
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">上级</label>
                    <div class="layui-input-block">
                        <select id="F_ParentId" name="F_ParentId">
                            <option value="0">父节点</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">类型</label>
                    <div class="layui-input-block">
                        <select id="F_CategoryId" name="F_CategoryId">
                            <option value="">==请选择==</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">名称</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_FullName" name="F_FullName" lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">编号</label>
                    <div class="layui-input-block">
                        <input type="text" id="F_EnCode" name="F_EnCode" lay-verify="required" class="layui-input ">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">负责人</label>
                    <div class="layui-input-block">
                        <input id="F_ManagerName" name="F_ManagerName" type="text" lay-verify="required" maxlength="50" autocomplete="off" class="layui-input" onclick="search('用户')" />
                        <input id="F_ManagerId" name="F_ManagerId" type="text" hidden />
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">显示顺序</label>
                    <div class="layui-input-block">
                        <input type="number" pattern="[0-9]*" id="F_SortCode" name="F_SortCode" lay-verify="required" class="layui-input ">
                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <label class="layui-form-label">选项</label>
                    <div class="layui-input-block">
                        <input type="checkbox" name="F_EnabledMark" id="F_EnabledMark" checked="" value="true" title="有效标识">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text layui-hide">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea id="F_Description" name="F_Description" class="layui-textarea"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>

</body>
