fix:成品和半成品无聊标签打印
This commit is contained in:
parent
d9daef3587
commit
a3b12bad68
|
|
@ -72,12 +72,12 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="更新时间" prop="update_time">
|
||||
</el-table-column>
|
||||
<el-table-column width="90">
|
||||
<el-table-column width="80">
|
||||
<template #default="scope">
|
||||
<el-button @click="printMaterial(scope.row)" type="text">标签</el-button>
|
||||
<el-link :underline="false" type="primary"
|
||||
<el-button @click="printMaterial(scope.row)" type="text">打签</el-button>
|
||||
<!-- <el-link :underline="false" type="primary"
|
||||
@click="handleWatch(scope.row)"
|
||||
>流程图</el-link>
|
||||
>流程图</el-link> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
|
@ -273,15 +273,50 @@ export default {
|
|||
});
|
||||
})
|
||||
},
|
||||
//打印物料标签
|
||||
printMaterial(row){
|
||||
//打签
|
||||
printMaterial(row,type){
|
||||
let that = this;
|
||||
let printer_name=localStorage.getItem("printer_name");
|
||||
if(printer_name!==''&&printer_name!==null&&printer_name!==undefined){
|
||||
if(that.project_code!=='gz'){
|
||||
if(type=='mb'){
|
||||
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 = res.commands;
|
||||
obj.printer_name = printer_name;
|
||||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
});
|
||||
})
|
||||
}else{
|
||||
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{
|
||||
that.wmId = row.id;
|
||||
that.wmtype = row.material_.type;
|
||||
that.print_m = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.printmaterial.open();
|
||||
})
|
||||
}
|
||||
}else{
|
||||
that.$message.error("请先设置打印机");
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -66,15 +66,13 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="物料存量" prop="count">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="有效期" prop="expiration_date">
|
||||
</el-table-column> -->
|
||||
<el-table-column label="更新时间" prop="update_time">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column width="90">
|
||||
<el-table-column width="80">
|
||||
<template #default="scope">
|
||||
<el-button @click="printMaterial(scope.row)" type="text">物料标签</el-button>
|
||||
<el-button @click="printMaterial(scope.row,'mb')" type="primar">打签</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
|
|
@ -199,15 +197,50 @@ export default {
|
|||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
//打印物料标签
|
||||
printMaterial(row){
|
||||
//打签
|
||||
printMaterial(row,type){
|
||||
let that = this;
|
||||
let printer_name=localStorage.getItem("printer_name");
|
||||
if(printer_name!==''&&printer_name!==null&&printer_name!==undefined){
|
||||
if(that.project_code!=='gz'){
|
||||
if(type=='mb'){
|
||||
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 = res.commands;
|
||||
obj.printer_name = printer_name;
|
||||
that.$API.wpm.prints.req(obj).then((response) => {
|
||||
that.$message.success("打印成功");
|
||||
});
|
||||
})
|
||||
}else{
|
||||
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{
|
||||
that.wmId = row.id;
|
||||
that.wmtype = row.material_.type;
|
||||
that.print_m = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.printmaterial.open();
|
||||
})
|
||||
}
|
||||
}else{
|
||||
that.$message.error("请先设置打印机");
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue