MES:
采购订单绑定销售订单完善:根据条码数量判断绑定数量等
master
xs 8 months ago
parent bd11b2eec2
commit a1bf717d40

@ -306,7 +306,7 @@ public class MesApiController extends BaseController {
*/ */
@GetMapping(value = "/printProductBarcodes/{barcodeIds}") @GetMapping(value = "/printProductBarcodes/{barcodeIds}")
public AjaxResult printProductBarcodes(@PathVariable Long[] barcodeIds) { public AjaxResult printProductBarcodes(@PathVariable Long[] barcodeIds) {
return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds, MesConstants.MES_BARCODE_TYPE_PRODUCT)); return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds, MesConstants.MES_BARCODE_TYPE_PRODUCT,false));
} }

@ -124,10 +124,22 @@ public class MesBaseBarcodeInfoController extends BaseController
* @return * @return
*/ */
@GetMapping(value = "/printBarcodes/{barcodeIds}") @GetMapping(value = "/printBarcodes/{barcodeIds}")
@RequiresPermissions("mes:barcode:printBarcodes") @RequiresPermissions("mes:barcode:printBarcode")
public AjaxResult printBarcodes(@PathVariable Long[] barcodeIds) public AjaxResult printBarcodes(@PathVariable Long[] barcodeIds)
{ {
return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds,MesConstants.MES_BARCODE_TYPE_RAW)); return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds,MesConstants.MES_BARCODE_TYPE_RAW,false));
}
/**
*
* @param barcodeIds
* @return
*/
@GetMapping(value = "/reprintBarcodes/{barcodeIds}")
@RequiresPermissions("mes:barcode:reprint")
public AjaxResult reprintBarcodes(@PathVariable Long[] barcodeIds)
{
return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds,MesConstants.MES_BARCODE_TYPE_RAW,true));
} }
/** /**
@ -207,7 +219,7 @@ public class MesBaseBarcodeInfoController extends BaseController
@RequiresPermissions("mes:barcode:printProductBarcodes") @RequiresPermissions("mes:barcode:printProductBarcodes")
public AjaxResult printProductBarcodes(@PathVariable Long[] barcodeIds) public AjaxResult printProductBarcodes(@PathVariable Long[] barcodeIds)
{ {
return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds, MesConstants.MES_BARCODE_TYPE_PRODUCT)); return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds, MesConstants.MES_BARCODE_TYPE_PRODUCT,false));
} }

@ -49,7 +49,7 @@ public class MesPurchaseOrderController extends BaseController
public TableDataInfo list(MesPurchaseOrder mesPurchaseOrder) public TableDataInfo list(MesPurchaseOrder mesPurchaseOrder)
{ {
startPage(); startPage();
List<MesPurchaseOrder> list = mesPurchaseOrderService.selectMesPurchaseOrderList(mesPurchaseOrder); List<MesPurchaseOrder> list = mesPurchaseOrderService.selectMesPurchaseOrderJoinList(mesPurchaseOrder);
return getDataTable(list); return getDataTable(list);
} }
@ -118,7 +118,7 @@ public class MesPurchaseOrderController extends BaseController
public TableDataInfo getSaleOrders(MesSaleOrder querySaleOrder) public TableDataInfo getSaleOrders(MesSaleOrder querySaleOrder)
{ {
startPage(); startPage();
List<MesSaleOrder> list = mesSaleOrderService.selectMesSaleOrderList(querySaleOrder); List<MesSaleOrder> list = mesSaleOrderService.selectMesSaleOrderJoinMaterialList(querySaleOrder);
return getDataTable(list); return getDataTable(list);
} }
@ -200,4 +200,16 @@ public class MesPurchaseOrderController extends BaseController
return toAjax(mesPurchaseOrderService.removeSalesBindPurchase(saleOrderId, purchaseOrderIds)); return toAjax(mesPurchaseOrderService.removeSalesBindPurchase(saleOrderId, purchaseOrderIds));
} }
/**
*
*/
@RequiresPermissions("mes:purchaseOrder:bind")
@Log(title = "采购订单板顶信息", businessType = BusinessType.DELETE)
@GetMapping("/deleteOrderBind/{orderBindIds}")
public AjaxResult deleteOrderBind(@PathVariable Long[] orderBindIds)
{
return toAjax(mesPurchaseOrderService.deleteMesOrderBindByOrderBindIds(orderBindIds));
}
} }

