diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java index dcc7ae12..9f9f6209 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/controller/MesApiController.java @@ -413,4 +413,14 @@ public class MesApiController extends BaseController { List list = mesPurchaseOrderService.selectBindPurchaseOrders(mesPurchaseOrder); return getDataTable(list); } + + /** + * 查询物料BOM信息列表,with 申请领料和已出库数量 + */ + @GetMapping("/getBomsWithApply") + public AjaxResult getBomsWithApply(MesMaterialBom mesMaterialBom) + { + List list = mesMaterialBomService.selectMesMaterialBomWithApplyList(mesMaterialBom); + return success(list); + } } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java index 5b1b2a3f..8971778c 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/domain/MesMaterialBom.java @@ -134,6 +134,12 @@ public class MesMaterialBom extends TreeEntity { private List userNameList; + private BigDecimal outstockAmount; + + private BigDecimal realOutstockAmount; + + private String planCode; + public String getAttachType() { return attachType; } @@ -321,6 +327,30 @@ public class MesMaterialBom extends TreeEntity { this.materialSpec = materialSpec; } + public BigDecimal getOutstockAmount() { + return outstockAmount; + } + + public void setOutstockAmount(BigDecimal outstockAmount) { + this.outstockAmount = outstockAmount; + } + + public BigDecimal getRealOutstockAmount() { + return realOutstockAmount; + } + + public void setRealOutstockAmount(BigDecimal realOutstockAmount) { + this.realOutstockAmount = realOutstockAmount; + } + + public String getPlanCode() { + return planCode; + } + + public void setPlanCode(String planCode) { + this.planCode = planCode; + } + public String getGroupBy() { String materialCode = StringUtils.isEmpty(this.materialCode) ? " " : this.materialCode; String materialName = StringUtils.isEmpty(this.materialName) ? " " : this.materialName; diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java index 49b4b439..5a4e82f2 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/mapper/MesMaterialBomMapper.java @@ -92,4 +92,13 @@ public interface MesMaterialBomMapper */ public List selectMesMaterialBomWithChildSopList(Long materialBomId); + + /** + * 查询物料BOM信息列表,with 申请领料和已出库数量 + * + * @param mesMaterialBom 物料BOM信息 + * @return 物料BOM信息集合 + */ + public List selectMesMaterialBomWithApplyList(MesMaterialBom mesMaterialBom); + } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesMaterialBomService.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesMaterialBomService.java index 8b33020b..f8a78f68 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesMaterialBomService.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/IMesMaterialBomService.java @@ -108,4 +108,11 @@ public interface IMesMaterialBomService */ public List selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange); + /** + * 查询物料BOM信息列表,with 申请领料和已出库数量 + * + * @param mesMaterialBom 物料BOM信息 + * @return 物料BOM信息 + */ + public List selectMesMaterialBomWithApplyList(MesMaterialBom mesMaterialBom); } diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java index 60c1cc6d..39a9c523 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesMaterialBomServiceImpl.java @@ -431,4 +431,16 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService { public List selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange){ return mesBomAttachChangeMapper.selectMesBomAttachChangeJoinList(mesBomAttachChange); } + + + /** + * 查询物料BOM信息列表,with 申请领料和已出库数量 + * + * @param mesMaterialBom 物料BOM信息 + * @return 物料BOM信息 + */ + @Override + public List selectMesMaterialBomWithApplyList(MesMaterialBom mesMaterialBom) { + return mesMaterialBomMapper.selectMesMaterialBomWithApplyList(mesMaterialBom); + } } diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml index 9259acf5..8d418c34 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesMaterialBomMapper.xml @@ -32,6 +32,8 @@ + + @@ -248,4 +250,14 @@ + + + diff --git a/hw-ui/src/api/board/laserLight.js b/hw-ui/src/api/board/laserLight.js index 46ced9b0..2f258e4d 100644 --- a/hw-ui/src/api/board/laserLight.js +++ b/hw-ui/src/api/board/laserLight.js @@ -65,3 +65,13 @@ export function directRawOutstock(data) { data: data }) } + + +// 激光切割工位获取bom信息,with 申请领料和已出库数量 +export function getBomsWithApply(query) { + return request({ + url: '/mes/api/getBomsWithApply', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/views/board/fourthFloor/laserLight.vue b/hw-ui/src/views/board/fourthFloor/laserLight.vue index 9e0e5b45..8c328f52 100644 --- a/hw-ui/src/views/board/fourthFloor/laserLight.vue +++ b/hw-ui/src/views/board/fourthFloor/laserLight.vue @@ -276,26 +276,18 @@ > - - - + @@ -379,7 +371,7 @@ import { } from "@/api/board"; import {monitorSerialData} from "@/utils/serial" -import {addWmslocation, updateWmslocation} from "@/api/wms/wmslocation"; +import {getBomsWithApply} from "@/api/board/laserLight"; import WorkshopNotice from "@/components/workshopNotice/index.vue"; import {noticeData} from "@/utils/notice" import ViewFile from "@/components/viewFile/index.vue"; @@ -473,7 +465,7 @@ export default { submitLoading: false, // 存储选中的行 - selectedRows: {}, + selectedRow: {}, //显示预览文件 showFileDialog: false, //显示预览文件标题 @@ -483,7 +475,8 @@ export default { rawOutstockData:[], purchaseOrderData:[], IS_SHOW_FINISH: "1", - showTitle: "显示" + showTitle: "显示", + pageSize:5 } }, async mounted() { @@ -497,23 +490,11 @@ export default { // duration: 0 // }); // }, 60 * 1000) - const data = await getProductPlans({pageNum: 1, pageSize: 5, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { + const data = await getProductPlans({pageNum: 1, pageSize: this.pageSize, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { this.tableData = e.rows - this.totalNum1 = Math.ceil(e.total / 5) - this.$refs.table1.setCurrentRow(e.rows[0]); - this.getInfo(e.rows[0]) - getNewestProductPlanDetailJoinAttach({planId: e.rows[0].planId}).then(val => { - this.form = val.data || {} - this.form.materialId = e.rows[0]?.materialId - this.form.materialCode = e.rows[0]?.materialCode - this.form.materialName = e.rows[0]?.materialName - this.form.saleOrderId = e.rows[0]?.saleOrderId - if (val.data) { - this.form.planDetailStatus = setState(val.data.planDetailStatus) - } - this.selectBindPurchaseOrders(); - this.selectRawOutstocks(); - }) + this.totalNum1 = Math.ceil(e.total / this.pageSize) + this.selectedRow = e.rows[0]; + this.getProductPlanDetailByProductPlan(); }) this.$refs.chart2.setData({ tooltip: { @@ -680,6 +661,25 @@ export default { }, methods: { + getProductPlanDetailByProductPlan(){ + if(this.selectedRow) { + this.$refs.table1.setCurrentRow(this.selectedRow); + this.getInfo(this.selectedRow) + getNewestProductPlanDetailJoinAttach({planId: this.selectedRow.planId}).then(val => { + this.form = val.data || {} + this.form.materialId = this.selectedRow?.materialId + this.form.materialCode = this.selectedRow?.materialCode + this.form.materialName = this.selectedRow?.materialName + this.form.saleOrderId = this.selectedRow?.saleOrderId + if (val.data) { + this.form.planDetailStatus = setState(val.data.planDetailStatus) + } + this.selectBindPurchaseOrders(); + this.selectRawOutstocks(); + }) + } + }, + async logout() { this.$confirm('确定退出系统吗?', '提示', { confirmButtonText: '确定', @@ -694,22 +694,27 @@ export default { }, next1() { this.nowNum1 += 1 - getProductPlans({pageNum: this.nowNum1, pageSize: 5, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { + getProductPlans({pageNum: this.nowNum1, pageSize: this.pageSize, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { this.tableData = e.rows - this.totalNum1 = Math.ceil(e.total / 5) + this.totalNum1 = Math.ceil(e.total / this.pageSize) + this.selectedRow = e.rows[0]; + this.getProductPlanDetailByProductPlan(); }) }, pre1() { this.nowNum1 -= 1 - getProductPlans({pageNum: this.nowNum1, pageSize: 5, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { + getProductPlans({pageNum: this.nowNum1, pageSize: this.pageSize, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { this.tableData = e.rows - this.totalNum1 = Math.ceil(e.total / 5) + this.totalNum1 = Math.ceil(e.total / this.pageSize) + this.selectedRow = e.rows[0]; + this.getProductPlanDetailByProductPlan(); }) }, getOrderInfo(e) { console.log("当前选择行:", e) - this.selectedRows = e; + this.selectedRow = e; this.getInfo(e) + this.selectRawOutstocks(); getNewestProductPlanDetailJoinAttach({planId: e.planId}).then(val => { if (val.data) { this.form = val.data @@ -720,7 +725,7 @@ export default { this.form.planDetailStatus = setState(val.data.planDetailStatus) this.selectBindPurchaseOrders(); - this.selectRawOutstocks(); + } }) @@ -1103,9 +1108,9 @@ export default { message: '已完成' }); - getProductPlans({pageNum: this.nowNum1, pageSize: 5, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { + getProductPlans({pageNum: this.nowNum1, pageSize: this.pageSize, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { this.tableData = e.rows - this.totalNum1 = Math.ceil(e.total / 5) + this.totalNum1 = Math.ceil(e.total / this.pageSize) 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]) @@ -1346,7 +1351,7 @@ export default { /** SOP预览*/ handleViewSOP(){ this.fileListData = []; - getDispatchAttachByPlanIdList("2", this.selectedRows.planId).then(res => { + getDispatchAttachByPlanIdList("2", this.selectedRow.planId).then(res => { let attachList = res.data; let thisFileList = []; attachList.forEach(e => { @@ -1414,9 +1419,15 @@ export default { selectRawOutstocks(){ this.rawOutstockData = []; - if(this.form.planDetailCode && this.form.planDetailCode!='') { - getRawOutstocks({planDetailCode: this.form.planDetailCode}).then(response => { - this.rawOutstockData = response.rows; + // alert(JSON.stringify(this.form)); + // alert(JSON.stringify(this.selectedRow)); + if(this.selectedRow && this.selectedRow.planCode && this.selectedRow.planCode!='') { + let query = { + planCode:this.selectedRow.planCode, + parentId:this.selectedRow.materialBomId + } + getBomsWithApply(query).then(response => { + this.rawOutstockData = response.data; // this.detailTotal = response.total; // this.loading = false; }); @@ -1431,9 +1442,9 @@ export default { this.showTitle = "显示"; this.IS_SHOW_FINISH = "1"; } - getProductPlans({pageNum: this.nowNum1, pageSize: 5, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { + getProductPlans({pageNum: this.nowNum1, pageSize: this.pageSize, incompleteFlag: this.IS_SHOW_FINISH}).then(e => { this.tableData = e.rows - this.totalNum1 = Math.ceil(e.total / 5) + this.totalNum1 = Math.ceil(e.total / this.pageSize) }) },