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

@ -33,5 +33,7 @@ public class MesSaleOrderTransferVo {
@NotNull(message = "新销售订单Id必须输入")
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.utils.SecurityUtils;
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.domain.MesMaterialBom;
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));
}
@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="incompleteFlag != null and incompleteFlag != ''">and mpp.plan_status in ('1','2')</if>
</where>
order by mpp.plan_status,mpp.plan_begin_time
order by mpp.plan_begin_time
</select>

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

@ -494,39 +494,11 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
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);
@ -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.setOldSaleOrderId(wmsStockTotal.getSaleOrderId());
mesSaleOrderTransferVo.setNewSaleOrderId(saleOrderId);
mesSaleOrderTransferVo.setMaterialId(materialId);
mesSaleOrderTransferVo.setMesBaseBarcodeInfos(mesBaseBarcodeInfos);
R<Boolean> transferBaseBarcodeInfosResult = remoteMesService.transferSaleOrders(mesSaleOrderTransferVo, SecurityConstants.INNER);

@ -27,6 +27,8 @@
<result property="batchFlag" column="batch_flag"/>
<result property="outstockAmount" column="outstock_amount"/>
<result property="saleorderCode" column="saleorder_code"/>
<result property="materialClassfication" column="material_classfication"/>
</resultMap>
<resultMap type="WmsStockTotal" id="WmsStockTotal4ApplyResult">
@ -245,7 +247,8 @@
wst.update_by,
wst.update_date,
wst.active_flag,
mso.saleorder_code
mso.saleorder_code,
mbmi.material_classfication
from wms_stock_total wst
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

