车间生产:
申请退库:1楼装配工序、4楼装配工序和5楼装配工序申请退库完成
WMS:
转库存:虚拟合并的原材料信息和成品信息不能转库存
master
xs 4 weeks ago
parent e66705b1a4
commit 21732d35a9

@ -33,5 +33,7 @@ public class MesSaleOrderTransferVo {
@NotNull(message = "新销售订单Id必须输入") @NotNull(message = "新销售订单Id必须输入")
private Long newSaleOrderId; private Long newSaleOrderId;
//物料ID
@NotNull(message = "物料Id必须输入")
private Long materialId;
} }

@ -9,6 +9,7 @@ import com.hw.common.log.enums.BusinessType;
import com.hw.common.security.annotation.RequiresPermissions; import com.hw.common.security.annotation.RequiresPermissions;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.api.domain.MesBaseMaterialInfo;
import com.hw.mes.api.domain.MesBaseStationInfo; import com.hw.mes.api.domain.MesBaseStationInfo;
import com.hw.mes.domain.MesMaterialBom; import com.hw.mes.domain.MesMaterialBom;
import com.hw.mes.domain.MesProductPlan; import com.hw.mes.domain.MesProductPlan;
@ -344,4 +345,15 @@ public class MesApiController extends BaseController {
return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds, MesConstants.MES_BARCODE_TYPE_PRODUCT,false,printNumber)); return success(mesBaseBarcodeInfoService.printBarcodes(barcodeIds, MesConstants.MES_BARCODE_TYPE_PRODUCT,false,printNumber));
} }
@GetMapping("/getMaterialInfoList")
public TableDataInfo getMaterialInfoList(MesBaseMaterialInfo mesBaseMaterialInfo)
{
startPage();
List<MesBaseMaterialInfo> list = mesBaseMaterialInfoService.selectMesBaseMaterialInfoList(mesBaseMaterialInfo);
return getDataTable(list);
}
} }

@ -359,7 +359,7 @@
<if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if> <if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if>
<if test="incompleteFlag != null and incompleteFlag != ''">and mpp.plan_status in ('1','2')</if> <if test="incompleteFlag != null and incompleteFlag != ''">and mpp.plan_status in ('1','2')</if>
</where> </where>
order by mpp.plan_status,mpp.plan_begin_time order by mpp.plan_begin_time
</select> </select>

