|
|
@ -224,7 +224,6 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
// FetchShowByBillIdAndShelfIdAndGridShelf |
|
|
|
import { FetchInitStockInfo, FetchInitBookDetailsByGrids, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchShowByBillIdAndShelfIdAndGridShelf } from '@/api/stockTask/index' |
|
|
|
import { dataScreeningCrud } from '@/views/visualCheck/mixins/index' |
|
|
|
import { FetchBookShelfDetails, FetchShelfGridByShelfIdAndGridShelf } from '@/api/shelf/index' |
|
|
@ -325,54 +324,7 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
async created() { |
|
|
|
if (localStorage.getItem('dataScreenFloorTableIndex')) { |
|
|
|
this.floorTabIndex = localStorage.getItem('dataScreenFloorTableIndex') |
|
|
|
} |
|
|
|
if (localStorage.getItem('dataScreenRegionTableIndex')) { |
|
|
|
this.regionTabIndex = localStorage.getItem('dataScreenRegionTableIndex') |
|
|
|
} |
|
|
|
if (localStorage.getItem('dataScreenShelf')) { |
|
|
|
const dataScreenShelf = JSON.parse(localStorage.getItem('dataScreenShelf')) |
|
|
|
this.floorName = dataScreenShelf.floorName |
|
|
|
this.regionName = dataScreenShelf.regionName |
|
|
|
this.gridRow = dataScreenShelf.gridRow |
|
|
|
this.gridShelf = dataScreenShelf.gridShelf |
|
|
|
|
|
|
|
if (localStorage.getItem('dataScreenShelfAllGrid')) { |
|
|
|
this.shelfAllGridData = JSON.parse(localStorage.getItem('dataScreenShelfAllGrid')) |
|
|
|
} |
|
|
|
|
|
|
|
// 单面/双面 |
|
|
|
this.tabListData = [{ name: dataScreenShelf.regionName + ' - ' + this.removeAreaPrefix(dataScreenShelf.gridName) }] |
|
|
|
|
|
|
|
// dataScreenShelf.rowType === 1 |
|
|
|
// ? dataScreenShelf.toward === 1 |
|
|
|
// ? [{ name: 'A面' }] |
|
|
|
// : [{ name: 'B面' }] |
|
|
|
// : [{ name: 'A面' }, { name: 'B面' }] |
|
|
|
|
|
|
|
this.tabIndex = dataScreenShelf.toward - 1 |
|
|
|
FetchBookShelfDetails({ 'shelfId': dataScreenShelf.shelfId }).then(res => { |
|
|
|
this.layerNum = res.shelfFloor |
|
|
|
this.rackNum = res.shelfShelf |
|
|
|
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.layerVal = parseInt(this.gridShelf) || '' |
|
|
|
|
|
|
|
this.getInitStockInfo(this.shelfAllGridData) |
|
|
|
|
|
|
|
this.getInitBookDetailsByGrids(this.shelfAllGridData) |
|
|
|
|
|
|
|
this.getBillByShelfIdAndGridShelf(this.shelfAllGridData) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
this.initData() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
[CRUD.HOOK.beforeRefresh]() { |
|
|
@ -401,6 +353,56 @@ export default { |
|
|
|
return '现在' |
|
|
|
} |
|
|
|
}, |
|
|
|
initData() { |
|
|
|
if (localStorage.getItem('dataScreenFloorTableIndex')) { |
|
|
|
this.floorTabIndex = localStorage.getItem('dataScreenFloorTableIndex') |
|
|
|
} |
|
|
|
if (localStorage.getItem('dataScreenRegionTableIndex')) { |
|
|
|
this.regionTabIndex = localStorage.getItem('dataScreenRegionTableIndex') |
|
|
|
} |
|
|
|
if (localStorage.getItem('dataScreenShelf')) { |
|
|
|
const dataScreenShelf = JSON.parse(localStorage.getItem('dataScreenShelf')) |
|
|
|
this.floorName = dataScreenShelf.floorName |
|
|
|
this.regionName = dataScreenShelf.regionName |
|
|
|
this.gridRow = dataScreenShelf.gridRow |
|
|
|
this.gridShelf = dataScreenShelf.gridShelf |
|
|
|
|
|
|
|
if (localStorage.getItem('dataScreenShelfAllGrid')) { |
|
|
|
this.shelfAllGridData = JSON.parse(localStorage.getItem('dataScreenShelfAllGrid')) |
|
|
|
} |
|
|
|
|
|
|
|
// 单面/双面 |
|
|
|
this.tabListData = [{ name: dataScreenShelf.regionName + ' - ' + this.removeAreaPrefix(dataScreenShelf.gridName) }] |
|
|
|
|
|
|
|
// dataScreenShelf.rowType === 1 |
|
|
|
// ? dataScreenShelf.toward === 1 |
|
|
|
// ? [{ name: 'A面' }] |
|
|
|
// : [{ name: 'B面' }] |
|
|
|
// : [{ name: 'A面' }, { name: 'B面' }] |
|
|
|
|
|
|
|
this.tabIndex = dataScreenShelf.toward - 1 |
|
|
|
FetchBookShelfDetails({ 'shelfId': dataScreenShelf.shelfId }).then(res => { |
|
|
|
this.layerNum = res.shelfFloor |
|
|
|
this.rackNum = res.shelfShelf |
|
|
|
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.layerVal = parseInt(this.gridShelf) || '' |
|
|
|
|
|
|
|
this.getInitStockInfo(this.shelfAllGridData) |
|
|
|
|
|
|
|
this.getInitBookDetailsByGrids(this.shelfAllGridData) |
|
|
|
|
|
|
|
this.getBillByShelfIdAndGridShelf(this.shelfAllGridData) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
removeAreaPrefix(gridNames) { |
|
|
|
const index = gridNames.indexOf('面') |
|
|
|
if (index !== -1) { |
|
|
@ -466,7 +468,10 @@ export default { |
|
|
|
'grids': ids.join(',') |
|
|
|
} |
|
|
|
FetchInitBookDetailsByGrids(params).then(res => { |
|
|
|
console.log('res', res) |
|
|
|
console.log('666', this.shelfAllGridData) |
|
|
|
this.shelfAllGridData.forEach((item) => { |
|
|
|
console.log('2222', item) |
|
|
|
const gridId = item.id |
|
|
|
if (res.hasOwnProperty(gridId)) { |
|
|
|
// item.books = res[gridId] |
|
|
@ -642,25 +647,46 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleHistory(item, index) { |
|
|
|
this.shelfAllGridDataLoading = true |
|
|
|
this.timeIndex = index |
|
|
|
console.log('item', item) |
|
|
|
const params = { |
|
|
|
'gridShelf': '0' + this.layerVal, |
|
|
|
'ShelfId': this.bookShelfDetails.id, |
|
|
|
'toward': this.bookShelfDetails.toward, |
|
|
|
'billId': item.stockBill |
|
|
|
} |
|
|
|
FetchShowByBillIdAndShelfIdAndGridShelf(params).then(res => { |
|
|
|
console.log('res', res) |
|
|
|
// this.shelfAllGridData = [] |
|
|
|
// this.shelfAllGridData = res |
|
|
|
// this.getInitStockInfo(this.shelfAllGridData) |
|
|
|
if (item.stockType === 0) { |
|
|
|
this.initData() |
|
|
|
setTimeout(() => { |
|
|
|
this.shelfAllGridDataLoading = false |
|
|
|
}, 500) |
|
|
|
} else { |
|
|
|
const params = { |
|
|
|
'gridShelf': '0' + this.layerVal, |
|
|
|
'ShelfId': this.bookShelfDetails.id, |
|
|
|
'toward': this.bookShelfDetails.toward, |
|
|
|
'billId': item.stockBill |
|
|
|
} |
|
|
|
FetchShowByBillIdAndShelfIdAndGridShelf(params).then(res => { |
|
|
|
this.shelfAllGridData.forEach((item) => { |
|
|
|
console.log(item.id) |
|
|
|
const gridId = item.id |
|
|
|
if (res.hasOwnProperty(gridId)) { |
|
|
|
this.$set(item, 'books', res.gridShelfList[gridId]) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// this.getInitBookDetailsByGrids(this.shelfAllGridData) |
|
|
|
const sortedKeys = Object.keys(res.gridShelfList).sort() |
|
|
|
const sortedShelfDetails = [] |
|
|
|
sortedKeys.forEach(key => { |
|
|
|
res.shelfDetails.forEach(shelfDetail => { |
|
|
|
if (shelfDetail.gridId === key) { |
|
|
|
sortedShelfDetails.push(shelfDetail) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.baseStockData = sortedShelfDetails |
|
|
|
|
|
|
|
// this.shelfAllGridDataLoading = false |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
setTimeout(() => { |
|
|
|
this.shelfAllGridDataLoading = false |
|
|
|
}, 500) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|