| | |
| | | <div style="height: 470px;"> |
| | | <div class="smallTitle"> |
| | | <svg-icon icon-class="ph" class="svg_class" /> |
| | | 半成品、产品库存量排行Top5 |
| | | 近一周采购待入库物料排行Top5 |
| | | </div> |
| | | <div class="lineContent horn" style="height: 410px"> |
| | | <div id="bar03" style="width: 100%;height:100%; " /> |
| | |
| | | <div style="height: 470px;margin-top: 30px;"> |
| | | <div class="smallTitle"> |
| | | <svg-icon icon-class="ph" class="svg_class" /> |
| | | 原材料库存量排行Top5 |
| | | 近一周销售已发货产品排行Top5 |
| | | </div> |
| | | <div class="lineContent horn" style="height: 410px"> |
| | | <div id="bar04" style="width: 100%;height:100%;" /> |
| | |
| | | import './kbCommon.css' |
| | | import { bar02, kbTop, loadEcharts } from '@/utils/myEcharts' |
| | | import { |
| | | WareHouseTopLeftData, |
| | | WareHouseTopBottomData, |
| | | WareHouseRightTopData, |
| | | WareHouseRightBottomData |
| | | ProcureOutsourcLeftTop, |
| | | ProductConsignmentLeftBottom, |
| | | ProcureOutsourcRightTop, |
| | | ProductionStockedInRightBottom |
| | | } from '@/api/kanbanManager' |
| | | |
| | | export default { |
| | |
| | | window.addEventListener('offline', this.updateOnlineStatus) |
| | | this.updateOnlineStatus({ type: this.onLine ? 'online' : 'offline', isFirst: true }) |
| | | |
| | | this.getWareHouseTopLeftData() |
| | | this.getWareHouseTopBottomData() |
| | | this.getProcureOutsourcLeftTop() |
| | | this.getProductConsignmentLeftBottom() |
| | | this.getEcharts() |
| | | }, |
| | | beforeDestroy() { |
| | |
| | | } |
| | | }, |
| | | // 获取左上table数据 |
| | | getWareHouseTopLeftData() { |
| | | WareHouseTopLeftData().then(res => { |
| | | getProcureOutsourcLeftTop() { |
| | | ProcureOutsourcLeftTop().then(res => { |
| | | this.tableDataTop = res.data |
| | | // this.number1 = this.tableDataTop.length |
| | | const divData = this.$refs.tableDataTopRef.bodyWrapper |
| | |
| | | if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) { |
| | | // 重置table距离顶部距离 |
| | | divData.scrollTop = 0 |
| | | WareHouseTopLeftData().then(res => { |
| | | ProcureOutsourcLeftTop().then(res => { |
| | | this.tableDataTop = res.data |
| | | // this.number1 = this.tableDataTop.length |
| | | if (this.tableDataTop.length > 10) { |
| | | clearInterval(this.tableTopTask) |
| | | this.getWareHouseTopLeftData() |
| | | this.getProcureOutsourcLeftTop() |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | }, |
| | | // 获取左下table数据 |
| | | getWareHouseTopBottomData() { |
| | | WareHouseTopBottomData().then(res => { |
| | | getProductConsignmentLeftBottom() { |
| | | ProductConsignmentLeftBottom().then(res => { |
| | | this.tableDataBottom = res.data |
| | | this.number2 = this.tableDataBottom.length |
| | | const divData = this.$refs.tableDataBottomRef.bodyWrapper |
| | |
| | | if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) { |
| | | // 重置table距离顶部距离 |
| | | divData.scrollTop = 0 |
| | | WareHouseTopBottomData().then(res => { |
| | | ProductConsignmentLeftBottom().then(res => { |
| | | this.tableDataBottom = res.data |
| | | this.number2 = this.tableDataBottom.length |
| | | if (this.tableDataBottom.length > 10) { |
| | | clearInterval(this.tableBottomTask) |
| | | this.getWareHouseTopBottomData() |
| | | this.getProductConsignmentLeftBottom() |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | // 获取echarts |
| | | getEcharts() { |
| | | WareHouseRightTopData().then(res => { |
| | | loadEcharts('bar03', bar02(res.data.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name))) |
| | | ProcureOutsourcRightTop().then(res => { |
| | | loadEcharts('bar03', bar02(res.data.filter(i => i.qty > 0).map(i => i.qty), res.data.filter(i => i.qty > 0).map(i => i.materiel_name))) |
| | | }) |
| | | |
| | | WareHouseRightBottomData().then(res => { |
| | | loadEcharts('bar04', bar02(res.dat.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name))) |
| | | ProductionStockedInRightBottom().then(res => { |
| | | loadEcharts('bar04', bar02(res.data.filter(i => i.qty > 0).map(i => i.qty), res.data.filter(i => i.qty > 0).map(i => i.materiel_name))) |
| | | }) |
| | | |
| | | this.echartsRightTop = setInterval(() => { |
| | | WareHouseRightTopData().then(res => { |
| | | loadEcharts('bar03', bar02(res.data.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name))) |
| | | ProcureOutsourcRightTop().then(res => { |
| | | loadEcharts('bar03', bar02(res.data.filter(i => i.qty > 0).map(i => i.qty), res.data.filter(i => i.qty > 0).map(i => i.materiel_name))) |
| | | }) |
| | | }, 1000 * 15) |
| | | |
| | | this.echartsRightBottom = setInterval(() => { |
| | | WareHouseRightBottomData().then(res => { |
| | | loadEcharts('bar04', bar02(res.data.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name))) |
| | | ProductionStockedInRightBottom().then(res => { |
| | | loadEcharts('bar04', bar02(res.data.filter(i => i.qty > 0).map(i => i.qty), res.data.filter(i => i.qty > 0).map(i => i.materiel_name))) |
| | | }) |
| | | }, 1000 * 15) |
| | | }, |