Browse Source

优化

master
xuhuajiao 5 months ago
parent
commit
789a40d9a3
  1. 1
      src/assets/styles/manage.scss
  2. 6
      src/views/visualCheck/bookstore/book/index.vue
  3. 8
      src/views/visualCheck/bookstore/collection/index.vue
  4. 8
      src/views/visualCheck/checkManage/bookSearch/index.vue
  5. 2
      src/views/visualCheck/checkManage/checkLog/index.vue
  6. 211
      src/views/visualCheck/checkManage/dataScreening/girdList.vue
  7. 2
      src/views/visualCheck/checkManage/dataScreening/index.vue
  8. 42
      src/views/visualCheck/checkManage/dataScreening/module/form.vue
  9. 4
      src/views/visualCheck/checkManage/dataScreening/regionsList.vue
  10. 4
      src/views/visualCheck/checkManage/dataScreening/shelfList.vue

1
src/assets/styles/manage.scss

@ -348,6 +348,7 @@
background-color: #E8F2FF;
border-radius: 3px;
overflow: hidden;
cursor: pointer;
// &:nth-last-of-type(-n+4) {
// margin-bottom: 0;
// }

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

@ -89,9 +89,9 @@
<el-table-column type="selection" align="center" width="55" />
<el-table-column prop="icon" label="封面" align="center">
<template slot-scope="scope">
<!-- <svg-icon :icon-class="scope.row.icon ? scope.row.icon : ''" /> -->
<img v-if="!scope.row.bookCover" src="~@/assets/images/cover-bg.png" alt="" style="height: 60px;">
<img v-else :src="baseApi + '/api/fileRelevant/getImg?imgType=2&imgId=' + scope.row.bookCover + '.jpg'" alt="" style="height: 60px;">
<img v-if="scope.row.bookCover === '' || scope.row.bookCover === null" src="~@/assets/images/cover-bg.png" alt="" style="height: 60px;">
<img v-else :src="baseApi + '/api/fileRelevant/getImg?imgType=2&imgId=' + scope.row.bookCover + '.jpg'" alt="">
<!-- <img style="height: 60px;" :src="scope.row.bookCover? baseApi + '/api/fileRelevant/getImg?imgType=2&imgId=' + scope.row.bookCover + '.jpg' : '~@/assets/images/cover-bg.png'" alt=""> -->
</template>
</el-table-column>
<el-table-column label="题名" prop="title" width="300px" :show-overflow-tooltip="true" />

8
src/views/visualCheck/bookstore/collection/index.vue

