仓储管理系统PDA接口:
	原材料采购入库
	人工原材料出库审批(审批不通过更新占用数量)
	人工原材料出库(更新库存和占用数量)
	人工原材料退库审批
	人工原材料退库(更新库存)
1.3.5
xins 11 months ago
parent 6bae9227ce
commit 066c854f11

@ -161,7 +161,7 @@ public class WmsMobileController extends BaseController {
@Log(title = "原材料退库记录", businessType = BusinessType.CONFIRM) @Log(title = "原材料退库记录", businessType = BusinessType.CONFIRM)
@PostMapping(("/confirmRawReturn")) @PostMapping(("/confirmRawReturn"))
public AjaxResult confirmRawReturn(@Validated @RequestBody WmsRawReturnConfirmVo wmsRawReturnConfirmVo) { public AjaxResult confirmRawReturn(@Validated @RequestBody WmsRawReturnConfirmVo wmsRawReturnConfirmVo) {
return toAjax(wmsRawReturnService.confirmWmsRawOutstock(wmsRawReturnConfirmVo)); return toAjax(wmsRawReturnService.confirmWmsRawReturn(wmsRawReturnConfirmVo));
} }
} }

@ -22,9 +22,9 @@ public class WmsRawOutstockConfirmVo {
@NotBlank(message = "库位编码必须输入") @NotBlank(message = "库位编码必须输入")
private String locationCode; private String locationCode;
//物料条码 //物料批次
@NotBlank(message = "物料条码必须输入") @NotBlank(message = "批次必须输入")
private String materialBarcode; private String instockBatch;
//原材料出库数量 //原材料出库数量
@NotNull(message = "原材料出库数量必须输入") @NotNull(message = "原材料出库数量必须输入")

@ -23,8 +23,8 @@ public class WmsRawReturnConfirmVo {
private String locationCode; private String locationCode;
//物料条码 //物料条码
@NotBlank(message = "物料条码必须输入") @NotBlank(message = "批次号必须输入")
private String materialBarcode; private String instockBatch;
//原材料出库数量 //原材料出库数量
@NotNull(message = "原材料退库数量必须输入") @NotNull(message = "原材料退库数量必须输入")

@ -85,7 +85,7 @@ public interface IWmsRawReturnService
* @param wmsRawReturnConfirmVo * @param wmsRawReturnConfirmVo
* @return * @return
*/ */
public int confirmWmsRawOutstock(WmsRawReturnConfirmVo wmsRawReturnConfirmVo); public int confirmWmsRawReturn(WmsRawReturnConfirmVo wmsRawReturnConfirmVo);
/** /**
* 退使 * 退使

@ -174,21 +174,52 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
* *
* *
* @param wmsRawOutstockAuditVo * @param wmsRawOutstockAuditVo
* @return
*/ */
@Transactional
@Override @Override
public int auditWmsRawOutstock(WmsRawOutstockAuditVo wmsRawOutstockAuditVo) { public int auditWmsRawOutstock(WmsRawOutstockAuditVo wmsRawOutstockAuditVo) {
String auditStatus = wmsRawOutstockAuditVo.getAuditStatus(); String auditStatus = wmsRawOutstockAuditVo.getAuditStatus();
String auditReason = wmsRawOutstockAuditVo.getAuditReason(); String auditReason = wmsRawOutstockAuditVo.getAuditReason();
if (WmsConstants.RAW_OUTSTOCK_AUDIT_STATUS_FAIL.equals(auditStatus) && StringUtils.isEmpty(auditReason)) { Date currentDate = new Date();
throw new ServiceException("请输入审核意见"); String userName = SecurityUtils.getUsername();
}
WmsRawOutstock wmsRawOutstock = wmsRawOutstockMapper.selectWmsRawOutstockByRawOutstockId(wmsRawOutstockAuditVo.getRawOutstockId()); WmsRawOutstock wmsRawOutstock = wmsRawOutstockMapper.selectWmsRawOutstockByRawOutstockId(wmsRawOutstockAuditVo.getRawOutstockId());
wmsRawOutstock.setAuditStatus(auditStatus); wmsRawOutstock.setAuditStatus(auditStatus);
wmsRawOutstock.setAuditReason(auditReason); wmsRawOutstock.setAuditReason(auditReason);
wmsRawOutstock.setAuditBy(SecurityUtils.getUsername()); wmsRawOutstock.setAuditBy(SecurityUtils.getUsername());
wmsRawOutstock.setAuditDate(new Date()); wmsRawOutstock.setAuditDate(new Date());
//审核不通过,需要有审核意见,并且需要更新库位占用数量。
if (auditStatus.equalsIgnoreCase(WmsConstants.RAW_OUTSTOCK_AUDIT_STATUS_FAIL)) {
if (StringUtils.isEmpty(auditReason)) {
throw new ServiceException("请输入审核意见");
}
List<WmsRawOutstockDetail> wmsRawOutstockDetails = wmsRawOutstock.getWmsRawOutstockDetailList();
wmsRawOutstockDetails.forEach(wmsRawOutstockDetail -> {
String locationCode = wmsRawOutstockDetail.getLocationCode();
String instockBatch = wmsRawOutstockDetail.getInstockBatch();
BigDecimal planAmount = wmsRawOutstockDetail.getPlanAmount();
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, instockBatch);
if (wmsRawStock != null) {
BigDecimal occupyAmount = wmsRawStock.getOccupyAmount() == null ?
BigDecimal.ZERO : wmsRawStock.getOccupyAmount();
if (occupyAmount.compareTo(planAmount) >= 0) {
wmsRawStock.setOccupyAmount(occupyAmount.subtract(planAmount));
wmsRawStock.setUpdateBy(userName);
wmsRawStock.setUpdateDate(currentDate);
} else {
wmsRawStock.setOccupyAmount(BigDecimal.ZERO);
wmsRawStock.setUpdateBy(userName);
wmsRawStock.setUpdateDate(currentDate);
}
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
}
});
}
return wmsRawOutstockMapper.updateWmsRawOutstock(wmsRawOutstock); return wmsRawOutstockMapper.updateWmsRawOutstock(wmsRawOutstock);
} }
/** /**
@ -202,12 +233,12 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
public int confirmWmsRawOutstock(WmsRawOutstockConfirmVo wmsRawOutstockConfirmVo) { public int confirmWmsRawOutstock(WmsRawOutstockConfirmVo wmsRawOutstockConfirmVo) {
Long rawOutstockDetailId = wmsRawOutstockConfirmVo.getRawOutstockDetailId(); Long rawOutstockDetailId = wmsRawOutstockConfirmVo.getRawOutstockDetailId();
String locationCode = wmsRawOutstockConfirmVo.getLocationCode(); String locationCode = wmsRawOutstockConfirmVo.getLocationCode();
String materialBarcode = wmsRawOutstockConfirmVo.getMaterialBarcode(); String instockBatch = wmsRawOutstockConfirmVo.getInstockBatch();
BigDecimal outstockAmount = wmsRawOutstockConfirmVo.getOutstockAmount(); BigDecimal outstockAmount = wmsRawOutstockConfirmVo.getOutstockAmount();
//判断是否有此出库任务,人工出库的同一个出库记录同一个库位、同一个物料对应一个明细agv的有可能是多个 //判断是否有此出库任务,人工出库的同一个出库记录同一个库位、同一个物料对应一个明细agv的有可能是多个
WmsRawOutstockDetail queryRawOutstockDetail = new WmsRawOutstockDetail(); WmsRawOutstockDetail queryRawOutstockDetail = new WmsRawOutstockDetail();
queryRawOutstockDetail.setLocationCode(locationCode); queryRawOutstockDetail.setLocationCode(locationCode);
queryRawOutstockDetail.setMaterialBarcode(materialBarcode); queryRawOutstockDetail.setInstockBatch(instockBatch);
List<WmsRawOutstockDetail> wmsRawOutstockDetails = wmsRawOutstockDetailMapper.selectWmsRawOutstockDetailList(queryRawOutstockDetail); List<WmsRawOutstockDetail> wmsRawOutstockDetails = wmsRawOutstockDetailMapper.selectWmsRawOutstockDetailList(queryRawOutstockDetail);
WmsRawOutstockDetail wmsRawOutstockDetail = new WmsRawOutstockDetail(); WmsRawOutstockDetail wmsRawOutstockDetail = new WmsRawOutstockDetail();
if (wmsRawOutstockDetails == null || wmsRawOutstockDetails.isEmpty()) { if (wmsRawOutstockDetails == null || wmsRawOutstockDetails.isEmpty()) {
@ -262,6 +293,24 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawOutstockDetail.setUpdateBy(userName); wmsRawOutstockDetail.setUpdateBy(userName);
} }
//更新原材料库存占用数量和总数量
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, instockBatch);
if (wmsRawStock == null) {
throw new ServiceException("数据异常");
} else {
BigDecimal totalAmount = wmsRawStock.getTotalAmount() == null ? BigDecimal.ZERO : wmsRawStock.getTotalAmount();
BigDecimal occupyAmount = wmsRawStock.getOccupyAmount() == null ? BigDecimal.ZERO : wmsRawStock.getOccupyAmount();
BigDecimal updatedOccupyAmount = occupyAmount.subtract(outstockAmount);
BigDecimal updatedTotalAmount = totalAmount.subtract(outstockAmount);
updatedOccupyAmount = updatedOccupyAmount.compareTo(BigDecimal.ZERO) >= 0 ? updatedOccupyAmount : BigDecimal.ZERO;
updatedTotalAmount = updatedTotalAmount.compareTo(BigDecimal.ZERO) >= 0 ? updatedTotalAmount : BigDecimal.ZERO;
wmsRawStock.setOccupyAmount(updatedOccupyAmount);
wmsRawStock.setTotalAmount(updatedTotalAmount);
wmsRawStock.setUpdateDate(currentDate);
wmsRawStock.setUpdateBy(userName);
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
}
wmsRawOutstockDetailMapper.updateWmsRawOutstockDetail(wmsRawOutstockDetail); wmsRawOutstockDetailMapper.updateWmsRawOutstockDetail(wmsRawOutstockDetail);
//todo 同步erp //todo 同步erp
@ -438,43 +487,4 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
} }
@Transactional
public int auditRawOutstock(WmsRawOutstock wmsRawOutstock) {
String auditStatus = wmsRawOutstock.getAuditStatus();
String auditReason = wmsRawOutstock.getAuditReason();
Date currentDate = new Date();
String userName = SecurityUtils.getUsername();
//审核不通过,需要有审核意见,并且需要更新库位占用数量。
if (auditStatus.equalsIgnoreCase(WmsConstants.RAW_OUTSTOCK_AUDIT_STATUS_FAIL)) {
if (StringUtils.isEmpty(auditReason)) {
throw new ServiceException("请输入审核意见");
}
List<WmsRawOutstockDetail> wmsRawOutstockDetails = wmsRawOutstock.getWmsRawOutstockDetailList();
wmsRawOutstockDetails.forEach(wmsRawOutstockDetail -> {
String locationCode = wmsRawOutstockDetail.getLocationCode();
String instockBatch = wmsRawOutstockDetail.getInstockBatch();
BigDecimal planAmount = wmsRawOutstockDetail.getPlanAmount();
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, instockBatch);
if (wmsRawStock != null) {
BigDecimal occupyAmount = wmsRawStock.getOccupyAmount() == null ?
BigDecimal.ZERO : wmsRawStock.getOccupyAmount();
if (occupyAmount.compareTo(planAmount) >= 0) {
wmsRawStock.setOccupyAmount(occupyAmount.subtract(planAmount));
wmsRawStock.setUpdateBy(userName);
wmsRawStock.setUpdateDate(currentDate);
} else {
wmsRawStock.setOccupyAmount(BigDecimal.ZERO);
wmsRawStock.setUpdateBy(userName);
wmsRawStock.setUpdateDate(currentDate);
}
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
}
});
}
return wmsRawOutstockMapper.updateWmsRawOutstock(wmsRawOutstock);
}
} }

@ -12,13 +12,13 @@ import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.RemoteMesService; import com.hw.mes.api.RemoteMesService;
import com.hw.mes.api.domain.MesBaseMaterialInfo; import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo; import com.hw.mes.api.domain.vo.MesBaseMaterialInfoVo;
import com.hw.wms.domain.WmsRawOutstock; import com.hw.wms.domain.*;
import com.hw.wms.domain.WmsRawOutstockDetail;
import com.hw.wms.domain.vo.WmsRawOutstockAuditVo; import com.hw.wms.domain.vo.WmsRawOutstockAuditVo;
import com.hw.wms.domain.vo.WmsRawOutstockConfirmVo; import com.hw.wms.domain.vo.WmsRawOutstockConfirmVo;
import com.hw.wms.domain.vo.WmsRawReturnAuditVo; import com.hw.wms.domain.vo.WmsRawReturnAuditVo;
import com.hw.wms.domain.vo.WmsRawReturnConfirmVo; import com.hw.wms.domain.vo.WmsRawReturnConfirmVo;
import com.hw.wms.mapper.WmsRawReturnDetailMapper; import com.hw.wms.mapper.WmsRawReturnDetailMapper;
import com.hw.wms.mapper.WmsRawStockMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -28,9 +28,7 @@ import java.util.stream.Collectors;
import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.hw.wms.domain.WmsRawReturnDetail;
import com.hw.wms.mapper.WmsRawReturnMapper; import com.hw.wms.mapper.WmsRawReturnMapper;
import com.hw.wms.domain.WmsRawReturn;
import com.hw.wms.service.IWmsRawReturnService; import com.hw.wms.service.IWmsRawReturnService;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -49,6 +47,9 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
@Autowired @Autowired
private WmsRawReturnDetailMapper wmsRawReturnDetailMapper; private WmsRawReturnDetailMapper wmsRawReturnDetailMapper;
@Autowired
private WmsRawStockMapper wmsRawStockMapper;
@Resource @Resource
private RemoteMesService remoteMesService; private RemoteMesService remoteMesService;
@ -212,15 +213,15 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
*/ */
@Transactional @Transactional
@Override @Override
public int confirmWmsRawOutstock(WmsRawReturnConfirmVo wmsRawReturnConfirmVo) { public int confirmWmsRawReturn(WmsRawReturnConfirmVo wmsRawReturnConfirmVo) {
Long rawReturnDetailId = wmsRawReturnConfirmVo.getRawReturnDetailId(); Long rawReturnDetailId = wmsRawReturnConfirmVo.getRawReturnDetailId();
String locationCode = wmsRawReturnConfirmVo.getLocationCode(); String locationCode = wmsRawReturnConfirmVo.getLocationCode();
String materialBarcode = wmsRawReturnConfirmVo.getMaterialBarcode(); String instockBatch = wmsRawReturnConfirmVo.getInstockBatch();
BigDecimal returnAmount = wmsRawReturnConfirmVo.getReturnAmount(); BigDecimal returnAmount = wmsRawReturnConfirmVo.getReturnAmount();
//判断是否有此退库任务,人工退库的同一个退库记录同一个库位、同一个物料对应一个明细agv的有可能是多个 //判断是否有此退库任务,人工退库的同一个退库记录同一个库位、同一个物料对应一个明细agv的有可能是多个
WmsRawReturnDetail queryRawReturnDetail = new WmsRawReturnDetail(); WmsRawReturnDetail queryRawReturnDetail = new WmsRawReturnDetail();
queryRawReturnDetail.setLocationCode(locationCode); queryRawReturnDetail.setLocationCode(locationCode);
queryRawReturnDetail.setMaterialBarcode(materialBarcode); queryRawReturnDetail.setInstockBatch(instockBatch);
List<WmsRawReturnDetail> wmsRawReturnDetails = wmsRawReturnDetailMapper.selectWmsRawReturnDetailList(queryRawReturnDetail); List<WmsRawReturnDetail> wmsRawReturnDetails = wmsRawReturnDetailMapper.selectWmsRawReturnDetailList(queryRawReturnDetail);
WmsRawReturnDetail wmsRawReturnDetail = new WmsRawReturnDetail(); WmsRawReturnDetail wmsRawReturnDetail = new WmsRawReturnDetail();
if (wmsRawReturnDetails == null || wmsRawReturnDetails.isEmpty()) { if (wmsRawReturnDetails == null || wmsRawReturnDetails.isEmpty()) {
@ -277,6 +278,19 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
wmsRawReturnDetailMapper.updateWmsRawReturnDetail(wmsRawReturnDetail); wmsRawReturnDetailMapper.updateWmsRawReturnDetail(wmsRawReturnDetail);
//更新原材料库存总数量
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByLocationAndBatch(locationCode, instockBatch);
if (wmsRawStock == null) {
throw new ServiceException("数据异常");
} else {
BigDecimal totalAmount = wmsRawStock.getTotalAmount() == null ? BigDecimal.ZERO : wmsRawStock.getTotalAmount();
BigDecimal updatedTotalAmount = totalAmount.add(returnAmount);
wmsRawStock.setTotalAmount(updatedTotalAmount);
wmsRawStock.setUpdateDate(currentDate);
wmsRawStock.setUpdateBy(userName);
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
}
//todo 同步erp //todo 同步erp
return 1; return 1;
} }
@ -288,8 +302,7 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
* @return 退 * @return 退
*/ */
@Override @Override
public List<WmsRawReturnDetail> selectAuditPassRawReturnDetails(WmsRawReturnDetail wmsRawReturnDetail) public List<WmsRawReturnDetail> selectAuditPassRawReturnDetails(WmsRawReturnDetail wmsRawReturnDetail) {
{
return wmsRawReturnDetailMapper.selectAuditPassRawReturnDetails(wmsRawReturnDetail); return wmsRawReturnDetailMapper.selectAuditPassRawReturnDetails(wmsRawReturnDetail);
} }

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询原材料出库记录列表
export function listRawoutstock(query) {
return request({
url: '/wms/rawoutstock/list',
method: 'get',
params: query
})
}
// 查询原材料出库记录详细
export function getRawoutstock(rawOutstockId) {
return request({
url: '/wms/rawoutstock/' + rawOutstockId,
method: 'get'
})
}
// 新增原材料出库记录
export function addRawoutstock(data) {
return request({
url: '/wms/rawoutstock',
method: 'post',
data: data
})
}
// 修改原材料出库记录
export function updateRawoutstock(data) {
return request({
url: '/wms/rawoutstock',
method: 'put',
data: data
})
}
// 删除原材料出库记录
export function delRawoutstock(rawOutstockId) {
return request({
url: '/wms/rawoutstock/' + rawOutstockId,
method: 'delete'
})
}

@ -0,0 +1,678 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="任务编号;移库时必须" prop="taskCode">
<el-input
v-model="queryParams.taskCode"
placeholder="请输入任务编号;移库时必须"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库ID;领料时需要保存" prop="warehouseId">
<el-input
v-model="queryParams.warehouseId"
placeholder="请输入仓库ID;领料时需要保存"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="库位编码;移库和合库时需要保存" prop="locationCode">
<el-input
v-model="queryParams.locationCode"
placeholder="请输入库位编码;移库和合库时需要保存"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单ID,关联pd_base_order_info的order_id" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入工单ID,关联pd_base_order_info的order_id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划ID,关联pd_base_plan_info的plan_id" prop="planId">
<el-input
v-model="queryParams.planId"
placeholder="请输入计划ID,关联pd_base_plan_info的plan_id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划明细ID,关联pd_base_plan_detail的plan_detail_id" prop="planDetailId">
<el-input
v-model="queryParams.planDetailId"
placeholder="请输入计划明细ID,关联pd_base_plan_detail的plan_detail_id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属工位关联pd_base_station_info的station_id" prop="stationId">
<el-input
v-model="queryParams.stationId"
placeholder="请输入所属工位关联pd_base_station_info的station_id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="成品ID,关联物料表物料id" prop="productId">
<el-input
v-model="queryParams.productId"
placeholder="请输入成品ID,关联物料表物料id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="申请人" prop="applyBy">
<el-input
v-model="queryParams.applyBy"
placeholder="请输入申请人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="申请时间" prop="applyDate">
<el-date-picker clearable
v-model="queryParams.applyDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择申请时间">
</el-date-picker>
</el-form-item>
<el-form-item label="审核人" prop="auditBy">
<el-input
v-model="queryParams.auditBy"
placeholder="请输入审核人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核时间" prop="auditDate">
<el-date-picker clearable
v-model="queryParams.auditDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择审核时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后更新时间" prop="updateDate">
<el-date-picker clearable
v-model="queryParams.updateDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="执行开始时间" prop="beginTime">
<el-date-picker clearable
v-model="queryParams.beginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择执行开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="执行结束时间" prop="endTime">
<el-date-picker clearable
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择执行结束时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['wms:rawoutstock:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['wms:rawoutstock:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['wms:rawoutstock:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['wms:rawoutstock:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="rawoutstockList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="原材料出库记录ID" align="center" prop="rawOutstockId" />
<el-table-column label="任务编号;移库时必须" align="center" prop="taskCode" />
<el-table-column label="仓库ID;领料时需要保存" align="center" prop="warehouseId" />
<el-table-column label="库位编码;移库和合库时需要保存" align="center" prop="locationCode" />
<el-table-column label="工单ID,关联pd_base_order_info的order_id" align="center" prop="orderId" />
<el-table-column label="计划ID,关联pd_base_plan_info的plan_id" align="center" prop="planId" />
<el-table-column label="计划明细ID,关联pd_base_plan_detail的plan_detail_id" align="center" prop="planDetailId" />
<el-table-column label="所属工位关联pd_base_station_info的station_id" align="center" prop="stationId" />
<el-table-column label="成品ID,关联物料表物料id" align="center" prop="productId" />
<el-table-column label="操作类型(0自动,1手动,2强制,3调度)" align="center" prop="operationType" />
<el-table-column label="任务类型(1生产领料,2移库出库,3合库出库,9其他领料)" align="center" prop="taskType" />
<el-table-column label="申请原因" align="center" prop="applyReason" />
<el-table-column label="审核原因" align="center" prop="auditReason" />
<el-table-column label="审核状态(0待审核,1审核通过,2审核未通过)" align="center" prop="auditStatus" />
<el-table-column label="执行状态(0待执行,1执行中,2执行完成)" align="center" prop="executeStatus" />
<el-table-column label="申请人" align="center" prop="applyBy" />
<el-table-column label="申请时间" align="center" prop="applyDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核人" align="center" prop="auditBy" />
<el-table-column label="审核时间" align="center" prop="auditDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.auditDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="最后更新时间" align="center" prop="updateDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="执行开始时间" align="center" prop="beginTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.beginTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="执行结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['wms:rawoutstock:edit']"
>明细</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['wms:rawoutstock:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['wms:rawoutstock:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改原材料出库记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务编号;移库时必须" prop="taskCode">
<el-input v-model="form.taskCode" placeholder="请输入任务编号;移库时必须" />
</el-form-item>
<el-form-item label="仓库ID;领料时需要保存" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID;领料时需要保存" />
</el-form-item>
<el-form-item label="库位编码;移库和合库时需要保存" prop="locationCode">
<el-input v-model="form.locationCode" placeholder="请输入库位编码;移库和合库时需要保存" />
</el-form-item>
<el-form-item label="工单ID,关联pd_base_order_info的order_id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单ID,关联pd_base_order_info的order_id" />
</el-form-item>
<el-form-item label="计划ID,关联pd_base_plan_info的plan_id" prop="planId">
<el-input v-model="form.planId" placeholder="请输入计划ID,关联pd_base_plan_info的plan_id" />
</el-form-item>
<el-form-item label="计划明细ID,关联pd_base_plan_detail的plan_detail_id" prop="planDetailId">
<el-input v-model="form.planDetailId" placeholder="请输入计划明细ID,关联pd_base_plan_detail的plan_detail_id" />
</el-form-item>
<el-form-item label="所属工位关联pd_base_station_info的station_id" prop="stationId">
<el-input v-model="form.stationId" placeholder="请输入所属工位关联pd_base_station_info的station_id" />
</el-form-item>
<el-form-item label="成品ID,关联物料表物料id" prop="productId">
<el-input v-model="form.productId" placeholder="请输入成品ID,关联物料表物料id" />
</el-form-item>
<el-form-item label="申请原因" prop="applyReason">
<el-input v-model="form.applyReason" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="审核原因" prop="auditReason">
<el-input v-model="form.auditReason" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="申请人" prop="applyBy">
<el-input v-model="form.applyBy" placeholder="请输入申请人" />
</el-form-item>
<el-form-item label="申请时间" prop="applyDate">
<el-date-picker clearable
v-model="form.applyDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择申请时间">
</el-date-picker>
</el-form-item>
<el-form-item label="审核人" prop="auditBy">
<el-input v-model="form.auditBy" placeholder="请输入审核人" />
</el-form-item>
<el-form-item label="审核时间" prop="auditDate">
<el-date-picker clearable
v-model="form.auditDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择审核时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后更新时间" prop="updateDate">
<el-date-picker clearable
v-model="form.updateDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="执行开始时间" prop="beginTime">
<el-date-picker clearable
v-model="form.beginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择执行开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="执行结束时间" prop="endTime">
<el-date-picker clearable
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择执行结束时间">
</el-date-picker>
</el-form-item>
<el-divider content-position="center">原材料出库记录明细信息</el-divider>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddWmsRawOutstockDetail"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteWmsRawOutstockDetail"></el-button>
</el-col>
</el-row>
<el-table :data="wmsRawOutstockDetailList" :row-class-name="rowWmsRawOutstockDetailIndex" @selection-change="handleWmsRawOutstockDetailSelectionChange" ref="wmsRawOutstockDetail">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="库位编码" prop="locationCode" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.locationCode" placeholder="请输入库位编码" />
</template>
</el-table-column>
<el-table-column label="物料条码" prop="materialBarcode" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.materialBarcode" placeholder="请输入物料条码" />
</template>
</el-table-column>
<el-table-column label="物料ID" prop="materialId" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.materialId" placeholder="请输入物料ID" />
</template>
</el-table-column>
<el-table-column label="批次;扫描条码时,从打印条码记录表中获取" prop="instockBatch" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.instockBatch" placeholder="请输入批次;扫描条码时,从打印条码记录表中获取" />
</template>
</el-table-column>
<el-table-column label="生产日期;扫描条码时,从打印条码记录表中获取" prop="materialProductionDate" width="240">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.materialProductionDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择生产日期;扫描条码时,从打印条码记录表中获取" />
</template>
</el-table-column>
<el-table-column label="计划数量" prop="planAmount" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.planAmount" placeholder="请输入计划数量" />
</template>
</el-table-column>
<el-table-column label="出库数量" prop="outstockAmount" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.outstockAmount" placeholder="请输入出库数量" />
</template>
</el-table-column>
<el-table-column label="执行状态(0待执行,1执行中,2执行完成)" prop="executeStatus" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.executeStatus" placeholder="请选择执行状态(0待执行,1执行中,2执行完成)">
<el-option label="请选择字典生成" value="" />
</el-select>
</template>
</el-table-column>
<el-table-column label="同步ERP状态(0:失败,1成功)" prop="erpStatus" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.erpStatus" placeholder="请选择同步ERP状态(0:失败,1成功)">
<el-option label="请选择字典生成" value="" />
</el-select>
</template>
</el-table-column>
<el-table-column label="出库人" prop="outstockPerson" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.outstockPerson" placeholder="请输入出库人" />
</template>
</el-table-column>
<el-table-column label="出库时间" prop="outstockTime" width="240">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.outstockTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择出库时间" />
</template>
</el-table-column>
<el-table-column label="出库方式" prop="outstockWay" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.outstockWay" placeholder="请输入出库方式" />
</template>
</el-table-column>
<el-table-column label="使用机台名称;出库扫描条码时,从打印条码记录表中获取" prop="machineName" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.machineName" placeholder="请输入使用机台名称;出库扫描条码时,从打印条码记录表中获取" />
</template>
</el-table-column>
<el-table-column label="质检状态(0:待质检,1:合格,2:NG)" prop="qualityStatus" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.qualityStatus" placeholder="请选择质检状态(0:待质检,1:合格,2:NG)">
<el-option label="请选择字典生成" value="" />
</el-select>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createDate" width="240">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.createDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择创建时间" />
</template>
</el-table-column>
<el-table-column label="最后更新时间" prop="updateDate" width="240">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.updateDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择最后更新时间" />
</template>
</el-table-column>
<el-table-column label="每托数量" prop="stackAmount" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.stackAmount" placeholder="请输入每托数量" />
</template>
</el-table-column>
</el-table>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listRawoutstock, getRawoutstock, delRawoutstock, addRawoutstock, updateRawoutstock } from "@/api/wms/rawoutstock";
export default {
name: "Rawoutstock",
data() {
return {
//
loading: true,
//
ids: [],
//
checkedWmsRawOutstockDetail: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
rawoutstockList: [],
//
wmsRawOutstockDetailList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
taskCode: null,
warehouseId: null,
locationCode: null,
orderId: null,
planId: null,
planDetailId: null,
stationId: null,
productId: null,
operationType: null,
taskType: null,
applyReason: null,
auditReason: null,
auditStatus: null,
executeStatus: null,
applyBy: null,
applyDate: null,
auditBy: null,
auditDate: null,
updateDate: null,
beginTime: null,
endTime: null
},
//
form: {},
//
rules: {
taskCode: [
{ required: true, message: "任务编号;移库时必须不能为空", trigger: "blur" }
],
warehouseId: [
{ required: true, message: "仓库ID;领料时需要保存不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询原材料出库记录列表 */
getList() {
this.loading = true;
listRawoutstock(this.queryParams).then(response => {
this.rawoutstockList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
rawOutstockId: null,
taskCode: null,
warehouseId: null,
locationCode: null,
orderId: null,
planId: null,
planDetailId: null,
stationId: null,
productId: null,
operationType: null,
taskType: null,
applyReason: null,
auditReason: null,
auditStatus: null,
executeStatus: null,
applyBy: null,
applyDate: null,
auditBy: null,
auditDate: null,
updateBy: null,
updateDate: null,
beginTime: null,
endTime: null
};
this.wmsRawOutstockDetailList = [];
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.rawOutstockId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加原材料出库记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const rawOutstockId = row.rawOutstockId || this.ids
getRawoutstock(rawOutstockId).then(response => {
this.form = response.data;
this.wmsRawOutstockDetailList = response.data.wmsRawOutstockDetailList;
this.open = true;
this.title = "修改原材料出库记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.wmsRawOutstockDetailList = this.wmsRawOutstockDetailList;
if (this.form.rawOutstockId != null) {
updateRawoutstock(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRawoutstock(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const rawOutstockIds = row.rawOutstockId || this.ids;
this.$modal.confirm('是否确认删除原材料出库记录编号为"' + rawOutstockIds + '"的数据项?').then(function() {
return delRawoutstock(rawOutstockIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 原材料出库记录明细序号 */
rowWmsRawOutstockDetailIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
},
/** 原材料出库记录明细添加按钮操作 */
handleAddWmsRawOutstockDetail() {
let obj = {};
obj.locationCode = "";
obj.materialBarcode = "";
obj.materialId = "";
obj.instockBatch = "";
obj.materialProductionDate = "";
obj.planAmount = "";
obj.outstockAmount = "";
obj.executeStatus = "";
obj.erpStatus = "";
obj.outstockPerson = "";
obj.outstockTime = "";
obj.outstockWay = "";
obj.machineName = "";
obj.qualityStatus = "";
obj.createDate = "";
obj.updateDate = "";
obj.stackAmount = "";
this.wmsRawOutstockDetailList.push(obj);
},
/** 原材料出库记录明细删除按钮操作 */
handleDeleteWmsRawOutstockDetail() {
if (this.checkedWmsRawOutstockDetail.length == 0) {
this.$modal.msgError("请先选择要删除的原材料出库记录明细数据");
} else {
const wmsRawOutstockDetailList = this.wmsRawOutstockDetailList;
const checkedWmsRawOutstockDetail = this.checkedWmsRawOutstockDetail;
this.wmsRawOutstockDetailList = wmsRawOutstockDetailList.filter(function(item) {
return checkedWmsRawOutstockDetail.indexOf(item.index) == -1
});
}
},
/** 复选框选中数据 */
handleWmsRawOutstockDetailSelectionChange(selection) {
this.checkedWmsRawOutstockDetail = selection.map(item => item.index)
},
/** 导出按钮操作 */
handleExport() {
this.download('wms/rawoutstock/export', {
...this.queryParams
}, `rawoutstock_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,678 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="任务编号;移库时必须" prop="taskCode">
<el-input
v-model="queryParams.taskCode"
placeholder="请输入任务编号;移库时必须"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="仓库ID;领料时需要保存" prop="warehouseId">
<el-input
v-model="queryParams.warehouseId"
placeholder="请输入仓库ID;领料时需要保存"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="库位编码;移库和合库时需要保存" prop="locationCode">
<el-input
v-model="queryParams.locationCode"
placeholder="请输入库位编码;移库和合库时需要保存"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单ID,关联pd_base_order_info的order_id" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入工单ID,关联pd_base_order_info的order_id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划ID,关联pd_base_plan_info的plan_id" prop="planId">
<el-input
v-model="queryParams.planId"
placeholder="请输入计划ID,关联pd_base_plan_info的plan_id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="计划明细ID,关联pd_base_plan_detail的plan_detail_id" prop="planDetailId">
<el-input
v-model="queryParams.planDetailId"
placeholder="请输入计划明细ID,关联pd_base_plan_detail的plan_detail_id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属工位关联pd_base_station_info的station_id" prop="stationId">
<el-input
v-model="queryParams.stationId"
placeholder="请输入所属工位关联pd_base_station_info的station_id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="成品ID,关联物料表物料id" prop="productId">
<el-input
v-model="queryParams.productId"
placeholder="请输入成品ID,关联物料表物料id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="申请人" prop="applyBy">
<el-input
v-model="queryParams.applyBy"
placeholder="请输入申请人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="申请时间" prop="applyDate">
<el-date-picker clearable
v-model="queryParams.applyDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择申请时间">
</el-date-picker>
</el-form-item>
<el-form-item label="审核人" prop="auditBy">
<el-input
v-model="queryParams.auditBy"
placeholder="请输入审核人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核时间" prop="auditDate">
<el-date-picker clearable
v-model="queryParams.auditDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择审核时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后更新时间" prop="updateDate">
<el-date-picker clearable
v-model="queryParams.updateDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="执行开始时间" prop="beginTime">
<el-date-picker clearable
v-model="queryParams.beginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择执行开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="执行结束时间" prop="endTime">
<el-date-picker clearable
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择执行结束时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['wms:rawoutstock:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['wms:rawoutstock:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['wms:rawoutstock:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['wms:rawoutstock:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="rawoutstockList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="原材料出库记录ID" align="center" prop="rawOutstockId" />
<el-table-column label="任务编号;移库时必须" align="center" prop="taskCode" />
<el-table-column label="仓库ID;领料时需要保存" align="center" prop="warehouseId" />
<el-table-column label="库位编码;移库和合库时需要保存" align="center" prop="locationCode" />
<el-table-column label="工单ID,关联pd_base_order_info的order_id" align="center" prop="orderId" />
<el-table-column label="计划ID,关联pd_base_plan_info的plan_id" align="center" prop="planId" />
<el-table-column label="计划明细ID,关联pd_base_plan_detail的plan_detail_id" align="center" prop="planDetailId" />
<el-table-column label="所属工位关联pd_base_station_info的station_id" align="center" prop="stationId" />
<el-table-column label="成品ID,关联物料表物料id" align="center" prop="productId" />
<el-table-column label="操作类型(0自动,1手动,2强制,3调度)" align="center" prop="operationType" />
<el-table-column label="任务类型(1生产领料,2移库出库,3合库出库,9其他领料)" align="center" prop="taskType" />
<el-table-column label="申请原因" align="center" prop="applyReason" />
<el-table-column label="审核原因" align="center" prop="auditReason" />
<el-table-column label="审核状态(0待审核,1审核通过,2审核未通过)" align="center" prop="auditStatus" />
<el-table-column label="执行状态(0待执行,1执行中,2执行完成)" align="center" prop="executeStatus" />
<el-table-column label="申请人" align="center" prop="applyBy" />
<el-table-column label="申请时间" align="center" prop="applyDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核人" align="center" prop="auditBy" />
<el-table-column label="审核时间" align="center" prop="auditDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.auditDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="最后更新时间" align="center" prop="updateDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="执行开始时间" align="center" prop="beginTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.beginTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="执行结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['wms:rawoutstock:edit']"
>明细</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['wms:rawoutstock:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['wms:rawoutstock:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改原材料出库记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="任务编号;移库时必须" prop="taskCode">
<el-input v-model="form.taskCode" placeholder="请输入任务编号;移库时必须" />
</el-form-item>
<el-form-item label="仓库ID;领料时需要保存" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID;领料时需要保存" />
</el-form-item>
<el-form-item label="库位编码;移库和合库时需要保存" prop="locationCode">
<el-input v-model="form.locationCode" placeholder="请输入库位编码;移库和合库时需要保存" />
</el-form-item>
<el-form-item label="工单ID,关联pd_base_order_info的order_id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单ID,关联pd_base_order_info的order_id" />
</el-form-item>
<el-form-item label="计划ID,关联pd_base_plan_info的plan_id" prop="planId">
<el-input v-model="form.planId" placeholder="请输入计划ID,关联pd_base_plan_info的plan_id" />
</el-form-item>
<el-form-item label="计划明细ID,关联pd_base_plan_detail的plan_detail_id" prop="planDetailId">
<el-input v-model="form.planDetailId" placeholder="请输入计划明细ID,关联pd_base_plan_detail的plan_detail_id" />
</el-form-item>
<el-form-item label="所属工位关联pd_base_station_info的station_id" prop="stationId">
<el-input v-model="form.stationId" placeholder="请输入所属工位关联pd_base_station_info的station_id" />
</el-form-item>
<el-form-item label="成品ID,关联物料表物料id" prop="productId">
<el-input v-model="form.productId" placeholder="请输入成品ID,关联物料表物料id" />
</el-form-item>
<el-form-item label="申请原因" prop="applyReason">
<el-input v-model="form.applyReason" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="审核原因" prop="auditReason">
<el-input v-model="form.auditReason" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="申请人" prop="applyBy">
<el-input v-model="form.applyBy" placeholder="请输入申请人" />
</el-form-item>
<el-form-item label="申请时间" prop="applyDate">
<el-date-picker clearable
v-model="form.applyDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择申请时间">
</el-date-picker>
</el-form-item>
<el-form-item label="审核人" prop="auditBy">
<el-input v-model="form.auditBy" placeholder="请输入审核人" />
</el-form-item>
<el-form-item label="审核时间" prop="auditDate">
<el-date-picker clearable
v-model="form.auditDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择审核时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后更新时间" prop="updateDate">
<el-date-picker clearable
v-model="form.updateDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择最后更新时间">
</el-date-picker>
</el-form-item>
<el-form-item label="执行开始时间" prop="beginTime">
<el-date-picker clearable
v-model="form.beginTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择执行开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="执行结束时间" prop="endTime">
<el-date-picker clearable
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择执行结束时间">
</el-date-picker>
</el-form-item>
<el-divider content-position="center">原材料出库记录明细信息</el-divider>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddWmsRawOutstockDetail"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteWmsRawOutstockDetail"></el-button>
</el-col>
</el-row>
<el-table :data="wmsRawOutstockDetailList" :row-class-name="rowWmsRawOutstockDetailIndex" @selection-change="handleWmsRawOutstockDetailSelectionChange" ref="wmsRawOutstockDetail">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="库位编码" prop="locationCode" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.locationCode" placeholder="请输入库位编码" />
</template>
</el-table-column>
<el-table-column label="物料条码" prop="materialBarcode" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.materialBarcode" placeholder="请输入物料条码" />
</template>
</el-table-column>
<el-table-column label="物料ID" prop="materialId" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.materialId" placeholder="请输入物料ID" />
</template>
</el-table-column>
<el-table-column label="批次;扫描条码时,从打印条码记录表中获取" prop="instockBatch" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.instockBatch" placeholder="请输入批次;扫描条码时,从打印条码记录表中获取" />
</template>
</el-table-column>
<el-table-column label="生产日期;扫描条码时,从打印条码记录表中获取" prop="materialProductionDate" width="240">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.materialProductionDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择生产日期;扫描条码时,从打印条码记录表中获取" />
</template>
</el-table-column>
<el-table-column label="计划数量" prop="planAmount" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.planAmount" placeholder="请输入计划数量" />
</template>
</el-table-column>
<el-table-column label="出库数量" prop="outstockAmount" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.outstockAmount" placeholder="请输入出库数量" />
</template>
</el-table-column>
<el-table-column label="执行状态(0待执行,1执行中,2执行完成)" prop="executeStatus" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.executeStatus" placeholder="请选择执行状态(0待执行,1执行中,2执行完成)">
<el-option label="请选择字典生成" value="" />
</el-select>
</template>
</el-table-column>
<el-table-column label="同步ERP状态(0:失败,1成功)" prop="erpStatus" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.erpStatus" placeholder="请选择同步ERP状态(0:失败,1成功)">
<el-option label="请选择字典生成" value="" />
</el-select>
</template>
</el-table-column>
<el-table-column label="出库人" prop="outstockPerson" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.outstockPerson" placeholder="请输入出库人" />
</template>
</el-table-column>
<el-table-column label="出库时间" prop="outstockTime" width="240">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.outstockTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择出库时间" />
</template>
</el-table-column>
<el-table-column label="出库方式" prop="outstockWay" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.outstockWay" placeholder="请输入出库方式" />
</template>
</el-table-column>
<el-table-column label="使用机台名称;出库扫描条码时,从打印条码记录表中获取" prop="machineName" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.machineName" placeholder="请输入使用机台名称;出库扫描条码时,从打印条码记录表中获取" />
</template>
</el-table-column>
<el-table-column label="质检状态(0:待质检,1:合格,2:NG)" prop="qualityStatus" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.qualityStatus" placeholder="请选择质检状态(0:待质检,1:合格,2:NG)">
<el-option label="请选择字典生成" value="" />
</el-select>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createDate" width="240">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.createDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择创建时间" />
</template>
</el-table-column>
<el-table-column label="最后更新时间" prop="updateDate" width="240">
<template slot-scope="scope">
<el-date-picker clearable v-model="scope.row.updateDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择最后更新时间" />
</template>
</el-table-column>
<el-table-column label="每托数量" prop="stackAmount" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.stackAmount" placeholder="请输入每托数量" />
</template>
</el-table-column>
</el-table>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listRawoutstock, getRawoutstock, delRawoutstock, addRawoutstock, updateRawoutstock } from "@/api/wms/rawoutstock";
export default {
name: "Rawoutstock",
data() {
return {
//
loading: true,
//
ids: [],
//
checkedWmsRawOutstockDetail: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
rawoutstockList: [],
//
wmsRawOutstockDetailList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
taskCode: null,
warehouseId: null,
locationCode: null,
orderId: null,
planId: null,
planDetailId: null,
stationId: null,
productId: null,
operationType: null,
taskType: null,
applyReason: null,
auditReason: null,
auditStatus: null,
executeStatus: null,
applyBy: null,
applyDate: null,
auditBy: null,
auditDate: null,
updateDate: null,
beginTime: null,
endTime: null
},
//
form: {},
//
rules: {
taskCode: [
{ required: true, message: "任务编号;移库时必须不能为空", trigger: "blur" }
],
warehouseId: [
{ required: true, message: "仓库ID;领料时需要保存不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询原材料出库记录列表 */
getList() {
this.loading = true;
listRawoutstock(this.queryParams).then(response => {
this.rawoutstockList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
rawOutstockId: null,
taskCode: null,
warehouseId: null,
locationCode: null,
orderId: null,
planId: null,
planDetailId: null,
stationId: null,
productId: null,
operationType: null,
taskType: null,
applyReason: null,
auditReason: null,
auditStatus: null,
executeStatus: null,
applyBy: null,
applyDate: null,
auditBy: null,
auditDate: null,
updateBy: null,
updateDate: null,
beginTime: null,
endTime: null
};
this.wmsRawOutstockDetailList = [];
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.rawOutstockId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加原材料出库记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const rawOutstockId = row.rawOutstockId || this.ids
getRawoutstock(rawOutstockId).then(response => {
this.form = response.data;
this.wmsRawOutstockDetailList = response.data.wmsRawOutstockDetailList;
this.open = true;
this.title = "修改原材料出库记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.wmsRawOutstockDetailList = this.wmsRawOutstockDetailList;
if (this.form.rawOutstockId != null) {
updateRawoutstock(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRawoutstock(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const rawOutstockIds = row.rawOutstockId || this.ids;
this.$modal.confirm('是否确认删除原材料出库记录编号为"' + rawOutstockIds + '"的数据项?').then(function() {
return delRawoutstock(rawOutstockIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 原材料出库记录明细序号 */
rowWmsRawOutstockDetailIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
},
/** 原材料出库记录明细添加按钮操作 */
handleAddWmsRawOutstockDetail() {
let obj = {};
obj.locationCode = "";
obj.materialBarcode = "";
obj.materialId = "";
obj.instockBatch = "";
obj.materialProductionDate = "";
obj.planAmount = "";
obj.outstockAmount = "";
obj.executeStatus = "";
obj.erpStatus = "";
obj.outstockPerson = "";
obj.outstockTime = "";
obj.outstockWay = "";
obj.machineName = "";
obj.qualityStatus = "";
obj.createDate = "";
obj.updateDate = "";
obj.stackAmount = "";
this.wmsRawOutstockDetailList.push(obj);
},
/** 原材料出库记录明细删除按钮操作 */
handleDeleteWmsRawOutstockDetail() {
if (this.checkedWmsRawOutstockDetail.length == 0) {
this.$modal.msgError("请先选择要删除的原材料出库记录明细数据");
} else {
const wmsRawOutstockDetailList = this.wmsRawOutstockDetailList;
const checkedWmsRawOutstockDetail = this.checkedWmsRawOutstockDetail;
this.wmsRawOutstockDetailList = wmsRawOutstockDetailList.filter(function(item) {
return checkedWmsRawOutstockDetail.indexOf(item.index) == -1
});
}
},
/** 复选框选中数据 */
handleWmsRawOutstockDetailSelectionChange(selection) {
this.checkedWmsRawOutstockDetail = selection.map(item => item.index)
},
/** 导出按钮操作 */
handleExport() {
this.download('wms/rawoutstock/export', {
...this.queryParams
}, `rawoutstock_${new Date().getTime()}.xlsx`)
}
}
};
</script>
Loading…
Cancel
Save