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 5c08d0ca..1414bcba 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 @@ -20,6 +20,8 @@ import com.ruoyi.system.domain.exportDto.SysCustomerDto; import com.ruoyi.system.mapper.SysCustomerQuoteChildMapper; import com.ruoyi.system.service.*; import com.ruoyi.system.service.impl.SysCustomerQuoteServiceImpl; +import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage; +import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamageChild; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; import org.activiti.engine.runtime.ProcessInstance; @@ -29,6 +31,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; +import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; @@ -375,11 +378,18 @@ public class SysCustomerQuoteController extends BaseController @Log(title = "客户报价信息", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(@RequestBody String[] supplierCodes) + public AjaxResult export(SysCustomerQuoteVo sysCustomerQuoteVo, String ids) { - List list = sysCustomerQuoteService.selectCustomerQuoteOneBySupplierCodes(supplierCodes); - ExcelUtil util = new ExcelUtil(SysCustomerQuote.class); - return util.exportExcel(list, "销售客户报价数据"); + if (StringUtils.isEmpty(ids)){ + List list = sysCustomerQuoteService.exportSysCustomerQuoteList(sysCustomerQuoteVo); + ExcelUtil util = new ExcelUtil(SysCustomerQuoteVo.class); + return util.exportExcel(list, "客户报价数据"); + }else { + String[] supplierCodes = ids.split(","); + List list = sysCustomerQuoteService.selectCustomerQuoteOneBySupplierCodes(supplierCodes);//客户报价编号 + ExcelUtil util = new ExcelUtil(SysCustomerQuote.class); + return util.exportExcel(list, ids); + } } 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 0f1c15cf..59566254 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 @@ -33,7 +33,7 @@ public interface ISysCustomerQuoteService * @param sysCustomerQuote 客户报价信息 * @return 客户报价信息集合 */ - List selectSysCustomerQuoteList(SysCustomerQuote sysCustomerQuote); + List exportSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuote); List selectSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo); 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 5344381d..dfbae80e 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 @@ -89,8 +89,8 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService { } @Override - public List selectSysCustomerQuoteList(SysCustomerQuote sysCustomerQuote) { - return null; + public List exportSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo) { + return sysCustomerQuoteMapper.selectSysCustomerQuoteList(sysCustomerQuoteVo); } /** 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 22489952..4fc4d434 100644 --- a/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html +++ b/ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html @@ -368,55 +368,25 @@ // 导出 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