@ -42,8 +42,8 @@
<i class="iconfont icon-daochu" />
导出
</el-button>
<el-button type="primary" class="warehousing-btn iconfont" :disabled="crud.selections.length === 0"><i class="iconfont icon-xinzeng" />批量导入数据</el-button>
<el-button type="primary" class="warehousing-btn iconfont" :disabled="crud.selections.length === 0" @click="printArchivesCode(crud.selections)"><svg-icon icon-class="print" class="svg-arc-style" />批量打印条形码</el-button>
<!-- <el-button type="primary" class="warehousing-btn iconfont" :disabled="crud.selections.length === 0"><i class="iconfont icon-xinzeng" />批量导入数据</el-button>
<el-button type="primary" class="warehousing-btn iconfont" :disabled="crud.selections.length === 0" @click="printArchivesCode(crud.selections)"><svg-icon icon-class="print" class="svg-arc-style" />批量打印条形码</el-button> -->
</template>
</crudOperation>
</div>
@ -388,9 +388,11 @@ export default {
if (this.form.isbn) {
FetchBookBasiceByISBN({ 'isbn': this.form.isbn }).then(res => {
console.log(res)
// Vue
if (res) {
this.crud.form.title = res.title
this.imageUrl = this.baseApi + '/api/fileRelevant/getImg?imgType=2&imgId=' + res.bookCover + '.jpg'
const defaultImage = require('@/assets/images/system/default-img.jpg')
this.imageUrl = (res.bookCover == null || res.bookCover === '') ? defaultImage : this.baseApi + '/api/fileRelevant/getImg?imgType=2&imgId=' + res.bookCover + '.jpg'
} else {
this.crud.form.title = null
this.imageUrl = require('@/assets/images/system/default-img.jpg')

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

@ -168,8 +168,12 @@
<li><span>ISBN</span>{{ detailContent.isbn }}</li>
<li><span>条码号</span>{{ detailContent.barcode }}</li>
<!-- <li><span>馆藏地</span>机构-楼层-馆藏地名称</li> -->
<!-- :src="baseApi + '/api/fileRelevant/getImg?imgType=2&imgId=' +scope.row.bookCover+'.jpg'" -->
<li class="book-img"><img :src="detailContent.bookCover === null ? defaultImg : baseApi + '/api/fileRelevant/getImg?imgType=2&imgId=' +detailContent.bookCover+'.jpg'" :onerror="defaultImg" alt=""></li>
<li v-if="detailContent.bookCover" class="book-img">
<img :src="baseApi + '/api/fileRelevant/getImg?imgType=2&imgId=' + detailContent.bookCover + '.jpg'" alt="">
</li>
<li v-else class="book-img">
<img :src="defaultImg" alt="">
</li>
<li class="book-summary"><span>简介</span><p>{{ detailContent.summary ? detailContent.summary :"暂无简介" }}</p></li>
</ul>
<ul v-if="tabIndex===1" class="book-detail book-other">

2
src/views/visualCheck/checkManage/checkLog/index.vue

@ -48,7 +48,7 @@
<span v-if="scope.row.stockType===6">层位盘点</span>
</template>
</el-table-column>
<el-table-column prop="stockRegion" label="目标位置" :show-overflow-tooltip="true" />
<el-table-column prop="stockRegion" label="目标位置" min-width="180" />
<el-table-column prop="stockGridNum" label="目标数量">
<template slot-scope="scope">
<div>{{ scope.row.stockGridNum + ' / '+ (scope.row.totalGridNum?scope.row.totalGridNum:'0') +' 层位' }}</div>

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

@ -153,14 +153,24 @@
<i class="iconfont icon-sulan" />
盘点照片
</el-button> -->
<div v-if="detailCurrent && detailCurrent.onShelfNum" style="height: 260px; background-color: #ccc; overflow: hidden; position: relative;" @click="handleViewImg">
<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 v-if="detailCurrent && detailCurrent.onShelfNum" style="height: 260px; background-color: #ccc; overflow: hidden; position: relative;" @dblclick="handleViewImg" @mousedown="onMouseDown" @mousemove="onMouseMove" @mouseleave="onMouseUp" @mouseup="onMouseUp">
<img
ref="image"
style="display:block; width: 100%;cursor: grab;"
:src="bigImg"
alt=""
@wheel="onWheel"
>
<span style="position: absolute; top: 0; right: 0; padding: 4px 6px; color: #fff; background-color: rgba(3,72,243,.8); border-radius: 4px;">双击可查看所有图片</span>
<el-button v-if="shouldShowResetButton" style="position: absolute; bottom: 10px; right: 10px; background-color: #fff; color: rgba(3,72,243,1); font-weight: bold; padding: 4px;" @click="resetImage"><i class="iconfont icon-shuaxin" style="font-size: 12px;" />重置</el-button>
</div>
<ul class="tab-nav">
<li :class="{'active-tab-nav': tabdialogIndex === 0}" @click="changeDialogTab(0)">图书列表</li>
<el-button class="compare-btn" @click="isCompare = !isCompare">
<i :class="['iconfont', !isCompare ? 'icon-zhongxinjiance':'icon-huifu' ]" />{{ !isCompare ? '数据比对' : '返回列表' }}</el-button>
</ul>
<el-table
v-if="!isCompare"
ref="table"
class="archives-table"
:data="detailTable"
@ -187,12 +197,27 @@
<span v-if="scope.row.bookStatus === '错序'" class="row-state row-physical state-active">错序</span>
</template>
</el-table-column>
<!-- <el-table-column prop="updateTime" label="盘点时间">
<template slot-scope="scope">
<div>{{ scope.row.updateTime | parseTime }}</div>
</template>
</el-table-column> -->
</el-table>
<swiper
v-else
ref="swiperList"
class="swiper-title layerShelf-swiper"
:options="swiperListOptions"
:auto-update="true"
:auto-destroy="true"
>
<swiper-slide
v-for="(item,index) in detailTable"
:key="index"
ref="swiperSlideItem"
class="swiper-slide-title"
>
<div class="book-name" :class="[{ 'red-active' : item.bookStatus === '错架'} ,{ 'blue-active' : item.bookStatus === '错序'}]">
<span>{{ index+1 }}</span>
{{ item.bookName }}
</div>
</swiper-slide>
</swiper>
</div>
</div>
</el-dialog>
@ -234,10 +259,12 @@ import { mapGetters } from 'vuex'
import eForm from './module/form'
import exportForm from './module/export'
import { parseTime, saveAs, getBlob } from '@/utils/index'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
export default {
name: 'DataScreening',
components: { crudOperation, eForm, exportForm },
components: { crudOperation, eForm, exportForm, swiper, swiperSlide },
cruds() {
return CRUD({ title: '架位盘点', url: 'api/libraryRegion/initLibraryRegionList', crudMethod: { ...crudRegion }, sort: [], optShow: {
add: false,
@ -297,7 +324,23 @@ export default {
bigImg: '',
timeIndex: 0,
gridName: '',
getGridToward: 1
getGridToward: 1,
currentScale: 1, //
isDragging: false, //
startX: 0, // x
startY: 0, // y
translateX: 0, // x
translateY: 0, // y
dragSpeed: 0.3, //
zoomSpeed: 0.1, //
maxScale: 5, //
minScale: 0.1, //
swiperListOptions: {
slidesPerView: 'auto',
freeMode: true
},
isCompare: false,
shouldShowResetButton: false
}
},
computed: {
@ -305,11 +348,8 @@ export default {
'user',
'baseApi'
]),
swiperContent() {
return this.$refs.swiperContent.$el.swiper
},
swiperTitle() {
return this.$refs.swiperTitle.$el.swiper
swiperList() {
return this.$refs.swiperList.$el.swiper
},
cellStyle: function() {
const h = '76px'
@ -323,7 +363,6 @@ export default {
position: 'absolute'
}
}
},
async created() {
this.initData()
@ -373,7 +412,7 @@ export default {
if (localStorage.getItem('dataScreenShelfAllGrid')) {
this.shelfAllGridData = JSON.parse(localStorage.getItem('dataScreenShelfAllGrid'))
}
this.updateParts(dataScreenShelf.gridName)
// /
this.tabListData = [{ name: dataScreenShelf.regionName + ' - ' + this.removeAreaPrefix(dataScreenShelf.gridName) }]
@ -406,6 +445,13 @@ export default {
})
}
},
removeQUPrefix(gridNames) {
const index = gridNames.indexOf('区')
if (index !== -1) {
return gridNames.substring(index + 1)
}
return gridNames
},
removeAreaPrefix(gridNames) {
const index = gridNames.indexOf('面')
if (index !== -1) {
@ -482,22 +528,25 @@ export default {
},
toAdd(type, item) {
if (type === 5) {
this.$refs.eform.formVisible = true
// this.$refs.eform.formVisible = true
this.$refs.eform.form.shelfId = this.bookShelfDetails.id
this.$refs.eform.form.toward = this.getGridToward
this.$refs.eform.form.gridShelf = this.gridShelf
this.$refs.eform.form.stockRegion = this.floorName + this.regionName + this.bookShelfDetails.shelfName + this.gridShelf + '架'
this.$refs.eform.form.stockRegion = this.floorName + '-' + this.regionName + '-' + this.bookShelfDetails.shelfName + this.gridShelf + '架'
} else {
if (item.isCheck) {
this.$refs.eform.formVisible = true
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
} else {
this.$message({ message: '当前层位不可盘点', type: 'error', offset: 8 })
}
// if (item.isCheck) {
// this.$refs.eform.formVisible = true
this.$refs.eform.form.shelfId = null
this.$refs.eform.form.gridShelf = null
this.$refs.eform.form.gridId = item.id
this.$refs.eform.form.toward = this.getGridToward
this.$refs.eform.form.stockRegion = this.removeQUPrefix(item.gridName)
this.$refs.eform.gridStockRegion = this.floorName + '-' + this.regionName + '-' + this.removeQUPrefix(item.gridName)
// } else {
// this.$message({ message: '', type: 'error', offset: 8 })
// }
}
this.$refs.eform.setData(type)
this.$refs.eform.setData(type, item)
},
doExport(type) {
this.$refs.exportform.formExportVisible = true
@ -534,6 +583,47 @@ export default {
setActiveItem(index) {
this.$refs.carousel.setActiveItem(index)
},
//
onMouseDown(e) {
e.preventDefault()
this.isDragging = true
this.startX = e.clientX
this.startY = e.clientY
this.$refs.image.style.cursor = 'grabbing'
},
//
onMouseMove(e) {
if (!this.isDragging) return
const deltaX = (e.clientX - this.startX) * this.dragSpeed
const deltaY = (e.clientY - this.startY) * this.dragSpeed
this.translateX += deltaX
this.translateY += deltaY
this.$refs.image.style.transform = `scale(${this.currentScale}) translate(${this.translateX}px, ${this.translateY}px)`
this.startX = e.clientX
this.startY = e.clientY
this.shouldShowResetButton = true
},
//
onMouseUp() {
this.isDragging = false
this.$refs.image.style.cursor = 'grab'
},
//
onWheel(e) {
e.preventDefault()
const delta = e.deltaY > 0 ? -1 : 1
this.currentScale = Math.min(this.maxScale, Math.max(this.minScale, this.currentScale + delta * this.zoomSpeed))
this.$refs.image.style.transform = `scale(${this.currentScale}) translate(${this.translateX}px, ${this.translateY}px)`
this.shouldShowResetButton = true
},
//
resetImage() {
this.currentScale = 1
this.translateX = 0
this.translateY = 0
this.$refs.image.style.transform = 'scale(1) translate(0, 0)'
this.shouldShowResetButton = false
},
handleViewImg() {
// /PD20250102001/040011011/img_result/result_cut_1.jpg
// /PD20250102001/040011011/img_result/result_cut_2.jpg
@ -542,6 +632,7 @@ export default {
// http://192.168.99.67:12010/api/fileRelevant/getImg?imgType=1&imgId=/1501/PD20250108013/010011015/img_result/result_LSD.jpg
// http://192.168.99.67:12010/api/fileRelevant/getImg?imgType=1&imgId=/1501/PD20250108013/010011015/img_result/result_cut_1_compressed.jpg
this.bookImgData = []
this.detailImgVisible = true
const params = {
@ -553,14 +644,15 @@ export default {
const baseUrl = `${this.baseApi}/api/fileRelevant/getImg?imgType=1&imgId=/${this.libcode}/${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`
`${baseUrl}result_cut_1_compressed.jpg`
]
this.$refs.carousel.setActiveItem(0)
if (res) {
if (res === null) {
this.bookImgData = commonImgs
} else {
this.bookImgData = [...commonImgs, `${baseUrl}result_cut_3_compressed.jpg`]
} else if (res === true) {
this.bookImgData = [...commonImgs, `${baseUrl}result_cut_2_compressed.jpg`]
} else if (res === false) {
this.bookImgData = [...commonImgs, `${baseUrl}result_cut_2_compressed.jpg`, `${baseUrl}result_cut_3_compressed.jpg`]
}
})
.catch(error => {
@ -588,6 +680,10 @@ export default {
},
handleCloseDialog() {
this.detailVisible = false
this.isCompare = false
if (this.shouldShowResetButton) {
this.resetImage()
}
},
handleCloseImgDialog() {
this.detailImgVisible = false
@ -716,7 +812,18 @@ export default {
width: 100%;
min-height: calc(100vh - 232px) !important;
.tab-nav{
position: relative;
flex: 1;
.iconfont{
font-size: 12px;
}
}
.compare-btn{
position: absolute;
right: 0;
top: 0;
font-size: 12px;
padding: 3px;
}
}
.gird-data-header{
@ -996,4 +1103,40 @@ export default {
font-style: normal;
}
}
.layerShelf-swiper{
margin: 0 20px;
::v-deep .swiper-wrapper{
font-size: 14px;
border-bottom: none !important;
.swiper-slide-title {
font-weight: bold;
height: 300px;
margin-top: 10px;
margin-right: 10px;
color: #0c0e1e;
writing-mode:vertical-rl;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
cursor: pointer;
.book-name {
&.red-active{
color: #ed4a41;
}
&.blue-active{
color: #0348f3;
}
span{
display: inline-block;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
transform: rotate(-90deg);
}
}
}
}
}
</style>

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

@ -173,7 +173,7 @@ export default {
})
},
toAdd(type) {
this.$refs.eform.formVisible = true
// this.$refs.eform.formVisible = true
this.$refs.eform.setData(type)
this.$refs.eform.form.stockRegion = '全部区域'
},

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

@ -5,20 +5,20 @@
<div class="setting-dialog">
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
<el-form-item label="盘点单号" prop="stockBill">
<el-input v-model="form.stockBill" disabled />
<el-input v-model="form.stockBill" disabled style="width: 240px;" />
</el-form-item>
<el-form-item label="盘点类型" prop="stockTypeName">
<el-input v-model="form.stockTypeName" disabled />
<el-input v-model="form.stockTypeName" disabled style="width: 240px;" />
</el-form-item>
<el-form-item label="目标位置" prop="stockRegion">
<el-input v-model="form.stockRegion" disabled />
<el-input v-model="form.stockRegion" disabled style="width: 240px;" />
</el-form-item>
<el-form-item label="目标数量" prop="stockGridNumName">
<el-input v-model="form.stockGridNumName" disabled />
<el-input v-model="form.stockGridNumName" disabled style="width: 240px;" />
</el-form-item>
<el-row>
<el-form-item label="备注" prop="stockRemarks">
<el-input v-model="form.stockRemarks" type="textarea" style="width: 572px;" :rows="4" />
<el-input v-model="form.stockRemarks" type="textarea" style="width: 590px;" :rows="4" />
</el-form-item>
</el-row>
</el-form>
@ -34,7 +34,7 @@
import crudStockTaskLog from '@/api/stockTaskLog/index'
import CRUD, { form } from '@crud/crud'
const defaultForm = { stockTypeName: '', stockType: null, stockBill: null, stockRegion: '', stockGridNum: null, stockGridNumName: null, totalGridNum: null, stockRemarks: null, regionId: null, shelfId: null, gridShelf: null, gridId: null }
const defaultForm = { stockTypeName: '', stockType: null, stockBill: null, stockRegion: '', stockGridNum: null, stockGridNumName: null, totalGridNum: null, stockRemarks: null, regionId: null, shelfId: null, gridShelf: null, gridId: null, toward: null }
export default {
name: 'DataForm',
mixins: [
@ -46,6 +46,7 @@ export default {
return {
saveLoading: false,
formVisible: false,
gridStockRegion: '',
rules: {
stockBill: [
{ required: true, message: '请输入盘点单号', trigger: 'blur' }
@ -63,7 +64,7 @@ export default {
}
},
methods: {
setData(type) {
setData(type, item) {
this.form.stockType = type
const typeMap = {
1: {
@ -71,6 +72,7 @@ export default {
shelfId: null,
gridShelf: null,
gridId: null,
toward: null,
stockTypeName: '全量盘点'
},
2: {
@ -78,6 +80,7 @@ export default {
shelfId: null,
gridShelf: null,
gridId: null,
toward: null,
stockTypeName: '区域盘点'
},
4: {
@ -85,6 +88,7 @@ export default {
shelfId: this.form.shelfId || null,
gridShelf: null,
gridId: null,
toward: null,
stockTypeName: '书架盘点'
},
5: {
@ -92,6 +96,7 @@ export default {
shelfId: this.form.shelfId || null,
gridShelf: this.form.gridShelf || null,
gridId: null,
toward: this.form.toward || null,
stockTypeName: '架位盘点'
},
6: {
@ -99,17 +104,31 @@ export default {
shelfId: null,
gridShelf: null,
gridId: this.form.gridId || null,
stockTypeName: '层位盘点'
stockTypeName: '层位盘点',
toward: this.form.toward || null
}
}
const { regionId, shelfId, gridShelf, gridId, stockTypeName } = typeMap[type] || {}
const params = { regionId, shelfId, gridShelf, gridId }
const { regionId, shelfId, gridShelf, gridId, toward, stockTypeName } = typeMap[type] || {}
const params = { regionId, shelfId, gridShelf, gridId, toward }
this.form.stockTypeName = stockTypeName
Promise.all([
crudStockTaskLog.FetchNewBillNo(),
crudStockTaskLog.FetchStockGirdNum(params),
crudStockTaskLog.FetchTotalGirdNum(params)
]).then(([newBillNoRes, stockGridNumRes, totalGirdNumRes]) => {
if (stockGridNumRes === 0) {
if (this.form.stockType === 6) {
this.$message({ message: '当前层位不可盘点', type: 'error', offset: 8 })
} else {
this.$message({ message: '当前无可盘点的层位', type: 'error', offset: 8 })
}
} else {
if (this.form.stockType === 6 && !item.isCheck) {
this.$message({ message: '当前层位不可盘点', type: 'error', offset: 8 })
} else {
this.formVisible = true
}
}
this.form.stockBill = newBillNoRes
this.crud.form.stockGridNumName = stockGridNumRes + ' / ' + totalGirdNumRes + ' 层位'
this.crud.form.stockGridNum = stockGridNumRes
@ -128,6 +147,9 @@ export default {
this.$refs['form'].validate((valid) => {
if (valid) {
this.saveLoading = true
if (this.form.stockType === 6 && this.gridStockRegion !== '') {
this.form.stockRegion = this.gridStockRegion
}
delete this.form.stockGridNumName
delete this.form.stockTypeName
crudStockTaskLog.add(this.form).then((res) => {

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

@ -191,9 +191,9 @@ export default {
return true
},
toAdd(type) {
this.$refs.eform.formVisible = true
// this.$refs.eform.formVisible = true
this.$refs.eform.form.regionId = this.regionOptions[this.tabIndex].id
this.$refs.eform.form.stockRegion = this.regionOptions[this.tabIndex].floorName + this.regionOptions[this.tabIndex].regionName
this.$refs.eform.form.stockRegion = this.regionOptions[this.tabIndex].floorName + '-' + this.regionOptions[this.tabIndex].regionName
this.$refs.eform.setData(type)
},
doExport(type) {

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

@ -321,9 +321,9 @@ export default {
this.getInitStockInfo(val)
},
toAdd(type) {
this.$refs.eform.formVisible = true
// this.$refs.eform.formVisible = true
this.$refs.eform.form.shelfId = this.bookShelfDetails.id
this.$refs.eform.form.stockRegion = this.floorName + this.regionName + this.bookShelfDetails.shelfName
this.$refs.eform.form.stockRegion = this.floorName + '-' + this.regionName + '-' + this.bookShelfDetails.shelfName
this.$refs.eform.setData(type)
},
doExport(type) {

Loading…
Cancel
Save