|
@@ -50,7 +50,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { appFindYourShipment } from '../../api/index'
|
|
|
+import { appFindYourShipment, appStatistics } from '../../api/index'
|
|
|
import {
|
|
|
Toast,
|
|
|
Dialog
|
|
@@ -61,6 +61,8 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
active: 0,
|
|
|
+ deliveryList: [],//派件
|
|
|
+ collectList: [],//揽收
|
|
|
value: "",
|
|
|
index: 1,
|
|
|
total: 0,
|
|
@@ -85,7 +87,37 @@ export default {
|
|
|
this.getData()
|
|
|
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ async mounted() {
|
|
|
+ // 数据图表
|
|
|
+ const resValue = await appStatistics({ deliveryPeopleId: localStorage.getItem('courierId') })
|
|
|
+ const { dispatchStatistics = [], pickupStatistics = [] } = resValue.data
|
|
|
+ let signSuccessfully = 0; // 签收成功
|
|
|
+ let outOfDelivery = 0; // 派送中
|
|
|
+ let deliveryFailure = 0; // 派送失败
|
|
|
+ dispatchStatistics.forEach(({ expressStatus, number }) => {
|
|
|
+ if (expressStatus == "1") {
|
|
|
+ outOfDelivery = number
|
|
|
+ } else if (expressStatus == "2") {
|
|
|
+ signSuccessfully = number
|
|
|
+ } else if (expressStatus == "4") {
|
|
|
+ deliveryFailure = number
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ let waiteCollecte = 0 //待揽收
|
|
|
+ let noCollecte = 0 //未揽收
|
|
|
+ let collecteSuccess = 0 //揽收成功
|
|
|
+ pickupStatistics.forEach(({ express_status, number }) => {
|
|
|
+ if (express_status == "1") {
|
|
|
+ waiteCollecte = number
|
|
|
+ noCollecte = number
|
|
|
+ } else if (express_status == "2") {
|
|
|
+ collecteSuccess = number
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log(resValue, 'resValue')
|
|
|
+
|
|
|
// 页面加载完成唤醒微信扫一扫
|
|
|
//本地 注释 服务器 放开
|
|
|
this.wxScanCode();
|
|
@@ -93,6 +125,7 @@ export default {
|
|
|
let myChart = this.$echarts.init(document.getElementById('myChart1'))
|
|
|
var option = {
|
|
|
tooltip: {
|
|
|
+ show: false,
|
|
|
trigger: 'item'
|
|
|
},
|
|
|
legend: {
|
|
@@ -117,7 +150,7 @@ export default {
|
|
|
show: true,
|
|
|
position: 'center',
|
|
|
color: '#4c4a4a',
|
|
|
- formatter: '{active|' + '今日累计收件' + '}' + '\n\r' + '{total|' + this.total +
|
|
|
+ formatter: '{active|' + '今日累计收件' + '}' + '\n\r' + '{total|' + signSuccessfully +
|
|
|
'}',
|
|
|
rich: {
|
|
|
total: {
|
|
@@ -140,7 +173,18 @@ export default {
|
|
|
labelLine: {
|
|
|
show: false
|
|
|
},
|
|
|
- data: this.data
|
|
|
+ data: [{
|
|
|
+ value: signSuccessfully,
|
|
|
+ name: '签收成功'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: outOfDelivery,
|
|
|
+ name: '派送中'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: deliveryFailure,
|
|
|
+ name: '派送失败'
|
|
|
+ },]
|
|
|
}]
|
|
|
}
|
|
|
myChart.setOption(option)
|
|
@@ -172,7 +216,7 @@ export default {
|
|
|
show: true,
|
|
|
position: 'center',
|
|
|
color: '#4c4a4a',
|
|
|
- formatter: '{active|' + '今日累计下单' + '}' + '\n\r' + '{total|' + this.total +
|
|
|
+ formatter: '{active|' + '今日累计下单' + '}' + '\n\r' + '{total|' + collecteSuccess +
|
|
|
'}',
|
|
|
rich: {
|
|
|
total: {
|
|
@@ -195,17 +239,17 @@ export default {
|
|
|
labelLine: {
|
|
|
show: false
|
|
|
},
|
|
|
- data: this.data = [{
|
|
|
- value: this.mailMap.succesLsNum,
|
|
|
+ data: [{
|
|
|
+ value: collecteSuccess,
|
|
|
name: '揽收成功'
|
|
|
},
|
|
|
{
|
|
|
- value: this.mailMap.waitLsNum,
|
|
|
+ value: waiteCollecte,
|
|
|
name: '待揽收'
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- value: this.mailMap.problemLsNum,
|
|
|
+ value: noCollecte,
|
|
|
name: '未揽收'
|
|
|
},
|
|
|
]
|