@ -1,6 +1,8 @@
package com.hw.mes.domain; package com.hw.mes.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Objects;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.hw.common.core.annotation.Excel; import com.hw.common.core.annotation.Excel;
@ -12,179 +14,194 @@ import com.hw.common.core.web.domain.BaseEntity;
* @author xins * @author xins
* @date 2024-05-16 * @date 2024-05-16
*/ */
public class MesOrderBind extends BaseEntity public class MesOrderBind extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键标识 */ /**
*
*/
private Long orderBindId; private Long orderBindId;
/** 安全库存标识(1是0否) */ /**
* (10)
*/
@Excel(name = "安全库存标识(1是0否)") @Excel(name = "安全库存标识(1是0否)")
private String safeFlag; private String safeFlag;
/** 销售订单ID;对应FID */ /**
* ID;FID
*/
@Excel(name = "销售订单ID;对应FID") @Excel(name = "销售订单ID;对应FID")
private Long saleOrderId; private Long saleOrderId;
/** 销售订单编号 */ /**
*
*/
@Excel(name = "销售订单编号") @Excel(name = "销售订单编号")
private String saleOrderCode; private String saleOrderCode;
/** ERP成品ID */ /**
* ERPID
*/
@Excel(name = "ERP成品ID") @Excel(name = "ERP成品ID")
private Long productId; private Long productId;
/** 成品编号 */ /**
*
*/
@Excel(name = "成品编号") @Excel(name = "成品编号")
private String productCode; private String productCode;
/** 成品名称 */ /**
*
*/
@Excel(name = "成品名称") @Excel(name = "成品名称")
private String productName; private String productName;
/** 采购订单ID */ /**
* ID
*/
@Excel(name = "采购订单ID") @Excel(name = "采购订单ID")
private Long purchaseOrderId; private Long purchaseOrderId;
/** 采购订单编号 */ /**
*
*/
@Excel(name = "采购订单编号") @Excel(name = "采购订单编号")
private String poNo; private String poNo;
/** ERP物料ID */ /**
* ERPID
*/
@Excel(name = "ERP物料ID") @Excel(name = "ERP物料ID")
private Long materialId; private Long materialId;
/** 物料编号 */ /**
*
*/
@Excel(name = "物料编号") @Excel(name = "物料编号")
private String materialCode; private String materialCode;
/** 物料名称 */ /**
*
*/
@Excel(name = "物料名称") @Excel(name = "物料名称")
private String materialName; private String materialName;
/** 绑定数量 */ /**
*
*/
@Excel(name = "绑定数量") @Excel(name = "绑定数量")
private BigDecimal bindAmount; private BigDecimal bindAmount;
/**绑定条码数量*/ /**
*
*/
private BigDecimal barcodeAmount; private BigDecimal barcodeAmount;
public void setOrderBindId(Long orderBindId) private String productSpec;
{
public void setOrderBindId(Long orderBindId) {
this.orderBindId = orderBindId; this.orderBindId = orderBindId;
} }
public Long getOrderBindId() public Long getOrderBindId() {
{
return orderBindId; return orderBindId;
} }
public void setSafeFlag(String safeFlag)
{ public void setSafeFlag(String safeFlag) {
this.safeFlag = safeFlag; this.safeFlag = safeFlag;
} }
public String getSafeFlag() public String getSafeFlag() {
{
return safeFlag; return safeFlag;
} }
public void setSaleOrderId(Long saleOrderId)
{ public void setSaleOrderId(Long saleOrderId) {
this.saleOrderId = saleOrderId; this.saleOrderId = saleOrderId;
} }
public Long getSaleOrderId() public Long getSaleOrderId() {
{
return saleOrderId; return saleOrderId;
} }
public void setSaleOrderCode(String saleOrderCode)
{ public void setSaleOrderCode(String saleOrderCode) {
this.saleOrderCode = saleOrderCode; this.saleOrderCode = saleOrderCode;
} }
public String getSaleOrderCode() public String getSaleOrderCode() {
{
return saleOrderCode; return saleOrderCode;
} }
public void setProductId(Long productId)
{ public void setProductId(Long productId) {
this.productId = productId; this.productId = productId;
} }
public Long getProductId() public Long getProductId() {
{
return productId; return productId;
} }
public void setProductCode(String productCode)
{ public void setProductCode(String productCode) {
this.productCode = productCode; this.productCode = productCode;
} }
public String getProductCode() public String getProductCode() {
{
return productCode; return productCode;
} }
public void setProductName(String productName)
{ public void setProductName(String productName) {
this.productName = productName; this.productName = productName;
} }
public String getProductName() public String getProductName() {
{
return productName; return productName;
} }
public void setPurchaseOrderId(Long purchaseOrderId)
{ public void setPurchaseOrderId(Long purchaseOrderId) {
this.purchaseOrderId = purchaseOrderId; this.purchaseOrderId = purchaseOrderId;
} }
public Long getPurchaseOrderId() public Long getPurchaseOrderId() {
{
return purchaseOrderId; return purchaseOrderId;
} }
public void setPoNo(String poNo)
{ public void setPoNo(String poNo) {
this.poNo = poNo; this.poNo = poNo;
} }
public String getPoNo() public String getPoNo() {
{
return poNo; return poNo;
} }
public void setMaterialId(Long materialId)
{ public void setMaterialId(Long materialId) {
this.materialId = materialId; this.materialId = materialId;
} }
public Long getMaterialId() public Long getMaterialId() {
{
return materialId; return materialId;
} }
public void setMaterialCode(String materialCode)
{ public void setMaterialCode(String materialCode) {
this.materialCode = materialCode; this.materialCode = materialCode;
} }
public String getMaterialCode() public String getMaterialCode() {
{
return materialCode; return materialCode;
} }
public void setMaterialName(String materialName)
{ public void setMaterialName(String materialName) {
this.materialName = materialName; this.materialName = materialName;
} }
public String getMaterialName() public String getMaterialName() {
{
return materialName; return materialName;
} }
public void setBindAmount(BigDecimal bindAmount)
{ public void setBindAmount(BigDecimal bindAmount) {
this.bindAmount = bindAmount; this.bindAmount = bindAmount;
} }
public BigDecimal getBindAmount() public BigDecimal getBindAmount() {
{
return bindAmount; return bindAmount;
} }
@ -196,6 +213,14 @@ public class MesOrderBind extends BaseEntity
this.barcodeAmount = barcodeAmount; this.barcodeAmount = barcodeAmount;
} }
public String getProductSpec() {
return productSpec;
}
public void setProductSpec(String productSpec) {
this.productSpec = productSpec;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -219,4 +244,17 @@ public class MesOrderBind extends BaseEntity
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.toString(); .toString();
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MesOrderBind that = (MesOrderBind) o;
return Objects.equals(orderBindId, that.orderBindId) && barcodeAmount.compareTo(that.barcodeAmount) == 0;
}
@Override
public int hashCode() {
return Objects.hash(orderBindId, barcodeAmount);
}
} }

@ -59,27 +59,27 @@ public class MesPurchaseOrder extends BaseEntity {
private BigDecimal completeAmount; private BigDecimal completeAmount;
/** 审核日期;对应FApproveDate */ /** 审核日期;对应FApproveDate */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "审核日期;对应FApproveDate", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "审核日期;对应FApproveDate", width = 30, dateFormat = "yyyy-MM-dd")
private Date approveDate; private Date approveDate;
/** ERP最后修改日期;对应FModifyDate */ /** ERP最后修改日期;对应FModifyDate */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "ERP最后修改日期;对应FModifyDate", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "ERP最后修改日期;对应FModifyDate", width = 30, dateFormat = "yyyy-MM-dd")
private Date erpModifyDate; private Date erpModifyDate;
/** 计划交货日期;对应FDeliveryDate */ /** 计划交货日期;对应FDeliveryDate */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "计划交货日期;对应FDeliveryDate", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划交货日期;对应FDeliveryDate", width = 30, dateFormat = "yyyy-MM-dd")
private Date planDeliveryDate; private Date planDeliveryDate;
/** 计划开始日期 */ /** 计划开始日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "计划开始日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划开始日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date beginDate; private Date beginDate;
/** 计划结束日期 */ /** 计划结束日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "计划结束日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划结束日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date endDate; private Date endDate;
@ -88,7 +88,7 @@ public class MesPurchaseOrder extends BaseEntity {
private String orderStatus; private String orderStatus;
/** 完成日期 */ /** 完成日期 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@Excel(name = "完成日期", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "完成日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date completeDate; private Date completeDate;
@ -176,6 +176,9 @@ public class MesPurchaseOrder extends BaseEntity {
private long mesMaterialId;//物料信息表的物料ID主键 private long mesMaterialId;//物料信息表的物料ID主键
private String alwaysFlag;
public Long getSerialNumber() { public Long getSerialNumber() {
return serialNumber; return serialNumber;
} }
@ -549,6 +552,14 @@ public class MesPurchaseOrder extends BaseEntity {
this.mesMaterialId = mesMaterialId; this.mesMaterialId = mesMaterialId;
} }
public String getAlwaysFlag() {
return alwaysFlag;
}
public void setAlwaysFlag(String alwaysFlag) {
this.alwaysFlag = alwaysFlag;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -166,6 +166,11 @@ public class MesSaleOrder extends BaseEntity {
*/ */
private String materialModel; private String materialModel;
private String materialSpec;
private Long erpMaterialId;
public String getMaterialModel() { public String getMaterialModel() {
return materialModel; return materialModel;
} }
@ -358,6 +363,22 @@ public class MesSaleOrder extends BaseEntity {
return isFlag; return isFlag;
} }
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
public Long getErpMaterialId() {
return erpMaterialId;
}
public void setErpMaterialId(Long erpMaterialId) {
this.erpMaterialId = erpMaterialId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -0,0 +1,54 @@
package com.hw.mes.domain.vo;
import com.hw.mes.domain.MesOrderBind;
import com.hw.mes.domain.MesProductPlan;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
/**
* @Description: VO
* @ClassName: MesOrderBindVo
* @Author : xins
* @Date :2024-08-14 13:46
* @Version :1.0
*/
@Data
public class MesOrderBindVo {
//物料ERPID
@NotNull(message = "物料ERPId必须输入")
private Long erpMaterialId;
//采购订单ID
@NotNull(message = "采购订单Id必须输入")
private Long purchaseOrderId;
//订单计划数量
@NotNull(message = "订单计划数量不能为空")
private BigDecimal orderAmount;
//物料编码
@NotEmpty(message = "物料编码不能为空")
private String materialCode;
//物料名称
@NotEmpty(message = "物料名称不能为空")
private String materialName;
//采购订单号
@NotEmpty(message = "采购订单号不能为空")
private String poNo;
//保存的订单绑定信息
@NotNull(message = "绑定信息不能为空")
private List<MesOrderBind> mesOrderBindList;
//待删除的订单绑定ID
private Long[] toDeletedOrderBindIds;
}

@ -109,4 +109,11 @@ public interface MesPurchaseOrderMapper
*/ */
List<MesPurchaseOrder> selectPurchaseOrderBindList(MesPurchaseOrder mesPurchaseOrder); List<MesPurchaseOrder> selectPurchaseOrderBindList(MesPurchaseOrder mesPurchaseOrder);
/**
* ,join material
* @param mesPurchaseOrder
* @return
*/
List<MesPurchaseOrder> selectMesPurchaseOrderJoinList(MesPurchaseOrder mesPurchaseOrder);
} }

