|
|
@@ -9,21 +9,15 @@
|
|
|
v-model:show="modal"
|
|
|
title="发卡机发卡"
|
|
|
>
|
|
|
- <div
|
|
|
- v-if="printResult != null && printResult.command == 'read'"
|
|
|
- class="alert alert-info"
|
|
|
- role="alert"
|
|
|
- >
|
|
|
- {{ printResult.success ? '操作成功' : '操作失败' }},读取到{{ printResult.tagCount }}个标签,{{ printResult.epcs }}
|
|
|
- </div>
|
|
|
-
|
|
|
- <div
|
|
|
- v-if="printResult != null && printResult.command == 'write'"
|
|
|
- class="alert alert-danger"
|
|
|
- role="alert"
|
|
|
- >
|
|
|
- {{ printResult.success ? '操作成功' : '操作失败' }},{{ printResult.message }}待写入EPC:{{ lastWriteEpc }}
|
|
|
+ <div class="form-horizontal">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="col-sm-2 control-label">EPC</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input v-model="lastWriteEpc" type="text" class="form-control" placeholder="EPC" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
|
|
|
<div
|
|
|
v-if="printResult != null && printResult.command == 'restore'"
|
|
|
@@ -35,35 +29,44 @@
|
|
|
|
|
|
<button
|
|
|
type="button"
|
|
|
- class="btn btn-info"
|
|
|
+ class="btn btn-default m-button"
|
|
|
@click="printSingleEpc(lastWriteEpc)"
|
|
|
>
|
|
|
- 再次打印
|
|
|
+ 打印
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
|
type="button"
|
|
|
- class="btn btn-info"
|
|
|
+ class="btn btn-default m-button"
|
|
|
@click="restoreEpc"
|
|
|
>
|
|
|
- 恢复标签
|
|
|
+ 重置
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
|
type="button"
|
|
|
- class="btn btn-info"
|
|
|
+ class="btn btn-default m-button"
|
|
|
@click="readEpc"
|
|
|
>
|
|
|
读取
|
|
|
</button>
|
|
|
|
|
|
- <button
|
|
|
- type="button"
|
|
|
- class="btn btn-danger"
|
|
|
- @click="modal = false"
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-if="printResult != null && printResult.command == 'write'"
|
|
|
+ class="alert alert-danger"
|
|
|
+ role="alert"
|
|
|
>
|
|
|
- 关闭
|
|
|
- </button>
|
|
|
+ {{ printResult.success ? '操作成功' : '操作失败' }},{{ printResult.message }}待写入EPC:{{ lastWriteEpc }}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-if="printResult != null && printResult.command == 'read'"
|
|
|
+ class="alert alert-info"
|
|
|
+ role="alert"
|
|
|
+ >
|
|
|
+ {{ printResult.success ? '操作成功' : '操作失败' }},读取到{{ printResult.tagCount }}个标签,{{ printResult.epcs }}
|
|
|
+ </div>
|
|
|
</Modal>
|
|
|
<Loading v-if="loading" />
|
|
|
</div>
|
|
|
@@ -87,7 +90,13 @@ export default {
|
|
|
type: String,
|
|
|
default: '',
|
|
|
},
|
|
|
+ 'visible':{
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
},
|
|
|
+
|
|
|
+ emits: ['update:visible'],
|
|
|
|
|
|
data: function () {
|
|
|
return {
|
|
|
@@ -102,10 +111,20 @@ export default {
|
|
|
epc: '', // 打印的EPC
|
|
|
},
|
|
|
loading: false,
|
|
|
- modal: false,
|
|
|
};
|
|
|
},
|
|
|
|
|
|
+ computed: {
|
|
|
+ modal: {
|
|
|
+ get(){
|
|
|
+ return this.visible;
|
|
|
+ },
|
|
|
+ set(value){
|
|
|
+ this.$emit('update:visible', value);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
methods: {
|
|
|
/**
|
|
|
@@ -140,7 +159,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- _self.lastWriteEpc = epc;
|
|
|
|
|
|
this.printSingleEpc(epc);
|
|
|
},
|
|
|
@@ -152,6 +170,7 @@ export default {
|
|
|
printSingleEpc: function (epc) {
|
|
|
let _self = this;
|
|
|
|
|
|
+ _self.lastWriteEpc = epc;
|
|
|
_self.modal = false;
|
|
|
|
|
|
let promise = PrintEpcUtil.printSingleEpc(this.printerName, epc);
|
|
|
@@ -223,3 +242,10 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ .m-button{
|
|
|
+ margin-right: 1rem;
|
|
|
+ margin-bottom: 1rem;
|
|
|
+ }
|
|
|
+</style>
|