Browse Source

首页需求更新

master
xuhuajiao 4 days ago
parent
commit
31d45ed1ea
  1. 1
      .env.development
  2. 2
      public/static/gs_label_c_sdk_2.0.0.js
  3. 12
      src/api/asset/index.js
  4. 8
      src/api/stockTask/index.js
  5. 12
      src/views/assetManage/inOutLog/index.vue
  6. 1003
      src/views/assetManage/inventory/index-tag.vue
  7. 10
      src/views/dashboard/PanelGroup.vue
  8. 453
      src/views/home.vue

1
.env.development

@ -4,6 +4,7 @@ ENV = 'development'
# 许镇-本地服地址 # 许镇-本地服地址
VUE_APP_BASE_API = 'http://192.168.99.63:15000' VUE_APP_BASE_API = 'http://192.168.99.63:15000'
# VUE_APP_BASE_API = 'http://192.168.99.101:15000'
VUE_APP_WEBRTCSTREAMER_API = '127.0.0.1:8000' VUE_APP_WEBRTCSTREAMER_API = '127.0.0.1:8000'
# 是否启用 babel-plugin-dynamic-import-node插件 # 是否启用 babel-plugin-dynamic-import-node插件

2
public/static/gs_label_c_sdk_2.0.0.js
File diff suppressed because it is too large
View File

12
src/api/asset/index.js

@ -88,6 +88,15 @@ export function FetchInitStockTakeBill(params) {
}) })
} }
// 初始化出入库
export function FetchInitInOutBill(params) {
return request({
url: 'api/asset/initInOutBill',
method: 'get',
params
})
}
export default { export default {
FetchInitAssetInfo, FetchInitAssetInfo,
add, add,
@ -98,5 +107,6 @@ export default {
FetchDeleteStockTake, FetchDeleteStockTake,
FetchDeleteAssetInfoPhotoById, FetchDeleteAssetInfoPhotoById,
FetchInOutDetailsByBillNo, FetchInOutDetailsByBillNo,
FetchInitStockTakeBill
FetchInitStockTakeBill,
FetchInitInOutBill
} }

8
src/api/stockTask/index.js

@ -59,10 +59,10 @@ export function FetchEditSetting(data) {
}) })
} }
// 初始化统计基础数据
export function FetchInitHomeInfo(params) {
// 初始化统计基础数据 --- 无线电
export function FetchInitBaseInfo(params) {
return request({ return request({
url: 'api/stocktask-task/initHomeInfo' + '?' + qs.stringify(params, { indices: false }),
url: 'api/home/initBaseInfo' + '?' + qs.stringify(params, { indices: false }),
method: 'get' method: 'get'
}) })
} }
@ -173,4 +173,4 @@ export function FetchManualShelving(data) {
}) })
} }
export default { add, edit, del, FetchUpdateStockTaskStatus, FetchInitSuggestTilting, FetchInitSetting, FetchEditSetting, FetchInitHomeInfo, FetchInitStockInfo, FetchInitHotBookList, FetchInitHotShelfList, FetchInitBookDetailsByGrids, FetchAITerminalStatusQuery, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchInitErrorProbaDesc, FetchShowByBillIdAndShelfIdAndGridShelf, FetchStartStopBookAIService, FetchMoveBills, FetchNewBillByGridId, FetchManualShelving }
export default { add, edit, del, FetchUpdateStockTaskStatus, FetchInitSuggestTilting, FetchInitSetting, FetchEditSetting, FetchInitBaseInfo, FetchInitStockInfo, FetchInitHotBookList, FetchInitHotShelfList, FetchInitBookDetailsByGrids, FetchAITerminalStatusQuery, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchInitErrorProbaDesc, FetchShowByBillIdAndShelfIdAndGridShelf, FetchStartStopBookAIService, FetchMoveBills, FetchNewBillByGridId, FetchManualShelving }

12
src/views/assetManage/inOutLog/index.vue

