Browse Source

[fix]

销售管理 客户报价
修改销售客户报价列表导出controller接口,实现多选和全部导出;
修改销售客户报价页面导出按钮绑定方法;
修改销售客户报价获取报价列表service方法,返回所有列表数据;
dev
王晓迪 2 weeks ago
parent
commit
e72c303e8c
  1. 16
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java
  3. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java
  4. 54
      ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html

16
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<SysCustomerQuote> list = sysCustomerQuoteService.selectCustomerQuoteOneBySupplierCodes(supplierCodes);
if (StringUtils.isEmpty(ids)){
List<SysCustomerQuoteVo> list = sysCustomerQuoteService.exportSysCustomerQuoteList(sysCustomerQuoteVo);
ExcelUtil<SysCustomerQuoteVo> util = new ExcelUtil<SysCustomerQuoteVo>(SysCustomerQuoteVo.class);
return util.exportExcel(list, "客户报价数据");
}else {
String[] supplierCodes = ids.split(",");
List<SysCustomerQuote> list = sysCustomerQuoteService.selectCustomerQuoteOneBySupplierCodes(supplierCodes);//客户报价编号
ExcelUtil<SysCustomerQuote> util = new ExcelUtil<SysCustomerQuote>(SysCustomerQuote.class);
return util.exportExcel(list, "销售客户报价数据");
return util.exportExcel(list, ids);
}
}

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java

@ -33,7 +33,7 @@ public interface ISysCustomerQuoteService
* @param sysCustomerQuote 客户报价信息
* @return 客户报价信息集合
*/
List<SysCustomerQuoteVo> selectSysCustomerQuoteList(SysCustomerQuote sysCustomerQuote);
List<SysCustomerQuoteVo> exportSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuote);
List<SysCustomerQuoteVo> selectSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo);

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java

@ -89,8 +89,8 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
}
@Override
public List<SysCustomerQuoteVo> selectSysCustomerQuoteList(SysCustomerQuote sysCustomerQuote) {
return null;
public List<SysCustomerQuoteVo> exportSysCustomerQuoteList(SysCustomerQuoteVo sysCustomerQuoteVo) {
return sysCustomerQuoteMapper.selectSysCustomerQuoteList(sysCustomerQuoteVo);
}
/**

54
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 });
var ids = $.table.selectColumns("supplierCode");
var dataParam = $("#formId").serializeArray();
let tipMsg = "确定导出当前所有数据吗?";
if ($.common.isNotEmpty(ids)) {
tipMsg = `确定导出 ${ids} 数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.confirm(tipMsg, function () {
$.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)
$.post( prefix + "/export", dataParam, function (result) {
if (result.code === web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName="+ encodeURI(result.msg) + "&delete=" + true;
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}else {
$.modal.confirm("确定导出选中的所有客户报价吗?", function () {
//·拼接单号
for(let i=0;i<selections.length;i++){
supplierCodeData.push(selections[i].supplierCode);
}
var supplierCodes = JSON.stringify(supplierCodeData);
// console.log(bomNos);
$.modal.loading("正在导出数据,请稍后...");
var config = {
url: prefix + '/export',
type: "post",
dataType: "json",
contentType: "application/json;charset=utf-8",
data: supplierCodes,
success: function(result) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
$.modal.alertSuccess("导出成功!")
$.modal.closeLoading();
},
error: function (result){
$.modal.alertError(result.msg);
}
};
$.ajax(config)
});
}
};

Loading…
Cancel
Save