修改生产界面

master
夜笙歌 8 months ago
parent cd75a5272b
commit bc6f67a32a

@ -43,3 +43,28 @@ export function getPlanDrawings(query) {
params: query params: query
}) })
} }
export function applyRawOutstock(query) {
return request({
url: '/wms/api/applyRawOutstock',
method: 'post',
data: query
})
}
export function getStockTotal(query) {
return request({
url: '/wms/api/getStockTotal',
method: 'get',
params: query
})
}
export function getWarehouses(query) {
return request({
url: '/wms/api/getWarehouses',
method: 'get',
params: query
})
}

@ -166,7 +166,7 @@
</el-row> </el-row>
</div> </div>
<el-dialog title="板材领料" :visible.sync="getMaterialsModel"> <el-dialog :visible.sync="getMaterialsModel" title="板材领料">
<el-form :model="form"> <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-input v-model="form.name" autocomplete="off"></el-input>
@ -236,8 +236,8 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input-number <el-input-number
:min="0"
v-model="scope.row.planAmount" v-model="scope.row.planAmount"
:min="0"
controls-position="right" controls-position="right"
style="width: 100%" style="width: 100%"
> >
@ -272,18 +272,20 @@ import {
getNewestProductPlanDetail, getNewestProductPlanDetail,
getProductPlans, getProductPlans,
startNextProductPlanDetail, startNextProductPlanDetail,
getPlanDrawings getPlanDrawings,
applyRawOutstock,
getStockTotal,
getWarehouses
} from "@/api/board/fifthFloor"; } from "@/api/board/fifthFloor";
import {applyRawOutstock, getStockTotal, getWarehouses} from "@/api/board/firstFloor";
const setState = (e)=>{ const setState = (e) => {
if(e === '1'){ if (e === '1') {
return '未开始' return '未开始'
} }
if(e === '2'){ if (e === '2') {
return '已开始' return '已开始'
} }
if(e === '3' || e === '9'){ if (e === '3' || e === '9') {
return '已完成' return '已完成'
} }
} }
@ -297,7 +299,7 @@ export default {
return { return {
nowNum1: 1, nowNum1: 1,
totalNum1: 0, totalNum1: 0,
getMaterialsModel:false, getMaterialsModel: false,
dialogVisible: false, dialogVisible: false,
form: {}, form: {},
form1: {}, form1: {},
@ -312,7 +314,7 @@ export default {
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / 5)
this.$refs.table1.setCurrentRow(e.rows[0]); this.$refs.table1.setCurrentRow(e.rows[0]);
this.getInfo(e.rows[0]) this.getInfo(e.rows[0])
getNewestProductPlanDetail({planId:e.rows[0].planId}).then(val=>{ getNewestProductPlanDetail({planId: e.rows[0].planId}).then(val => {
this.form = val.data this.form = val.data
this.form.materialId = e.rows[0].materialId this.form.materialId = e.rows[0].materialId
this.form.materialName = e.rows[0].materialName this.form.materialName = e.rows[0].materialName
@ -497,9 +499,9 @@ export default {
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / 5)
}) })
}, },
getOrderInfo(e){ getOrderInfo(e) {
this.getInfo(e) this.getInfo(e)
getNewestProductPlanDetail({planId:e.planId}).then(val=>{ getNewestProductPlanDetail({planId: e.planId}).then(val => {
this.form = val.data this.form = val.data
this.form.materialId = e.materialId this.form.materialId = e.materialId
this.form.materialName = e.materialName this.form.materialName = e.materialName
@ -543,7 +545,7 @@ export default {
center: ["50%", "50%"], center: ["50%", "50%"],
data: [ data: [
{ {
value: e.planAmount === 0 ? 0.0001 : e.planAmount , value: e.planAmount === 0 ? 0.0001 : e.planAmount,
label: { label: {
normal: { normal: {
rich: { rich: {
@ -622,7 +624,7 @@ export default {
center: ["50%", "50%"], center: ["50%", "50%"],
data: [ data: [
{ {
value: e.completeAmount === 0 ? 0.0001 : e.completeAmount , value: e.completeAmount === 0 ? 0.0001 : e.completeAmount,
label: { label: {
normal: { normal: {
rich: { rich: {
@ -701,7 +703,7 @@ export default {
center: ["50%", "50%"], center: ["50%", "50%"],
data: [ data: [
{ {
value: (e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount) , value: (e.planAmount - e.completeAmount) === 0 ? 0.0001 : (e.planAmount - e.completeAmount),
label: { label: {
normal: { normal: {
rich: { rich: {
@ -780,7 +782,7 @@ export default {
center: ["50%", "50%"], center: ["50%", "50%"],
data: [ data: [
{ {
value: ((e.completeAmount / e.planAmount)*100).toFixed(2), value: ((e.completeAmount / e.planAmount) * 100).toFixed(2),
label: { label: {
normal: { normal: {
rich: { rich: {
@ -822,7 +824,7 @@ export default {
}, },
}, },
{ {
value: ((1-(e.completeAmount / e.planAmount))*100).toFixed(2), value: ((1 - (e.completeAmount / e.planAmount)) * 100).toFixed(2),
name: "invisible", name: "invisible",
itemStyle: { itemStyle: {
normal: { normal: {
@ -842,10 +844,10 @@ export default {
async startNextProduction(val, e) { async startNextProduction(val, e) {
const dataIndex = this.tableData.indexOf(val) const dataIndex = this.tableData.indexOf(val)
const lineIndex = this.tableData[dataIndex].drawing.indexOf(e) const lineIndex = this.tableData[dataIndex].drawing.indexOf(e)
this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag',false) this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag', false)
await startNextProductPlanDetail({planId: val.planId, attachId: e.attachId}) await startNextProductPlanDetail({planId: val.planId, attachId: e.attachId})
.catch(() => { .catch(() => {
this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag',true) this.$set(this.tableData?.[dataIndex]?.[lineIndex], 'dispatchFlag', true)
}) })
getNewestProductPlanDetail({planId: val.planId}).then(val => { getNewestProductPlanDetail({planId: val.planId}).then(val => {
this.form = val.data this.form = val.data
@ -864,7 +866,7 @@ export default {
}) })
}, },
// //
accomplishPlan(){ accomplishPlan() {
this.$confirm('是否完成计划', '确认', { this.$confirm('是否完成计划', '确认', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -881,9 +883,9 @@ export default {
getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {
this.tableData = e.rows this.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / 5)
let data = e.rows.find(v=>v.planCode === this.form.planCode) || null let data = e.rows.find(v => v.planCode === this.form.planCode) || null
this.$refs.table1.setCurrentRow(data || e.rows[0]); this.$refs.table1.setCurrentRow(data || e.rows[0]);
this.getInfo(data ||e.rows[0]) this.getInfo(data || e.rows[0])
}) })
}) })
}) })
@ -909,7 +911,7 @@ export default {
wmsRawOutstockDetailList: [] wmsRawOutstockDetailList: []
} }
// //
getWarehouses({"warehouseFloor":5}).then(e => { getWarehouses({"warehouseFloor": 5}).then(e => {
this.warehouseList = e.data this.warehouseList = e.data
this.form1.warehouseId = e.data[0]?.warehouseId this.form1.warehouseId = e.data[0]?.warehouseId
@ -921,7 +923,7 @@ export default {
// //
searchMaterial(val) { searchMaterial(val) {
getStockTotal({ getStockTotal({
warehouseId:this.form1.warehouseId, warehouseId: this.form1.warehouseId,
materialName: val materialName: val
}).then(e => { }).then(e => {
this.form1.wmsRawOutstockDetailList = e.data.map(r => { this.form1.wmsRawOutstockDetailList = e.data.map(r => {
@ -929,8 +931,8 @@ export default {
materialId: r.materialId, materialId: r.materialId,
materialCode: r.materialCode, materialCode: r.materialCode,
materialName: r.materialName, materialName: r.materialName,
availableAmount: r.totalAmount-r.occupyAmount-r.frozenAmount, availableAmount: r.totalAmount - r.occupyAmount - r.frozenAmount,
unavailableAmount: r.occupyAmount+r.frozenAmount, unavailableAmount: r.occupyAmount + r.frozenAmount,
planAmount: r.planAmount planAmount: r.planAmount
} }
}) })
@ -938,14 +940,14 @@ export default {
}, },
warehouseChange(warehouseId){ warehouseChange(warehouseId) {
this.form.wmsRawOutstockDetailList =[]; this.form.wmsRawOutstockDetailList = [];
this.form.warehouseId = warehouseId; this.form.warehouseId = warehouseId;
this.getStockTotal(); this.getStockTotal();
}, },
receiveMaterial() { receiveMaterial() {
applyRawOutstock(this.form).then(e => { applyRawOutstock(this.form1).then(e => {
if (e.code === 200) { if (e.code === 200) {
this.dialogVisible = false this.dialogVisible = false
this.$message({ this.$message({
@ -1111,6 +1113,7 @@ export default {
border-radius: 0; border-radius: 0;
} }
} }
.roundBorder { .roundBorder {
position: absolute; position: absolute;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);

Loading…
Cancel
Save