fix:玻纤一次排棒批次以及单个打印修改

This commit is contained in:
shijing 2025-08-26 14:30:58 +08:00
parent 3472d39894
commit c54942ea58
1 changed files with 77 additions and 44 deletions

View File

@ -671,14 +671,27 @@ export default {
}); });
}) })
}) })
}else{ }else if(that.route_code=='paiyicibang'){
if(that.route_code=='paiyicibang'){ that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
params.extra_data={orimaterial:row.material_ofrom_name}; let namearr = row.material_name.split('排一次棒');
let extra_data = res[0].params_json;
extra_data.batch = row.batch;
extra_data.material_name=namearr[0];
extra_data.orimaterial=row.material_ofrom_name;
params.extra_data = extra_data;
params.label_template_name = '排一次棒打印模板'; params.label_template_name = '排一次棒打印模板';
}else{ that.apiObjPrint.req(params).then((res) => {
params.extra_data={orimaterial:row.material_ofrom_name,count:row.count}; let obj = {};
params.label_template_name = '其他工序打印模板'; obj.printer_commands = res.commands;
} obj.printer_name = that.printer_name;
that.$API.wpm.prints.req(obj).then((response) => {
that.$message.success("打印成功");
});
});
})
}else{
params.extra_data={orimaterial:row.material_ofrom_name,count:row.count};
params.label_template_name = '其他工序打印模板';
that.apiObjPrint.req(params).then((res) => { that.apiObjPrint.req(params).then((res) => {
let obj = {}; let obj = {};
obj.printer_commands = res.commands; obj.printer_commands = res.commands;
@ -691,45 +704,65 @@ export default {
}else if(type=='wpr'){ }else if(type=='wpr'){
let params = {}; let params = {};
let name = row.material_name.split('|')[0]; let name = row.material_name.split('|')[0];
if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'|| if(that.route_code=='paiyicibang'){
that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo' that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
){ console.log('排一次棒单件打印res',res);
let oinfo = []; let data = res[0].params_json;
for(let key in row.oinfo){ data.number = row.number;
oinfo.push(row.oinfo[key]) data.name=name;
} data.ofrom_name=that.ofrom_name;
let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch}; params.data = data;
if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){ params.label_template_name = '排一次棒单件打印模板';
params.label_template_name = '脱膜测量单件标签模板'; that.$API.cm.labeltemplate.commands.req(params).then((res) => {
}else{ let obj = {};
params.label_template_name = '排扳单件打印模板'; obj.printer_commands = res.commands;
} obj.printer_name = that.printer_name;
if(oinfo.length>0){ that.$API.wpm.prints.req(obj).then((response) => {
oinfo.forEach((item)=>{ that.$message.success("打印成功");
if(item.name=="丝高"){ });
data.sigao = item.val; });
}else if(item.name=="对边"){ })
data.duibian = item.val;
}else if(item.name=="模具号"){
data.moban = item.val;
}else if(item.name=="实验板段"){
data.istest = item.val?'是':'否';
}
})
}
params.data = data;
}else{ }else{
params.label_template_name = '单件打印模板'; if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||
params.data = {number:row.number,name:name}; that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo'
} ){
that.$API.cm.labeltemplate.commands.req(params).then((res) => { let oinfo = [];
let obj = {}; for(let key in row.oinfo){
obj.printer_commands = res.commands; oinfo.push(row.oinfo[key])
obj.printer_name = that.printer_name; }
that.$API.wpm.prints.req(obj).then((response) => { let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch};
that.$message.success("打印成功"); if(that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'){
params.label_template_name = '脱膜测量单件标签模板';
}else{
params.label_template_name = '排扳单件打印模板';
}
if(oinfo.length>0){
oinfo.forEach((item)=>{
if(item.name=="丝高"){
data.sigao = item.val;
}else if(item.name=="对边"){
data.duibian = item.val;
}else if(item.name=="模具号"){
data.moban = item.val;
}else if(item.name=="实验板段"){
data.istest = item.val?'是':'否';
}
})
}
params.data = data;
}else{
params.label_template_name = '单件打印模板';
params.data = {number:row.number,name:name};
}
that.$API.cm.labeltemplate.commands.req(params).then((res) => {
let obj = {};
obj.printer_commands = res.commands;
obj.printer_name = that.printer_name;
that.$API.wpm.prints.req(obj).then((response) => {
that.$message.success("打印成功");
});
}); });
}); }
} }
}else{ }else{
that.$message.warning("请先设置打印机"); that.$message.warning("请先设置打印机");