Browse Source

[feat] 工程管理 采购管理

修改开修改单的前端新增页面的采购添加方法:不能添加相同的物料;修改成可以添加多条数据;
修改开发修改单的修改页面前端采购添加方法:不能添加相同的物料;修改成可以添加多条数据;
修改后端加载审批弹窗方法:赋值上修改前说明和修改后说明
修改后端审批方法:加上审批通过后生成采购计划数据
开发修改单列表数据新增根据创建时间进行排序
修改开发修改单后端新增接口:加上对开发修改物料和采购物料判空条件
修改开发修改单后端修改接口:加上对开发修改物料和采购物料判空条件;加上如果新增加一条数据,进行对数据库匹配,没有就新增操作,有了执行修改操作。
采购计划新增 开发修改单审核通过后生成采购计划后端接口:生成采购计划,累加采购计划子表的数据插入到采购计划中;筛选出物料相同的数据进行合计,筛选出只有采购加工的数据;插入数据到采购计划子表中
采购计划实体类:采购计划状态和采购计划状态加上备注
新增 批量新增采购计划单物料信息后端接口
dev
liuxiaoxu 4 months ago
parent
commit
0f634cd1d2
  1. 13
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java
  2. 51
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderServiceImpl.java
  3. 4
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchasePlan.java
  4. 9
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchasePlanChildMapper.java
  5. 8
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchasePlanService.java
  6. 134
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java
  7. 1
      ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml
  8. 51
      ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanChildMapper.xml
  9. 17
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html
  10. 16
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/edit.html

13
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java

