4楼激光切割工序申请物料信息按bom显示
master
xs 3 months ago
parent db6b06cbb2
commit 0f1c764cac

@ -413,4 +413,14 @@ public class MesApiController extends BaseController {
List<MesPurchaseOrder> list = mesPurchaseOrderService.selectBindPurchaseOrders(mesPurchaseOrder); List<MesPurchaseOrder> list = mesPurchaseOrderService.selectBindPurchaseOrders(mesPurchaseOrder);
return getDataTable(list); return getDataTable(list);
} }
/**
* BOM,with
*/
@GetMapping("/getBomsWithApply")
public AjaxResult getBomsWithApply(MesMaterialBom mesMaterialBom)
{
List<MesMaterialBom> list = mesMaterialBomService.selectMesMaterialBomWithApplyList(mesMaterialBom);
return success(list);
}
} }

@ -134,6 +134,12 @@ public class MesMaterialBom extends TreeEntity {
private List<String> userNameList; private List<String> userNameList;
private BigDecimal outstockAmount;
private BigDecimal realOutstockAmount;
private String planCode;
public String getAttachType() { public String getAttachType() {
return attachType; return attachType;
} }
@ -321,6 +327,30 @@ public class MesMaterialBom extends TreeEntity {
this.materialSpec = materialSpec; 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() { public String getGroupBy() {
String materialCode = StringUtils.isEmpty(this.materialCode) ? " " : this.materialCode; String materialCode = StringUtils.isEmpty(this.materialCode) ? " " : this.materialCode;
String materialName = StringUtils.isEmpty(this.materialName) ? " " : this.materialName; String materialName = StringUtils.isEmpty(this.materialName) ? " " : this.materialName;

@ -92,4 +92,13 @@ public interface MesMaterialBomMapper
*/ */
public List<MesMaterialBom> selectMesMaterialBomWithChildSopList(Long materialBomId); public List<MesMaterialBom> selectMesMaterialBomWithChildSopList(Long materialBomId);
/**
* BOM,with
*
* @param mesMaterialBom BOM
* @return BOM
*/
public List<MesMaterialBom> selectMesMaterialBomWithApplyList(MesMaterialBom mesMaterialBom);
} }

@ -108,4 +108,11 @@ public interface IMesMaterialBomService
*/ */
public List<MesBomAttachChange> selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange); public List<MesBomAttachChange> selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange);
/**
* BOM,with
*
* @param mesMaterialBom BOM
* @return BOM
*/
public List<MesMaterialBom> selectMesMaterialBomWithApplyList(MesMaterialBom mesMaterialBom);
} }

@ -431,4 +431,16 @@ public class MesMaterialBomServiceImpl implements IMesMaterialBomService {
public List<MesBomAttachChange> selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange){ public List<MesBomAttachChange> selectMesBomAttachChangeJoinList(MesBomAttachChange mesBomAttachChange){
return mesBomAttachChangeMapper.selectMesBomAttachChangeJoinList(mesBomAttachChange); return mesBomAttachChangeMapper.selectMesBomAttachChangeJoinList(mesBomAttachChange);
} }
/**
* BOM,with
*
* @param mesMaterialBom BOM
* @return BOM
*/
@Override
public List<MesMaterialBom> selectMesMaterialBomWithApplyList(MesMaterialBom mesMaterialBom) {
return mesMaterialBomMapper.selectMesMaterialBomWithApplyList(mesMaterialBom);
}
} }

@ -32,6 +32,8 @@
<result property="sopId" column="sop_id"/> <result property="sopId" column="sop_id"/>
<result property="attachChangeFlag" column="attach_change_flag"/> <result property="attachChangeFlag" column="attach_change_flag"/>
<result property="sopChangeFlag" column="sop_change_flag"/> <result property="sopChangeFlag" column="sop_change_flag"/>
<result property="outstockAmount" column="outstock_amount"/>
<result property="realOutstockAmount" column="real_outstock_amount"/>
</resultMap> </resultMap>
<sql id="selectMesMaterialBomVo"> <sql id="selectMesMaterialBomVo">
@ -248,4 +250,14 @@
</select> </select>
<select id="selectMesMaterialBomWithApplyList" parameterType="MesMaterialBom" resultMap="MesMaterialBomResult">
select mmb.standard_amount,mmb.parent_id ,mbmi.material_code,mbmi.material_name,mbmi.material_spec,
(select ifnull(sum(wro.real_outstock_amount),0)
from wms_raw_outstock wro where
wro.plan_code=#{planCode}
and wro.audit_status != '2' and wro.material_id=mbmi.material_id) real_outstock_amount
from mes_material_bom mmb left join mes_base_material_info mbmi on mmb.material_id =mbmi.material_id where mmb.parent_id =#{parentId}
</select>
</mapper> </mapper>

