Przeglądaj źródła

费用管理全部导出

ly 11 miesięcy temu
rodzic
commit
ef9b56ee37

+ 3 - 7
src/main/java/com/liang/controller/StaBudgetapprovalController.java

@@ -1246,15 +1246,11 @@ public class StaBudgetapprovalController extends BaseController {
1246 1246
     }
1247 1247
     @ResponseBody
1248 1248
     @RequestMapping(value = "/getAll",method = RequestMethod.GET)
1249
-    public Object getAll(){
1249
+    public BaseResult getAll(){
1250 1250
         Map<String, String> paraMap = new HashMap<>();
1251 1251
         List<FeeManagemant> list = prjProjectService.getFyglList(paraMap);
1252
-        Map<String, Object> resultMap = new HashMap<>();
1253
-        resultMap.put("code",0);
1254
-        resultMap.put("mes","");
1255
-        resultMap.put("count",list.size());
1256
-        resultMap.put("data",list);
1257
-    return resultMap;
1252
+
1253
+    return BaseResult.success(list);
1258 1254
     }
1259 1255
 
1260 1256
 

+ 26 - 3
src/main/resources/templates/stafeemanage/list_feemanage.html

@@ -61,7 +61,8 @@
61 61
                         </div>
62 62
 
63 63
                         <div class="layui-inline" style="margin-left: 0px">
64
-                            <button type="submit" class="layui-btn" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
64
+                            <button type="submit" class="layui-btn" lay-submit lay-filter="data-search-btn">
65
+                                <i class="layui-icon"></i> 搜 索</button>
65 66
                             <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-reset-btn"><i class="layui-icon layui-icon-refresh"></i> 重 置 </button>
66 67
                         </div>
67 68
                     </div>
@@ -76,7 +77,7 @@
76 77
         <button class="layui-btn layui-btn-sm layui-btn-warm" lay-event="view">
77 78
             <i class="layui-icon layui-icon-file" style="font-size: 10px;"></i>查看
78 79
         </button>
79
-        <button class="layui-btn layui-btn-sm" lay-event="exportExcel">
80
+        <button class="layui-btn layui-btn-sm" lay-event="export">
80 81
             <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>导出列表
81 82
         </button>
82 83
     </div>
@@ -104,7 +105,7 @@
104 105
             cols: [
105 106
                 [
106 107
                     {type: "checkbox", fixed: 'left'},
107
-                    {type: 'numbers', align: 'center', fixed: 'left'},
108
+                    {type: 'numbers', align: 'center', fixed: 'left',title: '序号'},
108 109
                     // {field: 'id', title: 'ID',hide:true},
109 110
                     {field: 'zwmc', width: '20%', title: '项目名称'},
110 111
                     {field: 'erpbh', width: '8%', title: 'ERP编号'},
@@ -145,6 +146,8 @@
145 146
             }
146 147
         });
147 148
 
149
+
150
+
148 151
         // 监听搜索操作
149 152
         form.on('submit(data-search-btn)', function (data) {
150 153
             // 执行搜索重载
@@ -269,6 +272,26 @@
269 272
             a.click();
270 273
             a.parentNode.removeChild(a);
271 274
         }
275
+        else if (obj.event === 'export'){
276
+            console.log('导出按钮');
277
+            $.ajax({
278
+                url: AjaxUtil.ctx + 'staBudgetapproval/getAll',
279
+                type: 'get',
280
+                success: function (res) {
281
+                    console.log('返回了数据'+res.data);
282
+                    res.data.forEach(function (item){
283
+
284
+                        console.log('Item:',item)
285
+            });
286
+
287
+                    table.exportFile('currentTableId',res.data,'xls'); //表名 数据  格式
288
+                },
289
+                error: function (xhr, status, error) {
290
+                    console.error('Error fetching data:', error);
291
+                }
292
+            });
293
+
294
+        }
272 295
         });
273 296
     });
274 297
     function setUpdateFlag() {