| | |
| | | <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> |
| | |
| | | var option = []; |
| | | var sWhere = ""; |
| | | var HModName = "Pay_WorkTimesReportBill"; |
| | | |
| | | var ins; |
| | | //ä¸éè¦æ¾ç¤ºçåæ®µ 坿©å± |
| | | var titleData = ["hmainid", "HDeptID", "HGroupID","HMangerID","HLeaveID","hsubid","HMaterID","HProcID","hEmpid"]; |
| | | //#endregion |
| | |
| | | break; |
| | | //å设置 |
| | | case 'set_HideColumn': get_HideColumn(); |
| | | break; |
| | | //å¯¼åºæé® |
| | | case 'btn_Export': btn_Export(); |
| | | break; |
| | | }; |
| | | }); |
| | |
| | | } |
| | | //#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(); |
| | |
| | | } |
| | | } |
| | | table.render(option); |
| | | ins = table.render(option); |
| | | } else { |
| | | table.render(option); |
| | | ins = table.render(option); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |