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