|
@@ -6,6 +6,7 @@
|
|
|
v-model="selectedPrinterComputed"
|
|
v-model="selectedPrinterComputed"
|
|
|
class="form-control"
|
|
class="form-control"
|
|
|
style="width: 15em"
|
|
style="width: 15em"
|
|
|
|
|
+ @change="getPrintName"
|
|
|
>
|
|
>
|
|
|
<option value="" />
|
|
<option value="" />
|
|
|
<option
|
|
<option
|
|
@@ -58,11 +59,12 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
- emits: ['changePrinter', 'print', 'update:selectedPrinter'],
|
|
|
|
|
|
|
+ emits: ['changePrinter', 'print', 'update:selectedPrinter', 'selectedPrinterName'],
|
|
|
|
|
|
|
|
data: function () {
|
|
data: function () {
|
|
|
return {
|
|
return {
|
|
|
'printers': [], // 系统上的打印机
|
|
'printers': [], // 系统上的打印机
|
|
|
|
|
+ selectedPrinterName: '',
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -101,7 +103,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
-
|
|
|
|
|
|
|
+ getPrintName:function(e){
|
|
|
|
|
+ this.selectedPrinterName = e.target.value;
|
|
|
|
|
+ this.$emit('selectedPrinterName', e.target.value);
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 恢复选择的打印机
|
|
* 恢复选择的打印机
|
|
@@ -142,6 +147,18 @@ export default {
|
|
|
return null;
|
|
return null;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 仓库标签打印——获取选择打印的类型
|
|
|
|
|
+ */
|
|
|
|
|
+ getSelectedPrinterTypeTitle: function(){
|
|
|
|
|
+ for(let index = 0; index < this.printers.length; index ++){
|
|
|
|
|
+ if(this.printers[index].name === this.selectedPrinterName){
|
|
|
|
|
+ return this.printers[index].type;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return null;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|