Browse Source

首页/移动盘点/上架

master
xuhuajiao 5 months ago
parent
commit
c75fc38891
  1. 4
      .env.development
  2. 10
      src/api/stockTask/index.js
  3. 23
      src/views/dashboard/PanelGroup.vue
  4. 8
      src/views/home.vue
  5. 84
      src/views/visualCheck/checkManage/bookSearch/index.vue
  6. 50
      src/views/visualCheck/checkManage/dataScreening/girdList.vue
  7. 132
      src/views/visualCheck/checkManage/mobileCheck/index.vue
  8. 3
      src/views/visualCheck/checkManage/mobileCheck/module/corpper.vue

4
.env.development

@ -3,8 +3,8 @@ ENV = 'development'
# 接口地址 # 接口地址
# 许镇-本地服地址 # 许镇-本地服地址
#VUE_APP_BASE_API = 'http://192.168.99.67:12010'
VUE_APP_BASE_API = 'http://192.168.99.86:12010'
VUE_APP_BASE_API = 'http://192.168.99.72:12010'
#VUE_APP_BASE_API = 'http://192.168.99.86:12010'
#VUE_APP_BASE_API = 'http://27.19.205.234:17070' #VUE_APP_BASE_API = 'http://27.19.205.234:17070'

10
src/api/stockTask/index.js

@ -156,4 +156,12 @@ export function FetchMoveBills(data) {
}) })
} }
export default { add, edit, del, FetchUpdateStockTaskStatus, FetchInitSuggestTilting, FetchInitSetting, FetchEditSetting, FetchInitHomeInfo, FetchInitStockInfo, FetchInitHotBookList, FetchInitHotShelfList, FetchInitBookDetailsByGrids, FetchAITerminalStatusQuery, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchInitErrorProbaDesc, FetchShowByBillIdAndShelfIdAndGridShelf, FetchStartStopBookAIService, FetchMoveBills }
// 根据层架位id获取最新盘点信息
export function FetchNewBillByGridId(params) {
return request({
url: 'api/stocktask-task/getNewBillByGridId' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { add, edit, del, FetchUpdateStockTaskStatus, FetchInitSuggestTilting, FetchInitSetting, FetchEditSetting, FetchInitHomeInfo, FetchInitStockInfo, FetchInitHotBookList, FetchInitHotShelfList, FetchInitBookDetailsByGrids, FetchAITerminalStatusQuery, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchInitErrorProbaDesc, FetchShowByBillIdAndShelfIdAndGridShelf, FetchStartStopBookAIService, FetchMoveBills, FetchNewBillByGridId }

23
src/views/dashboard/PanelGroup.vue

@ -33,9 +33,19 @@
</div> </div>
<div class="card-panel-description"> <div class="card-panel-description">
盘点层位 盘点层位
<!-- <div style="display: flex; justify-content: flex-start; align-items: flex-start; flex-direction: column;"> -->
<div class="card-panel-text"> <div class="card-panel-text">
<count-to :start-val="0" :end-val="topObjectNum && topObjectNum.gridCount" :duration="3200" class="card-panel-num" /> <count-to :start-val="0" :end-val="topObjectNum && topObjectNum.gridCount" :duration="3200" class="card-panel-num" />
</div> </div>
<!-- <span style="font-size: 24px; margin: 10px 10px 0 10px;">/</span> -->
<!-- <span class="error-data">{{ topObjectNum.noStockGridCount }}</span> -->
<!-- </div> -->
</div>
<div class="card-panel-description">
盘点关闭
<div class="card-panel-text">
<count-to :start-val="0" :end-val="topObjectNum && topObjectNum.noStockGridCount" :duration="3200" class="card-panel-num" style="color: #ED4A41;" />
</div>
</div> </div>
</div> </div>
</el-col> </el-col>
@ -50,6 +60,12 @@
<count-to :start-val="0" :end-val="topObjectNum && topObjectNum.deviceCount" :duration="3200" class="card-panel-num" /> <count-to :start-val="0" :end-val="topObjectNum && topObjectNum.deviceCount" :duration="3200" class="card-panel-num" />
</div> </div>
</div> </div>
<div class="card-panel-description">
离线设备
<div class="card-panel-text">
<count-to :start-val="0" :end-val="topObjectNum && topObjectNum.deviceErrorCount" :duration="3200" class="card-panel-num" style="color: #ED4A41;" />
</div>
</div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -150,4 +166,11 @@ export default {
} }
} }
} }
.error-data{
font-size: 24px;
font-weight: bold;
color: #ED4A41;
margin: 10px 0 0 0;
}
</style> </style>

