修改生产界面

master
夜笙歌 7 months ago
parent 239aa3c1a2
commit 467ef43c84

@ -213,6 +213,16 @@ export function applyRawBack(data) {
} }
// 退库
export function applyRawReturn(data) {
return request({
url: '/wms/api/applyRawReturn',
method: 'post',
data: data
})
}
// 下发柜体到具体工位 // 下发柜体到具体工位
export function assignTask(data) { export function assignTask(data) {
return request({ return request({

@ -82,6 +82,7 @@
</div> </div>
</div> </div>
</div> </div>
<div> <div>
<div class="roundBorder" style="top: 32%;left: 1.2%;"> <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> <el-button :disabled="nowNum1 <= 1" circle icon="el-icon-back" size="mini" @click="pre1"></el-button>
@ -225,9 +226,9 @@
prop="createTime" prop="createTime"
width="80" width="80"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.mes_plan_detail_status" :value="scope.row.planDetailStatus"/> <dict-tag :options="dict.type.mes_plan_detail_status" :value="scope.row.planDetailStatus"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -262,6 +263,7 @@
<el-button <el-button
size="small" size="small"
type="text" type="text"
@click="returnMaterial(scope)"
> >
退料 退料
</el-button> </el-button>
@ -433,8 +435,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%"
> >
@ -459,9 +461,9 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="printModel" title="条码打印" width="80%" class="dialog"> <el-dialog :visible.sync="printModel" class="dialog" title="条码打印" width="80%">
<div style="height: 50vh;"> <div style="height: auto;">
<PrintPage :defineData="PrintData" /> <PrintPage :defineData="PrintData"/>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="printModel = false">关闭</el-button> <el-button @click="printModel = false">关闭</el-button>
@ -489,10 +491,10 @@
title="确认物料使用" title="确认物料使用"
width="40%"> width="40%">
<el-form ref="materialConfirmForm" :model="materialConfirmForm" :rules="materialConfirmRules" label-width="80px"> <el-form ref="materialConfirmForm" :model="materialConfirmForm" :rules="materialConfirmRules" label-width="80px">
<el-form-item label="计划ID" prop="planId" v-if="false"> <el-form-item v-if="false" label="计划ID" prop="planId">
<el-input v-model="materialConfirmForm.planId"></el-input> <el-input v-model="materialConfirmForm.planId"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="明细ID" prop="planDetailId" v-if="false"> <el-form-item v-if="false" label="明细ID" prop="planDetailId">
<el-input v-model="materialConfirmForm.planDetailId"></el-input> <el-input v-model="materialConfirmForm.planDetailId"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物料条码" prop="materialBarcode"> <el-form-item label="物料条码" prop="materialBarcode">
@ -508,6 +510,45 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="returnModelVisible" title="退料" width="25%">
<el-form ref="returnModelForm" :model="returnModelForm" label-width="80px" :rules="returnModelFormRules">
<el-form-item label="计划编号" >
<el-input v-model="returnModelForm.planCode" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="明细编号" >
<el-input v-model="returnModelForm.planDetailCode" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="成品" >
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="物料条码" >
<el-input placeholder="请输入内容" v-model="returnModelForm.materialBarcode" class="input-with-select" @blur="setReturnModelForm">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item label="仓库" >
<el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库" :disabled="!returnModelForm.materialBarcode">
<el-option :label="i.label" :value="i.value" v-for="i in WarehousesList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="数量" >
<el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1" ></el-input-number>
</el-form-item>
<el-form-item label="退库类型" prop="taskType">
<el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型">
<el-option :label="i.label" :value="i.value" v-for="i in dict.type.wms_raw_return_task_type"></el-option>
</el-select>
</el-form-item>
<el-form-item label="申请原因" >
<el-input type="textarea" v-model="returnModelForm.applyReason" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="returnModelVisible = false"> </el-button>
<el-button type="primary" @click="returnModelConfirm">退 </el-button>
</el-form-item>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
@ -523,20 +564,23 @@ import {
insertProductPlanDetails, insertProductPlanDetails,
getProductPlanDetails, startProductPlanDetail, completeProductPlanDetail, getProductPlanDetails, startProductPlanDetail, completeProductPlanDetail,
firstFloorProduceInstock, firstFloorProduceInstock,
scanMaterial2Confirm scanMaterial2Confirm, applyRawReturn
} from '@/api/board' } from '@/api/board'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default { export default {
name: 'Board1', name: 'Board1',
dicts: ['mes_plan_detail_status'], dicts: ['mes_plan_detail_status','wms_raw_return_task_type'],
components: { components: {
Chart, Chart,
PrintPage PrintPage
}, },
data() { data() {
return { return {
PrintData:{}, returnModelVisible: false,
returnModelForm:{},
WarehousesList:[],
PrintData: {},
printModel: false, printModel: false,
nowNum1: 1, nowNum1: 1,
totalNum1: 0, totalNum1: 0,
@ -547,7 +591,7 @@ export default {
nowNum4: 1, nowNum4: 1,
totalNum4: 0, totalNum4: 0,
planId: null, planId: null,
materialBomId: null, nowMaterial: null,
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100, vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
searchMaterialValue: '', searchMaterialValue: '',
warehouseList: [], warehouseList: [],
@ -562,7 +606,7 @@ export default {
}, },
productInstockRules: { productInstockRules: {
materialBarcode: [ materialBarcode: [
{ required: true, message: "成品条码不能为空", trigger: "blur" } {required: true, message: "成品条码不能为空", trigger: "blur"}
], ],
}, },
@ -570,17 +614,22 @@ export default {
materialConfirmForm: { materialConfirmForm: {
materialBarcode: null, materialBarcode: null,
planId: null, planId: null,
planDetailId:null, planDetailId: null,
checkAmount:null checkAmount: null
}, },
materialConfirmRules: { materialConfirmRules: {
materialBarcode: [ materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" } {required: true, message: "物料条码不能为空", trigger: "blur"}
], ],
checkAmount: [ checkAmount: [
{ required: true, message: "数量不能为空", trigger: "blur" } {required: true, message: "数量不能为空", trigger: "blur"}
], ],
} },
returnModelFormRules: {
taskType: [
{ required: true, message: '请选择退库类型', trigger: 'change' }
],
},
} }
}, },
@ -588,7 +637,7 @@ export default {
getProductPlans({pageNum: 1, pageSize: 5}).then(e => { getProductPlans({pageNum: 1, 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)
this.materialBomId = e.rows?.[0]?.materialBomId this.nowMaterial = e.rows?.[0]?.materialName
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.rows?.[0]?.planId}).then(res => { getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.rows?.[0]?.planId}).then(res => {
this.tableData1 = res.rows this.tableData1 = res.rows
this.totalNum2 = Math.ceil(res.total / 5) this.totalNum2 = Math.ceil(res.total / 5)
@ -768,7 +817,8 @@ export default {
this.$store.dispatch('LogOut').then(() => { this.$store.dispatch('LogOut').then(() => {
location.href = '/login?isStationId=true'; location.href = '/login?isStationId=true';
}) })
}).catch(() => {}); }).catch(() => {
});
}, },
next1() { next1() {
this.nowNum1 += 1 this.nowNum1 += 1
@ -879,8 +929,9 @@ export default {
}, },
// / // /
getDetail(e) { getDetail(e) {
console.log(e.row)
this.planId = e.row.planId this.planId = e.row.planId
this.materialBomId = e.row.materialBomId this.nowMaterial = e.row.materialName
this.nowNum2 = 1 this.nowNum2 = 1
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.row.planId}).then(res => { getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.row.planId}).then(res => {
if (res.rows.length === 0) { if (res.rows.length === 0) {
@ -930,7 +981,7 @@ export default {
wmsRawOutstockDetailList: [] wmsRawOutstockDetailList: []
} }
// //
getWarehouses({"warehouseFloor":1}).then(e => { getWarehouses({"warehouseFloor": 1}).then(e => {
this.warehouseList = e.data this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId this.form.warehouseId = e.data[0]?.warehouseId
@ -955,7 +1006,7 @@ export default {
// //
searchMaterial(val) { searchMaterial(val) {
getStockTotal({ getStockTotal({
warehouseId:this.form.warehouseId, warehouseId: this.form.warehouseId,
materialName: val materialName: val
}).then(e => { }).then(e => {
this.form.wmsRawOutstockDetailList = e.data.map(r => { this.form.wmsRawOutstockDetailList = e.data.map(r => {
@ -963,16 +1014,16 @@ 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
} }
}) })
}) })
}, },
warehouseChange(warehouseId){ warehouseChange(warehouseId) {
this.form.wmsRawOutstockDetailList =[]; this.form.wmsRawOutstockDetailList = [];
this.form.warehouseId = warehouseId; this.form.warehouseId = warehouseId;
this.getStockTotal(); this.getStockTotal();
}, },
@ -996,7 +1047,7 @@ export default {
}, },
submitProductInstock(){ submitProductInstock() {
this.$refs["productInstockForm"].validate(valid => { this.$refs["productInstockForm"].validate(valid => {
if (valid) { if (valid) {
firstFloorProduceInstock(this.productInstockForm).then(response => { firstFloorProduceInstock(this.productInstockForm).then(response => {
@ -1007,21 +1058,19 @@ export default {
}); });
}, },
cancelProductInstock(){ cancelProductInstock() {
this.productInstockVisible = false; this.productInstockVisible = false;
this.resetProductInstock(); this.resetProductInstock();
}, },
// //
resetMaterialConfirm() { resetMaterialConfirm() {
this.materialConfirmForm = { this.materialConfirmForm = {
materialBarcode: null, materialBarcode: null,
planId: null, planId: null,
planDetailId:null, planDetailId: null,
checkAmount:null checkAmount: null
}; };
this.resetForm("materialConfirmForm"); this.resetForm("materialConfirmForm");
}, },
@ -1031,14 +1080,14 @@ export default {
this.materialConfirmForm = { this.materialConfirmForm = {
materialBarcode: null, materialBarcode: null,
planId: scope.row.planId, planId: scope.row.planId,
planDetailId:scope.row.planDetailId, planDetailId: scope.row.planDetailId,
checkAmount:null checkAmount: null
}; };
this.materialConfirmVisible = true; this.materialConfirmVisible = true;
}, },
submitMaterialConfirm(){ submitMaterialConfirm() {
this.$refs["materialConfirmForm"].validate(valid => { this.$refs["materialConfirmForm"].validate(valid => {
if (valid) { if (valid) {
scanMaterial2Confirm(this.materialConfirmForm).then(response => { scanMaterial2Confirm(this.materialConfirmForm).then(response => {
@ -1049,9 +1098,48 @@ export default {
}); });
}, },
cancelMaterialConfirm(){ cancelMaterialConfirm() {
this.materialConfirmVisible = false; this.materialConfirmVisible = false;
this.resetMaterialConfirm(); this.resetMaterialConfirm();
},
returnMaterial(e) {
this.returnModelVisible = true
this.returnModelForm = {materialName:this.nowMaterial,...e.row}
},
setReturnModelForm(){
getWarehouses({
warehouseFloor:1,
materialBarcode:this.returnModelForm.materialBarcode
}).then(e=>{
this.WarehousesList = e.data.map(v=>{
return {
label:v.warehouseName,
value:v.warehouseId,
}
})
})
},
returnModelConfirm(){
this.$refs.returnModelForm.validate((valid) => {
if (valid) {
let data = {}
let keys = ['warehouseId','planCode','planDetailCode','productId','materialBarcode','planAmount','taskType','applyReason']
keys.forEach(v=>{
data[v] = this.returnModelForm[v]
})
applyRawReturn(data).then(v=>{
if(v.code === 200){
this.$message({
message: '退库成功',
type: 'success'
});
}
this.returnModelVisible = false
})
} else {
return false;
}
});
} }
} }

@ -179,6 +179,7 @@
<el-button <el-button
size="small" size="small"
type="text" type="text"
@click="returnMaterial(scope)"
> >
退料 退料
</el-button> </el-button>
@ -345,6 +346,44 @@
<el-button @click="cancelMaterialConfirm"> </el-button> <el-button @click="cancelMaterialConfirm"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="returnModelVisible" title="退料" width="25%">
<el-form ref="returnModelForm" :model="returnModelForm" label-width="80px" :rules="returnModelFormRules">
<el-form-item label="计划编号" >
<el-input v-model="returnModelForm.planCode" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="明细编号" >
<el-input v-model="returnModelForm.planDetailCode" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="成品" >
<el-input v-model="returnModelForm.materialName" autocomplete="off" disabled></el-input>
</el-form-item>
<el-form-item label="物料条码" >
<el-input placeholder="请输入内容" v-model="returnModelForm.materialBarcode" class="input-with-select" @blur="setReturnModelForm">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item label="仓库" >
<el-select v-model="returnModelForm.warehouseId" placeholder="请选择仓库" :disabled="!returnModelForm.materialBarcode">
<el-option :label="i.label" :value="i.value" v-for="i in WarehousesList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="数量" >
<el-input-number v-model="returnModelForm.planAmount" controls-position="right" :min="1" ></el-input-number>
</el-form-item>
<el-form-item label="退库类型" prop="taskType">
<el-select v-model="returnModelForm.taskType" placeholder="请选择退库类型">
<el-option :label="i.label" :value="i.value" v-for="i in dict.type.wms_raw_return_task_type"></el-option>
</el-select>
</el-form-item>
<el-form-item label="申请原因" >
<el-input type="textarea" v-model="returnModelForm.applyReason" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="returnModelVisible = false"> </el-button>
<el-button type="primary" @click="returnModelConfirm">退 </el-button>
</el-form-item>
</el-form>
</el-dialog>
</div> </div>
</template> </template>
@ -361,19 +400,22 @@ import {
insertProductPlanDetails, insertProductPlanDetails,
startProductPlanDetail, startProductPlanDetail,
fourthFloorProduceInstock, fourthFloorProduceInstock,
scanMaterial2Confirm scanMaterial2Confirm, applyRawReturn
} from "@/api/board"; } from "@/api/board";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default { export default {
name: 'Board1', name: 'Board1',
dicts: ['mes_plan_detail_status'], dicts: ['mes_plan_detail_status','wms_raw_return_task_type'],
components: { components: {
Chart, Chart,
PrintPage PrintPage
}, },
data() { data() {
return { return {
returnModelVisible: false,
returnModelForm:{},
WarehousesList:[],
PrintData:{}, PrintData:{},
printModel: false, printModel: false,
nowNum1: 1, nowNum1: 1,
@ -414,7 +456,13 @@ export default {
checkAmount: [ checkAmount: [
{ required: true, message: "数量不能为空", trigger: "blur" } { required: true, message: "数量不能为空", trigger: "blur" }
], ],
} },
returnModelFormRules: {
taskType: [
{ required: true, message: '请选择退库类型', trigger: 'change' }
],
},
} }
}, },
mounted() { mounted() {
@ -858,8 +906,47 @@ export default {
cancelMaterialConfirm(){ cancelMaterialConfirm(){
this.materialConfirmVisible = false; this.materialConfirmVisible = false;
this.resetMaterialConfirm(); this.resetMaterialConfirm();
} },
returnMaterial(e) {
this.returnModelVisible = true
this.returnModelForm = e.row
},
setReturnModelForm(){
getWarehouses({
warehouseFloor:4,
materialBarcode:this.returnModelForm.materialBarcode
}).then(e=>{
this.WarehousesList = e.data.map(v=>{
return {
label:v.warehouseName,
value:v.warehouseId,
}
})
})
},
returnModelConfirm(){
this.$refs.returnModelForm.validate((valid) => {
if (valid) {
let data = {}
let keys = ['warehouseId','planCode','planDetailCode','productId','materialBarcode','planAmount','taskType','applyReason']
keys.forEach(v=>{
data[v] = this.returnModelForm[v]
})
applyRawReturn(data).then(v=>{
if(v.code === 200){
this.$message({
message: '退库成功',
type: 'success'
});
}
this.returnModelVisible = false
})
} else {
return false;
}
});
}
} }
} }
</script> </script>

Loading…
Cancel
Save