1
duhe
2024-11-11 7eda5aaa12c20334544c2d71943a4dfa4313ed8f
WebTM/views/¼Æ»®¹ÜÀí/¹¤ÒÕ·Ïß/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  ç‰©æ–™ä»£ç  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 å·¥åºä»£ç  != '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')