车间MES完善:
1、四楼装配工序增加对内成品出库功能
2、重新生成条码需要更新绑定条码
3、对内生产生产成品条码完整标识要为0
master
xs 3 months ago
parent 1a04f7d426
commit 07294c5b3a

@ -129,6 +129,9 @@ public class MesBaseBarcodeInfo extends BaseEntity
@Excel(name = "项目号") @Excel(name = "项目号")
private String projectNo; private String projectNo;
private String completeFlag;//完整标识
/** /**
* 使使mes_product_plan_detailplan_detail_code*/ * 使使mes_product_plan_detailplan_detail_code*/
private String transferredPlanDetailCode; private String transferredPlanDetailCode;
@ -444,6 +447,14 @@ public class MesBaseBarcodeInfo extends BaseEntity
return projectNo; return projectNo;
} }
public String getCompleteFlag() {
return completeFlag;
}
public void setCompleteFlag(String completeFlag) {
this.completeFlag = completeFlag;
}
public String getTransferredPlanDetailCode() { public String getTransferredPlanDetailCode() {
return transferredPlanDetailCode; return transferredPlanDetailCode;
} }

@ -189,4 +189,11 @@ public class MesConstants {
* *
*/ */
public static final String MES_FINAL_PROCESS_FLAG_YES = "1";//是 public static final String MES_FINAL_PROCESS_FLAG_YES = "1";//是
/**
*
*/
public static final String MES_BASE_BARCODE_COMPLETE_FLAG_YES = "1";
public static final String MES_BASE_BARCODE_COMPLETE_FLAG_NO = "0";
} }

@ -52,8 +52,7 @@ public class MesApiController extends BaseController {
* *
*/ */
@GetMapping("/getLoginStationInfo") @GetMapping("/getLoginStationInfo")
public AjaxResult getLoginStationInfo() public AjaxResult getLoginStationInfo() {
{
MesBaseStationInfo loginStationInfo = mesBaseStationInfoService.getLoginStationInfo(); MesBaseStationInfo loginStationInfo = mesBaseStationInfoService.getLoginStationInfo();
return success(loginStationInfo); return success(loginStationInfo);
} }
@ -162,7 +161,7 @@ public class MesApiController extends BaseController {
@Log(title = "生产计划明细", businessType = BusinessType.START) @Log(title = "生产计划明细", businessType = BusinessType.START)
@PostMapping(("/startNextProductPlanDetail")) @PostMapping(("/startNextProductPlanDetail"))
public AjaxResult startNextProductPlanDetail(@RequestBody MesProductPlanDetail mesProductPlanDetail) { public AjaxResult startNextProductPlanDetail(@RequestBody MesProductPlanDetail mesProductPlanDetail) {
return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail,"")); return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail, ""));
} }
/** /**
@ -188,7 +187,7 @@ public class MesApiController extends BaseController {
MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail(); MesProductPlanDetail mesProductPlanDetail = new MesProductPlanDetail();
mesProductPlanDetail.setPlanId(mesProductPlanDetailAttachVo.getPlanId()); mesProductPlanDetail.setPlanId(mesProductPlanDetailAttachVo.getPlanId());
mesProductPlanDetail.setAttachId(mesProductPlanDetailAttachVo.getAttachId()); mesProductPlanDetail.setAttachId(mesProductPlanDetailAttachVo.getAttachId());
return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail,"")); return success(productPlanDetailService.startNextMesProductPlanDetail(mesProductPlanDetail, ""));
} }
/** /**
@ -231,6 +230,7 @@ public class MesApiController extends BaseController {
/** /**
* *
*
* @param hashMap (installType=1,installType=2) * @param hashMap (installType=1,installType=2)
* @return * @return
*/ */
@ -241,8 +241,6 @@ public class MesApiController extends BaseController {
} }
/** /**
* plancodeplandetailcode * plancodeplandetailcode
*/ */
@ -254,8 +252,7 @@ public class MesApiController extends BaseController {
@GetMapping("/listProductBarcode") @GetMapping("/listProductBarcode")
public TableDataInfo listProductBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) public TableDataInfo listProductBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
{
startPage(); startPage();
List<MesBaseBarcodeInfo> list = mesBaseBarcodeInfoService.selectMesBaseBarcodeInfoList(mesBaseBarcodeInfo); List<MesBaseBarcodeInfo> list = mesBaseBarcodeInfoService.selectMesBaseBarcodeInfoList(mesBaseBarcodeInfo);
return getDataTable(list); return getDataTable(list);
@ -266,9 +263,8 @@ public class MesApiController extends BaseController {
* *
*/ */
@Log(title = "条码信息", businessType = BusinessType.INSERT) @Log(title = "条码信息", businessType = BusinessType.INSERT)
@PostMapping(value="/addProductBarcode") @PostMapping(value = "/addProductBarcode")
public AjaxResult addProductBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo) public AjaxResult addProductBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo) {
{
return toAjax(mesBaseBarcodeInfoService.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo)); return toAjax(mesBaseBarcodeInfoService.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo));
} }
@ -278,8 +274,7 @@ public class MesApiController extends BaseController {
* *
*/ */
@GetMapping(value = "/selectProductBarcodeInfoByBarcodeInfo/{barcodeInfo}") @GetMapping(value = "/selectProductBarcodeInfoByBarcodeInfo/{barcodeInfo}")
public AjaxResult selectProductBarcodeInfoByBarcodeInfo(@PathVariable("barcodeInfo") String barcodeInfo) public AjaxResult selectProductBarcodeInfoByBarcodeInfo(@PathVariable("barcodeInfo") String barcodeInfo) {
{
return success(mesBaseBarcodeInfoService.selectProductBarcodeInfoByBarcodeInfo(barcodeInfo)); return success(mesBaseBarcodeInfoService.selectProductBarcodeInfoByBarcodeInfo(barcodeInfo));
} }
@ -287,33 +282,42 @@ public class MesApiController extends BaseController {
* *
*/ */
@Log(title = "条码信息", businessType = BusinessType.INSERT) @Log(title = "条码信息", businessType = BusinessType.INSERT)
@PostMapping(value="/addInternalBarcode") @PostMapping(value = "/addInternalBarcode")
public AjaxResult addInternalBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo) public AjaxResult addInternalBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo) {
{
return toAjax(mesBaseBarcodeInfoService.insertInternalMesBaseBarcode(mesBaseBarcodeInfo)); return toAjax(mesBaseBarcodeInfoService.insertInternalMesBaseBarcode(mesBaseBarcodeInfo));
} }
/** /**
* () * ()
*/ */
@Log(title = "条码信息", businessType = BusinessType.REGENERATE) @Log(title = "条码信息", businessType = BusinessType.REGENERATE)
@PostMapping(value="/regenerateBarcode") @PostMapping(value = "/regenerateBarcode")
public AjaxResult regenerateBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo) public AjaxResult regenerateBarcode(@RequestBody MesBaseBarcodeInfo mesBaseBarcodeInfo) {
{
return toAjax(mesBaseBarcodeInfoService.regenerateBarcode(mesBaseBarcodeInfo)); return toAjax(mesBaseBarcodeInfoService.regenerateBarcode(mesBaseBarcodeInfo));
} }
/** /**
* *
*
* @param barcodeIds * @param barcodeIds
* @return * @return
*/ */
@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));
} }
/**
*
*
* @param materialBarcode
* @return
*/
@GetMapping(value = "/check4thFloorProduceOutstock/{materialBarcode}")
public AjaxResult check4thFloorProduceOutstock(@PathVariable String materialBarcode) {
return success(mesBaseBarcodeInfoService.check4thFloorProduceOutstock(materialBarcode));
}
} }

