Browse Source

0113

master
xuhuajiao 6 months ago
parent
commit
7222446fdf
  1. 2
      package.json
  2. 2
      src/layout/components/Sidebar/Logo.vue
  3. 2
      src/settings.js
  4. 29
      src/views/components/bookSwiper.vue
  5. 11
      src/views/home.vue
  6. 2
      src/views/login.vue
  7. 3
      src/views/visualCheck/bookstore/book/index.vue
  8. 6
      src/views/visualCheck/bookstore/collectionLocation/index.vue
  9. 311
      src/views/visualCheck/checkManage/dataScreening/girdList.vue
  10. 81
      src/views/visualCheck/checkManage/dataScreening/index.vue
  11. 123
      src/views/visualCheck/checkManage/dataScreening/module/export.vue
  12. 8
      src/views/visualCheck/checkManage/dataScreening/module/form.vue
  13. 26
      src/views/visualCheck/checkManage/dataScreening/regionsList.vue
  14. 16
      src/views/visualCheck/checkManage/dataScreening/shelfList.vue
  15. 8
      src/views/visualCheck/checkManage/upDownLog/index.vue

2
package.json

@ -1,7 +1,7 @@
{
"name": "library-management-system",
"version": "1.0.0",
"description": "图书馆综合管理系统",
"description": "AI视觉盘点系统",
"license": "",
"scripts": {
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",

2
src/layout/components/Sidebar/Logo.vue

@ -2,7 +2,7 @@
<div class="sidebar-logo-container">
<router-link class="sidebar-logo-link" to="/">
<!-- <img src="@/assets/images/login/dl-logo.png" alt=""> -->
<h3 class="login-title">图书馆综合管理系统</h3>
<h3 class="login-title">AI视觉盘点系统</h3>
</router-link>
</div>
</template>

2
src/settings.js

@ -2,7 +2,7 @@ module.exports = {
/**
* @description 网站标题
*/
title: '图书馆综合管理系统',
title: 'AI视觉盘点系统',
/**
* @description 是否显示 tagsView
*/

29
src/views/components/bookSwiper.vue

@ -74,7 +74,6 @@ export default {
name: 'BookSwiper',
components: { swiper, swiperSlide },
props: {
},
data() {
const _this = this
@ -94,7 +93,9 @@ export default {
freeMode: true
},
tabListData: [{ name: '热门图书' }, { name: '热门架位' }],
bookList: []
bookList: [],
swiperParams: {},
swiperShelfParams: {}
}
},
computed: {
@ -109,11 +110,11 @@ export default {
}
},
mounted() {
if (this.swiperActiveIndex === 0) {
this.getInitHotBookList()
} else {
this.getInitHotShelfList()
}
// if (this.swiperActiveIndex === 0) {
// this.getInitHotBookList()
// } else {
// this.getInitHotShelfList()
// }
},
methods: {
handleSlidClickFun(index) {
@ -131,13 +132,15 @@ export default {
this.swiperTitle.slideTo(index, 500, false)
},
getInitHotBookList() {
FetchInitHotBookList().then(res => {
const params = this.swiperParams
FetchInitHotBookList(params).then(res => {
this.bookList = res
}).catch(() => {
})
},
getInitHotShelfList() {
FetchInitHotShelfList().then(res => {
const params = this.swiperShelfParams
FetchInitHotShelfList(params).then(res => {
this.bookList = res
}).catch(() => {
})
@ -167,12 +170,4 @@ export default {
}
}
}
.swiper-content{
// height: 544px;
}
.swiper-slide-content {
// padding: 0 10px;
// margin: 0 10px 0 0;
}
</style>

11
src/views/home.vue

@ -93,7 +93,7 @@
</h3>
<div class="refresh-date">2024-11-28 09:46</div>
<div class="chart-wrapper" style="padding: 0 10px; margin-top: -10px;">
<bookSwiper />
<bookSwiper ref="bookSwiperRefs" />
</div>
</div>
</el-col>
@ -190,6 +190,15 @@ export default {
this.getSystemInfo()
this.getStockLog()
this.handleInitStockInfo()
this.$nextTick(() => {
this.$refs.bookSwiperRefs.swiperParams = {}
this.$refs.bookSwiperRefs.swiperShelfParams = {}
if (this.$refs.bookSwiperRefs.swiperActiveIndex === 0) {
this.$refs.bookSwiperRefs.getInitHotBookList()
} else {
this.$refs.bookSwiperRefs.getInitHotShelfList()
}
})
},
mounted() {
// const _this = this

2
src/views/login.vue

@ -9,7 +9,7 @@
label-width="0px"
class="login-form"
>
<h3 class="login-title">图书馆综合管理系统</h3>
<h3 class="login-title">AI视觉盘点系统</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"

3
src/views/visualCheck/bookstore/book/index.vue

@ -237,13 +237,14 @@ export default {
this.$refs.table.toggleRowSelection(row)
},
toDelete(datas) {
this.$confirm('此操作将删除当前所选书<span>你是否还要继续?</span>', '提示', {
this.$confirm('此操作将删除当前所选书<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
this.crud.delAllLoading = true
// bookRecNos
const ids = []
datas.forEach(val => {
ids.push(val.bookRecNo)

6
src/views/visualCheck/bookstore/collectionLocation/index.vue

@ -142,7 +142,7 @@ export default {
[CRUD.HOOK.afterSubmit]() {
},
toDelete(datas) {
this.$confirm('此操作将删除当前所选机构<span>你是否还要继续?</span>', '提示', {
this.$confirm('此操作将删除当前所选馆藏地<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '继续',
cancelButtonText: '取消',
type: 'warning',
@ -154,8 +154,8 @@ export default {
ids.push(val.id)
})
console.log(ids)
crudBookBasice.del(ids).then(() => {
this.$message({ message: '删除成功', type: 'success', offset: 8 })
crudBookBasice.del(ids).then((res) => {
this.$message({ message: res, type: 'success', offset: 8 })
this.crud.delAllLoading = false
this.crud.refresh()
}).catch(err => {

311
src/views/visualCheck/checkManage/dataScreening/girdList.vue

@ -25,7 +25,6 @@
<span class="left-bottom-line" />
<div class="gird-data-header">
<ul class="tab-nav">
<!-- @click="changeActiveTab(index)" :class="{ 'active-tab-nav': tabIndex == index }-->
<li v-for="(item,index) in tabListData" :key="index" class="active-tab-nav">{{ item.name }}<i /></li>
<!-- 最右侧装饰img -->
<span class="tab-right-img" />
@ -35,8 +34,8 @@
<p class="tag-place">错架<i class="iconfont icon-zhuangtai2" />1</p>
<p class="tag-all">在架<i class="iconfont icon-zhuangtai2" />20</p>
</div> -->
<div class="time-update-cont">
<span v-if="checkDateLine.length !== 0" class="time-left-txt">最后更新时间</span>
<div v-if="checkDateLine.length !== 0" class="time-update-cont">
<span class="time-left-txt">最后更新时间</span>
<el-button>{{ checkDateLine[0].endTime }}</el-button>
<div class="time-update-line">
<el-timeline>
@ -65,7 +64,8 @@
</el-button>
</template>
<template v-slot:right>
<el-button :loading="crud.downloadLoading" size="mini" @click="doExport(crud.selections)">
<!-- @click="doExport(crud.selections)" -->
<el-button :loading="crud.downloadLoading" size="mini">
<i class="iconfont icon-daochu" />
导出
</el-button>
@ -114,7 +114,7 @@
</div>
</div>
</div>
<!-- popover -->
<div
v-if="popoverIndex !== null"
class="popover-external-set"
@ -145,10 +145,15 @@
<div class="setting-dialog">
<div class="detail-tab tab-content">
<el-button class="check-view-img" size="mini" @click="handleViewImg">
<!-- <el-button v-if="detailCurrent && detailCurrent.onShelfNum" class="check-view-img" size="mini" @click="handleViewImg">
<i class="iconfont icon-sulan" />
盘点照片
</el-button>
</el-button> -->
<div style="height: 260px; background-color: #ccc; overflow: hidden; position: relative;" @click="showAllImg">
<img style="display:block; width: 100%;" :src="bigImg" alt="">
<span style="position: absolute; top: 0; right: 0; padding: 4px 6px; color: #fff; background-color: rgba(3,72,243,.8); border-radius: 4px;">单击可查看所有图片</span>
</div>
<ul class="tab-nav">
<li :class="{'active-tab-nav': tabdialogIndex === 0}" @click="changeDialogTab(0)">图书列表</li>
</ul>
@ -157,7 +162,7 @@
class="archives-table"
:data="detailTable"
style="width: 100%;"
height="calc(100vh - 329px)"
height="calc(100vh - 560px)"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="bookName" label="题名" min-width="110" show-overflow-tooltip />
@ -193,7 +198,7 @@
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="gird-img-button">
<el-button size="mini">
<el-button size="mini" :loading="downImgLoading" :disabled="downImgLoading" @click="handleDownloadImg">
<i class="iconfont icon-xiazai" />
下载
</el-button>
@ -203,9 +208,8 @@
</el-button>
</div>
<div class="setting-dialog">
<el-carousel indicator-position="outside">
<el-carousel ref="carousel" indicator-position="outside" :autoplay="false" @setActiveItem="setActiveItem">
<el-carousel-item v-for="item in bookImgData" :key="item">
{{ item }}
<img :src="item" alt="">
</el-carousel-item>
</el-carousel>
@ -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 '1S'
// shelfType 2 'A1B1'
// shelfType 3 'B1A1'
// 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;

81
src/views/visualCheck/checkManage/dataScreening/index.vue

@ -13,7 +13,7 @@
</el-button>
</template>
<template v-slot:right>
<el-button :loading="crud.downloadLoading" size="mini" @click="doExport(crud.selections)">
<el-button :loading="crud.downloadLoading" size="mini" @click="doExport(1)">
<i class="iconfont icon-daochu" />
导出
</el-button>
@ -59,11 +59,12 @@
<div class="lib-right-item">
<h4>流通统计</h4>
<div class="refresh-date">2024-11-28 09:46</div>
<bookSwiper />
<bookSwiper ref="bookSwiperRefs" />
</div>
</div>
</div>
<eForm ref="eform" />
<exportForm ref="exportform" />
</div>
</template>
@ -79,10 +80,11 @@ import defaultImg from '@/assets/images/system/default-img.jpg'
import bookSwiper from '@/views/components/bookSwiper.vue'
import CanvasPreview from '@/views/components/canvasPreview.vue'
import eForm from './module/form'
import exportForm from './module/export'
export default {
name: 'DataScreening',
components: { crudOperation, bookSwiper, CanvasPreview, eForm },
components: { crudOperation, bookSwiper, CanvasPreview, eForm, exportForm },
cruds() {
return CRUD({ title: '数据总览', url: 'api/libraryFloor/initLibraryFloorList', crudMethod: { ...crudStockTaskLog }, sort: [], optShow: {
add: false,
@ -126,7 +128,9 @@ export default {
add: ['admin', 'floor:add'],
edit: ['admin', 'floor:edit'],
del: ['admin', 'floor:del']
}
},
swiperParams: {},
swiperShelfParams: {}
}
},
computed: {
@ -156,63 +160,30 @@ export default {
'floorId': this.floorOptions[this.tabIndex].id
}
this.handleInitStockInfo(params)
this.$nextTick(() => {
this.$refs.bookSwiperRefs.swiperParams = {
'floorId': this.floorOptions[this.tabIndex].id
}
this.$refs.bookSwiperRefs.swiperShelfParams = {
'floorId': this.floorOptions[this.tabIndex].id
}
if (this.$refs.bookSwiperRefs.swiperActiveIndex === 0) {
this.$refs.bookSwiperRefs.getInitHotBookList()
} else {
this.$refs.bookSwiperRefs.getInitHotShelfList()
}
})
},
toAdd(type) {
this.$refs.eform.formVisible = true
this.$refs.eform.setData(type)
this.$refs.eform.form.stockRegion = '全部区域'
},
// changeActiveTab(index) {
// this.prewLoading = true
// if (this.$refs.previewRefs.canvasPreview.lowerCanvasEl) {
// this.$refs.previewRefs.canvasPreview.clear()
// this.$refs.previewRefs.canvasPreview.dispose()
// }
// this.allCoverData = []
// this.tabIndex = index
// const params = {
// 'floorId': this.floorOptions[index].id
// }
// FetchInitLibraryRegionList(params).then(res => {
// this.allCoverData = res.content
// if (this.floorOptions[index].floorMap) {
// this.imageUrl = this.baseApi + '/api/fileRelevant/getImg?imgId=' + this.floorOptions[index].floorMap
// } else {
// this.imageUrl = this.defaultImg
// }
// if (this.allCoverData.length !== 0) {
// this.currentMarkData = this.allCoverData[0]
// const parsedSignPoints = this.allCoverData.map(item => {
// const signPoint = item.signPoint ? JSON.parse(item.signPoint) : null
// return {
// id: item.id,
// name: item.regionName,
// floorName: item.floorName,
// floorId: item.floorId,
// pointInfo: signPoint ? signPoint.pointInfo[0].pointInfo : null
// }
// })
// const imgInfo = JSON.parse(this.allCoverData[0].signPoint).imgInfo
// const result = {
// pointInfo: parsedSignPoints,
// imgInfo: imgInfo
// }
// console.log('result', result)
// this.$nextTick(() => {
// this.$refs.previewRefs.initCanvasPreview(result, this.tabIndex)
// })
// } else {
// this.currentMarkData = {}
// setTimeout(() => {
// this.prewLoading = false
// }, 500)
// }
// }).catch(() => {
// })
// },
doExport(type) {
this.$refs.exportform.formExportVisible = true
this.$refs.exportform.type = 1
},
async getInitStockInfo(data) {
const promises = data.map(item => {
const params = {

123
src/views/visualCheck/checkManage/dataScreening/module/export.vue

@ -0,0 +1,123 @@
<template>
<el-dialog append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleCloseForm" :visible="formExportVisible" title="导出数据">
<span class="dialog-right-top" />
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
<el-radio-group v-model="form.exportRadio">
<el-radio :label="1">盘点统计表</el-radio>
<el-radio v-if="type !== 1" :label="2">盘点明细表</el-radio>
<el-radio v-if="type === 3" :label="3">盘点差异表</el-radio>
</el-radio-group>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="handleCloseForm">取消</el-button>
<el-button :loading="saveLoading" type="primary" @click="handleComfiredEditing">继续</el-button>
</div>
</div>
</el-dialog>
</template>
<script>
import CRUD, { form } from '@crud/crud'
const defaultForm = { exportRadio: 1 }
export default {
name: 'DataForm',
mixins: [
form(function() {
return Object.assign({ }, defaultForm)
})
],
data() {
return {
saveLoading: false,
formExportVisible: false,
type: 1,
rules: {
exportRadio: [
{ required: true, message: '请选择需要导出得数据', trigger: 'change' }
]
}
}
},
methods: {
setData(type) {
this.form.stockType = type
const typeMap = {
1: {
regionId: null,
shelfId: null,
gridShelf: null,
gridId: null,
stockTypeName: '全量盘点'
},
2: {
regionId: this.form.regionId || null,
shelfId: null,
gridShelf: null,
gridId: null,
stockTypeName: '区域盘点'
},
4: {
regionId: null,
shelfId: this.form.shelfId || null,
gridShelf: null,
gridId: null,
stockTypeName: '书架盘点'
},
5: {
regionId: null,
shelfId: this.form.shelfId || null,
gridShelf: this.form.gridShelf || null,
gridId: null,
stockTypeName: '架位盘点'
},
6: {
regionId: null,
shelfId: null,
gridShelf: null,
gridId: this.form.gridId || null,
stockTypeName: '层位盘点'
}
}
console.log(typeMap)
},
handleCloseForm() {
this.$refs['form'].clearValidate()
this.$refs['form'].resetFields()
// this.form = {}
this.formExportVisible = false
},
handleComfiredEditing() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.saveLoading = true
// crudStockTaskLog.add(this.form).then((res) => {
// if (res.code !== 500) {
// this.$message({ message: '', type: 'success', offset: 8 })
// } else {
// this.$message({ message: res.message, type: 'error', offset: 8 })
// }
// this.handleCloseForm()
// this.saveLoading = false
// // this.$emit('refresh')
// }).catch(err => {
// console.log(err)
// this.saveLoading = true
// })
} else {
return false
}
})
},
//
[CRUD.HOOK.afterValidateCU](crud) {
return true
}
}
}
</script>
<style lang="scss" scoped>
</style>

8
src/views/visualCheck/checkManage/dataScreening/module/form.vue

@ -24,7 +24,7 @@
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="handleCloseForm">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="handleComfiredEditing">保存</el-button>
<el-button :loading="saveLoading" type="primary" @click="handleComfiredEditing">保存</el-button>
</div>
</div>
</el-dialog>
@ -44,6 +44,7 @@ export default {
],
data() {
return {
saveLoading: false,
formVisible: false,
rules: {
stockBill: [
@ -126,9 +127,9 @@ export default {
handleComfiredEditing() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.saveLoading = true
delete this.form.stockGridNumName
delete this.form.stockTypeName
console.log('this.form', this.form)
crudStockTaskLog.add(this.form).then((res) => {
if (res.code !== 500) {
this.$message({ message: '新增盘点成功', type: 'success', offset: 8 })
@ -136,9 +137,10 @@ export default {
this.$message({ message: res.message, type: 'error', offset: 8 })
}
this.handleCloseForm()
// this.$emit('refresh')
this.saveLoading = false
}).catch(err => {
console.log(err)
this.saveLoading = false
})
} else {
return false

26
src/views/visualCheck/checkManage/dataScreening/regionsList.vue

@ -20,7 +20,7 @@
</el-button>
</template>
<template v-slot:right>
<el-button :loading="crud.downloadLoading" size="mini" @click="doExport(crud.selections)">
<el-button :loading="crud.downloadLoading" size="mini" @click="doExport(2)">
<i class="iconfont icon-daochu" />
导出
</el-button>
@ -58,11 +58,12 @@
<div class="lib-right-item">
<h4>本区流通统计</h4>
<div class="refresh-date">2024-11-28 09:46</div>
<bookSwiper />
<bookSwiper ref="bookSwiperRefs" />
</div>
</div>
</div>
<eForm ref="eform" />
<exportForm ref="exportform" />
</div>
</template>
@ -78,10 +79,11 @@ import defaultImg from '@/assets/images/system/default-img.jpg'
import bookSwiper from '@/views/components/bookSwiper.vue'
import CanvasPreview from '@/views/components/canvasPreview.vue'
import eForm from './module/form'
import exportForm from './module/export'
export default {
name: 'DataScreening',
components: { crudOperation, bookSwiper, CanvasPreview, eForm },
components: { crudOperation, bookSwiper, CanvasPreview, eForm, exportForm },
cruds() {
return CRUD({ title: '区域总览', url: 'api/libraryRegion/initLibraryRegionList', crudMethod: { ...crudRegion }, sort: [], optShow: {
add: false,
@ -130,7 +132,9 @@ export default {
edit: ['admin', 'floor:edit'],
del: ['admin', 'floor:del']
},
baseStockDataAllShelf: []
baseStockDataAllShelf: [],
swiperParams: {},
swiperShelfParams: {}
}
},
computed: {
@ -174,6 +178,16 @@ export default {
'regionId': this.regionOptions[this.tabIndex].id
}
this.handleInitStockInfo(params)
this.$nextTick(() => {
this.$refs.bookSwiperRefs.swiperParams = params
this.$refs.bookSwiperRefs.swiperShelfParams = params
if (this.$refs.bookSwiperRefs.swiperActiveIndex === 0) {
this.$refs.bookSwiperRefs.getInitHotBookList()
} else {
this.$refs.bookSwiperRefs.getInitHotShelfList()
}
})
},
//
[CRUD.HOOK.afterValidateCU](crud) {
@ -185,6 +199,10 @@ export default {
this.$refs.eform.form.stockRegion = this.regionOptions[this.tabIndex].floorName + this.regionOptions[this.tabIndex].regionName
this.$refs.eform.setData(type)
},
doExport(type) {
this.$refs.exportform.formExportVisible = true
this.$refs.exportform.type = 2
},
async getInitStockInfo(data) {
const promises = data.map(item => {
const params = {

16
src/views/visualCheck/checkManage/dataScreening/shelfList.vue

@ -27,7 +27,7 @@
</el-button>
</template>
<template v-slot:right>
<el-button :loading="crud.downloadLoading" size="mini" @click="doExport(crud.selections)">
<el-button :loading="crud.downloadLoading" size="mini" @click="doExport(3)">
<i class="iconfont icon-daochu" />
导出
</el-button>
@ -114,6 +114,7 @@
</div>
</div>
<eForm ref="eform" />
<exportForm ref="exportform" />
</div>
</template>
@ -126,10 +127,11 @@ import CRUD, { presenter, header, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation'
import { mapGetters } from 'vuex'
import eForm from './module/form'
import exportForm from './module/export'
export default {
name: 'DataScreening',
components: { crudOperation, eForm },
components: { crudOperation, eForm, exportForm },
cruds() {
return CRUD({ title: '架位总览', url: 'api/libraryRegion/initLibraryRegionList', crudMethod: { ...crudRegion }, sort: [], optShow: {
add: false,
@ -316,7 +318,6 @@ export default {
})
},
changeShelfGetGrid(val) {
console.log('val', val)
this.initData(val)
this.getInitStockInfo(val)
},
@ -326,6 +327,10 @@ export default {
this.$refs.eform.form.stockRegion = this.floorName + this.regionName + this.bookShelfDetails.shelfName
this.$refs.eform.setData(type)
},
doExport(type) {
this.$refs.exportform.formExportVisible = true
this.$refs.exportform.type = 3
},
removeAreaPrefix(gridNames) {
return gridNames.replace(/\d*区|\d*层/g, '')
},
@ -440,8 +445,6 @@ export default {
this.getInitShelfGridByShelfId(this.layerVal.id, index + 1)
},
handleCellCurrent(item, index) {
console.log('index', index)
console.log('item', item)
this.cellIndex = index
this.cellInfo = {
id: item.id,
@ -483,7 +486,6 @@ export default {
for (let i = 0; i < this.booShelfGrid.length; i++) {
const columnIndex = i % this.rackNum
// 5
console.log('this.booShelfGrid.length', this.booShelfGrid.length)
if (this.rackNum !== 1) {
if (columnIndex === this.rackNum - 1) {
lastColumnIndexes.push(i)
@ -510,8 +512,6 @@ export default {
'shelfId': this.bookShelfDetails.id,
'gridShelf': this.booShelfGrid[columnIndex].gridShelf
}
console.log(params)
// this.handleInitStockInfo(params)
FetchInitStockInfo(params).then(res => {
this.itemStockData = res
}).catch(() => {

8
src/views/visualCheck/checkManage/upDownLog/index.vue

@ -39,7 +39,9 @@
>
<el-table-column prop="udType" label="类型" width="60">
<template slot-scope="scope">
<div>{{ scope.row.udType === 1 ? "上架":"下架" }}</div>
<!-- <div>{{ scope.row.udType === 1 ? "上架":"下架" }}</div> -->
<span v-if="scope.row.udType === 1" style="width: auto;" class="row-state row-binding state-active">上架</span>
<span v-else style="width: auto;" class="row-state row-physical state-active">下架</span>
</template>
</el-table-column>
<el-table-column prop="udWay" label="方式" width="60">
@ -51,8 +53,8 @@
<el-table-column prop="sortmark" label="索书号" />
<el-table-column prop="barcode" label="条码" />
<el-table-column prop="gridName" label="目标层位" />
<el-table-column prop="bill_no" label="盘点单号" />
<el-table-column prop="createBy" label="操作者" />
<el-table-column prop="billNo" label="盘点单号" />
<el-table-column prop="createBy" label="操作者" width="100" />
<el-table-column prop="createTime" label="操作时间">
<template slot-scope="scope">
<div>{{ scope.row.createTime | parseTime }}</div>

Loading…
Cancel
Save