|
@@ -45,7 +45,7 @@
|
|
|
this.getPartList()
|
|
|
},
|
|
|
onUnload() {
|
|
|
- this.$refs.kkprinter.closeConnect()
|
|
|
+ // this.$refs.kkprinter.closeConnect()
|
|
|
},
|
|
|
methods: {
|
|
|
// 查询详情
|
|
@@ -81,9 +81,12 @@
|
|
|
this.allChecked = val
|
|
|
},
|
|
|
printOnce(opt,tsc,blesdk,data){
|
|
|
+ if(this.isParinting){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isParinting = true
|
|
|
const _this = this
|
|
|
const dealer = this.$store.state.vuex_userData
|
|
|
- console.log(opt,data,'opt')
|
|
|
let top = 10 // 距离顶部10点像素
|
|
|
const left = 8 // 距离左边
|
|
|
const lightHeight = 24 // 行高3mm,1mm = 8点
|
|
@@ -91,7 +94,7 @@
|
|
|
const pageH = 30 // 页签高度mm
|
|
|
const maxFontNums = Math.floor((pageW*8-left*2)/lightHeight) // 每行最多字体数
|
|
|
let rightTop = 0
|
|
|
- let rightLeft = Math.floor(maxFontNums*0.6)*lightHeight
|
|
|
+ let rightLeft = (Math.floor(maxFontNums*0.6)+1)*lightHeight
|
|
|
// 初始化打印机
|
|
|
const command = tsc.jpPrinter.createNew()
|
|
|
command.init()
|
|
@@ -109,11 +112,11 @@
|
|
|
top = top+10
|
|
|
top = textFormat(command,data.productCode,lwidth,left,top,lightHeight,"left",1)
|
|
|
// 产品名称
|
|
|
- top = top+5
|
|
|
+ top = top+10
|
|
|
top = textFormat(command,data.product.name,lwidth,left,top,lightHeight,"left",1)
|
|
|
- // 时间
|
|
|
+ // 时间,打印人
|
|
|
top = top+10
|
|
|
- top = textFormat(command,this.$u.timeFormat(this.timestamp, 'yyyy-mm-dd hh:MM'),lwidth,left,top,lightHeight,"left",1)
|
|
|
+ top = textFormat(command,this.$u.timeFormat(this.timestamp, 'yyyy-mm-dd hh:MM')+" "+this.$store.state.vuex_userData.userNameCN,lwidth,left,top,lightHeight,"left",1)
|
|
|
// 货位号
|
|
|
textFormat(command,data.shelfPlaceCode,maxFontNums-lwidth,rightLeft,rightTop,lightHeight,"center",1)
|
|
|
// 二维码
|
|
@@ -136,6 +139,7 @@
|
|
|
}else{
|
|
|
_this.printIndex = 0
|
|
|
_this.$refs.kkprinter.onPrintSuccess()
|
|
|
+ _this.isParinting = false
|
|
|
}
|
|
|
});
|
|
|
},
|