1
yxj
2024-11-26 e9d2113417213c45750130861c935267498a90b1
WebTM/views/¹¤×ʹÜÀí/¿¼Çڻ㱨µ¥/Pay_WorkTimesSumQueryBillList.html
@@ -65,6 +65,7 @@
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></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"><i class="layui-icon layui-icon-form"></i>列设置</button>
                            </div>
                        </script>
@@ -91,7 +92,7 @@
            var option = [];
            var sWhere = "";
            var HModName = "Pay_WorkTimesReportBill";
            var ins;
            //不需要显示的字段 å¯æ‰©å±•
            var titleData = ["hmainid", "HDeptID", "HGroupID","HMangerID","HLeaveID","hsubid","HMaterID","HProcID","hEmpid"];
            //#endregion
@@ -115,6 +116,9 @@
                        break;
                    //列设置
                    case 'set_HideColumn': get_HideColumn();
                        break;
                    //导出按钮
                    case 'btn_Export': btn_Export();
                        break;
                };
            });
@@ -304,6 +308,24 @@
            }
            //#endregion
            //#region å¯¼å‡ºExecel
            function btn_Export() {
                var data = option.data
                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, option.data, "xls");
            }
            //#endregion
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
@@ -419,8 +441,10 @@
                                }
                            }
                            table.render(option);
                            ins = table.render(option);
                        } else {
                            table.render(option);
                            ins = table.render(option);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });