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

master
jiyufei 3 months ago
parent 1600316297
commit 50f2217a22

@ -4,6 +4,7 @@ import jnpf.model.yysmonthlyproduction.*;
import jnpf.entity.*; import jnpf.entity.*;
import java.util.*; import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/** /**
* yysMonthlyProduction * yysMonthlyProduction

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

@ -15,16 +15,20 @@ import jnpf.model.yysmonthlyproduction.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.*; import java.util.*;
import jnpf.annotation.JnpfField; import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO; import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO; import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO; import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil; import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity; import jnpf.base.entity.ProvinceEntity;
import java.io.IOException; import java.io.IOException;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity; import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException; import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile; 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 cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import java.io.File; import java.io.File;
import jnpf.onlinedev.model.ExcelImFieldModel; import jnpf.onlinedev.model.ExcelImFieldModel;
import jnpf.onlinedev.model.OnlineImport.ImportDataModel; import jnpf.onlinedev.model.OnlineImport.ImportDataModel;
import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel; import jnpf.onlinedev.model.OnlineImport.ImportFormCheckUniqueModel;
@ -51,6 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* yysMonthlyProduction * yysMonthlyProduction
*
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
@ -72,7 +79,6 @@ public class YysMonthlyProductionController {
private YysMonthlyProductionService yysMonthlyProductionService; private YysMonthlyProductionService yysMonthlyProductionService;
@Autowired @Autowired
private ConfigValueUtil configValueUtil; private ConfigValueUtil configValueUtil;
@ -104,6 +110,7 @@ public class YysMonthlyProductionController {
vo.setPagination(page); vo.setPagination(page);
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
* *
@ -117,8 +124,13 @@ public class YysMonthlyProductionController {
if (StringUtil.isNotEmpty(b)) { if (StringUtil.isNotEmpty(b)) {
return ActionResult.fail(b); return ActionResult.fail(b);
} }
return ActionResult.success(yysMonthlyProductionService.saveOrUpdate(yysMonthlyProductionForm, null, true)); String result = yysMonthlyProductionService.saveOrUpdate(yysMonthlyProductionForm, null, true);
if (result.contains("成功")) {
return ActionResult.success(result);
} }
return ActionResult.fail(result);
}
/** /**
* Excel * Excel
* *
@ -245,6 +257,7 @@ public class YysMonthlyProductionController {
} }
return vo; return vo;
} }
@Operation(summary = "上传文件") @Operation(summary = "上传文件")
@PostMapping("/Uploader") @PostMapping("/Uploader")
public ActionResult<Object> Uploader() { public ActionResult<Object> Uploader() {
@ -278,9 +291,9 @@ public class YysMonthlyProductionController {
List<ExcelExportEntity> entitys = new ArrayList<>(); List<ExcelExportEntity> entitys = new ArrayList<>();
//以下添加字段 //以下添加字段
entitys.add(new ExcelExportEntity("年月", "years")); entitys.add(new ExcelExportEntity("年月", "years"));
dataMap.put("years", "例: yyyy-MM");
entitys.add(new ExcelExportEntity("产品编码", "productId")); entitys.add(new ExcelExportEntity("产品编码", "productId"));
entitys.add(new ExcelExportEntity("产品名称", "productName")); entitys.add(new ExcelExportEntity("产品名称", "productName"));
dataMap.put("productName", "例:技术部/部门编码");
entitys.add(new ExcelExportEntity("规格型号", "model")); entitys.add(new ExcelExportEntity("规格型号", "model"));
entitys.add(new ExcelExportEntity("计量单位", "measurementUnit")); entitys.add(new ExcelExportEntity("计量单位", "measurementUnit"));
entitys.add(new ExcelExportEntity("当前库存", "currentInventory")); entitys.add(new ExcelExportEntity("当前库存", "currentInventory"));
@ -418,8 +431,10 @@ public class YysMonthlyProductionController {
} }
return ActionResult.success(vo); return ActionResult.success(vo);
} }
/** /**
* *
*
* @param id * @param id
* @param yysMonthlyProductionForm * @param yysMonthlyProductionForm
* @return * @return
@ -437,18 +452,18 @@ public class YysMonthlyProductionController {
} }
YysMonthlyProductionEntity entity = yysMonthlyProductionService.getInfo(id); YysMonthlyProductionEntity entity = yysMonthlyProductionService.getInfo(id);
if (entity != null) { if (entity != null) {
try{ String result = yysMonthlyProductionService.saveOrUpdate(yysMonthlyProductionForm, null, false);
yysMonthlyProductionService.saveOrUpdate(yysMonthlyProductionForm,id,false); if (result.contains("成功")) {
}catch(Exception e){ return ActionResult.success(result);
return ActionResult.fail("修改数据失败");
} }
return ActionResult.success("更新成功"); return ActionResult.fail(result);
}else{
return ActionResult.fail("更新失败,数据不存在");
} }
return ActionResult.fail("操作失败");
} }
/** /**
* *
*
* @param id * @param id
* @return * @return
*/ */
@ -458,14 +473,18 @@ public class YysMonthlyProductionController {
public ActionResult delete(@PathVariable("id") String id) { public ActionResult delete(@PathVariable("id") String id) {
YysMonthlyProductionEntity entity = yysMonthlyProductionService.getInfo(id); YysMonthlyProductionEntity entity = yysMonthlyProductionService.getInfo(id);
if (entity != null) { if (entity != null) {
//主表数据删除 //假删除
yysMonthlyProductionService.delete(entity); entity.setDeleteMark(1);
entity.setDeleteTime(DateUtil.getNowDate());
yysMonthlyProductionService.update(id, entity);
} }
return ActionResult.success("删除成功"); return ActionResult.success("删除成功");
} }
/** /**
* () * ()
* 使- * 使-
*
* @param id * @param id
* @return * @return
*/ */
@ -483,9 +502,11 @@ public class YysMonthlyProductionController {
yysMonthlyProductionMap = generaterSwapUtil.swapDataDetail(yysMonthlyProductionMap, YysMonthlyProductionConstant.getFormData(), "590488386381285765", false); yysMonthlyProductionMap = generaterSwapUtil.swapDataDetail(yysMonthlyProductionMap, YysMonthlyProductionConstant.getFormData(), "590488386381285765", false);
return ActionResult.success(yysMonthlyProductionMap); return ActionResult.success(yysMonthlyProductionMap);
} }
/** /**
* () * ()
* 使- * 使-
*
* @param id * @param id
* @return * @return
*/ */