@ -98,7 +98,7 @@ public class WmsApiController extends BaseController {
*/ */
@Log(title = "原材料退库记录", businessType = BusinessType.APPLY) @Log(title = "原材料退库记录", businessType = BusinessType.APPLY)
@PostMapping(("/applyRawReturn")) @PostMapping(("/applyRawReturn"))
public AjaxResult applyRawReturn(@Validated @RequestBody List<WmsRawReturn> wmsRawReturns) { public AjaxResult applyRawReturn(@RequestBody List<WmsRawReturn> wmsRawReturns) {
return toAjax(wmsRawReturnService.applyRawReturn(wmsRawReturns)); return toAjax(wmsRawReturnService.applyRawReturn(wmsRawReturns));
} }

@ -494,39 +494,11 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
if (planAmount.compareTo(BigDecimal.ZERO) <= 0) { if (planAmount.compareTo(BigDecimal.ZERO) <= 0) {
throw new ServiceException("数量需大于0"); throw new ServiceException("数量需大于0");
} }
String materialBarcode = rawReturn.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 batchFlag = baseBarcodeInfo.getBatchFlag();
if (!batchFlag.equals(MesConstants.IS_BATCH)) {
if (planAmount.compareTo(BigDecimal.ONE) != 0) {
throw new ServiceException("非批次物料数量需等于1");
}
}
if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
throw new ServiceException("物料条码有误,此物料编码非原材料编码");
}
WmsRawStock existedRawStock = wmsRawStockMapper.selectRawStockByBarcode(materialBarcode);
if (existedRawStock != null && existedRawStock.getTotalAmount().compareTo(BigDecimal.ZERO) > 0) {
throw new ServiceException("此物料条码在仓库中存在");
}
rawReturn.setTaskCode(taskCode); rawReturn.setTaskCode(taskCode);
rawReturn.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE); rawReturn.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE);
rawReturn.setEndStationCode(baseWarehouse.getAgvPositionCode());
rawReturn.setOperationType(operationType); rawReturn.setOperationType(operationType);
rawReturn.setAuditStatus(auditStatus); rawReturn.setAuditStatus(auditStatus);
rawReturn.setReturnAmount(BigDecimal.ZERO); rawReturn.setReturnAmount(BigDecimal.ZERO);
rawReturn.setMaterialId(baseBarcodeInfo.getMaterialId());
rawReturn.setBatchCode(baseBarcodeInfo.getBatchCode());
rawReturn.setApplyBy(userName); rawReturn.setApplyBy(userName);
rawReturn.setApplyDate(currentDate); rawReturn.setApplyDate(currentDate);
toInsertedRawReturns.add(rawReturn); toInsertedRawReturns.add(rawReturn);
@ -538,6 +510,91 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
} }
// /**
// * 申请退库
// *
// * @param wmsRawReturns 原材料退库记录列表
// * @return 结果
// */
// @Transactional(rollbackFor = Exception.class)
// @Override
// public int applyRawReturn(List<WmsRawReturn> wmsRawReturns) {
// //申请退库不指定库位,申请退库的多个物料生成多条退库记录,目前按每个条码物料申请退库
// //根据仓库ID分组获取总申请数量
//// Map<Long, List<WmsRawReturn>> rawReturnsMap = wmsRawReturns.stream()
//// .collect(Collectors.groupingBy(WmsRawReturn::getWarehouseId));
// WmsRawReturn firstWmsRawReturn = wmsRawReturns.get(0);
// Long warehouseId = firstWmsRawReturn.getWarehouseId();
// WmsBaseWarehouse baseWarehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(warehouseId);
// String warehouseType = baseWarehouse.getWarehouseType();
// String returnRequirement = baseWarehouse.getReturnRequirement();
// String operationType = WmsConstants.OPERATION_TYPE_MAP.get(warehouseType);
// String auditStatus = "";
// if (warehouseType.equals(WmsConstants.WMS_WAREHOUSE_TYPE_NORMAL)) {//如果是普通仓库,需要校验审核标识
// if (returnRequirement.equals(WmsConstants.WMS_WAREHOUSE_RETURN_REQUIREMENT_APPLY_AUDIT)) {
// auditStatus = WmsConstants.WMS_AUDIT_STATUS_TOAUDIT;
// } else {
// auditStatus = WmsConstants.WMS_AUDIT_STATUS_PASS;
// }
// } else {
// auditStatus = WmsConstants.WMS_AUDIT_STATUS_PASS;
// }
//
// List<WmsRawReturn> toInsertedRawReturns = new ArrayList<>();
// Date currentDate = new Date();
// String userName = SecurityUtils.getUsername();
// String taskCode = Seq.getId(Seq.rawReturnSeqType, Seq.rawReturnCode);
//
// for (WmsRawReturn rawReturn : wmsRawReturns) {
// BigDecimal planAmount = rawReturn.getPlanAmount();
// if (planAmount.compareTo(BigDecimal.ZERO) <= 0) {
// throw new ServiceException("数量需大于0");
// }
// String materialBarcode = rawReturn.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 batchFlag = baseBarcodeInfo.getBatchFlag();
// if (!batchFlag.equals(MesConstants.IS_BATCH)) {
// if (planAmount.compareTo(BigDecimal.ONE) != 0) {
// throw new ServiceException("非批次物料数量需等于1");
// }
// }
//
// if (!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW)) {
// throw new ServiceException("物料条码有误,此物料编码非原材料编码");
// }
//
// WmsRawStock existedRawStock = wmsRawStockMapper.selectRawStockByBarcode(materialBarcode);
// if (existedRawStock != null && existedRawStock.getTotalAmount().compareTo(BigDecimal.ZERO) > 0) {
// throw new ServiceException("此物料条码在仓库中存在");
// }
//
// rawReturn.setTaskCode(taskCode);
// rawReturn.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_TOEXECUTE);
// rawReturn.setEndStationCode(baseWarehouse.getAgvPositionCode());
// rawReturn.setOperationType(operationType);
// rawReturn.setAuditStatus(auditStatus);
// rawReturn.setReturnAmount(BigDecimal.ZERO);
// rawReturn.setMaterialId(baseBarcodeInfo.getMaterialId());
// rawReturn.setBatchCode(baseBarcodeInfo.getBatchCode());
// rawReturn.setApplyBy(userName);
// rawReturn.setApplyDate(currentDate);
// toInsertedRawReturns.add(rawReturn);
// }
//
// wmsRawReturnMapper.batchWmsRawReturn(toInsertedRawReturns);
//
// return 1;
// }
/** /**
* 退退 * 退退
* *

@ -462,6 +462,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService {
mesSaleOrderTransferVo.setTransferAmount(transferAmount); mesSaleOrderTransferVo.setTransferAmount(transferAmount);
mesSaleOrderTransferVo.setOldSaleOrderId(wmsStockTotal.getSaleOrderId()); mesSaleOrderTransferVo.setOldSaleOrderId(wmsStockTotal.getSaleOrderId());
mesSaleOrderTransferVo.setNewSaleOrderId(saleOrderId); mesSaleOrderTransferVo.setNewSaleOrderId(saleOrderId);
mesSaleOrderTransferVo.setMaterialId(materialId);
mesSaleOrderTransferVo.setMesBaseBarcodeInfos(mesBaseBarcodeInfos); mesSaleOrderTransferVo.setMesBaseBarcodeInfos(mesBaseBarcodeInfos);
R<Boolean> transferBaseBarcodeInfosResult = remoteMesService.transferSaleOrders(mesSaleOrderTransferVo, SecurityConstants.INNER); R<Boolean> transferBaseBarcodeInfosResult = remoteMesService.transferSaleOrders(mesSaleOrderTransferVo, SecurityConstants.INNER);

@ -27,6 +27,8 @@
<result property="batchFlag" column="batch_flag"/> <result property="batchFlag" column="batch_flag"/>
<result property="outstockAmount" column="outstock_amount"/> <result property="outstockAmount" column="outstock_amount"/>
<result property="saleorderCode" column="saleorder_code"/> <result property="saleorderCode" column="saleorder_code"/>
<result property="materialClassfication" column="material_classfication"/>
</resultMap> </resultMap>
<resultMap type="WmsStockTotal" id="WmsStockTotal4ApplyResult"> <resultMap type="WmsStockTotal" id="WmsStockTotal4ApplyResult">
@ -245,7 +247,8 @@
wst.update_by, wst.update_by,
wst.update_date, wst.update_date,
wst.active_flag, wst.active_flag,
mso.saleorder_code mso.saleorder_code,
mbmi.material_classfication
from wms_stock_total wst from wms_stock_total wst
left join wms_base_warehouse wbw on wbw.warehouse_id = wst.warehouse_id left join wms_base_warehouse wbw on wbw.warehouse_id = wst.warehouse_id
left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id left join mes_base_material_info mbmi on mbmi.material_id = wst.material_id

@ -357,3 +357,14 @@ export function getMaterialInfoByMaterialId(materialId) {
method: 'get', method: 'get',
}) })
} }
// 查询物料信息列表
export function getMaterialInfoList(query) {
return request({
url: '/mes/api/getMaterialInfoList',
method: 'get',
params: query
})
}

@ -0,0 +1,380 @@
<template>
<div>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="派工单号">
<el-input v-model="form.planCode" disabled style="width:360px"></el-input>
</el-form-item>
<el-form-item label="明细编号">
<el-input v-model="form.planDetailCode" disabled></el-input>
</el-form-item>
<el-form-item label="仓库">
<el-select v-model="form.warehouseId" placeholder="请选择仓库" style="width:360px">
<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="taskType">
<el-select v-model="form.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-select>
</el-form-item>
<el-form-item label="退库原因">
<el-input v-model="form.applyReason" type="textarea"></el-input>
</el-form-item>
</el-form>
<el-divider content-position="center">物料信息</el-divider>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="130px">
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleSelectMaterial"></el-button>
</el-form-item>
</el-form>
<el-table
:cell-style="{textAlign:'center'}"
:data="wmsRawReturnList"
:header-cell-style="{textAlign:'center'}"
max-height="19.13vw"
style="width: 100%;"
>
<el-table-column
label="物料编号"
prop="materialCode"
>
</el-table-column>
<el-table-column
label="物料名称"
prop="materialName"
>
</el-table-column>
<el-table-column
label="物料规格"
prop="materialSpec"
>
</el-table-column>
<el-table-column
label="退库数量"
prop="planAmount"
width="120"
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.planAmount"
controls-position="right"
:max="maxPlanAmount"
style="width: 100%"
>
</el-input-number>
</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-delete"
@click="handleDeleteMaterial(scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 选择信息对话框 -->
<el-dialog title="选择物料信息" :visible.sync="materialOpen" append-to-body>
<select-material ref="materialRef" v-if="materialOpen"></select-material>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitMaterialForm"> </el-button>
<el-button @click="materialOpen = false"> </el-button>
</div>
</el-dialog>
<div style="text-align: center;margin-top: 30px">
<el-button type="primary" :loading="submitLoading" @click="submitForm"></el-button>
<el-button type="info" @click="closeParentDialog"></el-button>
</div>
</div>
</template>
<script>
import {getWarehouses, getMaterialInfoByMaterialId, applyRawReturn, assignTask} from "@/api/board";
import selectMaterial from '@//views/board/common/selectMaterial.vue';
export default {
name: "Materialinfo",
props: {
defineData: {
type: Object,
default: {}
}
},
components: {
'select-material': selectMaterial,
},
dicts: ['mes_safe_flag', 'mes_material_accessories_flag','wms_raw_return_task_type'],
inject: ['closeRawReturnDialog'],
data() {
return {
//
loading: true,
//
submitLoading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
warehouseList: [],
//
title: "",
//
open: false,
maxPlanAmount: 100000000,
returnFlag: '',
taskType: '',
//
materialOpen: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
erpId: null,
materialCode: null,
oldMaterialCode: null,
materialName: null,
materialCategories: null,
materialSubclass: null,
materialTypeId: null,
batchFlag: null,
materialUnitId: null,
materialUnit: null,
materialMatkl: null,
materialSpec: null,
netWeight: null,
grossWeight: null,
factoryId: null,
createOrgId: null,
useOrgId: null,
prodlineId: null,
activeFlag: null,
deletedFlag: null,
approveDate: null,
erpModifyDate: null,
accessoriesFlag: '0'
},
//
form: {},
RETURN_FLAG: {//
YES: '1',//
},
rules: {
taskType: [
{required: true, message: "退库类型不能为空", trigger: "blur"}
],
},
wmsRawReturnList: [],
};
},
created() {
this.getData();
this.getMaterialInfoByMaterialId();
},
methods: {
getData() {
if (this.defineData.planCode) {
this.form = {
warehouseId: '',
planId: this.defineData?.planId,
planCode: this.defineData?.planCode,
dispatchCode: this.defineData?.dispatchCode,
planDetailCode: this.defineData?.planDetailCode,
saleOrderId: this.defineData?.saleOrderId,
productId: this.defineData?.productId,
materialBomId: this.defineData?.materialBomId,
applyReason: '',
taskType: this.defineData?.taskType,
stationId: this.defineData?.stationId,
endStationCode: this.defineData?.stationCode,
returnFlag: this.defineData?.returnFlag,
mesAreaType: this.defineData?.mesAreaType,
warehouseFloor: this.defineData?.warehouseFloor,
wmsRawReturnList: []
}
}
if (this.defineData.maxPlanAmount) {
this.maxPlanAmount = this.defineData.maxPlanAmount
}
if (this.defineData.returnFlag) {
this.returnFlag = this.defineData.returnFlag;
}
},
getMaterialInfoByMaterialId() {
getMaterialInfoByMaterialId(this.defineData.productId).then(e => {
this.queryParams.materialClassfication = e.data.materialClassfication;
this.getWarehouses();
});
},
getWarehouses() {
//
getWarehouses({
warehouseFloor: this.defineData.warehouseFloor,
returnFlag: this.defineData.returnFlag,
mesAreaType: this.defineData.mesAreaType,
}).then(e => {
this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId
// this.searchMaterial();
})
},
handleSelectMaterial() {
this.materialOpen = true;
},
/** 提交物料信息按钮 */
submitMaterialForm() {
let selectedRow = this.$refs.materialRef.selectedRow;
let rawReturnObj = {
"warehouseId":this.form.warehouseId,
"planCode":this.form.planCode,
"planDetailCode":this.form.planDetailCode,
"productId":this.form.productId,
"endStationCode":this.form.endStationCode,
"applyReason":"",
"taskType":"",
"materialId":selectedRow.materialId,
"materialCode":selectedRow.materialCode,
"materialName":selectedRow.materialName,
"materialSpec":selectedRow.materialSpec,
"planAmount":null
};
this.wmsRawReturnList.push(rawReturnObj);
this.materialOpen = false;
},
handleDeleteMaterial(row){
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
materialId: null,
erpId: null,
materialCode: null,
oldMaterialCode: null,
materialName: null,
materialCategories: null,
materialSubclass: null,
materialTypeId: null,
batchFlag: null,
materialUnitId: null,
materialUnit: null,
materialMatkl: null,
materialSpec: null,
netWeight: null,
grossWeight: null,
factoryId: null,
createOrgId: null,
useOrgId: null,
prodlineId: null,
activeFlag: null,
deletedFlag: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
approveDate: null,
erpModifyDate: null
};
this.resetForm("form");
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.wmsRawReturnList.length <= 0) {
this.$modal.msgWarning("请选择要退库的物料");
return;
}
for (const wmsRawReturn of this.wmsRawReturnList) {
if(wmsRawReturn.planAmount <=0){
this.$modal.msgWarning("退库数量需大于0");
return;
}
wmsRawReturn.applyReason = this.form.applyReason;
wmsRawReturn.taskType = this.form.taskType;
}
this.submitloading = true;
applyRawReturn(this.wmsRawReturnList).then(e => {
this.$modal.msgSuccess("申请成功");
}).finally(e => {
this.submitloading = false;
this.closeParentDialog();
})
}
});
},
closeParentDialog() {
this.closeRawReturnDialog()
},
}
};
</script>
<style lang="less" scoped>
.el-table {
background-color: #fff0;
overflow-y: auto;
}
.roundBorder {
position: absolute;
transform: translate(-50%, -50%);
}
</style>