@ -65,3 +65,13 @@ export function directRawOutstock(data) {
data: data data: data
}) })
} }
// 激光切割工位获取bom信息with 申请领料和已出库数量
export function getBomsWithApply(query) {
return request({
url: '/mes/api/getBomsWithApply',
method: 'get',
params: query
})
}

@ -276,26 +276,18 @@
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="申请数量" label="标准数量"
prop="planAmount" prop="standardAmount"
width="100" width="100"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="已领数量" label="已领数量"
prop="outstockAmount" prop="realOutstockAmount"
width="100" width="100"
> >
</el-table-column> </el-table-column>
<el-table-column
label="状态"
prop="auditStatus"
width="100"
>
<template slot-scope="scope">
<dict-tag :options="dict.type.wms_audit_status" :value="scope.row.auditStatus"/>
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
</div> </div>
@ -379,7 +371,7 @@ import {
} from "@/api/board"; } from "@/api/board";
import {monitorSerialData} from "@/utils/serial" 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 WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice" import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue"; import ViewFile from "@/components/viewFile/index.vue";
@ -473,7 +465,7 @@ export default {
submitLoading: false, submitLoading: false,
// //
selectedRows: {}, selectedRow: {},
// //
showFileDialog: false, showFileDialog: false,
// //
@ -483,7 +475,8 @@ export default {
rawOutstockData:[], rawOutstockData:[],
purchaseOrderData:[], purchaseOrderData:[],
IS_SHOW_FINISH: "1", IS_SHOW_FINISH: "1",
showTitle: "显示" showTitle: "显示",
pageSize:5
} }
}, },
async mounted() { async mounted() {
@ -497,23 +490,11 @@ export default {
// duration: 0 // duration: 0
// }); // });
// }, 60 * 1000) // }, 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.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / this.pageSize)
this.$refs.table1.setCurrentRow(e.rows[0]); this.selectedRow = e.rows[0];
this.getInfo(e.rows[0]) this.getProductPlanDetailByProductPlan();
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.$refs.chart2.setData({ this.$refs.chart2.setData({
tooltip: { tooltip: {
@ -680,6 +661,25 @@ export default {
}, },
methods: { 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() { async logout() {
this.$confirm('确定退出系统吗?', '提示', { this.$confirm('确定退出系统吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -694,22 +694,27 @@ export default {
}, },
next1() { next1() {
this.nowNum1 += 1 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.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() { pre1() {
this.nowNum1 -= 1 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.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) { getOrderInfo(e) {
console.log("当前选择行:", e) console.log("当前选择行:", e)
this.selectedRows = e; this.selectedRow = e;
this.getInfo(e) this.getInfo(e)
this.selectRawOutstocks();
getNewestProductPlanDetailJoinAttach({planId: e.planId}).then(val => { getNewestProductPlanDetailJoinAttach({planId: e.planId}).then(val => {
if (val.data) { if (val.data) {
this.form = val.data this.form = val.data
@ -720,7 +725,7 @@ export default {
this.form.planDetailStatus = setState(val.data.planDetailStatus) this.form.planDetailStatus = setState(val.data.planDetailStatus)
this.selectBindPurchaseOrders(); this.selectBindPurchaseOrders();
this.selectRawOutstocks();
} }
}) })
@ -1103,9 +1108,9 @@ export default {
message: '已完成' 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.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 let data = e.rows.find(v => v.planCode === this.form.planCode) || null
this.$refs.table1.setCurrentRow(data || e.rows[0]); this.$refs.table1.setCurrentRow(data || e.rows[0]);
this.getInfo(data || e.rows[0]) this.getInfo(data || e.rows[0])
@ -1346,7 +1351,7 @@ export default {
/** SOP预览*/ /** SOP预览*/
handleViewSOP(){ handleViewSOP(){
this.fileListData = []; this.fileListData = [];
getDispatchAttachByPlanIdList("2", this.selectedRows.planId).then(res => { getDispatchAttachByPlanIdList("2", this.selectedRow.planId).then(res => {
let attachList = res.data; let attachList = res.data;
let thisFileList = []; let thisFileList = [];
attachList.forEach(e => { attachList.forEach(e => {
@ -1414,9 +1419,15 @@ export default {
selectRawOutstocks(){ selectRawOutstocks(){
this.rawOutstockData = []; this.rawOutstockData = [];
if(this.form.planDetailCode && this.form.planDetailCode!='') { // alert(JSON.stringify(this.form));
getRawOutstocks({planDetailCode: this.form.planDetailCode}).then(response => { // alert(JSON.stringify(this.selectedRow));
this.rawOutstockData = response.rows; 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.detailTotal = response.total;
// this.loading = false; // this.loading = false;
}); });
@ -1431,9 +1442,9 @@ export default {
this.showTitle = "显示"; this.showTitle = "显示";
this.IS_SHOW_FINISH = "1"; 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.tableData = e.rows
this.totalNum1 = Math.ceil(e.total / 5) this.totalNum1 = Math.ceil(e.total / this.pageSize)
}) })
}, },

Loading…
Cancel
Save