diff --git a/src/views/visualCheck/checkManage/dataScreening/girdList.vue b/src/views/visualCheck/checkManage/dataScreening/girdList.vue index 5abf3a8..01e8a8e 100644 --- a/src/views/visualCheck/checkManage/dataScreening/girdList.vue +++ b/src/views/visualCheck/checkManage/dataScreening/girdList.vue @@ -324,6 +324,7 @@ export default { shelfAllGridData: [], layerNum: 0, rackNum: 0, + startShelf: 1, bookNum: 46, layerVal: null, rackOptions: [], @@ -458,14 +459,26 @@ export default { FetchBookShelfDetails({ 'shelfId': dataScreenShelf.shelfId }).then(res => { this.layerNum = res.shelfFloor this.rackNum = res.shelfShelf + this.startShelf = res.startShelf this.floorId = res.floorId this.regionId = res.regionId this.bookShelfDetails = res + // this.rackOptions = [] + // for (let i = 1; i <= this.rackNum; i++) { + // this.rackOptions.push({ id: i, name: `0${i}架` }) + // } + this.rackOptions = [] - for (let i = 1; i <= this.rackNum; i++) { - this.rackOptions.push({ id: i, name: `0${i}架` }) + const start = parseInt(this.startShelf) || 1 + const end = start + this.rackNum - 1 + for (let i = start; i <= end; i++) { + this.rackOptions.push({ + id: i, + name: `${i.toString().padStart(2, '0')}架` + }) } + this.layerVal = parseInt(this.gridShelf) || '' this.getInitStockInfo(this.shelfAllGridData) diff --git a/src/views/visualCheck/checkManage/dataScreening/shelfList.vue b/src/views/visualCheck/checkManage/dataScreening/shelfList.vue index abbbbe6..ace8de2 100644 --- a/src/views/visualCheck/checkManage/dataScreening/shelfList.vue +++ b/src/views/visualCheck/checkManage/dataScreening/shelfList.vue @@ -176,6 +176,7 @@ export default { callNumVisible: false, layerNum: 0, rackNum: 0, + startShelf: 1, swiperActiveIndex: 0, cellIndex: null, columnIndex: null, @@ -224,11 +225,27 @@ export default { return { width: `calc(${w})` } }, reversedRackNum() { + console.log('startShelf', this.startShelf) + console.log('booShelfGrid', this.booShelfGrid) + const start = parseInt(this.startShelf) || 1 + // 计算理论上的最后一个架号 + const end = start + this.rackNum - 1 + console.log('起始架号:', start, '总数量:', this.rackNum, '理论最后架号:', end) + if (this.booShelfGrid && this.booShelfGrid.length > 0) { - if (parseInt(this.booShelfGrid[0].gridShelf) === this.rackNum) { - return Array.from({ length: this.rackNum }, (_, i) => this.rackNum - i).map(x => x.toString()) + const firstGridShelf = parseInt(this.booShelfGrid[0].gridShelf) + console.log('实际第一个架号:', firstGridShelf) + + if (firstGridShelf === end) { + console.log('书架倒置:从', end, '递减到', start) + return Array.from({ length: this.rackNum }, (_, i) => { + return (end - i).toString() + }) } else { - return Array.from({ length: this.rackNum }, (_, i) => i + 1).map(x => x.toString()) + console.log('书架正序:从', start, '递增到', end) + return Array.from({ length: this.rackNum }, (_, i) => { + return (start + i).toString() + }) } } else { return [] @@ -279,6 +296,8 @@ export default { FetchBookShelfDetails({ 'shelfId': data.id }).then(res => { this.layerNum = res.shelfFloor this.rackNum = res.shelfShelf + this.startShelf = res.startShelf + // this.startShelf = 3 this.bookShelfDetails = res if (this.$route.query.tabIndex) { diff --git a/src/views/visualCheck/venueDevice/bookshelf/index.vue b/src/views/visualCheck/venueDevice/bookshelf/index.vue index 1965dda..e8cb1a2 100644 --- a/src/views/visualCheck/venueDevice/bookshelf/index.vue +++ b/src/views/visualCheck/venueDevice/bookshelf/index.vue @@ -121,21 +121,21 @@ - + - + - + - +