feat:上盘平磨合批时批次号默认:HP+模板+年月日

This commit is contained in:
shijing 2026-01-23 10:55:00 +08:00
parent 2225d79500
commit 9147e6cd86
2 changed files with 29 additions and 2 deletions

View File

@ -274,6 +274,10 @@ export default {
type: String,
default: "",
},
Mmodel:{
type: String,
default: "",
}
},
components: {
scanDialog
@ -423,7 +427,7 @@ export default {
month = month>9?month:'0'+month;
let day = date.getDate();
day = day>9?day:'0'+day;
that.form.new_batch = 'HP'+year+month+day;
that.form.new_batch = 'HP'+that.Mmodel+year+month+day;
}
})
// type=10
@ -679,6 +683,7 @@ export default {
that.form.new_batch = that.route_code=='shangpaipingmo'?that.form.new_batch:"";
let totalCount = 0,data = [];
if(that.selectItems.length>0){
console.log('that.selectItems',that.selectItems)
data = that.materialOptions.filter((item) => {
return that.selectItems.indexOf(item.id)>-1;
});
@ -704,6 +709,15 @@ export default {
}
})
}
if(data.length>0&&that.route_code=='shangpaipingmo'&&that.mtype==30&&that.new_wm==''&&that.route!=''&&data[0].material_.model!==null){
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth()+1;
month = month>9?month:'0'+month;
let day = date.getDate();
day = day>9?day:'0'+day;
that.form.new_batch = 'HP'+data[0].material_.model+year+month+day;
}
data.forEach((item,index)=>{
item.wm = item.id;
item.count = item.count_canhandover;
@ -926,7 +940,17 @@ export default {
})
}
})
if(hasArr.length>0){}else{
if(hasArr.length>0&&hasArr[0].material_&&hasArr[0].material_.model!==null){
if(that.route_code=='shangpaipingmo'&&that.mtype==30&&that.new_wm==''&&that.route!=''){
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth()+1;
month = month>9?month:'0'+month;
let day = date.getDate();
day = day>9?day:'0'+day;
that.form.new_batch = 'HP'+hasArr[0].material_.model+year+month+day;
}
}else{
that.$message.error("该批次不存在或没有可交接数量")
}
}

View File

@ -263,6 +263,7 @@
:tag="tag"
:new_wm="new_wm"
:wmItem="wmItem"
:Mmodel="Mmodel"
:mgroupName="mgroup_name"
:mgroupId="mgroupId"
@success="handleScrapSuccess"
@ -408,6 +409,7 @@ export default {
},
tag:"",
wmId:"",
Mmodel:"",
route_code:"",
showBatch: "",
wmMaterial:'',
@ -517,6 +519,7 @@ export default {
let handoverb = [];
if(this.selection.length>0){
this.selection.forEach(item=>{
that.Mmodel = item.material_.model;
let obj = {};
obj.id = item.id;
obj.wm = item.id;