|
@@ -1,89 +1,166 @@
|
|
|
-/**
|
|
|
- // author:zhangb
|
|
|
- // time:2022-10-19
|
|
|
- // desc:可视化组件图标部分拆解
|
|
|
-*/
|
|
|
+/** // author:zhangb // time:2022-10-19 // desc:可视化组件图标部分拆解 */
|
|
|
<template>
|
|
|
<div class="dashboard">
|
|
|
<!-- 顶部卡片汇总 -->
|
|
|
<div class="top_card_border">
|
|
|
- <card-box :boxWidth="'19%'" :numValue="8866" :mainTitle="'牧场总数量'" :numUnit="'个'"></card-box>
|
|
|
- <card-box :startCor="'#f382ee'" :endCor="'#7d7cfe'" :boxWidth="'19%'" :numValue="65244" :mainTitle="'奶牛总数量'" :numUnit="'头'"></card-box>
|
|
|
- <card-box :startCor="'#40ecb0'" :endCor="'#0eb4e8'" :boxWidth="'19%'" :numValue="10521" :mainTitle="'原奶总产量'" :numUnit="'公斤'"></card-box>
|
|
|
- <card-box :startCor="'#fe8e82'" :endCor="'#ff6fb7'" :boxWidth="'19%'" :numValue="8452" :mainTitle="'草料需求量'" :numUnit="'万吨'" :subTitle="'(按每月)'"></card-box>
|
|
|
- <card-box :startCor="'#fe8e82'" :endCor="'#ff6fb7'" :boxWidth="'19%'" :numValue="65121" :mainTitle="'饲料需求量'" :numUnit="'万吨'" :subTitle="'(按每月)'"></card-box>
|
|
|
- </div>
|
|
|
+ <card-box
|
|
|
+ :startCor="'#fe8e82'"
|
|
|
+ :endCor="'#ff6fb7'"
|
|
|
+ @click="router.push('/trackManager/waybillManager')"
|
|
|
+ :boxWidth="'19%'"
|
|
|
+ :numValue="waybillData.length"
|
|
|
+ :mainTitle="'运单数量'"
|
|
|
+ :numUnit="'条'"
|
|
|
+ ></card-box>
|
|
|
|
|
|
- <!-- TODO 暂不使用 -->
|
|
|
- <!-- 中部区域 -->
|
|
|
- <div class="mid_content" v-show="false">
|
|
|
- <!-- 左边 -->
|
|
|
- <div class="let_step">
|
|
|
- <des-card></des-card>
|
|
|
- <des-card></des-card>
|
|
|
- <des-card></des-card>
|
|
|
- <des-card></des-card>
|
|
|
- <des-card></des-card>
|
|
|
- <des-card></des-card>
|
|
|
+ <card-box
|
|
|
+ :boxWidth="'19%'"
|
|
|
+ @click="router.push('/trackManager/deviceAbnormality')"
|
|
|
+ :numValue="exceptionWaybillStatistics.device"
|
|
|
+ :mainTitle="'设备异常'"
|
|
|
+ :numUnit="'条'"
|
|
|
+ ></card-box>
|
|
|
+ <card-box
|
|
|
+ :startCor="'#f382ee'"
|
|
|
+ :endCor="'#7d7cfe'"
|
|
|
+ :boxWidth="'19%'"
|
|
|
+ @click="router.push('/trackManager/loadDeviation')"
|
|
|
+ :numValue="exceptionWaybillStatistics.loading"
|
|
|
+ :mainTitle="'装货地异常'"
|
|
|
+ :numUnit="'条'"
|
|
|
+ ></card-box>
|
|
|
+ <card-box
|
|
|
+ :startCor="'#40ecb0'"
|
|
|
+ :endCor="'#0eb4e8'"
|
|
|
+ @click="router.push('/trackManager/abnormalWaybill')"
|
|
|
+ :boxWidth="'19%'"
|
|
|
+ :numValue="exceptionWaybillStatistics.unload"
|
|
|
+ :mainTitle="'卸货地异常'"
|
|
|
+ :numUnit="'条'"
|
|
|
+ ></card-box>
|
|
|
+ <card-box
|
|
|
+ :startCor="'#fe8e82'"
|
|
|
+ :endCor="'#ff6fb7'"
|
|
|
+ :boxWidth="'19%'"
|
|
|
+ :numValue="exceptionRate"
|
|
|
+ :mainTitle="'运单运输异常率'"
|
|
|
+ :numUnit="'%'"
|
|
|
+ ></card-box>
|
|
|
+ </div>
|
|
|
+ <div class="mid_content">
|
|
|
+ <!-- 核心可视化地图内容 -->
|
|
|
+ <div class="map_style">
|
|
|
+ <map-chart :heightStyle="'height:800px;'"></map-chart>
|
|
|
</div>
|
|
|
- <!-- echarts 图表 -->
|
|
|
<div class="right_step">
|
|
|
- <pie-chart></pie-chart>
|
|
|
+ <div class="title">运单数据排行榜</div>
|
|
|
+ <el-table :data="tableData" border stripe style="width: 100%">
|
|
|
+ <el-table-column label="供应商" prop="supplierName" width=""></el-table-column>
|
|
|
+ <el-table-column label="运单数" prop="waybillCount" width=""></el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- 核心可视化地图内容 -->
|
|
|
- <div class="map_style">
|
|
|
- <map-chart :heightStyle="'height:800px;'"></map-chart>
|
|
|
- </div>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
-import { defineComponent } from 'vue'
|
|
|
+<script setup>
|
|
|
+import { tms } from '@/request/api'
|
|
|
import cardBox from './components/cardBox.vue'
|
|
|
-import desCard from './components/desCard.vue'
|
|
|
-export default defineComponent({
|
|
|
- components:{
|
|
|
- cardBox,desCard
|
|
|
- },
|
|
|
- setup() {
|
|
|
- return {
|
|
|
-
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
-
|
|
|
+import { ref, reactive, onMounted } from 'vue'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
+import mapChart from './components/mapChart.vue'
|
|
|
+const router = useRouter()
|
|
|
+// 异常运单统计
|
|
|
+const exceptionWaybillStatistics = ref({
|
|
|
+ device: 0,
|
|
|
+ loading: 0,
|
|
|
+ unload: 0,
|
|
|
+}) // 异常运单统计
|
|
|
+const getData = async () => {
|
|
|
+ const response = await tms.queryExceptionWaybillStatistics()
|
|
|
+ if (response.code === 101) {
|
|
|
+ exceptionWaybillStatistics.value.device = response.data.find(item => item.type === 'DEVICE').count
|
|
|
+ exceptionWaybillStatistics.value.loading = response.data.find(item => item.type === 'LOADING').count
|
|
|
+ exceptionWaybillStatistics.value.unload = response.data.find(item => item.type === 'UNLOAD').count
|
|
|
}
|
|
|
+}
|
|
|
+
|
|
|
+const waybillData = ref([]) // 运单数据
|
|
|
+// 获取运单发货地运力地图数据
|
|
|
+const getWaybillData = async () => {
|
|
|
+ const res = await tms.queryAllWaybill()
|
|
|
+ if (res.code === 101) {
|
|
|
+ waybillData.value = res.data
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const tableData = ref([]) // 运单数据排行
|
|
|
+// 查看供应商数据排行
|
|
|
+const getSupplierData = async () => {
|
|
|
+ const res = await tms.querySupplierRanking()
|
|
|
+ if (res.code === 101) {
|
|
|
+ console.log(res.data, '数据排行')
|
|
|
+ tableData.value = res.data
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const exceptionRate = ref(0) // 运单号
|
|
|
+// 订单运输异常率
|
|
|
+const getExceptionRate = async () => {
|
|
|
+ const res = await tms.queryExceptionRate()
|
|
|
+ if (res.code === 101) {
|
|
|
+ console.log(res.data, '订单运输异常率')
|
|
|
+ exceptionRate.value = res.data.exceptionWaybillCount / res.data.totalWaybillCount * 100
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getData()
|
|
|
+ getWaybillData()
|
|
|
+ getSupplierData()
|
|
|
+ getExceptionRate()
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.dashboard{
|
|
|
+.dashboard {
|
|
|
padding: 1em;
|
|
|
- .top_card_border{
|
|
|
+ width: 100%;
|
|
|
+ .top_card_border {
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
- justify-content:space-between;
|
|
|
+ justify-content: space-between;
|
|
|
}
|
|
|
- .mid_content{
|
|
|
- margin-top:30px;
|
|
|
- display: flex; justify-content:space-between;
|
|
|
- .let_step{
|
|
|
+ .mid_content {
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ justify-content: space-evenly;
|
|
|
+ .let_step {
|
|
|
// border: 1px solid #000;
|
|
|
- display: flex; justify-content:space-between;
|
|
|
- width:55%; height: calc(35vh);
|
|
|
- flex-wrap:wrap;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ width: 55%;
|
|
|
+ height: calc(35vh);
|
|
|
+ flex-wrap: wrap;
|
|
|
}
|
|
|
- .right_step{
|
|
|
- width: 44%; height: 34vh;
|
|
|
- background-color: #fff;
|
|
|
+ .right_step {
|
|
|
+ text-align: center;
|
|
|
+ width: 25%;
|
|
|
+ padding-top: 30px;
|
|
|
+ padding-left: 10px;
|
|
|
+ .title {
|
|
|
+ font-size: 20px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #000;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- .map_style{
|
|
|
- border: 1px solid #000; margin-top:30px;
|
|
|
- height: calc(100vh*0.7);
|
|
|
+ .map_style {
|
|
|
+ width: 75%;
|
|
|
+ border: 1px solid #309ef3;
|
|
|
+ margin-top: 30px;
|
|
|
+ // height: calc(100vh * 0.7);
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|