From 789a40d9a3518c9ded25bafcfa760e062d521b30 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Mon, 20 Jan 2025 17:27:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/styles/manage.scss | 1 + .../visualCheck/bookstore/book/index.vue | 6 +- .../bookstore/collection/index.vue | 8 +- .../checkManage/bookSearch/index.vue | 8 +- .../checkManage/checkLog/index.vue | 2 +- .../checkManage/dataScreening/girdList.vue | 211 +++++++++++++++--- .../checkManage/dataScreening/index.vue | 2 +- .../checkManage/dataScreening/module/form.vue | 42 +++- .../checkManage/dataScreening/regionsList.vue | 4 +- .../checkManage/dataScreening/shelfList.vue | 4 +- 10 files changed, 230 insertions(+), 58 deletions(-) diff --git a/src/assets/styles/manage.scss b/src/assets/styles/manage.scss index 075963b..cb1c517 100644 --- a/src/assets/styles/manage.scss +++ b/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; // } diff --git a/src/views/visualCheck/bookstore/book/index.vue b/src/views/visualCheck/bookstore/book/index.vue index 2baec49..ee93204 100644 --- a/src/views/visualCheck/bookstore/book/index.vue +++ b/src/views/visualCheck/bookstore/book/index.vue @@ -89,9 +89,9 @@ diff --git a/src/views/visualCheck/bookstore/collection/index.vue b/src/views/visualCheck/bookstore/collection/index.vue index 80b0215..413556f 100644 --- a/src/views/visualCheck/bookstore/collection/index.vue +++ b/src/views/visualCheck/bookstore/collection/index.vue @@ -42,8 +42,8 @@ 导出 - 批量导入数据 - 批量打印条形码 + @@ -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') diff --git a/src/views/visualCheck/checkManage/bookSearch/index.vue b/src/views/visualCheck/checkManage/bookSearch/index.vue index 6374778..5facfed 100644 --- a/src/views/visualCheck/checkManage/bookSearch/index.vue +++ b/src/views/visualCheck/checkManage/bookSearch/index.vue @@ -168,8 +168,12 @@
  • ISBN:{{ detailContent.isbn }}
  • 条码号:{{ detailContent.barcode }}
  • - -
  • +
  • + +
  • +
  • + +
  • 简介:

    {{ detailContent.summary ? detailContent.summary :"暂无简介" }}

    • diff --git a/src/views/visualCheck/checkManage/checkLog/index.vue b/src/views/visualCheck/checkManage/checkLog/index.vue index 7479dee..41a4c01 100644 --- a/src/views/visualCheck/checkManage/checkLog/index.vue +++ b/src/views/visualCheck/checkManage/checkLog/index.vue @@ -48,7 +48,7 @@ 层位盘点 - + - + + +
      + {{ index+1 }} + {{ item.bookName }} +
      +
      +
      @@ -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); + } + } + } + } +} diff --git a/src/views/visualCheck/checkManage/dataScreening/index.vue b/src/views/visualCheck/checkManage/dataScreening/index.vue index 76cde22..67c2f98 100644 --- a/src/views/visualCheck/checkManage/dataScreening/index.vue +++ b/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 = '全部区域' }, diff --git a/src/views/visualCheck/checkManage/dataScreening/module/form.vue b/src/views/visualCheck/checkManage/dataScreening/module/form.vue index 6323de3..7c65f77 100644 --- a/src/views/visualCheck/checkManage/dataScreening/module/form.vue +++ b/src/views/visualCheck/checkManage/dataScreening/module/form.vue @@ -5,20 +5,20 @@
      - + - + - + - + - + @@ -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) => { diff --git a/src/views/visualCheck/checkManage/dataScreening/regionsList.vue b/src/views/visualCheck/checkManage/dataScreening/regionsList.vue index 19cb570..544f314 100644 --- a/src/views/visualCheck/checkManage/dataScreening/regionsList.vue +++ b/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) { diff --git a/src/views/visualCheck/checkManage/dataScreening/shelfList.vue b/src/views/visualCheck/checkManage/dataScreening/shelfList.vue index 327ed61..a87f73b 100644 --- a/src/views/visualCheck/checkManage/dataScreening/shelfList.vue +++ b/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) {