fix:玻纤一次排棒批次以及单个打印修改
This commit is contained in:
parent
3472d39894
commit
c54942ea58
|
@ -671,14 +671,27 @@ export default {
|
|||
});
|
||||
})
|
||||
})
|
||||
}else{
|
||||
if(that.route_code=='paiyicibang'){
|
||||
params.extra_data={orimaterial:row.material_ofrom_name};
|
||||
}else if(that.route_code=='paiyicibang'){
|
||||
that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
|
||||
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 = '排一次棒打印模板';
|
||||
}else{
|
||||
params.extra_data={orimaterial:row.material_ofrom_name,count:row.count};
|
||||
params.label_template_name = '其他工序打印模板';
|
||||
}
|
||||
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("打印成功");
|
||||
});
|
||||
});
|
||||
})
|
||||
}else{
|
||||
params.extra_data={orimaterial:row.material_ofrom_name,count:row.count};
|
||||
params.label_template_name = '其他工序打印模板';
|
||||
that.apiObjPrint.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.printer_commands = res.commands;
|
||||
|
@ -691,45 +704,65 @@ export default {
|
|||
}else if(type=='wpr'){
|
||||
let params = {};
|
||||
let name = row.material_name.split('|')[0];
|
||||
if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||
|
||||
that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo'
|
||||
){
|
||||
let oinfo = [];
|
||||
for(let key in row.oinfo){
|
||||
oinfo.push(row.oinfo[key])
|
||||
}
|
||||
let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch};
|
||||
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;
|
||||
if(that.route_code=='paiyicibang'){
|
||||
that.$API.mtm.route.list.req({material_out:row.material,page:0}).then((res) => {
|
||||
console.log('排一次棒单件打印res',res);
|
||||
let data = res[0].params_json;
|
||||
data.number = row.number;
|
||||
data.name=name;
|
||||
data.ofrom_name=that.ofrom_name;
|
||||
params.data = data;
|
||||
params.label_template_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{
|
||||
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("打印成功");
|
||||
if(that.route_code=='paiban'||that.route_code=='zhuangmo'||that.route_code=='zlybcl'||that.route_code=='tuomoceliang'||
|
||||
that.route_code=='reyatuihuo'||that.route_code=='banduangunyuan'||that.route_code=='banduangunyuanhoudama'||that.route_code=='banduangunyuantuihuo'
|
||||
){
|
||||
let oinfo = [];
|
||||
for(let key in row.oinfo){
|
||||
oinfo.push(row.oinfo[key])
|
||||
}
|
||||
let data = {sigao:'',duibian:'',moban:'',istest:'否',number:row.number,name:name,ofrom_name:that.ofrom_name,ofrom_batch:that.ofrom_batch};
|
||||
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{
|
||||
that.$message.warning("请先设置打印机");
|
||||
|
|
Loading…
Reference in New Issue