@ -2,10 +2,10 @@ package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
*
*
* @ V3.5 * @ V3.5
* @ https://www.jnpfsoft.com * @ https://www.jnpfsoft.com
* @ JNPF * @ JNPF
@ -17,7 +17,7 @@ public class YysMonthlyProductionEntity {
@TableId(value = "ID") @TableId(value = "ID")
private String id; private String id;
@TableField(value = "YEARS", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "YEARS", updateStrategy = FieldStrategy.IGNORED)
private String years; private Date years;
@TableField(value = "PRODUCT_ID", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "PRODUCT_ID", updateStrategy = FieldStrategy.IGNORED)
private String productId; private String productId;
@TableField(value = "PRODUCT_NAME", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "PRODUCT_NAME", updateStrategy = FieldStrategy.IGNORED)
@ -56,4 +56,6 @@ public class YysMonthlyProductionEntity {
private String organizeJsonId; private String organizeJsonId;
@TableField("F_FLOW_ID") @TableField("F_FLOW_ID")
private String flowId; private String flowId;
@TableField("F_VERSION")
private Integer version;
} }

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

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

@ -53,26 +53,26 @@
<div class="JNPF-common-layout-main JNPF-flex-main"> <div class="JNPF-common-layout-main JNPF-flex-main">
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod"> :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>
<el-table-column prop="productCode" label="产品编码" align="left"> <el-table-column prop="productCode" label="产品编码" align="center">
</el-table-column> </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>
<el-table-column prop="models" label="规格型号" align="left"> <el-table-column prop="models" label="规格型号" align="center">
</el-table-column> </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>
<el-table-column prop="deviceCode" label="设备编码" align="left"> <el-table-column prop="deviceCode" label="设备编码" align="center">
</el-table-column> </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>
<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"> <template slot-scope="scope" v-if="scope.row.planNumber">
<JnpfNumber v-model="scope.row.planNumber" :thousands="false" /> <JnpfNumber v-model="scope.row.planNumber" :thousands="false" />
</template> </template>
</el-table-column> </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> </el-table-column>
</JNPF-table> </JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" <pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"

