MES:
原材料条码:
1、在新增上增加loading,防止二次点击
2、在生成条码时规格优先读取采购订单的规格参数,规格参数为空再读取物料的物料规格
3、无采购订单新增条码判断是否有库存
4、在采购新增条码时根据采购订单绑定的数量和已经生成条码的数量做判断
物料信息:
物料信息增加安全库存数量的维护和功能完善
master
xs 3 months ago
parent b664df36a0
commit 3317eeb0ea

@ -69,6 +69,10 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "物料ID")
private Long materialId;
/**条码规格*/
private String barcodeSpec;
/** 供应商ID */
@Excel(name = "供应商ID")
private Long manufacturerId;
@ -314,6 +318,15 @@ public class MesBaseBarcodeInfo extends BaseEntity
{
return materialId;
}
public String getBarcodeSpec() {
return barcodeSpec;
}
public void setBarcodeSpec(String barcodeSpec) {
this.barcodeSpec = barcodeSpec;
}
public void setManufacturerId(Long manufacturerId)
{
this.manufacturerId = manufacturerId;

@ -118,6 +118,9 @@ public class MesBaseMaterialInfo extends BaseEntity
@Excel(name = "审核日期;对应FApproveDate", width = 30, dateFormat = "yyyy-MM-dd")
private Date approveDate;
/**安全库存数量*/
private BigDecimal safeStockAmount;
/** erp最后更新日期;对应FModifyDate */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "erp最后更新日期;对应FModifyDate", width = 30, dateFormat = "yyyy-MM-dd")
@ -362,6 +365,15 @@ public class MesBaseMaterialInfo extends BaseEntity
{
return approveDate;
}
public BigDecimal getSafeStockAmount() {
return safeStockAmount;
}
public void setSafeStockAmount(BigDecimal safeStockAmount) {
this.safeStockAmount = safeStockAmount;
}
public void setErpModifyDate(Date erpModifyDate)
{
this.erpModifyDate = erpModifyDate;

@ -8,7 +8,9 @@ import com.hw.common.security.annotation.InnerAuth;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.domain.MesPurchaseOrder;
import com.hw.mes.service.IMesBaseMaterialInfoService;
import com.hw.mes.service.IMesPurchaseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -43,6 +45,9 @@ public class MesBaseBarcodeInfoController extends BaseController
@Autowired
private IMesBaseMaterialInfoService mesBaseMaterialInfoService;
@Autowired
private IMesPurchaseOrderService mesPurchaseOrderService;
/**
*
*/
@ -250,7 +255,7 @@ public class MesBaseBarcodeInfoController extends BaseController
/**
*
*/
@RequiresPermissions("mes:barcode:internalAdd")
@RequiresPermissions("mes:barcode:noPurchaseAdd")
@Log(title = "条码信息", businessType = BusinessType.INSERT)
@PostMapping(value="/addNoPurchaseBarcode")
public AjaxResult addNoPurchaseBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo)
@ -261,7 +266,6 @@ public class MesBaseBarcodeInfoController extends BaseController
/**
*
*/
@RequiresPermissions("mes:barcode:internalAdd")
@PostMapping(value="/checkBarcode")
public AjaxResult checkBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo)
{
@ -318,4 +322,17 @@ public class MesBaseBarcodeInfoController extends BaseController
}
/**
*
*/
@RequiresPermissions("mes:barcode:add")
@GetMapping("/selectPurchaseOrderBindList")
public TableDataInfo selectPurchaseOrderBindList(MesPurchaseOrder mesPurchaseOrder)
{
startPage();
List<MesPurchaseOrder> list = mesPurchaseOrderService.selectPurchaseOrderBindList(mesPurchaseOrder);
return getDataTable(list);
}
}

