修改生产界面

master
夜笙歌 9 months ago
parent 9f3b61d379
commit 60c397d0f3

@ -23,7 +23,17 @@ export function startNextProductPlanDetail(query) {
// 获取信息
export function getNewestProductPlanDetail(query) {
return request({
url: '/mes/api/getNewestProductPlanDetail/'+query,
url: '/mes/api/getNewestProductPlanDetail/',
method: 'get',
params: query
})
}
// 完成
export function completeProductPlanDetail(query) {
return request({
url: '/mes/api/completeProductPlanDetail',
method: 'post',
data: query
})
}

@ -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>

@ -19,16 +19,19 @@
<el-form-item label="物料名称">
<el-input v-model="form.materialName"></el-input>
</el-form-item>
<el-form-item label="扫码时间">
<el-input v-model="form.materialId1"></el-input>
</el-form-item>
<el-form-item label="产品型号">
<el-input v-model="form.materialId1"></el-input>
<el-form-item label="状态">
<el-input v-model="form.planDetailStatus"></el-input>
</el-form-item>
<!-- <el-form-item label="扫码时间">-->
<!-- <el-input v-model="form.materialId1"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="产品型号">-->
<!-- <el-input v-model="form.materialId1"></el-input>-->
<!-- </el-form-item>-->
</el-form>
<div style="text-align: center">
<el-button type="success">图纸下发</el-button>
<el-button type="primary">完成</el-button>
<el-button type="primary" @click="accomplishPlan"></el-button>
</div>
</div>
@ -118,25 +121,40 @@
width="120"
>
<template slot-scope="scope">
<el-button
size="small"
type="text"
<el-popconfirm
confirm-button-text='是'
cancel-button-text='否'
icon="el-icon-info"
v-if="scope.row.completeAmount === 0"
@click="startProduction(scope.row)"
icon-color="red"
@confirm="startNextProduction(scope.row)"
title="确定开始计划吗?"
>
开始
</el-button>
<el-button
size="small"
type="text"
@click="nextProduction(scope.row)"
<el-button
size="small"
type="text"
slot="reference">开始</el-button>
</el-popconfirm>
<el-popconfirm
confirm-button-text='是'
cancel-button-text='否'
icon="el-icon-info"
v-if="scope.row.completeAmount !== 0 && scope.row.completeAmount < scope.row.planAmount"
icon-color="red"
@confirm="startNextProduction(scope.row)"
title="确定继续计划吗?"
>
继续
</el-button>
<el-button
size="small"
type="text"
slot="reference">继续</el-button>
</el-popconfirm>
<el-button
size="small"
type="text"
style="margin-left: 4px"
>
退库
</el-button>
@ -147,6 +165,15 @@
</div>
</div>
<div>
<div class="roundBorder" style="top: 72%;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: 72%;left: 49%;">
<el-button :disabled="nowNum1 >= totalNum1" circle icon="el-icon-right" size="mini" @click="next1"></el-button>
</div>
</div>
<div class="chartBox chartBox4">
<div class="title">当日产量</div>
<div class="chart">
@ -165,14 +192,11 @@
<el-dialog title="板材领料" :visible.sync="getMaterialsModel">
<el-form :model="form">
<el-form-item label="活动名称" label-width="120px">
<el-form-item label="库位码" label-width="120px">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="活动区域" label-width="120px">
<el-select v-model="form.region" placeholder="请选择活动区域">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
<el-form-item label="物料码" label-width="120px">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -186,8 +210,24 @@
<script>
import Chart from '@/components/board/Chart'
import * as echarts from 'echarts'
import {getNewestProductPlanDetail, getProductPlans, startNextProductPlanDetail} from "@/api/board/laserLight";
import {
completeProductPlanDetail,
getNewestProductPlanDetail,
getProductPlans,
startNextProductPlanDetail
} from "@/api/board/laserLight";
const setState = (e)=>{
if(e === '1'){
return '未开始'
}
if(e === '2'){
return '已开始'
}
if(e === '3' || e === '9'){
return '已完成'
}
}
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
name: 'Board1',
@ -196,42 +236,24 @@ export default {
},
data() {
return {
nowNum1: 1,
totalNum1: 0,
getMaterialsModel:false,
form: {},
tableData: [
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
{
workOrderNumber: '202401221413',
planNum: '1000',
realNum: '800',
quantityNum: '200',
startTime: '2024-01-01',
},
],
tableData: [],
}
},
mounted() {
getProductPlans().then(e => {
this.tableData = e.data
this.$refs.table1.setCurrentRow(e.data[0]);
this.getInfo(e.data[0])
getNewestProductPlanDetail(e.data[0].planId).then(val=>{
async mounted() {
const data = await getProductPlans({pageNum: 1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
this.$refs.table1.setCurrentRow(e.rows[0]);
this.getInfo(e.rows[0])
getNewestProductPlanDetail({planId:e.rows[0].planId}).then(val=>{
this.form = val.data
this.form.materialId = e.data[0].materialId
this.form.materialName = e.data[0].materialName
this.form.materialId = e.rows[0].materialId
this.form.materialName = e.rows[0].materialName
this.form.planDetailStatus = setState(val.data.planDetailStatus)
})
})
this.$refs.chart2.setData({
@ -398,14 +420,30 @@ 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)
})
},
getOrderInfo(e){
this.getInfo(e)
getNewestProductPlanDetail(e.planId).then(val=>{
getNewestProductPlanDetail({planId:e.planId}).then(val=>{
this.form = val.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName
this.form.planDetailStatus = setState(val.data.planDetailStatus)
})
},
//
getInfo(e) {
this.$refs.chart1_1.setData({
series: [
@ -724,17 +762,45 @@ export default {
],
})
},
startProduction(e){
},
async nextProduction(e){
this.getInfo(e)
const data = await startNextProductPlanDetail({planId:e.planId})
//
async startNextProduction(e){
const data = await startNextProductPlanDetail({planId: e.planId})
this.form = data.data
this.form.materialId = e.materialId
this.form.materialName = e.materialName
this.form.planDetailStatus = setState(data.data.planDetailStatus)
},
//
accomplishPlan(){
this.$confirm('是否完成计划', '确认', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'success'
}).then(() => {
completeProductPlanDetail({
planDetailId: this.form.planDetailId
})
.then(() => {
this.$message({
type: 'success',
message: '已完成'
});
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5)
let data = e.rows.find(v=>v.planCode === this.form.planCode) || null
this.$refs.table1.setCurrentRow(data || e.rows[0]);
this.getInfo(data ||e.rows[0])
})
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
})
}
}
}
</script>
@ -891,4 +957,8 @@ export default {
border-radius: 0;
}
}
.roundBorder {
position: absolute;
transform: translate(-50%, -50%);
}
</style>

@ -107,6 +107,26 @@ export default {
floor: 1,
processId: 1,
route: '/board/firstFloor'
},
{
floor: 4,
processId: 41,
route: '/board/laserLight'
},
{
floor: 4,
processId: 42,
route: '/board/assemble'
},
{
floor: 4,
processId: 43,
route: '/board/weld'
},
{
floor: 5,
processId: 51,
route: '/board/fifthFloor'
}
]
};

Loading…
Cancel
Save