修改生产界面

master
夜笙歌 8 months ago
parent cd75a5272b
commit bc6f67a32a

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

Loading…
Cancel
Save