@ -73,12 +73,12 @@
<div>{{ scope.row.createTime | parseTime }}</div> <div>{{ scope.row.createTime | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="checkStartTime" label="入库开始时间" width="150px">
<el-table-column prop="checkStartTime" label="出/入库开始时间" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.checkStartTime | parseTime }}</div> <div>{{ scope.row.checkStartTime | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="checkEndTime" label="入库结束时间" width="150px">
<el-table-column prop="checkEndTime" label="出/入库结束时间" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.checkEndTime | parseTime }}</div> <div>{{ scope.row.checkEndTime | parseTime }}</div>
</template> </template>
@ -128,12 +128,12 @@
<div>{{ scope.row.createTime | parseTime }}</div> <div>{{ scope.row.createTime | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="checkStartTime" label="入库开始时间" width="150px">
<el-table-column prop="checkStartTime" label="出/入库开始时间" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.checkStartTime | parseTime }}</div> <div>{{ scope.row.checkStartTime | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="checkEndTime" label="入库结束时间" width="150px">
<el-table-column prop="checkEndTime" label="出/入库结束时间" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.checkEndTime | parseTime }}</div> <div>{{ scope.row.checkEndTime | parseTime }}</div>
</template> </template>
@ -297,7 +297,8 @@ export default {
}, },
computed: { computed: {
...mapGetters([ ...mapGetters([
'baseApi'
'baseApi',
'user'
]), ]),
hasAssets() { hasAssets() {
return this.totalAssets > 0 return this.totalAssets > 0
@ -327,6 +328,7 @@ export default {
// //
this.crud.params.status = this.query.status this.crud.params.status = this.query.status
this.crud.query.userId = this.user.id
// //
this.originalPage = this.crud.page.page this.originalPage = this.crud.page.page

1003
src/views/assetManage/inventory/index-tag.vue
File diff suppressed because it is too large
View File

10
src/views/dashboard/PanelGroup.vue

@ -8,7 +8,7 @@
<div class="card-panel-description"> <div class="card-panel-description">
资产数量 资产数量
<div class="card-panel-text"> <div class="card-panel-text">
<count-to :start-val="0" :end-val="topObjectNum && topObjectNum.regionCount" :duration="3200" class="card-panel-num" />
<count-to :start-val="0" :end-val="topObjectNum && topObjectNum.assetTotalNum" :duration="3200" class="card-panel-num" />
</div> </div>
</div> </div>
</div> </div>
@ -21,7 +21,7 @@
<div class="card-panel-description"> <div class="card-panel-description">
市州 市州
<div class="card-panel-text"> <div class="card-panel-text">
<count-to :start-val="0" :end-val="topObjectNum && topObjectNum.shelfCount" :duration="3200" class="card-panel-num" />
<count-to :start-val="0" :end-val="topObjectNum && topObjectNum.fondsNum" :duration="3200" class="card-panel-num" />
</div> </div>
</div> </div>
</div> </div>
@ -34,7 +34,7 @@
<div class="card-panel-description"> <div class="card-panel-description">
仓库 仓库
<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.warehouseNum" :duration="3200" class="card-panel-num" />
</div> </div>
</div> </div>
</div> </div>
@ -47,7 +47,7 @@
<div class="card-panel-description"> <div class="card-panel-description">
设备 设备
<div class="card-panel-text"> <div class="card-panel-text">
<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.deviceNum" :duration="3200" class="card-panel-num" />
</div> </div>
</div> </div>
</div> </div>
@ -78,7 +78,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.getAllDevice()
// this.getAllDevice()
}, },
methods: { methods: {
async getAllDevice() { async getAllDevice() {

453
src/views/home.vue

@ -15,27 +15,37 @@
</h3> </h3>
<div class="home-flowable" style="height: calc(100% - 54px); overflow-x: hidden;"> <div class="home-flowable" style="height: calc(100% - 54px); overflow-x: hidden;">
<div class="home-tab"> <div class="home-tab">
<span :class="{'home-tab-active': flowableTabIndex == 0}">未完成({{ stockLogIncompleteData.length !==0? stockLogIncompleteData.length: 0 }})</span>
<span :class="{'home-tab-active': flowableTabIndex == 1}">已完成({{ stockLogCompletedData.length !==0? stockLogCompletedData.length: 0 }})</span>
<span :class="{'home-tab-active': stockLogTabIndex == 0}" @click="changeStockLogTab(0)">未盘点({{ topObjectNum && topObjectNum.stockTakenotNum }})</span>
<span :class="{'home-tab-active': stockLogTabIndex == 1}" @click="changeStockLogTab(1)">盘点中({{ topObjectNum && topObjectNum.stockTakeingNum }})</span>
<span :class="{'home-tab-active': stockLogTabIndex == 2}" @click="changeStockLogTab(2)">已完成({{ topObjectNum && topObjectNum.stockTakedNum }})</span>
</div> </div>
<div class="home-flowable-list" style="height: calc(100% - 45px); overflow-y: auto; overflow-x: hidden;">
<el-table v-if="stockLogIncompleteData.length !== 0" height="calc(100%)" :data="stockLogIncompleteData" class="archives-table" stripe style="width: 100%">
<el-table-column prop="stockBill" label="盘点单号" />
<el-table-column prop="state" label="状态" align="center">
<template slot-scope="scope">
<span v-if="scope.row.state === 0" class="row-state row-lending state-active">已终止</span>
<span v-if="scope.row.state === 1" class="row-state row-warehousing state-active">排队中</span>
<span v-if="scope.row.state === 2" class="row-state row-binding state-active">盘点中</span>
<span v-if="scope.row.state === 3" class="row-state row-physical state-active">已完成</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="时间" width="180">
<div class="home-flowable-list" style="height: calc(100% - 45px); overflow-x: hidden;">
<el-table
v-show="stockData.length !== 0"
ref="stockTableRef"
height="calc(100%)"
:data="stockData"
class="archives-table"
stripe
style="width: 100%"
@scroll="handleStockTableScroll"
>
<el-table-column prop="billNo" label="任务编号" min-width="180px" :show-overflow-tooltip="true" />
<el-table-column prop="warehouseName" label="所属仓库" />
<el-table-column prop="stockNum" label="总数" width="80px" align="right" />
<el-table-column prop="takeDate" label="发起时间" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.createTime | parseTime }}</div>
<div>{{ scope.row.takeDate | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<div slot="append" style="text-align:center;padding:12px 0;color:#666;font-size:13px;">
<span v-if="stockPage.loadingMore">
<i class="el-icon-loading" /> 加载中...
</span>
<span v-else-if="!stockPage.hasMore && stockData.length">没有更多数据</span>
</div>
</el-table> </el-table>
<div v-else class="empty-main" style="height: 100%;">
<div v-if="stockData.length === 0" class="empty-main" style="height: 100%;">
<svg-icon icon-class="empty" class-name="empty-img" /> <svg-icon icon-class="empty" class-name="empty-img" />
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
@ -51,9 +61,6 @@
服务器监控 服务器监控
<div style="position: absolute; right: 20px; top: 20px; color: #999; cursor: pointer;" class="el-icon-refresh" @click="refreshSystemData" /> <div style="position: absolute; right: 20px; top: 20px; color: #999; cursor: pointer;" class="el-icon-refresh" @click="refreshSystemData" />
</h3> </h3>
<!-- <div class="chart-wrapper"> -->
<!-- <serverProgress :system-data="systemData" /> -->
<!-- </div> -->
<swiper <swiper
ref="swiperServer" ref="swiperServer"
class="swiper-server" class="swiper-server"
@ -66,17 +73,6 @@
<swiper-slide class="swiper-slide-server"> <swiper-slide class="swiper-slide-server">
<serverProgress :system-data="systemData" /> <serverProgress :system-data="systemData" />
</swiper-slide> </swiper-slide>
<swiper-slide class="swiper-slide-server cpu-echarts">
<serverGpuUse :utilization="utilization" />
<div class="cpu-right">
<serverGpu :temperature="temperature" />
<serverGpuOther :memory-total="memoryTotal" :memory-free="memoryFree" />
</div>
<div style="position: absolute; bottom: 136px; right: 70px; font-weight: bold;">{{ GPUName }}</div>
</swiper-slide>
<swiper-slide class="swiper-slide-server">
<serveTerminal ref="serveTerminalRefs" />
</swiper-slide>
<div slot="pagination" class="swiper-pagination" /> <div slot="pagination" class="swiper-pagination" />
</swiper> </swiper>
</div> </div>
@ -95,27 +91,48 @@
</h3> </h3>
<div class="home-flowable" style="height: calc(100% - 54px); overflow-x: hidden;"> <div class="home-flowable" style="height: calc(100% - 54px); overflow-x: hidden;">
<div class="home-tab"> <div class="home-tab">
<span :class="{'home-tab-active': flowableTabIndex == 0}">未完成({{ stockLogIncompleteData.length !==0? stockLogIncompleteData.length: 0 }})</span>
<span :class="{'home-tab-active': flowableTabIndex == 1}">已完成({{ stockLogCompletedData.length !==0? stockLogCompletedData.length: 0 }})</span>
<span :class="{'home-tab-active': inOutTabIndex == 0}" @click="changeInOutTab(0)">未开始({{ topObjectNum && topObjectNum.inOutnotNum }})</span>
<span :class="{'home-tab-active': inOutTabIndex == 1}" @click="changeInOutTab(1)">进行中({{ topObjectNum && topObjectNum.inOutingNum }})</span>
<span :class="{'home-tab-active': inOutTabIndex == 2}" @click="changeInOutTab(2)">已完成({{ topObjectNum && topObjectNum.inOutedNum }})</span>
</div> </div>
<div class="home-flowable-list" style="height: calc(100% - 45px); overflow-y: auto; overflow-x: hidden;">
<el-table v-if="stockLogIncompleteData.length !== 0" height="calc(100%)" :data="stockLogIncompleteData" class="archives-table" stripe style="width: 100%">
<el-table-column prop="stockBill" label="盘点单号" />
<el-table-column prop="state" label="状态" align="center">
<div class="home-flowable-list" style="height: calc(100% - 45px); overflow-x: hidden;">
<el-table
v-show="inOutData.length !== 0"
ref="inOutTableRef"
height="calc(100%)"
:data="inOutData"
class="archives-table"
stripe
style="width: 100%"
@scroll="handleInOutTableScroll"
>
<el-table-column prop="manageType" label="类型">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.state === 0" class="row-state row-lending state-active">已终止</span>
<span v-if="scope.row.state === 1" class="row-state row-warehousing state-active">排队中</span>
<span v-if="scope.row.state === 2" class="row-state row-binding state-active">盘点中</span>
<span v-if="scope.row.state === 3" class="row-state row-physical state-active">已完成</span>
<el-tag v-if="scope.row.manageType === 1">入库</el-tag>
<el-tag v-if="scope.row.manageType === 2" type="success">出库</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="时间" width="180">
<el-table-column prop="mainBillNo" label="任务单号" min-width="180px" :show-overflow-tooltip="true" />
<el-table-column prop="fondsName" label="所属市州" />
<el-table-column prop="inOutCount" label="总数量" width="80px" align="right" />
<el-table-column prop="checkStartTime" label="出/入库开始时间" width="150px">
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.createTime | parseTime }}</div>
<div>{{ scope.row.checkStartTime | parseTime }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="checkEndTime" label="出/入库结束时间" width="150px">
<template slot-scope="scope">
<div>{{ scope.row.checkEndTime | parseTime }}</div>
</template>
</el-table-column>
<div slot="append" style="text-align:center;padding:12px 0;color:#666;font-size:13px;">
<span v-if="inOutPage.loadingMore">
<i class="el-icon-loading" /> 加载中...
</span>
<span v-else-if="!inOutPage.hasMore && inOutData.length">没有更多数据</span>
</div>
</el-table> </el-table>
<div v-else class="empty-main" style="height: 100%;">
<div v-if="inOutData.length === 0" class="empty-main" style="height: 100%;">
<svg-icon icon-class="empty" class-name="empty-img" /> <svg-icon icon-class="empty" class-name="empty-img" />
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
@ -139,78 +156,77 @@
<script> <script>
import PanelGroup from './dashboard/PanelGroup' import PanelGroup from './dashboard/PanelGroup'
// 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 serverProgress from '@/views/components/echarts/serverProgress.vue' import serverProgress from '@/views/components/echarts/serverProgress.vue'
import serverGpu from '@/views/components/echarts/serverGpu.vue'
import serverGpuUse from '@/views/components/echarts/serverGpuUse.vue'
import serverGpuOther from '@/views/components/echarts/serverGpuOther.vue'
import serveTerminal from '@/views/components/serveTerminal.vue'
import { FetchInitHomeInfo, FetchInitStockInfo } from '@/api/stockTask/index'
import { FetchInitStockLogList } from '@/api/stockTaskLog/index'
import { FetchInitBaseInfo } from '@/api/stockTask/index'
import { FetchSystemInfo } from '@/api/home/cpu/index' import { FetchSystemInfo } from '@/api/home/cpu/index'
import { FetchInitStockTakeBill, FetchInitInOutBill } from '@/api/asset/index'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
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'
//
function debounce(fn, delay) {
let timer = null
return function(...args) {
clearTimeout(timer)
timer = setTimeout(() => {
fn.apply(this, args)
}, delay)
}
}
export default { export default {
name: 'Dashboard', name: 'Dashboard',
components: { components: {
PanelGroup, PanelGroup,
// lendAcross,
// catePie,
// typePie,
serverProgress, serverProgress,
serverGpu,
serverGpuUse,
serverGpuOther,
serveTerminal,
swiper, swiper,
swiperSlide swiperSlide
}, },
data() { data() {
return { return {
topObjectNum: { topObjectNum: {
regionCount: 0,
shelfCount: 0,
gridCount: 0,
deviceCount: 0,
noStockGridCount: 0,
deviceErrorCount: 0
assetTotalNum: 0,
deviceNum: 0,
fondsNum: 0,
warehouseNum: 0,
stockTakenotNum: 0,
stockTakeingNum: 0,
stockTakedNum: 0,
inOutnotNum: 0,
inOutingNum: 0,
inOutedNum: 0
},
//
stockData: [],
stockLogTabIndex: 0,
stockPage: {
currentPage: 1,
pageSize: 10,
loadingMore: false,
hasMore: true
},
//
inOutData: [],
inOutTabIndex: 0,
inOutPage: {
currentPage: 1,
pageSize: 10,
loadingMore: false,
hasMore: true
}, },
taskStockLogData: [],
inOutLogData: [],
echartsTimer: null,
refreshtime: 10000,
systemTimer: null,
systemData: { systemData: {
cpuPercentage: 0, cpuPercentage: 0,
memPercentage: 0, memPercentage: 0,
sysFilesPercentage: 0 sysFilesPercentage: 0
}, },
stockLogCompletedData: [],
stockLogIncompleteData: [],
archivesTotalNum: 0,
flowableData: [],
flowableTabIndex: 0,
swiperOptionServer: { swiperOptionServer: {
autoplay: { autoplay: {
delay: 8000, delay: 8000,
disableOnInteraction: false disableOnInteraction: false
}, },
slidesPerView: 'auto',
pagination: {
el: '.swiper-pagination',
clickable: true
slidesPerView: 'auto'
} }
},
memoryFree: 0,
memoryTotal: 0,
GPUName: '',
temperature: 0,
utilization: 0
} }
}, },
computed: { computed: {
@ -223,45 +239,189 @@ export default {
}, },
created() { created() {
this.handleMainData() this.handleMainData()
this.getInitStockTakeBill(true)
this.getInitInOutBill(true) //
this.getSystemInfo() this.getSystemInfo()
this.getStockLog()
this.handleInitStockInfo()
},
mounted() {
//
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.serveTerminalRefs.initData()
if (this.$refs.stockTableRef) {
const tableWrapper = this.$refs.stockTableRef.$el.querySelector('.el-table__body-wrapper')
if (tableWrapper) {
tableWrapper.addEventListener('scroll', debounce((e) => {
const { scrollTop, scrollHeight, clientHeight } = e.target
const distance = scrollHeight - scrollTop - clientHeight
if (distance <= 80) {
this.loadMoreStock()
}
}, 100))
}
}
//
if (this.$refs.inOutTableRef) {
const inOutTableWrapper = this.$refs.inOutTableRef.$el.querySelector('.el-table__body-wrapper')
if (inOutTableWrapper) {
inOutTableWrapper.addEventListener('scroll', debounce((e) => {
const { scrollTop, scrollHeight, clientHeight } = e.target
const distance = scrollHeight - scrollTop - clientHeight
if (distance <= 80) {
this.loadMoreInOut()
}
}, 100))
}
}
})
},
methods: {
handleMainData() {
const param = {
'userId': this.user.id
}
FetchInitBaseInfo(param).then(data => {
this.topObjectNum = {
assetTotalNum: data.assetTotalNum || 0,
deviceNum: data.deviceNum || 0,
fondsNum: data.fondsNum || 0,
warehouseNum: data.warehouseNum || 0,
stockTakenotNum: data.stockTakenotNum || 0,
stockTakeingNum: data.stockTakeingNum || 0,
stockTakedNum: data.stockTakedNum || 0,
inOutnotNum: data.inOutnotNum || 0,
inOutingNum: data.inOutingNum || 0,
inOutedNum: data.inOutedNum || 0
}
})
},
// ====== ======
changeStockLogTab(index) {
this.stockLogTabIndex = index
this.stockData = []
this.stockPage.currentPage = 1
this.stockPage.hasMore = true
this.$nextTick(() => {
this.getInitStockTakeBill(true)
})
},
handleStockTableScroll: debounce(function(e) {
const { scrollTop, scrollHeight, clientHeight } = e.target
const distance = scrollHeight - scrollTop - clientHeight
if (distance <= 80) {
this.loadMoreStock()
}
}, 100),
loadMoreStock() {
if (this.stockPage.loadingMore || !this.stockPage.hasMore) return
this.stockPage.currentPage += 1
this.getInitStockTakeBill(false)
},
getInitStockTakeBill(isFirst = false) {
if (isFirst) {
this.stockPage.loadingMore = true
} else {
if (this.stockPage.loadingMore || !this.stockPage.hasMore) return
this.stockPage.loadingMore = true
}
const params = {
'status': this.stockLogTabIndex,
'userId': this.user.id,
'pageNo': this.stockPage.currentPage,
'pageSize': this.stockPage.pageSize
}
FetchInitStockTakeBill(params).then(res => {
if (res.code !== 500 && Array.isArray(res.data)) {
const list = res.data
if (isFirst) {
this.stockData = list
} else {
this.stockData.push(...list)
}
if (res.pageNo >= res.totalPages) {
this.stockPage.hasMore = false
} else {
this.stockPage.hasMore = true
}
} else {
if (isFirst) {
this.stockData = []
}
this.stockPage.hasMore = false
}
}).finally(() => {
this.stockPage.loadingMore = false
}) })
}, },
mounted() {
// const _this = this
// //
// this.echartsTimer = setInterval(() => {
// _this.handleMainData()
// }, this.refreshtime)
//
// this.systemTimer = setInterval(() => {
// _this.systemData = {
// cpuPercentage: 0,
// memPercentage: 0,
// sysFilesPercentage: 0
// }
// this.getSystemInfo()
// }, 3000)
// ====== ======
changeInOutTab(index) {
this.inOutTabIndex = index
this.inOutData = []
this.inOutPage.currentPage = 1
this.inOutPage.hasMore = true
this.$nextTick(() => {
this.getInitInOutBill(true)
})
}, },
methods: {
handleInOutTableScroll: debounce(function(e) {
const { scrollTop, scrollHeight, clientHeight } = e.target
const distance = scrollHeight - scrollTop - clientHeight
if (distance <= 80) {
this.loadMoreInOut()
}
}, 100),
loadMoreInOut() {
if (this.inOutPage.loadingMore || !this.inOutPage.hasMore) return
this.inOutPage.currentPage += 1
this.getInitInOutBill(false)
},
/**
* 获取出入库列表
* @param {Boolean} isFirst true=首次/切换tab false=滚动追加
*/
getInitInOutBill(isFirst = false) {
if (isFirst) {
this.inOutPage.loadingMore = true
} else {
if (this.inOutPage.loadingMore || !this.inOutPage.hasMore) return
this.inOutPage.loadingMore = true
}
const params = {
'status': this.inOutTabIndex,
'userId': this.user.id,
'pageNo': this.inOutPage.currentPage,
'pageSize': this.inOutPage.pageSize
}
FetchInitInOutBill(params).then(res => {
if (res.code !== 500 && Array.isArray(res.records)) {
const list = res.records
if (isFirst) {
this.inOutData = list
} else {
this.inOutData.push(...list)
}
console.log(res)
if (res.current >= res.pages) {
this.inOutPage.hasMore = false
} else {
this.inOutPage.hasMore = true
}
} else {
if (isFirst) {
this.inOutData = []
}
this.inOutPage.hasMore = false
}
}).finally(() => {
this.inOutPage.loadingMore = false
})
},
getSystemInfo() { getSystemInfo() {
FetchSystemInfo().then(res => { FetchSystemInfo().then(res => {
// cpu cpuTotal-cpuFree/cpuTotal // cpu cpuTotal-cpuFree/cpuTotal
this.systemData.cpuPercentage = Math.round((res.cpuTotal - res.cpuFree) / res.cpuTotal * 100) this.systemData.cpuPercentage = Math.round((res.cpuTotal - res.cpuFree) / res.cpuTotal * 100)
// 使memUsed/memTotal // 使memUsed/memTotal
this.systemData.memPercentage = Math.round(res.memUsed / res.memTotal * 100) this.systemData.memPercentage = Math.round(res.memUsed / res.memTotal * 100)
this.memoryFree = res.memoryFree
this.memoryTotal = res.memoryTotal
this.GPUName = res.GPUName
this.temperature = res.temperature
this.utilization = res.utilization
// 使sysFiles[i].used/sysFiles[i].total // 使sysFiles[i].used/sysFiles[i].total
let sysFilesTotalUsed = 0 let sysFilesTotalUsed = 0
let sysFilesTotal = 0 let sysFilesTotal = 0
@ -278,42 +438,7 @@ export default {
memPercentage: 0, memPercentage: 0,
sysFilesPercentage: 0 sysFilesPercentage: 0
} }
this.memoryFree = 0
this.memoryTotal = 0
this.GPUName = ''
this.temperature = 0
this.utilization = 0
this.getSystemInfo() this.getSystemInfo()
this.$refs.serveTerminalRefs.initData()
},
getStockLog() {
FetchInitStockLogList().then(res => {
this.stockLogCompletedData = res.content.filter(item => [0, 3].includes(item.state))
this.stockLogIncompleteData = res.content.filter(item => [1, 2].includes(item.state))
})
},
handleMainData() {
FetchInitHomeInfo().then(data => {
this.topObjectNum = {
regionCount: data.regionCount,
shelfCount: data.shelfCount,
gridCount: data.gridCount,
deviceCount: data.deviceCount,
noStockGridCount: data.noStockGridCount,
deviceErrorCount: data.deviceErrorCount
}
})
},
handleInitStockInfo(params) {
FetchInitStockInfo(params).then(res => {
this.taskStockLogData = [
{ value: res.onShelfNum - res.errorShelfNum - res.errorOrderNum, name: '正常在架' },
{ value: res.errorShelfNum, name: '错架' },
{ value: res.errorOrderNum, name: '错序' }
]
}).catch(() => {
})
} }
} }
} }
@ -374,9 +499,10 @@ export default {
margin-right: 30px; margin-right: 30px;
padding-bottom: 3px; padding-bottom: 3px;
border-bottom: 3px solid #fff; border-bottom: 3px solid #fff;
cursor: pointer;
&.home-tab-active{ &.home-tab-active{
color: #0348F3; color: #0348F3;
// border-bottom: 3px solid #0348F3;
border-color:#0348F3;
} }
} }
} }
@ -386,7 +512,7 @@ export default {
background-color: #DDE8FB !important; background-color: #DDE8FB !important;
} }
::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-thumb {
::v-deep .home-flowable-list .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-thumb {
border-radius: 3px; border-radius: 3px;
background-color: #4578F6 !important; background-color: #4578F6 !important;
} }
@ -398,6 +524,7 @@ export default {
::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-corner { ::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-corner {
background-color: #DDE8FB !important; background-color: #DDE8FB !important;
} }
.refresh-date{ .refresh-date{
position: absolute; position: absolute;
right: 14px; right: 14px;
@ -421,14 +548,34 @@ export default {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
// background-color: #000;
.cpu-right{ .cpu-right{
flex: 1; flex: 1;
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
// flex-direction: column;
// flex-wrap: wrap;
}
}
::v-deep .el-tag{
&.el-tag--small{
color: #0348f3 !important;
background-color: #eef5fe !important;
border-color: #c1dbfc !important;
}
&.el-tag--success {
background-color: #e7faf0 !important;
border-color: #d0f5e0!important;
color: #13ce66!important;
}
&.el-tag--info {
background-color: #f4f4f5 !important;
border-color: #f4f4f5!important;
color: #909399!important;
}
&.el-tag--error {
background-color: #fbc0b5 !important;
border-color: #fcab9d !important;
color: #ed4a41!important;
} }
} }
</style> </style>
Loading…
Cancel
Save