@ -167,4 +167,12 @@ public interface IMesBaseBarcodeInfoService
* @return * @return
*/ */
public List<MesBaseBarcodeInfo> selectWarehouseBarCodeList(MesBaseBarcodeInfo mesBaseBarcodeInfo); public List<MesBaseBarcodeInfo> selectWarehouseBarCodeList(MesBaseBarcodeInfo mesBaseBarcodeInfo);
/**
*
* @param materialBarcode
* @return
*/
public int check4thFloorProduceOutstock(String materialBarcode);
} }

@ -281,6 +281,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
String saleOrderCode; String saleOrderCode;
Long materialId; Long materialId;
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode); String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
//在五楼根据原材料条码单独生成成品条码
if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) && if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) &&
mesBaseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_YES)) { mesBaseBarcodeInfo.getSingleFlag().equals(MesConstants.MES_BARCODE_SINGLE_FLAG_YES)) {
String rawMaterialBarcode = mesBaseBarcodeInfo.getProductBarcode(); String rawMaterialBarcode = mesBaseBarcodeInfo.getProductBarcode();
@ -357,6 +359,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
saleOrderId = productPlan.getSaleOrderId(); saleOrderId = productPlan.getSaleOrderId();
saleOrderCode = productPlan.getSaleorderCode(); saleOrderCode = productPlan.getSaleorderCode();
materialId = productPlan.getMaterialId(); materialId = productPlan.getMaterialId();
MesProductOrder mesProductOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(productPlan.getProductOrderId());
mesBaseBarcodeInfo.setCompleteFlag(mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE)
? MesConstants.MES_BASE_BARCODE_COMPLETE_FLAG_YES : MesConstants.MES_BASE_BARCODE_COMPLETE_FLAG_NO);
} }
@ -810,6 +816,13 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
throw new ServiceException("此成品条码已经打印过原材料条码,无需重复打印"); throw new ServiceException("此成品条码已经打印过原材料条码,无需重复打印");
} }
WmsProductStockVo queryProductStockVo = new WmsProductStockVo();
queryProductStockVo.setProductBatch(productBarcode);
R<Boolean> isExistProductStock = remoteWmsService.isExistProductStock(queryProductStockVo, SecurityConstants.INNER);
if (isExistProductStock.getData()) {
throw new ServiceException("此物料条码还未出库,不能生成原材料条码");
}
//先根据之前的成品条码信息获取托盘信息 //先根据之前的成品条码信息获取托盘信息
MesBasePalletInfo queryPalletInfo = new MesBasePalletInfo(); MesBasePalletInfo queryPalletInfo = new MesBasePalletInfo();
queryPalletInfo.setMaterialBarcode(productBarcode); queryPalletInfo.setMaterialBarcode(productBarcode);
@ -914,6 +927,17 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
mesBasePalletInfoMapper.updateMesBasePalletInfo(basePalletInfo); mesBasePalletInfoMapper.updateMesBasePalletInfo(basePalletInfo);
} }
MesBaseBarcodeInfo queryBindBarcode = new MesBaseBarcodeInfo();
queryBindBarcode.setBindBarcode(oldBarcode);
List<MesBaseBarcodeInfo> bindBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBindBarcode);
if (bindBarcodeInfos != null && !bindBarcodeInfos.isEmpty()) {
for (MesBaseBarcodeInfo bindBarcode : bindBarcodeInfos) {
bindBarcode.setBindBarcode(newBarcode);
bindBarcode.setUpdateBy(userName);
bindBarcode.setUpdateTime(currentDate);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(bindBarcode);
}
}
mesBaseBarcodeInfo.setBarcodeInfo(newBarcode); mesBaseBarcodeInfo.setBarcodeInfo(newBarcode);
mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_NO); mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_NO);
@ -946,4 +970,31 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
return mesBaseBarcodeInfoMapper.selectWarehouseBarCodeList(mesBaseBarcodeInfo); return mesBaseBarcodeInfoMapper.selectWarehouseBarCodeList(mesBaseBarcodeInfo);
} }
/**
*
*
* @param materialBarcode
* @return
*/
@Override
public int check4thFloorProduceOutstock(String materialBarcode) {
MesBaseBarcodeInfo mesBaseBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(materialBarcode);
if (mesBaseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
String planCode = mesBaseBarcodeInfo.getPlanCode();
MesProductOrder mesProductOrder = mesProductOrderMapper.selectMesProductOrderByPlanCode(planCode);
if (mesProductOrder == null) {
throw new ServiceException("未找到生产任务");
}
if (!mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_INTERNAL)) {
throw new ServiceException("此生产任务为外部销售,不能直接出库");
}
return 1;
}
} }

