diff --git a/erp-modular/src/main/java/com/skyeye/controller/ReceivablesController.java b/erp-modular/src/main/java/com/skyeye/controller/ReceivablesController.java index a2ffbd0a..094593aa 100644 --- a/erp-modular/src/main/java/com/skyeye/controller/ReceivablesController.java +++ b/erp-modular/src/main/java/com/skyeye/controller/ReceivablesController.java @@ -91,4 +91,17 @@ public class ReceivablesController { public void queryReceivablesByDetail(InputObject inputObject, OutputObject outputObject) throws Exception{ receivablesService.queryReceivablesByDetail(inputObject, outputObject); } + + /** + * 导出Excel + * @param inputObject + * @param outputObject + * @throws Exception + */ + @RequestMapping("/post/ReceivablesController/queryMationToExcel") + @ResponseBody + public void queryMationToExcel(InputObject inputObject, OutputObject outputObject) throws Exception{ + receivablesService.queryMationToExcel(inputObject, outputObject); + } + } diff --git a/erp-modular/src/main/java/com/skyeye/dao/ReceivablesDao.java b/erp-modular/src/main/java/com/skyeye/dao/ReceivablesDao.java index a7218819..9280b2b8 100644 --- a/erp-modular/src/main/java/com/skyeye/dao/ReceivablesDao.java +++ b/erp-modular/src/main/java/com/skyeye/dao/ReceivablesDao.java @@ -35,5 +35,7 @@ public interface ReceivablesDao { public int deleteReceivablesItemById(Map params) throws Exception; public List> queryUserInfoById(Map bean) throws Exception; + + public List> queryMationToExcel(Map params) throws Exception; } diff --git a/erp-modular/src/main/java/com/skyeye/service/ReceivablesService.java b/erp-modular/src/main/java/com/skyeye/service/ReceivablesService.java index e7d2ddfb..e3f95f6e 100644 --- a/erp-modular/src/main/java/com/skyeye/service/ReceivablesService.java +++ b/erp-modular/src/main/java/com/skyeye/service/ReceivablesService.java @@ -21,5 +21,7 @@ public interface ReceivablesService { public void deleteReceivablesById(InputObject inputObject, OutputObject outputObject) throws Exception; public void queryReceivablesByDetail(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void queryMationToExcel(InputObject inputObject, OutputObject outputObject) throws Exception; } diff --git a/erp-modular/src/main/java/com/skyeye/service/impl/ReceivablesServiceImpl.java b/erp-modular/src/main/java/com/skyeye/service/impl/ReceivablesServiceImpl.java index 967bf1be..21a6ec96 100644 --- a/erp-modular/src/main/java/com/skyeye/service/impl/ReceivablesServiceImpl.java +++ b/erp-modular/src/main/java/com/skyeye/service/impl/ReceivablesServiceImpl.java @@ -14,6 +14,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.skyeye.common.object.InputObject; import com.skyeye.common.object.OutputObject; +import com.skyeye.common.util.ExcelUtil; import com.skyeye.common.util.ToolUtil; import com.skyeye.dao.ReceivablesDao; import com.skyeye.erp.util.ErpConstants; @@ -237,4 +238,23 @@ public class ReceivablesServiceImpl implements ReceivablesService { outputObject.setreturnMessage("该数据已不存在."); } } + + /** + * 导出Excel + * @param inputObject + * @param outputObject + * @throws Exception + */ + @SuppressWarnings("static-access") + @Override + public void queryMationToExcel(InputObject inputObject, OutputObject outputObject) throws Exception { + Map params = inputObject.getParams(); + params.put("userId", inputObject.getLogParams().get("id")); + List> beans = receivablesDao.queryMationToExcel(params); + String[] key = new String[]{"billNo", "supplierName", "totalPrice", "hansPersonName", "billTime"}; + String[] column = new String[]{"单据编号", "付款单位", "合计金额", "经手人", "单据日期"}; + String[] dataType = new String[]{"", "data", "data", "data", "data"}; + //收款单信息导出 + ExcelUtil.createWorkBook("收款单", "收款单详细", beans, key, column, dataType, inputObject.getResponse()); + } } diff --git a/erp-modular/src/main/resources/dbmapper/erp/ReceivablesMapper.xml b/erp-modular/src/main/resources/dbmapper/erp/ReceivablesMapper.xml index 09c78db7..d80f85e9 100644 --- a/erp-modular/src/main/resources/dbmapper/erp/ReceivablesMapper.xml +++ b/erp-modular/src/main/resources/dbmapper/erp/ReceivablesMapper.xml @@ -165,5 +165,31 @@ WHERE INSTR(CONCAT(',', #{handsPersonId}, ','), CONCAT(',', a.user_id, ',')) + + \ No newline at end of file diff --git a/erp-modular/src/main/resources/mapping/erp.xml b/erp-modular/src/main/resources/mapping/erp.xml index d10056d6..36812e55 100644 --- a/erp-modular/src/main/resources/mapping/erp.xml +++ b/erp-modular/src/main/resources/mapping/erp.xml @@ -449,6 +449,11 @@ + + + + + diff --git a/erp-modular/src/main/resources/template/js/receivables/receivableslist.js b/erp-modular/src/main/resources/template/js/receivables/receivableslist.js index e2e383dc..21dd23ef 100644 --- a/erp-modular/src/main/resources/template/js/receivables/receivableslist.js +++ b/erp-modular/src/main/resources/template/js/receivables/receivableslist.js @@ -15,7 +15,8 @@ layui.config({ form = layui.form, laydate = layui.laydate, table = layui.table; - authBtn('1571810865614'); + authBtn('1571810865614');//新增 + authBtn('1572314972518');//导出 laydate.render({ elem: '#billTime', //指定元素 @@ -42,7 +43,6 @@ layui.config({ { field: 'totalPrice', title: '合计金额', align: 'left', width: 120}, { field: 'hansPersonName', title: '经手人', align: 'left', width: 100}, { field: 'billTime', title: '单据日期', align: 'center', width: 140 }, - { field: 'remark', title: '备注', align: 'center', width: 140 }, { title: '操作', fixed: 'right', align: 'center', width: 200, toolbar: '#tableBar'} ]] }); @@ -142,7 +142,7 @@ layui.config({ $("body").on("click", "#formSearch", function () { refreshTable(); - }) + }); //刷新 function loadTable(){ @@ -153,7 +153,7 @@ layui.config({ startTime = $("#billTime").val().split('~')[0].trim() + ' 00:00:00'; endTime = $("#billTime").val().split('~')[1].trim() + ' 23:59:59'; } - table.reload("messageTable", {where:{billNo: $("#billNo").val(), material: $("#material").val(), startTime: startTime, endTime: endTime}}); + table.reload("messageTable", {where:{billNo: $("#billNo").val(), startTime: startTime, endTime: endTime}}); } //搜索 @@ -165,8 +165,24 @@ layui.config({ startTime = $("#billTime").val().split('~')[0].trim() + ' 00:00:00'; endTime = $("#billTime").val().split('~')[1].trim() + ' 23:59:59'; } - table.reload("messageTable", {page: {curr: 1}, where:{billNo: $("#billNo").val(), material: $("#material").val(), startTime: startTime, endTime: endTime}}) + table.reload("messageTable", {page: {curr: 1}, where:{billNo: $("#billNo").val(), startTime: startTime, endTime: endTime}}) } + + //导出excel + $("body").on("click", "#downloadExcel", function () { + if(isNull($("#billTime").val())){//一定要记得,当createTime为空时 + startTime = ""; + endTime = ""; + }else { + startTime = $("#billTime").val().split('~')[0].trim() + ' 00:00:00'; + endTime = $("#billTime").val().split('~')[1].trim() + ' 23:59:59'; + } + postDownLoadFile({ + url : reqBasePath + 'receivables007?userToken=' + getCookie('userToken') + '&loginPCIp=' + returnCitySN["cip"], + params: {billNo: $("#billNo").val(), startTime: startTime, endTime: endTime}, + method : 'post' + }); + }); exports('receivableslist', {}); }); diff --git a/erp-modular/src/main/resources/template/tpl/receivables/receivableslist.html b/erp-modular/src/main/resources/template/tpl/receivables/receivableslist.html index 601c5da9..c7ae489f 100644 --- a/erp-modular/src/main/resources/template/tpl/receivables/receivableslist.html +++ b/erp-modular/src/main/resources/template/tpl/receivables/receivableslist.html @@ -30,6 +30,7 @@
+