|
|
|
@ -81,6 +81,14 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="roundBorder" style="top: 32%;left: 1.2%;">
|
|
|
|
|
<el-button :disabled="nowNum1 <= 1" circle icon="el-icon-back" size="mini" @click="pre1"></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="roundBorder" style="top: 32%;left: 49%;">
|
|
|
|
|
<el-button :disabled="nowNum1 >= totalNum1" circle icon="el-icon-right" size="mini" @click="next1"></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="chartBox chartBox2">
|
|
|
|
|
<div class="title">库存统计</div>
|
|
|
|
@ -88,6 +96,14 @@
|
|
|
|
|
<Chart ref="chart2"></Chart>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="roundBorder" style="top: 72%;left: 1.2%;">
|
|
|
|
|
<el-button :disabled="nowNum2 <= 1" circle icon="el-icon-back" size="mini" @click="pre2"></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="roundBorder" style="top: 72%;left: 49%;">
|
|
|
|
|
<el-button :disabled="nowNum2 >= totalNum2" circle icon="el-icon-right" size="mini" @click="next2"></el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="chartBox chartBox3">
|
|
|
|
|
<div class="title">计划明细</div>
|
|
|
|
@ -201,17 +217,11 @@
|
|
|
|
|
title="领料"
|
|
|
|
|
width="40%">
|
|
|
|
|
<el-form ref="form" :model="form" label-width="80px">
|
|
|
|
|
<el-form-item label="生产计划">
|
|
|
|
|
<el-form-item label="工单编号">
|
|
|
|
|
<el-input v-model="form.planCode"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-show="false" label="成品">
|
|
|
|
|
<el-input v-model="form.productId"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item v-show="false" label="领料类型">
|
|
|
|
|
<el-select v-model="form.taskType" placeholder="请选择领料类型">
|
|
|
|
|
<el-option label="类型一" value="shanghai"></el-option>
|
|
|
|
|
<el-option label="类型二" value="beijing"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-form-item label="明细编号">
|
|
|
|
|
<el-input v-model="form.planDetailCode"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="领料仓库">
|
|
|
|
|
<el-select v-model="form.warehouseId" placeholder="请选择领料仓库" @change="form.wmsRawOutstockDetailList =[]">
|
|
|
|
@ -247,6 +257,7 @@
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input-number
|
|
|
|
|
:min="0"
|
|
|
|
|
v-model="scope.row.quantityAcquired"
|
|
|
|
|
controls-position="right"
|
|
|
|
|
style="width: 100%"
|
|
|
|
@ -302,35 +313,29 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
nowNum1: 1,
|
|
|
|
|
totalNum1: 0,
|
|
|
|
|
nowNum2: 1,
|
|
|
|
|
totalNum2: 0,
|
|
|
|
|
planId: null,
|
|
|
|
|
materialBomId: null,
|
|
|
|
|
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
|
|
|
|
|
searchMaterialValue: '',
|
|
|
|
|
warehouseList: [],
|
|
|
|
|
form: {
|
|
|
|
|
warehouseId: '',
|
|
|
|
|
planCode: '',
|
|
|
|
|
applyReason: '',
|
|
|
|
|
productId: '' || 2,
|
|
|
|
|
planDetailCode: '' || 1,
|
|
|
|
|
taskType: '1',
|
|
|
|
|
wmsRawOutstockDetailList: []
|
|
|
|
|
},
|
|
|
|
|
form2: {
|
|
|
|
|
materialId: '',
|
|
|
|
|
materialName: '',
|
|
|
|
|
planAmount: '',
|
|
|
|
|
quantityAcquired: 0,
|
|
|
|
|
},
|
|
|
|
|
form: {},
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
addDialogVisible: false,
|
|
|
|
|
tableData: [],
|
|
|
|
|
tableData1: [],
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
getProductPlans().then(e => {
|
|
|
|
|
this.tableData = e.data
|
|
|
|
|
getProductPlanDetails({planId: e.data?.[0]?.planId}).then(res => {
|
|
|
|
|
this.tableData1 = res.data
|
|
|
|
|
getProductPlans({pageNum: 1, pageSize: 5}).then(e => {
|
|
|
|
|
this.tableData = e.rows
|
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
|
this.materialBomId = e.rows?.[0]?.materialBomId
|
|
|
|
|
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.rows?.[0]?.planId}).then(res => {
|
|
|
|
|
this.tableData1 = res.rows
|
|
|
|
|
this.totalNum2 = Math.ceil(res.total / 5)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
this.$refs.chart2.setData({
|
|
|
|
@ -497,8 +502,36 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
next1() {
|
|
|
|
|
this.nowNum1 += 1
|
|
|
|
|
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
|
|
|
|
|
this.tableData = e.rows
|
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
pre1() {
|
|
|
|
|
this.nowNum1 -= 1
|
|
|
|
|
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
|
|
|
|
|
this.tableData = e.rows
|
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
next2() {
|
|
|
|
|
this.nowNum2 += 1
|
|
|
|
|
getProductPlanDetails({pageNum: this.nowNum2, pageSize: 5, planId: this.planId}).then(res => {
|
|
|
|
|
this.tableData1 = res.rows
|
|
|
|
|
this.totalNum2 = Math.ceil(res.total / 5)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
pre2() {
|
|
|
|
|
this.nowNum2 -= 1
|
|
|
|
|
getProductPlanDetails({pageNum: this.nowNum2, pageSize: 5, planId: this.planId}).then(res => {
|
|
|
|
|
this.tableData1 = res.rows
|
|
|
|
|
this.totalNum2 = Math.ceil(res.total / 5)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 开始/继续计划
|
|
|
|
|
planExecute(e) {
|
|
|
|
|
console.log(e)
|
|
|
|
|
if (e.planDetailStatus === '1') {
|
|
|
|
|
this.$confirm('是否开始计划', '确认', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
@ -510,8 +543,9 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.getDetail({row: {planId: e.planId}})
|
|
|
|
|
getProductPlans().then(e => {
|
|
|
|
|
this.tableData = e.data
|
|
|
|
|
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
|
|
|
|
|
this.tableData = e.rows
|
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
@ -533,8 +567,9 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
this.getDetail({row: {planId: e.planId}})
|
|
|
|
|
getProductPlans().then(e => {
|
|
|
|
|
this.tableData = e.data
|
|
|
|
|
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
|
|
|
|
|
this.tableData = e.rows
|
|
|
|
|
this.totalNum1 = Math.ceil(e.total / 5)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
@ -546,9 +581,13 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 生成/获取明细
|
|
|
|
|
getDetail(e) {
|
|
|
|
|
getProductPlanDetails({planId: e.row.planId}).then(res => {
|
|
|
|
|
if (res.data.length === 0) {
|
|
|
|
|
this.planId = e.row.planId
|
|
|
|
|
this.materialBomId = e.row.materialBomId
|
|
|
|
|
this.nowNum2 = 1
|
|
|
|
|
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.row.planId}).then(res => {
|
|
|
|
|
if (res.rows.length === 0) {
|
|
|
|
|
this.$confirm('是否生成计划明细', '确认', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
@ -557,7 +596,10 @@ export default {
|
|
|
|
|
insertProductPlanDetails({
|
|
|
|
|
"planId": e.row.planId,
|
|
|
|
|
}).then(val => {
|
|
|
|
|
this.tableData1 = val.data
|
|
|
|
|
getProductPlanDetails({pageNum: this.nowNum2, pageSize: 5, planId: e.row.planId}).then(res => {
|
|
|
|
|
this.tableData1 = res.rows
|
|
|
|
|
this.totalNum2 = Math.ceil(res.total / 5)
|
|
|
|
|
})
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: `生成完成`
|
|
|
|
@ -571,32 +613,33 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.tableData1 = res.data
|
|
|
|
|
this.tableData1 = res.rows
|
|
|
|
|
this.totalNum2 = Math.ceil(res.total / 5)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 领料页面
|
|
|
|
|
getMaterials(val) {
|
|
|
|
|
this.searchMaterialValue = ''
|
|
|
|
|
this.dialogVisible = true
|
|
|
|
|
this.form = {
|
|
|
|
|
warehouseId: '',
|
|
|
|
|
planCode: val.row.planNumber,
|
|
|
|
|
productId: '' || 2,
|
|
|
|
|
planDetailCode: '' || 1,
|
|
|
|
|
planCode: val.row.planCode,
|
|
|
|
|
planDetailCode: val.row.planDetailCode,
|
|
|
|
|
applyReason: '',
|
|
|
|
|
taskType: '1',
|
|
|
|
|
wmsRawOutstockDetailList: []
|
|
|
|
|
}
|
|
|
|
|
getWarehouses({
|
|
|
|
|
warehouseFloor: 1
|
|
|
|
|
}).then(e => {
|
|
|
|
|
// 获取仓库信息
|
|
|
|
|
getWarehouses().then(e => {
|
|
|
|
|
this.warehouseList = e.data
|
|
|
|
|
this.form.warehouseId = e.data[0]?.warehouseId
|
|
|
|
|
})
|
|
|
|
|
// 获取物料信息
|
|
|
|
|
getMaterialBoms({
|
|
|
|
|
ancestors: 1,
|
|
|
|
|
ancestors: this.materialBomId,
|
|
|
|
|
}).then(e => {
|
|
|
|
|
this.form.wmsRawOutstockDetailList = e.data.map(r => {
|
|
|
|
|
return {
|
|
|
|
@ -607,13 +650,9 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
addMaterialRequisition() {
|
|
|
|
|
this.addDialogVisible = false
|
|
|
|
|
this.form.wmsRawOutstockDetailList.push(this.form2)
|
|
|
|
|
},
|
|
|
|
|
// 申请领料
|
|
|
|
|
receiveMaterial() {
|
|
|
|
|
applyRawOutstock(this.form).then(e => {
|
|
|
|
|
console.log(e)
|
|
|
|
|
if (e.code === 200) {
|
|
|
|
|
this.dialogVisible = false
|
|
|
|
|
this.$message({
|
|
|
|
@ -623,9 +662,11 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 物料搜索
|
|
|
|
|
searchMaterial(val) {
|
|
|
|
|
getMaterialBoms({
|
|
|
|
|
ancestors: 1,
|
|
|
|
|
warehouseFloor:1,
|
|
|
|
|
ancestors: this.materialBomId,
|
|
|
|
|
materialName: val
|
|
|
|
|
}).then(e => {
|
|
|
|
|
this.form.wmsRawOutstockDetailList = e.data.map(r => {
|
|
|
|
@ -737,4 +778,9 @@ export default {
|
|
|
|
|
bottom: 1.5%;
|
|
|
|
|
left: 2%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.roundBorder {
|
|
|
|
|
position: absolute;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|