wtt
2025-04-01 af04f977e1ccf75942872156a2a03540e7d79667
导出采购入库收料通知
2个文件已修改
358 ■■■■■ 已修改文件
WebTM/views/采购管理/收料通知单/Cg_POInStockBillList.html 178 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/验收入库/外购入库/Kf_POStockInBillList.html 180 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/²É¹º¹ÜÀí/ÊÕÁÏ֪ͨµ¥/Cg_POInStockBillList.html
@@ -232,6 +232,7 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh" id="Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print" id="print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print1" id="print1"><i class="layui-icon layui-icon-print"></i>打印(收料单)</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Export" id="btn_Export"><i class="layui-icon layui-icon-export"></i>导出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>按钮设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit" id="Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
@@ -268,6 +269,7 @@
            var sWhere = "";
            var option = [];
            var HModName = "Cg_POInStockBillList";
            var ins;
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "1103";
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
@@ -668,7 +670,7 @@
                            laypage.render(optionPage);
                            //刷新表格数据
                            DisPlay_HideColumn();
                            ins = table.render(option);
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                            var HBillType = "1103";
@@ -853,6 +855,9 @@
                    //打印
                    case 'btn-print1':
                        get_PrintReport1();
                        break;
                    //导出按钮
                    case 'btn_Export': btn_Export();
                        break;
                    //列设置
                    case 'set_HideColumn':