@ -24,7 +24,7 @@ public class MesMobileController extends BaseController {
/**
*
* rfid
*/
@Log(title = "托盘信息", businessType = BusinessType.BIND)
@PostMapping(("/bindPalletInfo"))

@ -67,6 +67,9 @@ public class MesOrderBind extends BaseEntity
@Excel(name = "绑定数量")
private BigDecimal bindAmount;
/**绑定条码数量*/
private BigDecimal barcodeAmount;
public void setOrderBindId(Long orderBindId)
{
this.orderBindId = orderBindId;
@ -185,6 +188,14 @@ public class MesOrderBind extends BaseEntity
return bindAmount;
}
public BigDecimal getBarcodeAmount() {
return barcodeAmount;
}
public void setBarcodeAmount(BigDecimal barcodeAmount) {
this.barcodeAmount = barcodeAmount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -164,6 +164,18 @@ public class MesPurchaseOrder extends BaseEntity {
/** 序号 */
private Long serialNumber;
/**订单绑定的数量和条码的数量,以-分割*/
private String orderBindBarcodeAmount;
/**安全库存绑定的数量和条码的数量,以-分割*/
private String safeBindBarcodeAmount;
private String batchFlag;
private BigDecimal batchAmount;
private long mesMaterialId;//物料信息表的物料ID主键
public Long getSerialNumber() {
return serialNumber;
}
@ -497,6 +509,46 @@ public class MesPurchaseOrder extends BaseEntity {
this.bindFlag = bindFlag;
}
public String getOrderBindBarcodeAmount() {
return orderBindBarcodeAmount;
}
public void setOrderBindBarcodeAmount(String orderBindBarcodeAmount) {
this.orderBindBarcodeAmount = orderBindBarcodeAmount;
}
public String getSafeBindBarcodeAmount() {
return safeBindBarcodeAmount;
}
public void setSafeBindBarcodeAmount(String safeBindBarcodeAmount) {
this.safeBindBarcodeAmount = safeBindBarcodeAmount;
}
public String getBatchFlag() {
return batchFlag;
}
public void setBatchFlag(String batchFlag) {
this.batchFlag = batchFlag;
}
public BigDecimal getBatchAmount() {
return batchAmount;
}
public void setBatchAmount(BigDecimal batchAmount) {
this.batchAmount = batchAmount;
}
public long getMesMaterialId() {
return mesMaterialId;
}
public void setMesMaterialId(long mesMaterialId) {
this.mesMaterialId = mesMaterialId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -101,4 +101,12 @@ public interface MesPurchaseOrderMapper
* @return
*/
List<MesPurchaseOrder> saleBindPurchaseOrderList(MesPurchaseOrder mesPurchaseOrder);
/**
* List,for 使
* @param mesPurchaseOrder
* @return
*/
List<MesPurchaseOrder> selectPurchaseOrderBindList(MesPurchaseOrder mesPurchaseOrder);
}

@ -105,4 +105,12 @@ public interface IMesPurchaseOrderService
* @return
*/
public int removeSalesBindPurchase(Long saleOrderId, Long[] purchaseOrderIds);
/**
* List,for 使
*
* @param mesPurchaseOrder
* @return
*/
public List<MesPurchaseOrder> selectPurchaseOrderBindList(MesPurchaseOrder mesPurchaseOrder);
}

@ -108,6 +108,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
public List<MesBaseBarcodeInfo> selectMesBaseBarcodeInfoList(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
mesBaseBarcodeInfo.setMaterialSpec(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getMaterialSpec())
? mesBaseBarcodeInfo.getMaterialSpec().replaceAll("\\s+", "") : "");
mesBaseBarcodeInfo.setBarcodeSpec(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getBarcodeSpec())
? mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("\\s+", "") : "");
return mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(mesBaseBarcodeInfo);
}
@ -140,12 +142,6 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
Long purchaseOrderId = mesBaseBarcodeInfo.getPurchaseOrderId();
MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo();
queryBaseBarcodeInfo.setPurchaseOrderId(purchaseOrderId);
int mesBaseBarcodeInfoCount = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoCount(queryBaseBarcodeInfo);
if (mesBaseBarcodeInfoCount > 0) {
throw new ServiceException("此采购订单已经生成条码,无需重复生成");
}
Long materialId = mesBaseBarcodeInfo.getMaterialId();
MesBaseMaterialInfo mesBaseMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(materialId);
@ -168,8 +164,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
BigDecimal totalBindAmount = mesOrderBinds.stream().map(MesOrderBind::getBindAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
if (barcodeAmount.compareTo(totalBindAmount) != 0) {
throw new ServiceException("采购订单还未完全绑定到销售订单");
BigDecimal totalBarcodeAmount = mesOrderBinds.stream().map(MesOrderBind::getBarcodeAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
if (totalBindAmount.subtract(totalBarcodeAmount).compareTo(barcodeAmount) != 0) {
throw new ServiceException("采购订单绑定数据有变化,请重新选择采购订单绑定");
}
String batchCode = Seq.getId(Seq.mesBatchCodeSeqType, Seq.mesBatchCodeCode);
@ -177,7 +174,11 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
for (MesOrderBind mesOrderBind : mesOrderBinds) {
BigDecimal bindAmount = mesOrderBind.getBindAmount();
for (int i = 0; i < bindAmount.intValue(); i++) {
BigDecimal bindBarcodeAmount = mesOrderBind.getBarcodeAmount();
BigDecimal canBindAmount = bindAmount.subtract(bindBarcodeAmount);
if (canBindAmount.compareTo(BigDecimal.ONE) >= 0) {
for (int i = 0; i < canBindAmount.intValue(); i++) {
// 生成数量条的不同条码内容
toInsertedBarcodeInfo = getInsertedBarcodeInfo(mesBaseBarcodeInfo, batchCode, userName, currentDate);
@ -187,13 +188,22 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo);
}
//更新订单绑定的条码已绑定数量
mesOrderBind.setBarcodeAmount(bindAmount);
mesOrderBind.setUpdateBy(userName);
mesOrderBind.setUpdateTime(currentDate);
mesOrderBindMapper.updateMesOrderBind(mesOrderBind);
}
}
} else {
MesBaseBarcodeInfo toInsertedBarcodeInfo;
String batchCode = Seq.getId(Seq.mesBatchCodeSeqType, Seq.mesBatchCodeCode);
for (long i = 0; i < barcodeAmount.intValue(); i++) {
// 生成数量条的不同条码内容
// 生成条码数量的不同条码内容
toInsertedBarcodeInfo = getInsertedBarcodeInfo(mesBaseBarcodeInfo, batchCode, userName, currentDate);
toInsertedBarcodeInfo.setSaleOrderId(0L);
toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(toInsertedBarcodeInfo);
}
@ -202,13 +212,12 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
/**
*
* ,
*
* @param mesBaseBarcodeInfo
*/
@Override
public int checkBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
if (mesBaseBarcodeInfo.getConfirmFlag() == null || !mesBaseBarcodeInfo.getConfirmFlag().equals("1")) {
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
queryBarcodeInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId());
queryBarcodeInfo.setBatchFlag(MesConstants.IS_BATCH);
@ -216,7 +225,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
if (mesBaseBarcodeInfos != null && !mesBaseBarcodeInfos.isEmpty()) {
return 2;
}
}
return 1;
}
@ -258,6 +267,13 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
public int generateRegularRawBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
MesBaseBarcodeInfo queryBaseBarcodeInfo = new MesBaseBarcodeInfo();
queryBaseBarcodeInfo.setMaterialId(mesBaseBarcodeInfo.getMaterialId());
queryBaseBarcodeInfo.setBarcodeType(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR);
List<MesBaseBarcodeInfo> baseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBaseBarcodeInfo);
if (baseBarcodeInfos != null && !baseBarcodeInfos.isEmpty()) {
throw new ServiceException("已经有此物料固定条码,无需重复生成");
}
String barcodeInfo = Seq.getId(Seq.mesBarcodeSeqType, Seq.mesBarcodeCode);
mesBaseBarcodeInfo.setBarcodeInfo(barcodeInfo);
@ -266,6 +282,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBaseBarcodeInfo.setBatchFlag(MesConstants.IS_BATCH);
mesBaseBarcodeInfo.setBarcodeType(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR);
mesBaseBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
mesBaseBarcodeInfo.setSaleOrderId(0L);
mesBaseBarcodeInfo.setCreateBy(userName);
mesBaseBarcodeInfo.setCreateTime(currentDate);
@ -489,6 +506,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
toInsertedBarcodeInfo.setLastOutstockDate(mesBaseBarcodeInfo.getLastOutstockDate());
toInsertedBarcodeInfo.setProjectNo(mesBaseBarcodeInfo.getProjectNo());
toInsertedBarcodeInfo.setBatchFlag(mesBaseBarcodeInfo.getBatchFlag());
toInsertedBarcodeInfo.setBarcodeSpec(mesBaseBarcodeInfo.getBarcodeSpec());
if (mesBaseBarcodeInfo.getBatchFlag().equals(MesConstants.NOT_IS_BATCH)) {
toInsertedBarcodeInfo.setAmount(new BigDecimal(1));
}
@ -661,7 +679,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
PrintContentVo printMaterialSpec = new PrintContentVo();
printMaterialSpec.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC);
printMaterialSpec.setValue(mesBaseBarcodeInfo.getMaterialSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", ""));
printMaterialSpec.setValue(mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", ""));
printMaterialSpec.setType(PrintContentVo.TYPE_TEXT);
PrintContentVo printQty = new PrintContentVo();

@ -4,7 +4,9 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
@ -15,6 +17,9 @@ import com.hw.mes.domain.vo.MesPalletInfoBindVo;
import com.hw.mes.mapper.MesBaseBarcodeInfoMapper;
import com.hw.printer.api.RemotePrinterService;
import com.hw.printer.api.domain.vo.PrintContentVo;
import com.hw.wms.api.RemoteWmsService;
import com.hw.wms.api.domain.vo.WmsProductStockVo;
import com.hw.wms.api.domain.vo.WmsRawStockVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -46,6 +51,9 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
@Resource
private RemotePrinterService remotePrinterService;
@Resource
private RemoteWmsService remoteWmsService;
/**
*
*
@ -119,6 +127,7 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
/**
*
*
* @param mesPalletInfoBindVo
* @return
*/
@ -140,6 +149,30 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
throw new ServiceException("托盘码有误");
}
if (!mesBaseBarcodeInfo.getPrintFlag().equals(MesConstants.MES_BARCODE_PRINT_FLAG_YES)) {
throw new ServiceException("此物料条码还未打印");
}
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getPalletInfoCode()) && mesBaseBarcodeInfo.getPalletInfoCode().equals(palletInfoCode)) {
throw new ServiceException("已经绑定过");
}
WmsProductStockVo queryProductStockVo = new WmsProductStockVo();
queryProductStockVo.setProductBatch(materialBarcode);
R<Boolean> isExistProductStock = remoteWmsService.isExistProductStock(queryProductStockVo, SecurityConstants.INNER);
if (isExistProductStock.getData()) {
throw new ServiceException("此物料条码存在成品库存,不能绑定");
}
WmsRawStockVo queryRawStockVo = new WmsRawStockVo();
queryRawStockVo.setInstockBatch(materialBarcode);
R<Boolean> isExistRawStock = remoteWmsService.isExistRawStock(queryRawStockVo, SecurityConstants.INNER);
if (isExistRawStock.getData()) {
throw new ServiceException("此物料条码存在原材料库存,不能绑定");
}
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
mesBaseBarcodeInfo.setPalletInfoCode(palletInfoCode);
@ -158,8 +191,6 @@ public class MesBasePalletInfoServiceImpl implements IMesBasePalletInfoService {
}
/**
* RFID
*

@ -338,4 +338,16 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService {
}
/**
* List,for 使
*
* @param mesPurchaseOrder
* @return
*/
@Override
public List<MesPurchaseOrder> selectPurchaseOrderBindList(MesPurchaseOrder mesPurchaseOrder) {
return mesPurchaseOrderMapper.selectPurchaseOrderBindList(mesPurchaseOrder);
}
}

