cwjbxqmz
2024-01-16 435e5bf7960b4bf8d437a6a54ac52a945ddf711a
WebTM/views/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillList.html
@@ -244,22 +244,30 @@
                , laypage = layui.laypage
                , laydate = layui.laydate
                , soulTable = layui.soulTable
            //var sWhere = " äº§å“ä»£ç  = 'BX0002'";
            var sWhere = "";
            var sWhere = "";
            var HModName = "Sc_ICMOBillList";
            var HDeptID = 0;
            var params = getUrlVars();
            var HDeptID = params[params[0]];
            var option = [];
            var ins;                        //用于导出excel
            //是否已经选择了过滤方案
            window.HDefaultFilter = "";
            //选择的过滤方案内码
            window.HInterID_Choose = 0;
            //判断是否有参数传递
            //#region ã€è¿‡æ»¤æ–¹æ¡ˆã€‘
            //过滤条件的classç±»
            var HClassTag = "ForFilteringSchemes";
            //模块名称(中文版) æ¯ä¸ªæ¨¡å—页面都需要修改
            window.HModuleName = "生产订单";
            //是否已经选择了过滤方案(全局变量)
            window.HDefaultFilter = "";
            //选择的过滤方案内码(全局变量)
            window.HInterID_Choose = 0;
            //#endregion
            //初始化表格
            DisPlay_HideColumn();
