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) {