修改生产界面

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) {
return request({

@ -82,6 +82,7 @@
</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>
@ -262,6 +263,7 @@
<el-button
size="small"
type="text"
@click="returnMaterial(scope)"
>
退料
</el-button>
@ -433,8 +435,8 @@
>
<template slot-scope="scope">
<el-input-number
:min="0"
v-model="scope.row.planAmount"
:min="0"
controls-position="right"
style="width: 100%"
>
@ -459,9 +461,9 @@
</div>
</el-dialog>
<el-dialog :visible.sync="printModel" title="条码打印" width="80%" class="dialog">
<div style="height: 50vh;">
<PrintPage :defineData="PrintData" />
<el-dialog :visible.sync="printModel" class="dialog" title="条码打印" width="80%">
<div style="height: auto;">
<PrintPage :defineData="PrintData"/>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="printModel = false">关闭</el-button>
@ -489,10 +491,10 @@
title="确认物料使用"
width="40%">
<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-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-form-item>
<el-form-item label="物料条码" prop="materialBarcode">
@ -508,6 +510,45 @@
</div>
</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>
</template>
@ -523,20 +564,23 @@ import {
insertProductPlanDetails,
getProductPlanDetails, startProductPlanDetail, completeProductPlanDetail,
firstFloorProduceInstock,
scanMaterial2Confirm
scanMaterial2Confirm, applyRawReturn
} from '@/api/board'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
name: 'Board1',
dicts: ['mes_plan_detail_status'],
dicts: ['mes_plan_detail_status','wms_raw_return_task_type'],
components: {
Chart,
PrintPage
},
data() {
return {
PrintData:{},
returnModelVisible: false,
returnModelForm:{},
WarehousesList:[],
PrintData: {},
printModel: false,
nowNum1: 1,
totalNum1: 0,
@ -547,7 +591,7 @@ export default {
nowNum4: 1,
totalNum4: 0,
planId: null,
materialBomId: null,
nowMaterial: null,
vw: (document.documentElement.clientWidth || document.body.clientWidth) / 100,
searchMaterialValue: '',
warehouseList: [],
@ -562,7 +606,7 @@ export default {
},
productInstockRules: {
materialBarcode: [
{ required: true, message: "成品条码不能为空", trigger: "blur" }
{required: true, message: "成品条码不能为空", trigger: "blur"}
],
},
@ -570,17 +614,22 @@ export default {
materialConfirmForm: {
materialBarcode: null,
planId: null,
planDetailId:null,
checkAmount:null
planDetailId: null,
checkAmount: null
},
materialConfirmRules: {
materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" }
{required: true, message: "物料条码不能为空", trigger: "blur"}
],
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 => {
this.tableData = e.rows
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 => {
this.tableData1 = res.rows
this.totalNum2 = Math.ceil(res.total / 5)
@ -768,7 +817,8 @@ export default {
this.$store.dispatch('LogOut').then(() => {
location.href = '/login?isStationId=true';
})
}).catch(() => {});
}).catch(() => {
});
},
next1() {
this.nowNum1 += 1
@ -879,8 +929,9 @@ export default {
},
// /
getDetail(e) {
console.log(e.row)
this.planId = e.row.planId
this.materialBomId = e.row.materialBomId
this.nowMaterial = e.row.materialName
this.nowNum2 = 1
getProductPlanDetails({pageNum: 1, pageSize: 5, planId: e.row.planId}).then(res => {
if (res.rows.length === 0) {
@ -930,7 +981,7 @@ export default {
wmsRawOutstockDetailList: []
}
//
getWarehouses({"warehouseFloor":1}).then(e => {
getWarehouses({"warehouseFloor": 1}).then(e => {
this.warehouseList = e.data
this.form.warehouseId = e.data[0]?.warehouseId
@ -955,7 +1006,7 @@ export default {
//
searchMaterial(val) {
getStockTotal({
warehouseId:this.form.warehouseId,
warehouseId: this.form.warehouseId,
materialName: val
}).then(e => {
this.form.wmsRawOutstockDetailList = e.data.map(r => {
@ -963,16 +1014,16 @@ 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
}
})
})
},
warehouseChange(warehouseId){
this.form.wmsRawOutstockDetailList =[];
warehouseChange(warehouseId) {
this.form.wmsRawOutstockDetailList = [];
this.form.warehouseId = warehouseId;
this.getStockTotal();
},
@ -996,7 +1047,7 @@ export default {
},
submitProductInstock(){
submitProductInstock() {
this.$refs["productInstockForm"].validate(valid => {
if (valid) {
firstFloorProduceInstock(this.productInstockForm).then(response => {
@ -1007,21 +1058,19 @@ export default {
});
},
cancelProductInstock(){
cancelProductInstock() {
this.productInstockVisible = false;
this.resetProductInstock();
},
//
resetMaterialConfirm() {
this.materialConfirmForm = {
materialBarcode: null,
planId: null,
planDetailId:null,
checkAmount:null
planDetailId: null,
checkAmount: null
};
this.resetForm("materialConfirmForm");
},
@ -1031,14 +1080,14 @@ export default {
this.materialConfirmForm = {
materialBarcode: null,
planId: scope.row.planId,
planDetailId:scope.row.planDetailId,
checkAmount:null
planDetailId: scope.row.planDetailId,
checkAmount: null
};
this.materialConfirmVisible = true;
},
submitMaterialConfirm(){
submitMaterialConfirm() {
this.$refs["materialConfirmForm"].validate(valid => {
if (valid) {
scanMaterial2Confirm(this.materialConfirmForm).then(response => {
@ -1049,9 +1098,48 @@ export default {
});
},
cancelMaterialConfirm(){
cancelMaterialConfirm() {
this.materialConfirmVisible = false;
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
size="small"
type="text"
@click="returnMaterial(scope)"
>
退料
</el-button>
@ -345,6 +346,44 @@
<el-button @click="cancelMaterialConfirm"> </el-button>
</div>
</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>
</template>
@ -361,19 +400,22 @@ import {
insertProductPlanDetails,
startProductPlanDetail,
fourthFloorProduceInstock,
scanMaterial2Confirm
scanMaterial2Confirm, applyRawReturn
} from "@/api/board";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
name: 'Board1',
dicts: ['mes_plan_detail_status'],
dicts: ['mes_plan_detail_status','wms_raw_return_task_type'],
components: {
Chart,
PrintPage
},
data() {
return {
returnModelVisible: false,
returnModelForm:{},
WarehousesList:[],
PrintData:{},
printModel: false,
nowNum1: 1,
@ -414,7 +456,13 @@ export default {
checkAmount: [
{ required: true, message: "数量不能为空", trigger: "blur" }
],
}
},
returnModelFormRules: {
taskType: [
{ required: true, message: '请选择退库类型', trigger: 'change' }
],
},
}
},
mounted() {
@ -858,8 +906,47 @@ export default {
cancelMaterialConfirm(){
this.materialConfirmVisible = false;
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>

Loading…
Cancel
Save