@@ -1638,32 +1646,44 @@
                return res;
            }
            //#region ã€è¿‡æ»¤æ–¹æ¡ˆã€‘
            //获取当前用户的默认过滤方案
            function get_DefaultModule() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
                    type: "GET",
                    data: { "user": sessionStorage["Czybm"], "HModuleName": "生产订单", "HInterID": 0, "Type": "Default" },
                    data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": 0, "Type": "Default" },
                    success: function (data1) {
                        if (data1.count == 1) {
                            //当前用户设置有默认的过滤方案
                            var data = data1.data;
                            //当前选择的过滤方案
                            HInterID_Choose = data[0].hmainid;
                            //过滤方案内码
                            HInterID = data[0].hmainid
                            //过滤方案名称
                            HDefaultFilter = data[0].方案名称
                            //过滤方案的备注(方案信息描述)
                            var HRemark = data[0].备注
                            //显示出当前的默认过滤方案
                            document.getElementById("HFilterScheme_Now").style.display = "block";
                            document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + HRemark + ")" + '</span>';
                            //把过滤条件值回写到页面上
                            for (let i = 0; i < data.length; i++) {
                                $("#" + data[i].过滤字段ID).val(data[i].过滤值);
                                if (data[i].过滤标签类型 == 'SELECT') {
                                    $("#" + data[i].过滤字段ID).find("option[value='" + data[i].过滤值 + "']").attr("selected", true);
                                }
                            }
                            //执行查询方法
                            get_FastQuery()
                            form.render("select");
                        } else {
                            //当前用户没有设置默认的过滤方案
                            //隐藏显示过滤方案的标签信息
                            document.getElementById("HFilterScheme_Now").style.display = "none";
                            //执行查询方法
                            get_FastQuery()
                            form.render("select");
                        }
@@ -1676,13 +1696,16 @@
            //保存方案
            function set_SaveScheme() {
                var index = layer.open()
                //判断用户是否点击了右上角的“叉号”关闭弹窗页面
                var HIsClose_Manual = false;
                var Filter = document.getElementsByClassName("ForFilteringSchemes"); //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
                //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
                var Filter = document.getElementsByClassName(HClassTag);
                var HFilterIdList = "";
                var HFilterIdLists = "";
                var HValue = "";
                var HElement_type = "";
                var HFilterIdList = "";//过滤条件
                var HFilterIdLists = "";//拼接多个过滤条件
                var HValue = "";//过滤值
                var HElement_type = "";//过滤标签类型
                for (var i = 0; i < Filter.length; i++) {
                    HFilterIdList = Filter[i].id; //过滤条件ID
                    HFilterIdLists += Filter[i].id + ","; //过滤条件ID(拼接)
@@ -1690,18 +1713,19 @@
                    HElement_type += document.getElementById(HFilterIdList).tagName + ",";//通过标签id获取标签类型
                }
                //对数组进行编码
                //去除末尾逗号
                HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
                HValue = HValue.substring(0, HValue.length - 1);
                HElement_type = HElement_type.substring(0, HElement_type.length - 1);
                //当前页面上没有选择过滤方案,进入新增方法
                if (HDefaultFilter == "") {
                    layer.open({
                        type: 2
                        , area: ['40%', '80%']
                        , title: '过滤方案'
                        , shift: 0//弹出动画
                        , content: '../../系统管理/过滤方案设置/Xt_FastICScheme.html?OperationType=1&HModuleName=生产订单&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
                        , content: '../../系统管理/过滤方案设置/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
                        , cancel: function () {
                            // å³ä¸Šè§’关闭事件的逻辑
                            HIsClose_Manual = true;
@@ -1711,12 +1735,13 @@
                                get_FastQuery();
                                //显示当前的过滤方案
                                document.getElementById("HFilterScheme_Now").style.display = "block";
                                document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
                                document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
                            }
                        }
                    })
                    layer.close(index)
                } else {
                    //当前页面已有过滤方案,用户选择 æ–°å¢žæˆ–者编辑
                    layer.confirm('当前已选择过滤方案,是否修改?请选择对应操作', {
                        title: "操作提示",
                        icon: 0,
@@ -1728,17 +1753,18 @@
                            , area: ['40%', '80%']
                            , title: '过滤方案'
                            , shift: 0//弹出动画
                            , content: '../../系统管理/过滤方案设置/Xt_FastICScheme.html?OperationType=1&HModuleName=生产订单&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
                            , content: '../../系统管理/过滤方案设置/Xt_FastICScheme.html?OperationType=1&HModuleName=' + HModuleName + '&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
                            , end: function () {
                                get_FastQuery()
                                get_FastQuery()
                                //显示当前的过滤方案
                                document.getElementById("HFilterScheme_Now").style.display = "block";
                                document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
                                document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + sessionStorage["HFilterSchemeName_" + sessionStorage["Czybm"]] + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + sessionStorage["HFilterSchemeRemark_" + sessionStorage["Czybm"]] + ")" + '</span>';
                            }
                        })
                        layer.close(index)
                    }, function (index) {
                        var Filter_Edit = document.getElementsByClassName("ForFilteringSchemes"); //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
                        //编辑
                        var Filter_Edit = document.getElementsByClassName(HClassTag); //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
                        HFilterIdList = "";
                        HFilterIdLists = "";
                        HValue = "";
@@ -1749,10 +1775,11 @@
                            HValue += $("#" + HFilterIdList).val() + ","; //过滤条件中输入的值
                            HElement_type += document.getElementById(HFilterIdList).tagName + ",";//通过标签id获取标签类型
                        }
                        //对数组进行编码
                        //去除末尾逗号
                        HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
                        HValue = HValue.substring(0, HValue.length - 1);
                        HElement_type = HElement_type.substring(0, HElement_type.length - 1);
                        var sMainSub = HInterID_Choose + ';' + HFilterIdLists + ';' + HValue + ';' + HElement_type + ';' + sessionStorage["HUserName"] + ';' + 3;
                        //修改
@@ -1764,11 +1791,7 @@
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                    layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                        parent.layer.close(index); //再执行关闭
                                    });
                                    layer.msg(data.Message, { time: 1 * 1000, icon: 1 });
                                }
                                else {
@@ -1793,7 +1816,7 @@
            //读取方案
            function set_ReadScheme() {
                var HIsClose_Manual = false;
                var Filter = document.getElementsByClassName("ForFilteringSchemes"); //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
                var Filter = document.getElementsByClassName(HClassTag); //获取本页所有过滤条件对象(class中包含"ForFilteringSchemes"的元素)
                var HFilterIdList = "";
                var HFilterIdLists = "";
@@ -1805,7 +1828,7 @@
                    HValue += $("#" + HFilterIdList).val() + ","; //过滤条件中输入的值
                    HElement_type += document.getElementById(HFilterIdList).tagName + ",";//通过标签id获取标签类型
                }
                //对数组进行编码
                //去除末尾逗号
                HFilterIdLists = HFilterIdLists.substring(0, HFilterIdLists.length - 1);
                HValue = HValue.substring(0, HValue.length - 1);
                HElement_type = HElement_type.substring(0, HElement_type.length - 1);
@@ -1815,7 +1838,7 @@
                    , area: ['80%', '80%']
                    , title: '过滤方案列表'
                    , shift: 0//弹出动画
                    , content: '../../系统管理/过滤方案设置/Xt_FastICSchemeList.html?HType=Select&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type
                    , content: '../../系统管理/过滤方案设置/Xt_FastICSchemeList.html?HType=Select&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type + '&HModuleName=' + HModuleName
                    , cancel: function () {
                        // å³ä¸Šè§’关闭事件的逻辑
                        HIsClose_Manual = true;
@@ -1828,13 +1851,17 @@
                    }
                })
            }
            //#endregion
            //#endregion
            //以上是layui模块
        });
        // è¿‡æ»¤æ–¹æ¡ˆè¿”回数据
        //#region ã€è¿‡æ»¤æ–¹æ¡ˆè¿”回数据】
        function HFilterScheme(obj)  //返回过滤方案
        {
            var HInterID = obj[0].hmainid;
@@ -1842,7 +1869,7 @@
            $.ajax({
                url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
                type: "GET",
                data: { "user": sessionStorage["Czybm"], "HModuleName": "生产订单", "HInterID": HInterID, "Type": "Select" },
                data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": HInterID, "Type": "Select" },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = data1.data;
@@ -1871,6 +1898,7 @@
                }
            });
        }
        //#endregion
    </script>
</body>