@ -107,6 +107,11 @@ public class WmsRawStockController extends BaseController
}
@PostMapping(value = "/checkRawStock")
public AjaxResult checkRawStock(@RequestBody WmsRawStock wmsRawStock){
return success(wmsRawStockService.checkRawStock(wmsRawStock));
}
/**
*

@ -131,8 +131,12 @@ public class WmsRawReturn extends BaseEntity
private String warehouseName;
private String materialCode;
private String materialName;
private String materialSpec;
private String productName;
/** 原材料退库记录明细信息 */
@ -401,6 +405,14 @@ public class WmsRawReturn extends BaseEntity
this.warehouseName = warehouseName;
}
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
@ -409,6 +421,14 @@ public class WmsRawReturn extends BaseEntity
this.materialName = materialName;
}
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
public String getProductName() {
return productName;
}

@ -66,4 +66,11 @@ public interface IWmsRawStockService
* @return
*/
public WmsRawStock getWmsRawStockByInstockBatch(String instockBatch);
/**
* ID
* @param wmsRawStock
* @return
*/
public boolean checkRawStock(WmsRawStock wmsRawStock);
}

@ -147,12 +147,17 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
String operationType = warehouse.getWarehouseType().equals(WmsConstants.WMS_WAREHOUSE_TYPE_NORMAL)
? WmsConstants.WMS_OPERATION_TYPE_MANUAL : WmsConstants.WMS_OPERATION_TYPE_AUTO;
String auditStatus = WmsConstants.WMS_AUDIT_STATUS_PASS;
if (warehouse.getOutRequirement().equals(WmsConstants.WMS_WAREHOUSE_OUT_REQUIREMENT_APPLY_AUDIT)) {
auditStatus = WmsConstants.WMS_AUDIT_STATUS_TOAUDIT;
}
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
wmsProductOutstock.setProductType(WmsConstants.WMS_PRODUCT_OUTSTOCK_PRODUCT_TYPE_PRODUCT);
wmsProductOutstock.setOperationType(operationType);
wmsProductOutstock.setOutstockType(WmsConstants.WMS_PRODUCT_OUTSTOCK_TYPE_SALE);
wmsProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsProductOutstock.setAuditStatus(auditStatus);
wmsProductOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE);
wmsProductOutstock.setApplyBy(userName);
wmsProductOutstock.setApplyDate(currentDate);
@ -329,6 +334,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
/**
* 使
*
* @param wmsProductOutstock
* @return
*/
@ -339,6 +345,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
/**
* 使
*
* @param productOutstockId
* @return
*/
@ -350,6 +357,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
/**
*
*
* @param wmsProductOutstockAuditVo
* @return
*/