@@ -1526,6 +1531,177 @@
            }
            //#endregion
            //权限判定
            function set_ModCheck(ModRightNameCheck) {
                var Permission = false;
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //方法所在页面和方法名
                    async: false,
                    data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            Permission = true;
                        } else {
                            layer.alert("当前模块没有查询权限!", { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                return Permission;
            }
            //#region å¯¼å‡ºExecel
            function btn_Export() {
                //权限判定
                if (!set_ModCheck("Cg_POInStockBill_ExportExcel")) {
                    return
                }
                var data;
                //设置sWhere
                var ajaxLoad = layer.load();
                var HDate = $("#HDate").val();//开始日期
                var HDate1 = $("#HDate1").val();//结束日期
                var HBillNo = $("#HBillNo").val();//单据号
                var HProjectNumber = $("#HProjectNumber").val(); //项目编号
                var HSupID = $("#HSupID").val();
                var HDeptID = $("#HDeptID").val();
                var HMangerID = $("#HMangerID").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 (Comparator) {
                        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 = "" + Comparator2 + "'" + ColContent2 + "'";
                            break;
                    }
                    sWhere += " and " + ColName2 + " " + com2;
                }
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
                if (HDate1) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HDate1 + "'";
                }
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                if (HProjectNumber) {
                    sWhere += " and é¡¹ç›®ä»£ç  like '%" + HProjectNumber + "%'";
                }
                if (HSupID) {
                    sWhere += " and ä¾›åº”商 like '%" + HSupID + "%'";
                }
                if (HDeptID) {
                    sWhere += " and éƒ¨é—¨ like '%" + HDeptID + "%'";
                }
                if (HMangerID) {
                    sWhere += " and ä¸»ç®¡ like '%" + HMangerID + "%'";
                }
                //sWhere += " and å…³é—­äºº =''";
                sWhere += addSWhereByOpenType();
                $.ajax({
                    url: GetWEBURL() + '/Cg_POInStockBill/list',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            data = data1.data
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    },
                    error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                sWhere = "";
                data.forEach((item) => {
                    for (let itemobj in item) {
                        if (item[itemobj] == null) {
                            item[itemobj] = "";
                        }
                        if (item[itemobj].length > 0) {  // å‡è®¾å­—段名为field
                            item[itemobj] = item[itemobj].toString().replaceAll(/[\r\n]+/g, '');  // å°†æ¢è¡Œç¬¦æ›¿æ¢ä¸ºç©ºå­—符串
                        }
                    }
                });
                table.exportFile(ins.config.id, data, "xls");
            }
            //#endregion
            //隐藏列设置
            function get_HideColumn() {
                var colName = "";
WebTM/views/ÑéÊÕÈë¿â/Í⹺Èë¿â/Kf_POStockInBillList.html
@@ -226,6 +226,7 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Drop" id="Drop"><i class="layui-icon layui-icon-radio"></i>作废</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop" id="DeDrop"><i class="layui-icon layui-icon-radio"></i>反作废</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print" id="print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Export" id="btn_Export"><i class="layui-icon layui-icon-export"></i>导出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>按钮设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit" id="Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
@@ -263,6 +264,7 @@
            var option = [];
            var HModName = "Kf_POStockInBillList";
            var HBillSubType = "";
            var ins;
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "1201";
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
@@ -649,7 +651,7 @@
                            laypage.render(optionPage);
                            //刷新表格数据
                            DisPlay_HideColumn();
                            ins = table.render(option);
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                            var HBillType = "1201";
@@ -794,6 +796,9 @@
                    //反作废按钮
                    case 'btn-DeDrop':
                        set_DropBill(2);
                        break;
                    //导出按钮
                    case 'btn_Export': btn_Export();
                        break;
                    //列设置
                    case 'set_HideColumn': get_HideColumn();
@@ -1633,6 +1638,175 @@
            }
            //#endregion 
            //权限判定
            function set_ModCheck(ModRightNameCheck) {
                var Permission = false;
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //方法所在页面和方法名
                    async: false,
                    data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            Permission = true;
                        } else {
                            layer.alert("当前模块没有查询权限!", { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                return Permission;
            }
            //#region å¯¼å‡ºExecel
            function btn_Export() {
                if (!set_ModCheck("Kf_POStockInBill_ExportExcel")) {
                    return
                }
                var data;
                //设置sWhere
                var ajaxLoad = layer.load();
                var HDate = $("#HBeginDate").val();//开始日期
                var HDate1 = $("#HEndDate").val();//结束日期
                var HBillNo = $("#HBillNo").val();//单据号
                var HProjectNumber = $("#HProjectNumber").val(); //项目编号
                var HSupID = $("#HSupID").val();
                var HDeptID = $("#HDeptID").val();
                var HMangerID = $("#HMangerID").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 (Comparator) {
                        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 = "" + Comparator2 + "'" + ColContent2 + "'";
                            break;
                    }
                    sWhere += " and " + ColName2 + " " + com2;
                }
                if (HDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + HDate + "'";
                }
                if (HDate1) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + HDate1 + "'";
                }
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                if (HProjectNumber) {
                    sWhere += " and é¡¹ç›®ä»£ç  like '%" + HProjectNumber + "%'";
                }
                if (HSupID) {
                    sWhere += " and ä¾›åº”商 like '%" + HSupID + "%'";
                }
                if (HDeptID) {
                    sWhere += " and éƒ¨é—¨ like '%" + HDeptID + "%'";
                }
                if (HMangerID) {
                    sWhere += " and è´Ÿè´£äºº like '%" + HMangerID + "%'";
                }
                sWhere += addSWhereByOpenType();
                $.ajax({
                    url: GetWEBURL() + '/Kf_POStockInBill/list',
                    type: "GET",
                    async:false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            data = data1.data
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.Message, { icon: 5 });
                        }
                    },
                    error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                sWhere = "";
                data.forEach((item) => {
                    for (let itemobj in item) {
                        if (item[itemobj] == null) {
                            item[itemobj] = "";
                        }
                        if (item[itemobj].length > 0) {  // å‡è®¾å­—段名为field
                            item[itemobj] = item[itemobj].toString().replaceAll(/[\r\n]+/g, '');  // å°†æ¢è¡Œç¬¦æ›¿æ¢ä¸ºç©ºå­—符串
                        }
                    }
                });
                table.exportFile(ins.config.id, data, "xls");
            }
            //#endregion
            //隐藏列设置
            function get_HideColumn() {
                var colName = "";
@@ -1759,9 +1933,9 @@
                                    option.cols[0][i]["sort"] = false;
                                }
                            }
                            table.render(option);
                            ins=table.render(option);
                        } else {
                            table.render(option);
                            ins=table.render(option);
                        }
                        //刷新按钮显示
                        var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象