车间:四楼板材领料和板材入口完成
WMS:四楼板材领料和板材入口接口完成
master
xins 8 months ago
parent c644b07717
commit e6d118f911

@ -30,6 +30,9 @@ public class WmsApiController extends BaseController {
@Autowired
private IWmsRawOutstockService wmsRawOutstockService;
@Autowired
private IWmsRawInstockService wmsRawInstockService;
@Autowired
private IWmsRawReturnService wmsRawReturnService;
@ -82,4 +85,26 @@ public class WmsApiController extends BaseController {
return toAjax(wmsRawReturnService.applyRawReturn(wmsRawReturns));
}
/**
*
*/
// @RequiresPermissions("wms:mobile:addrawinstock")
@Log(title = "原材料入库记录", businessType = BusinessType.INSERT)
@PostMapping(("/addRawInstock"))
public AjaxResult addRawInstock(@Validated @RequestBody WmsRawInstockVo wmsRawInstockVo) {
return toAjax(wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo));
}
/**
*
*/
@Log(title = "原材料出库记录", businessType = BusinessType.CONFIRM)
@PostMapping(("/directRawOutstock"))
public AjaxResult directRawOutstock(@RequestBody WmsRawOutstock wmsRawOutstock) {
return toAjax(wmsRawOutstockService.directRawOutstock(wmsRawOutstock));
}
}