@ -33,6 +33,7 @@
<result property="saleOrderId" column="sale_order_id"/> <result property="saleOrderId" column="sale_order_id"/>
<result property="saleorderCode" column="saleorder_code"/> <result property="saleorderCode" column="saleorder_code"/>
<result property="projectNo" column="project_no"/> <result property="projectNo" column="project_no"/>
<result property="completeFlag" column="complete_flag"/>
<result property="transferredPlanDetailCode" column="transferred_plan_detail_code"/> <result property="transferredPlanDetailCode" column="transferred_plan_detail_code"/>
<result property="serialNumber" column="serial_number"/> <result property="serialNumber" column="serial_number"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
@ -103,6 +104,8 @@
<if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info = #{barcodeInfo}</if> <if test="barcodeInfo != null and barcodeInfo != ''">and bbi.barcode_info = #{barcodeInfo}</if>
<if test="batchCode != null and batchCode != ''">and bbi.batch_code = #{batchCode}</if> <if test="batchCode != null and batchCode != ''">and bbi.batch_code = #{batchCode}</if>
<if test="palletInfoCode != null and palletInfoCode != ''">and bbi.pallet_info_code = #{palletInfoCode}</if> <if test="palletInfoCode != null and palletInfoCode != ''">and bbi.pallet_info_code = #{palletInfoCode}</if>
<if test="bindBarcode != null and bindBarcode != ''">and bbi.bind_barcode = #{bindBarcode}</if>
<if test="materialId != null ">and bbi.material_id = #{materialId}</if> <if test="materialId != null ">and bbi.material_id = #{materialId}</if>
<if test="materialCode != null and materialCode != '' ">and bmi.material_code like concat('%', #{materialCode}, <if test="materialCode != null and materialCode != '' ">and bmi.material_code like concat('%', #{materialCode},
@ -174,6 +177,7 @@
<if test="saleOrderId != null">sale_order_id,</if> <if test="saleOrderId != null">sale_order_id,</if>
<if test="saleorderCode != null">saleorder_code,</if> <if test="saleorderCode != null">saleorder_code,</if>
<if test="projectNo != null">project_no,</if> <if test="projectNo != null">project_no,</if>
<if test="completeFlag != null">complete_flag,</if>
<if test="serialNumber != null">serial_number,</if> <if test="serialNumber != null">serial_number,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="bindStatus != null">bind_status,</if> <if test="bindStatus != null">bind_status,</if>
@ -210,6 +214,7 @@
<if test="saleOrderId != null">#{saleOrderId},</if> <if test="saleOrderId != null">#{saleOrderId},</if>
<if test="saleorderCode != null">#{saleorderCode},</if> <if test="saleorderCode != null">#{saleorderCode},</if>
<if test="projectNo != null">#{projectNo},</if> <if test="projectNo != null">#{projectNo},</if>
<if test="completeFlag != null">#{completeFlag},</if>
<if test="serialNumber != null">#{serialNumber},</if> <if test="serialNumber != null">#{serialNumber},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="bindStatus != null">#{bindStatus},</if> <if test="bindStatus != null">#{bindStatus},</if>

@ -45,6 +45,9 @@ public class WmsApiController extends BaseController {
@Autowired @Autowired
private IWmsProductInstockService wmsProductInstockService; private IWmsProductInstockService wmsProductInstockService;
@Autowired
private IWmsProductOutstockService wmsProductOutstockService;
@Autowired @Autowired
private IWmsErpScheduledTaskService wmsErpScheduledTaskService; private IWmsErpScheduledTaskService wmsErpScheduledTaskService;
@ -146,6 +149,15 @@ public class WmsApiController extends BaseController {
return toAjax(wmsProductInstockService.fourthFloorProduceInstock(wmsProduceInstockVo)); return toAjax(wmsProductInstockService.fourthFloorProduceInstock(wmsProduceInstockVo));
} }
/**
*
*/
@Log(title = "成品出库记录", businessType = BusinessType.INSERT)
@PostMapping(("/fourthFloorProduceOutstock"))
public AjaxResult fourthFloorProduceOutstock(@Validated @RequestBody WmsProduceInstockVo wmsProduceInstockVo) {
return toAjax(wmsProductOutstockService.fourthFloorProduceOutstock(wmsProduceInstockVo));
}
/** /**
* wcs * wcs
*/ */

@ -2,7 +2,9 @@ package com.hw.wms.service;
import java.util.List; import java.util.List;
import com.hw.wms.domain.WmsProductOutstock; import com.hw.wms.domain.WmsProductOutstock;
import com.hw.wms.domain.vo.WmsProduceInstockVo;
import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo; import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo;
import org.springframework.transaction.annotation.Transactional;
/** /**
* Service * Service
@ -83,4 +85,13 @@ public interface IWmsProductOutstockService
* @return * @return
*/ */
public int finalConfirmProductOutstock(WmsProductOutstockConfirmVo wmsProductOutstockConfirmVo); public int finalConfirmProductOutstock(WmsProductOutstockConfirmVo wmsProductOutstockConfirmVo);
/**
* (Web4)
*
* @param wmsProduceInstockVo
* @return
*/
public int fourthFloorProduceOutstock(WmsProduceInstockVo wmsProduceInstockVo);
} }

