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, type: String,
default: "", default: "",
}, },
Mmodel:{
type: String,
default: "",
}
}, },
components: { components: {
scanDialog scanDialog
@ -423,7 +427,7 @@ export default {
month = month>9?month:'0'+month; month = month>9?month:'0'+month;
let day = date.getDate(); let day = date.getDate();
day = day>9?day:'0'+day; 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 // type=10
@ -679,6 +683,7 @@ export default {
that.form.new_batch = that.route_code=='shangpaipingmo'?that.form.new_batch:""; that.form.new_batch = that.route_code=='shangpaipingmo'?that.form.new_batch:"";
let totalCount = 0,data = []; let totalCount = 0,data = [];
if(that.selectItems.length>0){ if(that.selectItems.length>0){
console.log('that.selectItems',that.selectItems)
data = that.materialOptions.filter((item) => { data = that.materialOptions.filter((item) => {
return that.selectItems.indexOf(item.id)>-1; 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)=>{ data.forEach((item,index)=>{
item.wm = item.id; item.wm = item.id;
item.count = item.count_canhandover; 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("该批次不存在或没有可交接数量") that.$message.error("该批次不存在或没有可交接数量")
} }
} }

View File

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