MES:新增门板条码和背板条码打印
WMS:结束领料和结束退料调用wcs接口
master
xs 4 months ago
parent cd86603d30
commit a33fa0362c

@ -28,6 +28,10 @@ public class MesConstants {
* :
*/
public static final String MES_BARCODE_TYPE_BACKPLATE = "4";
/**
* :
*/
public static final String MES_BARCODE_TYPE_DOOR = "5";
/**
* :
*/

@ -240,18 +240,4 @@ public class MesApiController extends BaseController {
}
/**
*
*/
@Log(title = "领料", businessType = BusinessType.COMPLETE)
@PostMapping(("/completeCollectMaterials"))
public AjaxResult completeCollectMaterials() {
//todo
/*http://IP:5001/wcs/RecieveRcs/agvComplete 装配区背负式Agv通知任务完成
{
"endStationCode": "string",//工位
}*/
return null;
}
}

@ -123,6 +123,10 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
generateProductBarcode(mesBaseBarcodeInfo);
}
else{//生成背板条码或者门板条码
generateBackOrDoorBarcode(mesBaseBarcodeInfo);
}
return 1;
}
@ -250,22 +254,22 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
List<MesBaseBarcodeInfo> mesBaseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBarcodeInfo);
if (mesBaseBarcodeInfos != null && !mesBaseBarcodeInfos.isEmpty()) {
throw new ServiceException("此计划明细已经生成条码,不能重复生成");
throw new ServiceException("此生产明细已经生成条码,不能重复生成");
}
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailCode(planDetailCode);
if (mesProductPlanDetail == null) {
throw new ServiceException("此生产任务明细不存在");
throw new ServiceException("此生产明细不存在");
}
if (!mesProductPlanDetail.getPlanDetailStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_FINISH) &&
!mesProductPlanDetail.getPlanDetailStatus().equals(MesConstants.MES_PRODUCT_PLAN_DETAIL_STATUS_ABNORMAL_FINISH)) {
throw new ServiceException("此生产任务明细还未完成,不能打印条码");
throw new ServiceException("此生产明细还未完成,不能打印条码");
}
MesProductPlan productPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(planCode);
if (productPlan == null) {
throw new ServiceException("此生产任务不存在");
throw new ServiceException("此生产派工不存在");
}
@ -290,6 +294,69 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService
}
/**
*
* @param mesBaseBarcodeInfo
*/
public void generateBackOrDoorBarcode(MesBaseBarcodeInfo mesBaseBarcodeInfo) {
String planCode = mesBaseBarcodeInfo.getPlanCode();
String planDetailCode = mesBaseBarcodeInfo.getPlanDetailCode();
MesBaseBarcodeInfo queryBarcodeInfo = new MesBaseBarcodeInfo();
queryBarcodeInfo.setPlanDetailCode(planDetailCode);
queryBarcodeInfo.setBarcodeType(mesBaseBarcodeInfo.getBarcodeType());
List<MesBaseBarcodeInfo> mesBaseBarcodeInfos = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoList(queryBarcodeInfo);
if (mesBaseBarcodeInfos != null && !mesBaseBarcodeInfos.isEmpty()) {
throw new ServiceException("此生产明细已经生成条码,不能重复生成");
}
MesProductPlanDetail mesProductPlanDetail = mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailCode(planDetailCode);
if (mesProductPlanDetail == null) {
throw new ServiceException("此生产明细不存在");
}
MesProductPlan productPlan = mesProductPlanMapper.selectOnlyMesProductPlanByPlanCode(planCode);
if (productPlan == null) {
throw new ServiceException("此生产派工不存在");
}
MesBaseBarcodeInfo bindBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByBarcodeInfo(mesBaseBarcodeInfo.getBindBarcode());
if(bindBarcodeInfo==null){
throw new ServiceException("绑定的柜体码不存在");
}
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
//将之前的原材料码设置计划编码和明细编码,在入半成品库时是按照此码入库,后续生成成品码也需要根据此码生成
bindBarcodeInfo.setPlanCode(mesBaseBarcodeInfo.getPlanCode());
bindBarcodeInfo.setPlanDetailCode(mesBaseBarcodeInfo.getPlanDetailCode());
bindBarcodeInfo.setUpdateBy(userName);
bindBarcodeInfo.setUpdateTime(currentDate);
String barcode = Seq.getId(Seq.mesCompBarcodeSeqType, Seq.mesCompBarcodeCode);
mesBaseBarcodeInfo.setBatchCode(barcode);// 成品的批次代码 == 条码内容
mesBaseBarcodeInfo.setBarcodeInfo(barcode);
mesBaseBarcodeInfo.setAmount(new BigDecimal(1));
mesBaseBarcodeInfo.setBatchFlag(MesConstants.NOT_IS_BATCH);
mesBaseBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES);
mesBaseBarcodeInfo.setMaterialId(productPlan.getMaterialId());
mesBaseBarcodeInfo.setPrintFlag(MesConstants.MES_BARCODE_PRINT_FLAG_NO);
mesBaseBarcodeInfo.setSaleOrderId(productPlan.getSaleOrderId());
mesBaseBarcodeInfo.setSaleorderCode(productPlan.getSaleorderCode());
mesBaseBarcodeInfo.setCreateTime(currentDate);
mesBaseBarcodeInfo.setCreateBy(userName);
mesBaseBarcodeInfoMapper.updateMesBaseBarcodeInfo(bindBarcodeInfo);
mesBaseBarcodeInfoMapper.insertMesBaseBarcodeInfo(mesBaseBarcodeInfo);
}
public MesBaseBarcodeInfo getInsertedBarcodeInfo(MesBaseBarcodeInfo mesBaseBarcodeInfo, String batchCode, String userName, Date currentDate) {
MesBaseBarcodeInfo toInsertedBarcodeInfo = new MesBaseBarcodeInfo();
//同一批次的批次代码相同

@ -6,14 +6,13 @@ import org.springframework.context.annotation.Configuration;
/**
* @Description:
* @ClassName: StationConfig
* @Author : xins
* @Date :2024-03-25 8:53
* @Author : xins
* @Date :2024-03-25 8:53
* @Version :1.0
*/
@Configuration
@ConfigurationProperties(prefix = "wms")
public class WmsConfig
{
public class WmsConfig {
/**
*
*/
@ -44,6 +43,11 @@ public class WmsConfig
*/
private Long fourthFloorPartsWarehouseId;
/**
* WCS-agv
*/
private String wcsAgvCompleteUrl;
public String getFifthAssembleStationCode() {
return fifthAssembleStationCode;
@ -92,4 +96,12 @@ public class WmsConfig
public void setFourthFloorPartsWarehouseId(Long fourthFloorPartsWarehouseId) {
this.fourthFloorPartsWarehouseId = fourthFloorPartsWarehouseId;
}
public String getWcsAgvCompleteUrl() {
return wcsAgvCompleteUrl;
}
public void setWcsAgvCompleteUrl(String wcsAgvCompleteUrl) {
this.wcsAgvCompleteUrl = wcsAgvCompleteUrl;
}
}

@ -153,4 +153,29 @@ public class WmsApiController extends BaseController {
}
/**
*
*/
@Log(title = "领料", businessType = BusinessType.COMPLETE)
@PostMapping(("/completeCollectMaterials"))
public AjaxResult completeCollectMaterials(@RequestBody WmsCmpleteCollectMaterialsVo wmsCmpleteCollectMaterialsVo) {
return toAjax(wmsRawOutstockService.completeCollectMaterials(wmsCmpleteCollectMaterialsVo));
}
/**
* 退
*/
@Log(title = "退料", businessType = BusinessType.COMPLETE)
@PostMapping(("/completeReturnMaterials"))
public AjaxResult completeReturnMaterials(@RequestBody WmsCmpleteCollectMaterialsVo wmsCmpleteCollectMaterialsVo) {
return toAjax(wmsRawOutstockService.completeCollectMaterials(wmsCmpleteCollectMaterialsVo));
}
/**
*
*/
@GetMapping(("/getNewestOutstockCabinet"))
public AjaxResult getNewestOutstockCabinet(WmsRawOutstock wmsRawOutstock) {
return success(wmsRawOutstockService.getNewestOutstockCabinet(wmsRawOutstock));
}
}

@ -0,0 +1,11 @@
package com.hw.wms.domain.vo;
import lombok.Data;
@Data
public class WcsReturnMsgVo {
private Integer code;
private String message;
}

@ -0,0 +1,9 @@
package com.hw.wms.domain.vo;
import lombok.Data;
@Data
public class WmsCmpleteCollectMaterialsVo {
private String endStationCode;
}

@ -139,4 +139,11 @@ public interface WmsRawOutstockMapper
*/
public WmsRawOutstock selectWmsRawOutstockJoinMaterialById(Long rawOutstockId);
/**
*
*
* @param wmsRawOutstock
* @return
*/
public WmsRawOutstock selectNewestWmsRawOutstock(WmsRawOutstock wmsRawOutstock);
}

@ -140,4 +140,19 @@ public interface IWmsRawOutstockService
* @return
*/
public int directRawOutstock(WmsRawOutstock wmsRawOutstock);
/**
* wcswcsagv
* @param wmsCmpleteCollectMaterialsVo
*/
public int completeCollectMaterials(WmsCmpleteCollectMaterialsVo wmsCmpleteCollectMaterialsVo);
/**
* (使)
* @param wmsRawOutstock
* @return
*/
public WmsRawOutstock getNewestOutstockCabinet(WmsRawOutstock wmsRawOutstock);
}