@ -106,9 +106,11 @@ public interface IMesBaseBarcodeInfoService
* *
* @param barcodeIds * @param barcodeIds
* @param printType 1 3 * @param printType 1 3
* @param reprintFlag (1)
* @return * @return
*/ */
public int printBarcodes(Long[] barcodeIds,String printType); public int printBarcodes(Long[] barcodeIds, String printType,boolean reprintFlag);
/** /**
* () * ()

@ -27,6 +27,14 @@ public interface IMesPurchaseOrderService
*/ */
public List<MesPurchaseOrder> selectMesPurchaseOrderList(MesPurchaseOrder mesPurchaseOrder); public List<MesPurchaseOrder> selectMesPurchaseOrderList(MesPurchaseOrder mesPurchaseOrder);
/**
* ,Join material
*
* @param mesPurchaseOrder
* @return
*/
public List<MesPurchaseOrder> selectMesPurchaseOrderJoinList(MesPurchaseOrder mesPurchaseOrder);
/** /**
* *
* *
@ -113,4 +121,12 @@ public interface IMesPurchaseOrderService
* @return * @return
*/ */
public List<MesPurchaseOrder> selectPurchaseOrderBindList(MesPurchaseOrder mesPurchaseOrder); public List<MesPurchaseOrder> selectPurchaseOrderBindList(MesPurchaseOrder mesPurchaseOrder);
/**
*
*
* @param orderBindIds
* @return
*/
public int deleteMesOrderBindByOrderBindIds(Long[] orderBindIds);
} }

@ -585,17 +585,18 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
* *
* @param barcodeIds * @param barcodeIds
* @param printType 1 3 * @param printType 1 3
* @param reprintFlag (1)
* @return * @return
*/ */
@Override @Override
@Transactional @Transactional
public int printBarcodes(Long[] barcodeIds, String printType) { public int printBarcodes(Long[] barcodeIds, String printType, boolean reprintFlag) {
//获取条码List //获取条码List
List<List<PrintContentVo>> printContents = new ArrayList<>(); // List<List<PrintContentVo>> printContents = new ArrayList<>();
List<MesBaseBarcodeInfo> toUpdatedBaseBarcodeInfos = new ArrayList<>(); // List<MesBaseBarcodeInfo> toUpdatedBaseBarcodeInfos = new ArrayList<>();
for (Long barcodeId : barcodeIds) { for (Long barcodeId : barcodeIds) {
printBarcodesByBarcodeId(barcodeId, printType); printBarcodesByBarcodeId(barcodeId, printType, reprintFlag);
} }
// for (MesBaseBarcodeInfo toUpdateMesBaseBarcodeInfo : toUpdatedBaseBarcodeInfos) { // for (MesBaseBarcodeInfo toUpdateMesBaseBarcodeInfo : toUpdatedBaseBarcodeInfos) {
@ -617,18 +618,20 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
// throw new RuntimeException(printResultR.getMsg()); // throw new RuntimeException(printResultR.getMsg());
// } // }
return toUpdatedBaseBarcodeInfos.size(); return 1;
} }
@Transactional(propagation = Propagation.REQUIRES_NEW) @Transactional(propagation = Propagation.REQUIRES_NEW)
public void printBarcodesByBarcodeId(Long barcodeId, String printType) { public void printBarcodesByBarcodeId(Long barcodeId, String printType, boolean reprintFlag) {
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoJoinByBarcodeId(barcodeId); MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoJoinByBarcodeId(barcodeId);
if (!reprintFlag) {
String printFlag = mesBaseBarcodeInfo.getPrintFlag(); String printFlag = mesBaseBarcodeInfo.getPrintFlag();
if (printFlag.equals(MesConstants.MES_BARCODE_PRINT_FLAG_YES)) { if (printFlag.equals(MesConstants.MES_BARCODE_PRINT_FLAG_YES)) {
throw new ServiceException("此物料条码[" + mesBaseBarcodeInfo.getBarcodeInfo() + "]已经打印过,不能重复打印"); throw new ServiceException("此物料条码[" + mesBaseBarcodeInfo.getBarcodeInfo() + "]已经打印过,不能重复打印");
} }
}
String materialName = mesBaseBarcodeInfo.getMaterialName(); String materialName = mesBaseBarcodeInfo.getMaterialName();
List<PrintContentVo> printContentVos = new ArrayList<>(); List<PrintContentVo> printContentVos = new ArrayList<>();
@ -740,7 +743,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseBarcodeInfo.setPrintTime(DateUtils.getNowDate()); mesBaseBarcodeInfo.setPrintTime(DateUtils.getNowDate());
mesBaseBarcodeInfo.setPrintPerson(SecurityUtils.getUsername()); mesBaseBarcodeInfo.setPrintPerson(SecurityUtils.getUsername());
mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_YES); mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_YES);
mesBaseBarcodeInfo.setPrintNumber(1L); mesBaseBarcodeInfo.setPrintNumber(mesBaseBarcodeInfo.getPrintNumber() == null ? 1L : mesBaseBarcodeInfo.getPrintNumber() + 1);
mesBaseBarcodeInfo.setAcceptedDate(DateUtils.getNowDate()); mesBaseBarcodeInfo.setAcceptedDate(DateUtils.getNowDate());
this.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo); this.updateMesBaseBarcodeInfo(mesBaseBarcodeInfo);