@ -277,6 +277,7 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
wmsProductStock.setPlanCode(baseBarcodeInfo.getPlanCode()); wmsProductStock.setPlanCode(baseBarcodeInfo.getPlanCode());
wmsProductStock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode()); wmsProductStock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode());
wmsProductStock.setWarehouseFloor(warehouseFloor); wmsProductStock.setWarehouseFloor(warehouseFloor);
wmsProductStock.setSaleOrderId(baseBarcodeInfo.getSaleOrderId());
wmsProductStock.setSaleorderCode(baseBarcodeInfo.getSaleorderCode()); wmsProductStock.setSaleorderCode(baseBarcodeInfo.getSaleorderCode());
// wmsProductStock.setQualityStatus(wmsRawInstockVo.getQualityStatus()); // wmsProductStock.setQualityStatus(wmsRawInstockVo.getQualityStatus());
wmsProductStock.setTotalAmount(instockAmount); wmsProductStock.setTotalAmount(instockAmount);
@ -358,9 +359,9 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
throw new ServiceException("物料条码有误"); throw new ServiceException("物料条码有误");
} }
// if (baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW)) { if (baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW)) {
// throw new ServiceException("此物料条码为原材料,非成品条码"); throw new ServiceException("此物料条码为原材料,非成品条码");
// } }
//按原材料入库的柜体原料码进行入库 //按原材料入库的柜体原料码进行入库
if (baseBarcodeInfo.getPrintFlag().equals(MesConstants.MES_BARCODE_PRINT_FLAG_NO)) { if (baseBarcodeInfo.getPrintFlag().equals(MesConstants.MES_BARCODE_PRINT_FLAG_NO)) {
throw new ServiceException("此条码还未打印"); throw new ServiceException("此条码还未打印");
@ -405,8 +406,5 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
return wmsProductInstockMapper.insertWmsProductInstock(wmsProductInstock); return wmsProductInstockMapper.insertWmsProductInstock(wmsProductInstock);
} }
public void syncToErp() {
//todo 根据质检状态是通过的同步给ERP
}
} }