@ -71,40 +71,40 @@
</div> </div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' <JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange'
:span-method="arraySpanMethod"> :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>
<el-table-column prop="deviceCode" label="设备编码" align="left"> <el-table-column prop="deviceCode" label="设备编码" align="center">
</el-table-column> </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>
<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"> <template slot-scope="scope" v-if="scope.row.sort">
<JnpfNumber v-model="scope.row.sort" :thousands="false" /> <JnpfNumber v-model="scope.row.sort" :thousands="false" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="班次" prop="post" algin="left"> <el-table-column label="班次" prop="post" algin="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.post }} {{ scope.row.post }}
</template> </template>
</el-table-column> </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>
<el-table-column prop="endTime" label="结束时间" align="left"> <el-table-column prop="endTime" label="结束时间" align="center">
</el-table-column> </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>
<el-table-column prop="productName" label="产品名称" align="left"> <el-table-column prop="productName" label="产品名称" align="center">
</el-table-column> </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>
<el-table-column prop="measurementUnit" label="计量单位" align="left"> <el-table-column prop="measurementUnit" label="计量单位" align="center">
</el-table-column> </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"> <template slot-scope="scope" v-if="scope.row.planNumber">
<JnpfNumber v-model="scope.row.planNumber" :thousands="false" /> <JnpfNumber v-model="scope.row.planNumber" :thousands="false" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="生产状态" prop="productionStatus" algin="left"> <el-table-column label="生产状态" prop="productionStatus" algin="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.productionStatus }} {{ scope.row.productionStatus }}
</template> </template>

File diff suppressed because one or more lines are too long

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

@ -5,9 +5,9 @@
<el-form @submit.native.prevent> <el-form @submit.native.prevent>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="年月"> <el-form-item label="年月">
<JnpfDatePicker v-model="query.years" format="yyyy-MM" startPlaceholder="开始日期" <JnpfDateRangePicker v-model="query.years" format="yyyy-MM" startPlaceholder="开始日期"
endPlaceholder="结束日期"> endPlaceholder="结束日期">
</JnpfDatePicker> </JnpfDateRangePicker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -32,9 +32,9 @@
</el-button> </el-button>
<el-button type="success" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()"> <el-button type="success" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()">
</el-button> </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>
<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> </el-button>
</div> </div>
<div class="JNPF-common-head-right"> <div class="JNPF-common-head-right">
@ -52,19 +52,19 @@
:span-method="arraySpanMethod"> :span-method="arraySpanMethod">
<el-table-column prop="years" label="年月" align="center"> <el-table-column prop="years" label="年月" align="center">
</el-table-column> </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>
<el-table-column prop="productName" label="产品名称" align="left"> <el-table-column prop="productName" label="产品名称" align="center">
</el-table-column> </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>
<el-table-column prop="measurementUnit" label="计量单位" align="left"> <el-table-column prop="measurementUnit" label="计量单位" align="center">
</el-table-column> </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>
<el-table-column prop="currentInventory" label="当前库存" align="left"> <el-table-column prop="currentInventory" label="当前库存" align="center">
</el-table-column> </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>
<el-table-column label="操作" fixed="right" width="150"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
@ -354,13 +354,6 @@ export default {
moduleId: '590488386381285765', moduleId: '590488386381285765',
type: 1, 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({ request({
url: `/api/example/YysMonthlyProduction/getList`, url: `/api/example/YysMonthlyProduction/getList`,
method: 'post', method: 'post',

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