@ -4,6 +4,7 @@ import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.hw.common.core.constant.MesConstants; import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
@ -14,6 +15,7 @@ import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo; import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.domain.MesOrderBind; import com.hw.mes.domain.MesOrderBind;
import com.hw.mes.domain.MesSaleOrder; import com.hw.mes.domain.MesSaleOrder;
import com.hw.mes.domain.vo.MesOrderBindVo;
import com.hw.mes.mapper.*; import com.hw.mes.mapper.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -66,6 +68,21 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
return mesPurchaseOrderMapper.selectMesPurchaseOrderList(mesPurchaseOrder); return mesPurchaseOrderMapper.selectMesPurchaseOrderList(mesPurchaseOrder);
} }
/**
* ,Join material
*
* @param mesPurchaseOrder
* @return
*/
@Override
public List<MesPurchaseOrder> selectMesPurchaseOrderJoinList(MesPurchaseOrder mesPurchaseOrder) {
mesPurchaseOrder.setMaterialSpec(StringUtils.isNotEmpty(mesPurchaseOrder.getMaterialSpec())
? mesPurchaseOrder.getMaterialSpec().replaceAll("\\s+", "") : "");
mesPurchaseOrder.setSpecificationParameter(StringUtils.isNotEmpty(mesPurchaseOrder.getSpecificationParameter())
? mesPurchaseOrder.getSpecificationParameter().replaceAll("\\s+", "") : "");
return mesPurchaseOrderMapper.selectMesPurchaseOrderJoinList(mesPurchaseOrder);
}
/** /**
* *
* *
@ -120,7 +137,7 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
* @return * @return
*/ */
@Override @Override
@Transactional @Transactional(rollbackFor = Exception.class)
public int bindOrder(MesPurchaseOrder mesPurchaseOrder) { public int bindOrder(MesPurchaseOrder mesPurchaseOrder) {
Long erpMaterialId = mesPurchaseOrder.getMaterialId(); Long erpMaterialId = mesPurchaseOrder.getMaterialId();
MesBaseMaterialInfo mesBaseMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByErpId(erpMaterialId); MesBaseMaterialInfo mesBaseMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByErpId(erpMaterialId);
@ -137,15 +154,9 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
} }
Long purchaseOrderId = mesPurchaseOrder.getPurchaseOrderId(); Long purchaseOrderId = mesPurchaseOrder.getPurchaseOrderId();
MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo(); MesOrderBind queryOrderBind = new MesOrderBind();
queryBaseBarcodeInfo.setPurchaseOrderId(purchaseOrderId); queryOrderBind.setPurchaseOrderId(purchaseOrderId);
int mesBaseBarcodeInfoCount = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoCount(queryBaseBarcodeInfo); List<MesOrderBind> dbMesOrderBinds = mesOrderBindMapper.selectMesOrderBindList(queryOrderBind);
if (mesBaseBarcodeInfoCount > 0) {
throw new ServiceException("此采购订单已经生成条码,不能再绑定");
}
mesPurchaseOrderMapper.deleteMesOrderBindByPurchaseOrderId(mesPurchaseOrder.getPurchaseOrderId());
Date currentDate = new Date(); Date currentDate = new Date();
String userName = SecurityUtils.getUsername(); String userName = SecurityUtils.getUsername();
@ -155,8 +166,46 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
String poNo = mesPurchaseOrder.getPoNo(); String poNo = mesPurchaseOrder.getPoNo();
BigDecimal orderAmount = mesPurchaseOrder.getOrderAmount(); BigDecimal orderAmount = mesPurchaseOrder.getOrderAmount();
List<MesOrderBind> orderBinds = mesPurchaseOrder.getMesOrderBindList(); List<MesOrderBind> orderBinds = mesPurchaseOrder.getMesOrderBindList();
List<MesOrderBind> toUpdatedOrderBinds = orderBinds.stream().filter(ob ->
ob.getOrderBindId() != null).collect(Collectors.toList());
List<MesOrderBind> toInsertedOrderBinds = orderBinds.stream().filter(ob ->
ob.getOrderBindId() == null).collect(Collectors.toList());
/**判断两个数据库的list和前端提交的list是否相同根据orderbindid和barcodeamount判断*/
boolean areEqual =
(dbMesOrderBinds != null && toUpdatedOrderBinds != null) &&
dbMesOrderBinds.size() == toUpdatedOrderBinds.size() &&
dbMesOrderBinds.containsAll(toUpdatedOrderBinds) &&
toUpdatedOrderBinds.containsAll(dbMesOrderBinds);
if (!areEqual) {
throw new ServiceException("订单绑定数据有变化,请重新绑定");
}
/**
*
*/
BigDecimal totalBindAmount = BigDecimal.ZERO; BigDecimal totalBindAmount = BigDecimal.ZERO;
for (MesOrderBind orderBind : orderBinds) { for (MesOrderBind toUpdatedOrderBind : toUpdatedOrderBinds) {
BigDecimal bindAmount = toUpdatedOrderBind.getBindAmount() == null ?
BigDecimal.ZERO : toUpdatedOrderBind.getBindAmount();
if (bindAmount.compareTo(BigDecimal.ZERO) <= 0) {
throw new ServiceException("绑定数量需大于0");
}
if (bindAmount.compareTo(toUpdatedOrderBind.getBarcodeAmount()) < 0) {
throw new ServiceException("绑定数量不能小于已经生成的条码数量");
}
toUpdatedOrderBind.setUpdateTime(currentDate);
toUpdatedOrderBind.setUpdateBy(userName);
totalBindAmount = totalBindAmount.add(bindAmount);
mesOrderBindMapper.updateMesOrderBind(toUpdatedOrderBind);
}
/**
*
*/
for (MesOrderBind orderBind : toInsertedOrderBinds) {
if (StringUtils.isEmpty(orderBind.getSafeFlag())) { if (StringUtils.isEmpty(orderBind.getSafeFlag())) {
throw new ServiceException("请全部选择安全标识"); throw new ServiceException("请全部选择安全标识");
} }
@ -176,21 +225,20 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
throw new ServiceException("绑定数量需大于0"); throw new ServiceException("绑定数量需大于0");
} }
orderBind.setPurchaseOrderId(purchaseOrderId); orderBind.setPurchaseOrderId(purchaseOrderId);
orderBind.setPoNo(poNo);
orderBind.setCreateTime(currentDate); orderBind.setCreateTime(currentDate);
orderBind.setCreateBy(userName); orderBind.setCreateBy(userName);
orderBind.setMaterialId(erpMaterialId);
orderBind.setMaterialCode(materialCode);
orderBind.setMaterialName(materialName);
orderBind.setPoNo(poNo);
totalBindAmount = totalBindAmount.add(bindAmount); totalBindAmount = totalBindAmount.add(bindAmount);
} }
if (totalBindAmount.compareTo(orderAmount) > 0) { if (totalBindAmount.compareTo(orderAmount) > 0) {
throw new ServiceException("总绑定数量" + totalBindAmount + "不能大于订单计划数量" + orderAmount); throw new ServiceException("现总绑定数量为" + totalBindAmount + ",不能大于订单计划数量" + orderAmount);
} }
return mesPurchaseOrderMapper.batchMesOrderBind(orderBinds); if (toInsertedOrderBinds != null && !toInsertedOrderBinds.isEmpty()) {
mesPurchaseOrderMapper.batchMesOrderBind(toInsertedOrderBinds);
}
return 1;
} }
@ -215,6 +263,7 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
/** /**
* *
*
* @param mesPurchaseOrder * @param mesPurchaseOrder
* @return * @return
*/ */
@ -225,6 +274,7 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
/** /**
* List * List
*
* @param mesPurchaseOrder * @param mesPurchaseOrder
* @return * @return
*/ */
@ -236,6 +286,7 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
/** /**
* *
*
* @param purchaseOrderList * @param purchaseOrderList
* @return * @return
*/ */
@ -350,4 +401,21 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
} }
/**
*
*
* @param orderBindIds
* @return
*/
@Override
public int deleteMesOrderBindByOrderBindIds(Long[] orderBindIds) {
for (Long orderBindId : orderBindIds) {
MesOrderBind mesOrderBind = mesOrderBindMapper.selectMesOrderBindByOrderBindId(orderBindId);
if (mesOrderBind.getBarcodeAmount() != null && mesOrderBind.getBarcodeAmount().compareTo(BigDecimal.ONE) >= 0) {
throw new ServiceException("已经生成条码数量的不能删除");
}
}
return mesOrderBindMapper.deleteMesOrderBindByOrderBindIds(orderBindIds);
}
} }

@ -2,6 +2,7 @@ package com.hw.mes.service.impl;
import java.util.List; import java.util.List;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.hw.mes.mapper.MesSaleOrderMapper; import com.hw.mes.mapper.MesSaleOrderMapper;
@ -105,6 +106,8 @@ public class MesSaleOrderServiceImpl implements IMesSaleOrderService
@Override @Override
public List<MesSaleOrder> selectMesSaleOrderJoinMaterialList(MesSaleOrder mesSaleOrder) public List<MesSaleOrder> selectMesSaleOrderJoinMaterialList(MesSaleOrder mesSaleOrder)
{ {
mesSaleOrder.setMaterialSpec(StringUtils.isNotEmpty(mesSaleOrder.getMaterialSpec())
? mesSaleOrder.getMaterialSpec().replaceAll("\\s+", "") : "");
return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder); return mesSaleOrderMapper.selectMesSaleOrderJoinMaterialList(mesSaleOrder);
} }
} }