@ -93,11 +93,11 @@ public class WmsProductOutstockDetailServiceImpl implements IWmsProductOutstockD
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(productBarcode, SecurityConstants.INNER); R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(productBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) { if (baseBarcodeInfoR == null) {
throw new ServiceException("物料码有误"); throw new ServiceException("物料码有误");
} }
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) { if (baseBarcodeInfo == null) {
throw new ServiceException("物料码有误"); throw new ServiceException("物料码有误");
} }
WmsProductOutstock productOutstock = wmsProductOutstockMapper.selectOnlyWmsProductOutstockByOutstockId(productOutstockId); WmsProductOutstock productOutstock = wmsProductOutstockMapper.selectOnlyWmsProductOutstockByOutstockId(productOutstockId);
@ -106,7 +106,7 @@ public class WmsProductOutstockDetailServiceImpl implements IWmsProductOutstockD
} }
if(!productOutstock.getProductId().equals(baseBarcodeInfo.getMaterialId())) { if(!productOutstock.getProductId().equals(baseBarcodeInfo.getMaterialId())) {
throw new ServiceException("物料码有误"); throw new ServiceException("物料码有误");
} }
if(StringUtils.isEmpty(locationCode) && if(StringUtils.isEmpty(locationCode) &&

@ -4,12 +4,18 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.WmsConstants; import com.hw.common.core.constant.WmsConstants;
import com.hw.common.core.domain.R;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.uuid.Seq; import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.wms.config.WmsConfig;
import com.hw.wms.domain.WmsBaseWarehouse; import com.hw.wms.domain.WmsBaseWarehouse;
import com.hw.wms.domain.WmsProductStock; import com.hw.wms.domain.WmsProductStock;
import com.hw.wms.domain.vo.WmsProduceInstockVo;
import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo; import com.hw.wms.domain.vo.WmsProductOutstockConfirmVo;
import com.hw.wms.mapper.WmsBaseWarehouseMapper; import com.hw.wms.mapper.WmsBaseWarehouseMapper;
import com.hw.wms.mapper.WmsProductOutstockDetailMapper; import com.hw.wms.mapper.WmsProductOutstockDetailMapper;
@ -26,6 +32,8 @@ import com.hw.wms.mapper.WmsProductOutstockMapper;
import com.hw.wms.domain.WmsProductOutstock; import com.hw.wms.domain.WmsProductOutstock;
import com.hw.wms.service.IWmsProductOutstockService; import com.hw.wms.service.IWmsProductOutstockService;
import javax.annotation.Resource;
/** /**
* Service * Service
* *
@ -46,6 +54,12 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
@Autowired @Autowired
private WmsBaseWarehouseMapper wmsBaseWarehouseMapper; private WmsBaseWarehouseMapper wmsBaseWarehouseMapper;
@Autowired
private WmsConfig wmsConfig;
@Resource
private RemoteMesService remoteMesService;
/** /**
* *
* *
@ -70,7 +84,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
/** /**
* *
*||||| * |||||
* |:---- |:---|:----- |----- | * |:---- |:---|:----- |----- |
* | warehouseId | long ID; | * | warehouseId | long ID; |
* | saleorderId | string * | saleorderId | string
@ -88,7 +102,7 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
String saleorderCode = wmsProductOutstock.getSaleorderCode(); String saleorderCode = wmsProductOutstock.getSaleorderCode();
Long productId = wmsProductOutstock.getProductId(); Long productId = wmsProductOutstock.getProductId();
BigDecimal applyQty = wmsProductOutstock.getApplyQty(); BigDecimal applyQty = wmsProductOutstock.getApplyQty();
if(applyQty.compareTo(BigDecimal.ZERO) <=0){ if (applyQty.compareTo(BigDecimal.ZERO) <= 0) {
throw new ServiceException("申请数量需大于0"); throw new ServiceException("申请数量需大于0");
} }
@ -97,6 +111,8 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
queryProductStock.setSaleorderCode(saleorderCode); queryProductStock.setSaleorderCode(saleorderCode);
queryProductStock.setProductId(productId); queryProductStock.setProductId(productId);
queryProductStock.setSaleOrderId(wmsProductOutstock.getSaleOrderId()); queryProductStock.setSaleOrderId(wmsProductOutstock.getSaleOrderId());
//group by wps.warehouse_id,wps.sale_order_id,wps.product_id获取的以下库存信息
List<WmsProductStock> productStocks = wmsProductStockMapper.selectWmsProductStocksBySaleorder(queryProductStock); List<WmsProductStock> productStocks = wmsProductStockMapper.selectWmsProductStocksBySaleorder(queryProductStock);
if (productStocks == null || productStocks.isEmpty()) { if (productStocks == null || productStocks.isEmpty()) {
throw new ServiceException("没有库存"); throw new ServiceException("没有库存");
@ -270,4 +286,57 @@ public class WmsProductOutstockServiceImpl implements IWmsProductOutstockService
return wmsProductOutstockDetailMapper.updateWmsProductOutstockDetail(productOutstockDetail); return wmsProductOutstockDetailMapper.updateWmsProductOutstockDetail(productOutstockDetail);
} }
/**
* (Web4)
*
* @param wmsProduceInstockVo
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int fourthFloorProduceOutstock(WmsProduceInstockVo wmsProduceInstockVo) {
//对内生产可直接出库,外部销售需要申请后才能出库(外部销售在手机端操作出库)
Long warehouseId = wmsConfig.getFourthFloorProductWarehouseId();
String materialBarcode = wmsProduceInstockVo.getMaterialBarcode();
WmsProductStock productStock = wmsProductStockMapper.selectProductStockByBatch(materialBarcode);
BigDecimal availableAmount = getAvailableAmount(productStock); //可申请数量
if (availableAmount.compareTo(BigDecimal.ONE) < 0) {
throw new ServiceException("没有库存信息");
}
WmsProductOutstock wmsProductOutstock = new WmsProductOutstock();
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
wmsProductOutstock.setWarehouseId(warehouseId);
wmsProductOutstock.setProductType(WmsConstants.WMS_PRODUCT_OUTSTOCK_PRODUCT_TYPE_PRODUCT);
wmsProductOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_MANUAL);
wmsProductOutstock.setOutstockType(WmsConstants.WMS_PRODUCT_OUTSTOCK_TYPE_SALE);
wmsProductOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsProductOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsProductOutstock.setApplyBy(userName);
wmsProductOutstock.setApplyDate(currentDate);
wmsProductOutstock.setTaskCode(Seq.getId(Seq.productOutstockSeqType, Seq.productOutstockCode));
wmsProductOutstockMapper.insertWmsProductOutstock(wmsProductOutstock);
return wmsProductStockMapper.deleteWmsProductStockByProductStockId(productStock.getProductStockId());
}
private static BigDecimal getAvailableAmount(WmsProductStock productStock) {
if (productStock == null) {
throw new ServiceException("没有库存信息");
}
/*获取仓库可用库存数量*/
BigDecimal totalAmount = productStock.getTotalAmount() == null ? BigDecimal.ZERO : productStock.getTotalAmount();
BigDecimal frozenAmount = productStock.getFrozenAmount() == null ? BigDecimal.ZERO : productStock.getFrozenAmount();//冻结数量暂时没用
BigDecimal occupyAmount = productStock.getOccupyAmount() == null ? BigDecimal.ZERO : productStock.getOccupyAmount();//
BigDecimal availableAmount = totalAmount.subtract(frozenAmount).subtract(occupyAmount);
return availableAmount;
}
} }

@ -108,6 +108,7 @@
<if test="productId != null">product_id,</if> <if test="productId != null">product_id,</if>
<if test="planCode != null">plan_code,</if> <if test="planCode != null">plan_code,</if>
<if test="planDetailCode != null">plan_detail_code,</if> <if test="planDetailCode != null">plan_detail_code,</if>
<if test="saleOrderId != null">sale_order_id,</if>
<if test="saleorderCode != null">saleorder_code,</if> <if test="saleorderCode != null">saleorder_code,</if>
<if test="totalAmount != null">total_amount,</if> <if test="totalAmount != null">total_amount,</if>
<if test="frozenAmount != null">frozen_amount,</if> <if test="frozenAmount != null">frozen_amount,</if>
@ -130,6 +131,7 @@
<if test="productId != null">#{productId},</if> <if test="productId != null">#{productId},</if>
<if test="planCode != null">#{planCode},</if> <if test="planCode != null">#{planCode},</if>
<if test="planDetailCode != null">#{planDetailCode},</if> <if test="planDetailCode != null">#{planDetailCode},</if>
<if test="saleOrderId != null">#{saleOrderId},</if>
<if test="saleorderCode != null">#{saleorderCode},</if> <if test="saleorderCode != null">#{saleorderCode},</if>
<if test="totalAmount != null">#{totalAmount},</if> <if test="totalAmount != null">#{totalAmount},</if>
<if test="frozenAmount != null">#{frozenAmount},</if> <if test="frozenAmount != null">#{frozenAmount},</if>
@ -155,6 +157,7 @@
<if test="productId != null">product_id = #{productId},</if> <if test="productId != null">product_id = #{productId},</if>
<if test="planCode != null">plan_code = #{planCode},</if> <if test="planCode != null">plan_code = #{planCode},</if>
<if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if> <if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if>
<if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if>
<if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if> <if test="saleorderCode != null">saleorder_code = #{saleorderCode},</if>
<if test="totalAmount != null">total_amount = #{totalAmount},</if> <if test="totalAmount != null">total_amount = #{totalAmount},</if>
<if test="frozenAmount != null">frozen_amount = #{frozenAmount},</if> <if test="frozenAmount != null">frozen_amount = #{frozenAmount},</if>

