Browse Source

首页盘点统计

master
xuhuajiao 5 months ago
parent
commit
1bc86fd848
  1. 10
      src/api/stockTask/index.js
  2. 183
      src/views/components/checkSwiper.vue
  3. 30
      src/views/home.vue
  4. 14
      src/views/visualCheck/checkManage/dataScreening/girdList.vue

10
src/api/stockTask/index.js

@ -123,4 +123,12 @@ export function FetchIsGoodcutByBillNoAndGridId(params) {
})
}
export default { add, edit, del, FetchUpdateStockTaskStatus, FetchInitSuggestTilting, FetchInitSetting, FetchEditSetting, FetchInitHomeInfo, FetchInitStockInfo, FetchInitHotBookList, FetchInitHotShelfList, FetchInitBookDetailsByGrids, FetchAITerminalStatusQuery, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId }
// 建议顺架
export function FetchInitErrorProbaDesc(params) {
return request({
url: 'api/stocktask-task/initErrorProbaDesc' + '?' + 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 }

183
src/views/components/checkSwiper.vue

@ -0,0 +1,183 @@
<template>
<div>
<swiper
ref="swiperTitle"
class="swiper-title"
:options="swiperOptionTitle"
:auto-update="true"
:auto-destroy="true"
:delete-instance-on-destroy="true"
:cleanup-styles-on-destroy="true"
>
<swiper-slide
v-for="(item, index) of tabListData"
ref="swiperSlideItem"
:key="'name' + index"
:iname="item.name"
class="swiper-slide-title"
>
<div
class="tab-name"
:class="{ active: index === swiperActiveIndex }"
@click="handleSlidClickFun(index)"
>
{{ item.name }}
</div>
</swiper-slide>
</swiper>
<swiper
ref="swiperContent"
class="swiper-content"
:options="swiperOptionContent"
:auto-update="true"
:auto-destroy="true"
:delete-instance-on-destroy="true"
:cleanup-styles-on-destroy="true"
>
<swiper-slide
v-for="(item, index) of tabListData"
:key="'content' + index"
class="swiper-slide-content"
>
<el-table
:data="bookList"
stripe
style="width: 100%"
height="150"
>
<el-table-column
prop="regionName"
label="楼层区域"
>
<template slot-scope="scope">
{{ scope.row.floorName + scope.row.regionName }}
</template>
</el-table-column>
<el-table-column
prop="gridName"
label="层位"
/>
<el-table-column
prop="prop"
:label="swiperActiveIndex === 1 ? '上架率' :'错架率'"
width="80"
align="center"
>
<template slot-scope="scope">
{{ scope.row.prop + '%' }}
</template>
</el-table-column>
</el-table>
</swiper-slide>
</swiper>
</div>
</template>
<script>
import { FetchInitErrorProbaDesc, FetchInitSuggestTilting } from '@/api/stockTask/index'
import { mapGetters } from 'vuex'
import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
export default {
name: 'BookSwiper',
components: { swiper, swiperSlide },
props: {
},
data() {
const _this = this
return {
swiperActiveIndex: 0,
swiperOptionContent: {
slidesPerView: 'auto',
on: {
slideChangeTransitionStart: function() {
_this.swiperActiveIndex = this.activeIndex
_this.swiperTitle.slideTo(this.activeIndex, 500, false)
}
}
},
swiperOptionTitle: {
slidesPerView: 'auto',
freeMode: true
},
tabListData: [{ name: '建议顺架' }, { name: '建议倒架' }],
bookList: [],
swiperParams: {},
swiperShelfParams: {}
}
},
computed: {
...mapGetters([
'baseApi'
]),
swiperContent() {
return this.$refs.swiperContent.$el.swiper
},
swiperTitle() {
return this.$refs.swiperTitle.$el.swiper
}
},
mounted() {
if (this.swiperActiveIndex === 0) {
this.getInitErrorProbaDesc()
} else {
this.getInitSuggestTilting()
}
},
methods: {
handleSlidClickFun(index) {
this.handleSlideToFun(index)
},
handleSlideToFun(index) {
this.bookList = []
this.swiperActiveIndex = index
if (this.swiperActiveIndex === 0) {
this.getInitErrorProbaDesc()
} else {
this.getInitSuggestTilting()
}
this.swiperContent.slideTo(index, 500, false)
this.swiperTitle.slideTo(index, 500, false)
},
getInitErrorProbaDesc() {
const params = this.swiperParams
FetchInitErrorProbaDesc(params).then(res => {
this.bookList = res.content
}).catch(() => {
})
},
getInitSuggestTilting() {
const params = {
orderType: 1
}
FetchInitSuggestTilting(params).then(res => {
this.bookList = res
}).catch(() => {
})
}
}
}
</script>
<style lang="scss" scoped>
.swiper-title{
font-size: 14px;
::v-deep .swiper-wrapper{
margin: 10px 0;
border-bottom: 1px solid #EDEFF3;
}
}
.swiper-slide-title {
width: auto !important;
margin-right: 20px;
cursor: pointer;
.tab-name {
padding: 10px;
&.active {
color: #0348F3;
border-bottom: 3px solid #0348F3;
}
}
}
</style>

30
src/views/home.vue

@ -84,33 +84,33 @@
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<!-- 档案类 -->
<!-- 档案 -->
<div class="container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3 class="home-item-title">
流通统计
盘点统计
</h3>
<!-- <div class="refresh-date">2024-11-28 09:46</div> -->
<div class="chart-wrapper" style="padding: 0 10px; margin-top: -10px;">
<bookSwiper ref="bookSwiperRefs" />
<checkSwiper ref="checkSwiperRefs" />
</div>
<!-- <div v-else class="empty-main">
<svg-icon icon-class="empty" class-name="empty-img" />
<p>暂无数据</p>
</div> -->
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<!-- 档案门类 -->
<!-- 档案类 -->
<div class="container-wrap">
<span class="right-top-line" />
<span class="left-bottom-line" />
<h3 class="home-item-title">
馆藏统计
流通统计
</h3>
<div v-if="typeData.length !== 0" class="chart-wrapper">
<type-pie :type-data="typeData" />
</div>
<div v-else class="empty-main">
<svg-icon icon-class="empty" class-name="empty-img" />
<p>暂无数据</p>
<!-- <div class="refresh-date">2024-11-28 09:46</div> -->
<div class="chart-wrapper" style="padding: 0 10px; margin-top: -10px;">
<bookSwiper ref="bookSwiperRefs" />
</div>
</div>
</el-col>
@ -124,8 +124,9 @@ import PanelGroup from './dashboard/PanelGroup'
import taskStockLogEcharts from '@/views/components/echarts/taskStockLog.vue'
// import lendAcross from '@/views/components/echarts/lendAcross.vue'
// import catePie from '@/views/components/echarts/catePie.vue'
import typePie from '@/views/components/echarts/typePie.vue'
// import typePie from '@/views/components/echarts/typePie.vue'
import bookSwiper from '@/views/components/bookSwiper.vue'
import checkSwiper from '@/views/components/checkSwiper.vue'
import serverProgress from '@/views/components/echarts/serverProgress.vue'
import { FetchInitHomeInfo, FetchInitStockInfo } from '@/api/stockTask/index'
import { FetchInitStockLogList } from '@/api/stockTaskLog/index'
@ -140,7 +141,8 @@ export default {
taskStockLogEcharts,
// catePie,
bookSwiper,
typePie,
checkSwiper,
// typePie,
serverProgress
},
data() {

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

@ -36,7 +36,8 @@
</div> -->
<div v-if="checkDateLine.length !== 0" class="time-update-cont">
<span class="time-left-txt">最后更新时间</span>
<el-button>{{ checkDateLine[0].endTime }}</el-button>
<!-- <el-button class="time-btn-txt">{{ checkDateLine[2].endTime }}</el-button> -->
<el-button>{{ checkDateLine[0].stockType === 0 ? '现在' : checkDateLine[0].endTime }}</el-button>
<div class="time-update-line">
<el-timeline>
<el-timeline-item
@ -392,7 +393,7 @@ export default {
case 6:
return '层位盘点'
default:
return ''
return '现在'
}
},
removeAreaPrefix(gridNames) {
@ -426,9 +427,12 @@ export default {
this.checkDateLine = res.sort((a, b) => {
return new Date(b.endTime) - new Date(a.endTime)
})
this.checkDateLine.unshift({
stockType: 0,
icon: 'el-icon-more',
color: '#0bbd87'
})
this.billNoImg = this.checkDateLine[0].stockBill
this.checkDateLine[0].icon = 'el-icon-more'
this.checkDateLine[0].color = '#0bbd87'
} else {
this.checkDateLine = []
}
@ -671,8 +675,10 @@ export default {
font-size: 14px;
}
.el-button{
width: 134px;
padding:5px;
border: none;
text-align: left;
}
.time-update-line{
display: none;

Loading…
Cancel
Save