@ -1,28 +1,23 @@
package com.hw.wms.service.impl;
import java.util.HashMap;
import java.util.List;
import com.hw.common.core.constant.SecurityConstants;
import com.hw.common.core.constant.WmsConstants;
import com.hw.common.core.enums.WmsLocationStatus;
import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils;
import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.printer.api.RemotePrinterService;
import com.hw.printer.api.domain.vo.PrintContentVo;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.domain.WmsBaseWarehouse;
import com.hw.wms.mapper.WmsBaseLocationMapper;
import com.hw.wms.mapper.WmsBaseWarehouseMapper;
import com.hw.wms.service.IWmsBaseLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hw.wms.mapper.WmsBaseLocationMapper;
import com.hw.wms.domain.WmsBaseLocation;
import com.hw.wms.service.IWmsBaseLocationService;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
/**
* Service

@ -358,10 +358,10 @@ public class WmsProductInstockServiceImpl implements IWmsProductInstockService {
throw new ServiceException("物料条码有误");
}
if (baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW)) {
throw new ServiceException("此物料条码为原材料,非成品条码");
}
// if (baseBarcodeInfo.getBarcodeType().equals(WmsConstants.RWA_STOCK_STOCK_TYPE_RAW)) {
// throw new ServiceException("此物料条码为原材料,非成品条码");
// }
//按原材料入库的柜体原料码进行入库
if (baseBarcodeInfo.getPrintFlag().equals(MesConstants.MES_BARCODE_PRINT_FLAG_NO)) {
throw new ServiceException("此条码还未打印");
}

@ -19,8 +19,13 @@ import com.hw.wms.domain.vo.*;
import com.hw.wms.mapper.*;
import com.hw.wms.service.IWmsRawOutstockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.math.BigDecimal;
import java.util.*;
@ -924,7 +929,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
*/
@Override
public int assembleOutstock(WmsAssembleOutstockVo wmsAssembleOutstockVo) {
/**1todowcs
/**1wcs
* 2
* 3WCS
* *
@ -932,11 +937,11 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
String materialBarcode = wmsAssembleOutstockVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料码有误");
throw new ServiceException("物料码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料码有误");
throw new ServiceException("物料码有误");
}
/**todo需要最终确认一下。在申请领柜体后wcs会调度agv将对应库位的柜体运输到柜体拆分区然后更新rawoutstock的materialbatch为其物料条码*/
@ -959,7 +964,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
throw new ServiceException("没找到库存信息");
}
WmsRawStock wmsRawStock = wmsRawStocks.get(0); //todo待agv出库后wcs更新库存信息需要删除库存由于是1个
WmsRawStock wmsRawStock = wmsRawStocks.get(0); //待agv出库后wcs更新库存信息需要删除库存由于是1个
WmsRawOutstock wmsRawOutstock = new WmsRawOutstock();
wmsRawOutstock.setTaskCode(Seq.getId(Seq.rawOutstockSeqType, Seq.rawOutstockSeqCode));
@ -973,7 +978,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstock.setPalletInfoCode(baseBarcodeInfo.getPalletInfoCode());//在绑定时需要在条码信息中记录托盘码
wmsRawOutstock.setOutstockAmount(BigDecimal.ONE);
wmsRawOutstock.setEndStationCode(wmsConfig.getFifthAssembleStationCode());//目标位置,五楼组装区域 todo 读配置文件获取
wmsRawOutstock.setEndStationCode(wmsConfig.getFifthAssembleStationCode());//目标位置,五楼组装区域
wmsRawOutstock.setOperationType(WmsConstants.WMS_OPERATION_TYPE_AUTO);
wmsRawOutstock.setTaskType(WmsConstants.WMS_RAW_OUTSTOCK_TASK_TYPE_PRODUCTION_INSTALL);
wmsRawOutstock.setApplyBy(SecurityUtils.getUsername());
@ -1165,4 +1170,49 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
}
}
/**
* wcswcsagv
*
* @param wmsCmpleteCollectMaterialsVo
*/
@Override
public int completeCollectMaterials(WmsCmpleteCollectMaterialsVo wmsCmpleteCollectMaterialsVo) {
try {
String wcsAgvCompleteUrl = wmsConfig.getWcsAgvCompleteUrl();
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
// headers.add(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON_VALUE);
// String params = "{\"endStationCode\":\""+stationCode+"\"}";
HttpEntity<WmsCmpleteCollectMaterialsVo> entity = new HttpEntity<>(wmsCmpleteCollectMaterialsVo, headers);
ResponseEntity<WcsReturnMsgVo> response = restTemplate.postForEntity(
wcsAgvCompleteUrl, entity, WcsReturnMsgVo.class);
WcsReturnMsgVo wcsReturnMsgVo = response.getBody();
// System.out.println("Response Status: " + response.getStatusCode());
// System.out.println("Response Status: " + wcsReturnMsgVo);
if (response.getStatusCodeValue() != 200) {
throw new ServiceException("调度异常,请重试");
}
} catch (Exception e) {
throw new ServiceException("调度异常,请重试");
}
return 1;
}
/**
* (使)
*
* @param wmsRawOutstock
* @return
*/
@Override
public WmsRawOutstock getNewestOutstockCabinet(WmsRawOutstock wmsRawOutstock) {
wmsRawOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
return wmsRawOutstockMapper.selectNewestWmsRawOutstock(wmsRawOutstock);
}
}

