-
+
+
+
+
![]()
+
单击可查看所有图片
+
@@ -157,7 +162,7 @@
class="archives-table"
:data="detailTable"
style="width: 100%;"
- height="calc(100vh - 329px)"
+ height="calc(100vh - 560px)"
>
@@ -193,7 +198,7 @@
-
+
下载
@@ -203,9 +208,8 @@
-
+
- {{ item }}
@@ -224,6 +228,8 @@ import CRUD, { presenter, header, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import { mapGetters } from 'vuex'
import eForm from './module/form'
+import { parseTime, saveAs, getBlob } from '@/utils/index'
+// import qs from 'qs'
export default {
name: 'DataScreening',
@@ -243,6 +249,8 @@ export default {
mixins: [presenter(), header(), crud(), dataScreeningCrud],
data() {
return {
+ activeIndex: 0,
+ downImgLoading: false,
detailVisible: false,
detailImgVisible: false,
detailTable: [],
@@ -277,22 +285,12 @@ export default {
popoverStyles: [],
currentBookName: '', // 当前书籍的名称
popoverPosition: { x: 0, y: 0 }, // Popover的位置
- checkDateLine: [{
- content: '现在',
- // timestamp: '2018-04-12 20:46',
- size: 'large',
- type: 'primary',
- icon: 'el-icon-more',
- color: '#0bbd87'
- }, {
- content: '手动盘点全局',
- timestamp: '2024-12-18 09:46',
- size: 'large'
- }],
+ checkDateLine: [],
baseStockData: [],
shelfAllGridDataLoading: false,
billNoImg: null,
- bookImgData: []
+ bookImgData: [],
+ bigImg: ''
}
},
computed: {
@@ -418,19 +416,21 @@ export default {
return parts.length > 0 ? parts.join('-') : '-'
},
getBillByShelfIdAndGridShelf(data) {
- console.log('this.shelfAllGridData', data)
const params = {
'gridShelf': data[0].gridShelf,
'ShelfId': data[0].shelfId,
'size': 5
}
FetchBillByShelfIdAndGridShelf(params).then(res => {
- console.log(res)
- if (res) {
+ if (res !== null) {
this.checkDateLine = res.sort((a, b) => {
return new Date(b.endTime) - new Date(a.endTime)
})
this.billNoImg = this.checkDateLine[0].stockBill
+ this.checkDateLine[0].icon = 'el-icon-more'
+ this.checkDateLine[0].color = '#0bbd87'
+ } else {
+ this.checkDateLine = []
}
}).catch(() => {
})
@@ -457,7 +457,6 @@ export default {
'grids': ids.join(',')
}
FetchInitBookDetailsByGrids(params).then(res => {
- console.log(res)
this.shelfAllGridData.forEach((item) => {
const gridId = item.id
if (res.hasOwnProperty(gridId)) {
@@ -465,134 +464,27 @@ export default {
this.$set(item, 'books', res[gridId])
}
})
- console.log(this.shelfAllGridData)
}).catch(() => {
})
},
toAdd(type, item) {
- this.$refs.eform.formVisible = true
- if (type === 5) {
- this.$refs.eform.form.shelfId = this.bookShelfDetails.id
- this.$refs.eform.form.gridShelf = this.gridShelf
- this.$refs.eform.form.stockRegion = this.floorName + this.regionName + this.bookShelfDetails.shelfName + this.gridShelf + '架'
- } else {
- this.$refs.eform.form.shelfId = null
- this.$refs.eform.form.gridShelf = null
- this.$refs.eform.form.gridId = item.id
- this.$refs.eform.form.stockRegion = item.gridName
- }
-
- this.$refs.eform.setData(type)
- },
- getInitShelfGridByShelfId(toward) {
- this.listLoading = true
- // rowType 1 单 2 双
- // toward 1 A面 2 B面
- // shelfType 1 '始终最左边为第1架(S型排架)'
- // shelfType 2 'A面最左为第1架(B面最左为最后1架)'
- // shelfType 3 'B面最左为第1架(A面最左为最后1架)'
- // floorType 1 '最顶层为第一层(从上至下)'
- // floorType 2 '最底层为第一层(从下至上)'
- // FetchInitShelfGridByShelfId({ 'shelfId': this.bookShelfDetails.id, 'toward': toward }).then(res => {
- // const sortFunction = toward === 1 ? {
- // 1: { 1: 'sortBookshelvesLeftTop', 2: 'sortBookshelvesLeftBottom' },
- // 2: { 1: 'sortBookshelvesLeftTop', 2: 'sortBookshelvesLeftBottom' },
- // 3: { 1: 'sortBookshelvesRightTop', 2: 'sortBookshelvesRightBottom' }
- // } : {
- // 1: { 1: 'sortBookshelvesLeftTop', 2: 'sortBookshelvesLeftBottom' },
- // 2: { 1: 'sortBookshelvesRightTop', 2: 'sortBookshelvesRightBottom' },
- // 3: { 1: 'sortBookshelvesLeftTop', 2: 'sortBookshelvesLeftBottom' }
- // }
- // const shelfType = this.bookShelfDetails.shelfType
- // const floorType = this.bookShelfDetails.floorType
- // const sortMethod = sortFunction[shelfType][floorType]
- // this.booShelfGrid = this[sortMethod](res)
-
- // this.popoverVisible = Array(this.booShelfGrid.length).fill(false)
- // setTimeout(() => {
- // this.listLoading = false
- // }, 1000)
- // }).catch(() => {
- // })
- },
- // 最左为第一架, 最顶层为第一层 从上往下
- sortBookshelvesLeftTop(data) {
- const sortedData = []
- const maxFloor = Math.max(...data.map(item => parseInt(item.gridFloor)))
- const maxShelf = Math.max(...data.map(item => parseInt(item.gridShelf.slice(-1))))
-
- for (let i = 1; i <= maxFloor; i++) {
- for (let j = 1; j <= maxShelf; j++) {
- const currentShelf = data.find(item => parseInt(item.gridFloor) === i && parseInt(item.gridShelf.slice(-1)) === j)
- if (currentShelf) {
- sortedData.push(currentShelf)
- }
- }
- }
- return sortedData
- },
- // 最右为第一架,最左为最后一架, 最顶层为第一层 从上往下
- sortBookshelvesRightTop(data) {
- const sortedData = []
- // 获取最大的楼层数
- const maxFloor = Math.max(...data.map(item => parseInt(item.gridFloor)))
- const maxShelf = Math.max(...data.map(item => parseInt(item.gridShelf.match(/\d+$/)[0])))
- for (let i = 1; i <= maxFloor; i++) {
- // 从最大的书架层数开始,向下排序
- for (let j = maxShelf; j >= 1; j--) {
- const currentShelf = data.find(item => parseInt(item.gridFloor) === i && parseInt(item.gridShelf.match(/\d+$/)[0]) === j)
- if (currentShelf) {
- sortedData.push(currentShelf)
- }
- }
- }
- return sortedData
- },
- // 最左为第一架, 最底层为第一层 从下往上
- sortBookshelvesLeftBottom(data) {
- const sortedData = []
- // 获取最大的楼层数
- const maxFloor = Math.max(...data.map(item => parseInt(item.gridFloor)))
- // 获取最大的书架层数
- const maxShelf = Math.max(...data.map(item => parseInt(item.gridShelf.slice(-1))))
- for (let i = maxFloor; i >= 1; i--) {
- for (let j = 1; j <= maxShelf; j++) {
- const currentShelf = data.find(item => parseInt(item.gridFloor) === i && parseInt(item.gridShelf.slice(-1)) === j)
- if (currentShelf) {
- sortedData.push(currentShelf)
- }
- }
- }
- return sortedData
- },
- // 最左为最后一架, 最底层为第一层 从下往上
- sortBookshelvesRightBottom(data) {
- const sortedData = []
- // 获取最大的楼层数
- const maxFloor = Math.max(...data.map(item => parseInt(item.gridFloor)))
- const maxShelfPerFloor = data.map(item => parseInt(item.gridShelf.match(/\d+$/)[0]))
- .reduce((acc, curr, index, arr) => {
- const floor = parseInt(data[index].gridFloor)
- if (!acc[floor]) acc[floor] = 1
- if (acc[floor] < curr) acc[floor] = curr
- return acc
- }, {})
- // 从最大的楼层开始向下遍历
- for (let i = maxFloor; i >= 1; i--) {
- // 从最大的书架编号开始向左遍历
- for (let j = maxShelfPerFloor[i] || 1; j >= 1; j--) {
- const currentShelf = data.find(item => parseInt(item.gridFloor) === i && parseInt(item.gridShelf.match(/\d+$/)[0]) === j)
- if (currentShelf) {
- sortedData.push(currentShelf)
- }
+ if (item.isCheck) {
+ this.$refs.eform.formVisible = true
+ if (type === 5) {
+ this.$refs.eform.form.shelfId = this.bookShelfDetails.id
+ this.$refs.eform.form.gridShelf = this.gridShelf
+ this.$refs.eform.form.stockRegion = this.floorName + this.regionName + this.bookShelfDetails.shelfName + this.gridShelf + '架'
+ } else {
+ this.$refs.eform.form.shelfId = null
+ this.$refs.eform.form.gridShelf = null
+ this.$refs.eform.form.gridId = item.id
+ this.$refs.eform.form.stockRegion = item.gridName
}
+
+ this.$refs.eform.setData(type)
+ } else {
+ this.$message({ message: '当前层位不可盘点', type: 'error', offset: 8 })
}
- return sortedData
- },
- changeActiveTab(index) {
- this.tabIndex = index
- this.cellIndex = null
- this.getInitShelfGridByShelfId(index + 1)
},
handleCellCurrent(item, index) {
this.cellIndex = index
@@ -612,39 +504,65 @@ export default {
this.detailVisible = true
this.detailTable = item.books
this.detailCurrent = item
+ this.handleViewImg()
},
- handleViewImg(item) {
- this.detailImgVisible = true
- console.log(this.detailCurrent.gridCode)
+ setActiveItem(index) {
+ this.$refs.carousel.setActiveItem(index)
+ },
+ handleViewImg() {
+ // /PD20250102001/040011011/img_result/result_cut_1.jpg
+ // /PD20250102001/040011011/img_result/result_cut_2.jpg
+ // /PD20250102001/040011011/img_result/result_cut_3.jpg
+ // http://192.168.99.67:12010/api/fileRelevant/getImg?imgId=/ceshi111/1_1_book_spine-0.png
+
+ // http://192.168.99.67:12010/api/fileRelevant/getImg?imgId=/1501/PD20250108013/010011015/img_result/result_LSD.jpg
+ // http://192.168.99.67:12010/api/fileRelevant/getImg?imgId=/1501/PD20250108013/010011015/img_result/result_cut_1_compressed.jpg
+ this.bookImgData = []
+ // this.detailImgVisible = true
const params = {
'billNo': this.billNoImg,
'gridId': this.detailCurrent.id
}
- FetchIsGoodcutByBillNoAndGridId(params).then(res => {
- console.log(res)
- // /PD20250102001/040011011/img_result/result_cut_1.jpg
- // /PD20250102001/040011011/img_result/result_cut_2.jpg
- // /PD20250102001/040011011/img_result/result_cut_3.jpg
- // http://192.168.99.67:12010/api/fileRelevant/getImg?imgId=
- if (res) {
- // 2张
- // const url = this.baseApi + '/api/fileRelevant/getImg?imgId=' + this.billNoImg + '/' + this.detailCurrent.gridCod + '/img_result/result_cut_1.jpg'
-
- // for (var i = 0; i < 2; i++) {
- this.bookImgData = [
- this.baseApi + '/api/fileRelevant/getImg?imgId=/' + this.billNoImg + '/' + this.detailCurrent.gridCode + '/img_result/result_cut_1.jpg',
- this.baseApi + '/api/fileRelevant/getImg?imgId=/' + this.billNoImg + '/' + this.detailCurrent.gridCode + '/img_result/result_cut_2.jpg'
+ FetchIsGoodcutByBillNoAndGridId(params)
+ .then(res => {
+ const baseUrl = `${this.baseApi}/api/fileRelevant/getImg?imgId=/${this.billNoImg}/${this.detailCurrent.gridCode}/img_result/`
+ const commonImgs = [
+ `${baseUrl}result_LSD_compressed.jpg`,
+ `${baseUrl}result_cut_1_compressed.jpg`,
+ `${baseUrl}result_cut_2_compressed.jpg`
]
- // }
- } else {
- // 3张
- this.bookImgData = [
- this.baseApi + '/api/fileRelevant/getImg?imgId=/' + this.billNoImg + '/' + this.detailCurrent.gridCode + '/img_result/result_cut_1.jpg',
- this.baseApi + '/api/fileRelevant/getImg?imgId=/' + this.billNoImg + '/' + this.detailCurrent.gridCode + '/img_result/result_cut_2.jpg',
- this.baseApi + '/api/fileRelevant/getImg?imgId=/' + this.billNoImg + '/' + this.detailCurrent.gridCode + '/img_result/result_cut_3.jpg'
- ]
- }
- }).catch(() => {
+ this.bigImg = commonImgs[0]
+ if (res) {
+ this.bookImgData = commonImgs
+ } else {
+ this.bookImgData = [...commonImgs, `${baseUrl}result_cut_3_compressed.jpg`]
+ }
+ })
+ .catch(error => {
+ console.error(error)
+ })
+ },
+ showAllImg() {
+ this.detailImgVisible = true
+ this.$refs.carousel.setActiveItem(0)
+ },
+ handleDownloadImg() {
+ this.downImgLoading = true
+ const idsArray = []
+ for (const url of this.bookImgData) {
+ const startIndex = url.indexOf('imgId=') + 'imgId='.length
+ const endIndex = url.length
+ idsArray.push(url.slice(startIndex, endIndex))
+ }
+ // 下载桶图片
+ const params = {
+ 'imgIds': idsArray
+ }
+ const url = this.baseApi + '/api/fileRelevant/uploadImgs' + '?' + new URLSearchParams(params).toString()
+ getBlob(url, (blob) => {
+ const fileName = this.billNoImg + '-' + parseTime(new Date()) + '.zip'
+ saveAs(blob, fileName)
+ this.downImgLoading = false
})
},
handleCloseDialog() {
@@ -652,6 +570,7 @@ export default {
},
handleCloseImgDialog() {
this.detailImgVisible = false
+ this.activeIndex = 0
},
handleToGrids(data) {
this.$router.push({ path: '/dataScreening/gird' })
@@ -686,7 +605,6 @@ export default {
this.tabdialogIndex = index
},
changeShelfGetGrid(val) {
- console.log('val', val)
this.shelfAllGridDataLoading = true
const params = {
'gridShelf': '0' + val,
@@ -717,7 +635,7 @@ export default {
}
.tab-content{
width: 100%;
- min-height: calc(100vh - 234px) !important;
+ min-height: calc(100vh - 196px) !important;
.tab-nav{
flex: 1;
}
@@ -904,6 +822,10 @@ export default {
.el-dialog__body{
padding: 0 !important;
}
+
+ .tab-nav{
+ margin: 14px 0 10px 0 !important;
+ }
}
.detail-tab{
position: relative;
@@ -930,12 +852,37 @@ export default {
}
}
::v-deep .el-carousel__container{
- height: 700px !important;
+ height: 600px !important;
+ .el-carousel__item{
+ display: flex;
+ align-items: center;
+ }
.el-carousel__item img{
display: block;
- width: 100%;
- height: 100%;
+ // width: 100%;
+ // height: 100%;
+ max-width: 100%;
+ max-height: 100%;
+ margin: 0 auto;
}
+ .el-carousel__arrow{
+ background-color: rgba(3,72,243,1);
+ i.el-icon-arrow-left,
+ i.el-icon-arrow-right{
+ color: #fff;
+ }
+ .el-icon-arrow-right:before{
+ color: #fff;
+ }
+ }
+
+ }
+ ::v-deep .el-carousel__button{
+ height: 6px !important;
+ }
+ ::v-deep .el-carousel__indicators--outside button{
+ background-color: rgba(3,72,243,1);
+
}
.gird-img-button{
position: fixed;
diff --git a/src/views/visualCheck/checkManage/dataScreening/index.vue b/src/views/visualCheck/checkManage/dataScreening/index.vue
index 2fa5d64..339239b 100644
--- a/src/views/visualCheck/checkManage/dataScreening/index.vue
+++ b/src/views/visualCheck/checkManage/dataScreening/index.vue
@@ -13,7 +13,7 @@
-
+
导出
@@ -59,11 +59,12 @@
流通统计
2024-11-28 09:46
-
+