fix:玻纤批次打印分为四类(工序带板段号打印模板、排一次棒打印模板、脱模测量前工序打印模板、其他工序打印模板)

This commit is contained in:
shijing 2025-12-24 16:03:23 +08:00
parent 0adebe5fe4
commit aad1383334
2 changed files with 96 additions and 53 deletions

View File

@ -557,11 +557,11 @@ export default {
if(type=='wm'){ if(type=='wm'){
let params = {}; let params = {};
params.tid = row.id; params.tid = row.id;
that.wprParams.wm = row.id;
let materialname = row.material_.name + '|' + row.material_.process_name; let materialname = row.material_.name + '|' + row.material_.process_name;
let specification = row.material_.specification; let specification = row.material_.specification;
if(that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='tuomoceliang'){ if(that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'){
params.label_template_name = '工序带板段号打印模板'; params.label_template_name = '工序带板段号打印模板';
that.wprParams.wm = row.id;
let totalcount = 0; let totalcount = 0;
let numbers = ['','','','','','','']; let numbers = ['','','','','','',''];
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => { this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
@ -588,41 +588,57 @@ export default {
} }
} }
params.extra_data={orimaterial:row.material_ofrom_name,materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,totalcount:totalcount,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]}; params.extra_data={orimaterial:row.material_ofrom_name,materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,totalcount:totalcount,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]};
that.apiObjPrint.req(params).then((res) => { that.printFun(params);
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 if(that.route_code=='yicifusi'){
}else{ that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
if(that.route_code=='paiyicibang'){ let namearr = row.material_name.split('排一次棒');
params.extra_data={orimaterial:row.material_ofrom_name}; 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.printFun(params);
})
}else if(that.route_code=='qingxi'||that.route_code=='kunbang'||that.route_code=='ladansi'||that.route_code=='yicifusi'||that.route_code=='paiercibang'||
that.route_code=='ercifusi'||that.route_code=='qiesi'||that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'){
params.extra_data={orimaterial:row.material_ofrom_name,count:row.count}; params.extra_data={orimaterial:row.material_ofrom_name,count:row.count};
params.label_template_name = '其他工序打印模板'; params.label_template_name = '脱模测量前工序打印模板';
that.printFun(params);
}else{
let numbers = ['','','','','','','','','','','','','',''];
let numberList = [];
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
let leng = res.length;
if(leng>0){
let mojuArr = res[0].number.match(/[a-zA-Z]/g) || [];
let mojuhao = mojuArr[0];
res.forEach(item=>{
let num = mojuhao+item.number.split(mojuhao)[1];
numberList.push(num);
})
numberList.forEach((item,index)=>{
let index1 = Math.floor(index/6);
if(index1<14){
numbers[index1]+=item+'、';
} }
that.apiObjPrint.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("打印成功");
});
}) })
} }
params.extra_data={orimaterial:row.material_ofrom_name,count:'—'+row.count,numbers0:numbers[0],
numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],
numbers6:numbers[6],numbers7:numbers[7],numbers8:numbers[8],numbers9:numbers[9],numbers10:numbers[10],
numbers11:numbers[11],numbers12:numbers[12],numbers13:numbers[13]};
params.label_template_name = '其他工序打印模板';
that.printFun(params);
})
}
}else if(type=='wpr'){ }else if(type=='wpr'){
that.ofromBatch = row.wm_batch; that.ofromBatch = row.wm_batch;
that.ofromName = row.wm_material_ofrom_name; that.ofromName = row.wm_material_ofrom_name;
let params = {}; let params = {};
let name = row.material_name.split('|')[0]; let name = row.material_name.split('|')[0];
if(that.route_code=='paiyicibang'||that.route_code=='kunbang'){ if(that.route_code=='paiyicibang'||that.route_code=='kunbang'){
console.log('that.route_code',that.route_code);
console.log('that.ofromName',that.ofromName);
that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => { that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
let data = res[0].params_json; let data = res[0].params_json;
data.number = row.number; data.number = row.number;
@ -691,6 +707,18 @@ export default {
that.$message.warning("请先设置打印机"); that.$message.warning("请先设置打印机");
} }
}, },
printFun(params){
let that = this;
console.log('params',params)
that.apiObjPrint.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("打印成功");
});
})
},
inmCheck(row){ inmCheck(row){
let that = this; let that = this;
that.checkItem = row; that.checkItem = row;

View File

@ -613,14 +613,7 @@ export default {
} }
} }
params.extra_data={orimaterial:row.material_ofrom_name,materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,totalcount:totalcount,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]}; params.extra_data={orimaterial:row.material_ofrom_name,materialname:materialname,specification:specification,count:row.count,slicecount:slice_count,totalcount:totalcount,numbers0:numbers[0],numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],numbers6:numbers[6]};
that.apiObjPrint.req(params).then((res) => { that.printFun(params);
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 if(that.route_code=='paiyicibang'){ }else if(that.route_code=='paiyicibang'){
that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => { that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
@ -631,25 +624,38 @@ export default {
extra_data.orimaterial=row.material_ofrom_name; extra_data.orimaterial=row.material_ofrom_name;
params.extra_data = extra_data; params.extra_data = extra_data;
params.label_template_name = '排一次棒打印模板'; params.label_template_name = '排一次棒打印模板';
that.apiObjPrint.req(params).then((res) => { that.printFun(params);
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 if(that.route_code=='qingxi'||that.route_code=='kunbang'||that.route_code=='ladansi'||that.route_code=='yicifusi'||that.route_code=='paiercibang'||
that.route_code=='ercifusi'||that.route_code=='qiesi'||that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'){
params.extra_data={orimaterial:row.material_ofrom_name,count:row.count}; params.extra_data={orimaterial:row.material_ofrom_name,count:row.count};
params.label_template_name = '脱模测量前工序打印模板';
that.printFun(params);
}else{
let numbers = ['','','','','','','','','','','','','',''];
let numberList = [];
this.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
let leng = res.length;
if(leng>0){
let mojuArr = res[0].number.match(/[a-zA-Z]/g) || [];
let mojuhao = mojuArr[0];
res.forEach(item=>{
let num = mojuhao+item.number.split(mojuhao)[1];
numberList.push(num);
})
numberList.forEach((item,index)=>{
let index1 = Math.floor(index/6);
if(index1<14){
numbers[index1]+=item+'、';
}
})
}
params.extra_data={orimaterial:row.material_ofrom_name,count:'—'+row.count,numbers0:numbers[0],
numbers1:numbers[1],numbers2:numbers[2],numbers3:numbers[3],numbers4:numbers[4],numbers5:numbers[5],
numbers6:numbers[6],numbers7:numbers[7],numbers8:numbers[8],numbers9:numbers[9],numbers10:numbers[10],
numbers11:numbers[11],numbers12:numbers[12],numbers13:numbers[13]};
params.label_template_name = '其他工序打印模板'; params.label_template_name = '其他工序打印模板';
that.apiObjPrint.req(params).then((res) => { that.printFun(params);
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 if(type=='wpr'){ }else if(type=='wpr'){
@ -658,8 +664,6 @@ export default {
let params = {}; let params = {};
let name = row.material_name.split('|')[0]; let name = row.material_name.split('|')[0];
if(that.route_code=='paiyicibang'||that.route_code=='kunbang'){ if(that.route_code=='paiyicibang'||that.route_code=='kunbang'){
console.log('that.route_code',that.route_code);
console.log('that.ofromName',that.ofromName);
that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => { that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
let data = res[0].params_json; let data = res[0].params_json;
data.number = row.number; data.number = row.number;
@ -728,6 +732,17 @@ export default {
that.$message.warning("请先设置打印机"); that.$message.warning("请先设置打印机");
} }
}, },
printFun(params){
let that = this;
that.apiObjPrint.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("打印成功");
});
})
},
inmCheck(row){ inmCheck(row){
let that = this; let that = this;
that.checkItem = row; that.checkItem = row;