@ -73,8 +73,8 @@ public class WmsRawOutstock extends BaseEntity {
/**
* ID,id
*/
@Excel(name = "成品ID,关联物料表物料id")
private Long productId;
@Excel(name = "物料ID,关联物料表物料id")
private Long materialId;
/** 物料批次 */
@Excel(name = "物料批次")
@ -204,6 +204,8 @@ public class WmsRawOutstock extends BaseEntity {
*/
private String executeStatusStr;
private String materialBarcode;
/**
*
*/
@ -281,12 +283,12 @@ public class WmsRawOutstock extends BaseEntity {
return stationId;
}
public void setProductId(Long productId) {
this.productId = productId;
public Long getMaterialId() {
return materialId;
}
public Long getProductId() {
return productId;
public void setMaterialId(Long materialId) {
this.materialId = materialId;
}
public String getMaterialBatch() {
@ -505,6 +507,14 @@ public class WmsRawOutstock extends BaseEntity {
this.executeStatusStr = executeStatusStr;
}
public String getMaterialBarcode() {
return materialBarcode;
}
public void setMaterialBarcode(String materialBarcode) {
this.materialBarcode = materialBarcode;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
@ -516,7 +526,7 @@ public class WmsRawOutstock extends BaseEntity {
.append("planCode", getPlanCode())
.append("planDetailCode", getPlanDetailCode())
.append("stationId", getStationId())
.append("productId", getProductId())
.append("materialId", getMaterialId())
.append("operationType", getOperationType())
.append("taskType", getTaskType())
.append("applyReason", getApplyReason())

@ -125,4 +125,11 @@ public interface IWmsRawOutstockService
* @return
*/
public int assembleOutstock(WmsAssembleOutstockVo wmsAssembleOutstockVo);
/**
*
* @param wmsRawOutstock
* @return
*/
public int directRawOutstock(WmsRawOutstock wmsRawOutstock);
}

@ -147,7 +147,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
BigDecimal instockAmount = wmsRawInstockVo.getInstockAmount();
if (baseBarcodeInfo.getBatchFlag().equals(MesConstants.IS_BATCH)) {
if (instockAmount.compareTo(BigDecimal.ONE) <= 0) {
if (instockAmount.compareTo(BigDecimal.ONE) < 0) {
throw new ServiceException("入库数量需大于等于1");
}
} else {

@ -361,7 +361,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstock.setUpdateBy(userName);
wmsRawOutstockMapper.updateWmsRawOutstock(wmsRawOutstock);
insertRawOutstockDetail(wmsRawOutstock, materialBarcode, batchCode,userName, currentDate);
insertRawOutstockDetail(wmsRawOutstock, materialBarcode, batchCode, userName, currentDate);
updateRawStock(locationCode, batchCode, outstockAmount, userName, currentDate);
@ -372,9 +372,10 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
String userName, Date currentDate) {
WmsRawOutstockDetail wmsRawOutstockDetail = new WmsRawOutstockDetail();
wmsRawOutstockDetail.setRawOutstockId(wmsRawOutstock.getRawOutstockId());
wmsRawOutstockDetail.setTaskCode(wmsRawOutstock.getTaskCode());
wmsRawOutstockDetail.setWarehouseId(wmsRawOutstock.getWarehouseId());
wmsRawOutstockDetail.setLocationCode(wmsRawOutstock.getLocationCode());
wmsRawOutstockDetail.setMaterialId(wmsRawOutstock.getProductId());
wmsRawOutstockDetail.setMaterialId(wmsRawOutstock.getMaterialId());
wmsRawOutstockDetail.setMaterialBarcode(materialBarcode);
wmsRawOutstockDetail.setInstockBatch(batchCode);
wmsRawOutstockDetail.setPlanAmount(BigDecimal.ONE);
@ -390,7 +391,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
public void updateRawStock(String locationCode, String batchCode, BigDecimal outstockAmount, String userName, Date currentDate) {
//更新原材料库存占用数量和总数量
//更新原材料库存占用数量和总数量
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, batchCode);
if (wmsRawStock == null) {
throw new ServiceException("没找到库存信息");
@ -403,12 +404,15 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
if (updatedTotalAmount.compareTo(BigDecimal.ZERO) < 0) {
throw new ServiceException("库存不足");
}
updatedTotalAmount = updatedTotalAmount.compareTo(BigDecimal.ZERO) >= 0 ? updatedTotalAmount : BigDecimal.ZERO;
wmsRawStock.setOccupyAmount(updatedOccupyAmount);
wmsRawStock.setTotalAmount(updatedTotalAmount);
wmsRawStock.setUpdateDate(currentDate);
wmsRawStock.setUpdateBy(userName);
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
if (updatedTotalAmount.compareTo(BigDecimal.ZERO) <= 0) {
wmsRawStockMapper.deleteWmsRawStockByRawStockId(wmsRawStock.getRawStockId());
} else {
wmsRawStock.setOccupyAmount(updatedOccupyAmount);
wmsRawStock.setTotalAmount(updatedTotalAmount);
wmsRawStock.setUpdateDate(currentDate);
wmsRawStock.setUpdateBy(userName);
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
}
}
}
@ -613,7 +617,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
toInsertedRawOutstock.setApplyBy(userName);
toInsertedRawOutstock.setApplyDate(currentDate);
toInsertedRawOutstock.setEndStationCode(SecurityUtils.getStationCode());
toInsertedRawOutstock.setProductId(materialId);
toInsertedRawOutstock.setMaterialId(materialId);
toInsertedRawOutstock.setOutstockAmount(planAmount);
toInsertedRawOutstock.setPlanCode(planCode);
toInsertedRawOutstock.setPlanDetailCode(planDetailCode);
@ -934,6 +938,9 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
public int assembleOutstock(WmsAssembleOutstockVo wmsAssembleOutstockVo) {
String materialBarcode = wmsAssembleOutstockVo.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料编码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料编码有误");
@ -965,7 +972,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstock.setOrderId(baseBarcodeInfo.getSaleOrderId());
wmsRawOutstock.setPlanCode(baseBarcodeInfo.getPlanCode());
wmsRawOutstock.setPlanDetailCode(baseBarcodeInfo.getPlanDetailCode());
wmsRawOutstock.setProductId(baseBarcodeInfo.getMaterialId());
wmsRawOutstock.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawOutstock.setMaterialBatch(bindBarcode);
wmsRawOutstock.setPalletInfoCode(baseBarcodeInfo.getPalletInfoCode());//在绑定时需要在条码信息中记录托盘码
wmsRawOutstock.setOutstockAmount(BigDecimal.ONE);
@ -982,4 +989,81 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
return 1;
}
/**
*
* @param wmsRawOutstock
* @return
*/
@Transactional
@Override
public int directRawOutstock(WmsRawOutstock wmsRawOutstock) {
//出库要求 0申请出库1申请审核出库2直接出库
String materialBarcode = wmsRawOutstock.getMaterialBarcode();
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料编码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料编码有误");
}
String locationCode = wmsRawOutstock.getLocationCode();
WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode);
if (baseLocation == null) {
throw new ServiceException("库位编码错误");
}
BigDecimal outstockAmount = wmsRawOutstock.getOutstockAmount();
String batchCode = baseBarcodeInfo.getBatchCode();
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
wmsRawOutstock.setTaskCode(Seq.getId(Seq.rawOutstockSeqType, Seq.rawOutstockSeqCode));
wmsRawOutstock.setWarehouseId(baseLocation.getWarehouseId());
wmsRawOutstock.setStationId(SecurityUtils.getStationId());
wmsRawOutstock.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawOutstock.setMaterialBatch(baseBarcodeInfo.getBatchCode());
wmsRawOutstock.setRealOutstockAmount(outstockAmount);
wmsRawOutstock.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsRawOutstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsRawOutstock.setApplyBy(userName);
wmsRawOutstock.setApplyDate(currentDate);
wmsRawOutstockMapper.insertWmsRawOutstock(wmsRawOutstock);
this.insertRawOutstockDetail(wmsRawOutstock, materialBarcode, batchCode,
userName, currentDate);
directOutstockUpdateRawStock(locationCode, batchCode, outstockAmount, userName, currentDate);
return 1;
}
public void directOutstockUpdateRawStock(String locationCode, String batchCode, BigDecimal outstockAmount,
String userName, Date currentDate) {
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, batchCode);
if (wmsRawStock == null) {
throw new ServiceException("没找到库存信息");
} else {
BigDecimal totalAmount = wmsRawStock.getTotalAmount() == null ? BigDecimal.ZERO : wmsRawStock.getTotalAmount();
BigDecimal updatedTotalAmount = totalAmount.subtract(outstockAmount);
if (updatedTotalAmount.compareTo(BigDecimal.ZERO) < 0) {
throw new ServiceException("库存不足");
}
if (updatedTotalAmount.compareTo(BigDecimal.ZERO) <= 0) {
wmsRawStockMapper.deleteWmsRawStockByRawStockId(wmsRawStock.getRawStockId());
} else {
wmsRawStock.setTotalAmount(updatedTotalAmount);
wmsRawStock.setUpdateDate(currentDate);
wmsRawStock.setUpdateBy(userName);
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
}
}
}
}

@ -13,7 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="planCode" column="plan_code" />
<result property="planDetailCode" column="plan_detail_code" />
<result property="stationId" column="station_id" />
<result property="productId" column="product_id" />
<result property="materialId" column="material_id" />
<result property="materialBatch" column="material_batch" />
<result property="palletInfoCode" column="pallet_info_code" />
<result property="outstockAmount" column="outstock_amount" />
@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialBarcode" column="sub_material_barcode" />
<result property="materialId" column="sub_material_id" />
<result property="instockBatch" column="sub_instock_batch" />
<result property="materialProductionDate" column="sub_material_production_Date" />
<result property="materialProductionDate" column="sub_material_production_date" />
<result property="planAmount" column="sub_plan_amount" />
<result property="outstockAmount" column="sub_outstock_amount" />
<result property="executeStatus" column="sub_execute_status" />
@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectWmsRawOutstockVo">
select raw_outstock_id, task_code, warehouse_id, location_code, order_id, plan_code, plan_detail_code, station_id, product_id, material_batch, pallet_info_code, outstock_amount, real_outstock_amount, end_station_code, operation_type, task_type, apply_reason, audit_reason, audit_status, execute_status, apply_by, apply_date, audit_by, audit_date, update_by, update_date, begin_time, end_time, erp_status, erp_amount from wms_raw_outstock
select raw_outstock_id, task_code, warehouse_id, location_code, order_id, plan_code, plan_detail_code, station_id, material_id, material_batch, pallet_info_code, outstock_amount, real_outstock_amount, end_station_code, operation_type, task_type, apply_reason, audit_reason, audit_status, execute_status, apply_by, apply_date, audit_by, audit_date, update_by, update_date, begin_time, end_time, erp_status, erp_amount from wms_raw_outstock
</sql>
<select id="selectWmsRawOutstockList" parameterType="WmsRawOutstock" resultMap="WmsRawOutstockResult">
@ -86,7 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planCode != null "> and plan_code = #{planCode}</if>
<if test="planDetailCode != null "> and plan_detail_code = #{planDetailCode}</if>
<if test="stationId != null "> and station_id = #{stationId}</if>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="materialId != null "> and material_id = #{materialId}</if>
<if test="operationType != null and operationType != ''"> and operation_type = #{operationType}</if>
<if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if>
<if test="applyReason != null and applyReason != ''"> and apply_reason = #{applyReason}</if>
@ -119,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planCode != null">plan_code,</if>
<if test="planDetailCode != null">plan_detail_code,</if>
<if test="stationId != null">station_id,</if>
<if test="productId != null">product_id,</if>
<if test="materialId != null">material_id,</if>
<if test="materialBatch != null">material_batch,</if>
<if test="palletInfoCode != null">pallet_info_code,</if>
<if test="outstockAmount != null">outstock_amount,</if>
@ -150,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planCode != null">#{planCode},</if>
<if test="planDetailCode != null">#{planDetailCode},</if>
<if test="stationId != null">#{stationId},</if>
<if test="productId != null">#{productId},</if>
<if test="materialId != null">#{materialId},</if>
<if test="materialBatch != null">#{materialBatch},</if>
<if test="palletInfoCode != null">#{palletInfoCode},</if>
<if test="outstockAmount != null">#{outstockAmount},</if>
@ -185,7 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="planCode != null">plan_code = #{planCode},</if>
<if test="planDetailCode != null">plan_detail_code = #{planDetailCode},</if>
<if test="stationId != null">station_id = #{stationId},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialBatch != null">material_batch = #{materialBatch},</if>
<if test="palletInfoCode != null">pallet_info_code = #{palletInfoCode},</if>
<if test="outstockAmount != null">outstock_amount = #{outstockAmount},</if>
@ -234,7 +234,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<insert id="batchWmsRawOutstockDetail">
insert into wms_raw_outstock_detail( raw_outstock_detail_id, raw_outstock_id, location_code, material_barcode, material_id, instock_batch, material_production_Date, plan_amount, outstock_amount, execute_status, erp_status, outstock_person, outstock_time, outstock_way, machine_name, quality_status, create_by, create_date, update_by, update_date, stack_amount) values
insert into wms_raw_outstock_detail( raw_outstock_detail_id, raw_outstock_id, location_code, material_barcode, material_id, instock_batch, material_production_date, plan_amount, outstock_amount, execute_status, erp_status, outstock_person, outstock_time, outstock_way, machine_name, quality_status, create_by, create_date, update_by, update_date, stack_amount) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.rawOutstockDetailId}, #{item.rawOutstockId}, #{item.locationCode}, #{item.materialBarcode}, #{item.materialId}, #{item.instockBatch}, #{item.materialProductionDate}, #{item.planAmount}, #{item.outstockAmount}, #{item.executeStatus}, #{item.erpStatus}, #{item.outstockPerson}, #{item.outstockTime}, #{item.outstockWay}, #{item.machineName}, #{item.qualityStatus}, #{item.createBy}, #{item.createDate}, #{item.updateBy}, #{item.updateDate}, #{item.stackAmount})
</foreach>
@ -244,7 +244,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectWmsRawOutstockJoinList" parameterType="WmsRawOutstock" resultMap="WmsRawOutstockResult">
select wro.raw_outstock_id, wro.task_code, wro.warehouse_id, wro.location_code, wro.order_id, wro.plan_code, wro.plan_detail_code, wro.station_id,wro.material_batch,
wro.product_id, wro.operation_type, wro.task_type, wro.apply_reason, wro.audit_reason, wro.audit_status, wro.execute_status, wro.apply_by, wro.apply_date,
wro.material_id, wro.operation_type, wro.task_type, wro.apply_reason, wro.audit_reason, wro.audit_status, wro.execute_status, wro.apply_by, wro.apply_date,
wro.audit_by, wro.audit_date, wro.update_by, wro.update_date, wro.begin_time, wro.end_time,wbw.warehouse_name
from wms_raw_outstock wro left join wms_base_warehouse wbw on wro.warehouse_id = wbw.warehouse_id
<where>
@ -282,7 +282,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wro.apply_by,wro.apply_date,wro.apply_reason,wro.audit_by,wro.audit_date,wro.audit_reason,wro.plan_code,wro.plan_detail_code,wro.audit_status,wro.task_type,
wro.execute_status,wro.erp_status,wro.erp_amount,
mbmi.material_code,mbmi.material_name
from wms_raw_outstock wro left join mes_base_material_info mbmi on wro.product_id = mbmi.material_id
from wms_raw_outstock wro left join mes_base_material_info mbmi on wro.material_id = mbmi.material_id
<where>
<if test="taskCode != null and taskCode != ''"> and wro.task_code = #{taskCode}</if>
<if test="auditStatus != null and auditStatus != ''"> and wro.audit_status = #{auditStatus}</if>
@ -291,9 +291,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="batchWmsRawOutstock">
insert into wms_raw_outstock(raw_outstock_id, task_code,warehouse_id,location_code,order_id,plan_code,plan_detail_code,station_id,product_id,material_batch,pallet_info_code,outstock_amount,end_station_code,operation_type,task_type,audit_status,execute_status,apply_by,apply_date) values
insert into wms_raw_outstock(raw_outstock_id, task_code,warehouse_id,location_code,order_id,plan_code,plan_detail_code,station_id,material_id,material_batch,pallet_info_code,outstock_amount,end_station_code,operation_type,task_type,audit_status,execute_status,apply_by,apply_date) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.rawOutstockId}, #{item.taskCode}, #{item.warehouseId}, #{item.locationCode}, #{item.orderId}, #{item.planCode}, #{item.planDetailCode}, #{item.stationId}, #{item.productId}, #{item.materialBatch}, #{item.palletInfoCode}, #{item.outstockAmount}, #{item.endStationCode}, #{item.operationType}, #{item.taskType}, #{item.auditStatus}, #{item.executeStatus}, #{item.applyBy}, #{item.applyDate})
( #{item.rawOutstockId}, #{item.taskCode}, #{item.warehouseId}, #{item.locationCode}, #{item.orderId}, #{item.planCode}, #{item.planDetailCode}, #{item.stationId}, #{item.materialId}, #{item.materialBatch}, #{item.palletInfoCode}, #{item.outstockAmount}, #{item.endStationCode}, #{item.operationType}, #{item.taskType}, #{item.auditStatus}, #{item.executeStatus}, #{item.applyBy}, #{item.applyDate})
</foreach>
</insert>
@ -316,7 +316,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wro.apply_by,wro.apply_date,wro.apply_reason,wro.audit_by,wro.audit_date,wro.audit_reason,wro.plan_code,wro.plan_detail_code,wro.audit_status,wro.task_type,
wro.execute_status,wro.erp_status,wro.erp_amount,
mbmi.material_code,mbmi.material_name
from wms_raw_outstock wro left join mes_base_material_info mbmi on wro.product_id = mbmi.material_id
from wms_raw_outstock wro left join mes_base_material_info mbmi on wro.material_id = mbmi.material_id
where wro.raw_outstock_id = #{rawOutstockId}
</select>

@ -46,3 +46,22 @@ export function getPlanDrawings(query) {
params: query
})
}
//激光切割工位板材入库
export function addRawInstock(data) {
return request({
url: '/wms/api/addRawInstock',
method: 'post',
data: data
})
}
//激光切割工位板材出库
export function directRawOutstock(data) {
return request({
url: '/wms/api/directRawOutstock',
method: 'post',
data: data
})
}