@ -328,4 +328,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectNewestWmsRawOutstock" parameterType="WmsRawOutstock" resultMap="WmsRawOutstockResult">
select wro.raw_outstock_id,wrod.material_barcode as material_batch from wms_raw_outstock wro left join wms_raw_outstock_detail wrod on wro.raw_outstock_id = wrod.raw_outstock_id
<where>
<if test="planCode != null "> and wro.plan_code = #{planCode}</if>
<if test="planDetailCode != null "> and wro.plan_detail_code = #{planDetailCode}</if>
<if test="executeStatus != null and executeStatus != ''"> and wro.execute_status = #{executeStatus}</if>
</where>
order by wro.raw_outstock_id desc limit 1
</select>
</mapper>

@ -250,3 +250,43 @@ export function selectMaterialInstallationCircumstance(query) {
params: query
})
}
// 查询当前登录工位
export function getLoginStationInfo() {
return request({
url: '/mes/api/getLoginStationInfo',
method: 'get',
})
}
export function getNewestOutstockCabinet(query) {
return request({
url: '/wms/api/getNewestOutstockCabinet',
method: 'get',
params: query
})
}
/**
* 完成领料拿料
*/
export function completeCollectMaterials(data) {
return request({
url: '/wms/api/completeCollectMaterials',
method: 'post',
data: data
})
}
/**
* 完成退料放料
*/
export function completeReturnMaterials(data) {
return request({
url: '/wms/api/completeReturnMaterials',
method: 'post',
data: data
})
}

