diff --git a/src/plugin/KeyScaner.js b/src/plugin/KeyScaner.js index ee42882..b7ddc13 100644 --- a/src/plugin/KeyScaner.js +++ b/src/plugin/KeyScaner.js @@ -5,7 +5,7 @@ * 20200421 * 1.0 */ - const KeyScaner = /** @class */ (function () { +const KeyScaner = /** @class */ (function () { function KeyScaner(_dom) { this.keybufs = []; this.altBuf = []; @@ -15,12 +15,14 @@ * 在收集到文本输入时触发 * @param text 收集到的连续文本 */ - this.onInput = function (text) { }; + this.onInput = function (text) { + }; this.dom = _dom; _dom.addEventListener('keydown', this.onKeyDown.bind(this)); _dom.addEventListener('keyup', this.onKeyUp.bind(this)); this.interval = setInterval(this.onTick.bind(this), 100); } + KeyScaner.prototype.appendChar = function (c) { this.keybufs.push(c); }; @@ -30,41 +32,40 @@ if (ev.shiftKey || ev.ctrlKey || ev.metaKey) { return; } - } - else if (ev.key == "Shift") { + } else if (ev.key == "Shift") { if (ev.altKey || ev.ctrlKey || ev.metaKey) { return; } this.isShift = true; - } - else if (ev.key == "Enter") { + } else if (ev.key == "Enter") { if (ev.shiftKey || ev.altKey || ev.ctrlKey || ev.metaKey) { return; } + console.log("监听到回车键。。。。。。。。。。。。。。。。。。。"); this.appendChar("\r"); this.completeInput(); //立即完成输入 - } - else { + } else if (ev.key == "Delete" || ev.key == "Backspace") { + console.log("监听到删除键。。。。。。。。。。。。。。。。。。。"); + this.dom.innerTex = ""; + this.appendChar("delete"); + this.completeInput(); //立即完成输入 + } else { if (ev.key.length == 1) { var charCode = ev.key.charCodeAt(0); if (charCode >= 48 && charCode <= 57) { if (ev.altKey) { this.altBuf.push(ev.key); - } - else { + } else { this.appendChar(ev.key); } - } - else if ((charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122)) { + } else if ((charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122)) { //忽略大小写锁定键,直接通过SHIFT键判断大小写 if (ev.shiftKey) { this.appendChar(ev.key.toUpperCase()); - } - else { + } else { this.appendChar(ev.key.toLowerCase()); } - } - else { + } else { this.appendChar(ev.key); } } @@ -81,8 +82,7 @@ this.appendChar(c); this.altBuf = []; } - } - else if (ev.key == "Shift") { + } else if (ev.key == "Shift") { this.isShift = false; } }; diff --git a/src/views/warehouse/IONewOrder.vue b/src/views/warehouse/IONewOrder.vue index 12e3dd9..b284b97 100644 --- a/src/views/warehouse/IONewOrder.vue +++ b/src/views/warehouse/IONewOrder.vue @@ -331,7 +331,7 @@ export default { page: 1, status: 10, limit: 10, - locStorageCode:null, + locStorageCode: null, }, checkStatus: { '-1': "草稿", diff --git a/src/views/warehouse/addHosOrder.vue b/src/views/warehouse/addHosOrder.vue index 450b734..eabe514 100644 --- a/src/views/warehouse/addHosOrder.vue +++ b/src/views/warehouse/addHosOrder.vue @@ -181,20 +181,28 @@ - +
- 条码: + + {{ scanText }} + +
+
+ +
@@ -210,6 +218,11 @@
+ + + + + 分段扫码 @@ -218,8 +231,6 @@
条码数量:{{ total }}
- -
diff --git a/src/views/warehouse/addOrder.vue b/src/views/warehouse/addOrder.vue index aac848e..4b6939d 100644 --- a/src/views/warehouse/addOrder.vue +++ b/src/views/warehouse/addOrder.vue @@ -112,32 +112,42 @@ - +
- 条码: + + {{ scanText }} + +
- + - +
+ +
确定 + style="height: 31px; margin-left: 20px" + >添加 + +
@@ -148,7 +158,6 @@ - -