From a775034b6d7cc32108529eb7c579552b1afd2256 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期一, 11 十一月 2024 17:21:10 +0800
Subject: [PATCH] 1

---
 WebTM/views/计划管理/工艺路线/Gy_RoutingBillList.html |  161 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 159 insertions(+), 2 deletions(-)

diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html"
index 5d59a8a..0652702 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillList.html"
@@ -1416,7 +1416,8 @@
                     url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
                     data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
                     success: function (result) {
-                        var data = option.data
+
+                        var data = getExportData();
                         data.forEach((item) => {
                             for (let itemobj in item) {
                                 if (item[itemobj] == null) {
@@ -1428,7 +1429,7 @@
                             }
                         });
                         if (result.count == 1) {
-                            table.exportFile(ins.config.id, option.data, "xls");
+                            table.exportFile(ins.config.id, data, "xls");
                         } else {
                             layer.alert("褰撳墠妯″潡娌℃湁瀵煎嚭鏉冮檺!", { icon: 5 });
                         }
@@ -1439,6 +1440,162 @@
             }
             //#endregion
 
+            //#region 鑾峰彇瀵煎嚭鏁版嵁
+            function getExportData() {
+                var data;;//瀵煎嚭鐨勬暟鎹�
+                var ajaxLoad = layer.load();
+                var HDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�
+                var HDate1 = $("#HEndDate").val();//缁撴潫鏃ユ湡
+                var HOrgID = "";
+                var HOrderProcNO = $("#HOrderProcNO").val();//鍗曟嵁绫诲瀷
+                //var HMaterID = $("#HMaterID").val();
+                var HMaterName = $("#HMaterName").val();
+                var HMaterNumber = $("#HMaterNumber").val();
+                var HModel = $("#HModel").val();
+                var WorkCenter = $("#WorkCenter").val();//鍗曟嵁鍙�
+                var HProject = $("#HProject").val();
+                var ColName = $("#ColName").val();//澶嶉�夋
+                var Comparator = $("#Comparator").val()
+                var ColContent = $("#ColContent").val();
+                var ColName1 = $("#ColName1").val();//澶嶉�夋
+                var Comparator1 = $("#Comparator1").val()
+                var ColContent1 = $("#ColContent1").val();
+                var ColName2 = $("#ColName2").val();//澶嶉�夋
+                var Comparator2 = $("#Comparator2").val()
+                var ColContent2 = $("#ColContent2").val();
+
+                if (ColName != 0 && Comparator != 0) {
+                    var com = "";
+                    switch (Comparator) {
+                        case "7":
+                            com = "like'%" + ColContent + "%'";
+                            break;
+                        case "8":
+                            com = "like'%" + ColContent + "'";
+                            break;
+                        case "9":
+                            com = "like'" + ColContent + "%'";
+                            break;
+                        case "10":
+                            com = "not like'%" + ColContent + "%'";
+                            break;
+                        default:
+                            com = "" + Comparator + "'" + ColContent + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName + " " + com;
+                }
+
+                if (ColName1 != 0 && Comparator1 != 0) {
+                    var com1 = "";
+                    switch (Comparator1) {
+                        case "7":
+                            com1 = "like'%" + ColContent1 + "%'";
+                            break;
+                        case "8":
+                            com1 = "like'%" + ColContent1 + "'";
+                            break;
+                        case "9":
+                            com1 = "like'" + ColContent1 + "%'";
+                            break;
+                        case "10":
+                            com1 = "not like'%" + ColContent1 + "%'";
+                            break;
+                        default:
+                            com1 = "" + Comparator1 + "'" + ColContent1 + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName1 + " " + com1;
+                }
+                if (ColName2 != 0 && Comparator2 != 0) {
+                    var com2 = "";
+                    switch (Comparator2) {
+                        case "7":
+                            com2 = "like'%" + ColContent2 + "%'";
+                            break;
+                        case "8":
+                            com2 = "like'%" + ColContent2 + "'";
+                            break;
+                        case "9":
+                            com2 = "like'" + ColContent2 + "%'";
+                            break;
+                        case "10":
+                            com2 = "not like'%" + ColContent2 + "%'";
+                            break;
+                        default:
+                            com2 = "" + Comparator + "'" + ColContent + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName2 + " " + com2;
+                }
+                if (HDate) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
+                }
+                if (HDate1) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate1 + "'";
+                }
+                if (HMaterID != "" && HMaterID != "undefined" && HMaterID != null) {
+                    //浠庡埆鐨勯〉闈㈡墦寮�浼犲叆Hmaterid鍊硷紝璁剧疆鐗╂枡杩囨护,鏈叧闂�
+                    sWhere += " and HMaterID = " + HMaterID + " and 鐘舵��='瀹℃牳' and 澶辨晥鏃堕棿>GETDATE()";
+                } else {
+                    //涓嶆槸浠庡埆鐨勯〉闈㈡墦寮�
+                    var HMaterID2 = $("#HMaterID").val();
+                    sWhere += (HMaterID2 == 0 ? "" : (" and HMaterID = " + HMaterID2));
+                }
+                if (HProID != 0 && HProID != "undefined" && HProID != null) {
+                    sWhere += " and HMainProcID = " + HProID;
+                }
+                var HOrgID = $("#HOrgID").val();//缁勭粐
+                if (HOrderProcNO) {
+                    sWhere += " and 鍗曟嵁绫诲瀷 like '%" + HOrderProcNO + "%'";
+                }
+                if (HMaterName) {
+                    sWhere += "and 鐗╂枡鍚嶇О like '%" + HMaterName + "%'";
+                }
+                if (HMaterNumber) {
+                    sWhere += "and  鐗╂枡浠g爜 like '%" + HMaterNumber + "%'";
+                }
+                if (HModel) {
+                    sWhere += "and  瑙勬牸鍨嬪彿 like '%" + HModel + "%'";
+                }
+                if (WorkCenter) {
+                    sWhere += " and 鍗曟嵁鍙� like '%" + WorkCenter + "%'";
+                }
+                if (HOrgID) {
+                    sWhere += " and HOrgID = '" + HOrgID + "'";
+                }
+                if (HProject != '0') {
+                    sWhere += " and 椤圭洰鍙� like '%" + HProject + "%'";
+                }
+                
+                sWhere += " and 宸ュ簭浠g爜 != '9999' and HBillSubType<>'SUB'"
+                //鏌ヨ璇彞
+                $.ajax({
+                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
+                    url: GetWEBURL() + '/LEMS/MES_Gy_RoutingBillList_Json',
+                    type: "GET",
+                    async:false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
+                    success: function (data1) {
+                        if (data1.count == 1) {
+                            data = data1.data;//鍒楀瓧娈垫暟鎹�
+                            layer.close(ajaxLoad);
+                            //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(data1.code + data1.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+                sWhere = "";
+                return data;
+
+            }
+            //#endregin
+
             //#region 鍙戣捣瀹℃壒
             function set_startCheckBill() {
                 var checkStatus = table.checkStatus('mainTable')

--
Gitblit v1.9.1