@ -99,6 +99,25 @@ export function fourthFloorProduceInstock(data) {
}) })
} }
// 校验四楼成品出库
export function check4thFloorProduceOutstock(materialBarcode) {
return request({
url: '/mes/api/check4thFloorProduceOutstock/'+materialBarcode,
method: 'get'
})
}
// 四楼成品出库
export function fourthFloorProduceOutstock(data) {
return request({
url: '/wms/api/fourthFloorProduceOutstock',
method: 'post',
data: data
})
}
//扫描物料条码确认使用 //扫描物料条码确认使用
export function scanMaterial2Confirm(data) { export function scanMaterial2Confirm(data) {
return request({ return request({

@ -7,65 +7,65 @@
<div class="chart"> <div class="chart">
<div class="whiteTable"> <div class="whiteTable">
<el-table <el-table
:cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"
:data="tableData" :data="tableData"
:header-cell-style="{textAlign:'center'}" :header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw" :max-height="19.13 * vw"
style="width: 100%" style="width: 100%"
> >
<el-table-column <el-table-column
label="序号" label="序号"
type="index" type="index"
width="50" width="50"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="派工单号" label="派工单号"
prop="planCode" prop="planCode"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="物料名称" label="物料名称"
prop="materialName" prop="materialName"
width="100" width="100"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="计划" label="计划"
prop="planAmount" prop="planAmount"
width="100" width="100"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="实际" label="实际"
prop="completeAmount" prop="completeAmount"
width="100" width="100"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="差异" label="差异"
prop="difference" prop="difference"
width="100" width="100"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.planAmount - scope.row.completeAmount }} {{ scope.row.planAmount - scope.row.completeAmount }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="交付时间" label="交付时间"
prop="planDeliveryDate" prop="planDeliveryDate"
width="150" width="150"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
width="120" width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="small" size="small"
type="text" type="text"
@click="getDetail(scope)" @click="getDetail(scope)"
> >
明细 明细
</el-button> </el-button>
@ -104,93 +104,93 @@
<div class="chart"> <div class="chart">
<div class="whiteTable"> <div class="whiteTable">
<el-table <el-table
:cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"
:data="tableData1" :data="tableData1"
:header-cell-style="{textAlign:'center'}" :header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw" :max-height="19.13 * vw"
style="width: 100%" style="width: 100%"
> >
<el-table-column <el-table-column
label="序号" label="序号"
type="index" type="index"
width="50" width="50"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="派工单号" label="派工单号"
prop="planCode" prop="planCode"
width="80" width="80"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="明细编号" label="明细编号"
prop="planDetailCode" prop="planDetailCode"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="开始时间" label="开始时间"
prop="realBeginTime" prop="realBeginTime"
width="120" width="120"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="结束时间" label="结束时间"
prop="realEndTime" prop="realEndTime"
width="120" width="120"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="状态" label="状态"
prop="createTime" prop="createTime"
width="80" width="80"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_plan_detail_status" :value="scope.row.planDetailStatus"/> <dict-tag :options="dict.type.mes_plan_detail_status" :value="scope.row.planDetailStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
width="160" width="160"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="scope.row.planDetailStatus !== '3' && scope.row.planDetailStatus !== '9'" v-if="scope.row.planDetailStatus !== '3' && scope.row.planDetailStatus !== '9'"
size="small" size="small"
type="text" type="text"
@click="planExecute(scope.row)" @click="planExecute(scope.row)"
> >
{{ scope.row.planDetailStatus === '1' ? '开始' : '完成' }} {{ scope.row.planDetailStatus === '1' ? '开始' : '完成' }}
</el-button> </el-button>
<el-button <el-button
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED" v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"
size="small" size="small"
type="text" type="text"
@click="getMaterials(scope) " @click="getMaterials(scope) "
> >
领料 领料
</el-button> </el-button>
<el-button <el-button
@click="handleMaterialConfirmForm(scope)" @click="handleMaterialConfirmForm(scope)"
size="small" size="small"
type="text" type="text"
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED" v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"
> >
扫描 扫描
</el-button> </el-button>
<el-button <el-button
size="small" size="small"
type="text" type="text"
@click="returnMaterial(scope)" @click="returnMaterial(scope)"
v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START" v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START"
> >
退库 退库
</el-button> </el-button>
<el-button <el-button
size="small" size="small"
type="text" type="text"
@click="print(scope.row)" @click="print(scope.row)"
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.FINISHED || scope.row.planDetailStatus === PLAN_DETAIL_STATUS.ABNORMAL_FINISHED" v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.FINISHED || scope.row.planDetailStatus === PLAN_DETAIL_STATUS.ABNORMAL_FINISHED"
> >
条码 条码
</el-button> </el-button>
@ -221,16 +221,16 @@
<el-row> <el-row>
<el-button type="primary">首页</el-button> <el-button type="primary">首页</el-button>
<el-button type="success" @click="handleProductInstock"></el-button> <el-button type="success" @click="handleProductInstock"></el-button>
<!--el-button type="warning" @click="connectSerialPort" ref="connectSerialBtn">连接条码枪</el-button--> <el-button type="warning" @click="handleProductOutstock"></el-button>
<!--el-button type="info">最小化</el-button--> <!--el-button type="info">最小化</el-button-->
<el-button type="danger" @click="logout">退</el-button> <el-button type="danger" @click="logout">退</el-button>
</el-row> </el-row>
</div> </div>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
title="领料" title="领料"
width="40%"> width="40%">
<el-form ref="form" :model="form" label-width="80px"> <el-form ref="form" :model="form" label-width="80px">
<el-form-item label="派工单号"> <el-form-item label="派工单号">
<el-input v-model="form.planCode" disabled></el-input> <el-input v-model="form.planCode" disabled></el-input>
@ -249,65 +249,65 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
:cell-style="{textAlign:'center'}" :cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList" :data="form.wmsRawOutstockDetailList"
:header-cell-style="{textAlign:'center'}" :header-cell-style="{textAlign:'center'}"
max-height="19.13vw" max-height="19.13vw"
style="width: 100%" style="width: 100%"
> >
<el-table-column <el-table-column
label="物料编号" label="物料编号"
prop="materialCode" prop="materialCode"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="物料名称" label="物料名称"
prop="materialName" prop="materialName"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="安全库存" label="安全库存"
prop="safeFlag" prop="safeFlag"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_safe_flag" :value="scope.row.safeFlag"/> <dict-tag :options="dict.type.mes_safe_flag" :value="scope.row.safeFlag"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="可用库存数量" label="可用库存数量"
prop="availableAmount" prop="availableAmount"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="占用库存数量" label="占用库存数量"
prop="unavailableAmount" prop="unavailableAmount"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="领取数量" label="领取数量"
prop="planAmount" prop="planAmount"
width="120" width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-input-number
v-model="scope.row.planAmount" v-model="scope.row.planAmount"
:min="0" :min="0"
controls-position="right" controls-position="right"
style="width: 100%" style="width: 100%"
> >
</el-input-number> </el-input-number>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作" label="操作"
width="160" width="160"
> >
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<el-input <el-input
v-model="searchMaterialValue" v-model="searchMaterialValue"
placeholder="输入物料名称搜索" placeholder="输入物料名称搜索"
size="mini" size="mini"
@change="searchMaterial"/> @change="searchMaterial"/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -328,9 +328,9 @@
<el-dialog <el-dialog
:visible.sync="productInstockVisible" :visible.sync="productInstockVisible"
title="成品入库" :title="productInstockTitle"
width="40%"> width="40%">
<el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="80px"> <el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="80px">
<el-form-item label="成品条码" prop="materialBarcode"> <el-form-item label="成品条码" prop="materialBarcode">
<el-input v-model="productInstockForm.materialBarcode" suffix-icon="el-icon-full-screen"></el-input> <el-input v-model="productInstockForm.materialBarcode" suffix-icon="el-icon-full-screen"></el-input>
@ -344,9 +344,9 @@
<el-dialog <el-dialog
:visible.sync="materialConfirmVisible" :visible.sync="materialConfirmVisible"
title="确认物料使用" title="确认物料使用"
width="40%"> width="40%">
<el-form ref="materialConfirmForm" :model="materialConfirmForm" :rules="materialConfirmRules" label-width="80px"> <el-form ref="materialConfirmForm" :model="materialConfirmForm" :rules="materialConfirmRules" label-width="80px">
<el-form-item label="计划ID" prop="planId" v-if="false"> <el-form-item label="计划ID" prop="planId" v-if="false">
<el-input v-model="materialConfirmForm.planId"></el-input> <el-input v-model="materialConfirmForm.planId"></el-input>
@ -378,7 +378,8 @@
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input> <el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
</el-form-item--> </el-form-item-->
<el-form-item label="物料条码"> <el-form-item label="物料条码">
<el-input placeholder="请扫描或输入物料条码" v-model="returnModelForm.materialBarcode" suffix-icon="el-icon-full-screen"> <el-input placeholder="请扫描或输入物料条码" v-model="returnModelForm.materialBarcode"
suffix-icon="el-icon-full-screen">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="仓库"> <el-form-item label="仓库">
@ -388,7 +389,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="planAmount"> <el-form-item label="数量" prop="planAmount">
<el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1" style="width: 260px"></el-input-number> <el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1"
style="width: 260px"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="退库类型" prop="taskType"> <el-form-item label="退库类型" prop="taskType">
<el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型" style="width: 260px"> <el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型" style="width: 260px">
@ -421,6 +423,8 @@ import {
insertProductPlanDetails, insertProductPlanDetails,
startProductPlanDetail, startProductPlanDetail,
fourthFloorProduceInstock, fourthFloorProduceInstock,
check4thFloorProduceOutstock,
fourthFloorProduceOutstock,
scanMaterial2Confirm, applyRawReturn scanMaterial2Confirm, applyRawReturn
} from "@/api/board"; } from "@/api/board";
import {monitorSerialData} from "@/utils/serial" import {monitorSerialData} from "@/utils/serial"
@ -461,7 +465,13 @@ export default {
tableData: [], tableData: [],
tableData1: [], tableData1: [],
productInstockType: null,//
PRODUCT_INSTOCK_TYPE: {
INSTOCK: "1",//
OUTSTOCK: "2",//
},
productInstockVisible: false, productInstockVisible: false,
productInstockTitle:'',
productInstockForm: { productInstockForm: {
materialBarcode: null materialBarcode: null
}, },
@ -497,11 +507,11 @@ export default {
], ],
}, },
PLAN_DETAIL_STATUS:{ PLAN_DETAIL_STATUS: {
TO_START : '1', TO_START: '1',
STARTED : '2', STARTED: '2',
FINISHED : '3', FINISHED: '3',
ABNORMAL_FINISHED : '9' ABNORMAL_FINISHED: '9'
}, },
} }
}, },
@ -764,8 +774,6 @@ export default {
// }, // },
async logout() { async logout() {
this.$confirm('确定退出系统吗?', '提示', { this.$confirm('确定退出系统吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -817,20 +825,20 @@ export default {
startProductPlanDetail({ startProductPlanDetail({
planDetailId: e.planDetailId planDetailId: e.planDetailId
}) })
.finally(() => { .finally(() => {
this.getDetail({row: {planId: e.planId}}) this.getDetail({row: {planId: e.planId}})
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / 5)
})
}) })
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
}) })
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
})
} }
if (e.planDetailStatus === '2') { if (e.planDetailStatus === '2') {
this.$confirm('是否完成计划', '确认', { this.$confirm('是否完成计划', '确认', {
@ -841,20 +849,20 @@ export default {
completeProductPlanDetail({ completeProductPlanDetail({
planDetailId: e.planDetailId planDetailId: e.planDetailId
}) })
.finally(() => { .finally(() => {
this.getDetail({row: {planId: e.planId}}) this.getDetail({row: {planId: e.planId}})
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / 5)
})
}) })
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
}) })
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
})
} }
}, },
// / // /
@ -883,12 +891,12 @@ export default {
}); });
}) })
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '已取消' message: '已取消'
}); });
}) })
} else { } else {
this.tableData1 = res.rows this.tableData1 = res.rows
this.totalNum2 = Math.ceil(res.total / 5) this.totalNum2 = Math.ceil(res.total / 5)
@ -912,7 +920,7 @@ export default {
wmsRawOutstockDetailList: [] wmsRawOutstockDetailList: []
} }
// //
getWarehouses({"warehouseFloor": 4,"mesAreaType" : 4}).then(e => { getWarehouses({"warehouseFloor": 4, "mesAreaType": 4}).then(e => {
this.warehouseList = e.data this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId this.form.warehouseId = e.data[0]?.warehouseId
this.searchMaterial(""); this.searchMaterial("");
@ -977,6 +985,19 @@ export default {
/** 成品入库按钮操作 */ /** 成品入库按钮操作 */
handleProductInstock() { handleProductInstock() {
this.productInstockTitle = "成品入库";
this.productInstockType = this.PRODUCT_INSTOCK_TYPE.INSTOCK;
this.handleProductStock();
},
/** 成品出库按钮操作 */
handleProductOutstock() {
this.productInstockTitle = "成品出库";
this.productInstockType = this.PRODUCT_INSTOCK_TYPE.OUTSTOCK;
this.handleProductStock();
},
handleProductStock() {
this.resetProductInstock(); this.resetProductInstock();
this.productInstockVisible = true; this.productInstockVisible = true;
if (!this.checkSerialConnected()) { if (!this.checkSerialConnected()) {
@ -993,22 +1014,28 @@ export default {
showCancelButton: true, showCancelButton: true,
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
console.log("dddd")
this.connectSerial(this.setSerialData); this.connectSerial(this.setSerialData);
}).catch(() => { }).catch(() => {
}); });
} }
}, },
submitProductInstock() { submitProductInstock() {
this.$refs["productInstockForm"].validate(valid => { this.$refs["productInstockForm"].validate(valid => {
if (valid) { if (valid) {
fourthFloorProduceInstock(this.productInstockForm).then(response => { if (this.productInstockType === this.PRODUCT_INSTOCK_TYPE.INSTOCK) {
this.$modal.msgSuccess("入库成功"); fourthFloorProduceInstock(this.productInstockForm).then(response => {
this.cancelProductInstock(); this.$modal.msgSuccess("入库成功");
}); this.cancelProductInstock();
});
} else if (this.productInstockType === this.PRODUCT_INSTOCK_TYPE.OUTSTOCK) {
check4thFloorProduceOutstock(this.productInstockForm.materialBarcode).then(response => {
fourthFloorProduceOutstock(this.productInstockForm).then(response => {
this.$modal.msgSuccess("出库成功");
this.cancelProductInstock();
});
});
}
} }
}); });
}, },
@ -1096,7 +1123,7 @@ export default {
}, },
setReturnModelForm() { setReturnModelForm() {
getWarehouses({ getWarehouses({
mesAreaType : 3, //4 mesAreaType: 3, //4
//warehouseFloor: 4, //warehouseFloor: 4,
//materialBarcode: this.returnModelForm.materialBarcode //materialBarcode: this.returnModelForm.materialBarcode
}).then(e => { }).then(e => {
@ -1107,7 +1134,7 @@ export default {
} }
}); });
if(this.WarehousesList && this.WarehousesList.length>0){ if (this.WarehousesList && this.WarehousesList.length > 0) {
this.returnModelForm.warehouseId = this.WarehousesList[0].value; this.returnModelForm.warehouseId = this.WarehousesList[0].value;
} }
}) })
@ -1161,7 +1188,7 @@ export default {
this.materialConfirmForm.materialBarcode = this.serialData; this.materialConfirmForm.materialBarcode = this.serialData;
} else if (this.productInstockVisible) { } else if (this.productInstockVisible) {
this.productInstockForm.materialBarcode = this.serialData; this.productInstockForm.materialBarcode = this.serialData;
} else if(this.returnModelVisible){ } else if (this.returnModelVisible) {
this.returnModelForm.materialBarcode = this.serialData; this.returnModelForm.materialBarcode = this.serialData;
} }
// console.log(this.serialData) // console.log(this.serialData)

Loading…
Cancel
Save