@ -33,6 +33,7 @@
<!-- </el-form-item>-->
</el-form>
<div style="text-align: center">
<el-button type="success" @click="handleRawOutstock"></el-button>
<el-button type="primary" @click="accomplishPlan"></el-button>
</div>
</div>
@ -185,24 +186,24 @@
<div class="bottom">
<el-row>
<el-button type="primary">首页</el-button>
<el-button type="success" @click="getMaterialsModel = true">板材领料</el-button>
<el-button type="success" @click="handleRawInstock"></el-button>
<el-button type="info">SOP预览</el-button>
<el-button type="danger">退出</el-button>
</el-row>
</div>
<el-dialog :visible.sync="getMaterialsModel" title="板材领料">
<el-form :model="form">
<el-form-item label="库位码" label-width="120px">
<el-input v-model="form.name" autocomplete="off"></el-input>
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="wmsForm" :model="wmsForm" :rules="wmsRules" label-width="80px">
<el-form-item label="库位编码" prop="locationCode">
<el-input v-model="wmsForm.locationCode" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="物料码" label-width="120px">
<el-input v-model="form.name" autocomplete="off"></el-input>
<el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="wmsForm.materialBarcode" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="getMaterialsModel = false"> </el-button>
<el-button type="primary" @click="getMaterialsModel = false"> </el-button>
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submitRawStock"> </el-button>
</div>
</el-dialog>
</div>
@ -217,6 +218,8 @@ import {
getProductPlans,
startNextProductPlanDetail,
getPlanDrawings,
addRawInstock,
directRawOutstock,
} from "@/api/board/laserLight";
const setState = (e) => {
@ -244,7 +247,23 @@ export default {
form: {},
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
tableData: [],
drawingList: []
drawingList: [],
title: '',
open: false,
stockType: '',
wmsForm:{
locationCode: null,
materialBarcode : null,
},//使
//
wmsRules: {
locationCode: [
{ required: true, message: "库位编码不能为空", trigger: "blur" }
],
materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" }
],
}
}
},
async mounted() {
@ -841,8 +860,64 @@ export default {
message: '已取消'
});
})
}
}
},
//
resetWmsForm() {
this.wmsForm = {
locationCode: undefined,
materialBarcode: undefined
};
this.resetForm("wmsForm");
},
handleRawInstock(){
this.resetWmsForm();
this.open = true;
this.stockType = "1";//
this.title = "板材入库";
},
handleRawOutstock(){
this.resetWmsForm();
this.open = true;
this.stockType = "2";//
this.title = "板材领料";
},
cancel(){
this.stockType = "";
this.open = false;
this.resetWmsForm();
},
submitRawStock(){
if(this.stockType == "1"){//
this.wmsForm.instockAmount = 1;
addRawInstock(this.wmsForm).then(response => {
this.$modal.msgSuccess("板材入库成功");
this.cancel();
});
} else if(this.stockType == "2"){//
this.wmsForm.outstockAmount = 1;
this.wmsForm.planCode = this.form.planCode;
this.wmsForm.planDetailCode = this.form.planDetailCode;
this.wmsForm.operationType = '1';//
this.wmsForm.taskType = '1';//
directRawOutstock(this.wmsForm).then(response => {
this.$modal.msgSuccess("板材领取成功");
this.cancel();
});
}
},
},
}
</script>
<style lang="less" scoped>

Loading…
Cancel
Save