@ -0,0 +1,188 @@
<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="materialCode">
<el-input
v-model="queryParams.materialCode"
placeholder="请输入物料编码"
clearable
@keyup.enter.native="handleQuery"
auto-complete="on"
id="historyMaterialCode"
/>
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入物料名称"
clearable
@keyup.enter.native="handleQuery"
auto-complete="on"
id="historyMaterialName"
/>
</el-form-item>
<el-form-item label="物料规格" prop="materialSpec">
<el-input
v-model="queryParams.materialSpec"
placeholder="请输入物料规格"
clearable
@keyup.enter.native="handleQuery"
auto-complete="on"
id="historyMaterialSpec"
/>
</el-form-item>
<el-form-item label="批次标识" prop="batchFlag">
<el-select v-model="queryParams.batchFlag" placeholder="请选择批次标识" clearable>
<el-option
v-for="dict in dict.type.active_flag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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-table v-loading="loading" :data="materialinfoList" @selection-change="handleSelectionChange"
@row-click="handleRowClick"
highlight-current-row>
<el-table-column type="selection" width="55" align="center" v-if="false" />
<el-table-column label="物料ID" align="center" prop="materialId" v-if="false"/>
<el-table-column label="物料编码" align="center" prop="materialCode"/>
<el-table-column label="物料名称" align="center" prop="materialName"/>
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
<el-table-column label="常备物料" align="center" prop="bindFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_material_bind_flag" :value="scope.row.bindFlag"/>
</template>
</el-table-column>
<el-table-column label="批次标识" align="center" prop="batchFlag">
<template slot-scope="scope">
<dict-tag :options="dict.type.active_flag" :value="scope.row.batchFlag"/>
</template>
</el-table-column>
<el-table-column label="批次数量" align="center" prop="batchAmount"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import {getMaterialInfoList} from "@/api/board";
export default {
name: "Materialinfo",
dicts: ['active_flag', 'material_categories','mes_material_bind_flag'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
baseMaterialTypeOptions: [],
//
materialinfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
erpId: null,
materialCode: null,
oldMaterialCode: null,
materialName: null,
materialCategories: null,
materialSubclass: null,
materialTypeId: null,
batchFlag: null,
materialUnitId: null,
materialUnit: null,
materialMatkl: null,
materialSpec: null,
netWeight: null,
grossWeight: null,
factoryId: null,
createOrgId: null,
useOrgId: null,
prodlineId: null,
activeFlag: '1',
deletedFlag: null,
approveDate: null,
erpModifyDate: null,
materialClassfication:"1",
},
};
},
created() {
this.getList();
},
methods: {
/** 查询物料信息列表 */
getList() {
this.loading = true;
getMaterialInfoList(this.queryParams).then(response => {
this.materialinfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.materialId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
//
handleRowClick(row) {
this.selectedRow = row
},
}
};
</script>

@ -45,7 +45,8 @@
:disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode"
@click="handleMaterialConfirmForm()">扫描 @click="handleMaterialConfirmForm()">扫描
</el-button> </el-button>
<el-button size="mini" type="danger" @click="returnMaterial()" v-if="(!$route.query || $route.query.id==='2')" <el-button size="mini" type="danger" @click="handleApplyRawReturn()"
v-if="(!$route.query || $route.query.id==='2')"
:disabled="!form.planDetailCode">退料 :disabled="!form.planDetailCode">退料
</el-button> </el-button>
<el-button size="mini" type="info" @click="completeReturnMaterials()" <el-button size="mini" type="info" @click="completeReturnMaterials()"
@ -418,7 +419,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="returnModelVisible = false"> </el-button> <el-button @click="returnModelVisible = false"> </el-button>
<el-button type="primary" @click="returnModelConfirm">退 </el-button> <el-button type="primary" @click="handleApplyRawReturn">退 </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
@ -440,6 +441,14 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 申请退库信息对话框 -->
<el-dialog :title="applyRawReturnTitle" :visible.sync="applyRawReturnVisible" append-to-body>
<apply-raw-return ref="applyRawReturnRef" :defineData="productPlanData"
v-if="applyRawReturnVisible"></apply-raw-return>
</el-dialog>
<div id="workshopNotice"> <div id="workshopNotice">
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice> <WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div> </div>
@ -496,10 +505,11 @@ import {
getWarehouses, getWarehouses,
bindBarcode, bindBarcode,
applyRawBack, applyRawBack,
assignTask, scanMaterial2Confirm, applyRawReturn, assignTask, scanMaterial2Confirm,
getNewestOutstockCabinet, updateBarcodePlan, completeCollectMaterials, completeReturnMaterials, continueRawInstock getNewestOutstockCabinet, updateBarcodePlan, completeCollectMaterials, completeReturnMaterials, continueRawInstock
} from "@/api/board"; } from "@/api/board";
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue'; import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import WorkshopNotice from "@/components/workshopNotice/index.vue"; import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice" import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue"; import ViewFile from "@/components/viewFile/index.vue";
@ -521,6 +531,7 @@ export default {
name: 'Board1', name: 'Board1',
components: { components: {
'apply-raw-outstock': applyRawOutstock, 'apply-raw-outstock': applyRawOutstock,
'apply-raw-return': applyRawReturn,
Chart, Chart,
PrintPage, PrintPage,
WorkshopNotice, WorkshopNotice,
@ -529,7 +540,8 @@ export default {
dicts: ['wms_raw_return_task_type', 'mes_safe_flag'], dicts: ['wms_raw_return_task_type', 'mes_safe_flag'],
provide() { provide() {
return { return {
closeDialog: this.closeDialog closeDialog: this.closeDialog,
closeRawReturnDialog:this.closeRawReturnDialog
} }
}, },
mixins: [noticeData], mixins: [noticeData],
@ -557,6 +569,10 @@ export default {
productPlanData: {}, productPlanData: {},
form: {}, form: {},
form1: {}, form1: {},
applyRawReturnTitle: '',
applyRawReturnVisible: false,
assignTaskForm: { assignTaskForm: {
materialBarcode: null, materialBarcode: null,
stationId: null stationId: null
@ -1381,7 +1397,6 @@ export default {
} }
// getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { // getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
// this.tableData = e.rows // this.tableData = e.rows
// this.totalNum1 = Math.ceil(e.total / 5) // this.totalNum1 = Math.ceil(e.total / 5)
@ -1430,6 +1445,9 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
}, },
closeRawReturnDialog(){
this.applyRawReturnVisible = false;
},
print() { print() {
getNewestOutstockCabinet({planDetailCode: this.form.planDetailCode}).then(response => { getNewestOutstockCabinet({planDetailCode: this.form.planDetailCode}).then(response => {
@ -1699,6 +1717,33 @@ export default {
}) })
}, },
// 退
handleApplyRawReturn() {
this.applyRawReturnTitle = "申请退库";
this.applyRawReturnVisible = true;
this.productPlanData = {
warehouseId: '',
planId: this.form?.planId,
planCode: this.form?.planCode,
dispatchCode: this.form?.dispatchCode,
planDetailCode: this.form?.planDetailCode,
saleOrderId: this.form?.saleOrderId,
productId: this.form?.materialId,
materialBomId: this.form?.materialBomId,
maxPlanAmount: this.maxPlanAmount,
applyReason: '',
taskType: this.taskType,
returnFlag: '0',
stationId: this.loginStationInfo.stationId,
stationCode: this.loginStationInfo.stationCode,
warehouseFloor: 5,
wmsRawReturnList: []
}
},
} }
} }
</script> </script>

@ -236,7 +236,7 @@
<el-button <el-button
size="small" size="small"
type="text" type="text"
@click="returnMaterial(scope)" @click="handleApplyRawReturn(scope.row)"
v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START" v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START"
> >
退库 退库
@ -419,6 +419,14 @@
</el-form> </el-form>
</el-dialog> </el-dialog>
<!-- 申请退库信息对话框 -->
<el-dialog :title="applyRawReturnTitle" :visible.sync="applyRawReturnVisible" append-to-body>
<apply-raw-return ref="applyRawReturnRef" :defineData="productPlanData"
v-if="applyRawReturnVisible"></apply-raw-return>
</el-dialog>
<div id="workshopNotice"> <div id="workshopNotice">
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice> <WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div> </div>
@ -445,11 +453,11 @@ import {
completeProductPlanDetail, completeProductPlanDetail,
firstFloorProduceInstock, firstFloorProduceInstock,
scanMaterial2Confirm, scanMaterial2Confirm,
applyRawReturn,
selectMaterialInstallationCircumstance selectMaterialInstallationCircumstance
} from '@/api/board' } from '@/api/board'
import {getToken} from "@/utils/auth"; import {getToken} from "@/utils/auth";
import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue"; import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import {getNowDateTime} from "@/utils/ruoyi"; import {getNowDateTime} from "@/utils/ruoyi";
import ViewFile from "@/components/viewFile/index.vue"; import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan"; import {getDispatchSOPAttachList} from "@/api/mes/productplan";
@ -460,11 +468,13 @@ export default {
dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', "mes_safe_flag"], dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', "mes_safe_flag"],
provide(){ provide(){
return{ return{
closeDialog : this.closeDialog closeDialog : this.closeDialog,
closeRawReturnDialog:this.closeRawReturnDialog
} }
}, },
components: { components: {
'apply-raw-outstock': applyRawOutstock, 'apply-raw-outstock': applyRawOutstock,
'apply-raw-return': applyRawReturn,
Chart, Chart,
PrintPage, PrintPage,
WorkshopNotice, WorkshopNotice,
@ -501,6 +511,8 @@ export default {
warehouseList: [], warehouseList: [],
form: {}, form: {},
dialogVisible: false, dialogVisible: false,
applyRawReturnVisible:false,
applyRawReturnTitle: '',
tableData: [], tableData: [],
tableData1: [], tableData1: [],
tableData2: [], tableData2: [],
@ -1034,6 +1046,33 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
}, },
// 退
handleApplyRawReturn(row) {
this.applyRawReturnTitle = "申请退库";
this.applyRawReturnVisible = true;
this.productPlanData = {
warehouseId: '',
planId: row.planId,
planCode: row.planCode,
dispatchCode: row.dispatchCode,
planDetailCode: row.planDetailCode,
saleOrderId: row.saleOrderId,
productId: this.productId,
materialBomId: this.materialBomId,
applyReason: '',
taskType: '',
warehouseFloor: 1,
wmsRawReturnList: []
}
},
closeRawReturnDialog(){
this.applyRawReturnVisible = false;
},
} }
} }
</script> </script>

