车间MES:
-1楼、4楼和5楼各工序申请领物料页面完善,搜索条件可根据名称、编码或规格搜索,增加已申请数量的显示
master
xs 1 year ago
parent 0cf799c883
commit 2cc0c44f74

@ -131,6 +131,7 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService
public List<MesMaterialBom> getMaterialVisionList(Long materialId) {
MesMaterialBom materialBom = new MesMaterialBom();
materialBom.setMaterialId(materialId);
materialBom.setParentId(0L);
return mesMaterialBomMapper.selectMesMaterialBomList(materialBom);
}

@ -253,7 +253,7 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
mesProductPlan.setCreateBy(SecurityUtils.getUsername());
mesProductPlan.setCreateTime(DateUtils.getNowDate());
mesProductPlan.setPlanCode(Seq.getId(Seq.planCodeSeqType, Seq.planCodeCode));
if(mesProductPlan.getSaleOrderId()==null){
if (mesProductPlan.getSaleOrderId() == null) {
mesProductPlan.setSaleOrderId(0L);
}
@ -670,7 +670,6 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
}
// public String executeAssignTaskResultTask() {
// ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
// boolean running = true;

@ -111,7 +111,7 @@
<if test="deletedFlag != null and deletedFlag != ''">and bmi.deleted_flag = #{deletedFlag}</if>
<if test="approveDate != null ">and bmi.approve_date = #{approveDate}</if>
<if test="erpModifyDate != null ">and bmi.erp_modify_date = #{erpModifyDate}</if>
<if test="selectType != null and selectType = '1'">and exists (select 1 from wms_warehouse_material wwm where wwm.storage_type='1' and wwm.warehouse_id=511 and wwm.storage_id=bmi.material_id)</if>
<if test="selectType != null and selectType !=''">and exists (select 1 from wms_warehouse_material wwm where wwm.storage_type='1' and wwm.warehouse_id=511 and wwm.storage_id=bmi.material_id)</if>
</where>
</select>

@ -351,7 +351,7 @@
<if test="userId != null ">and mpp.user_id = #{userId}</if>
<if test="planStatus != null and planStatus != ''">and mpp.plan_status = #{planStatus}</if>
</where>
order by mpo.plan_delivery_date
order by mpp.plan_status,mpp.plan_begin_time
</select>

@ -6,8 +6,10 @@ import javax.servlet.http.HttpServletResponse;
import com.hw.common.core.constant.WmsConstants;
import com.hw.wms.domain.WmsBaseWarehouse;
import com.hw.wms.domain.WmsStockTotal;
import com.hw.wms.domain.vo.WmsRawOutstockAuditVo;
import com.hw.wms.service.IWmsBaseWarehouseService;
import com.hw.wms.service.IWmsStockTotalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@ -44,6 +46,9 @@ public class WmsRawOutstockController extends BaseController
@Autowired
private IWmsBaseWarehouseService wmsBaseWarehouseService;
@Autowired
private IWmsStockTotalService wmsStockTotalService;
/**
*
*/
@ -92,17 +97,17 @@ public class WmsRawOutstockController extends BaseController
/**
*
* @param wmsRawOutstock
* @return
*/
@Log(title = "原材料出库记录", businessType = BusinessType.APPLY)
@PostMapping("/applyRawOutstock")
public AjaxResult applyRawOutstock(@RequestBody WmsRawOutstock wmsRawOutstock)
{
return toAjax(wmsRawOutstockService.applyRawOutstock(wmsRawOutstock));
}
// /**
// * 申请领料
// * @param wmsRawOutstock
// * @return
// */
// @Log(title = "原材料出库记录", businessType = BusinessType.APPLY)
// @PostMapping("/applyRawOutstock")
// public AjaxResult applyRawOutstock(@RequestBody WmsRawOutstock wmsRawOutstock)
// {
// return toAjax(wmsRawOutstockService.applyRawOutstock(wmsRawOutstock));
// }
/**
@ -145,4 +150,44 @@ public class WmsRawOutstockController extends BaseController
List<WmsBaseWarehouse> warehouses = wmsBaseWarehouseService.selectWmsBaseWarehouseList(queryWarehouse);
return success(warehouses);
}
/**
*
*/
@RequiresPermissions("wms:rawoutstock:apply")
@GetMapping("/getWarehouses4Apply")
public AjaxResult getWarehouses4Apply(WmsBaseWarehouse queryBaseWarehouse) {
queryBaseWarehouse.setWarehouseInstockType(WmsConstants.WMS_WAREHOUSE_INSTOCK_TYPE_RAW);
List<WmsBaseWarehouse> list = wmsBaseWarehouseService.selectWmsBaseWarehouseList(queryBaseWarehouse);
return success(list);
}
/**
*
*/
@RequiresPermissions("wms:rawoutstock:apply")
@GetMapping("/getStockTotal")
public TableDataInfo getStockTotal(WmsStockTotal queryStockTotal) {
startPage();
List<WmsStockTotal> list = wmsStockTotalService.selectWmsStockTotalJoinListBySaleOrder(queryStockTotal);
return getDataTable(list);
}
/**
* wcs
*/
@RequiresPermissions("wms:rawoutstock:apply")
@Log(title = "原材料出库记录", businessType = BusinessType.APPLY)
@PostMapping(("/applyRawOutstock"))
public AjaxResult applyRawOutstock(@Validated @RequestBody WmsRawOutstock wmsRawOutstock) {
return toAjax(wmsRawOutstockService.applyRawOutstock(wmsRawOutstock));
}
}