@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="orderBindBarcodeAmount" column="order_bind_barcode_amount" /> <result property="orderBindBarcodeAmount" column="order_bind_barcode_amount" />
<result property="safeBindBarcodeAmount" column="safe_bind_barcode_amount" /> <result property="safeBindBarcodeAmount" column="safe_bind_barcode_amount" />
<result property="alwaysFlag" column="always_flag" />
</resultMap> </resultMap>
<resultMap id="MesPurchaseOrderMesOrderBindResult" type="MesPurchaseOrder" extends="MesPurchaseOrderResult"> <resultMap id="MesPurchaseOrderMesOrderBindResult" type="MesPurchaseOrder" extends="MesPurchaseOrderResult">
@ -64,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="productId" column="sub_product_id" /> <result property="productId" column="sub_product_id" />
<result property="productCode" column="sub_product_code" /> <result property="productCode" column="sub_product_code" />
<result property="productName" column="sub_product_name" /> <result property="productName" column="sub_product_name" />
<result property="purchaseOrderId" column="sub_purchase_order_id" /> <result property="purchaseOrderId" column="sub_purchase_order_id" />
<result property="poNo" column="sub_po_no" /> <result property="poNo" column="sub_po_no" />
<result property="materialId" column="sub_material_id" /> <result property="materialId" column="sub_material_id" />
@ -75,6 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createTime" column="sub_create_time" /> <result property="createTime" column="sub_create_time" />
<result property="updateBy" column="sub_update_by" /> <result property="updateBy" column="sub_update_by" />
<result property="updateTime" column="sub_update_time" /> <result property="updateTime" column="sub_update_time" />
<result property="productSpec" column="sub_product_spec" />
<result property="barcodeAmount" column="sub_barcode_amount" />
</resultMap> </resultMap>
@ -109,10 +113,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectMesPurchaseOrderByPurchaseOrderId" parameterType="Long" resultMap="MesPurchaseOrderMesOrderBindResult"> <select id="selectMesPurchaseOrderByPurchaseOrderId" parameterType="Long" resultMap="MesPurchaseOrderMesOrderBindResult">
select a.purchase_order_id, a.erp_id, a.fentry_id, a.po_no, a.document_status, a.material_id, a.material_code, a.material_name, a.order_amount, a.complete_amount, a.approve_date, a.erp_modify_date, a.plan_delivery_date, a.begin_date, a.end_date, a.order_status, a.complete_date, a.is_flag, a.unit_id, a.stock_unit_id, a.price_unit_id, a.aux_prop_id, a.src_bill_no, a.purchase_org_id, a.tond_base, a.supplier_id, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, select a.purchase_order_id, a.po_no, a.document_status, a.material_id,
b.order_bind_id as sub_order_bind_id, b.safe_flag as sub_safe_flag, b.sale_order_id as sub_sale_order_id, b.sale_order_code as sub_sale_order_code, b.product_id as sub_product_id, b.product_code as sub_product_code, b.product_name as sub_product_name, b.purchase_order_id as sub_purchase_order_id, b.po_no as sub_po_no, b.material_id as sub_material_id, b.material_code as sub_material_code, b.material_name as sub_material_name, b.bind_amount as sub_bind_amount, b.remark as sub_remark, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time a.material_code, a.material_name, a.order_amount, a.complete_amount, a.approve_date,a.specification_parameter,
a.erp_modify_date, a.plan_delivery_date, a.order_status, a.complete_date,
a.is_flag, a.src_bill_no,
a.purchase_org_id, a.tond_base, a.supplier_id,a.create_by, a.create_time, a.update_by, a.update_time,
b.order_bind_id as sub_order_bind_id, b.safe_flag as sub_safe_flag, b.sale_order_id as sub_sale_order_id,
b.sale_order_code as sub_sale_order_code, b.product_id as sub_product_id,
mbmi.material_code as sub_product_code, mbmi.material_name as sub_product_name, mbmi.material_spec as sub_product_spec,
b.purchase_order_id as sub_purchase_order_id, b.po_no as sub_po_no,
b.material_id as sub_material_id, b.material_code as sub_material_code,
b.material_name as sub_material_name, b.bind_amount as sub_bind_amount, b.barcode_amount as sub_barcode_amount
from mes_purchase_order a from mes_purchase_order a
left join mes_order_bind b on b.purchase_order_id = a.purchase_order_id left join mes_order_bind b on b.purchase_order_id = a.purchase_order_id
left join mes_base_material_info mbmi on b.product_id=mbmi.erp_id
where a.purchase_order_id = #{purchaseOrderId} where a.purchase_order_id = #{purchaseOrderId}
</select> </select>
@ -337,4 +351,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name order by mpo.erp_modify_date desc,mpo.po_no ,mpo.material_name
</select> </select>
<select id="selectMesPurchaseOrderJoinList" parameterType="MesPurchaseOrder" resultMap="MesPurchaseOrderResult">
select mpo.purchase_order_id, mpo.erp_id, mpo.fentry_id, mpo.po_no, mpo.document_status, mpo.material_id,
mpo.order_amount, mpo.complete_amount, mpo.approve_date,
mpo.erp_modify_date, mpo.plan_delivery_date, mpo.begin_date, mpo.end_date, mpo.order_status,
mpo.complete_date, mpo.specification_parameter, mpo.src_bill_no, mpo.purchase_org_id, mpo.tond_base,
mbmi.material_code,mbmi.material_name,mbmi.material_spec,mbmi.always_flag
from mes_purchase_order mpo left join mes_base_material_info mbmi on mpo.material_id =mbmi.erp_id
<where>
<if test="poNo != null and poNo != ''"> and mpo.po_no like concat('%', #{poNo}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
<if test="materialSpec != null and materialSpec != '' ">and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
<if test="specificationParameter != null and specificationParameter != '' ">and replace(mpo.specification_parameter,' ','') like concat('%', #{specificationParameter},
'%')</if>
<if test="orderStatus != null and orderStatus != ''"> and mpo.order_status = #{orderStatus}</if>
<if test="alwaysFlag != null and alwaysFlag != ''"> and mbmi.always_flag = #{alwaysFlag}</if>
<if test="orderAmount != null "> and mpo.order_amount = #{orderAmount}</if>
<if test="completeAmount != null "> and mpo.complete_amount = #{completeAmount}</if>
<if test="approveDate != null "> and mpo.approve_date = #{approveDate}</if>
<if test="erpModifyDate != null "> and mpo.erp_modify_date = #{erpModifyDate}</if>
<if test="planDeliveryDate != null "> and mpo.plan_delivery_date = #{planDeliveryDate}</if>
<if test="beginDate != null "> and mpo.begin_date = #{beginDate}</if>
<if test="endDate != null "> and mpo.end_date = #{endDate}</if>
<if test="completeDate != null "> and mpo.complete_date = #{completeDate}</if>
<if test="isFlag != null and isFlag != ''"> and mpo.is_flag = #{isFlag}</if>
<if test="srcBillNo != null and srcBillNo != ''"> and mpo.src_bill_no like concat('%', #{srcBillNo}, '%')</if>
<if test="tondBase != null and tondBase != ''"> and mpo.tond_base like concat('%', #{tondBase}, '%')</if>
</where>
</select>
</mapper> </mapper>

@ -34,6 +34,8 @@
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="materialModel" column="material_model"/> <result property="materialModel" column="material_model"/>
<result property="materialSpec" column="material_spec"/>
<result property="erpMaterialId" column="erp_material_id"/>
</resultMap> </resultMap>
<sql id="selectMesSaleOrderVo"> <sql id="selectMesSaleOrderVo">
@ -225,9 +227,11 @@
select mso.sale_order_id, select mso.sale_order_id,
mso.saleorder_code, mso.saleorder_code,
mso.document_status, mso.document_status,
mso.material_id as erp_material_id,
mbmi.material_id, mbmi.material_id,
mso.material_code, mbmi.material_code,
mso.material_name, mbmi.material_name,
mbmi.material_spec,
mso.order_amount, mso.order_amount,
mso.complete_amount, mso.complete_amount,
mso.release_qty, mso.release_qty,
@ -238,11 +242,15 @@
mso.complete_date mso.complete_date
from mes_sale_order mso left join mes_base_material_info mbmi on mso.material_id = mbmi.erp_id from mes_sale_order mso left join mes_base_material_info mbmi on mso.material_id = mbmi.erp_id
<where> <where>
<if test="saleorderCode != null and saleorderCode != ''">and mso.saleorder_code = #{saleorderCode}</if> <if test="saleorderCode != null and saleorderCode != ''">and mso.saleorder_code like concat('%', #{saleorderCode},
<if test="materialCode != null and materialCode != ''">and mso.material_code = #{materialCode}</if> '%')</if>
<if test="materialName != null and materialName != ''">and mso.material_name like concat('%', #{materialName}, <if test="materialCode != null and materialCode != ''">and mbmi.material_code like concat('%', #{materialCode},
'%')</if>
<if test="materialName != null and materialName != ''">and mbmi.material_name like concat('%', #{materialName},
'%') '%')
</if> </if>
<if test="materialSpec != null and materialSpec != '' ">and replace(mbmi.material_spec,' ','') like concat('%', #{materialSpec},
'%')</if>
</where> </where>
</select> </select>

@ -158,3 +158,12 @@ export function addRegularBarcode(data) {
data: data data: data
}) })
} }
// 打印原材料条码
export function reprintBarcodes(barcodeIds) {
return request({
url: '/mes/barcode/reprintBarcodes/' + barcodeIds,
method: 'get'
})
}