@ -10,6 +10,7 @@ import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderVo;
import com.ruoyi.erp.service.IErpMaterialService;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.purchase.service.IPurchasePlanService;
import com.ruoyi.sales.domain.VO.SalesAftersalesNoticeVO;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderDept;
@ -75,6 +76,9 @@ public class ErpDevelopModifyorderController extends BaseController
@Autowired
private IProcessService processService;
@Autowired
private IPurchasePlanService purchasePlanService;
@RequiresPermissions("erp:developModifyOrder:view")
@GetMapping()
@ -205,6 +209,8 @@ public class ErpDevelopModifyorderController extends BaseController
String processInstanceId = task.getProcessInstanceId();
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
ErpDevelopModifyorderVo erpDevelopModifyorderVo = erpDevelopModifyorderService.selectErpDevelopModifyorderById(new Long(processInstance.getBusinessKey()));
mmap.put("beforeUpdateRemark", erpDevelopModifyorderVo.getBeforeUpdateRemark());
mmap.put("afterUpdateRemark", erpDevelopModifyorderVo.getAfterUpdateRemark());
mmap.put("formData", erpDevelopModifyorderVo);
mmap.put("taskId", taskId);
String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1);
@ -250,7 +256,12 @@ public class ErpDevelopModifyorderController extends BaseController
if (processIsFinish) {
// 审核通过
erpDevelopModifyorderVo.setAuditStatus("1");
String developOderCode = erpDevelopModifyorderVo.getDevelopOrderCode();
// String developOderCode = erpDevelopModifyorderVo.getDevelopOrderCode();
//如果审核通过生成采购计划
purchasePlanService.generatePurchasePlanByDevelopModifyorder(erpDevelopModifyorderVo);
// SalesAftersalesNoticeVO tempSalesAftersalesNoticeVO = salesAftersalesNoticeService.selectSalesAftersalesNoticeByCode(aftersalesNoticeCode);
//
// //如果审核通过生成售后单

51
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderServiceImpl.java

@ -157,19 +157,27 @@ public class ErpDevelopModifyorderServiceImpl implements IErpDevelopModifyorderS
String developOderCode = redisCache.generateBillNo("KF");
erpDevelopModifyorder.setDevelopOrderCode(developOderCode);
List<ErpDevelopModifyorderMaterialVo> developModifyorderMaterialVoList = erpDevelopModifyorder.getDevelopModifyorderMaterialVoList();
if (!CollectionUtils.isEmpty(developModifyorderMaterialVoList)){
ErpDevelopModifyorderMaterialVo erpDevelopModifyorderMaterialVo = developModifyorderMaterialVoList.get(0);
erpDevelopModifyorder.setMaterialNo(erpDevelopModifyorderMaterialVo.getMaterialNo());
erpDevelopModifyorder.setMaterialName(erpDevelopModifyorderMaterialVo.getMaterialName());
erpDevelopModifyorder.setMaterialBrand(erpDevelopModifyorderMaterialVo.getMaterialBrand());
erpDevelopModifyorder.setMaterialType(erpDevelopModifyorderMaterialVo.getMaterialType());
erpDevelopModifyorder.setMaterialProcessMethod(erpDevelopModifyorderMaterialVo.getMaterialProcessMethod());
erpDevelopModifyorder.setMaterialUnit(erpDevelopModifyorderMaterialVo.getMaterialUnit());
}
ErpDevelopModifyorderMaterialVo erpDevelopModifyorderMaterialVo = erpDevelopModifyorder.getDevelopModifyorderMaterialVoList().get(0);
erpDevelopModifyorder.setMaterialNo(erpDevelopModifyorderMaterialVo.getMaterialNo());
erpDevelopModifyorder.setMaterialName(erpDevelopModifyorderMaterialVo.getMaterialName());
erpDevelopModifyorder.setMaterialBrand(erpDevelopModifyorderMaterialVo.getMaterialBrand());
erpDevelopModifyorder.setMaterialType(erpDevelopModifyorderMaterialVo.getMaterialType());
erpDevelopModifyorder.setMaterialProcessMethod(erpDevelopModifyorderMaterialVo.getMaterialProcessMethod());
erpDevelopModifyorder.setMaterialUnit(erpDevelopModifyorderMaterialVo.getMaterialUnit());
//添加采购物料相关数据
ErpDevelopModifyorderDetail erpDevelopModifyorderDetail = erpDevelopModifyorder.getDevelopModifyorderDetailList().get(0);
erpDevelopModifyorderDetail.setDevelopOrderCode(developOderCode);
developModifyorderDetailMapper.insertErpDevelopModifyorderDetail(erpDevelopModifyorderDetail);
List<ErpDevelopModifyorderDetail> developModifyorderDetailList = erpDevelopModifyorder.getDevelopModifyorderDetailList();
for (ErpDevelopModifyorderDetail erpDevelopModifyorderDetail : developModifyorderDetailList) {
erpDevelopModifyorderDetail.setDevelopOrderCode(developOderCode);
erpDevelopModifyorderDetail.setCreateBy(loginName);
erpDevelopModifyorderDetail.setCreateTime(new Date());
developModifyorderDetailMapper.insertErpDevelopModifyorderDetail(erpDevelopModifyorderDetail);
}
return erpDevelopModifyorderMapper.insertErpDevelopModifyorder(erpDevelopModifyorder);
@ -189,17 +197,24 @@ public class ErpDevelopModifyorderServiceImpl implements IErpDevelopModifyorderS
erpDevelopModifyorder.setUpdateBy(loginName);
erpDevelopModifyorder.setUpdateTime(new Date());
//添加采购物料相关数据
//修改开发修改单详情数据
List<ErpDevelopModifyorderDetail> developModifyorderDetailList = erpDevelopModifyorder.getDevelopModifyorderDetailList();
if (!CollectionUtils.isEmpty(developModifyorderDetailList)){
ErpDevelopModifyorderDetail erpDevelopModifyorderDetail = erpDevelopModifyorder.getDevelopModifyorderDetailList().get(0);
erpDevelopModifyorderDetail.setUpdateBy(loginName);
erpDevelopModifyorderDetail.setUpdateTime(new Date());
developModifyorderDetailMapper.updateErpDevelopModifyorderDetail(erpDevelopModifyorderDetail);
}
for (ErpDevelopModifyorderDetail erpDevelopModifyorderDetail : developModifyorderDetailList) {
ErpDevelopModifyorderDetail tempDevelopModifyorderDetail = developModifyorderDetailMapper.selectErpDevelopModifyorderDetailById(erpDevelopModifyorderDetail.getDevelopOrderDetailId());
if (tempDevelopModifyorderDetail!=null){
erpDevelopModifyorderDetail.setUpdateBy(loginName);
erpDevelopModifyorderDetail.setUpdateTime(new Date());
developModifyorderDetailMapper.updateErpDevelopModifyorderDetail(erpDevelopModifyorderDetail);
}else {
erpDevelopModifyorderDetail.setDevelopOrderCode(erpDevelopModifyorder.getDevelopOrderCode());
erpDevelopModifyorderDetail.setCreateBy(loginName);
erpDevelopModifyorderDetail.setCreateTime(new Date());
developModifyorderDetailMapper.insertErpDevelopModifyorderDetail(erpDevelopModifyorderDetail);
}
}
}
return erpDevelopModifyorderMapper.updateErpDevelopModifyorder(erpDevelopModifyorder);
}

