Commit 03e074a4 authored by Damon's avatar Damon

feat: 订单数据API对接

parent 11810bbd
...@@ -216,6 +216,9 @@ let orderApiFun = function(vm){ ...@@ -216,6 +216,9 @@ let orderApiFun = function(vm){
// 工单搜索联想 // 工单搜索联想
let association = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/association', params); let association = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/association', params);
let getWorkerData = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/' + vm.vuex_token + `/getWorkerData`, params)
const orderApi = { const orderApi = {
listByRecommendOrder, listByRecommendOrder,
listOrderCount, listOrderCount,
...@@ -273,7 +276,8 @@ let orderApiFun = function(vm){ ...@@ -273,7 +276,8 @@ let orderApiFun = function(vm){
receiveParts, receiveParts,
cancelParts, cancelParts,
workerDealWithError, workerDealWithError,
association association,
getWorkerData
} }
return orderApi return orderApi
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="progress" > <view class="progress" >
<text :style="{background:content.background,width:content.width + '%',height:progressWidth+'rpx'}"></text> <text :style="{background:content.background,width:content.width + '%',height:progressWidth+'rpx'}"></text>
</view> </view>
<view class="num">{{content.num}}</view> <view class="num">{{content.num + '%'}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
this.maxNumber = Math.max.apply(Math,this.copyContent.map(item => { return item.num })); this.maxNumber = Math.max.apply(Math,this.copyContent.map(item => { return item.num }));
} }
this.copyContent.map((item,index) =>{ this.copyContent.map((item,index) =>{
item.width = this.computeWidth(this.maxNumber,item.num); item.width = this.computeWidth(100,item.num);
}); });
} }
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<u-navbar <u-navbar
back-icon-color="#fff" back-icon-color="#fff"
background="#FFFFFF" background="#FFFFFF"
title="用户画像" :title="title"
titleColor="#fff" titleColor="#fff"
:border-bottom="false" :border-bottom="false"
title-bold title-bold
...@@ -47,19 +47,19 @@ ...@@ -47,19 +47,19 @@
<view class="top_desc"> <view class="top_desc">
<view class="text-gray">综合评分</view> <view class="text-gray">综合评分</view>
<view class="remaining">86</view> <view class="remaining">{{ info.score }}</view>
<view class="u-flex head_block"> <view class="u-flex head_block">
<view> <view>
<text class="text-gray">总派单量</text> <text class="text-gray">总派单量</text>
<text class="income">1008</text> <text class="income">{{ info.totalAllocateCount }}</text>
</view> </view>
<view> <view>
<text class="text-gray">总完工量</text> <text class="text-gray">总完工量</text>
<text class="income">432</text> <text class="income">{{ info.totalFinishCount }}</text>
</view> </view>
<view> <view>
<text class="text-gray">未完工工单量</text> <text class="text-gray">未完工工单量</text>
<text class="income">533</text> <text class="income">{{ info.totalTodoCont }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
}, },
data() { data() {
return { return {
title: '用户画像', //标题 title: '订单数据', //标题
showDataTime: 'today', //选中的时间 showDataTime: 'today', //选中的时间
tabCur: 0, //标签头下标 tabCur: 0, //标签头下标
topBar: 17, //导航高 topBar: 17, //导航高
...@@ -96,107 +96,164 @@ export default { ...@@ -96,107 +96,164 @@ export default {
{ {
series: [ series: [
{ {
color: '#fff', name: '综合评分',
data: 0.224, value: '0',
precent: '22.4%',
index: 0,
legendShape: 'circle',
name: '总派单量',
pointShape: 'circle',
show: true,
type: 'arcbar',
value: '1332',
backgroundColor: '#00AEF9',
}, },
], ],
}, },
{ {
series: [ series: [
{ {
color: '#fff', name: '总派单量',
data: 0.3717, value: '0',
precent: '37.17%',
index: 0,
legendShape: 'circle',
name: '总完工量',
pointShape: 'circle',
show: true,
type: '133',
value: '1096',
backgroundColor: '#F55676',
}, },
], ],
}, },
{ {
series: [ series: [
{ {
color: '#fff', name: '总完工量',
data: 0.0017, value: '0',
precent: '0.17%',
index: 0,
legendShape: 'circle',
name: '未完工工单量',
pointShape: 'circle',
show: true,
type: 'arcbar',
value: '765',
backgroundColor: '#FAB215',
}, },
], ],
}, },
{ {
series: [ series: [
{ {
color: '#fff', name: '未完工工单量',
data: 0.6321, value: '0',
precent: '63.21%',
index: 0,
legendShape: 'circle',
name: '综合评分',
pointShape: 'circle',
show: true,
type: 'arcbar',
value: '65',
backgroundColor: '#2EC693',
}, },
], ],
}, },
], ],
RankData: [ RankData: [
{ {
"name":"一次通过率", "name":"接单及时率",
"num":500, "num":0,
"width":"", "width":"",
"background":"#FFBE68" "background":"#BF8DFC"
}, },
{ {
"name":"预约及时率", "name":"预约及时率",
"num":300, "num":0,
"width":"", "width":"",
"background":"#0FEBE1" "background":"#0FEBE1"
}, },
{ {
"name":"接单及时率", "name":"上门及时率",
"num":455, "num":0,
"width":"", "width":"",
"background":"#BF8DFC" "background":"#FF859C"
}, },
{ {
"name":"上门及时率", "name":"一次通过率",
"num":601, "num":0,
"width":"", "width":"",
"background":"#FF859C" "background":"#FFBE68"
}
],
info: {
totalAllocateCount: 0,
totalFinishCount: 0,
totalTodoCont: 0,
appRate: 0,
auditRate: 0,
checkRate: 0,
takeRate: 0,
score: 0
} }
]
} }
}, },
computed: {}, computed: {},
methods: { methods: {
updateRanking(nVal){ updateRanking(nVal){
this.RankData = nVal this.RankData = nVal
},
init() {
this.$u.api.getWorkerData().then(res => {
const data = res.data || {}
if (data) {
const score = (20 * data.takeRate) + (20 * data.auditRate) + (20 * data.checkRate) + (20 * data.takeRate) + (20 * (data.totalFinishCount / data.totalAllocateCount))
const info = {
totalAllocateCount: data.totalAllocateCount,
totalFinishCount: data.totalFinishCount,
totalTodoCont: data.totalTodoCont,
appRate: parseInt(data.appRate * 100),
auditRate: parseInt(data.auditRate * 100),
checkRate: parseInt(data.checkRate * 100),
takeRate: parseInt(data.takeRate * 100),
score: parseInt(score) || 0
}
// 基础数据
this.CircleData = [
{
series: [
{
name: '综合评分',
value: info.score,
},
],
},
{
series: [
{
name: '总派单量',
value: info.totalAllocateCount,
},
],
},
{
series: [
{
name: '总完工量',
value: info.totalFinishCount,
},
],
},
{
series: [
{
name: '未完工工单量',
value: info. totalTodoCont,
},
],
},
]
// 服务时效
this.RankData = [
{
"name":"接单及时率",
"num": info.takeRate,
"width":"",
"background":"#BF8DFC"
},
{
"name":"预约及时率",
"num": info.appRate,
"width":"",
"background":"#0FEBE1"
},
{
"name":"上门及时率",
"num": info.checkRate,
"width":"",
"background":"#FF859C"
},
{
"name":"一次通过率",
"num": info.auditRate,
"width":"",
"background":"#FFBE68"
}
]
this.info = info
}
})
} }
}, },
onLoad() {}, onLoad() {
this.init()
},
} }
</script> </script>
...@@ -287,13 +344,13 @@ export default { ...@@ -287,13 +344,13 @@ export default {
background-color: #0FC3FF; background-color: #0FC3FF;
} }
.block_1{ .block_1{
background-color: #FF6B8B; background-color: #3BDCAA;
} }
.block_2{ .block_2{
background-color: #FFCB1D; background-color: #FFCB1D;
} }
.block_3{ .block_3{
background-color: #3BDCAA; background-color: #FF6B8B;
} }
.planet { .planet {
width: 60px; width: 60px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment