标签打印接口
This commit is contained in:
parent
ef18e8b2a7
commit
af448398a2
46
src/components/printerLabel/index.vue
Normal file
46
src/components/printerLabel/index.vue
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<template>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-print"
|
||||||
|
@click="handlePrint()"
|
||||||
|
>{{labelText}}</el-button>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { printBarcodeLabel } from "@/api/print/print";
|
||||||
|
export default {
|
||||||
|
name: 'printLabel',
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props:{
|
||||||
|
businessId: null,
|
||||||
|
businessCode: null,
|
||||||
|
businessType: null,
|
||||||
|
labelText: {
|
||||||
|
type: String,
|
||||||
|
default: '打印'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
handlePrint(){
|
||||||
|
//先检查是否有配置默认的打印机
|
||||||
|
const key = 'defaultPrinter';
|
||||||
|
let printerJson = localStorage.getItem(key);
|
||||||
|
|
||||||
|
debugger;
|
||||||
|
if(printerJson !=null){
|
||||||
|
const printer = JSON.parse(printerJson);
|
||||||
|
const param = { businessId: this.businessId, businessCode: this.businessCode, businessType: this.businessType, printerCode: printer.printerCode };
|
||||||
|
printBarcodeLabel(param);
|
||||||
|
}else{
|
||||||
|
this.$modal.msgError("请在打印管理-打印机配置功能中指定默认打印机!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
@ -93,13 +93,7 @@
|
|||||||
<el-table-column label="流转数量" align="center" prop="quantityTransfered" />
|
<el-table-column label="流转数量" align="center" prop="quantityTransfered" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<printLabel :businessId = "scope.row.cardId" :businessCode = "scope.row.cardCode" businessType = "PROCARD"></printLabel>
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-print"
|
|
||||||
@click="handlePrint(scope.row)"
|
|
||||||
v-hasPermi="['mes:pro:procard:query']"
|
|
||||||
>打印</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -196,13 +190,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import { listProcard, getProcard, delProcard, addProcard, updateProcard } from "@/api/mes/pro/procard";
|
import { listProcard, getProcard, delProcard, addProcard, updateProcard } from "@/api/mes/pro/procard";
|
||||||
import { printBarcodeLabel } from "@/api/print/print";
|
import { printBarcodeLabel } from "@/api/print/print";
|
||||||
|
import printLabel from "@/components/printerLabel/index.vue"
|
||||||
import BarcodeImg from "@/components/barcodeImg/index.vue"
|
import BarcodeImg from "@/components/barcodeImg/index.vue"
|
||||||
import Procardprocess from "./process.vue"
|
import Procardprocess from "./process.vue"
|
||||||
import WorkorderSelect from "@/components/workorderSelect/single.vue"
|
import WorkorderSelect from "@/components/workorderSelect/single.vue"
|
||||||
import { getToken } from "@/utils/auth";
|
|
||||||
export default {
|
export default {
|
||||||
name: "Procard",
|
name: "Procard",
|
||||||
components: {BarcodeImg,Procardprocess,WorkorderSelect},
|
components: {BarcodeImg,Procardprocess,WorkorderSelect,printLabel},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
optType: null,
|
optType: null,
|
||||||
@ -302,20 +296,6 @@ export default {
|
|||||||
this.optType = 'view';
|
this.optType = 'view';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//跳转到报表展示界面
|
|
||||||
handlePrint(row){
|
|
||||||
//先检查是否有配置默认的打印机
|
|
||||||
const key = 'defaultPrinter';
|
|
||||||
const printer = localStorage.getItem(key);
|
|
||||||
if(value !=null){
|
|
||||||
const param = { bussinessId: this.form.cardId , bussinessCode: this.form.cardCode, printerCode: printer.printerCode };
|
|
||||||
printBarcodeLabel(param);
|
|
||||||
}else{
|
|
||||||
this.$modal.msgError("请在打印管理-打印机配置功能中指定默认打印机!");
|
|
||||||
}
|
|
||||||
//var reportName = "pro_card";
|
|
||||||
//window.open(`${this.website.reportUrl}/preview?_u=mysql:`+reportName+`&&cardId=`+row.cardId);
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
|
Loading…
Reference in New Issue
Block a user