4
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchasePlan.java

@ -22,7 +22,7 @@ public class PurchasePlan extends BaseEntity
@Excel(name = "采购计划单号")
private String purchasePlanCode;
/** 采购计划状态 */
/** 采购计划状态 (0待申请、1申请中、2申请通过、3审核拒绝、4已作废)*/
@Excel(name = "采购计划状态")
private String purchasePlanStatus;
@ -30,7 +30,7 @@ public class PurchasePlan extends BaseEntity
@Excel(name = "关联单号")
private String correlationCode;
/** 采购来源 */
/** 采购计划状态 (1生产单、2请购单、3开发修改单)*/
@Excel(name = "采购来源")
private String purchasePlanType;

9
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchasePlanChildMapper.java

@ -2,6 +2,7 @@ package com.ruoyi.purchase.mapper;
import java.util.List;
import com.ruoyi.purchase.domain.PurchasePlanChild;
import org.apache.ibatis.annotations.Param;
/**
* 采购计划单物料信息Mapper接口
@ -35,6 +36,14 @@ public interface PurchasePlanChildMapper
*/
public int insertPurchasePlanChild(PurchasePlanChild purchasePlanChild);
/**
* 批量新增采购计划单物料信息
*
* @param purchasePlanChildList 采购计划单物料信息集合
* @return 结果
*/
public int batchInsertPurchasePlanChild(@Param("list") List<PurchasePlanChild> purchasePlanChildList);
/**
* 修改采购计划单物料信息
*

8
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchasePlanService.java

@ -1,5 +1,6 @@
package com.ruoyi.purchase.service;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderVo;
import com.ruoyi.purchase.domain.PurchasePlan;
import com.ruoyi.purchase.domain.PurchasePlanChild;
import com.ruoyi.system.domain.SysMakeorderBom;
@ -78,8 +79,13 @@ public interface IPurchasePlanService
public List<PurchasePlan> selectPurchasePlanByPlanCode(String purchasePlanCodes);
/*
/**
* 生产订单工程审核后生成采购计划
* */
void generatePurchasePlanByMakeOrder(List<SysMakeorderBom> insertedSysMakeorderBoms);
/**
* 开发修改单审核通过后生成采购计划
* */
void generatePurchasePlanByDevelopModifyorder(ErpDevelopModifyorderVo erpDevelopModifyorderVo);
}

134
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java