@ -25,20 +25,44 @@
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button type="success" v-if="(!$route.query || $route.query.id==='2')" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="getMaterials('0')">
<el-button type="success" v-if="(!$route.query || $route.query.id==='2')"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="getMaterials('0')">领料
</el-button>
<el-button type="warning" v-if="(!$route.query || $route.query.id==='2')" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="handleMaterialConfirmForm()">
<el-button type="info" v-if="(!$route.query || $route.query.id==='2')"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="completeCollectMaterials()">完成领料
</el-button>
<el-button type="danger" @click="returnMaterial()" v-if="(!$route.query || $route.query.id==='2')" :disabled="!form.planDetailCode">退
<el-button type="warning" v-if="(!$route.query || $route.query.id==='2')"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="handleMaterialConfirmForm()">扫描
</el-button>
<el-button type="primary" v-if="($route.query && $route.query.id) !== '2'" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="getMaterials('1')">
<el-button type="danger" @click="returnMaterial()" v-if="(!$route.query || $route.query.id==='2')"
:disabled="!form.planDetailCode">退料
</el-button>
<el-button type="info" @click="completeReturnMaterials()" v-if="(!$route.query || $route.query.id==='2')"
:disabled="!form.planDetailCode">完成退料
</el-button>
<el-button type="primary" v-if="($route.query && $route.query.id) !== '2'"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="getMaterials('1')">
领柜体
</el-button>
<el-button v-if="($route.query && $route.query.id) !== '2'" type="info" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="handleBindBarcode">
<el-button type="danger" v-if="($route.query && $route.query.id) !== '2'"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="print()">
条码
</el-button>
<el-button v-if="($route.query && $route.query.id) !== '2'" type="warning" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="handleRawBack">
<!--el-button v-if="($route.query && $route.query.id) !== '2'" type="info"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="handleBindBarcode">绑定
</el-button-->
<el-button v-if="($route.query && $route.query.id) !== '2'" type="warning"
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="handleRawBack">返库
</el-button>
<el-button :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" type="success"
@click="finish">完成
</el-button>
<el-button :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" type="primary" @click="finish"></el-button>
<el-popover
v-if="($route.query && $route.query.id) !== '2'"
v-model="assignModel"
@ -61,11 +85,12 @@
<div style="float:right;margin-top: 8px">
<el-button type="primary" :loading="submitAssignLoading" @click="completeStation"> </el-button>
</div>
<el-button slot="reference" type="success" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode">下发
</el-button>
<!--el-button slot="reference" type="success" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode">下发
</el-button-->
</el-popover>
</div>
</div>
</div>
@ -156,19 +181,10 @@
size="small"
style="margin-right: 12px"
type="text"
@click="SOP(scope.row)"
@click="SOP(scope.row)"
>
SOP预览
</el-button>
<el-button
v-if="($route.query && $route.query.id) !== '2'"
size="small"
style="margin-right: 12px"
type="text"
@click="print(scope.row)"
>
条码打印
</el-button>
<!-- <el-button-->
<!-- size="small"-->
<!-- type="text"-->
@ -200,7 +216,7 @@
trigger="click">
<div>
<div style="margin: 15px 0;">
<el-input placeholder="请扫描或输入物料条码" v-model="input1" class="input-with-select">
<el-input placeholder="请扫描或输入背板条码" v-model="input1" class="input-with-select">
<el-button slot="append" icon="el-icon-full-screen"></el-button>
</el-input>
</div>
@ -339,7 +355,7 @@
</el-dialog>
<el-dialog :visible.sync="printModel" class="dialog" title="条码打印" width="80%">
<div >
<div>
<PrintPage :defineData="PrintData" v-if="printModel"/>
</div>
<div slot="footer" class="dialog-footer">
@ -353,7 +369,7 @@
title="柜体绑定"
width="40%">
<el-form ref="bindBarcodeForm" :model="bindBarcodeForm" :rules="bindBarcodeRules" label-width="80px">
<el-form-item label="成品条码" prop="productBarcode">
<el-form-item label="背板条码" prop="productBarcode">
<el-input v-model="bindBarcodeForm.productBarcode"></el-input>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
@ -369,16 +385,16 @@
<el-dialog
:visible.sync="rawBackVisible"
title="柜体返库"
width="40%">
width="500px">
<el-form ref="rawBackForm" :model="rawBackForm" :rules="rawBackRules" label-width="80px">
<el-form-item label="返库仓库" prop="warehouseId">
<el-select v-model="rawBackForm.warehouseId" placeholder="请选择返库仓库">
<el-select v-model="rawBackForm.warehouseId" placeholder="请选择返库仓库" style="width:380px">
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
:value="item.warehouseId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="rawBackForm.materialBarcode"></el-input>
<el-form-item label="柜体条码" prop="materialBarcode">
<el-input v-model="rawBackForm.materialBarcode" suffix-icon="el-icon-full-screen" style="width:380px"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -413,34 +429,37 @@
</el-dialog>
<el-dialog :visible.sync="returnModelVisible" title="退料" width="25%">
<el-form ref="returnModelForm" :model="returnModelForm" label-width="80px" :rules="returnModelFormRules">
<el-form-item label="计划编号" >
<el-form-item label="计划编号">
<el-input v-model="returnModelForm.planCode" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="明细编号" >
<el-form-item label="明细编号">
<el-input v-model="returnModelForm.planDetailCode" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="成品" >
<el-form-item label="成品">
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="物料条码" >
<el-input placeholder="请输入内容" v-model="returnModelForm.materialBarcode" class="input-with-select" @blur="setReturnModelForm">
<el-form-item label="物料条码">
<el-input placeholder="请输入内容" v-model="returnModelForm.materialBarcode" class="input-with-select"
@blur="setReturnModelForm">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item label="仓库" >
<el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库" :disabled="!returnModelForm.materialBarcode">
<el-form-item label="仓库">
<el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库"
:disabled="!returnModelForm.materialBarcode">
<el-option :label="i.label" :key="i.value" :value="i.value" v-for="i in WarehousesList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="数量" >
<el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1" ></el-input-number>
<el-form-item label="数量">
<el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="退库类型" prop="taskType">
<el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型">
<el-option :label="i.label" :key="i.value" :value="i.value" v-for="i in dict.type.wms_raw_return_task_type"></el-option>
<el-option :label="i.label" :key="i.value" :value="i.value"
v-for="i in dict.type.wms_raw_return_task_type"></el-option>
</el-select>
</el-form-item>
<el-form-item label="申请原因" >
<el-form-item label="申请原因">
<el-input type="textarea" v-model="returnModelForm.applyReason" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
@ -549,6 +568,7 @@ import PrintPage from '@/views/mes/barcode/endProductIndex'
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
import {
getLoginStationInfo,
completeProductPlanDetail,
getNewestProductPlanDetail,
getProductPlans,
@ -559,7 +579,8 @@ import {
getWarehouses,
bindBarcode,
applyRawBack,
assignTask, scanMaterial2Confirm, applyRawReturn
assignTask, scanMaterial2Confirm, applyRawReturn,
getNewestOutstockCabinet,completeCollectMaterials,completeReturnMaterials
} from "@/api/board";
const setState = (e) => {
@ -580,7 +601,7 @@ export default {
Chart,
PrintPage
},
dicts: ['wms_raw_return_task_type','mes_safe_flag'],
dicts: ['wms_raw_return_task_type', 'mes_safe_flag'],
data() {
return {
fileList: [],
@ -588,9 +609,9 @@ export default {
pictureDetailModel: false,
dialogImageUrl: '',
returnModelVisible: false,
returnModelForm:{},
WarehousesList:[],
input1:null,
returnModelForm: {},
WarehousesList: [],
input1: null,
PrintData: {},
printModel: false,
assignModel: false,
@ -598,9 +619,9 @@ export default {
totalNum1: 0,
getMaterialsModel: false,
applyMaterialTitle: '',
planAmount : null,
maxPlanAmount : 1,
taskType:'',
planAmount: null,
maxPlanAmount: 1,
taskType: '',
dialogVisible: false,
form: {},
form1: {},
@ -622,20 +643,21 @@ export default {
materialConfirmForm: {
materialBarcode: null,
planId: null,
planDetailId:null,
checkAmount:null
planDetailId: null,
checkAmount: null
},
materialConfirmRules: {
materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" }
{required: true, message: "物料条码不能为空", trigger: "blur"}
],
checkAmount: [
{ required: true, message: "数量不能为空", trigger: "blur" }
{required: true, message: "数量不能为空", trigger: "blur"}
],
},
tableData: [],
nowStation: null,
loginStationInfo: {},
stationData: [
{
stationName: '五楼装配工位1',
@ -695,189 +717,203 @@ export default {
},
returnModelFormRules: {
taskType: [
{ required: true, message: '请选择退库类型', trigger: 'change' }
{required: true, message: '请选择退库类型', trigger: 'change'}
],
},
}
},
async mounted() {
setInterval(() => {
this.$notify.info({
title: '通知',
message: '通知公告',
position: 'bottom-right',
duration: 0
});
}, 60 * 1000)
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
this.tableClick(e.rows[0])
})
this.$refs.chart2.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
// setInterval(() => {
// this.$notify.info({
// title: '',
// message: '',
// position: 'bottom-right',
// duration: 0
// });
// }, 60 * 1000)
getLoginStationInfo().then(e => {
this.loginStationInfo = e.data;
this.getProductPlans();
this.getChartData();
});
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
methods: {
getProductPlans() {
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
this.tableClick(e.rows[0])
})
},
getChartData() {
this.$refs.chart2.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
splitLine: {
show: false
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
this.$refs.chart4.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
},
splitLine: {
show: false
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
this.$refs.chart4.setData({
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
}
},
splitLine: {
show: false
grid: {
left: '0',
right: '4%',
bottom: '0',
top: 20,
containLabel: true
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
xAxis: {
type: 'category',
data: [1, 2, 3, 4, 5, 6],
axisLine: {
lineStyle: {
color: 'white'
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
axisLabel: {
// interval: 0,
// rotate: 40,
textStyle: {
fontFamily: 'Microsoft YaHei'
}
}
},
yAxis: {
type: 'value',
axisLine: {
show: false,
lineStyle: {
color: 'white'
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
},
methods: {
splitLine: {
show: false
},
axisLabel: {}
},
series: [
{
name: '数量',
label: {
normal: {
show: true,
position: 'top',
textStyle: {
color: '#a8aab0',
fontStyle: 'normal',
fontFamily: '微软雅黑',
fontSize: 0.75 * vw
}
}
},
type: 'bar',
barWidth: '30%',
barMaxWidth: 50,
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#39ffff'
},
{
offset: 1,
color: '#5affa6'
}
])
}
},
data: [1, 2, 3, 4, 5, 6]
}
]
})
},
async logout() {
this.$confirm('确定退出系统吗?', '提示', {
@ -905,11 +941,11 @@ export default {
this.totalNum1 = Math.ceil(e.total / 5)
})
},
async startPlan(val,materialBarcode) {
async startPlan(val, materialBarcode) {
let data;
if(materialBarcode && materialBarcode!==''){
data = await scan2StartNextProductPlanDetail({planId: val.planId,materialBarcode:materialBarcode})
}else{
if (materialBarcode && materialBarcode !== '') {
data = await scan2StartNextProductPlanDetail({planId: val.planId, materialBarcode: materialBarcode})
} else {
data = await startNextProductPlanDetail({planId: val.planId})
}
@ -926,11 +962,11 @@ export default {
this.form.planDetailStatus = setState(data.data.planDetailStatus)
this.getInfo(val)
},
closePopover(){
closePopover() {
document.body.click()
},
async startPlan1(val) {
if(!this.input1 || this.input1==null || this.input1==undefined || this.input1==''){
if (!this.input1 || this.input1 == null || this.input1 == undefined || this.input1 == '') {
this.$modal.msgWarning("请扫描或输入物料条码");
return;
}
@ -959,7 +995,7 @@ export default {
this.form.materialCode = val.materialCode
this.form.materialName = val.materialName
this.form.saleOrderId = val.saleOrderId
if(data){
if (data) {
this.form.planDetailStatus = setState(data.planDetailStatus)
}
@ -1360,7 +1396,7 @@ export default {
this.applyMaterialTitle = "领料";
this.planAmount = null;
this.maxPlanAmount = 1000000000;
this.taskType='1';//
this.taskType = '1';//
}
this.searchMaterialValue = ''
@ -1373,6 +1409,8 @@ export default {
saleOrderId: this.form?.saleOrderId,
applyReason: '',
taskType: '1',
stationId :this.loginStationInfo.stationId,
endStationCode: this.loginStationInfo.stationCode,
wmsRawOutstockDetailList: []
}
//
@ -1430,9 +1468,17 @@ export default {
})
},
print(val) {
this.PrintData = val
this.printModel = true
print() {
getNewestOutstockCabinet({planDetailCode:this.form.planDetailCode}).then(response => {
if(!response.data){
this.$modal.msgWarning("请先领取柜体");
return;
}
this.PrintData = this.form
this.PrintData.bindBarcode = response.data.materialBatch;
this.PrintData.barcodeType = '4';//
this.printModel = true
});
},
assignClick() {
this.assignModel = true
@ -1516,14 +1562,13 @@ export default {
},
//
resetMaterialConfirm() {
this.materialConfirmForm = {
materialBarcode: null,
planId: null,
planDetailId:null,
checkAmount:null
planDetailId: null,
checkAmount: null
};
this.resetForm("materialConfirmForm");
},
@ -1533,14 +1578,14 @@ export default {
this.materialConfirmForm = {
materialBarcode: null,
planId: this.form.planId,
planDetailId:this.form.planDetailId,
checkAmount:null
planDetailId: this.form.planDetailId,
checkAmount: null
};
this.materialConfirmVisible = true;
},
submitMaterialConfirm(){
submitMaterialConfirm() {
this.$refs["materialConfirmForm"].validate(valid => {
if (valid) {
scanMaterial2Confirm(this.materialConfirmForm).then(response => {
@ -1551,7 +1596,7 @@ export default {
});
},
cancelMaterialConfirm(){
cancelMaterialConfirm() {
this.materialConfirmVisible = false;
this.resetMaterialConfirm();
},
@ -1559,29 +1604,29 @@ export default {
this.returnModelVisible = true
this.returnModelForm = this.form
},
setReturnModelForm(){
setReturnModelForm() {
getWarehouses({
warehouseFloor:5,
materialBarcode:this.returnModelForm.materialBarcode
}).then(e=>{
this.WarehousesList = e.data.map(v=>{
warehouseFloor: 5,
materialBarcode: this.returnModelForm.materialBarcode
}).then(e => {
this.WarehousesList = e.data.map(v => {
return {
label:v.warehouseName,
value:v.warehouseId,
label: v.warehouseName,
value: v.warehouseId,
}
})
})
},
returnModelConfirm(){
returnModelConfirm() {
this.$refs.returnModelForm.validate((valid) => {
if (valid) {
let data = {}
let keys = ['warehouseId','planCode','planDetailCode','productId','materialBarcode','planAmount','taskType','applyReason']
keys.forEach(v=>{
let keys = ['warehouseId', 'planCode', 'planDetailCode', 'productId', 'materialBarcode', 'planAmount', 'taskType', 'applyReason']
keys.forEach(v => {
data[v] = this.returnModelForm[v]
})
applyRawReturn(data).then(v=>{
if(v.code === 200){
applyRawReturn(data).then(v => {
if (v.code === 200) {
this.$message({
message: '退库成功',
type: 'success'
@ -1661,6 +1706,18 @@ export default {
return ['png', 'jpg', 'jpeg'].includes(name.toLowerCase())
},
completeCollectMaterials() {
completeCollectMaterials({endStationCode:this.loginStationInfo.stationCode}).then(v => {
this.$modal.msgSuccess("操作成功");
})
},
completeReturnMaterials() {
completeReturnMaterials({endStationCode:this.loginStationInfo.stationCode}).then(v => {
this.$modal.msgSuccess("操作成功");
})
},
}
}
</script>

@ -409,7 +409,7 @@
width="40%">
<el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="80px">
<el-form-item label="成品条码" prop="materialBarcode">
<el-input v-model="productInstockForm.materialBarcode" suffix-icon="el-icon-camera"></el-input>
<el-input v-model="productInstockForm.materialBarcode" suffix-icon="el-icon-full-screen"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -434,7 +434,7 @@
<el-input v-model="materialConfirmForm.planDetailCode" disabled></el-input>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="materialConfirmForm.materialBarcode" suffix-icon="el-icon-camera"></el-input>
<el-input v-model="materialConfirmForm.materialBarcode" suffix-icon="el-icon-full-screen"></el-input>
</el-form-item>
<el-form-item label="数量" prop="checkAmount">
<el-input v-model="materialConfirmForm.checkAmount" disabled></el-input>
@ -458,7 +458,7 @@
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
</el-form-item-->
<el-form-item label="物料条码">
<el-input placeholder="请扫描或输入物料条码" v-model="returnModelForm.materialBarcode" suffix-icon="el-icon-camera">
<el-input placeholder="请扫描或输入物料条码" v-model="returnModelForm.materialBarcode" suffix-icon="el-icon-full-screen">
</el-input>
</el-form-item>
<el-form-item label="仓库">

@ -325,7 +325,7 @@
width="40%">
<el-form ref="productInstockForm" :model="productInstockForm" :rules="productInstockRules" label-width="80px">
<el-form-item label="成品条码" prop="materialBarcode">
<el-input v-model="productInstockForm.materialBarcode" suffix-icon="el-icon-camera"></el-input>
<el-input v-model="productInstockForm.materialBarcode" suffix-icon="el-icon-full-screen"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -370,7 +370,7 @@
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
</el-form-item-->
<el-form-item label="物料条码">
<el-input placeholder="请扫描或输入物料条码" v-model="returnModelForm.materialBarcode" suffix-icon="el-icon-camera">
<el-input placeholder="请扫描或输入物料条码" v-model="returnModelForm.materialBarcode" suffix-icon="el-icon-full-screen">
</el-input>
</el-form-item>
<el-form-item label="仓库">

@ -197,11 +197,11 @@
<el-form ref="wmsForm" :model="wmsForm" :rules="wmsRules" label-width="80px">
<el-form-item label="库位编码" prop="locationCode">
<el-input v-model="wmsForm.locationCode" ref="locationCodeRef" autocomplete="off" placeholder="请扫描或输入库位编码"
@focus="handleLocationCodeFocus" @blur="handleLocationCodeBlur" suffix-icon="el-icon-camera"></el-input>
@focus="handleLocationCodeFocus" @blur="handleLocationCodeBlur" suffix-icon="el-icon-full-screen"></el-input>
</el-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" autocomplete="off" placeholder="请扫描或输入物料条码"
@focus="handleMaterialBarcodeFocus" @blur="handleMaterialBarcodeBlur" suffix-icon="el-icon-camera"></el-input>
@focus="handleMaterialBarcodeFocus" @blur="handleMaterialBarcodeBlur" suffix-icon="el-icon-full-screen"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">

@ -26,8 +26,21 @@
size="mini"
type="primary"
@click="handleAdd"
v-if = "addBarcodeBtnVisible"
>新增条码
v-if="addBarcodeBtnVisible"
>{{addBtnTitle}}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['mes:barcode:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleDoorPlaneAdd"
v-if="addDoorBarcodeBtnVisible"
>新增门板条码
</el-button>
</el-col>
@ -72,7 +85,8 @@
<span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column v-if="columns[16].visible" align="center" label="最晚出库日期" prop="lastOutstockDate" width="180">
<el-table-column v-if="columns[16].visible" align="center" label="最晚出库日期" prop="lastOutstockDate"
width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastOutstockDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
@ -117,16 +131,16 @@
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="生产计划编号" prop="planCode">
<el-input v-model="form.planCode" :disabled = "true">
<el-input v-model="form.planCode" :disabled="true">
</el-input>
</el-form-item>
<el-form-item label="计划明细编号" prop="planDetailCode">
<el-input v-model="form.planDetailCode" :disabled = "true">
<el-input v-model="form.planDetailCode" :disabled="true">
</el-input>
</el-form-item>
<!-- <el-form-item label="销售订单编号" prop="saleorderCode">-->
<!-- <el-input v-model="form.saleorderCode" :disabled="true" placeholder="请输入销售订单编号"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="销售订单编号" prop="saleorderCode">-->
<!-- <el-input v-model="form.saleorderCode" :disabled="true" placeholder="请输入销售订单编号"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="条码类型" prop="barcodeType">-->
<!-- <el-radio-group v-model="form.barcodeType">-->
<!-- <el-radio-->
@ -154,10 +168,24 @@
<!-- <el-form-item label="供应商ID" prop="manufacturerId">-->
<!-- <el-input v-model="form.manufacturerId" placeholder="请输入供应商ID" />-->
<!-- </el-form-item>-->
<!--el-form-item label="条码类型" prop="barcodeType">
<el-checkbox-group v-model="form.barcodeType">
<el-checkbox
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.value">{{ dict.label }}</el-checkbox>
</el-checkbox-group>
</el-form-item-->
<el-form-item label="数量" prop="amount">
<el-input-number v-model="form.amount" :min="0" placeholder="请输入数量" :disabled="true"/>
</el-form-item>
<el-form-item label="绑定柜体码" prop="bindBarcode">
<el-input v-model="form.bindBarcode" :disabled="true" v-if="this.form.barcodeType === this.BARCODE_TYPE.BACK_PLANE || this.form.barcodeType === this.BARCODE_TYPE.DOOR">
</el-input>
</el-form-item>
<el-form-item label="生产日期" prop="productionDate">
<el-date-picker v-model="form.productionDate"
clearable
@ -224,12 +252,19 @@
</template>
<script>
import {listProductBarcode, getBarcode, delBarcode, addProductBarcode, printProductBarcodes,regenerateProductBarcode} from "@/api/mes/barcode";
import {
listProductBarcode,
getBarcode,
delBarcode,
addProductBarcode,
printProductBarcodes,
regenerateProductBarcode
} from "@/api/mes/barcode";
import addProductPlan from '@//views/mes/productplan/addProductPlan.vue';
export default {
name: "Barcode",
dicts: ['bind_status', 'active_flag', 'barcode_type','mes_print_flag'],
dicts: ['bind_status', 'active_flag', 'barcode_type', 'mes_print_flag'],
components: {
'add-ProductPlan': addProductPlan,
},
@ -256,6 +291,7 @@ export default {
title: "",
//
open: false,
addBtnTitle:'新增条码',
//
queryParams: {
pageNum: 1,
@ -301,6 +337,9 @@ export default {
barcodeType: [
{required: true, message: "条码类型不能为空", trigger: "change"}
],
bindBarcode: [
{required: true, message: "请先领取柜体", trigger: "change"}
],
materialId: [
{required: true, message: "物料ID不能为空", trigger: "blur"}
],
@ -338,7 +377,16 @@ export default {
],
addBarcodeBtnVisible: false,
addDoorBarcodeBtnVisible:false,
batchPrintBtnDisabled: false,
BARCODE_TYPE: {
PRODUCT: '3',//
BACK_PLANE: '4',//
DOOR :'5'//
}
};
},
mounted() {
@ -365,15 +413,26 @@ export default {
// },
methods: {
getData() {
let barcodeType = this.defineData.barcodeType ? this.defineData.barcodeType : this.BARCODE_TYPE.PRODUCT;
let bindBarcode = this.defineData.bindBarcode ? this.defineData.bindBarcode : '';
if(barcodeType === this.BARCODE_TYPE.BACK_PLANE){
this.addBtnTitle = "新增背板条码";
}
this.form = {
planId: this.defineData.planId,
planCode: this.defineData.planCode,
planDetailCode: this.defineData.planDetailCode,
batchFlag:'0',
barcodeType:'3',
amount :1,
batchFlag: '0',
bindBarcode: bindBarcode,
barcodeType: barcodeType,
amount: 1,
}
this.queryParams.planDetailCode = this.defineData.planDetailCode;
if(barcodeType !==this.BARCODE_TYPE.PRODUCT){
this.queryParams.barcodeType = null;
this.queryParams.barcodeTypeStr = this.BARCODE_TYPE.DOOR+","+this.BARCODE_TYPE.BACK_PLANE;
}
this.queryParams.planDetailCode = this.defineData.planDetailCode;
},
/** 查询条码信息列表 */
@ -382,10 +441,23 @@ export default {
listProductBarcode(this.queryParams).then(response => {
this.barcodeList = response.rows;
this.total = response.total;
if(this.total && this.total >0){
this.addBarcodeBtnVisible = false;
}else{
if (this.total && this.total > 0) {
if(this.queryParams.barcodeTypeStr){
this.addBarcodeBtnVisible = true;
this.addDoorBarcodeBtnVisible = true;
this.barcodeList.forEach(e =>{
if(e.barcodeType === this.BARCODE_TYPE.BACK_PLANE){
this.addBarcodeBtnVisible = false;
}else if(e.barcodeType === this.BARCODE_TYPE.DOOR){
this.addDoorBarcodeBtnVisible = false;
}
})
}else{
this.addBarcodeBtnVisible = false;
}
} else {
this.addBarcodeBtnVisible = true;
this.addDoorBarcodeBtnVisible = true;
this.handleAdd();
}
this.loading = false;
@ -472,7 +544,18 @@ export default {
this.getData()
}
this.open = true;
this.title = "添加成品条码信息";
this.title = "添加条码信息";
},
/** 新增门板按钮操作 */
handleDoorPlaneAdd() {
this.reset();
if (this.defineData?.planCode) {
this.getData()
this.form.barcodeType = this.BARCODE_TYPE.DOOR;
}
this.open = true;
this.title = "添加条码信息";
},
/** 打印条码按钮操作 */
@ -516,11 +599,11 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
addProductBarcode(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
addProductBarcode(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
});
},
@ -550,7 +633,11 @@ export default {
const barcodeType = row.barcodeType;
this.$modal.confirm('重新生成后之前的条码将会作废,是否确认重新生成条码内容为"' + barcodeInfo + '"的数据项?').then(function () {
return regenerateProductBarcode({"barcodeId": barcodeId, "barcodeInfo": barcodeInfo, "barcodeType": barcodeType});
return regenerateProductBarcode({
"barcodeId": barcodeId,
"barcodeInfo": barcodeInfo,
"barcodeType": barcodeType
});
}).then(() => {
this.getList();
this.$modal.msgSuccess("重新生成成功");

Loading…
Cancel
Save