Browse Source

[feat]

工程管理 bom信息
新增bom页面导出按钮判断是否有选中值,若无则导出所有数据的方法;
新增后端接口获得所有导出bom数据的方法;
dev
王晓迪 4 months ago
parent
commit
4aafbab74a
  1. 14
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java
  2. 24
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

14
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpBomController.java

@ -15,6 +15,7 @@ import com.ruoyi.erp.domain.*;
import com.ruoyi.erp.service.IErpBomService;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.SysOutGood;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.web.controller.demo.domain.UserOperateModel;
import org.activiti.engine.RuntimeService;
@ -147,6 +148,19 @@ public class ErpBomController extends BaseController
ExcelUtil<ErpBom> util = new ExcelUtil<ErpBom>(ErpBom.class);
return util.exportExcel(list, "bom数据");
}
/**
* 导出bom列表
*/
@RequiresPermissions("erp:bom:export")
@Log(title = "ErpBom", businessType = BusinessType.EXPORT)
@PostMapping("/exportAll")
@ResponseBody
public AjaxResult export(ErpBomVo erpBom)
{
List<ErpBom> list = erpBomService.getExportList(erpBom);
ExcelUtil<ErpBom> util = new ExcelUtil<ErpBom>(ErpBom.class);
return util.exportExcel(list, "bom数据");
}
/**
* 导出模板
*/

24
ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

@ -751,8 +751,26 @@
var bomNoData = [];
var selections = $("#bootstrap-table").bootstrapTable("getSelections");
if(selections.length === 0){
$.modal.alertWarning("请至少选择一条bom信息");
return;
// $.modal.alertWarning("请至少选择一条bom信息");
// return;
$.modal.confirm("确定导出所有bom吗?", 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("确定导出选中的所有" + table.options.modalName + "吗?", function () {
//·拼接单号
@ -760,7 +778,7 @@
bomNoData.push(selections[i].bomNo);
}
var bomNos = JSON.stringify(bomNoData);
console.log(bomNos);
// console.log(bomNos);
$.modal.loading("正在导出数据,请稍后...");
var config = {
url: prefix + '/export',

Loading…
Cancel
Save