From 2c4e339508f78a215518a8a12af34ca0b1564d44 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 31 十月 2025 13:07:03 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI

---
 WebTM/views/基础资料/生产基础资料/Gy_Source.html |   63 ++++++++++++++++++++++++-------
 1 files changed, 49 insertions(+), 14 deletions(-)

diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Source.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Source.html"
index 218863a..35e9448 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Source.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_Source.html"
@@ -472,7 +472,11 @@
                                 else if ($.inArray(data[i].name, totalArray) > -1) { //璁$畻鍒�  
                                     col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, totalRow: true, width: 120 });
                                 } else if (data[i].name == '鐢熶骇璧勬簮浠g爜') {
-                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: false, width: 200, event: '鐢熶骇璧勬簮浠g爜' });
+                                    col.push({
+                                        field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '鐢熶骇璧勬簮浠g爜', templet: function (d) {
+                                            return '<span style="color: blue;">' + d.鐢熶骇璧勬簮浠g爜 + '</span>'
+                                        }, style: 'cursor: pointer;'
+                                    });
                                 } else {
                                     switch (data[i].Type) {
                                         //int
@@ -684,29 +688,33 @@
                     sWhere += " and " + ColName2 + " " + com2;
                 }
        
-                if (number == 1) {
-                    HOrgID = sessionStorage["OrganizationID"];
-                }
-                else {
-                    HOrgID = $("#HOrgID").val();//缁勭粐
-                }
+                //if (number == 1) {
+                //    HOrgID = sessionStorage["OrganizationID"];
+                //}
+                //else {
+                //    HOrgID = $("#HOrgID").val();//缁勭粐
+                //}
 
-                if (HOrgID) {
-                    sWhere += " and HUSEORGID = '" + HOrgID + "'";
-                }
+                //if (HOrgID) {
+                //    sWhere += " and HUSEORGID = '" + HOrgID + "'";
+                //}
 
                 if (Htype != "") {
                     Htype = decodeURI(Htype);
-                    sWhere += " and 绫诲瀷 = '" + Htype + "'";
+                    //sWhere += " and 绫诲瀷 = '" + Htype + "'";
                 }
 
                 if (HNumber) {
                     sWhere += " and 鐢熶骇璧勬簮浠g爜 like '%" + HNumber + "%'";
                 }
                 if (HName) {
-                    sWhere += " and 鐢熶骇璧勬簮鍚嶇О like '%" + HName + "%'";
-                }              
+                    sWhere += " and 鐢熶骇璧勬簮鍚嶇О like '%" + HName + "%'";                
+                }
+
                 sWhere += addSWhereByOpenType();
+
+                sWhere += getOrgIDByUser();//鐢ㄦ埛鍏宠仈缁勭粐鏌ヨ杩囨护
+
                 get_Display(sWhere);
                 sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
             }
@@ -979,11 +987,37 @@
                 var params = get_UrlVars();
 
                 var openType = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鎵撳紑鏂瑰紡  1鐩存帴鎵撳紑 2鍏跺畠椤甸潰閫氳繃閫夋嫨鎸夐挳鎵撳紑
-                if ( openType == "2") {
+                if (typeof (openType) != "undefined") {
                     sWhere += " and 绂佺敤鏍囪 != 'Y' and ISNULL(瀹℃牳浜�,'')  != ''"
                     return sWhere;
                 }
                 return sWhere;
+            }
+            //#endregion
+
+
+            //#region 鏍规嵁鐢ㄦ埛鑾峰彇鐢ㄦ埛鍏宠仈缁勭粐鐨勮繃婊ゆ潯浠�
+            function getOrgIDByUser() {
+                var res = "";
+                $.ajax({
+                    type: "GET",
+                    async: false,
+                    url: GetWEBURL() + "/Xt_User/getOrgIDListByUser", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�       浼犲弬 缁勭粐蹇呴』鏄垪琛ㄥご閮ㄦ煡璇㈢殑缁勭粐  涓嶈兘浣跨敤鐢ㄦ埛榛樿
+                    data: { "UserID": sessionStorage["Czybm"], "UserName": sessionStorage["HUserName"], HOrgID: $("#HOrgID").val() },
+                    success: function (result) {
+                        if (result.count == 1) {
+                            if (result.data[0].sWhere == "1") {
+                                res = " and HUSEORGID = '" + $("#HOrgID").val() + "'";
+                            } else {
+                                res = result.data[0].sWhere;
+                            }
+                        }
+                    }, error: function (err) {
+                        res = " and 1 = 0";
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+                return res;
             }
             //#endregion
 
@@ -1056,6 +1090,7 @@
                             //闅愯棌鏄剧ず杩囨护鏂规鐨勬爣绛句俊鎭�
                             document.getElementById("HFilterScheme_Now").style.display = "none";
                             //鎵ц鏌ヨ鏂规硶
+                            // get_FastQuery(1);
                             form.render("select");
                         }
                     }, error: function () {

--
Gitblit v1.9.1