@ -185,7 +185,7 @@
<el-button <el-button
size="small" size="small"
type="text" type="text"
@click="returnMaterial(scope)" @click="handleApplyRawReturn(scope.row)"
v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START" v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START"
> >
退库 退库
@ -328,6 +328,15 @@
</el-form> </el-form>
</el-dialog> </el-dialog>
<!-- 申请退库信息对话框 -->
<el-dialog :title="applyRawReturnTitle" :visible.sync="applyRawReturnVisible" append-to-body>
<apply-raw-return ref="applyRawReturnRef" :defineData="productPlanData"
v-if="applyRawReturnVisible"></apply-raw-return>
</el-dialog>
<div id="workshopNotice"> <div id="workshopNotice">
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice> <WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div> </div>
@ -352,10 +361,11 @@ import {
fourthFloorProduceInstock, fourthFloorProduceInstock,
check4thFloorProduceOutstock, check4thFloorProduceOutstock,
fourthFloorProduceOutstock, fourthFloorProduceOutstock,
scanMaterial2Confirm, applyRawReturn scanMaterial2Confirm,
} from "@/api/board"; } from "@/api/board";
import {monitorSerialData} from "@/utils/serial"; import {monitorSerialData} from "@/utils/serial";
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue'; import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import {getNowDateTime} from "@/utils/ruoyi"; import {getNowDateTime} from "@/utils/ruoyi";
import WorkshopNotice from "@/components/workshopNotice/index.vue"; import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice" import {noticeData} from "@/utils/notice"
@ -368,12 +378,14 @@ export default {
dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', 'mes_safe_flag'], dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', 'mes_safe_flag'],
provide(){ provide(){
return{ return{
closeDialog : this.closeDialog closeDialog : this.closeDialog,
closeRawReturnDialog:this.closeRawReturnDialog
} }
}, },
mixins: [monitorSerialData, noticeData], mixins: [monitorSerialData, noticeData],
components: { components: {
'apply-raw-outstock': applyRawOutstock, 'apply-raw-outstock': applyRawOutstock,
'apply-raw-return': applyRawReturn,
Chart, Chart,
PrintPage, PrintPage,
WorkshopNotice, WorkshopNotice,
@ -408,7 +420,8 @@ export default {
dialogVisible: false, dialogVisible: false,
tableData: [], tableData: [],
tableData1: [], tableData1: [],
applyRawReturnVisible:false,
applyRawReturnTitle: '',
productInstockType: null,// productInstockType: null,//
PRODUCT_INSTOCK_TYPE: { PRODUCT_INSTOCK_TYPE: {
INSTOCK: "1",// INSTOCK: "1",//
@ -1154,6 +1167,32 @@ export default {
}, },
// 退
handleApplyRawReturn(row) {
this.applyRawReturnTitle = "申请退库";
this.applyRawReturnVisible = true;
this.productPlanData = {
warehouseId: '',
planId: row.planId,
planCode: row.planCode,
dispatchCode: row.dispatchCode,
planDetailCode: row.planDetailCode,
saleOrderId: row.saleOrderId,
productId: this.productId,
materialBomId: this.materialBomId,
applyReason: '',
taskType: '',
mesAreaType: 3,
warehouseFloor: 4,
wmsRawReturnList: []
}
},
closeRawReturnDialog(){
this.applyRawReturnVisible = false;
},
} }
} }
</script> </script>

