yusijie
2025-08-15 afc30d805a3121988be9a425455c2f6313d81d63
WebTM/views/ϵͳ¹ÜÀí/Óû§¹ÜÀí/Xt_UserList.html
@@ -48,8 +48,10 @@
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">对应CLOUD组织</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HUSEORGID" id="HUSEORGID">
                                    <div class="layui-input-block" style=" width: 185px;">
                                        <select name="HUSEORGID" id="HUSEORGID" class="ForFilteringSchemes" lay-verify="HUSEORGID">
                                            <!--动态渲染组织-->
                                        </select>
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
@@ -262,10 +264,11 @@
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
            function set_ClearBill() {
                set_StockOrg();
                //初始化表格(主表)
                set_InitGrid();
                //查询
                get_Display(sWhere);
                get_FastQuery();
                DisPlay_HideColumn();
            }
            //初始化表格(主表)
@@ -559,9 +562,11 @@
                if (HName) {
                    sWhere += " and ç”¨æˆ·åç§° like '%" + HName + "%'";
                }
                if (HUSEORGID) {
                    sWhere += " and å¯¹åº”CLOUD组织 like '%" + HUSEORGID + "%'";
                }
                //if (HUSEORGID) {
                //    sWhere += " and å¯¹åº”CLOUD组织 like '%" + HUSEORGID + "%'";
                //}
                sWhere += getOrgIDByUser();//用户关联组织查询过滤
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
@@ -727,6 +732,60 @@
                form.render('select');
            }
            //#endregion
            //#region   èŽ·å–ç»„ç»‡
            function set_StockOrg() {
                //获取登录页组织列
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Web/GetOrganizations",
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    success: function (result) {
                        var Organization = "";
                        Organization += '<option  style="color:blue;" value="">全部</option>';
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data;
                            for (var i = 0; i < data.length; i++) {
                                Organization += '<option  style="color:blue;" value="' + data[i].Name + '">' + data[i].Name + '</option>';
                            }
                            $("#HUSEORGID").append(Organization);
                            $("#HUSEORGID").val(sessionStorage["Organization"])
                            form.render('select');
                        }
                        layer.closeAll("loading");
                    },
                    complete: function (XHR, TS) { XHR = null }//回收资源
                })
            }
            //#endregion
            //#region æ ¹æ®ç”¨æˆ·èŽ·å–ç”¨æˆ·å…³è”ç»„ç»‡çš„è¿‡æ»¤æ¡ä»¶
            function getOrgIDByUser() {
                var res = "";
                $.ajax({
                    type: "GET",
                    async: false,
                    url: GetWEBURL() + "/Xt_User/getOrgIDListByUser", //方法所在页面和方法名       ä¼ å‚ ç»„织必须是列表头部查询的组织  ä¸èƒ½ä½¿ç”¨ç”¨æˆ·é»˜è®¤
                    data: { "UserID": sessionStorage["Czybm"], "UserName": sessionStorage["HUserName"], HOrgID: $("#HUSEORGID").val() },
                    success: function (result) {
                        if (result.count == 1) {
                            if (result.data[0].sWhere == "1") {
                                res = " and å¯¹åº”CLOUD组织 = '" + $("#HUSEORGID").val() + "'";
                            } else {
                                res = result.data[0].sWhere;
                            }
                        }
                    }, error: function (err) {
                        res = " and 1 = 0";
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                return res;
            }
            //#endregion
            //#endregion