|
@@ -55,7 +55,7 @@
|
|
|
<div class="app-modal-input-wrap">
|
|
<div class="app-modal-input-wrap">
|
|
|
<div class="inp-list-line">
|
|
<div class="inp-list-line">
|
|
|
<div class="line-input">
|
|
<div class="line-input">
|
|
|
- <input type="number" style="width:200upx;text-align:center;" :focus="printFocus" v-model="printNum" :adjust-position="false" class="inp-input" />
|
|
|
|
|
|
|
+ <input type="number" ref="input" style="width:61.8%;text-align:center;" @focus="focus" @blur="blur" :focus="printFocus" v-model="printNum" :adjust-position="false" class="inp-input" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -120,42 +120,67 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ focus() {
|
|
|
|
|
+ //this.printFocus = true
|
|
|
|
|
+ },
|
|
|
|
|
+ blur() {
|
|
|
|
|
+ this.printFocus = false
|
|
|
|
|
+ },
|
|
|
doPrintLabel(id){
|
|
doPrintLabel(id){
|
|
|
this.printItemId = id
|
|
this.printItemId = id
|
|
|
- //this.$refs.inputDialog.open()
|
|
|
|
|
this.printLabelShow = true
|
|
this.printLabelShow = true
|
|
|
|
|
+ this.printNum = null
|
|
|
|
|
+
|
|
|
|
|
+ setTimeout(x => {
|
|
|
|
|
+ this.$nextTick(() => this.setFocus()); // just watch out with going too fast !!!
|
|
|
|
|
+ }, 200);
|
|
|
|
|
+ },
|
|
|
|
|
+ setFocus() {
|
|
|
this.printFocus = true
|
|
this.printFocus = true
|
|
|
|
|
+
|
|
|
|
|
+ //let that=this;
|
|
|
|
|
+ //that.$refs.input.focus()
|
|
|
|
|
+ //that.$refs.input.$el.focus()
|
|
|
|
|
+ //that.$refs.input.$el.children[0].focus();
|
|
|
},
|
|
},
|
|
|
dialogInputConfirm(val) {
|
|
dialogInputConfirm(val) {
|
|
|
|
|
+ console.log(val)
|
|
|
let that=this;
|
|
let that=this;
|
|
|
if (val.index == 0) {
|
|
if (val.index == 0) {
|
|
|
- this.printLabelShow = false
|
|
|
|
|
- this.printFocus = true
|
|
|
|
|
|
|
+ that.printLabelShow = false
|
|
|
|
|
+ that.printFocus = false
|
|
|
return
|
|
return
|
|
|
- }
|
|
|
|
|
- //this.$refs.inputDialog.close()
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- let currentNum = Number(this.printNum)
|
|
|
|
|
|
|
+ let currentNum = this.printNum
|
|
|
let itemId = this.printItemId
|
|
let itemId = this.printItemId
|
|
|
|
|
+ if (currentNum == null) {
|
|
|
|
|
+ that.$msg('打印数量未填写')
|
|
|
|
|
+ that.printFocus = true
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
if (currentNum <= 0) {
|
|
if (currentNum <= 0) {
|
|
|
that.$msg('打印数量不能小于等于0')
|
|
that.$msg('打印数量不能小于等于0')
|
|
|
|
|
+ that.printFocus = true
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (itemId == 0) {
|
|
if (itemId == 0) {
|
|
|
that.$msg('打印的花材id出错')
|
|
that.$msg('打印的花材id出错')
|
|
|
|
|
+ that.printLabelShow = false
|
|
|
|
|
+ that.printFocus = false
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
print({id:itemId,num:currentNum}).then(res=>{
|
|
print({id:itemId,num:currentNum}).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
that.$msg(res.msg)
|
|
that.$msg(res.msg)
|
|
|
} else if(res.code == 0){
|
|
} else if(res.code == 0){
|
|
|
|
|
+ that.printLabelShow = false
|
|
|
|
|
+ that.printFocus = false
|
|
|
that.$msg(res.msg)
|
|
that.$msg(res.msg)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- testFunc() {
|
|
|
|
|
- console.log(1111)
|
|
|
|
|
- },
|
|
|
|
|
moreToDo(item){
|
|
moreToDo(item){
|
|
|
let that=this;
|
|
let that=this;
|
|
|
let doList = ['复制花材', '销售记录']
|
|
let doList = ['复制花材', '销售记录']
|