@ -1,6 +1,7 @@
package com.hw.wms.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.wms.mapper.WmsRawStockMapper;
@ -14,8 +15,7 @@ import com.hw.wms.service.IWmsRawStockService;
* @date 2023-12-20
*/
@Service
public class WmsRawStockServiceImpl implements IWmsRawStockService
{
public class WmsRawStockServiceImpl implements IWmsRawStockService {
@Autowired
private WmsRawStockMapper wmsRawStockMapper;
@ -26,8 +26,7 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService
* @return
*/
@Override
public WmsRawStock selectWmsRawStockByRawStockId(Long rawStockId)
{
public WmsRawStock selectWmsRawStockByRawStockId(Long rawStockId) {
return wmsRawStockMapper.selectWmsRawStockByRawStockId(rawStockId);
}
@ -38,9 +37,9 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService
* @return
*/
@Override
public List<WmsRawStock> selectWmsRawStockList(WmsRawStock wmsRawStock)
{
List<WmsRawStock> wmsRawStocks= wmsRawStockMapper.selectWmsRawStockList(wmsRawStock);;
public List<WmsRawStock> selectWmsRawStockList(WmsRawStock wmsRawStock) {
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectWmsRawStockList(wmsRawStock);
;
return wmsRawStocks;
}
@ -51,8 +50,7 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService
* @return
*/
@Override
public int insertWmsRawStock(WmsRawStock wmsRawStock)
{
public int insertWmsRawStock(WmsRawStock wmsRawStock) {
return wmsRawStockMapper.insertWmsRawStock(wmsRawStock);
}
@ -63,8 +61,7 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService
* @return
*/
@Override
public int updateWmsRawStock(WmsRawStock wmsRawStock)
{
public int updateWmsRawStock(WmsRawStock wmsRawStock) {
return wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
}
@ -75,8 +72,7 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService
* @return
*/
@Override
public int deleteWmsRawStockByRawStockIds(Long[] rawStockIds)
{
public int deleteWmsRawStockByRawStockIds(Long[] rawStockIds) {
return wmsRawStockMapper.deleteWmsRawStockByRawStockIds(rawStockIds);
}
@ -87,14 +83,14 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService
* @return
*/
@Override
public int deleteWmsRawStockByRawStockId(Long rawStockId)
{
public int deleteWmsRawStockByRawStockId(Long rawStockId) {
return wmsRawStockMapper.deleteWmsRawStockByRawStockId(rawStockId);
}
/**
*
*
* @param instockBatch
* @return
*/
@ -102,4 +98,16 @@ public class WmsRawStockServiceImpl implements IWmsRawStockService
public WmsRawStock getWmsRawStockByInstockBatch(String instockBatch) {
return wmsRawStockMapper.selectRawStockByBarcode(instockBatch);
}
/**
* ID
* @param wmsRawStock
* @return
*/
@Override
public boolean checkRawStock(WmsRawStock wmsRawStock) {
List<WmsRawStock> wmsRawStocks = wmsRawStockMapper.selectWmsRawStockList(wmsRawStock);
return wmsRawStocks != null && !wmsRawStocks.isEmpty();
}
}

@ -36,7 +36,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="erpAmount" column="erp_amount" />
<result property="warehouseName" column="warehouse_name" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="materialSpec" column="material_spec" />
</resultMap>
<resultMap id="WmsRawReturnWmsRawReturnDetailResult" type="WmsRawReturn" extends="WmsRawReturnResult">
@ -311,8 +313,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wrr.warehouse_id,
wrr.location_code,
wrr.material_id,
mbmi.material_code,
mbmi.material_name,
wrr.batch_code,
mbmi.material_spec,
wrr.material_barcode,
wrr.plan_amount,
wrr.return_amount,
wrr.execute_status,

@ -130,10 +130,10 @@ export function addProductBarcode(data) {
// 无采购订单新增原材料条码信息
export function checkBarcode(data) {
// 根据物料ID校验库存
export function checkRawStock(data) {
return request({
url: '/mes/barcode/checkBarcode',
url: '/wms/rawstock/checkRawStock',
method: 'post',
data: data
})

@ -109,3 +109,14 @@ export function removeSalesBindPurchase(data) {
params: data
})
}
//查询采购订单信息for 采购新增原材料条码
export function selectPurchaseOrderBindList(query) {
return request({
url: '/mes/barcode/selectPurchaseOrderBindList',
method: 'get',
params: query
})
}

@ -529,7 +529,7 @@ export const dynamicRoutes = [
path: '/wms/product-outstock',
component: Layout,
hidden: true,
permissions: ['wms:productoutstock:audit:list'],
permissions: ['wms:productoutstock:audit:query'],
children: [
{
path: 'audit/:taskCode',
@ -544,7 +544,7 @@ export const dynamicRoutes = [
path: '/wms/raw-outstock',
component: Layout,
hidden: true,
permissions: ['wms:rawoutstock:audit:list'],
permissions: ['wms:rawoutstock:audit:query'],
children: [
{
path: 'audit/:taskCode/:detailFlag/:warehouseName',
@ -575,7 +575,7 @@ export const dynamicRoutes = [
path: '/wms/raw-return',
component: Layout,
hidden: true,
permissions: ['wms:rawreturn:audit:list'],
permissions: ['wms:rawreturn:audit:query'],
children: [
{
path: 'audit/:rawReturnId/:detailFlag/:warehouseName',

@ -1,6 +1,23 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="采购订单号" prop="poNo">
<el-input
v-model="queryParams.poNo"
placeholder="请输入采购订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="销售订单号" prop="saleorderCode">
<el-input
v-model="queryParams.saleorderCode"
placeholder="请输入销售订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料编号" prop="materialCode">
<el-input
v-model="queryParams.materialCode"
@ -9,7 +26,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料名称" prop="poNo">
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
@ -17,15 +34,17 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物料规格" prop="poNo">
<el-form-item label="规格参数" prop="barcodeSpec">
<el-input
v-model="queryParams.materialSpec"
placeholder="请输入物料规格"
v-model="queryParams.barcodeSpec"
placeholder="请输入规格参数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
<el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable>
<el-option
@ -36,14 +55,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="采购订单号" prop="poNo">
<el-input
v-model="queryParams.poNo"
placeholder="请输入采购订单号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="打印标识" prop="printFlag">
<el-select v-model="queryParams.printFlag" placeholder="请选择打印标识" clearable>
@ -76,18 +88,6 @@
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleInternalAdd"
v-hasPermi="['mes:barcode:internalAdd']"
>生产新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
@ -124,7 +124,7 @@
>打印
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
<!--right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar-->
</el-row>
<el-table v-loading="loading" :data="barcodeList" @selection-change="handleSelectionChange">
@ -147,7 +147,7 @@
<el-table-column label="条码内容" align="center" prop="barcodeInfo" v-if="columns[5].visible" width="100"/>
<el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[31].visible" width="100"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[8].visible" width="100"/>
<el-table-column label="物料规格" align="center" prop="materialSpec" v-if="columns[32].visible" width="150"/>
<el-table-column label="规格参数" align="center" prop="barcodeSpec" v-if="columns[33].visible" width="150"/>
<el-table-column label="批次标识" align="center" prop="batchFlag" v-if="columns[3].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.batchFlag"/>
@ -268,24 +268,6 @@
</el-input>
</el-form-item>
<!-- <el-form-item label="条码类型" prop="barcodeType">-->
<!-- <el-radio-group v-model="form.barcodeType">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.barcode_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="条码内容" prop="barcodeInfo">-->
<!-- <el-input v-model="form.barcodeInfo" placeholder="请输入条码内容" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="批次代码" prop="batchCode">-->
<!-- <el-input v-model="form.batchCode" placeholder="请输入批次代码" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="托盘RFID代码" prop="palletInfoCode">-->
<!-- <el-input v-model="form.palletInfoCode" placeholder="请输入托盘RFID代码" />-->
<!-- </el-form-item>-->
<el-form-item label="物料ID" prop="materialId" v-if="false">
<el-input v-model="form.materialId" placeholder="请输入物料ID"/>
</el-form-item>
@ -295,6 +277,12 @@
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" :disabled="true"/>
</el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input v-model="form.materialSpec" :disabled="true"/>
</el-form-item>
<el-form-item label="规格参数" prop="barcodeSpec">
<el-input v-model="form.barcodeSpec" :disabled="true"/>
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
<el-radio-group v-model="form.batchFlag" :disabled="saleBatchFlagDisable">
@ -317,17 +305,20 @@
</el-tooltip>
批次数量
</span>
<el-input v-model="form.amount" placeholder="请在物料信息中维护" :disabled="saleBatchAmountDisabled"/>
<el-input v-model="form.amount" placeholder="请在物料信息中维护"/>
</el-form-item>
<el-form-item prop="barcodeAmount">
<span slot="label">
<el-tooltip content="需要打印条码的数量如果需要贴10个条码则需要生成10个" placement="top">
<el-tooltip content="需要打印条码的数量如果需要贴10个物料条码则需要生成10个" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
条码数量
</span>
<el-input v-model="form.barcodeAmount" disabled/>
<span v-if="form.currentOrderBindAmount!==0 || form.currentSafeBindAmount !==0"><b>订单条码数量:</b>{{
form.currentOrderBindAmount
}} <b>安全库存条码数量:</b>{{ form.currentSafeBindAmount }}</span>
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
@ -379,7 +370,7 @@
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" :loading="submitLoading" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@ -413,6 +404,9 @@
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="internalForm.materialName" :disabled="true"/>
</el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input v-model="internalForm.materialSpec" :disabled="true"/>
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker clearable
@ -457,13 +451,13 @@
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="noPurchaseForm.materialName" readonly/>
</el-form-item>
<el-form-item label="物料规格" prop="materialName">
<el-input v-model="noPurchaseForm.materialSpec" type="textarea" readonly/>
<el-form-item label="物料规格" prop="barcodeSpec">
<el-input v-model="noPurchaseForm.barcodeSpec" type="textarea" readonly/>
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
<el-radio-group v-model="noPurchaseForm.batchFlag" :disabled="noPurchaseBatchFlagDisable">
<el-radio-group v-model="noPurchaseForm.batchFlag">
<el-radio
v-for="dict in dict.type.active_flag"
:key="dict.value"
@ -520,7 +514,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitNoPurchaseAddForm"> </el-button>
<el-button type="primary" :loading="submitLoading" @click="submitNoPurchaseAddForm"> </el-button>
<el-button @click="cancelNoPurchase"> </el-button>
</div>
</el-dialog>
@ -540,8 +534,8 @@
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="regularForm.materialName" readonly/>
</el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input v-model="regularForm.materialSpec" readonly/>
<el-form-item label="物料规格" prop="barcodeSpec">
<el-input v-model="regularForm.barcodeSpec" readonly/>
</el-form-item>
@ -588,7 +582,7 @@
import {
listBarcode, getBarcode, delBarcode, addBarcode, updateBarcode,
printBarcodes, getMaterialInfoByErpId, selectProductBarcodeInfoByBarcodeInfo,
addInternalBarcode, regenerateBarcode, checkBarcode,addNoPurchaseBarcode, addRegularBarcode
addInternalBarcode, regenerateBarcode, checkRawStock, addNoPurchaseBarcode, addRegularBarcode
} from "@/api/mes/barcode";
import addPurchaseOrder from '@//views/mes/purchaseOrder/addPurchaseOrder.vue';
import selectMaterial from '@//views/mes/materialinfo/selectMaterial.vue';
@ -626,6 +620,7 @@ export default {
title: "",
//
open: false,
submitLoading: false,
//
queryParams: {
pageNum: 1,
@ -642,6 +637,7 @@ export default {
materialCode: null,
materialName: null,
materialSpec: null,
barcodeSpec:null,
manufacturerId: null,
amount: null,
machineName: null,
@ -719,6 +715,7 @@ export default {
{key: 30, label: `安全库存`, visible: true},
{key: 31, label: `物料编码`, visible: true},
{key: 32, label: `物料规格`, visible: true},
{key: 33, label: `规格参数`, visible: true},
],
@ -727,8 +724,8 @@ export default {
internalForm: {},
//
internalRules: {
poNo: [
{required: true, message: "采购订单号不能为空", trigger: "change"}
productBarcode: [
{required: true, message: "成品条码不能为空", trigger: "change"}
],
batchFlag: [
{required: true, message: "批次标识不能为空", trigger: "change"}
@ -751,9 +748,13 @@ export default {
noPurchaseBatchAmountDisabled: true,
saleBatchFlagDisable: true,
saleBatchAmountDisabled: true,
orderBindAmount: 0,
safeBindAmount: 0,
//
noPurchaseRules: {
materialCode: [
{required: true, message: "物料不能为空", trigger: "change"}
],
batchFlag: [
{required: true, message: "批次标识不能为空", trigger: "blur"}
],
@ -770,7 +771,7 @@ export default {
regularForm: {},
//
regularRules: {
materialCode2: [
materialCode: [
{
required: true, message: "物料不能为空", trigger: ["blur", "change"]
}
@ -826,6 +827,10 @@ export default {
batchCode: null,
palletInfoCode: null,
materialId: null,
materialCode: null,
materialName: null,
materialSpec: null,
barcodeSpec: null,
manufacturerId: null,
amount: null,
barcodeAmount: null,
@ -846,7 +851,9 @@ export default {
bindBy: null,
bindTime: null,
updateBy: null,
updateTime: null
updateTime: null,
currentOrderBindAmount: 0,
currentSafeBindAmount: 0
};
this.resetForm("form");
},
@ -879,30 +886,60 @@ export default {
/** 提交采购订单按钮 */
submitPurchaseOrderForm() {
let selectedRow = this.$refs.purchaseOrderRef.selectedRow;
this.form.batchFlag = null;
this.form.amount = null;
this.form.materialCode = null;
this.form.materialId = null;
this.form.materialName = null;
this.form.materialSpec = null;
this.form.barcodeSpec = null;
this.form.projectNo = null;
this.form.purchaseOrderId = null;
//
this.form.currentOrderBindAmount = null;
//
this.form.currentSafeBindAmount = null;
//
this.form.barcodeAmount = null;
this.form.poNo = null;
let currentOrderBindAmount = parseInt(selectedRow.orderBindAmount) - parseInt(selectedRow.orderBarcodeAmount);
let currentSafeBindAmount = parseInt(selectedRow.safeBindAmount) - parseInt(selectedRow.safeBarcodeAmount)
let canBindAmount = currentOrderBindAmount + currentSafeBindAmount;
if (selectedRow.mesMaterialId === null || selectedRow.mesMaterialId === '' || selectedRow.mesMaterialId === 0) {
this.$modal.msgError("物料信息不存在");
return;
}
if (canBindAmount <= 0) {
this.$modal.msgError("无可生成条码数量");
return;
}
this.$set(this.form, "poNo", selectedRow.poNo);
this.form.barcodeType = '1';//1,2,3,4
// this.form.materialId = selectedRow.materialId;//ERPID
this.form.materialId = selectedRow.mesMaterialId;//ID
this.form.materialCode = selectedRow.materialCode;
this.form.materialName = selectedRow.materialName;
this.form.materialSpec = selectedRow.materialSpec;
this.form.projectNo = selectedRow.projectNo;
this.form.purchaseOrderId = selectedRow.purchaseOrderId;
this.form.poNo = selectedRow.poNo;
this.form.barcodeAmount = selectedRow.orderAmount;
this.form.barcodeSpec = selectedRow.specificationParameter;
//
this.form.currentOrderBindAmount = currentOrderBindAmount;
//
this.form.currentSafeBindAmount = currentSafeBindAmount;
//
this.form.barcodeAmount = canBindAmount;
this.form.batchFlag = null;
this.form.amount = null;
getMaterialInfoByErpId(selectedRow.materialId).then(response => {
if (response.data == null) {
this.$modal.msgError("物料信息不存在");
return;
}
if (response.data.batchFlag != null) {
this.form.batchFlag = response.data.batchFlag;
this.form.materialId = response.data.materialId;
if (selectedRow.batchFlag != null && selectedRow.batchFlag !== '') {
this.saleBatchFlagDisable = true;
this.form.batchFlag = selectedRow.batchFlag;
if (this.form.batchFlag === this.BATCH_FLAG.YES) {
this.form.amount = response.data.batchAmount;
this.form.amount = selectedRow.batchAmount;
} else {
this.form.amount = 1;
}
@ -910,7 +947,13 @@ export default {
this.saleBatchFlagDisable = false;
}
this.saleBatchAmountDisabled = this.form.amount != null && this.form.amount > 0;
getMaterialInfoByErpId(selectedRow.materialId).then(response => {
if (response.data == null) {
this.$modal.msgError("物料信息不存在");
return;
}
this.purchaseOrderOpen = false;
});
@ -976,19 +1019,15 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.barcodeId != null) {
updateBarcode(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.submitLoading = true;
addBarcode(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(e => {
this.submitLoading = false;
});
}
}
});
},
@ -1024,6 +1063,9 @@ export default {
batchCode: null,
palletInfoCode: null,
materialId: null,
materialCode: null,
materialName: null,
materialSpec: null,
manufacturerId: null,
amount: null,
barcodeAmount: null,
@ -1053,7 +1095,7 @@ export default {
handleInternalAdd() {
this.resetInternal();
this.internalOpen = true;
this.title = "添加原材料条码信息";
this.title = "添加生产新增原材料条码信息";
},
selectProductBarcodeInfoByBarcodeInfo() {
@ -1063,6 +1105,7 @@ export default {
selectProductBarcodeInfoByBarcodeInfo(this.internalForm.productBarcode).then(response => {
if (response.data == null) {
this.resetInternal();
this.$modal.msgError("成品信息不存在");
return;
}
@ -1075,6 +1118,10 @@ export default {
this.$set(this.internalForm, "saleorderCode", response.data.saleorderCode);
}).catch(error => {
this.resetInternal();
}).finally(e => {
});
},
@ -1112,6 +1159,9 @@ export default {
batchCode: null,
palletInfoCode: null,
materialId: null,
materialCode: null,
materialName:null,
barcodeSpec:null,
manufacturerId: null,
amount: null,
barcodeAmount: null,
@ -1154,11 +1204,12 @@ export default {
submitSelectMaterialForm() {
if (this.noPurchaseOpen) {
let selectedRow = this.$refs.selectMaterialRef.selectedRow;
this.$set(this.noPurchaseForm, "materialCode", selectedRow.materialCode);
this.noPurchaseForm.barcodeType = '1';//1,2,3,4
this.noPurchaseForm.materialId = selectedRow.materialId;
this.noPurchaseForm.materialCode = selectedRow.materialCode;
this.noPurchaseForm.materialName = selectedRow.materialName;
this.noPurchaseForm.materialSpec = selectedRow.materialSpec;
this.noPurchaseForm.barcodeSpec = selectedRow.materialSpec;
this.noPurchaseForm.batchFlag = selectedRow.batchFlag;
if (this.noPurchaseForm.batchFlag == null || this.noPurchaseForm.batchFlag === '') {
@ -1187,10 +1238,12 @@ export default {
submitNoPurchaseAddForm() {
this.$refs["noPurchaseForm"].validate(valid => {
if (valid) {
this.submitLoading = true;
const checkNoPurchaseForm = {materialId: this.noPurchaseForm.materialId};
const noPurchaseForm = this.noPurchaseForm;
checkBarcode(noPurchaseForm).then(response => {
if (response.data === 2) {
this.$modal.confirm('已经有此物料的的条码,请确认是否继续生成?').then(function () {
checkRawStock(checkNoPurchaseForm).then(response => {
if (response.data) {
this.$modal.confirm('已经有此物料库存,请确认是否继续生成条码?').then(function () {
return addNoPurchaseBarcode(noPurchaseForm)
}).then(() => {
this.$modal.msgSuccess("新增成功");
@ -1207,6 +1260,8 @@ export default {
});
}
}).finally(e => {
this.submitLoading = false;
});
}
@ -1233,6 +1288,9 @@ export default {
batchCode: null,
palletInfoCode: null,
materialId: null,
materialCode: null,
materialName: null,
barcodeSpec: null,
manufacturerId: null,
amount: null,
barcodeAmount: null,
@ -1270,10 +1328,10 @@ export default {
submitRegularSelectMaterialForm() {
let selectedRow = this.$refs.selectMaterialRef.selectedRow;
this.regularForm.barcodeType = '9';//1,2,3,4,9
this.$set(this.regularForm, "materialCode", selectedRow.materialCode);
this.regularForm.materialId = selectedRow.materialId;
this.regularForm.materialCode = selectedRow.materialCode;
this.regularForm.materialName = selectedRow.materialName;
this.regularForm.materialSpec = selectedRow.materialSpec;
this.regularForm.barcodeSpec = selectedRow.materialSpec;
this.selectMaterialVisible = false;
@ -1284,10 +1342,13 @@ export default {
submitRegularAddForm() {
this.$refs["regularForm"].validate(valid => {
if (valid) {
this.submitLoading = true;
addRegularBarcode(this.regularForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.regularOpen = false;
this.getList();
}).finally(e => {
this.submitLoading = false;
});
}

@ -18,6 +18,14 @@
@keyup.enter.native="handleQuery"
/>
</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="materialCategories">
<el-select v-model="queryParams.materialCategories" placeholder="请选择物料大类" clearable>
<el-option
@ -104,6 +112,7 @@
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="物料大类" align="center" prop="materialCategories">
<template slot-scope="scope">
<dict-tag :options="dict.type.material_categories" :value="scope.row.materialCategories"/>
@ -111,18 +120,19 @@
</el-table-column>
<!-- <el-table-column label="物料类型" align="center" prop="materialTypeId"/>-->
<el-table-column label="物料类型" align="center" prop="materialTypeName"/>
<el-table-column label="常备物料" align="center" prop="bindFlag">
<el-table-column label="常备物料" align="center" prop="alwaysFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_material_bind_flag" :value="scope.row.bindFlag"/>
<dict-tag :options="dict.type.mes_material_bind_flag" :value="scope.row.alwaysFlag"/>
</template>
</el-table-column>
<el-table-column label="批次标识" align="center" prop="batchFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.batchFlag"/>
<dict-tag :options="dict.type.mes_material_batch_flag" :value="scope.row.batchFlag"/>
</template>
</el-table-column>
<el-table-column label="批次数量" align="center" prop="batchAmount"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="安全库存数量" align="center" prop="safeStockAmount"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -153,8 +163,8 @@
/>
<!-- 添加或修改物料信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料编码" :disabled="true"/>
@ -183,8 +193,8 @@
<treeselect v-model="form.materialTypeId" :options="baseMaterialTypeOptions" :normalizer="normalizer"
placeholder="请选择物料类型"/>
</el-form-item>
<el-form-item label="常备物料" prop="bindFlag">
<el-radio-group v-model="form.bindFlag" :disabled="form.bindFlag!=null">
<el-form-item label="常备物料" prop="alwaysFlag">
<el-radio-group v-model="form.alwaysFlag">
<el-radio
v-for="dict in dict.type.active_flag"
:key="dict.value"
@ -195,7 +205,7 @@
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
<el-radio-group v-model="form.batchFlag" :disabled="form.batchFlag!=null">
<el-radio-group v-model="form.batchFlag">
<el-radio
v-for="dict in dict.type.active_flag"
:key="dict.value"
@ -206,64 +216,15 @@
</el-form-item>
<el-form-item label="批次数量" prop="batchAmount" v-if="form.batchFlag==='1'">
<el-input-number v-model="form.batchAmount" placeholder="请输入批次数量" :min="1" :disabled="form.batchFlag!=null"/>
<el-input-number v-model="form.batchAmount" placeholder="请输入批次数量" :min="1" :max="10000000000"
style="width:300px"/>
</el-form-item>
<el-form-item label="安全库存数量" prop="safeStockAmount">
<el-input-number v-model="form.safeStockAmount" placeholder="请输入安全库存数量" :min="1" :max="10000000000"
style="width:300px"/>
</el-form-item>
<!-- <el-form-item label="计量单位" prop="materialUnitId">-->
<!-- <el-input v-model="form.materialUnitId" placeholder="请输入计量单位" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="计量单位名称" prop="materialUnit">-->
<!-- <el-input v-model="form.materialUnit" placeholder="请输入计量单位名称" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料组" prop="materialMatkl">-->
<!-- <el-input v-model="form.materialMatkl" placeholder="请输入物料组" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料规格" prop="materialSpec">-->
<!-- <el-input v-model="form.materialSpec" placeholder="请输入物料规格" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="净重" prop="netWeight">-->
<!-- <el-input v-model="form.netWeight" placeholder="请输入净重" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="毛重" prop="grossWeight">-->
<!-- <el-input v-model="form.grossWeight" placeholder="请输入毛重" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="所属工厂" prop="factoryId">-->
<!-- <el-input v-model="form.factoryId" placeholder="请输入所属工厂" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="创建组织" prop="createOrgId">-->
<!-- <el-input v-model="form.createOrgId" placeholder="请输入创建组织" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="使用组织" prop="useOrgId">-->
<!-- <el-input v-model="form.useOrgId" placeholder="请输入使用组织" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="所属产线" prop="prodlineId">-->
<!-- <el-input v-model="form.prodlineId" placeholder="请输入所属产线" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="激活标识1-是0-否" prop="activeFlag">-->
<!-- <el-input v-model="form.activeFlag" placeholder="请输入激活标识1-是0-否" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="删除标识(0否1是)" prop="deletedFlag">-->
<!-- <el-input v-model="form.deletedFlag" placeholder="请输入删除标识(0否1是)" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="备注" prop="remark">-->
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="审核日期" prop="approveDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.approveDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择审核日期">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="erp最后更新日期" prop="erpModifyDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.erpModifyDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择erp最后更新日期">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -287,7 +248,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Materialinfo",
dicts: ['active_flag', 'material_categories','mes_material_bind_flag'],
dicts: ['active_flag', 'material_categories', 'mes_material_bind_flag','mes_material_batch_flag'],
components: {
Treeselect
},
@ -344,15 +305,15 @@ export default {
form: {},
//
rules: {
bindFlag: [
{required: true, message: "常备物料不能为空", trigger: "change"}
],
batchFlag: [
{required: true, message: "批次标识不能为空", trigger: "change"}
],
batchAmount: [
{required: true, message: "批次数量不能为空", trigger: "blur"}
],
// bindFlag: [
// {required: true, message: "", trigger: "change"}
// ],
// batchFlag: [
// {required: true, message: "", trigger: "change"}
// ],
// batchAmount: [
// {required: true, message: "", trigger: "blur"}
// ],
// materialTypeId: [
// {required: true, message: "", trigger: "blur"}
// ],
@ -380,6 +341,8 @@ export default {
//
reset() {
this.form = {
alwaysFlag: null,
safeStockAmount: null,
materialId: null,
erpId: null,
materialCode: null,

@ -25,15 +25,31 @@
@keyup.enter.native="handleQuery"
/>
</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>
<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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!--el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
</el-row-->
<el-table v-loading="loading"
:data="purchaseOrderList"
@ -42,31 +58,38 @@
highlight-current-row
>
<el-table-column type="selection" width="55" align="center" v-if="false"/>
<el-table-column label="ID" align="center" prop="purchaseOrderId" v-if="columns[0].visible"/>
<el-table-column label="ERP主键信息" align="center" prop="erpId" v-if="columns[1].visible"/>
<el-table-column label="金蝶ERP订单明细ID" align="center" prop="fentryId" v-if="columns[2].visible"/>
<el-table-column label="采购订单编号" align="center" prop="poNo" v-if="columns[3].visible" width="120"/>
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[5].visible" width="120"/>
<el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[6].visible" width="120"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[7].visible"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="规格参数" align="center" prop="specificationParameter"/>
<el-table-column label="单据状态" align="center" prop="documentStatus" v-if="columns[4].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.document_status" :value="scope.row.documentStatus"/>
</template>
</el-table-column>
<el-table-column label="订单计划数量" align="center" prop="orderAmount" v-if="columns[8].visible" width="100"/>
<el-table-column label="订单数量" align="center" prop="orderAmount" v-if="columns[8].visible" width="100"/>
<el-table-column label="订单绑定数量" align="center" prop="orderBindAmount" width="100"/>
<el-table-column label="订单条码数量" align="center" prop="orderBarcodeAmount" width="100"/>
<el-table-column label="安全库存绑定数量" align="center" prop="safeBindAmount" width="100"/>
<el-table-column label="安全库存条码数量" align="center" prop="safeBarcodeAmount" width="100"/>
<el-table-column label="完成采购数量" align="center" prop="completeAmount" v-if="columns[9].visible" width="100"/>
<el-table-column label="审核日期" align="center" prop="approveDate" width="180" v-if="columns[10].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.approveDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="ERP最后修改日期" align="center" prop="erpModifyDate" width="180" v-if="columns[11].visible">
<el-table-column label="ERP最后修改日期" align="center" prop="erpModifyDate" width="180"
v-if="columns[11].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.erpModifyDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划交货日期" align="center" prop="planDeliveryDate" width="180" v-if="columns[12].visible">
<el-table-column label="计划交货日期" align="center" prop="planDeliveryDate" width="180"
v-if="columns[12].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.planDeliveryDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
@ -111,7 +134,13 @@
</template>
<script>
import { listPurchaseOrder, getPurchaseOrder, delPurchaseOrder, addPurchaseOrder, updatePurchaseOrder } from "@//api/mes/purchaseOrder";
import {
selectPurchaseOrderBindList,
getPurchaseOrder,
delPurchaseOrder,
addPurchaseOrder,
updatePurchaseOrder
} from "@//api/mes/purchaseOrder";
export default {
name: "PurchaseOrder",
@ -147,6 +176,8 @@ export default {
materialId: null,
materialCode: null,
materialName: null,
materialSpec: null,
specificationParameter: null,
orderAmount: null,
completeAmount: null,
approveDate: null,
@ -177,17 +208,17 @@ export default {
{key: 1, label: `ERP主键信息`, visible: false},
{key: 2, label: `金蝶ERP订单明细ID`, visible: false},
{key: 3, label: `采购订单编号`, visible: true},
{ key: 4, label: `单据状态`, visible: true },
{key: 4, label: `单据状态`, visible: false},
{key: 5, label: `物料ID`, visible: false},
{key: 6, label: `物料编码`, visible: true},
{key: 7, label: `物料名称`, visible: true},
{key: 8, label: `订单计划数量`, visible: true},
{ key: 9, label: `完成采购数量`, visible: true },
{ key: 10, label: `审核日期`, visible: true },
{ key: 11, label: `ERP最后修改日期`, visible: true },
{ key: 12, label: `计划交货日期`, visible: true },
{ key: 13, label: `计划开始日期`, visible: true },
{ key: 14, label: `计划结束日期`, visible: true },
{key: 9, label: `完成采购数量`, visible: false},
{key: 10, label: `审核日期`, visible: false},
{key: 11, label: `ERP最后修改日期`, visible: false},
{key: 12, label: `计划交货日期`, visible: false},
{key: 13, label: `计划开始日期`, visible: false},
{key: 14, label: `计划结束日期`, visible: false},
{key: 15, label: `订单状态`, visible: false},
{key: 16, label: `完成日期`, visible: false},
{key: 17, label: `是否标识`, visible: false},
@ -206,7 +237,15 @@ export default {
/** 查询采购订单信息列表 */
getList() {
this.loading = true;
listPurchaseOrder(this.queryParams).then(response => {
selectPurchaseOrderBindList(this.queryParams).then(response => {
response.rows.forEach(e => {
let orderBindBarcodeAmount = e.orderBindBarcodeAmount.split("-");
let safeBindBarcodeAmount = e.safeBindBarcodeAmount.split("-");
e.orderBindAmount = parseInt(orderBindBarcodeAmount[0]);
e.orderBarcodeAmount = parseInt(orderBindBarcodeAmount[1]);
e.safeBindAmount = parseInt(safeBindBarcodeAmount[0]);
e.safeBarcodeAmount = parseInt(safeBindBarcodeAmount[1]);
});
this.purchaseOrderList = response.rows;
this.total = response.total;
this.loading = false;
@ -310,7 +349,8 @@ export default {
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {

@ -108,8 +108,10 @@
ref="wmsRawReturnDetail">
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="库位编码" prop="locationCode"/>
<el-table-column label="物料编码" prop="materialCode"/>
<el-table-column label="物料名称" prop="materialName"/>
<el-table-column label="物料批次" prop="batchCode"/>
<el-table-column label="物料规格" prop="materialSpec"/>
<el-table-column label="物料条码" prop="materialBarcode"/>
<el-table-column label="计划数量" prop="planAmount"/>
<el-table-column label="已退库数量" prop="returnAmount" v-if="detailFlag"/>
<el-table-column label="执行状态" prop="executeStatus" v-if="detailFlag">

Loading…
Cancel
Save