@ -139,7 +139,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-shopping-cart-1" icon="el-icon-shopping-cart-1"
v-if="scope.row.batchFlag === BATCH_FLAG.NO && type === STOCK_TYPE.RAW" v-if="scope.row.batchFlag === BATCH_FLAG.NO && type === STOCK_TYPE.RAW && scope.row.materialClassfication=== MATERIAL_CLASSFICATION.ERP"
@click="handleStockTotalTransfer(scope.row)" @click="handleStockTotalTransfer(scope.row)"
v-hasPermi="['wms:stocktotal:transfer']" v-hasPermi="['wms:stocktotal:transfer']"
>转库存 >转库存
@ -148,7 +148,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-shopping-cart-1" icon="el-icon-shopping-cart-1"
v-if="scope.row.batchFlag === BATCH_FLAG.NO && type === STOCK_TYPE.PRODUCT" v-if="scope.row.batchFlag === BATCH_FLAG.NO && type === STOCK_TYPE.PRODUCT && scope.row.materialClassfication=== MATERIAL_CLASSFICATION.ERP"
@click="handleStockTotalTransfer(scope.row)" @click="handleStockTotalTransfer(scope.row)"
v-hasPermi="['wms:stocktotal:transferProduct']" v-hasPermi="['wms:stocktotal:transferProduct']"
>转库存 >转库存
@ -209,7 +209,8 @@
{{ scope.row.saleOrderId === 0 ? "是" : "否" }} {{ scope.row.saleOrderId === 0 ? "是" : "否" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="物料条码" align="center" :prop="columns[5].prop" width="100" v-if="columns[5].visible"/> <el-table-column label="物料条码" align="center" :prop="columns[5].prop" width="100"
v-if="columns[5].visible"/>
<el-table-column label="容器码" align="center" prop="palletInfoCode" width="120" <el-table-column label="容器码" align="center" prop="palletInfoCode" width="120"
v-if="columns[6].visible"/> v-if="columns[6].visible"/>
<el-table-column label="入库时间" align="center" prop="instockDate" width="180"> <el-table-column label="入库时间" align="center" prop="instockDate" width="180">
@ -346,6 +347,7 @@ export default {
label: "warehouseName" label: "warehouseName"
}, },
rawStockIds: [], rawStockIds: [],
instockBatches: [],
rawStockInfos: [], rawStockInfos: [],
rawStockInfosStr: '', rawStockInfosStr: '',
// //
@ -402,6 +404,17 @@ export default {
YES: "1", YES: "1",
NO: "0" NO: "0"
}, // }, //
MATERIAL_CLASSFICATION: {
ERP: "1",
VIRTUAL: "2"
},
RAW_BARCODE_VIRTUAL:{
EXTERNAL_VIRTUAL:"VR",//
INTERNAL_VIRTUAL:"RN",//
},
selectSaleOrderVisible: false, selectSaleOrderVisible: false,
}; };
}, },
@ -595,8 +608,13 @@ export default {
// //
handleRawStockSelectionChange(selection) { handleRawStockSelectionChange(selection) {
this.rawStockIds = selection.map((item, index) => index + "-" + item.rawStockId); let index = 0;
this.rawStockInfos = selection.map((item, index) => "序号:" + (index + 1) + " 物料编码:" + item.materialCode + " 物料名称:" + item.materialName + " 物料规格:" + item.materialSpec + " 数量:" + item.totalAmount + " 销售订单:" + (item.saleorderCode ? item.saleorderCode : "无")) selection.forEach(row => {
index = this.rawstockList.indexOf(row);
});
this.instockBatches = selection.map((item, index1) => index + "-" + item.instockBatch);
this.rawStockIds = selection.map((item, index1) => index + "-" + item.rawStockId);
this.rawStockInfos = selection.map((item, index1) => "序号:" + (index + 1) + " 物料编码:" + item.materialCode + " 物料名称:" + item.materialName + " 物料规格:" + item.materialSpec + " 数量:" + item.totalAmount + " 销售订单:" + (item.saleorderCode ? item.saleorderCode : "无"))
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
@ -645,6 +663,16 @@ export default {
}); });
} else if (this.transferType === '2') { } else if (this.transferType === '2') {
this.form.indexStockIds = this.rawStockIds; this.form.indexStockIds = this.rawStockIds;
for(const instockBatchStr of this.instockBatches){
let instockBatchStrArr = instockBatchStr.split("-");
let instockBatchIndex = parseInt(instockBatchStrArr[0]);
let instockBatch = instockBatchStrArr[1];
if(instockBatch.indexOf(this.RAW_BARCODE_VIRTUAL.EXTERNAL_VIRTUAL) >=0 || instockBatch.indexOf(this.RAW_BARCODE_VIRTUAL.INTERNAL_VIRTUAL) >=0){
this.$modal.msgSuccess("序号:"+(instockBatchIndex+1)+",是虚拟合并的物料,不能转库存");
return;
}
}
transferRaw(this.form).then(response => { transferRaw(this.form).then(response => {
this.$modal.msgSuccess("转库存成功"); this.$modal.msgSuccess("转库存成功");
this.open = false; this.open = false;
@ -655,7 +683,6 @@ export default {
} }
} }
}); });
}, },

Loading…
Cancel
Save