@ -66,6 +66,13 @@ export function bindOrder(data) {
} }
// 删除绑定的采购订单信息
export function deleteOrderBind(orderBindIds) {
return request({
url: '/mes/purchaseOrder/deleteOrderBind/'+orderBindIds,
method: 'get'
})
}
// 查询采购订单信息详细,校验是否需要绑定 // 查询采购订单信息详细,校验是否需要绑定
export function getCheckedPurchaseOrder(purchaseOrderId) { export function getCheckedPurchaseOrder(purchaseOrderId) {

@ -297,13 +297,13 @@ export const dynamicRoutes = [
], ],
}, },
{ {
path: '/mes/product-order', path: '/mes/purchase-order',
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ['mes:productOrder:bind'], permissions: ['mes:purchaseOrder:bind'],
children: [ children: [
{ {
path: 'bind/:purchaseOrderId(\\d+)', path: 'bind/:purchaseOrderId(\\d+)/:materialSpec',
component: () => import('@/views/mes/purchaseOrder/bindOrder'), component: () => import('@/views/mes/purchaseOrder/bindOrder'),
name: 'orderBind', name: 'orderBind',
meta: { title: '订单信息绑定', activeMenu: '/mes/purchaseOrder' } meta: { title: '订单信息绑定', activeMenu: '/mes/purchaseOrder' }

@ -1,8 +1,5 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="form" :model="form" label-width="110px"> <el-form ref="form" :model="form" label-width="110px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -17,8 +14,6 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="物料编码" prop="materialCode"> <el-form-item label="物料编码" prop="materialCode">
@ -32,6 +27,19 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="物料规格" prop="materialSpec">
<el-input v-model="form.materialSpec" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格参数" prop="specificationParameter">
<el-input v-model="form.specificationParameter" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="审核日期" prop="approveDate"> <el-form-item label="审核日期" prop="approveDate">
@ -50,7 +58,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="订单状态" prop="orderStatus"> <el-form-item label="订单状态" prop="orderStatus">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.order_status" :value="form.orderStatus"/> <dict-tag :options="dict.type.mes_purchase_order_status" :value="form.orderStatus"/>
</template> </template>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -91,7 +99,8 @@
<el-table-column label="序号" align="center" prop="index" width="50"/> <el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="安全库存标识" prop="safeFlag" width="150"> <el-table-column label="安全库存标识" prop="safeFlag" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-radio-group v-model="scope.row.safeFlag" @input="changeSafeFlag(scope.row)"> <el-radio-group v-model="scope.row.safeFlag" @input="changeSafeFlag(scope.row)"
:disabled="scope.row.orderBindId">
<el-radio <el-radio
v-for="dict in dict.type.mes_safe_flag" v-for="dict in dict.type.mes_safe_flag"
:key="dict.value" :key="dict.value"
@ -104,19 +113,17 @@
<el-table-column label="销售订单" prop="saleOrderCode"> <el-table-column label="销售订单" prop="saleOrderCode">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.saleOrderCode" placeholder="请点击右侧选择销售订单" readonly> <el-input v-model="scope.row.saleOrderCode" placeholder="请点击右侧选择销售订单" readonly>
<el-button slot="append" icon="el-icon-search" @click="handleSaleOrderAdd(scope.row)"></el-button> <el-button slot="append" icon="el-icon-search"
v-if="!scope.row.orderBindId && scope.row.safeFlag=== SAFE_FLAG.NO"
@click="handleSaleOrderAdd(scope.row)"></el-button>
</el-input> </el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="成品编码" prop="productCode" width="150"> <el-table-column label="成品编码" prop="productCode" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.productCode" readonly/>
</template>
</el-table-column> </el-table-column>
<el-table-column label="成品名称" prop="productName" width="150"> <el-table-column label="成品名称" prop="productName" width="150">
<template slot-scope="scope"> </el-table-column>
<el-input v-model="scope.row.productName" readonly/> <el-table-column label="成品规格" prop="productSpec" width="150">
</template>
</el-table-column> </el-table-column>
<el-table-column label="绑定数量" prop="bindAmount" width="260"> <el-table-column label="绑定数量" prop="bindAmount" width="260">
<template slot-scope="scope"> <template slot-scope="scope">
@ -124,6 +131,8 @@
</el-input-number> </el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="条码数量" prop="barcodeAmount" width="150">
</el-table-column>
</el-table> </el-table>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -146,7 +155,7 @@
</template> </template>
<script> <script>
import {getPurchaseOrder, bindOrder} from "@/api/mes/purchaseOrder"; import {getPurchaseOrder, bindOrder, deleteOrderBind} from "@/api/mes/purchaseOrder";
import selectSaleOrder from '@//views/mes/purchaseOrder/selectSaleOrder.vue'; import selectSaleOrder from '@//views/mes/purchaseOrder/selectSaleOrder.vue';
@ -163,6 +172,7 @@ export default {
loading: true, loading: true,
// //
ids: [], ids: [],
indexes: [],
// //
checkedMesOrderBind: [], checkedMesOrderBind: [],
// //
@ -226,26 +236,80 @@ export default {
], ],
}, },
saleOrderOpen: false saleOrderOpen: false,
SAFE_FLAG: {
YES: '1',
NO: '0'
}
}; };
}, },
created() {
activated() {
this.getPurchaseOrder();
},
methods: {
getPurchaseOrder() {
const purchaseOrderId = this.$route.params && this.$route.params.purchaseOrderId; const purchaseOrderId = this.$route.params && this.$route.params.purchaseOrderId;
const materialSpec = this.$route.params && this.$route.params.materialSpec;
getPurchaseOrder(purchaseOrderId).then(response => { getPurchaseOrder(purchaseOrderId).then(response => {
this.form = response.data; this.form = response.data;
this.form.materialSpec = materialSpec;
this.mesOrderBindList = response.data.mesOrderBindList; this.mesOrderBindList = response.data.mesOrderBindList;
}); });
},
isPositiveInteger(value) {
// 使
return /^[0-9]\d*$/.test(value);
}, },
methods: {
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.loading = true; this.loading = true;
let totalBindAmount = 0;
for (let i = 0; i < this.mesOrderBindList.length; i++) {
let mob = this.mesOrderBindList[i];
let bindAmount = mob.bindAmount ? parseInt(mob.bindAmount) : 0;
let barcodeAmount = mob.barcodeAmount ? parseInt(mob.barcodeAmount) : 0;
if (!mob.safeFlag) {
this.$modal.msgError("序号为" + (i + 1) + ",请选择安全标识");
return;
}
if (mob.safeFlag === this.SAFE_FLAG.NO && !mob.saleOrderId) {
this.$modal.msgError("序号为" + (i + 1) + ",请选择销售订单");
return;
}
if (!this.isPositiveInteger(bindAmount) || bindAmount <= 0) {
this.$modal.msgError("序号为" + (i + 1) + ",绑定数量须为大于等于0的正整数");
return;
}
if (bindAmount < barcodeAmount) {
this.$modal.msgError("序号为" + (i + 1) + ",绑定数量不能小于条码数量");
return;
}
totalBindAmount = totalBindAmount + bindAmount;
}
if (totalBindAmount > this.form.orderAmount) {
this.$modal.msgError("现总绑定数量为" + totalBindAmount + ",不能大于订单计划数量" + this.form.orderAmount);
return;
}
this.form.mesOrderBindList = this.mesOrderBindList; this.form.mesOrderBindList = this.mesOrderBindList;
if (this.form.purchaseOrderId != null) { if (this.form.purchaseOrderId != null) {
bindOrder(this.form).then(response => { bindOrder(this.form).then(response => {
this.$modal.msgSuccess("绑定成功"); this.$modal.msgSuccess("绑定成功");
this.close(); this.close();
}).catch(error => {
this.getPurchaseOrder();
}); });
} }
@ -266,24 +330,40 @@ export default {
obj.productCode = ""; obj.productCode = "";
obj.productName = ""; obj.productName = "";
obj.bindAmount = ""; obj.bindAmount = "";
obj.barcodeAmount = 0;
obj.remark = ""; obj.remark = "";
this.mesOrderBindList.push(obj); this.mesOrderBindList.push(obj);
}, },
/** 采购销售订单绑定信息;销售订单绑定采购订单明细信息删除按钮操作 */ /** 采购销售订单绑定信息;销售订单绑定采购订单明细信息删除按钮操作 */
handleDeleteMesOrderBind() { handleDeleteMesOrderBind() {
if (this.checkedMesOrderBind.length == 0) { if (this.checkedMesOrderBind.length === 0) {
this.$modal.msgError("请先选择要删除的采购订单绑定信息"); this.$modal.msgError("请先选择要删除的采购订单绑定信息");
} else { } else {
let ids = this.ids;
ids = ids.filter(item => item != null && item !== '')
this.$modal.confirm('是否确认删除序号为"' + this.indexes + '"的数据项?').then(function () {
if (ids.length > 0) {
return deleteOrderBind(ids);
}
}).then(() => {
this.$modal.msgSuccess("删除成功");
const mesOrderBindList = this.mesOrderBindList; const mesOrderBindList = this.mesOrderBindList;
const checkedMesOrderBind = this.checkedMesOrderBind; const checkedMesOrderBind = this.checkedMesOrderBind;
this.mesOrderBindList = mesOrderBindList.filter(function (item) { this.mesOrderBindList = mesOrderBindList.filter(function (item) {
return checkedMesOrderBind.indexOf(item.index) == -1 return checkedMesOrderBind.indexOf(item.index) == -1
}); });
}).catch(() => {
});
} }
}, },
/** 复选框选中数据 */ /** 复选框选中数据 */
handleMesOrderBindSelectionChange(selection) { handleMesOrderBindSelectionChange(selection) {
this.checkedMesOrderBind = selection.map(item => item.index) this.checkedMesOrderBind = selection.map(item => item.index)
this.ids = selection.map(item => item.orderBindId)
this.indexes = selection.map(item => item.index)
}, },
@ -296,17 +376,40 @@ export default {
/** 提交选择销售订单信息按钮 */ /** 提交选择销售订单信息按钮 */
submitSaleOrderForm() { submitSaleOrderForm() {
let selectedRow = this.$refs.saleOrderRef.selectedRow; let selectedRow = this.$refs.saleOrderRef.selectedRow;
let filteredWithIndex = this.mesOrderBindList
.filter(item => item.saleOrderId === selectedRow.saleOrderId)
.map((item, newIndex) => ({value: item, originalIndex: this.mesOrderBindList.indexOf(item)})); //
// let sameSaleOrder = this.mesOrderBindList.filter(item => item.saleOrderId === selectedRow.saleOrderId)
if (filteredWithIndex && filteredWithIndex.length > 0) {
this.$modal.msgError("序号为" + (filteredWithIndex[0].originalIndex + 1) + "已经选择此销售订单");
return;
}
this.editedRow.saleOrderId = selectedRow.saleOrderId; this.editedRow.saleOrderId = selectedRow.saleOrderId;
this.editedRow.saleOrderCode = selectedRow.saleorderCode; this.editedRow.saleOrderCode = selectedRow.saleorderCode;
this.editedRow.productCode = selectedRow.materialCode; this.editedRow.productCode = selectedRow.materialCode;
this.editedRow.productName = selectedRow.materialName; this.editedRow.productName = selectedRow.materialName;
this.editedRow.productId = selectedRow.materialId; this.editedRow.productId = selectedRow.erpMaterialId;
this.saleOrderOpen = false; this.saleOrderOpen = false;
}, },
changeSafeFlag(row) { changeSafeFlag(row) {
if (row.safeFlag == "1") { if (row.safeFlag === this.SAFE_FLAG.YES) {
let filteredWithIndex = this.mesOrderBindList
.filter(item => item.safeFlag === this.SAFE_FLAG.YES && item.index!== row.index)
.map((item, newIndex) => ({value: item, originalIndex: this.mesOrderBindList.indexOf(item)})); //
// let sameSaleOrder = this.mesOrderBindList.filter(item => item.saleOrderId === selectedRow.saleOrderId)
if (filteredWithIndex && filteredWithIndex.length > 0) {
row.safeFlag = this.SAFE_FLAG.NO;
this.$modal.msgError("序号为" + (filteredWithIndex[0].originalIndex + 1) + "已经选择安全库存");
return;
}
row.saleOrderId = ""; row.saleOrderId = "";
row.saleOrderCode = ""; row.saleOrderCode = "";
row.productCode = ""; row.productCode = "";

@ -26,6 +26,36 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input
v-model="queryParams.materialSpec"
placeholder="请输入物料规格"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="规格参数" prop="specificationParameter">
<el-input
v-model="queryParams.specificationParameter"
placeholder="请输入规格参数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="常备物料" prop="alwaysFlag">
<el-select v-model="queryParams.alwaysFlag" placeholder="请选择常备物料标识" clearable>
<el-option
v-for="dict in dict.type.mes_material_bind_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="订单状态" prop="orderStatus"> <el-form-item label="订单状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择订单状态" clearable> <el-select v-model="queryParams.orderStatus" placeholder="请选择订单状态" clearable>
<el-option <el-option
@ -37,22 +67,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="源单编号" prop="srcBillNo">
<el-input
v-model="queryParams.srcBillNo"
placeholder="请输入源单编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="京源项目" prop="tondBase">
<el-input
v-model="queryParams.tondBase"
placeholder="请输入京源项目"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -62,12 +77,13 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="info" type="primary"
plain plain
icon="el-icon-upload2" icon="el-icon-upload2"
size="mini" size="mini"
@click="handleImport" @click="handleImport"
>采购申请单导入</el-button> >采购申请单导入
</el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -75,34 +91,41 @@
<el-table-column label="采购订单编号" align="center" prop="poNo"/> <el-table-column label="采购订单编号" align="center" prop="poNo"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/> <el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/> <el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="订单数量" align="center" prop="orderAmount" /> <el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="审核日期" align="center" prop="approveDate" width="180"> <el-table-column label="规格参数" align="center" prop="specificationParameter" width="200"/>
<el-table-column label="常备物料" align="center" prop="alwaysFlag">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.approveDate, '{y}-{m}-{d}') }}</span> <dict-tag :options="dict.type.mes_material_bind_flag" :value="scope.row.alwaysFlag"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="ERP最后修改日期" align="center" prop="erpModifyDate" width="180"> <el-table-column label="订单状态" align="center" prop="orderStatus">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.erpModifyDate, '{y}-{m}-{d}') }}</span> <dict-tag :options="dict.type.mes_purchase_order_status" :value="scope.row.orderStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="计划交货日期" align="center" prop="planDeliveryDate" width="180"> <el-table-column label="订单数量" align="center" prop="orderAmount"/>
<el-table-column label="完成数量" align="center" prop="completeAmount"/>
<el-table-column label="审核日期" align="center" prop="approveDate">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.planDeliveryDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.approveDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单状态" align="center" prop="orderStatus"> <el-table-column label="ERP最后修改日期" align="center" prop="erpModifyDate">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_purchase_order_status" :value="scope.row.orderStatus"/> <span>{{ parseTime(scope.row.erpModifyDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="完成日期" align="center" prop="completeDate" width="180"> <el-table-column label="计划交货日期" align="center" prop="planDeliveryDate">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.completeDate, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.planDeliveryDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="完成日期" align="center" prop="completeDate">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.completeDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="源单编号" align="center" prop="srcBillNo" />
<el-table-column label="京源项目" align="center" prop="tondBase" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -110,8 +133,10 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['mes:purchaseOrder:edit']" v-hasPermi="['mes:purchaseOrder:bind']"
>绑定</el-button> v-if="scope.row.alwaysFlag === ALWAYS_FLAG.NO"
>绑定
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -156,13 +181,19 @@
</template> </template>
<script> <script>
import { listPurchaseOrder, getPurchaseOrder, delPurchaseOrder, addPurchaseOrder, updatePurchaseOrder } from "@/api/mes/purchaseOrder"; import {
listPurchaseOrder,
getPurchaseOrder,
delPurchaseOrder,
addPurchaseOrder,
updatePurchaseOrder
} from "@/api/mes/purchaseOrder";
import router from "@/router"; import router from "@/router";
import {getToken} from "@/utils/auth"; import {getToken} from "@/utils/auth";
export default { export default {
name: "PurchaseOrder", name: "PurchaseOrder",
dicts: ['active_flag', 'mes_purchase_order_status', 'document_status','mes_safe_flag'], dicts: ['active_flag', 'mes_purchase_order_status', 'document_status', 'mes_safe_flag','mes_material_bind_flag'],
data() { data() {
return { return {
// //
@ -198,6 +229,9 @@ export default {
materialId: null, materialId: null,
materialCode: null, materialCode: null,
materialName: null, materialName: null,
materialSpec: null,
specificationParameter: null,
alwaysFlag: null,
orderAmount: null, orderAmount: null,
completeAmount: null, completeAmount: null,
approveDate: null, approveDate: null,
@ -244,6 +278,11 @@ export default {
isFlag: [ isFlag: [
{required: true, message: "是否标识1-是0-否不能为空", trigger: "change"} {required: true, message: "是否标识1-是0-否不能为空", trigger: "change"}
], ],
},
ALWAYS_FLAG: {
YES: "1",
NO: "0"
} }
}; };
}, },
@ -326,8 +365,7 @@ export default {
}, },
/** 下载模板操作 */ /** 下载模板操作 */
importTemplate() { importTemplate() {
this.download('system/user/importTemplate', { this.download('system/user/importTemplate', {}, `template_${new Date().getTime()}.xlsx`)
}, `template_${new Date().getTime()}.xlsx`)
}, },
// //
handleFileUploadProgress(event, file, fileList) { handleFileUploadProgress(event, file, fileList) {
@ -354,9 +392,11 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
const purchaseOrderId = row.purchaseOrderId; const purchaseOrderId = row.purchaseOrderId;
const materialSpec = row.materialSpec;
const poNo = row.poNo; const poNo = row.poNo;
const params = {queryParams: this.queryParams}; const params = {queryParams: this.queryParams ,t: Date.now()};
this.$tab.openPage("订单绑定[" + poNo + "]", '/mes/product-order/bind/' + purchaseOrderId, params);
this.$tab.openPage("订单绑定[" + poNo + "]", '/mes/purchase-order/bind/' + purchaseOrderId +'/'+materialSpec, params);
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
@ -387,7 +427,8 @@ export default {
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {
});
}, },
/** 采购销售订单绑定信息;销售订单绑定采购订单明细信息序号 */ /** 采购销售订单绑定信息;销售订单绑定采购订单明细信息序号 */
rowMesOrderBindIndex({row, rowIndex}) { rowMesOrderBindIndex({row, rowIndex}) {

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
<el-form-item label="销售订单编号" prop="saleorderCode"> <el-form-item label="销售订单编号" prop="saleorderCode">
<el-input <el-input
v-model="queryParams.saleorderCode" v-model="queryParams.saleorderCode"
@ -9,16 +9,6 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="单据状态" prop="documentStatus">
<el-select v-model="queryParams.documentStatus" placeholder="请选择单据状态" clearable>
<el-option
v-for="dict in dict.type.document_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="物料编码" prop="materialCode"> <el-form-item label="物料编码" prop="materialCode">
<el-input <el-input
v-model="queryParams.materialCode" v-model="queryParams.materialCode"
@ -35,17 +25,15 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-form-item label="是否已下达计划" prop="isRelease"> <el-input
<el-select v-model="queryParams.isRelease" placeholder="请选择是否已下达计划" clearable> v-model="queryParams.materialSpec"
<el-option placeholder="请输入物料规格"
v-for="dict in dict.type.is_release" clearable
:key="dict.value" @keyup.enter.native="handleQuery"
:label="dict.label"
:value="dict.value"
/> />
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
@ -59,14 +47,11 @@
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[3].visible"/> <el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[3].visible"/>
<el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[9].visible"/> <el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[9].visible"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[10].visible"/> <el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[10].visible"/>
<el-table-column label="订单计划数量" align="center" prop="orderAmount" v-if="columns[12].visible"/> <el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="订单数量" align="center" prop="orderAmount" v-if="columns[12].visible"/>
<el-table-column label="完成数量" align="center" prop="completeAmount" v-if="columns[13].visible"/> <el-table-column label="完成数量" align="center" prop="completeAmount" v-if="columns[13].visible"/>
<el-table-column label="已发布数量" align="center" prop="releaseQty" v-if="columns[14].visible"/> <el-table-column label="已发布数量" align="center" prop="releaseQty" v-if="columns[14].visible"/>
<el-table-column label="是否已下达计划" align="center" prop="isRelease" v-if="columns[15].visible" >
<template slot-scope="scope">
<dict-tag :options="dict.type.is_release" :value="scope.row.isRelease"/>
</template>
</el-table-column>
</el-table> </el-table>
@ -121,6 +106,7 @@ export default {
materialId: null, materialId: null,
materialCode: null, materialCode: null,
materialName: null, materialName: null,
materialSpec: null,
matkl: null, matkl: null,
orderAmount: null, orderAmount: null,
completeAmount: null, completeAmount: null,

Loading…
Cancel
Save