From 42a78ecd3d19c06591bdc43773d725198eb017d6 Mon Sep 17 00:00:00 2001 From: Vergil <974548713@qq.com> Date: Tue, 18 Feb 2020 16:31:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=BD=E8=BF=B0=E5=8A=A0=E5=B7=A5=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E4=B8=8A=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProcessingStatusNew/index.vue | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/views/ManufacturingCenter/ProcessingStatusNew/index.vue b/src/views/ManufacturingCenter/ProcessingStatusNew/index.vue index c4aadfcd..e28fc06b 100644 --- a/src/views/ManufacturingCenter/ProcessingStatusNew/index.vue +++ b/src/views/ManufacturingCenter/ProcessingStatusNew/index.vue @@ -343,10 +343,13 @@ export default { this.getTable9() var _this = this document.onkeydown = function(e) { - if (event.keyCode === 37 || event.keyCode === 38) { + // 暂时弃用↑↓ 只用←→ + // event.keyCode === 38 || + if (event.keyCode === 37) { _this.click_Up() } - if (event.keyCode === 39 || event.keyCode === 40) { + // event.keyCode === 40 || + if (event.keyCode === 39) { _this.click_Down() } } @@ -356,22 +359,26 @@ export default { if (this.index === -1) { console.log(-1) } else { - this.index = this.index - 1 - console.log(this.index) - this.$refs.singleTable.setCurrentRow(this.tableData[this.index]) - this.批次数量 = this.tableData[this.index].批次数量 - this.getCurrentRow_Click(this.tableData[this.index].工艺计划流水号) + if (this.index !== 0) { + this.index = this.index - 1 + console.log(this.index) + this.$refs.singleTable.setCurrentRow(this.tableData[this.index]) + this.批次数量 = this.tableData[this.index].批次数量 + this.getCurrentRow_Click(this.tableData[this.index].工艺计划流水号) + } } }, click_Down() { if (this.index === -1) { console.log(-1) } else { - this.index = this.index + 1 - console.log(this.index) - this.$refs.singleTable.setCurrentRow(this.tableData[this.index]) - this.批次数量 = this.tableData[this.index].批次数量 - this.getCurrentRow_Click(this.tableData[this.index].工艺计划流水号) + if (this.index + 1 !== this.tableData.length) { + this.index = this.index + 1 + console.log(this.index) + this.$refs.singleTable.setCurrentRow(this.tableData[this.index]) + this.批次数量 = this.tableData[this.index].批次数量 + this.getCurrentRow_Click(this.tableData[this.index].工艺计划流水号) + } } }, getCurrentRow_Click(row) {