8
src/views/home.vue

@ -188,7 +188,9 @@ export default {
regionCount: 0, regionCount: 0,
shelfCount: 0, shelfCount: 0,
gridCount: 0, gridCount: 0,
deviceCount: 0
deviceCount: 0,
noStockGridCount: 0,
deviceErrorCount: 0
}, },
taskStockLogData: [], taskStockLogData: [],
echartsTimer: null, echartsTimer: null,
@ -342,7 +344,9 @@ export default {
regionCount: data.regionCount, regionCount: data.regionCount,
shelfCount: data.shelfCount, shelfCount: data.shelfCount,
gridCount: data.gridCount, gridCount: data.gridCount,
deviceCount: data.deviceCount
deviceCount: data.deviceCount,
noStockGridCount: data.noStockGridCount,
deviceErrorCount: data.deviceErrorCount
} }
}) })
}, },

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

@ -13,10 +13,10 @@
</div> </div>
<crudOperation :permission="permission"> <crudOperation :permission="permission">
<template v-slot:right> <template v-slot:right>
<!-- <el-button size="mini" :disabled="crud.selections.length === 0" @click="handleBatchListing">
<el-button size="mini" :disabled="crud.selections.length === 0" @click="handleBatchListing(crud.selections)">
<i class="iconfont icon-ruku" /> <i class="iconfont icon-ruku" />
批量上架 批量上架
</el-button> -->
</el-button>
<el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="handleRemoveShelf(crud.selections)"> <el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="handleRemoveShelf(crud.selections)">
<i class="iconfont icon-chuku" /> <i class="iconfont icon-chuku" />
一键下架 一键下架
@ -86,58 +86,49 @@
<div class="batch-left"> <div class="batch-left">
<h5>已选图书</h5> <h5>已选图书</h5>
<ul class="left-book-list"> <ul class="left-book-list">
<li>条码号图书题名1</li>
<li>条码号图书题名1</li>
<li>条码号图书题名1</li>
<li>条码号图书题名1</li>
<li>条码号图书题名1</li>
<li>条码号图书题名1</li>
<li>条码号图书题名1</li>
<li>条码号图书题名1</li>
<li>条码号图书题名1</li>
<li>条码号图书题名1</li>
<li v-for="(item,index) in selectBookData" :key="index">{{ item.barcode }}{{ item.bookName }}</li>
</ul> </ul>
</div> </div>
<div class="batch-right"> <div class="batch-right">
<h5>选择上架位置</h5> <h5>选择上架位置</h5>
<el-form ref="form" :rules="rules" :model="form" size="small" label-width="30px"> <el-form ref="form" :rules="rules" :model="form" size="small" label-width="30px">
<el-form-item prop="floorId"> <el-form-item prop="floorId">
<el-select v-model="form.floorId" placeholder="选择楼层" style="width: 280px;" @change="changeFloorValue($event)">
<el-select v-model="form.floorId" placeholder="选择楼层" style="width: 280px;" value-key="id" @change="changeFloorValue($event)">
<el-option <el-option
v-for="(item,index) in floorOptions" v-for="(item,index) in floorOptions"
:key="index" :key="index"
:label="item.floorName" :label="item.floorName"
:value="item.id"
:value="item"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="regionId"> <el-form-item prop="regionId">
<el-select v-model="form.regionId" placeholder="选择区域" style="width: 280px;" @change="changeRegionValue($event)">
<el-select v-model="form.regionId" placeholder="选择区域" style="width: 280px;" value-key="id" @change="changeRegionValue($event)">
<el-option <el-option
v-for="(item,index) in regionOptions" v-for="(item,index) in regionOptions"
:key="index" :key="index"
:label="item.regionName" :label="item.regionName"
:value="item.id"
:value="item"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="shelfId"> <el-form-item prop="shelfId">
<el-select v-model="form.shelfId" placeholder="选择书架" style="width: 280px;" @change="changeShelfValue($event)">
<el-select v-model="form.shelfId" placeholder="选择书架" style="width: 280px;" value-key="shelfId" @change="changeShelfValue($event)">
<el-option <el-option
v-for="(item,index) in shelfOptions" v-for="(item,index) in shelfOptions"
:key="index" :key="index"
:label="item.shelfName" :label="item.shelfName"
:value="item.shelfId"
:value="item"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="girdId"> <el-form-item prop="girdId">
<el-select v-model="form.girdId" placeholder="选择层位" style="width: 280px;" @change="changeGirdValue($event)">
<el-select v-model="form.girdId" placeholder="选择层位" style="width: 280px;" value-key="id" @change="changeGirdValue($event)">
<el-option <el-option
v-for="(item,index) in girdOptions" v-for="(item,index) in girdOptions"
:key="index" :key="index"
:label="item.gridName" :label="item.gridName"
:value="item.id"
:value="item"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -145,8 +136,8 @@
</div> </div>
</div> </div>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-button type="text" @click="handleCloseDialog">取消</el-button>
<el-button :loading="crud.status.cu === 2" type="primary" @click="saveBatchUp">保存</el-button>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
@ -306,7 +297,10 @@ export default {
}, },
tabIndex: 0, tabIndex: 0,
defaultImg: defaultImg, defaultImg: defaultImg,
imageUrl: defaultImg
imageUrl: defaultImg,
selectBookData: [],
selectShelfVal: '',
selectGridVal: null
} }
}, },
@ -400,8 +394,36 @@ export default {
this.crud.delAllLoading = false this.crud.delAllLoading = false
}) })
}, },
handleBatchListing() {
this.addBookShelfVisible = true
handleBatchListing(datas) {
const hasNonUnknownStatus = datas.some(item => item.bookStatus !== '未知')
if (hasNonUnknownStatus) {
this.$message({ message: '当前所选数据包含已上架过的图书,请检查后再操作!', type: 'error', offset: 8 })
return
} else {
this.selectBookData = datas
this.addBookShelfVisible = true
}
},
saveBatchUp() {
this.$refs.form.validate((valid) => {
if (valid) {
const params = {
'gridId': this.selectGridVal.id,
'stockRegion': this.selectShelfVal + '-' + removeQUPrefix(this.selectGridVal.gridName)
}
console.log('params', params)
// crudBook.FetchFastDownShelf(params).then(() => {
// this.$message({ message: '', type: 'success', offset: 8 })
// this.crud.refresh()
// }).catch(err => {
// console.log(err)
// })
} else {
console.log('error submit!!')
return false
}
})
}, },
changeFloorValue(value) { changeFloorValue(value) {
console.log(value) console.log(value)
@ -411,7 +433,7 @@ export default {
this.shelfOptions = [] this.shelfOptions = []
this.girdOptions = [] this.girdOptions = []
const params = { const params = {
'floorId': value
'floorId': value.id
} }
FetchRegionAllByFloor(params).then(res => { FetchRegionAllByFloor(params).then(res => {
this.regionOptions = res this.regionOptions = res
@ -424,7 +446,7 @@ export default {
this.crud.form.girdId = null this.crud.form.girdId = null
this.girdOptions = [] this.girdOptions = []
const params = { const params = {
'regionId': value
'regionId': value.id
} }
FetchShelfAllByRegionId(params).then(res => { FetchShelfAllByRegionId(params).then(res => {
this.shelfOptions = res this.shelfOptions = res
@ -433,9 +455,10 @@ export default {
}, },
changeShelfValue(value) { changeShelfValue(value) {
console.log(value) console.log(value)
this.selectShelfVal = value.floorName + '-' + value.regionName
this.crud.form.girdId = null this.crud.form.girdId = null
const params = { const params = {
'shelfId': value
'shelfId': value.shelfId
} }
FetchShelfGridAllByShelfId(params).then(res => { FetchShelfGridAllByShelfId(params).then(res => {
this.girdOptions = res this.girdOptions = res
@ -443,8 +466,13 @@ export default {
}) })
}, },
changeGirdValue(value) { changeGirdValue(value) {
this.selectGridVal = value
console.log(value) console.log(value)
},
handleCloseDialog() {
this.addBookShelfVisible = false
} }
} }
} }
</script> </script>

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

@ -127,7 +127,7 @@
<div class="tag-item tag-all">在架<i class="iconfont icon-zhuangtai2" /><p>{{ baseStockData.length !==0 && baseStockData[index].onShelfNum }}</p></div> <div class="tag-item tag-all">在架<i class="iconfont icon-zhuangtai2" /><p>{{ baseStockData.length !==0 && baseStockData[index].onShelfNum }}</p></div>
</div> </div>
<div class="layer-handle"> <div class="layer-handle">
<el-button size="mini" @click="handleDetail(item)">
<el-button size="mini" @click="handleDetail(item,index)">
<i class="iconfont icon-xiaowenjian" /> <i class="iconfont icon-xiaowenjian" />
详情 详情
</el-button> </el-button>
@ -173,7 +173,7 @@
<i class="iconfont icon-sulan" /> <i class="iconfont icon-sulan" />
盘点照片 盘点照片
</el-button> --> </el-button> -->
<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">
<div v-if="getOnShelfNum" style="height: 260px; background-color: #ccc; overflow: hidden; position: relative;" @dblclick="handleViewImg" @mousedown="onMouseDown" @mousemove="onMouseMove" @mouseleave="onMouseUp" @mouseup="onMouseUp">
<img <img
ref="image" ref="image"
style="display:block; width: 100%;cursor: grab;" style="display:block; width: 100%;cursor: grab;"
@ -269,7 +269,7 @@
</template> </template>
<script> <script>
import { FetchInitStockInfo, FetchInitBookDetailsByGrids, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchShowByBillIdAndShelfIdAndGridShelf } from '@/api/stockTask/index'
import { FetchInitStockInfo, FetchInitBookDetailsByGrids, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchShowByBillIdAndShelfIdAndGridShelf, FetchNewBillByGridId } from '@/api/stockTask/index'
import { dataScreeningCrud } from '@/views/visualCheck/mixins/index' import { dataScreeningCrud } from '@/views/visualCheck/mixins/index'
import { FetchBookShelfDetails, FetchShelfGridByShelfIdAndGridShelf } from '@/api/shelf/index' import { FetchBookShelfDetails, FetchShelfGridByShelfIdAndGridShelf } from '@/api/shelf/index'
import crudRegion from '@/api/area/index' import crudRegion from '@/api/area/index'
@ -281,6 +281,7 @@ import exportForm from './module/export'
import { parseTime, saveAs, getBlob, removeQUPrefix, removePrefix } from '@/utils/index' import { parseTime, saveAs, getBlob, removeQUPrefix, removePrefix } from '@/utils/index'
import { swiper, swiperSlide } from 'vue-awesome-swiper' import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css' import 'swiper/dist/css/swiper.css'
import Vue from 'vue'
export default { export default {
name: 'DataScreening', name: 'DataScreening',
@ -342,7 +343,7 @@ export default {
shelfAllGridDataLoading: false, shelfAllGridDataLoading: false,
billNoImg: null, billNoImg: null,
bookImgData: [], bookImgData: [],
bigImg: '',
bigImg: null,
timeIndex: 0, timeIndex: 0,
gridName: '', gridName: '',
getGridToward: 1, getGridToward: 1,
@ -365,7 +366,8 @@ export default {
swiperListShelfOptions: { swiperListShelfOptions: {
slidesPerView: 'auto', slidesPerView: 'auto',
freeMode: true freeMode: true
}
},
getOnShelfNum: 0
} }
}, },
computed: { computed: {
@ -526,7 +528,9 @@ export default {
if (!Array.isArray(this.baseStockData)) { if (!Array.isArray(this.baseStockData)) {
this.baseStockData = [] this.baseStockData = []
} }
this.baseStockData = this.baseStockData.concat(results)
// this.baseStockData = this.baseStockData.concat(results)
this.baseStockData = results
console.log('this.baseStockData222', this.baseStockData)
}, },
getInitBookDetailsByGrids(data) { getInitBookDetailsByGrids(data) {
const ids = data.map(item => item.id) const ids = data.map(item => item.id)
@ -587,21 +591,36 @@ export default {
} }
this.handleToGrids(this.cellInfo) this.handleToGrids(this.cellInfo)
}, },
handleDetail(item) {
this.detailVisible = true
this.detailTable = item.books
handleDetail(item, index) {
if (this.checkDateLine.length !== 0) { if (this.checkDateLine.length !== 0) {
this.detailTitle = removeQUPrefix(item.gridName) + ' - 详情 - ' + (this.checkDateLine[this.timeIndex].stockType === 0 ? '现在' : this.checkDateLine[this.timeIndex].endTime) this.detailTitle = removeQUPrefix(item.gridName) + ' - 详情 - ' + (this.checkDateLine[this.timeIndex].stockType === 0 ? '现在' : this.checkDateLine[this.timeIndex].endTime)
} else { } else {
this.detailTitle = removeQUPrefix(item.gridName) + ' - 详情' this.detailTitle = removeQUPrefix(item.gridName) + ' - 详情'
} }
this.detailCurrent = item
if (this.detailCurrent.onShelfNum) {
this.bigImg = `${this.baseApi}/api/fileRelevant/getImg?imgType=1&imgId=/${this.libcode}/${this.billNoImg}/${this.detailCurrent.gridCode}/img_result/result_LSD_compressed.jpg`
Vue.set(this, 'bigImg', null)
Vue.set(this, 'detailCurrent', {
id: item.id,
gridCode: item.gridCode
})
Vue.set(this, 'detailTable', item.books)
this.getOnShelfNum = this.baseStockData[index].onShelfNum
if (this.getOnShelfNum) {
if (this.checkDateLine[this.timeIndex].stockType === 0) {
FetchNewBillByGridId({ 'gridId': item.id })
.then(res => {
this.billNoImg = res.stockBill
Vue.set(this, 'bigImg', `${this.baseApi}/api/fileRelevant/getImg?imgType=1&imgId=/${this.libcode}/${res.stockBill}/${this.detailCurrent.gridCode}/img_result/result_LSD_compressed.jpg`)
})
.catch(error => {
console.error(error)
})
} else {
Vue.set(this, 'bigImg', `${this.baseApi}/api/fileRelevant/getImg?imgType=1&imgId=/${this.libcode}/${this.billNoImg}/${this.detailCurrent.gridCode}/img_result/result_LSD_compressed.jpg`)
}
} else { } else {
this.bigImg = ''
Vue.set(this, 'bigImg', null)
} }
this.detailVisible = true
}, },
setActiveItem(index) { setActiveItem(index) {
this.$refs.carousel.setActiveItem(index) this.$refs.carousel.setActiveItem(index)
@ -657,6 +676,7 @@ export default {
// http://192.168.99.67:12010/api/fileRelevant/getImg?imgType=1&imgId=/1501/PD20250108013/010011015/img_result/result_cut_1_compressed.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.bookImgData = []
this.detailImgVisible = true this.detailImgVisible = true
const params = { const params = {
'billNo': this.billNoImg, 'billNo': this.billNoImg,
@ -778,6 +798,7 @@ export default {
}) })
}, },
handleHistory(item, index) { handleHistory(item, index) {
this.detailCurrent = {}
this.shelfAllGridDataLoading = true this.shelfAllGridDataLoading = true
this.timeIndex = index this.timeIndex = index
this.billNoImg = item.stockType === 0 ? this.checkDateLine[1].stockBill : item.stockBill this.billNoImg = item.stockType === 0 ? this.checkDateLine[1].stockBill : item.stockBill
@ -810,6 +831,7 @@ export default {
} }
}) })
}) })
console.log('sortedKeys', sortedKeys)
this.baseStockData = sortedShelfDetails this.baseStockData = sortedShelfDetails
setTimeout(() => { setTimeout(() => {

132
src/views/visualCheck/checkManage/mobileCheck/index.vue

@ -55,12 +55,12 @@
<div v-if="!stepOne" class="step-style"> <div v-if="!stepOne" class="step-style">
<div class="mobile-check-upload"> <div class="mobile-check-upload">
<div class="upload-input"> <div class="upload-input">
<!-- multiple -->
<input <input
ref="imgFile" ref="imgFile"
accept="image/*" accept="image/*"
capture="camera" capture="camera"
type="file" type="file"
multiple
:disabled="stepOne" :disabled="stepOne"
@change="previewFiles" @change="previewFiles"
> >
@ -70,7 +70,7 @@
<div v-for="(imgSrc, index) in imageSources" :key="index" style="display: inline-block; margin: 10px;"> <div v-for="(imgSrc, index) in imageSources" :key="index" style="display: inline-block; margin: 10px;">
<img <img
:src="imgSrc" :src="imgSrc"
style="display: inline-block; max-width: 100px; max-height: 100px;"
style="display: inline-block; max-width: 400px; max-height: 150px;"
@click="showCoverPreview(imgSrc)" @click="showCoverPreview(imgSrc)"
> >
<i class="iconfont icon-shanchu1" @click="deleteImage(index)" /> <i class="iconfont icon-shanchu1" @click="deleteImage(index)" />
@ -88,7 +88,7 @@
</el-form> --> </el-form> -->
</div> </div>
<div> <div>
<el-button type="primary" @click="returnStepOne">上一步</el-button>
<el-button type="primary" :disabled="stepTwo" @click="returnStepOne">上一步</el-button>
<el-button class="check-btn" :loading="submitLoading" type="primary" @click="saveData">下一步</el-button> <el-button class="check-btn" :loading="submitLoading" type="primary" @click="saveData">下一步</el-button>
</div> </div>
</div> </div>
@ -96,16 +96,19 @@
<div :class="!isMobile ? 'mobile-step' : 'mobile-step isMobile-step'"> <div :class="!isMobile ? 'mobile-step' : 'mobile-step isMobile-step'">
<!-- <span>开始盘点</span> --> <!-- <span>开始盘点</span> -->
<el-divider content-position="left"><img src="@/assets/images/collect/three2.png"><span>开始盘点</span></el-divider> <el-divider content-position="left"><img src="@/assets/images/collect/three2.png"><span>开始盘点</span></el-divider>
<div v-if="stepThree" class="step-style step-three-text">
<p v-if="mobileResult">
移动盘点已创建成功单号{{ mobileResult.stockBill }}查看详情请转到
<router-link :to="{ path: '/check/check/checkLog'}">
盘点日志
</router-link>
</p>
<p v-else>
移动盘点创建失败
</p>
<div v-if="stepTwo" class="step-style step-three-text">
<div v-if="mobileResult">
<i class="iconfont icon-shangchuanchenggong" />
<p>移动盘点已创建成功盘点单号{{ mobileResult.stockBill || mobileResult.inventoryId }}查看详情请转到
<router-link :to="{ path: '/check/check/checkLog'}">
盘点日志
</router-link>
</p>
</div>
<div v-else>
<i class="iconfont icon-shangchuanshibai" />
<p>移动盘点创建失败</p>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -133,7 +136,7 @@
:modal-append-to-body="false" :modal-append-to-body="false"
append-to-body append-to-body
:visible.sync="cropperModel" :visible.sync="cropperModel"
width="950px"
width="1250px"
center center
> >
<cropper-image <cropper-image
@ -200,7 +203,6 @@ export default {
}, },
stepOne: true, stepOne: true,
stepTwo: false, stepTwo: false,
stepThree: false,
// //
formValidate: { formValidate: {
mainImage: '' mainImage: ''
@ -309,38 +311,64 @@ export default {
}, },
previewFiles() { previewFiles() {
const files = this.$refs.imgFile.files const files = this.$refs.imgFile.files
const maxImages = 3
const remainingSlots = maxImages - this.imageSources.length
if (remainingSlots === 0) {
this.$message({ message: '已有 3 张图片,不能再上传', type: 'error', offset: 8 })
if (files.length === 0) {
this.$message({ message: '请选择一张图片', type: 'error', offset: 8 })
return
} }
const validFiles = []
for (let i = 0; i < files.length; i++) {
const file = files[i]
if (file.type === 'image/jpeg') {
validFiles.push(file)
} else {
this.$message({ message: `文件 ${file.name} 不是 JPG 格式,将忽略该文件`, type: 'error', offset: 8 })
}
const file = files[0]
if (file.type !== 'image/jpeg') {
this.$message({ message: `文件 ${file.name} 不是 JPG 格式,请重新选择`, type: 'error', offset: 8 })
return
} }
if (validFiles.length > remainingSlots) {
this.$message({ message: `最多只能再上传 ${remainingSlots} 张图片,将只处理部分选择的图片`, type: 'error', offset: 8 })
}
const numFilesToProcess = Math.min(validFiles.length, remainingSlots)
for (let i = 0; i < numFilesToProcess; i++) {
const file = validFiles[i]
const reader = new FileReader()
reader.onload = (e) => {
this.imageSources.push(e.target.result)
}
reader.readAsDataURL(file)
this.selectedFiles.push(file)
// if (this.imageSources.length > 0) {
// this.$message({ message: '', type: 'error', offset: 8 })
// return
// }
this.imageSources = []
this.selectedFiles = []
const reader = new FileReader()
reader.onload = (e) => {
this.imageSources.push(e.target.result)
} }
reader.readAsDataURL(file)
this.selectedFiles.push(file)
}, },
// previewFiles() {
// const files = this.$refs.imgFile.files
// const maxImages = 3
// const remainingSlots = maxImages - this.imageSources.length
// if (remainingSlots === 0) {
// this.$message({ message: ' 3 ', type: 'error', offset: 8 })
// }
// const validFiles = []
// for (let i = 0; i < files.length; i++) {
// const file = files[i]
// if (file.type === 'image/jpeg') {
// validFiles.push(file)
// } else {
// this.$message({ message: ` ${file.name} JPG `, type: 'error', offset: 8 })
// }
// }
// if (validFiles.length > remainingSlots) {
// this.$message({ message: ` ${remainingSlots} `, type: 'error', offset: 8 })
// }
// const numFilesToProcess = Math.min(validFiles.length, remainingSlots)
// for (let i = 0; i < numFilesToProcess; i++) {
// const file = validFiles[i]
// const reader = new FileReader()
// reader.onload = (e) => {
// this.imageSources.push(e.target.result)
// }
// reader.readAsDataURL(file)
// this.selectedFiles.push(file)
// }
// },
submitStepOne() { submitStepOne() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
@ -373,12 +401,12 @@ export default {
if (res.data.code === 200) { if (res.data.code === 200) {
this.mobileResult = res.data.data this.mobileResult = res.data.data
this.stepOne = false this.stepOne = false
this.stepTwo = true
} else { } else {
this.$message({ message: res.data.message, type: 'error', offset: 8 }) this.$message({ message: res.data.message, type: 'error', offset: 8 })
this.mobileResult = null this.mobileResult = null
} }
this.submitLoading = false this.submitLoading = false
this.stepTwo = true
}) })
} }
}, },
@ -492,9 +520,23 @@ export default {
} }
.step-three-text { .step-three-text {
justify-content: flex-start; justify-content: flex-start;
a{
font-weight: bold;
color: #1f55eb;
div{
display: flex;
justify-content: flex-start;
align-items: center;
a{
font-weight: bold;
color: #1f55eb;
}
i{
font-size: 26px;
&.icon-shangchuanchenggong{
color: #2ECAAC;
}
&.icon-shangchuanshibai{
color: #ED4A41;
}
}
} }
} }

3
src/views/visualCheck/checkManage/mobileCheck/module/corpper.vue

@ -47,6 +47,7 @@
<!--预览效果图--> <!--预览效果图-->
<div class="show-preview"> <div class="show-preview">
<div :style="previews.div" class="preview"> <div :style="previews.div" class="preview">
{{ previews }}
<img :src="previews.url" :style="previews.img"> <img :src="previews.url" :style="previews.img">
</div> </div>
</div> </div>
@ -74,7 +75,7 @@ export default {
full: false, // propsfull full: false, // propsfull
canMove: true, // canMove: true, //
original: false, // original: false, //
height: true, // dpr
height: false, // dpr
canMoveBox: true, // canMoveBox: true, //
autoCrop: true, // autoCrop: true, //
autoCropWidth: 200, // autoCropWidth: 200, //

Loading…
Cancel
Save