diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java index 0bace43c..5f386507 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java @@ -11,6 +11,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.remind.service.RemindService; @@ -215,16 +216,7 @@ public class SysCustomerQuoteController extends BaseController return list; } - @RequiresPermissions("system:customerQuote:export") - @Log(title = "客户报价信息", businessType = BusinessType.EXPORT) - @RequestMapping("/exportCustomerInfo") - @ResponseBody - public void exportCustomerInfo(@RequestBody String selectData, HttpServletResponse response) throws IOException { - //数据处理 - JSONObject jsonObject = (JSONObject) JSONObject.parse(selectData); - JSONArray jsonArray = jsonObject.getJSONArray("selectData"); - List selectDataList = JSONObject.parseArray(String.valueOf(jsonArray), SysCustomerDto.class); - } + /** * 获取客户报价编号 */ @@ -335,6 +327,22 @@ public class SysCustomerQuoteController extends BaseController } + + /** + * 导出客户报价列表 + */ + @RequiresPermissions("system:customerQuote:export") + @Log(title = "客户报价信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(@RequestBody String[] supplierCodes) + { + List list = sysCustomerQuoteService.selectCustomerQuoteOneBySupplierCodes(supplierCodes); + ExcelUtil util = new ExcelUtil(SysCustomerQuote.class); + return util.exportExcel(list, "销售客户报价数据"); + } + + /** * 导出客户报价模板1 * */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java index d49078b9..fc838c30 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerQuoteMapper.java @@ -105,4 +105,9 @@ public interface SysCustomerQuoteMapper public int restoreSysCustomerQuoteById(Long id); int insertSysCustomerQuote(SysCustomerQuoteVo sysCustomerQuote); + + /** + * 根据供应商编码数组查询客户报价信息集合 + * */ + List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java index 36dd5669..64f847d4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java @@ -107,4 +107,9 @@ public interface ISysCustomerQuoteService * 导出客户报价模板4 * */ void exportCustomerQuoteFour(String supplierCode, HttpServletResponse response); + + /** + * 根据供应商编码数组查询客户报价信息集合 + * */ + List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java index a330b5e1..7e72ff55 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java @@ -92,6 +92,14 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { return null; } + /** + * 根据供应商编码数组查询客户报价信息集合 + * */ + @Override + public List selectCustomerQuoteOneBySupplierCodes(String[] supplierCodes) { + List list = sysCustomerQuoteMapper.selectCustomerQuoteOneBySupplierCodes(supplierCodes); + return list; + } @Override public List selectSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo) diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml index e4ed55b5..486d6d65 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml @@ -115,6 +115,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where customerCode = #{cusotomerCode} + + insert into sys_customer_quote diff --git a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html index b0a39343..dfdeb624 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html @@ -67,7 +67,7 @@ 添加 - + 导出 @@ -83,7 +83,6 @@ 导出客户报价4 -
@@ -131,7 +130,6 @@ restoreUrl: prefix + "/restore/{id}", detailUrl: prefix + "/detail/{id}", exportUrl: prefix + "/export", - pageList: [5, 10, 25, 50], modalName: "客户报价表", fixedColumns:true, fixedRightNumber:1, @@ -223,6 +221,61 @@ + // 导出 + function exportExcel(formId) { + // $.table.set(); + var supplierCodeData = []; + var selections = $("#bootstrap-table").bootstrapTable("getSelections"); + if(selections.length === 0){ + $.modal.confirm("确定导出所有的客户报价吗?", function() { + var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; + var params = $("#bootstrap-table").bootstrapTable('getOptions'); + var dataParam = $("#" + currentId).serializeArray(); + dataParam.push({ "name": "orderByColumn", "value": params.sortName }); + dataParam.push({ "name": "isAsc", "value": params.sortOrder }); + $.modal.loading("正在导出数据,请稍后..."); + $.post(prefix + '/exportAll', dataParam, function(result) { + if (result.code == web_status.SUCCESS) { + window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; + } else if (result.code == web_status.WARNING) { + $.modal.alertWarning(result.msg) + } else { + $.modal.alertError(result.msg); + } + $.modal.closeLoading(); + }); + }); + }else { + $.modal.confirm("确定导出选中的所有客户报价吗?", function () { + //·拼接单号 + for(let i=0;i