@ -357,3 +357,14 @@ export function getMaterialInfoByMaterialId(materialId) {
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"
@click="handleMaterialConfirmForm()">扫描
</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">退料
</el-button>
<el-button size="mini" type="info" @click="completeReturnMaterials()"
@ -418,7 +419,7 @@
</el-form-item>
<el-form-item>
<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>
</el-dialog>
@ -440,6 +441,14 @@
</div>
</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">
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div>
@ -496,10 +505,11 @@ import {
getWarehouses,
bindBarcode,
applyRawBack,
assignTask, scanMaterial2Confirm, applyRawReturn,
assignTask, scanMaterial2Confirm,
getNewestOutstockCabinet, updateBarcodePlan, completeCollectMaterials, completeReturnMaterials, continueRawInstock
} from "@/api/board";
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
@ -521,6 +531,7 @@ export default {
name: 'Board1',
components: {
'apply-raw-outstock': applyRawOutstock,
'apply-raw-return': applyRawReturn,
Chart,
PrintPage,
WorkshopNotice,
@ -529,7 +540,8 @@ export default {
dicts: ['wms_raw_return_task_type', 'mes_safe_flag'],
provide() {
return {
closeDialog: this.closeDialog
closeDialog: this.closeDialog,
closeRawReturnDialog:this.closeRawReturnDialog
}
},
mixins: [noticeData],
@ -557,6 +569,10 @@ export default {
productPlanData: {},
form: {},
form1: {},
applyRawReturnTitle: '',
applyRawReturnVisible: false,
assignTaskForm: {
materialBarcode: null,
stationId: null
@ -1377,11 +1393,10 @@ export default {
this.form.planDetailStatus = setState("3");
let productPlanRow = this.tableData.find(v => v.planCode === this.form.planCode);
productPlanRow.completeAmount = productPlanRow.completeAmount+1;
productPlanRow.completeAmount = productPlanRow.completeAmount + 1;
}
// getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
// this.tableData = e.rows
// this.totalNum1 = Math.ceil(e.total / 5)
@ -1430,6 +1445,9 @@ export default {
this.dialogVisible = false;
},
closeRawReturnDialog(){
this.applyRawReturnVisible = false;
},
print() {
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>

@ -236,7 +236,7 @@
<el-button
size="small"
type="text"
@click="returnMaterial(scope)"
@click="handleApplyRawReturn(scope.row)"
v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START"
>
退库
@ -419,6 +419,14 @@
</el-form>
</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">
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div>
@ -445,11 +453,11 @@ import {
completeProductPlanDetail,
firstFloorProduceInstock,
scanMaterial2Confirm,
applyRawReturn,
selectMaterialInstallationCircumstance
} from '@/api/board'
import {getToken} from "@/utils/auth";
import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import {getNowDateTime} from "@/utils/ruoyi";
import ViewFile from "@/components/viewFile/index.vue";
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"],
provide(){
return{
closeDialog : this.closeDialog
closeDialog : this.closeDialog,
closeRawReturnDialog:this.closeRawReturnDialog
}
},
components: {
'apply-raw-outstock': applyRawOutstock,
'apply-raw-return': applyRawReturn,
Chart,
PrintPage,
WorkshopNotice,
@ -501,6 +511,8 @@ export default {
warehouseList: [],
form: {},
dialogVisible: false,
applyRawReturnVisible:false,
applyRawReturnTitle: '',
tableData: [],
tableData1: [],
tableData2: [],
@ -1034,6 +1046,33 @@ export default {
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>

@ -185,7 +185,7 @@
<el-button
size="small"
type="text"
@click="returnMaterial(scope)"
@click="handleApplyRawReturn(scope.row)"
v-if="scope.row.planDetailStatus !== PLAN_DETAIL_STATUS.TO_START"
>
退库
@ -328,6 +328,15 @@
</el-form>
</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">
<WorkshopNotice :visible.sync="showTableDialog" :noticeListData="noticeListData"></WorkshopNotice>
</div>
@ -352,10 +361,11 @@ import {
fourthFloorProduceInstock,
check4thFloorProduceOutstock,
fourthFloorProduceOutstock,
scanMaterial2Confirm, applyRawReturn
scanMaterial2Confirm,
} from "@/api/board";
import {monitorSerialData} from "@/utils/serial";
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import {getNowDateTime} from "@/utils/ruoyi";
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
@ -368,12 +378,14 @@ export default {
dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', 'mes_safe_flag'],
provide(){
return{
closeDialog : this.closeDialog
closeDialog : this.closeDialog,
closeRawReturnDialog:this.closeRawReturnDialog
}
},
mixins: [monitorSerialData, noticeData],
components: {
'apply-raw-outstock': applyRawOutstock,
'apply-raw-return': applyRawReturn,
Chart,
PrintPage,
WorkshopNotice,
@ -408,7 +420,8 @@ export default {
dialogVisible: false,
tableData: [],
tableData1: [],
applyRawReturnVisible:false,
applyRawReturnTitle: '',
productInstockType: null,//
PRODUCT_INSTOCK_TYPE: {
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>

@ -139,7 +139,7 @@
size="mini"
type="text"
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)"
v-hasPermi="['wms:stocktotal:transfer']"
>转库存
@ -148,7 +148,7 @@
size="mini"
type="text"
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)"
v-hasPermi="['wms:stocktotal:transferProduct']"
>转库存
@ -190,7 +190,7 @@
<!-- <el-table-column label="原材料库存ID" align="center" prop="rawStockId" />-->
<!-- <el-table-column label="仓库ID" align="center" prop="warehouseId"/>-->
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" type="index" align="center" />
<el-table-column label="序号" type="index" align="center"/>
<el-table-column label="仓库名称" align="center" prop="warehouseName" width="120" v-if="columns[0].visible"/>
<el-table-column label="库位编码" align="center" prop="locationCode" v-if="columns[2].visible"/>
<!-- <el-table-column label="库存类型" align="center" prop="stockType"/>-->
@ -209,7 +209,8 @@
{{ scope.row.saleOrderId === 0 ? "是" : "否" }}
</template>
</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"
v-if="columns[6].visible"/>
<el-table-column label="入库时间" align="center" prop="instockDate" width="180">
@ -306,7 +307,7 @@ export default {
components: {
'select-sale-order': selectSaleOrder
},
dicts: ['mes_safe_flag', 'wms_stock_complete_flag','mes_material_batch_flag'],
dicts: ['mes_safe_flag', 'wms_stock_complete_flag', 'mes_material_batch_flag'],
data() {
return {
//
@ -332,7 +333,7 @@ export default {
open: false,
//
transferType: '',
rowIndex:0,
rowIndex: 0,
// =1=2
type: null,
// List
@ -346,6 +347,7 @@ export default {
label: "warehouseName"
},
rawStockIds: [],
instockBatches: [],
rawStockInfos: [],
rawStockInfosStr: '',
//
@ -402,6 +404,17 @@ export default {
YES: "1",
NO: "0"
}, //
MATERIAL_CLASSFICATION: {
ERP: "1",
VIRTUAL: "2"
},
RAW_BARCODE_VIRTUAL:{
EXTERNAL_VIRTUAL:"VR",//
INTERNAL_VIRTUAL:"RN",//
},
selectSaleOrderVisible: false,
};
},
@ -423,7 +436,7 @@ export default {
{key: 2, label: `库位编码`, visible: true},
{key: 3, label: `物料编码`, visible: true},
{key: 4, label: `物料名称`, visible: true},
{key: 5, label: `物料条码`, visible: true, prop:'instockBatch'},
{key: 5, label: `物料条码`, visible: true, prop: 'instockBatch'},
{key: 6, label: `托盘码`, visible: true},
{key: 7, label: `总数量`, visible: true},
{key: 8, label: `占用数量`, visible: true},
@ -447,7 +460,7 @@ export default {
{key: 2, label: `库位编码`, visible: true},
{key: 3, label: `物料编码`, visible: true},
{key: 4, label: `物料名称`, visible: true},
{key: 5, label: `物料条码`, visible: true,prop:'productBatch'},
{key: 5, label: `物料条码`, visible: true, prop: 'productBatch'},
{key: 6, label: `托盘码`, visible: true},
{key: 7, label: `总数量`, visible: true},
{key: 8, label: `占用数量`, visible: true},
@ -588,15 +601,20 @@ export default {
saleOrderId: null,
stockTotalId: null,
transferAmount: null,
index:null,
index: null,
};
this.resetForm("form");
},
//
handleRawStockSelectionChange(selection) {
this.rawStockIds = selection.map((item, index) => index + "-" + item.rawStockId);
this.rawStockInfos = selection.map((item, index) => "序号:" + (index + 1) + " 物料编码:" + item.materialCode + " 物料名称:" + item.materialName + " 物料规格:" + item.materialSpec + " 数量:" + item.totalAmount + " 销售订单:" + (item.saleorderCode ? item.saleorderCode : "无"))
let index = 0;
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.multiple = !selection.length
},
@ -628,23 +646,33 @@ export default {
this.form.saleorderCode = null;
}
if (this.type === this.STOCK_TYPE.PRODUCT){
if (this.type === this.STOCK_TYPE.PRODUCT) {
transferProductStockTotal(this.form).then(response => {
this.$modal.msgSuccess("转库存成功");
this.open = false;
this.getList();
this.getTwoList();
});
}else if (this.type === this.STOCK_TYPE.RAW){
if(this.transferType==='1'){
} else if (this.type === this.STOCK_TYPE.RAW) {
if (this.transferType === '1') {
transferRawStockTotal(this.form).then(response => {
this.$modal.msgSuccess("转库存成功");
this.open = false;
this.getList();
this.getTwoList();
});
}else if(this.transferType==='2'){
} else if (this.transferType === '2') {
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 => {
this.$modal.msgSuccess("转库存成功");
this.open = false;
@ -655,7 +683,6 @@ export default {
}
}
});
},
@ -664,9 +691,9 @@ export default {
handleStockTotalTransfer(row) {
this.reset();
this.transferType = "1";
this.form.index = (this.stocktotalList.findIndex(item => item.stockTotalId === row.stockTotalId))+1;
this.form.index = (this.stocktotalList.findIndex(item => item.stockTotalId === row.stockTotalId)) + 1;
this.form.stockTotalId = row.stockTotalId;
this.rawStockInfosStr = "序号:"+this.form.index+" 物料编码:" + row.materialCode + " 物料名称:" + row.materialName + " 物料规格:" + row.materialSpec + " 可转数量:" + (row.totalAmount - (row.occupyAmount ? row.occupyAmount : 0)) + " 销售订单:" + (row.saleorderCode ? row.saleorderCode : "无");
this.rawStockInfosStr = "序号:" + this.form.index + " 物料编码:" + row.materialCode + " 物料名称:" + row.materialName + " 物料规格:" + row.materialSpec + " 可转数量:" + (row.totalAmount - (row.occupyAmount ? row.occupyAmount : 0)) + " 销售订单:" + (row.saleorderCode ? row.saleorderCode : "无");
this.open = true;
},
@ -675,7 +702,7 @@ export default {
};
</script>
<style lang="less" scoped>
.app-container{
.app-container {
overflow: auto;
height: calc(100vh - 83px);
}

Loading…
Cancel
Save