@ -112,7 +112,11 @@ public class WmsStockTotal extends BaseEntity {
private String materialCodeNameSpec;
private BigDecimal applyQty;//已申请数量
private BigDecimal outstockAmount;//已申请数量
private String planCode;
private String planDetailCode;
public String getWarehouseName() {
@ -260,12 +264,28 @@ public class WmsStockTotal extends BaseEntity {
this.materialCodeNameSpec = materialCodeNameSpec;
}
public BigDecimal getApplyQty() {
return applyQty;
public BigDecimal getOutstockAmount() {
return outstockAmount;
}
public void setApplyQty(BigDecimal applyQty) {
this.applyQty = applyQty;
public void setOutstockAmount(BigDecimal outstockAmount) {
this.outstockAmount = outstockAmount;
}
public String getPlanCode() {
return planCode;
}
public void setPlanCode(String planCode) {
this.planCode = planCode;
}
public String getPlanDetailCode() {
return planDetailCode;
}
public void setPlanDetailCode(String planDetailCode) {
this.planDetailCode = planDetailCode;
}
@Override

@ -508,7 +508,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
String planDetailCode = wmsRawOutstock.getPlanDetailCode();
if (StringUtils.isEmpty(planCode) || StringUtils.isEmpty(planDetailCode)) {
throw new ServiceException("请选择派工明细信息再领料");
throw new ServiceException("请选择派工信息再领料");
}
Long warehouseId = wmsRawOutstock.getWarehouseId();

@ -24,6 +24,7 @@
<result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/>
<result property="warehouseName" column="warehouse_name"/>
<result property="outstockAmount" column="outstock_amount"/>
</resultMap>
<sql id="selectWmsStockTotalVo">
@ -140,11 +141,13 @@
<select id="selectWmsStockTotalJoinListBySaleOrder" parameterType="WmsStockTotal" resultMap="WmsStockTotalResult">
select wst.stock_total_id, wst.warehouse_id, wst.warehouse_floor, wst.stock_type, wst.material_id,
wst.total_amount, wst.frozen_amount, wst.occupy_amount,wst.safe_flag,
mbmi.material_code,mbmi.material_name,mbmi.material_spec
mbmi.material_code,mbmi.material_name,mbmi.material_spec,
(select sum(wro.outstock_amount) from wms_raw_outstock wro where wro.stock_total_id=wst.stock_total_id and
wro.plan_code=#{planCode} and wro.plan_detail_code=#{planDetailCode}) outstock_amount
from wms_stock_total wst left join mes_base_material_info mbmi on wst.material_id = mbmi.material_id
<where>
and wst.total_amount>0
and wst.total_amount>=0
<if test="warehouseId != null ">and wst.warehouse_id = #{warehouseId}</if>
<if test="warehouseFloor != null ">and wst.warehouse_floor = #{warehouseFloor}</if>
<if test="stockType != null and stockType != ''">and wst.stock_type = #{stockType}</if>

@ -90,3 +90,32 @@ export function getWarehouses4Audit() {
method: 'get'
})
}
export function getStockTotal(query) {
return request({
url: '/wms/rawoutstock/getStockTotal',
method: 'get',
params: query
})
}
// 获取仓库列表
export function getWarehouses4Apply(query) {
return request({
url: '/wms/rawoutstock/getWarehouses4Apply',
method: 'get',
params: query
})
}
// 申请领料
export function applyRawOutstock(query) {
return request({
url: '/wms/rawoutstock/applyRawOutstock',
method: 'post',
data: query
})
}

@ -0,0 +1,329 @@
<template>
<div class="app-container">
<el-form ref="form" :model="form" 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" @change="warehouseChange">
<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="领取原因">
<el-input v-model="form.applyReason" type="textarea"></el-input>
</el-form-item>
</el-form>
<el-table
:cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList"
: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="safeFlag"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_safe_flag" :value="scope.row.safeFlag"/>
</template>
</el-table-column>
<el-table-column
label="可用库存"
prop="availableAmount"
>
</el-table-column>
<el-table-column
label="占用库存"
prop="unavailableAmount"
>
</el-table-column>
<el-table-column
label="已申请"
prop="outstockAmount"
>
</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="操作"
width="160"
>
<template slot="header" slot-scope="scope">
<el-input
v-model="queryParams.materialCodeNameSpec"
placeholder="编码、名称或规格搜索"
size="mini"
@change="searchMaterial"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="searchMaterial"
/>
<div style="text-align: center;margin-top: 30px">
<el-button type="primary" @click="submitForm"></el-button>
</div>
</div>
</template>
<script>
import {getWarehouses, getStockTotal, applyRawOutstock} from "@/api/board";
export default {
name: "Materialinfo",
props: {
defineData: {
type: Object,
default: {}
}
},
dicts: ['mes_safe_flag'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
warehouseList: [],
//
title: "",
//
open: false,
maxPlanAmount: 1,
taskType: '',
//
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
},
//
form: {},
};
},
created() {
this.getData();
this.getWarehouses();
},
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,
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,
wmsRawOutstockDetailList: []
}
}
if (this.defineData.maxPlanAmount) {
this.maxPlanAmount = this.defineData?.maxPlanAmount
}
},
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();
})
},
warehouseChange(warehouseId) {
this.form.wmsRawOutstockDetailList = [];
this.form.warehouseId = warehouseId;
this.searchMaterial();
},
//
searchMaterial() {
if (this.form.warehouseId === null || this.form.warehouseId === undefined
|| this.form.warehouseId === "") {
return;
}
this.queryParams.warehouseId = this.form.warehouseId;
this.queryParams.saleOrderId = this.form.saleOrderId;
this.queryParams.planCode = this.form.planCode;
this.queryParams.planDetailCode = this.form.planDetailCode;
getStockTotal(this.queryParams).then(e => {
this.total = e.total;
this.form.wmsRawOutstockDetailList = e.rows.map(r => {
return {
stockTotalId: r.stockTotalId,
materialId: r.materialId,
materialCode: r.materialCode,
materialName: r.materialName,
safeFlag: r.safeFlag,
availableAmount: r.totalAmount - r.occupyAmount - r.frozenAmount,
unavailableAmount: r.occupyAmount + r.frozenAmount,
outstockAmount: r.outstockAmount,
planAmount: this.planAmount
}
})
})
},
/** 查询物料信息列表 */
getList() {
this.loading = true;
this.queryParams.selectType = this.selectType;
listMaterialinfo(this.queryParams).then(response => {
this.materialinfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
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() {
applyRawOutstock(this.form).then(e => {
this.dialogVisible = false
this.$modal.msgSuccess("申请成功");
})
},
}
};
</script>
<style lang="less" scoped>
.el-table {
background-color: #fff0;
overflow-y: auto;
}
.roundBorder {
position: absolute;
transform: translate(-50%, -50%);
}
</style>

@ -289,113 +289,12 @@
</div>
<el-dialog
:visible.sync="dialogVisible"
:title="applyMaterialTitle"
width="800px">
<el-form ref="form" :model="form1" label-width="100px">
<el-form-item label="派工单号">
<el-input v-model="form1.dispatchCode" disabled></el-input>
</el-form-item>
<el-form-item label="计划编号" v-if="false">
<el-input v-model="form1.planCode" disabled></el-input>
</el-form-item>
<el-form-item label="明细编号">
<el-input v-model="form1.planDetailCode" disabled></el-input>
</el-form-item>
<el-form-item label="仓库">
<el-select v-model="form1.warehouseId" placeholder="请选择仓库" @change="warehouseChange">
<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="领取原因">
<el-input v-model="form1.applyReason" type="textarea"></el-input>
</el-form-item>
</el-form>
<el-table
:cell-style="{textAlign:'center'}"
:data="form1.wmsRawOutstockDetailList"
: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="safeFlag"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_safe_flag" :value="scope.row.safeFlag"/>
</template>
</el-table-column>
<el-table-column
label="可用库存"
prop="availableAmount"
>
</el-table-column>
<el-table-column
label="占用库存"
prop="unavailableAmount"
>
</el-table-column>
<el-table-column
label="领取数量"
prop="planAmount"
width="120"
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.planAmount"
:max="maxPlanAmount"
controls-position="right"
style="width: 100%"
>
</el-input-number>
</template>
</el-table-column>
<el-table-column
label="操作"
width="160"
>
<template slot="header" slot-scope="scope">
<el-input
v-model="queryParams.materialCodeNameSpec"
placeholder="编码、名称或规格搜索"
size="mini"
@change="searchMaterial"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="searchMaterial"
/>
<div style="text-align: center;margin-top: 30px">
<el-button type="primary" @click="receiveMaterial"></el-button>
</div>
<!-- 申请领料信息对话框 -->
<el-dialog :title="applyMaterialTitle" :visible.sync="dialogVisible" append-to-body>
<apply-raw-outstock ref="applyRawOutstockRef" :defineData="productPlanData" v-if="dialogVisible"></apply-raw-outstock>
</el-dialog>
<el-dialog :visible.sync="printModel" class="dialog" title="条码打印" width="80%">
<div>
<PrintPage :defineData="PrintData" v-if="printModel"/>
@ -636,14 +535,13 @@ import {
getProductPlans,
startNextProductPlanDetail,
scan2StartNextProductPlanDetail,
applyRawOutstock,
getStockTotal,
getWarehouses,
bindBarcode,
applyRawBack,
assignTask, scanMaterial2Confirm, applyRawReturn,
getNewestOutstockCabinet,updateBarcodePlan, completeCollectMaterials, completeReturnMaterials,continueRawInstock
} from "@/api/board";
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
const setState = (e) => {
if (e === '1') {
@ -660,6 +558,7 @@ const vw = (document.documentElement.clientWidth || document.body.clientWidth) /
export default {
name: 'Board1',
components: {
'apply-raw-outstock': applyRawOutstock,
Chart,
PrintPage
},
@ -685,6 +584,7 @@ export default {
maxPlanAmount: 1,
taskType: '',
dialogVisible: false,
productPlanData:{},
form: {},
form1: {},
assignTaskForm: {
@ -1485,82 +1385,38 @@ export default {
getMaterials(returnFlag) {
if (returnFlag === '1') {
this.applyMaterialTitle = "领柜体";
this.planAmount = null;
this.maxPlanAmount = 1;
this.taskType = '2';//
} else {
this.applyMaterialTitle = "领料";
this.planAmount = null;
this.maxPlanAmount = 1000000000;
this.taskType = '1';//
}
this.queryParams.materialCodeNameSpec = ''
this.dialogVisible = true
this.form1 = {
this.productPlanData = {
warehouseId: '',
planId: this.form?.planId,
planCode: this.form?.planCode,
dispatchCode: this.form?.dispatchCode,
planDetailCode: this.form?.planDetailCode,
saleOrderId: this.form?.saleOrderId,
maxPlanAmount: this.maxPlanAmount,
returnFlag: returnFlag,
applyReason: '',
taskType: this.taskType,
stationId: this.loginStationInfo.stationId,
endStationCode: this.loginStationInfo.stationCode,
warehouseFloor: 5,
wmsRawOutstockDetailList: []
}
//
getWarehouses({"warehouseFloor": 5, "returnFlag": returnFlag}).then(e => {
this.warehouseList = e.data
this.form1.warehouseId = e.data[0]?.warehouseId
this.searchMaterial();
})
},
//
searchMaterial() {
if (this.form1.warehouseId === null || this.form1.warehouseId === undefined
|| this.form1.warehouseId === "") {
return;
}
this.queryParams.warehouseId = this.form1.warehouseId;
this.queryParams.saleOrderId = this.form1.saleOrderId;
getStockTotal(this.queryParams).then(e => {
this.total = e.total;
this.form1.wmsRawOutstockDetailList = e.rows.map(r => {
return {
stockTotalId: r.stockTotalId,
materialId: r.materialId,
materialCode: r.materialCode,
materialName: r.materialName,
safeFlag: r.safeFlag,
availableAmount: r.totalAmount - r.occupyAmount - r.frozenAmount,
unavailableAmount: r.occupyAmount + r.frozenAmount,
planAmount: this.planAmount
}
})
})
},
warehouseChange(warehouseId) {
this.form.wmsRawOutstockDetailList = [];
this.form.warehouseId = warehouseId;
this.searchMaterial('');
},
receiveMaterial() {
this.form1.taskType = this.taskType;
applyRawOutstock(this.form1).then(e => {
this.dialogVisible = false
this.$message({
message: '申请领取成功',
type: 'success'
});
})
},
print() {
getNewestOutstockCabinet({planDetailCode: this.form.planDetailCode}).then(response => {

@ -12,6 +12,8 @@
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw"
style="width: 100%"
ref="planTable"
highlight-current-row
>
<el-table-column
label="序号"
@ -20,7 +22,7 @@
>
</el-table-column>
<el-table-column
label="工单号"
label="工单号"
prop="planCode"
>
</el-table-column>
@ -30,6 +32,12 @@
width="100"
>
</el-table-column>
<el-table-column
label="成品规格"
prop="materialSpec"
width="100"
>
</el-table-column>
<el-table-column
label="计划"
prop="planAmount"
@ -139,7 +147,7 @@
</div>
<div class="chartBox chartBox3">
<div class="title">计划明细</div>
<div class="title">生产明细</div>
<div class="chart">
<div class="whiteTable">
<el-table
@ -160,7 +168,7 @@
>
</el-table-column>
<el-table-column
label="工单号"
label="工单号"
prop="planCode"
width="80"
>
@ -208,7 +216,7 @@
<el-button
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED" size="small"
type="text"
@click="getMaterials(scope) "
@click="getMaterials(scope.row) "
>
领料
</el-button>
@ -305,93 +313,9 @@
</el-row>
</div>
<el-dialog
:visible.sync="dialogVisible"
title="领料"
width="40%">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="工单编号">
<el-input v-model="form.planCode" disabled></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="请选择领料仓库" @change="warehouseChange">
<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="领料原因">
<el-input v-model="form.applyReason" type="textarea"></el-input>
</el-form-item>
</el-form>
<el-table
:cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList"
: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="safeFlag"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_safe_flag" :value="scope.row.safeFlag"/>
</template>
</el-table-column>
<el-table-column
label="可用库存数量"
prop="availableAmount"
>
</el-table-column>
<el-table-column
label="占用库存数量"
prop="unavailableAmount"
>
</el-table-column>
<el-table-column
label="领取数量"
prop="planAmount"
width="120"
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.planAmount"
:min="0"
controls-position="right"
style="width: 100%"
>
</el-input-number>
</template>
</el-table-column>
<el-table-column
label="操作"
width="160"
>
<template slot="header" slot-scope="scope">
<el-input
v-model="searchMaterialValue"
placeholder="输入物料名称搜索"
size="mini"
@change="searchMaterial"/>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 12px">
<el-button type="primary" @click="receiveMaterial"></el-button>
</div>
<!-- 申请领料信息对话框 -->
<el-dialog title="申请领料" :visible.sync="dialogVisible" append-to-body>
<apply-raw-outstock ref="applyRawOutstockRef" :defineData="productPlanData" v-if="dialogVisible"></apply-raw-outstock>
</el-dialog>
<el-dialog :visible.sync="printModel" class="dialog" title="条码打印" width="80%">
@ -558,9 +482,7 @@ import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import * as echarts from 'echarts'
import {
getStockTotal,
getWarehouses,
applyRawOutstock,
getProductPlans,
insertProductPlanDetails,
getProductPlanDetails,
@ -572,12 +494,14 @@ import {
selectMaterialInstallationCircumstance
} from '@/api/board'
import {getToken} from "@/utils/auth";
import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
name: 'Board1',
dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type',"mes_safe_flag"],
components: {
'apply-raw-outstock': applyRawOutstock,
Chart,
PrintPage,
WorkshopNotice
@ -661,6 +585,7 @@ export default {
ABNORMAL_FINISHED : '9'
},
productPlanData:{}
}
},
mounted() {
@ -679,6 +604,7 @@ export default {
this.nowMaterial = e.rows?.[0]?.materialName
this.materialBomId = e.rows?.[0]?.materialBomId
this.saleOrderId = e.rows?.[0]?.saleOrderId
this.$refs.planTable.setCurrentRow(e.rows?.[0]);
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.rows?.[0]?.planId}).then(res => {
this.tableData1 = res.rows
this.totalNum3 = Math.ceil(res.total / 5)
@ -781,7 +707,7 @@ export default {
// /
planExecute(e) {
if (e.planDetailStatus === '1') {
this.$confirm('是否开始计划', '确认', {
this.$confirm('是否开始生产明细', '确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
@ -897,66 +823,23 @@ export default {
//
getMaterials(val) {
this.searchMaterialValue = ''
this.dialogVisible = true
this.form = {
this.productPlanData = {
warehouseId: '',
planId: val.row.planId,
planCode: val.row.planCode,
planDetailCode: val.row.planDetailCode,
saleOrderId : this.saleOrderId,
planId: val.planId,
planCode: val.planCode,
dispatchCode: val.dispatchCode,
planDetailCode: val.planDetailCode,
saleOrderId: val.saleOrderId,
maxPlanAmount: 100000000,
returnFlag: "0",
applyReason: '',
taskType: '1',
taskType: "1",
warehouseFloor: 1,
wmsRawOutstockDetailList: []
}
//
getWarehouses({"warehouseFloor": 1}).then(e => {
this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId
this.searchMaterial("");
})
},
//
receiveMaterial() {
applyRawOutstock(this.form).then(e => {
if (e.code === 200) {
this.dialogVisible = false
this.$message({
message: '领料完成',
type: 'success'
});
}
})
},
//
searchMaterial(val) {
getStockTotal({
warehouseId: this.form.warehouseId,
saleOrderId: this.saleOrderId,
materialName: val
}).then(e => {
this.form.wmsRawOutstockDetailList = e.data.map(r => {
return {
stockTotalId: r.stockTotalId,
materialId: r.materialId,
materialCode: r.materialCode,
materialName: r.materialName,
safeFlag: r.safeFlag,
availableAmount: r.totalAmount - r.occupyAmount - r.frozenAmount,
unavailableAmount: r.occupyAmount + r.frozenAmount,
planAmount: r.planAmount
}
})
})
},
warehouseChange(warehouseId) {
this.form.wmsRawOutstockDetailList = [];
this.form.warehouseId = warehouseId;
this.getStockTotal();
},
print(val) {
this.PrintData = val
this.printModel = true

@ -166,7 +166,7 @@
v-if="scope.row.planDetailStatus === PLAN_DETAIL_STATUS.STARTED"
size="small"
type="text"
@click="getMaterials(scope) "
@click="getMaterials(scope.row) "
>
领料
</el-button>
@ -227,93 +227,9 @@
</el-row>
</div>
<el-dialog
:visible.sync="dialogVisible"
title="领料"
width="40%">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="派工单号">
<el-input v-model="form.planCode" disabled></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="请选择领料仓库" @change="warehouseChange">
<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="领料原因">
<el-input v-model="form.applyReason" type="textarea"></el-input>
</el-form-item>
</el-form>
<el-table
:cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList"
: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="safeFlag"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_safe_flag" :value="scope.row.safeFlag"/>
</template>
</el-table-column>
<el-table-column
label="可用库存数量"
prop="availableAmount"
>
</el-table-column>
<el-table-column
label="占用库存数量"
prop="unavailableAmount"
>
</el-table-column>
<el-table-column
label="领取数量"
prop="planAmount"
width="120"
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.planAmount"
:min="0"
controls-position="right"
style="width: 100%"
>
</el-input-number>
</template>
</el-table-column>
<el-table-column
label="操作"
width="160"
>
<template slot="header" slot-scope="scope">
<el-input
v-model="searchMaterialValue"
placeholder="输入物料名称搜索"
size="mini"
@change="searchMaterial"/>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 12px">
<el-button type="primary" @click="receiveMaterial"></el-button>
</div>
<!-- 申请领料信息对话框 -->
<el-dialog title="申请领料" :visible.sync="dialogVisible" append-to-body>
<apply-raw-outstock ref="applyRawOutstockRef" :defineData="productPlanData" v-if="dialogVisible"></apply-raw-outstock>
</el-dialog>
@ -415,7 +331,6 @@
import Chart from '@/components/board/Chart'
import PrintPage from '@/views/board/barcode/workshopBarcode'
import * as echarts from 'echarts'
import {getWarehouses, applyRawOutstock} from '@/api/board/firstFloor'
import {
completeProductPlanDetail,
getProductPlanDetails,
@ -427,7 +342,8 @@ import {
fourthFloorProduceOutstock,
scanMaterial2Confirm, applyRawReturn
} from "@/api/board";
import {monitorSerialData} from "@/utils/serial"
import {monitorSerialData} from "@/utils/serial";
import applyRawOutstock from '@//views/board/common/applyRawOutstock.vue';
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -435,6 +351,7 @@ export default {
dicts: ['mes_plan_detail_status', 'wms_raw_return_task_type', 'mes_safe_flag'],
mixins: [monitorSerialData],
components: {
'apply-raw-outstock': applyRawOutstock,
Chart,
PrintPage
},
@ -449,6 +366,7 @@ export default {
returnModelVisible: false,
returnModelForm: {},
WarehousesList: [],
productPlanData:{},
PrintData: {},
printModel: false,
nowNum1: 1,
@ -918,67 +836,25 @@ export default {
},
//
getMaterials(val) {
this.searchMaterialValue = ''
this.dialogVisible = true
this.form = {
this.productPlanData = {
warehouseId: '',
planId: val.row.planId,
planCode: val.row.planCode,
planDetailCode: val.row.planDetailCode,
saleOrderId: this.saleOrderId,
planId: val.planId,
planCode: val.planCode,
dispatchCode: val.dispatchCode,
planDetailCode: val.planDetailCode,
saleOrderId: val.saleOrderId,
maxPlanAmount: 100000000,
returnFlag: "0",
applyReason: '',
taskType: '1',
taskType: "1",
warehouseFloor: 4,
mesAreaType:3,
wmsRawOutstockDetailList: []
}
//
getWarehouses({"warehouseFloor": 4, "mesAreaType": 4}).then(e => {
this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId
this.searchMaterial("");
})
this.dialogVisible = true
},
//
receiveMaterial() {
applyRawOutstock(this.form).then(e => {
if (e.code === 200) {
this.dialogVisible = false
this.$message({
message: '领料完成',
type: 'success'
});
}
})
},
//
searchMaterial(val) {
getStockTotal({
warehouseId: this.form.warehouseId,
saleOrderId: this.saleOrderId,
materialName: val
}).then(e => {
this.form.wmsRawOutstockDetailList = e.data.map(r => {
return {
stockTotalId: r.stockTotalId,
materialId: r.materialId,
materialCode: r.materialCode,
materialName: r.materialName,
safeFlag: r.safeFlag,
availableAmount: r.totalAmount - r.occupyAmount - r.frozenAmount,
unavailableAmount: r.occupyAmount + r.frozenAmount,
planAmount: r.planAmount
}
})
})
},
warehouseChange(warehouseId) {
this.form.wmsRawOutstockDetailList = [];
this.form.warehouseId = warehouseId;
this.getStockTotal();
},
print(val) {
this.PrintData = val
this.PrintData.barcodeType = '4';//

@ -0,0 +1,286 @@
<template>
<div class="app-container">
<el-form ref="form" :model="form" 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.dispatchAmount" disabled style="width:360px"></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>
<el-table
:cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList"
: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="safeFlag"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_safe_flag" :value="scope.row.safeFlag"/>
</template>
</el-table-column>
<el-table-column
label="可用库存"
prop="availableAmount"
>
</el-table-column>
<el-table-column
label="占用库存"
prop="unavailableAmount"
>
</el-table-column>
<el-table-column
label="已申请"
prop="outstockAmount"
>
</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"
style="width: 100%"
>
</el-input-number>
</template>
</el-table-column>
<el-table-column
label="操作"
width="160"
>
<template slot="header" slot-scope="scope">
<el-input
v-model="queryParams.materialCodeNameSpec"
placeholder="编码、名称或规格搜索"
size="mini"
@change="searchMaterial"/>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="searchMaterial"
/>
<div style="text-align: center;margin-top: 30px">
<el-button type="primary" @click="submitForm"></el-button>
</div>
</div>
</template>
<script>
import {getWarehouses4Apply,getStockTotal,applyRawOutstock} from "@/api/wms/rawoutstock";
export default {
name: "Materialinfo",
props: {
defineData: {
type: Object,
default: {}
}
},
dicts: ['mes_safe_flag'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
warehouseList: [],
//
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: null,
deletedFlag: null,
approveDate: null,
erpModifyDate: null
},
//
form: {},
};
},
created() {
this.getData();
this.getWarehouses4Apply();
},
methods: {
getData() {
if (this.defineData.planCode) {
this.form = {
planId: this.defineData.planId,
planCode: this.defineData.planCode,
dispatchAmount : this.defineData.dispatchAmount,
saleOrderId:this.defineData.saleOrderId
}
}
},
getWarehouses4Apply(){
//
getWarehouses4Apply({"warehouseFloor": 3}).then(e => {
this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId
this.searchMaterial();
})
},
//
searchMaterial() {
if (this.form.warehouseId === null || this.form.warehouseId === undefined
|| this.form.warehouseId === "") {
return;
}
this.queryParams.warehouseId = this.form.warehouseId;
this.queryParams.saleOrderId = this.form.saleOrderId;
this.queryParams.planCode = this.form.planCode;
this.queryParams.planDetailCode = "0";
getStockTotal(this.queryParams).then(e => {
this.total = e.total;
this.form.wmsRawOutstockDetailList = e.rows.map(r => {
return {
stockTotalId: r.stockTotalId,
materialId: r.materialId,
materialCode: r.materialCode,
materialName: r.materialName,
safeFlag: r.safeFlag,
availableAmount: r.totalAmount - r.occupyAmount - r.frozenAmount,
unavailableAmount: r.occupyAmount + r.frozenAmount,
outstockAmount:r.outstockAmount,
planAmount: this.planAmount
}
})
})
},
/** 查询物料信息列表 */
getList() {
this.loading = true;
this.queryParams.selectType = this.selectType;
listMaterialinfo(this.queryParams).then(response => {
this.materialinfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
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.form.taskType = "1";//
this.form.planDetailCode = "0";
applyRawOutstock(this.form).then(e => {
this.dialogVisible = false
this.$modal.msgSuccess("申请投料成功");
})
},
}
};
</script>
Loading…
Cancel
Save