feat():前端组件样式修改,后端逻辑优化;

master
jiyufei 3 months ago
parent 1600316297
commit 50f2217a22

@ -4,6 +4,7 @@ import jnpf.model.yysmonthlyproduction.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* yysMonthlyProduction
@ -29,6 +30,6 @@ public interface YysMonthlyProductionService extends IService<YysMonthlyProducti
//副表数据方法
String checkForm(YysMonthlyProductionForm form,int i);
String saveOrUpdate(YysMonthlyProductionForm yysMonthlyProductionForm, String id, boolean isSave) ;
String saveOrUpdate(YysMonthlyProductionForm yysMonthlyProductionForm,String id, boolean isSave);
}

@ -1,17 +1,28 @@
package jnpf.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import jnpf.entity.*;
import jnpf.mapper.YysMonthlyProductionMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.yysmonthlyproduction.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
@ -25,6 +36,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
@ -49,17 +63,7 @@ public class YysMonthlyProductionServiceImpl extends ServiceImpl<YysMonthlyProdu
@Override
public List<YysMonthlyProductionEntity> getList(YysMonthlyProductionPagination yysMonthlyProductionPagination) {
// QueryWrapper<YysMonthlyProductionEntity> wrapper = new QueryWrapper<>();
// if (ObjectUtil.isNotEmpty(yysMonthlyProductionPagination.getYears())) {
// wrapper.lambda().eq(YysMonthlyProductionEntity::getYears, yysMonthlyProductionPagination.getYears().toString());
// }
// wrapper.lambda().isNull(YysMonthlyProductionEntity::getDeleteMark);
// wrapper.last("ORDER BY CAST(day AS UNSIGNED)");
// Page<YysMonthlyProductionEntity> page = new Page<>(yysMonthlyProductionPagination.getCurrentPage(), yysMonthlyProductionPagination.getPageSize());
// IPage<YysMonthlyProductionEntity> userIPage = this.page(page, wrapper);
// return yysMonthlyProductionPagination.setData(userIPage.getRecords(), userIPage.getTotal());
return getTypeList(yysMonthlyProductionPagination, yysMonthlyProductionPagination.getDataType());
}
/**
@ -161,10 +165,13 @@ public class YysMonthlyProductionServiceImpl extends ServiceImpl<YysMonthlyProdu
if (ObjectUtil.isNotEmpty(yysMonthlyProductionPagination.getYears())) {
yysMonthlyProductionNum++;
String value = yysMonthlyProductionPagination.getYears() instanceof List ?
JsonUtil.getObjectToString(yysMonthlyProductionPagination.getYears()) :
String.valueOf(yysMonthlyProductionPagination.getYears());
yysMonthlyProductionQueryWrapper.lambda().eq(YysMonthlyProductionEntity::getYears, value);
List YearsList = JsonUtil.getJsonToList(yysMonthlyProductionPagination.getYears(), String.class);
Long fir = Long.valueOf(String.valueOf(YearsList.get(0)));
Long sec = Long.valueOf(String.valueOf(YearsList.get(1)));
yysMonthlyProductionQueryWrapper.lambda().ge(YysMonthlyProductionEntity::getYears, new Date(fir))
.le(YysMonthlyProductionEntity::getYears, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
@ -202,6 +209,8 @@ public class YysMonthlyProductionServiceImpl extends ServiceImpl<YysMonthlyProdu
List<String> finalAllRuleIDlist = allRuleIDlist;
yysMonthlyProductionQueryWrapper.lambda().and(t -> t.in(YysMonthlyProductionEntity::getId, finalAllRuleIDlist));
}
//假删除标志
yysMonthlyProductionQueryWrapper.lambda().isNull(YysMonthlyProductionEntity::getDeleteMark);
//排序
if (StringUtil.isEmpty(yysMonthlyProductionPagination.getSidx())) {
@ -270,21 +279,31 @@ public class YysMonthlyProductionServiceImpl extends ServiceImpl<YysMonthlyProdu
id = form.getId();
}
//主表字段验证
if (StringUtil.isEmpty(form.getYears())) {
return "年月不能为空";
}
if (StringUtil.isEmpty(form.getProductId())) {
return "产品编码不能为空";
}
if (StringUtil.isEmpty(form.getProductName())) {
return "产品名称不能为空";
}
if (StringUtil.isEmpty(form.getModel())) {
return "规格型号不能为空";
}
if (StringUtil.isEmpty(form.getMeasurementUnit())) {
return "计量单位不能为空";
}
if (StringUtil.isNotEmpty(form.getMeasurementNumber())) {
if (!Pattern.compile("^\\d+$").matcher(String.valueOf(form.getMeasurementNumber())).matches()) {
return "请输入正确的数字";
}
}
if (StringUtil.isEmpty(form.getCurrentInventory())) {
return "当前库存不能为空";
}
if (StringUtil.isNotEmpty(form.getCurrentInventory())) {
if (!Pattern.compile("^\\d+$").matcher(String.valueOf(form.getCurrentInventory())).matches()) {
return "请输入正确的数字";
}
}
return countRecover;
}
@ -299,31 +318,33 @@ public class YysMonthlyProductionServiceImpl extends ServiceImpl<YysMonthlyProdu
@Transactional
public String saveOrUpdate(YysMonthlyProductionForm yysMonthlyProductionForm, String id, boolean isSave) {
UserInfo userInfo = userProvider.get();
LambdaQueryWrapper<YysMonthlyProductionEntity> wrapper = new LambdaQueryWrapper<>(YysMonthlyProductionEntity.class);
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
yysMonthlyProductionForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(YysMonthlyProductionConstant.getFormData(), yysMonthlyProductionForm), YysMonthlyProductionForm.class);
YysMonthlyProductionEntity entity = JsonUtil.getJsonToBean(yysMonthlyProductionForm, YysMonthlyProductionEntity.class);
java.sql.Date sqlDate = new java.sql.Date(Long.parseLong(yysMonthlyProductionForm.getYears()));
LambdaQueryWrapper<YysMonthlyProductionEntity> wrapper = new LambdaQueryWrapper<>(YysMonthlyProductionEntity.class);
wrapper.eq(YysMonthlyProductionEntity::getProductName, yysMonthlyProductionForm.getProductName());
wrapper.eq(YysMonthlyProductionEntity::getProductId, yysMonthlyProductionForm.getProductId());
wrapper.eq(YysMonthlyProductionEntity::getYears, sqlDate);
if (isSave) {
wrapper.eq(YysMonthlyProductionEntity::getYears, yysMonthlyProductionForm.getYears());
wrapper.eq(YysMonthlyProductionEntity::getProductName, yysMonthlyProductionForm.getProductName());
if (CollectionUtils.isNotEmpty(this.list(wrapper))) {
return "所选年月与产品已被创建";
return "所选年月及产品名称已经创建";
}
String mainId = RandomUtil.uuId();
entity.setCreatorTime(DateUtil.getNowDate());
entity.setCreatorUserId(userInfo.getUserId());
entity.setId(mainId);
entity.setVersion(0);
} else {
wrapper.ne(YysMonthlyProductionEntity::getYears, yysMonthlyProductionForm.getYears());
wrapper.ne(YysMonthlyProductionEntity::getProductName, yysMonthlyProductionForm.getProductName());
if (CollectionUtils.isNotEmpty(this.list(wrapper))) {
return "所选年月与产品已被创建";
YysMonthlyProductionEntity byId = this.getById(yysMonthlyProductionForm.getId());
boolean isProductNameChanged = !byId.getProductName().equals(yysMonthlyProductionForm.getProductName());
boolean isProductCodeChanged = !byId.getProductId().equals(yysMonthlyProductionForm.getProductId());
boolean isYearsChanged = !byId.getYears().equals(sqlDate);
if (isProductNameChanged || isProductCodeChanged || isYearsChanged) {
if (CollectionUtils.isNotEmpty(this.list(wrapper))) {
return "所选年月及产品名称已经存在,无法修改";
}
}
entity.setLastModifyTime(DateUtil.getNowDate());
entity.setLastModifyUserId(userInfo.getUserId());
@ -333,6 +354,5 @@ public class YysMonthlyProductionServiceImpl extends ServiceImpl<YysMonthlyProdu
return "操作成功";
}
return "操作失败";
}
}

@ -15,16 +15,20 @@ import jnpf.model.yysmonthlyproduction.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile;
@ -36,7 +40,9 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.File;
import jnpf.onlinedev.model.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
@ -51,6 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
/**
* yysMonthlyProduction
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
@ -58,7 +65,7 @@ import org.springframework.transaction.annotation.Transactional;
*/
@Slf4j
@RestController
@Tag(name = "yysMonthlyProduction" , description = "example")
@Tag(name = "yysMonthlyProduction", description = "example")
@RequestMapping("/api/example/YysMonthlyProduction")
public class YysMonthlyProductionController {
@ -72,30 +79,29 @@ public class YysMonthlyProductionController {
private YysMonthlyProductionService yysMonthlyProductionService;
@Autowired
private ConfigValueUtil configValueUtil;
/**
*
*
* @param yysMonthlyProductionPagination
* @return
*/
*
*
* @param yysMonthlyProductionPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody YysMonthlyProductionPagination yysMonthlyProductionPagination)throws IOException{
List<YysMonthlyProductionEntity> list= yysMonthlyProductionService.getList(yysMonthlyProductionPagination);
List<Map<String, Object>> realList=new ArrayList<>();
public ActionResult list(@RequestBody YysMonthlyProductionPagination yysMonthlyProductionPagination) throws IOException {
List<YysMonthlyProductionEntity> list = yysMonthlyProductionService.getList(yysMonthlyProductionPagination);
List<Map<String, Object>> realList = new ArrayList<>();
for (YysMonthlyProductionEntity entity : list) {
Map<String, Object> yysMonthlyProductionMap=JsonUtil.entityToMap(entity);
yysMonthlyProductionMap.put("id", yysMonthlyProductionMap.get("id"));
//副表数据
//子表数据
Map<String, Object> yysMonthlyProductionMap = JsonUtil.entityToMap(entity);
yysMonthlyProductionMap.put("id", yysMonthlyProductionMap.get("id"));
//副表数据
//子表数据
realList.add(yysMonthlyProductionMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, YysMonthlyProductionConstant.getFormData(), YysMonthlyProductionConstant.getColumnData(), yysMonthlyProductionPagination.getModuleId(),false);
realList = generaterSwapUtil.swapDataList(realList, YysMonthlyProductionConstant.getFormData(), YysMonthlyProductionConstant.getColumnData(), yysMonthlyProductionPagination.getModuleId(), false);
//返回对象
PageListVO vo = new PageListVO();
@ -104,94 +110,100 @@ public class YysMonthlyProductionController {
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param yysMonthlyProductionForm
* @return
*/
*
*
* @param yysMonthlyProductionForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid YysMonthlyProductionForm yysMonthlyProductionForm) {
String b = yysMonthlyProductionService.checkForm(yysMonthlyProductionForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
String b = yysMonthlyProductionService.checkForm(yysMonthlyProductionForm, 0);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
String result = yysMonthlyProductionService.saveOrUpdate(yysMonthlyProductionForm, null, true);
if (result.contains("成功")) {
return ActionResult.success(result);
}
return ActionResult.success(yysMonthlyProductionService.saveOrUpdate(yysMonthlyProductionForm, null, true));
return ActionResult.fail(result);
}
/**
* Excel
*
* @return
*/
* Excel
*
* @return
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody YysMonthlyProductionPagination yysMonthlyProductionPagination) throws IOException {
if (StringUtil.isEmpty(yysMonthlyProductionPagination.getSelectKey())){
if (StringUtil.isEmpty(yysMonthlyProductionPagination.getSelectKey())) {
return ActionResult.fail("请选择导出字段");
}
List<YysMonthlyProductionEntity> list= yysMonthlyProductionService.getList(yysMonthlyProductionPagination);
List<Map<String, Object>> realList=new ArrayList<>();
List<YysMonthlyProductionEntity> list = yysMonthlyProductionService.getList(yysMonthlyProductionPagination);
List<Map<String, Object>> realList = new ArrayList<>();
for (YysMonthlyProductionEntity entity : list) {
Map<String, Object> yysMonthlyProductionMap=JsonUtil.entityToMap(entity);
yysMonthlyProductionMap.put("id", yysMonthlyProductionMap.get("id"));
//副表数据
//子表数据
Map<String, Object> yysMonthlyProductionMap = JsonUtil.entityToMap(entity);
yysMonthlyProductionMap.put("id", yysMonthlyProductionMap.get("id"));
//副表数据
//子表数据
realList.add(yysMonthlyProductionMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, YysMonthlyProductionConstant.getFormData(), YysMonthlyProductionConstant.getColumnData(), yysMonthlyProductionPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(yysMonthlyProductionPagination.getSelectKey())?yysMonthlyProductionPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
realList = generaterSwapUtil.swapDataList(realList, YysMonthlyProductionConstant.getFormData(), YysMonthlyProductionConstant.getColumnData(), yysMonthlyProductionPagination.getModuleId(), false);
String[] keys = !StringUtil.isEmpty(yysMonthlyProductionPagination.getSelectKey()) ? yysMonthlyProductionPagination.getSelectKey() : new String[0];
UserInfo userInfo = userProvider.get();
DownloadVO vo = this.creatModelExcel(configValueUtil.getTemporaryFilePath(), realList, keys, userInfo);
return ActionResult.success(vo);
}
/**
*
*/
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
DownloadVO vo=DownloadVO.builder().build();
List<ExcelExportEntity> entitys=new ArrayList<>();
if(keys.length>0){
for(String key:keys){
switch(key){
case "years" :
entitys.add(new ExcelExportEntity("年月" ,"years"));
break;
case "productId" :
entitys.add(new ExcelExportEntity("产品编码" ,"productId"));
break;
case "productName" :
entitys.add(new ExcelExportEntity("产品名称" ,"productName"));
break;
case "model" :
entitys.add(new ExcelExportEntity("规格型号" ,"model"));
break;
case "measurementUnit" :
entitys.add(new ExcelExportEntity("计量单位" ,"measurementUnit"));
break;
case "measurementNumber" :
entitys.add(new ExcelExportEntity("计量数量" ,"measurementNumber"));
break;
case "currentInventory" :
entitys.add(new ExcelExportEntity("当前库存" ,"currentInventory"));
break;
case "deliveryTime" :
entitys.add(new ExcelExportEntity("交期" ,"deliveryTime"));
break;
*
*/
public DownloadVO creatModelExcel(String path, List<Map<String, Object>> list, String[] keys, UserInfo userInfo) {
DownloadVO vo = DownloadVO.builder().build();
List<ExcelExportEntity> entitys = new ArrayList<>();
if (keys.length > 0) {
for (String key : keys) {
switch (key) {
case "years":
entitys.add(new ExcelExportEntity("年月", "years"));
break;
case "productId":
entitys.add(new ExcelExportEntity("产品编码", "productId"));
break;
case "productName":
entitys.add(new ExcelExportEntity("产品名称", "productName"));
break;
case "model":
entitys.add(new ExcelExportEntity("规格型号", "model"));
break;
case "measurementUnit":
entitys.add(new ExcelExportEntity("计量单位", "measurementUnit"));
break;
case "measurementNumber":
entitys.add(new ExcelExportEntity("计量数量", "measurementNumber"));
break;
case "currentInventory":
entitys.add(new ExcelExportEntity("当前库存", "currentInventory"));
break;
case "deliveryTime":
entitys.add(new ExcelExportEntity("交期", "deliveryTime"));
break;
default:
break;
break;
}
}
}
ExportParams exportParams = new ExportParams(null, "表单信息");
exportParams.setType(ExcelType.XSSF);
try{
try {
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
if (entitys.size() > 0) {
if (list.size() == 0) {
list.add(new HashMap<>());
}
//去除空数据
@ -201,8 +213,8 @@ public class YysMonthlyProductionController {
for (String key : keys) {
//子表
if (key.toLowerCase().startsWith("tablefield")) {
String tableField = key.substring(0, key.indexOf("-" ));
String field = key.substring(key.indexOf("-" ) + 1);
String tableField = key.substring(0, key.indexOf("-"));
String field = key.substring(key.indexOf("-") + 1);
Object o = map.get(tableField);
if (o != null) {
List<Map<String, Object>> childList = (List<Map<String, Object>>) o;
@ -228,7 +240,7 @@ public class YysMonthlyProductionController {
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
dataList = VisualUtils.complexHeaderDataHandel(dataList, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList);
@ -245,6 +257,7 @@ public class YysMonthlyProductionController {
}
return vo;
}
@Operation(summary = "上传文件")
@PostMapping("/Uploader")
public ActionResult<Object> Uploader() {
@ -264,75 +277,75 @@ public class YysMonthlyProductionController {
}
/**
*
*
* @return
*/
*
*
* @return
*/
@Operation(summary = "模板下载")
@GetMapping("/TemplateDownload")
public ActionResult<DownloadVO> TemplateDownload(){
public ActionResult<DownloadVO> TemplateDownload() {
DownloadVO vo = DownloadVO.builder().build();
UserInfo userInfo = userProvider.get();
Map<String, Object> dataMap = new HashMap<>();
//主表对象
List<ExcelExportEntity> entitys = new ArrayList<>();
//以下添加字段
entitys.add(new ExcelExportEntity("年月" ,"years"));
entitys.add(new ExcelExportEntity("产品编码" ,"productId"));
entitys.add(new ExcelExportEntity("产品名称" ,"productName"));
dataMap.put("productName", "例:技术部/部门编码");
entitys.add(new ExcelExportEntity("规格型号" ,"model"));
entitys.add(new ExcelExportEntity("计量单位" ,"measurementUnit"));
entitys.add(new ExcelExportEntity("当前库存" ,"currentInventory"));
entitys.add(new ExcelExportEntity("交期" ,"deliveryTime"));
dataMap.put("deliveryTime", "例: yyyy-MM-dd");
entitys.add(new ExcelExportEntity("计量数量" ,"measurementNumber"));
entitys.add(new ExcelExportEntity("年月", "years"));
dataMap.put("years", "例: yyyy-MM");
entitys.add(new ExcelExportEntity("产品编码", "productId"));
entitys.add(new ExcelExportEntity("产品名称", "productName"));
entitys.add(new ExcelExportEntity("规格型号", "model"));
entitys.add(new ExcelExportEntity("计量单位", "measurementUnit"));
entitys.add(new ExcelExportEntity("当前库存", "currentInventory"));
entitys.add(new ExcelExportEntity("交期", "deliveryTime"));
dataMap.put("deliveryTime", "例: yyyy-MM-dd");
entitys.add(new ExcelExportEntity("计量数量", "measurementNumber"));
List<Map<String, Object>> list = new ArrayList<>();
list.add(dataMap);
ExportParams exportParams = new ExportParams(null, "月生产计划模板");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(YysMonthlyProductionConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
}
String fileName = "月生产计划模板" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
try {
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size() > 0) {
if (list.size() == 0) {
list.add(new HashMap<>());
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(YysMonthlyProductionConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
}
String fileName = "月生产计划模板" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("模板信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
log.error("模板信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return ActionResult.success(vo);
}
/**
*
*
* @return
*/
@Operation(summary = "导入预览" )
*
*
* @return
*/
@Operation(summary = "导入预览")
@GetMapping("/ImportPreview")
public ActionResult<Map<String, Object>> ImportPreview(String fileName) throws Exception {
Map<String, Object> headAndDataMap = new HashMap<>(2);
String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath();
FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName);
String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getTemporaryFilePath();
FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName);
File temporary = new File(XSSEscape.escapePath(filePath + fileName));
int headerRowIndex = 1;
int headerRowIndex = 1;
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setHeadRows(headerRowIndex);
@ -341,17 +354,17 @@ public class YysMonthlyProductionController {
List<YysMonthlyProductionExcelVO> excelDataList = ExcelImportUtil.importExcel(temporary, YysMonthlyProductionExcelVO.class, params);
// 导入字段
List<ExcelImFieldModel> columns = new ArrayList<>();
columns.add(new ExcelImFieldModel("years","年月"));
columns.add(new ExcelImFieldModel("productId","产品编码"));
columns.add(new ExcelImFieldModel("productName","产品名称"));
columns.add(new ExcelImFieldModel("model","规格型号"));
columns.add(new ExcelImFieldModel("measurementUnit","计量单位"));
columns.add(new ExcelImFieldModel("currentInventory","当前库存"));
columns.add(new ExcelImFieldModel("deliveryTime","交期"));
columns.add(new ExcelImFieldModel("measurementNumber","计量数量"));
headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));
} catch (Exception e){
columns.add(new ExcelImFieldModel("years", "年月"));
columns.add(new ExcelImFieldModel("productId", "产品编码"));
columns.add(new ExcelImFieldModel("productName", "产品名称"));
columns.add(new ExcelImFieldModel("model", "规格型号"));
columns.add(new ExcelImFieldModel("measurementUnit", "计量单位"));
columns.add(new ExcelImFieldModel("currentInventory", "当前库存"));
columns.add(new ExcelImFieldModel("deliveryTime", "交期"));
columns.add(new ExcelImFieldModel("measurementNumber", "计量数量"));
headAndDataMap.put("dataRow", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow", JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));
} catch (Exception e) {
e.printStackTrace();
return ActionResult.fail("表头名称不可更改,表头行不能删除");
}
@ -359,148 +372,156 @@ public class YysMonthlyProductionController {
}
/**
*
*
* @return
*/
@Operation(summary = "导入数据" )
*
*
* @return
*/
@Operation(summary = "导入数据")
@PostMapping("/ImportData")
public ActionResult<ExcelImportModel> ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception {
List<Map<String, Object>> listData=new ArrayList<>();
for(Map<String, Object> map : visualImportModel.getList()){
List<Map<String, Object>> listData = new ArrayList<>();
for (Map<String, Object> map : visualImportModel.getList()) {
listData.add(map);
}
ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel();
uniqueModel.setDbLinkId(YysMonthlyProductionConstant.DBLINKID);
uniqueModel.setUpdate(Objects.equals("2", "2"));
ExcelImportModel excelImportModel = generaterSwapUtil.importData(YysMonthlyProductionConstant.getFormData(),listData,uniqueModel,
YysMonthlyProductionConstant.TABLEFIELDKEY,YysMonthlyProductionConstant.getTableList());
ExcelImportModel excelImportModel = generaterSwapUtil.importData(YysMonthlyProductionConstant.getFormData(), listData, uniqueModel,
YysMonthlyProductionConstant.TABLEFIELDKEY, YysMonthlyProductionConstant.getTableList());
List<ImportDataModel> importDataModel = uniqueModel.getImportDataModel();
for (ImportDataModel model : importDataModel) {
String id = model.getId();
Map<String, Object> result = model.getResultData();
if(StringUtil.isNotEmpty(id)){
update(id, JsonUtil.getJsonToBean(result,YysMonthlyProductionForm.class), true);
}else {
create( JsonUtil.getJsonToBean(result,YysMonthlyProductionForm.class));
if (StringUtil.isNotEmpty(id)) {
update(id, JsonUtil.getJsonToBean(result, YysMonthlyProductionForm.class), true);
} else {
create(JsonUtil.getJsonToBean(result, YysMonthlyProductionForm.class));
}
}
return ActionResult.success(excelImportModel);
}
/**
*
*
* @return
*/
*
*
* @return
*/
@Operation(summary = "导出异常报告")
@PostMapping("/ImportExceptionData")
public ActionResult<DownloadVO> ImportExceptionData(@RequestBody VisualImportModel visualImportModel) {
DownloadVO vo=DownloadVO.builder().build();
DownloadVO vo = DownloadVO.builder().build();
List<YysMonthlyProductionExcelErrorVO> yysMonthlyProductionVOList = JsonUtil.getJsonToList(visualImportModel.getList(), YysMonthlyProductionExcelErrorVO.class);
UserInfo userInfo = userProvider.get();
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
ExportParams exportParams = new ExportParams(null, "错误报告");
exportParams.setType(ExcelType.XSSF);
workbook = ExcelExportUtil.exportExcel(exportParams,
YysMonthlyProductionExcelErrorVO.class, yysMonthlyProductionVOList);
try {
@Cleanup Workbook workbook = new HSSFWorkbook();
ExportParams exportParams = new ExportParams(null, "错误报告");
exportParams.setType(ExcelType.XSSF);
workbook = ExcelExportUtil.exportExcel(exportParams,
YysMonthlyProductionExcelErrorVO.class, yysMonthlyProductionVOList);
String fileName = "错误报告" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String fileName = "错误报告" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
}
return ActionResult.success(vo);
}
/**
*
* @param id
* @param yysMonthlyProductionForm
* @return
*/
*
*
* @param id
* @param yysMonthlyProductionForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid YysMonthlyProductionForm yysMonthlyProductionForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid YysMonthlyProductionForm yysMonthlyProductionForm,
@RequestParam(value = "isImport", required = false) boolean isImport) {
yysMonthlyProductionForm.setId(id);
if (!isImport) {
String b = yysMonthlyProductionService.checkForm(yysMonthlyProductionForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
String b = yysMonthlyProductionService.checkForm(yysMonthlyProductionForm, 1);
if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b);
}
}
YysMonthlyProductionEntity entity= yysMonthlyProductionService.getInfo(id);
if(entity!=null){
try{
yysMonthlyProductionService.saveOrUpdate(yysMonthlyProductionForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
YysMonthlyProductionEntity entity = yysMonthlyProductionService.getInfo(id);
if (entity != null) {
String result = yysMonthlyProductionService.saveOrUpdate(yysMonthlyProductionForm, null, false);
if (result.contains("成功")) {
return ActionResult.success(result);
}
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
return ActionResult.fail(result);
}
return ActionResult.fail("操作失败");
}
/**
*
* @param id
* @return
*/
*
*
* @param id
* @return
*/
@Operation(summary = "删除")
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
YysMonthlyProductionEntity entity= yysMonthlyProductionService.getInfo(id);
if(entity!=null){
//主表数据删除
yysMonthlyProductionService.delete(entity);
public ActionResult delete(@PathVariable("id") String id) {
YysMonthlyProductionEntity entity = yysMonthlyProductionService.getInfo(id);
if (entity != null) {
//假删除
entity.setDeleteMark(1);
entity.setDeleteTime(DateUtil.getNowDate());
yysMonthlyProductionService.update(id, entity);
}
return ActionResult.success("删除成功");
}
/**
* ()
* 使-
* @param id
* @return
*/
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
YysMonthlyProductionEntity entity= yysMonthlyProductionService.getInfo(id);
if(entity==null){
public ActionResult detailInfo(@PathVariable("id") String id) {
YysMonthlyProductionEntity entity = yysMonthlyProductionService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysMonthlyProductionMap=JsonUtil.entityToMap(entity);
Map<String, Object> yysMonthlyProductionMap = JsonUtil.entityToMap(entity);
yysMonthlyProductionMap.put("id", yysMonthlyProductionMap.get("id"));
//副表数据
//子表数据
yysMonthlyProductionMap = generaterSwapUtil.swapDataDetail(yysMonthlyProductionMap,YysMonthlyProductionConstant.getFormData(),"590488386381285765",false);
yysMonthlyProductionMap = generaterSwapUtil.swapDataDetail(yysMonthlyProductionMap, YysMonthlyProductionConstant.getFormData(), "590488386381285765", false);
return ActionResult.success(yysMonthlyProductionMap);
}
/**
* ()
* 使-
* @param id
* @return
*/
* ()
* 使-
*
* @param id
* @return
*/
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
YysMonthlyProductionEntity entity= yysMonthlyProductionService.getInfo(id);
if(entity==null){
public ActionResult info(@PathVariable("id") String id) {
YysMonthlyProductionEntity entity = yysMonthlyProductionService.getInfo(id);
if (entity == null) {
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> yysMonthlyProductionMap=JsonUtil.entityToMap(entity);
Map<String, Object> yysMonthlyProductionMap = JsonUtil.entityToMap(entity);
yysMonthlyProductionMap.put("id", yysMonthlyProductionMap.get("id"));
//副表数据
//子表数据
yysMonthlyProductionMap = generaterSwapUtil.swapDataForm(yysMonthlyProductionMap,YysMonthlyProductionConstant.getFormData(),YysMonthlyProductionConstant.TABLEFIELDKEY,YysMonthlyProductionConstant.TABLERENAMES);
yysMonthlyProductionMap = generaterSwapUtil.swapDataForm(yysMonthlyProductionMap, YysMonthlyProductionConstant.getFormData(), YysMonthlyProductionConstant.TABLEFIELDKEY, YysMonthlyProductionConstant.TABLERENAMES);
return ActionResult.success(yysMonthlyProductionMap);
}

@ -2,10 +2,10 @@ package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
@ -13,24 +13,24 @@ import java.util.Date;
*/
@Data
@TableName("yys_monthly_production")
public class YysMonthlyProductionEntity {
@TableId(value ="ID" )
public class YysMonthlyProductionEntity {
@TableId(value = "ID")
private String id;
@TableField(value = "YEARS" , updateStrategy = FieldStrategy.IGNORED)
private String years;
@TableField(value = "PRODUCT_ID" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "YEARS", updateStrategy = FieldStrategy.IGNORED)
private Date years;
@TableField(value = "PRODUCT_ID", updateStrategy = FieldStrategy.IGNORED)
private String productId;
@TableField(value = "PRODUCT_NAME" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "PRODUCT_NAME", updateStrategy = FieldStrategy.IGNORED)
private String productName;
@TableField(value = "MODEL" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "MODEL", updateStrategy = FieldStrategy.IGNORED)
private String model;
@TableField(value = "MEASUREMENT_UNIT" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "MEASUREMENT_UNIT", updateStrategy = FieldStrategy.IGNORED)
private String measurementUnit;
@TableField(value = "MEASUREMENT_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "MEASUREMENT_NUMBER", updateStrategy = FieldStrategy.IGNORED)
private String measurementNumber;
@TableField(value = "CURRENT_INVENTORY" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "CURRENT_INVENTORY", updateStrategy = FieldStrategy.IGNORED)
private String currentInventory;
@TableField(value = "DELIVERY_TIME" , updateStrategy = FieldStrategy.IGNORED)
@TableField(value = "DELIVERY_TIME", updateStrategy = FieldStrategy.IGNORED)
private Date deliveryTime;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@ -56,4 +56,6 @@ public class YysMonthlyProductionEntity {
private String organizeJsonId;
@TableField("F_FLOW_ID")
private String flowId;
@TableField("F_VERSION")
private Integer version;
}

@ -25,6 +25,7 @@ public class YysMonthlyProductionExcelVO{
/** 年月 **/
@JSONField(name = "years")
@Excel(name = "年月",orderNum = "1", isImportField = "true" )
@JsonFormat(pattern = "yyyy-MM",timezone = "GMT+8")
private String years;
/** 产品编码 **/

@ -16,7 +16,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
public class YysMonthlyProductionForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 年月 **/
@JsonProperty("years")
private String years;
@ -25,7 +27,7 @@ public class YysMonthlyProductionForm {
private String productId;
/** 产品名称 **/
@JsonProperty("productName")
private Object productName;
private String productName;
/** 规格型号 **/
@JsonProperty("model")
private String model;

@ -53,26 +53,26 @@
<div class="JNPF-common-layout-main JNPF-flex-main">
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod">
<el-table-column prop="manufactureTime" label="生产日期" align="left">
<el-table-column prop="manufactureTime" label="生产日期" align="center">
</el-table-column>
<el-table-column prop="productCode" label="产品编码" align="left">
<el-table-column prop="productCode" label="产品编码" align="center">
</el-table-column>
<el-table-column prop="productName" label="产品名称" align="left">
<el-table-column prop="productName" label="产品名称" align="center">
</el-table-column>
<el-table-column prop="models" label="规格型号" align="left">
<el-table-column prop="models" label="规格型号" align="center">
</el-table-column>
<el-table-column prop="measurementUnit" label="计量单位" align="left">
<el-table-column prop="measurementUnit" label="计量单位" align="center">
</el-table-column>
<el-table-column prop="deviceCode" label="设备编码" align="left">
<el-table-column prop="deviceCode" label="设备编码" align="center">
</el-table-column>
<el-table-column prop="deviceName" label="设备名称" align="left">
<el-table-column prop="deviceName" label="设备名称" align="center">
</el-table-column>
<el-table-column prop="planNumber" label="计量数量" align="left">
<el-table-column prop="planNumber" label="计量数量" align="center">
<template slot-scope="scope" v-if="scope.row.planNumber">
<JnpfNumber v-model="scope.row.planNumber" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="deliveryTime" label="交期" align="left" :formatter="formatDeliveryTime">
<el-table-column prop="deliveryTime" label="交期" align="center" :formatter="formatDeliveryTime">
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"

@ -71,40 +71,40 @@
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod">
<el-table-column prop="manufactureTime" label="生产日期" align="left">
<el-table-column prop="manufactureTime" label="生产日期" align="center">
</el-table-column>
<el-table-column prop="deviceCode" label="设备编码" align="left">
<el-table-column prop="deviceCode" label="设备编码" align="center">
</el-table-column>
<el-table-column prop="deviceName" label="设备名称" align="left">
<el-table-column prop="deviceName" label="设备名称" align="center">
</el-table-column>
<el-table-column prop="sort" label="顺序号" align="left">
<el-table-column prop="sort" label="顺序号" align="center">
<template slot-scope="scope" v-if="scope.row.sort">
<JnpfNumber v-model="scope.row.sort" :thousands="false" />
</template>
</el-table-column>
<el-table-column label="班次" prop="post" algin="left">
<el-table-column label="班次" prop="post" algin="center">
<template slot-scope="scope">
{{ scope.row.post }}
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" align="left">
<el-table-column prop="startTime" label="开始时间" align="center">
</el-table-column>
<el-table-column prop="endTime" label="结束时间" align="left">
<el-table-column prop="endTime" label="结束时间" align="center">
</el-table-column>
<el-table-column prop="productCode" label="产品编码" align="left">
<el-table-column prop="productCode" label="产品编码" align="center">
</el-table-column>
<el-table-column prop="productName" label="产品名称" align="left">
<el-table-column prop="productName" label="产品名称" align="center">
</el-table-column>
<el-table-column prop="models" label="规格型号" align="left">
<el-table-column prop="models" label="规格型号" align="center">
</el-table-column>
<el-table-column prop="measurementUnit" label="计量单位" align="left">
<el-table-column prop="measurementUnit" label="计量单位" align="center">
</el-table-column>
<el-table-column prop="planNumber" label="计量数量" align="left">
<el-table-column prop="planNumber" label="计量数量" align="center">
<template slot-scope="scope" v-if="scope.row.planNumber">
<JnpfNumber v-model="scope.row.planNumber" :thousands="false" />
</template>
</el-table-column>
<el-table-column label="生产状态" prop="productionStatus" algin="left">
<el-table-column label="生产状态" prop="productionStatus" algin="center">
<template slot-scope="scope">
{{ scope.row.productionStatus }}
</template>

File diff suppressed because one or more lines are too long

@ -6,11 +6,13 @@
label-position="right">
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24">
<jnpf-form-tip-item label="年月" prop="years">
<JnpfInput v-model="dataForm.years" @change="changeData('years', -1)" placeholder="请输入年月"
clearable :style='{ "width": "100%" }'>
</JnpfInput>
<JnpfDatePicker v-model="dataForm.years" @change="changeData('years', -1)"
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
placeholder="请选择年月" clearable :style='{ "width": "100%" }' type="month" format="yyyy-MM">
</JnpfDatePicker>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
@ -71,16 +73,6 @@
@select="addForSelect" @close="selectDialogVisible = false" />
</el-row>
<span slot="footer" class="dialog-footer">
<!-- <div class="upAndDown-button" v-if="dataForm.id">
<el-button @click="prev" :disabled='prevDis'>
{{ '上一条' }}
</el-button>
<el-button @click="next" :disabled='nextDis'>
{{ '下一条' }}
</el-button>
</div>
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-button> -->
<el-button @click="visible = false"> </el-button>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> </el-button>
</span>
@ -136,6 +128,7 @@ export default {
measurementNumber: undefined,
currentInventory: undefined,
deliveryTime: undefined,
version: 0,
},
tableRequiredData: {},
dataRule:
@ -143,8 +136,8 @@ export default {
years: [
{
required: true,
message: '请输入年月',
trigger: 'blur'
message: '请选择年月',
trigger: 'change'
},
],
productId: [
@ -346,7 +339,6 @@ export default {
//
initDefaultData() {
this.dataForm.deliveryTime = new Date().getTime()
this.dataForm.years = new Date().getTime()
},
//

@ -5,9 +5,9 @@
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="年月">
<JnpfDatePicker v-model="query.years" format="yyyy-MM" startPlaceholder="开始日期"
<JnpfDateRangePicker v-model="query.years" format="yyyy-MM" startPlaceholder="开始日期"
endPlaceholder="结束日期">
</JnpfDatePicker>
</JnpfDateRangePicker>
</el-form-item>
</el-col>
<el-col :span="6">
@ -32,9 +32,9 @@
</el-button>
<el-button type="success" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()">
</el-button>
<el-button class="custom-success-button" type="success" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()">
<el-button type="success" icon="icon-ym icon-ym-btn-add" @click="handelUpload()">
</el-button>
<el-button class="custom-mpr-button" type="success" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()">MPR
<el-button type="success" icon="icon-ym icon-ym-btn-add" @click="handelUpload()">MRP
</el-button>
</div>
<div class="JNPF-common-head-right">
@ -52,19 +52,19 @@
:span-method="arraySpanMethod">
<el-table-column prop="years" label="年月" align="center">
</el-table-column>
<el-table-column prop="productId" label="产品编码" align="left">
<el-table-column prop="productId" label="产品编码" align="center">
</el-table-column>
<el-table-column prop="productName" label="产品名称" align="left">
<el-table-column prop="productName" label="产品名称" align="center">
</el-table-column>
<el-table-column prop="model" label="规格型号" align="left">
<el-table-column prop="model" label="规格型号" align="center">
</el-table-column>
<el-table-column prop="measurementUnit" label="计量单位" align="left">
<el-table-column prop="measurementUnit" label="计量单位" align="center">
</el-table-column>
<el-table-column prop="measurementNumber" label="计量数量" align="left">
<el-table-column prop="measurementNumber" label="计量数量" align="center">
</el-table-column>
<el-table-column prop="currentInventory" label="当前库存" align="left">
<el-table-column prop="currentInventory" label="当前库存" align="center">
</el-table-column>
<el-table-column prop="deliveryTime" label="交期" align="left">
<el-table-column prop="deliveryTime" label="交期" align="center">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
@ -354,13 +354,6 @@ export default {
moduleId: '590488386381285765',
type: 1,
};
if (_query.years != undefined) {
let aaa = _query.years;
const date = new Date(aaa);
const year = date.getFullYear().toString();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
_query.years = `${year}${month}`;
}
request({
url: `/api/example/YysMonthlyProduction/getList`,
method: 'post',

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save