fix:原料库和出入库详情中打印物料标签
This commit is contained in:
parent
b31b2f44f6
commit
8c1e98ce18
|
@ -182,42 +182,30 @@ export default {
|
|||
if(printer_name!==''&&printer_name!==null&&printer_name!==undefined){
|
||||
if(that.project_code!=='gz'){
|
||||
if(type=='mb'){
|
||||
that.$API.cm.labelmat.fromMb.req({tid:row.id}).then((res) => {
|
||||
let code = res.code_label;
|
||||
let str = [
|
||||
"SIZE 40 mm,70 mm",
|
||||
"GAP 7 mm,7 mm",
|
||||
"CLS",
|
||||
"REFERENCE 0,0",
|
||||
'QRCODE 30,400,H,5,A,0,"' +code +'"',
|
||||
"WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name,
|
||||
"WINTEXT 240,550,28,90,0,0,Simhei,"+"批次号:" + res.batch,
|
||||
"WINTEXT 280,550,28,90,0,0,Simhei," +"数量:" + row.count,
|
||||
"PRINT 1",
|
||||
];
|
||||
let params = {};
|
||||
params.tid = row.id;
|
||||
params.label_template_name = '库存标签模板';
|
||||
params.extra_data={count:row.count};
|
||||
that.$API.cm.labelmat.fromMb.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.printer_commands = str;
|
||||
obj.printer_commands = res.commands;
|
||||
obj.printer_name = printer_name;
|
||||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
});
|
||||
})
|
||||
}else{
|
||||
let code = row.number;
|
||||
let str = [
|
||||
"SIZE 70 mm,100 mm",
|
||||
"GAP 7 mm,7 mm",
|
||||
"CLS",
|
||||
"REFERENCE 0,0",
|
||||
'QRCODE 30,400,H,5,A,0,"' +code +'"',
|
||||
"WINTEXT 240,550,28,90,0,0,Simhei," + row.number,
|
||||
"PRINT 1",
|
||||
];
|
||||
let obj = {};
|
||||
obj.printer_commands = str;
|
||||
obj.printer_name = printer_name;
|
||||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
let params = {};
|
||||
let name = row.material_name.split('|')[0];
|
||||
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 = printer_name;
|
||||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
});
|
||||
});
|
||||
}
|
||||
}else{
|
||||
|
|
|
@ -198,11 +198,12 @@
|
|||
</el-button>
|
||||
<el-link
|
||||
type="primary"
|
||||
v-if="mioObj.type == 'do_out'&&project_code=='bxerp'"
|
||||
v-if="mioObj.type == 'do_out'"
|
||||
@click="printMaterial(scope.row,'mioitem')"
|
||||
>
|
||||
物料标签
|
||||
</el-link>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
@ -251,7 +252,7 @@
|
|||
width="120"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">打印标签</el-link>
|
||||
<el-link :underline="false" v-if="mioObj.type == 'do_out'" @click="printMaterial(scope.row,'wpr')" type="primary">打印标签</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
@ -472,6 +473,7 @@ export default {
|
|||
},//打印
|
||||
showWpr(row){
|
||||
let that = this;
|
||||
that.printMaterialName = row.material_name;
|
||||
that.wprList = row.mioitemw;
|
||||
that.wprVisibleDrawer = true;
|
||||
},
|
||||
|
@ -480,42 +482,30 @@ export default {
|
|||
let that = this;
|
||||
if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
|
||||
if(type=='mioitem'){
|
||||
that.$API.cm.labelmat.fromMioitem.req({tid:row.id}).then((res) => {
|
||||
let code = res.code_label;
|
||||
let str = [
|
||||
"SIZE 40 mm,70 mm",
|
||||
"GAP 7 mm,7 mm",
|
||||
"CLS",
|
||||
"REFERENCE 0,0",
|
||||
'QRCODE 30,400,H,5,A,0,"' +code +'"',
|
||||
"WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name,
|
||||
"WINTEXT 240,550,28,90,0,0,Simhei," +"批次号:"+ res.batch,
|
||||
"WINTEXT 280,550,28,90,0,0,Simhei," +"数量:" + row.count,
|
||||
"PRINT 1",
|
||||
];
|
||||
let params = {};
|
||||
params.tid = row.id;
|
||||
params.extra_data={count:row.count};
|
||||
params.label_template_name = '库存标签模板';
|
||||
that.$API.cm.labelmat.fromMioitem.req(params).then((res) => {
|
||||
let obj = {};
|
||||
obj.printer_commands = str;
|
||||
obj.printer_commands = res.commands;
|
||||
obj.printer_name = that.printer_name;
|
||||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
});
|
||||
})
|
||||
}else{
|
||||
let code = row.number;
|
||||
let str = [
|
||||
"SIZE 70 mm,100 mm",
|
||||
"GAP 7 mm,7 mm",
|
||||
"CLS",
|
||||
"REFERENCE 0,0",
|
||||
'QRCODE 30,400,H,5,A,0,"' +code +'"',
|
||||
"WINTEXT 240,550,28,90,0,0,Simhei," + row.number,
|
||||
"PRINT 1",
|
||||
];
|
||||
let obj = {};
|
||||
obj.printer_commands = str;
|
||||
obj.printer_name = that.printer_name;
|
||||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
let params = {};
|
||||
let name = that.printMaterialName.split('|')[0];
|
||||
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{
|
||||
|
|
Loading…
Reference in New Issue