Commit 03e074a4 authored by Damon's avatar Damon

feat: 订单数据API对接

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