From 467ef43c840d54332f443db8d216a10d08128214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Mon, 15 Apr 2024 16:58:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E4=BA=A7=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw-ui/src/api/board/index.js | 10 ++ hw-ui/src/views/board/firstFloor/index.vue | 164 ++++++++++++++---- .../src/views/board/fourthFloor/assemble.vue | 95 +++++++++- 3 files changed, 227 insertions(+), 42 deletions(-) diff --git a/hw-ui/src/api/board/index.js b/hw-ui/src/api/board/index.js index 41ef24b..1279c8e 100644 --- a/hw-ui/src/api/board/index.js +++ b/hw-ui/src/api/board/index.js @@ -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({ diff --git a/hw-ui/src/views/board/firstFloor/index.vue b/hw-ui/src/views/board/firstFloor/index.vue index 9fac87e..ede2d95 100644 --- a/hw-ui/src/views/board/firstFloor/index.vue +++ b/hw-ui/src/views/board/firstFloor/index.vue @@ -82,6 +82,7 @@ +
@@ -225,9 +226,9 @@ prop="createTime" width="80" > - + 退料 @@ -433,8 +435,8 @@ > @@ -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; + } + }); } } diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue index 277009e..613521c 100644 --- a/hw-ui/src/views/board/fourthFloor/assemble.vue +++ b/hw-ui/src/views/board/fourthFloor/assemble.vue @@ -179,6 +179,7 @@ 退料 @@ -345,6 +346,44 @@ 取 消
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取 消 + 退 库 + + +
@@ -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; + } + }); + } } }