| | |
| | | </div> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="10" :md="10" :lg="8" :xl="8" class="home-media"> |
| | | |
| | | <div class="home-card-item"> |
| | | <div class="home-card-item-title">快捷导航工具</div> |
| | | <div class="home-monitor"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="15" class="home-card-three"> |
| | |
| | | import { useThemeConfig } from '/@/stores/themeConfig'; |
| | | import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes'; |
| | | import { wmsStockPassMap,wmsHomePageQuery,wmsHomePlaceQuery,wmsTransitionDiagramQuery } from '/@/api/main/inventoryWarning/inventoryWarning'; |
| | | import type { TabsPaneContext } from 'element-plus' |
| | | import type { TabsPaneContext } from 'element-plus'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | | const router = useRouter(); |
| | | // 接口数据 |
| | |
| | | // 查询 |
| | | const handleQuery1 = async () => { |
| | | loadingwms.value = true; |
| | | var res = await wmsHomePageQuery(); |
| | | if(res.data.type=="success"){ |
| | | let result = res.data.result || []; |
| | | state.orderNum = result.allOrderNumber || 0 |
| | | state.homeOne[0].num1 = result.outtingPlaceNumber || 0 |
| | | state.homeOne[0].num2 = result.allOuttingNumber || 0 |
| | | state.homeOne[0].numA = Math.round((result.outtingPlaceNumber || 0) / (result.allOuttingNumber || 0) * 10000) / 100 || 0 |
| | | state.homeOne[1].num1 = result.warehousingNumber || 0 |
| | | state.homeOne[1].num2 = result.allWarehousingNumber || 0 |
| | | state.homeOne[1].numA = Math.round((result.warehousingNumber || 0) / (result.allWarehousingNumber || 0)* 10000) / 100 || 0 |
| | | // var res = await wmsHomePageQuery(); |
| | | // if(res.data.type=="success"){ |
| | | // let result = res.data.result || []; |
| | | // state.orderNum = result.allOrderNumber || 0 |
| | | // state.homeOne[0].num1 = result.outtingPlaceNumber || 0 |
| | | // state.homeOne[0].num2 = result.allOuttingNumber || 0 |
| | | // state.homeOne[0].numA = Math.round((result.outtingPlaceNumber || 0) / (result.allOuttingNumber || 0) * 10000) / 100 || 0 |
| | | // state.homeOne[1].num1 = result.warehousingNumber || 0 |
| | | // state.homeOne[1].num2 = result.allWarehousingNumber || 0 |
| | | // state.homeOne[1].numA = Math.round((result.warehousingNumber || 0) / (result.allWarehousingNumber || 0)* 10000) / 100 || 0 |
| | | |
| | | } |
| | | // } |
| | | loadingwms.value = false; |
| | | }; |
| | | const handleQuery2 = async () => { |
| | | loadingwms.value = true; |
| | | var res = await wmsHomePlaceQuery(); |
| | | if(res.data.type=="success"){ |
| | | let result = res.data.result || {}; |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | | initPieChart(result); |
| | | }, 500); |
| | | }); |
| | | } |
| | | // var res = await wmsHomePlaceQuery(); |
| | | // if (res.data.type == 'success') { |
| | | // let result = res.data.result || {}; |
| | | // nextTick(() => { |
| | | // setTimeout(() => { |
| | | // initPieChart(result); |
| | | // }, 500); |
| | | // }); |
| | | // } |
| | | loadingwms.value = false; |
| | | }; |
| | | const dataAll = ref({ |
| | |
| | | arr2:[], |
| | | arr3:[], |
| | | arr4:[], |
| | | arr5:[] |
| | | }) |
| | | arr5: [], |
| | | }); |
| | | const handleQuery3 = async (val:any) => { |
| | | dataAll.value.arr1 = []; |
| | | dataAll.value.arr2 = []; |
| | |
| | | dataAll.value.arr4 = []; |
| | | dataAll.value.arr5 = []; |
| | | loadingwms.value = true; |
| | | let para = {DayOrWeekOrMonth:Number(val)} |
| | | let para = { DayOrWeekOrMonth: Number(val) }; |
| | | var res = await wmsStockPassMap(para); |
| | | if(res.data.type=="success"){ |
| | | if (res.data.type == 'success') { |
| | | let result = res.data.result || []; |
| | | result.forEach((item:any,index:number) => { |
| | | dataAll.value.arr1.push({value:item.inWare,stationName:'s'+item.time}) |
| | | dataAll.value.arr2.push({value:item.outWare,stationName:'s'+item.time}) |
| | | dataAll.value.arr3.push({value:item.stockNum,stationName:'s'+item.time}) |
| | | dataAll.value.arr4.push({value:item.aveStockNum,stationName:'s'+item.time}) |
| | | dataAll.value.arr5.push(item.date) |
| | | }) |
| | | dataAll.value.arr1.push({ value: item.inWare, stationName: 's' + item.time }); |
| | | dataAll.value.arr2.push({ value: item.outWare, stationName: 's' + item.time }); |
| | | dataAll.value.arr3.push({ value: item.stockNum, stationName: 's' + item.time }); |
| | | dataAll.value.arr4.push({ value: item.aveStockNum, stationName: 's' + item.time }); |
| | | dataAll.value.arr5.push(item.date); |
| | | }); |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | | if (!state.global.dispose.some((b: any) => b === state.global.homeCharThree)) state.global.homeCharThree.dispose(); |
| | | initChart() |
| | | initChart(); |
| | | }, 500); |
| | | }); |
| | | } |
| | |
| | | const handleQuery4 = async () => { |
| | | loadingwms.value = true; |
| | | var res = await wmsTransitionDiagramQuery(); |
| | | if(res.data.type=="success"){ |
| | | if (res.data.type == 'success') { |
| | | let arr1: any[] = []; |
| | | let arr2: any = []; |
| | | let arrA: any = []; |
| | | let result = res.data.result || []; |
| | | result.forEach((item:any,index:number) => { |
| | | arr1.push(item.receiptNumber) |
| | | arr2.push(item.deliveryNumber) |
| | | arrA.push(item.day.slice(0, 10)) |
| | | }) |
| | | arr1.push(item.receiptNumber); |
| | | arr2.push(item.deliveryNumber); |
| | | arrA.push(item.day.slice(0, 10)); |
| | | }); |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | | initLineChart(arr1,arr2,arrA); |
| | |
| | | } |
| | | loadingwms.value = false; |
| | | }; |
| | | handleQuery1(); |
| | | handleQuery2(); |
| | | handleQuery3('1'); |
| | | handleQuery4(); |
| | | const activeName = ref('1') |
| | | // handleQuery1(); |
| | | // handleQuery2(); |
| | | // handleQuery3('1'); |
| | | // handleQuery4(); |
| | | const activeName = ref('1'); |
| | | const handleClick = (tab: TabsPaneContext, event: Event) => { |
| | | handleQuery3(tab.props.name); |
| | | } |
| | | }; |
| | | |
| | | // 定义变量内容 |
| | | const homeLineRef = ref(); |
| | |
| | | }; |
| | | const initChart = () => { |
| | | if (!state.global.dispose.some((b: any) => b === state.global.homeCharThree)) state.global.homeCharThree.dispose(); |
| | | const chart = document.getElementById("homeBarRef") |
| | | if (chart!=null) chart.removeAttribute('_echarts_instance_')//解决切换页面echarts不显示的问题 |
| | | const chart = document.getElementById('homeBarRef'); |
| | | if (chart != null) chart.removeAttribute('_echarts_instance_'); //解决切换页面echarts不显示的问题 |
| | | state.global.homeCharThree = markRaw(echarts.init(chart, state.charts.theme)); |
| | | //手动赋值 |
| | | option.xAxis[0].data = dataAll.value.arr5 |
| | | option.series[0].data = dataAll.value.arr1 |
| | | option.series[1].data = dataAll.value.arr2 |
| | | option.xAxis[0].data = dataAll.value.arr5; |
| | | option.series[0].data = dataAll.value.arr1; |
| | | option.series[1].data = dataAll.value.arr2; |
| | | // option.series[2].data = dataAll.value.arr3 |
| | | // option.series[3].data = dataAll.value.arr4 |
| | | // 绘制图表 |
| | | state.global.homeCharThree.setOption(option); |
| | | state.myCharts.push(state.global.homeCharThree); |
| | | } |
| | | }; |
| | | |
| | | // 批量设置 echarts resize |
| | | const routerJupm = (v:any) => { |
| | |
| | | let timeInter: any = null; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | initEchartsResize(); |
| | | // initEchartsResize(); |
| | | |
| | | timeInter = setInterval(() => { |
| | | nextTick(() => { |
| | | handleQuery1(); |
| | | handleQuery2(); |
| | | handleQuery3('1'); |
| | | handleQuery4(); |
| | | }); |
| | | }, 15000); //调用频率改为 15秒一次查询。 |
| | | // timeInter = setInterval(() => { |
| | | // nextTick(() => { |
| | | // handleQuery1(); |
| | | // handleQuery2(); |
| | | // handleQuery3('1'); |
| | | // handleQuery4(); |
| | | // }); |
| | | // }, 15000); //调用频率改为 15秒一次查询。 |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | |
| | | immediate: true, |
| | | } |
| | | ); |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |