修改生产界面

master
夜笙歌 7 months ago
parent bc04ddac1a
commit 6e3be17158

@ -7,11 +7,11 @@
<div class="chart">
<div class="whiteTable">
<el-table
:data="tableData"
style="width: 100%"
:max-height="19.13 * vw"
:cell-style="{textAlign:'center'}"
:data="tableData"
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw"
style="width: 100%"
>
<el-table-column
label="序号"
@ -20,31 +20,40 @@
>
</el-table-column>
<el-table-column
prop="workOrderNumber"
label="工单编号"
prop="planCode"
>
</el-table-column>
<el-table-column
label="物料名称"
prop="materialName"
width="100"
>
</el-table-column>
<el-table-column
prop="plan"
label="计划"
prop="planAmount"
width="100"
>
</el-table-column>
<el-table-column
prop="practical"
label="实际"
prop="completeAmount"
width="100"
>
</el-table-column>
<el-table-column
prop="difference"
label="差异"
prop="difference"
width="100"
>
<template slot-scope="scope">
{{ scope.row.planAmount - scope.row.completeAmount }}
</template>
</el-table-column>
<el-table-column
prop="deliveryTime"
label="交付时间"
prop="planDeliveryDate"
width="150"
>
</el-table-column>
@ -54,16 +63,17 @@
>
<template slot-scope="scope">
<el-button
type="text"
size="small"
type="text"
>
条码打印
</el-button>
<el-button
type="text"
size="small"
type="text"
@click="getDetail(scope)"
>
开始
明细
</el-button>
</template>
</el-table-column>
@ -71,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>
@ -84,11 +102,11 @@
<div class="chart">
<div class="whiteTable">
<el-table
:data="tableData1"
style="width: 100%"
:max-height="19.13 * vw"
:cell-style="{textAlign:'center'}"
:data="tableData1"
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw"
style="width: 100%"
>
<el-table-column
@ -98,57 +116,70 @@
>
</el-table-column>
<el-table-column
prop="planNumber"
label="计划编号"
label="工单编号"
prop="planCode"
width="80"
>
</el-table-column>
<el-table-column
prop="workOrderNumber"
label="工单编号"
label="明细编号"
prop="planDetailCode"
>
</el-table-column>
<el-table-column
prop="startTime"
label="开始时间"
width="200"
prop="realBeginTime"
width="120"
>
</el-table-column>
<el-table-column
label="操作"
label="结束时间"
prop="realEndTime"
width="120"
>
</el-table-column>
<el-table-column
label="状态"
prop="createTime"
width="80"
>
<template slot-scope="scope">
<el-tag v-if="scope.row.planDetailStatus==='1'" size="small"></el-tag>
<el-tag v-if="scope.row.planDetailStatus==='2'" size="small" type="info"></el-tag>
<el-tag v-if="scope.row.planDetailStatus==='3'" size="small" type="success"></el-tag>
</template>
</el-table-column>
<el-table-column
label="操作"
width="160"
>
<template slot-scope="scope">
<el-button
type="text"
v-if="scope.row.planDetailStatus !== '3'"
size="small"
type="text"
@click="planExecute(scope.row)"
>
装配
{{ scope.row.planDetailStatus === '1' ? '开始' : '完成' }}
</el-button>
<el-button
type="text"
size="small"
type="text"
@click="getMaterials(scope) "
>
领料
</el-button>
<el-button
type="text"
size="small"
type="text"
>
扫描
</el-button>
<el-button
type="text"
size="small"
>
退料
</el-button>
<el-button
type="text"
size="small"
style="color: #f56c6c"
>
删除
退料
</el-button>
</template>
</el-table-column>
@ -156,6 +187,14 @@
</div>
</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 chartBox4">
<div class="title">当日产量</div>
@ -174,37 +213,38 @@
</div>
<el-dialog
title="领料"
: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"></el-input>
</el-form-item>
<el-form-item label="成品" v-show="false">
<el-form-item v-show="false" label="成品">
<el-input v-model="form.productId"></el-input>
</el-form-item>
<el-form-item label="领料类型" v-show="false">
<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>
<el-form-item label="领料仓库" >
<el-form-item label="领料仓库">
<el-select v-model="form.warehouseId" placeholder="请选择领料仓库" @change="form.wmsRawOutstockDetailList =[]">
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName" :value="item.warehouseId"></el-option>
<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 type="textarea" v-model="form.applyReason"></el-input>
<el-input v-model="form.applyReason" type="textarea"></el-input>
</el-form-item>
</el-form>
<el-table
:data="form.wmsRawOutstockDetailList"
style="width: 100%"
:max-height="19.13 * vw"
:cell-style="{textAlign:'center'}"
:data="form.wmsRawOutstockDetailList"
:header-cell-style="{textAlign:'center'}"
:max-height="19.13 * vw"
style="width: 100%"
>
<el-table-column
label="物料编号"
@ -212,20 +252,20 @@
>
</el-table-column>
<el-table-column
prop="materialName"
label="物料名称"
prop="materialName"
>
</el-table-column>
<el-table-column
prop="planAmount"
label="领取数量"
prop="planAmount"
width="120"
>
<template slot-scope="scope">
<el-input-number
style="width: 100%"
controls-position="right"
v-model="scope.row.quantityAcquired"
controls-position="right"
style="width: 100%"
>
</el-input-number>
</template>
@ -237,14 +277,14 @@
<template slot="header" slot-scope="scope">
<el-input
v-model="searchMaterialValue"
placeholder="输入物料名称搜索"
size="mini"
@change="searchMaterial"
placeholder="输入物料名称搜索"/>
@change="searchMaterial"/>
</template>
<template slot-scope="scope">
<el-button
type="text"
size="small"
type="text"
>
删除
</el-button>
@ -261,7 +301,14 @@
<script>
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
import {getMaterialBoms,getWarehouses,applyRawOutstock} from'@/api/board/firstFloor'
import {getMaterialBoms, getWarehouses, applyRawOutstock} from '@/api/board/firstFloor'
import {
completeProductPlanDetail,
getProductPlanDetails,
getProductPlans, getStockTotal,
insertProductPlanDetails,
startProductPlanDetail
} from "@/api/board";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -271,69 +318,31 @@ 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,
},
searchMaterialValue: '',
warehouseList: [],
form: {},
dialogVisible: false,
addDialogVisible: false,
tableData: [
{
workOrderNumber: '202401221413',
plan: '1000',
practical: '800',
difference: '200',
deliveryTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
plan: '1000',
practical: '800',
difference: '200',
deliveryTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
plan: '1000',
practical: '800',
difference: '200',
deliveryTime: '2024-01-01',
}
],
tableData1: [
{
workOrderNumber: '202401221413',
planNumber: '202401221413-1',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNumber: '202401221413-2',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNumber: '202401221413-3',
startTime: '2024-01-01',
},
],
tableData: [],
tableData1: [],
}
},
mounted() {
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({
tooltip: {
trigger: 'axis',
@ -498,44 +507,152 @@ 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) {
if (e.planDetailStatus === '1') {
this.$confirm('是否开始计划', '确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
startProductPlanDetail({
planDetailId: e.planDetailId
})
.finally(() => {
this.getDetail({row: {planId: e.planId}})
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
})
}
if (e.planDetailStatus === '2') {
this.$confirm('是否完成计划', '确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
completeProductPlanDetail({
planDetailId: e.planDetailId
})
.finally(() => {
this.getDetail({row: {planId: e.planId}})
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
})
}
},
// /
getDetail(e) {
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: '取消',
type: 'success'
}).then(() => {
insertProductPlanDetails({
"planId": e.row.planId,
}).then(val => {
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: `生成完成`
});
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
})
} else {
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,
planId: val.row.planId,
planCode: val.row.planCode,
planDetailCode: val.row.planDetailCode,
applyReason: '',
taskType: '1',
wmsRawOutstockDetailList: []
}
getWarehouses({
warehouseFloor:1
}).then(e=>{
//
getWarehouses({"warehouseFloor":1}).then(e => {
this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId
this.searchMaterial("");
})
getMaterialBoms({
ancestors:1,
}).then(e=>{
this.form.wmsRawOutstockDetailList = e.data.map(r=>{
return {
materialId:r.materialId,
materialName:r.materialName,
planAmount:0,
}
})
})
},
addMaterialRequisition() {
this.addDialogVisible = false
this.form.wmsRawOutstockDetailList.push(this.form2)
},
//
receiveMaterial() {
applyRawOutstock(this.form).then(e=>{
console.log(e)
if(e.code === 200){
applyRawOutstock(this.form).then(e => {
if (e.code === 200) {
this.dialogVisible = false
this.$message({
message: '领料完成',
@ -544,20 +661,29 @@ export default {
}
})
},
searchMaterial(val){
console.log(val)
getMaterialBoms({
ancestors:1,
materialName:val
}).then(e=>{
this.form.wmsRawOutstockDetailList = e.data.map(r=>{
//
searchMaterial(val) {
getStockTotal({
warehouseId:this.form.warehouseId,
materialName: val
}).then(e => {
this.form.wmsRawOutstockDetailList = e.data.map(r => {
return {
materialId:r.materialId,
materialName:r.materialName,
planAmount:0,
materialId: r.materialId,
materialCode: r.materialCode,
materialName: r.materialName,
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();
}
}
}
@ -658,4 +784,8 @@ export default {
bottom: 1.5%;
left: 2%;
}
.roundBorder {
position: absolute;
transform: translate(-50%, -50%);
}
</style>

@ -14,17 +14,17 @@
<el-input v-model="form.planDetailCode"></el-input>
</el-form-item>
<el-form-item label="成品名称">
<el-input v-model="form.materialId"></el-input>
<el-input v-model="form.materialName"></el-input>
</el-form-item>
<el-form-item label="成品编号">
<el-input v-model="form.materialName"></el-input>
<el-input v-model="form.materialCode"></el-input>
</el-form-item>
<el-form-item label="状态">
<el-input v-model="form.planDetailStatus"></el-input>
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button type="primary" @click="finish()"></el-button>
<el-button type="primary" @click="finish()" :disabled="form.planDetailStatus === '已完成'">完成</el-button>
</div>
</div>

Loading…
Cancel
Save