@ -9,6 +9,11 @@ import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.erp.domain.ErpBom;
import com.ruoyi.erp.domain.ErpDevelopModifyorderDetail;
import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderVo;
import com.ruoyi.erp.mapper.ErpDevelopModifyorderDetailMapper;
import com.ruoyi.erp.service.IErpBomService;
import com.ruoyi.purchase.domain.PurchasePlan;
import com.ruoyi.purchase.domain.PurchasePlanChild;
import com.ruoyi.purchase.mapper.PurchasePlanChildMapper;
@ -17,6 +22,7 @@ import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.purchase.mapper.PurchasePlanMapper;
@ -48,6 +54,12 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
@Autowired
private SysSalesOrderChildMapper salesOrderChildMapper;
@Autowired
private ErpDevelopModifyorderDetailMapper developModifyorderDetailMapper;
@Autowired
private IErpBomService erpBomService;
/**
* 查询采购计划单
*
@ -267,6 +279,128 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService
}
/**
* 开发修改单审核通过后生成采购计划
*/
@Override
public void generatePurchasePlanByDevelopModifyorder(ErpDevelopModifyorderVo erpDevelopModifyorderVo) {
String developOrderCode = erpDevelopModifyorderVo.getDevelopOrderCode();
String loginName = ShiroUtils.getLoginName();
String purchasePlanCode = generateUniquePurchasePlanCode();
List<ErpDevelopModifyorderDetail> erpDevelopModifyorderDetailList = developModifyorderDetailMapper.selectDevelopModifyDetailMaterialByCode(developOrderCode);
// // 只需要加工方式为采购的
// List<ErpDevelopModifyorderDetail> filterDevelopModifyorderDetailList = erpDevelopModifyorderDetailList.stream()
// .filter(detail -> "0".equals(detail.getMaterialProcessMethod()))
// .collect(Collectors.toList());
List<PurchasePlanChild> purchasePlanChildList = new ArrayList<>();
PurchasePlan purchasePlan = new PurchasePlan();
purchasePlan.setPurchasePlanCode(purchasePlanCode);
purchasePlan.setCreateTime(new Date());
purchasePlan.setCreateBy(loginName);
// 标明来源是开发修改单
purchasePlan.setPurchasePlanType("3");
// 标明为待申请
purchasePlan.setPurchasePlanStatus("0");
purchasePlan.setCorrelationCode(erpDevelopModifyorderVo.getDevelopOrderCode());
// 处理开发修改单详情
for (ErpDevelopModifyorderDetail erpDevelopModifyorderDetail : erpDevelopModifyorderDetailList) {
// 获取0阶层物料
Integer bomId = erpDevelopModifyorderDetail.getBomId();
// 插入开发修改单详情的数据
PurchasePlanChild tempPurchasePlanChild = createPurchasePlanChild(purchasePlanCode, erpDevelopModifyorderDetail, loginName);
purchasePlanChildList.add(tempPurchasePlanChild);
if (bomId != null) {
// 插入子阶的数据
ErpBom oneLevelBom = new ErpBom();
oneLevelBom.setParentId(Long.valueOf(bomId));
List<ErpBom> subBomList = erpBomService.selectErpBomAllLevelList(oneLevelBom);
// 只需要加工方式为采购的
List<ErpBom> filterSubBomList = subBomList.stream()
.filter(bom -> "0".equals(bom.getProcessMethod()))
.collect(Collectors.toList());
for (ErpBom subBom : filterSubBomList) {
PurchasePlanChild purchasePlanChild = createPurchasePlanChild(purchasePlanCode, subBom, loginName);
purchasePlanChild.setMaterialNum(erpDevelopModifyorderDetail.getMaterialNum() * subBom.getUseNum());
purchasePlanChildList.add(purchasePlanChild);
}
}
}
// 合并相同materialCode的数据
List<PurchasePlanChild> mergedPurchasePlanChildList = mergePurchasePlanChildList(purchasePlanChildList);
// 只需要加工方式为采购的
List<PurchasePlanChild> filterMergedPurchasePlanChildList = mergedPurchasePlanChildList.stream().filter(child -> "0".equals(child.getProcessMethod())).collect(Collectors.toList());
purchasePlan.setMaterialAmount(Long.valueOf(filterMergedPurchasePlanChildList.size()));
// 计算所有 PurchasePlanChild 的 materialNum 总和
Long totalMaterialNum = filterMergedPurchasePlanChildList.stream()
.mapToLong(PurchasePlanChild::getMaterialNum)
.sum();
purchasePlan.setMaterialSum(totalMaterialNum);
// 批量新增采购计划子表
// purchasePlanChildMapper.batchInsertPurchasePlanChild(filterMergedPurchasePlanChildList);
for (PurchasePlanChild purchasePlanChild : filterMergedPurchasePlanChildList) {
purchasePlanChildMapper.insertPurchasePlanChild(purchasePlanChild);
}
// 新增保存 PurchasePlan 到数据库
purchasePlanMapper.insertPurchasePlan(purchasePlan);
}
private PurchasePlanChild createPurchasePlanChild(String purchasePlanCode, ErpDevelopModifyorderDetail detail, String loginName) {
PurchasePlanChild purchasePlanChild = new PurchasePlanChild();
purchasePlanChild.setPurchasePlanCode(purchasePlanCode);
purchasePlanChild.setCreateTime(new Date());
purchasePlanChild.setCreateBy(loginName);
purchasePlanChild.setMaterialCode(detail.getMaterialNo());
purchasePlanChild.setMaterialName(detail.getMaterialName());
purchasePlanChild.setMaterialType(detail.getMaterialType());
purchasePlanChild.setBrand(detail.getMaterialBrand());
purchasePlanChild.setUnit(detail.getMaterialUnit());
purchasePlanChild.setDescribe(detail.getMaterialDescribe());
purchasePlanChild.setMaterialNum(Long.valueOf(detail.getMaterialNum()));
return purchasePlanChild;
}
private PurchasePlanChild createPurchasePlanChild(String purchasePlanCode, ErpBom bom, String loginName) {
PurchasePlanChild purchasePlanChild = new PurchasePlanChild();
purchasePlanChild.setPurchasePlanCode(purchasePlanCode);
purchasePlanChild.setCreateTime(new Date());
purchasePlanChild.setCreateBy(loginName);
purchasePlanChild.setMaterialCode(bom.getMaterialNo());
purchasePlanChild.setMaterialName(bom.getMaterialName());
purchasePlanChild.setMaterialType(bom.getMaterialType());
purchasePlanChild.setProcessMethod(bom.getProcessMethod());
purchasePlanChild.setBrand(bom.getBrand());
purchasePlanChild.setUnit(bom.getUnit());
purchasePlanChild.setDescribe(bom.getDescribe());
// MaterialNum will be set later based on the parent's quantity and useNum
return purchasePlanChild;
}
private List<PurchasePlanChild> mergePurchasePlanChildList(List<PurchasePlanChild> purchasePlanChildList) {
Map<String, PurchasePlanChild> aggregatedMap = new HashMap<>();
for (PurchasePlanChild purchasePlanChild : purchasePlanChildList) {
String materialCode = purchasePlanChild.getMaterialCode();
if (aggregatedMap.containsKey(materialCode)) {
PurchasePlanChild existing = aggregatedMap.get(materialCode);
existing.setMaterialNum(existing.getMaterialNum() + purchasePlanChild.getMaterialNum());
} else {
aggregatedMap.put(materialCode, purchasePlanChild);
}
}
return new ArrayList<>(aggregatedMap.values());
}
/*假设自生成的采购计划单号*/
private String generateUniquePurchasePlanCode() {
// 实现生成唯一采购计划单号的逻辑

1
ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml

@ -58,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null "> and user_id = #{userId}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
</where>
order by create_time desc
</select>
<select id="selectErpDevelopModifyorderById" parameterType="Long" resultMap="ErpDevelopModifyorderResult">

51
ruoyi-admin/src/main/resources/mapper/purchase/PurchasePlanChildMapper.xml

@ -136,6 +136,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<insert id="batchInsertPurchasePlanChild" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="purchasePlanChildId">
insert into purchase_plan_child
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.purchasePlanCode != null">purchase_plan_code,</if>
<if test="item.materialCode != null">material_code,</if>
<if test="item.materialName != null">material_name,</if>
<if test="item.materialType != null">material_type,</if>
<if test="item.processMethod != null">process_method,</if>
<if test="item.brand != null">brand,</if>
<if test="item.describe != null">`describe`,</if>
<if test="item.unit != null">unit,</if>
<if test="item.warehouseDept != null">warehouse_dept,</if>
<if test="item.materialNum != null">material_num,</if>
<if test="item.createBy != null">create_by,</if>
<if test="item.createTime != null">create_time,</if>
<if test="item.updateBy != null">update_by,</if>
<if test="item.updateTime != null">update_time,</if>
<if test="item.remark != null">remark,</if>
<if test="item.useStatus != null">use_status,</if>
<if test="item.auditStatus != null">audit_status,</if>
<if test="item.delFlag != null">del_flag,</if>
</trim>
<foreach collection="list" item="item" index="index" separator=",">
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="item.purchasePlanCode != null">#{item.purchasePlanCode},</if>
<if test="item.materialCode != null">#{item.materialCode},</if>
<if test="item.materialName != null">#{item.materialName},</if>
<if test="item.materialType != null">#{item.materialType},</if>
<if test="item.processMethod != null">#{item.processMethod},</if>
<if test="item.brand != null">#{item.brand},</if>
<if test="item.describe != null">#{item.describe},</if>
<if test="item.unit != null">#{item.unit},</if>
<if test="item.warehouseDept != null">#{item.warehouseDept},</if>
<if test="item.materialNum != null">#{item.materialNum},</if>
<if test="item.createBy != null">#{item.createBy},</if>
<if test="item.createTime != null">#{item.createTime},</if>
<if test="item.updateBy != null">#{item.updateBy},</if>
<if test="item.updateTime != null">#{item.updateTime},</if>
<if test="item.remark != null">#{item.remark},</if>
<if test="item.useStatus != null">#{item.useStatus},</if>
<if test="item.auditStatus != null">#{item.auditStatus},</if>
<if test="item.delFlag != null">#{item.delFlag}</if>
</trim>
</foreach>
</insert>
<update id="updatePurchasePlanChild" parameterType="PurchasePlanChild">
update purchase_plan_child
<trim prefix="SET" suffixOverrides=",">

17
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html

@ -625,18 +625,13 @@
//判断是否重复
var rows = $("#bootstrap-table-purchase").bootstrapTable('getData').length;
if (rows > 0){
$.modal.alertError("每次只能修改一条物料!");
return;
for(var i=0;i<rows;i++){
var data = $("#bootstrap-table-purchase").bootstrapTable('getData')[i];
if(data.materialNo==rowData.materialNo){
$.modal.alertError("不能选择已添加过的相同物料");
return;
}
}
// for(var i=0;i<rows;i++){
// var data = $("#bootstrap-table-developModify").bootstrapTable('getData')[i];
// if(data.materialNo==rowData.materialNo){
// $.modal.alertError("不能选择已添加过的相同物料");
// return;
// }
// }
console.log("rowData: "+rowData);
$("#bootstrap-table-purchase").bootstrapTable('insertRow', {

16
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/edit.html

@ -654,17 +654,13 @@
//判断是否重复
var rows = $("#bootstrap-table-purchase").bootstrapTable('getData').length;
if (rows > 0){
$.modal.alertError("每次只能修改一条物料!");
return;
for(var i=0;i<rows;i++){
var data = $("#bootstrap-table-purchase").bootstrapTable('getData')[i];
if(data.materialNo==rowData.materialNo){
$.modal.alertError("不能选择已添加过的相同物料");
return;
}
}
// for(var i=0;i<rows;i++){
// var data = $("#bootstrap-table-developModify").bootstrapTable('getData')[i];
// if(data.materialNo==rowData.materialNo){
// $.modal.alertError("不能选择已添加过的相同物料");
// return;
// }
// }
console.log("rowData: "+rowData);
$("#bootstrap-table-purchase").bootstrapTable('insertRow', {

Loading…
Cancel
Save