Commit a3720460 authored by Damon's avatar Damon

feat: 针对某个订单的服务质量数据对接

parent 218ff2ac
......@@ -218,6 +218,7 @@ 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)
let getOrderTime = async (params = {}) => await vm.$u.get('/wxh-worker-rest/rest/order/revision/' + vm.vuex_token + `/getOrderTime/${params.id}`, params)
const orderApi = {
listByRecommendOrder,
......@@ -277,7 +278,8 @@ let orderApiFun = function(vm){
cancelParts,
workerDealWithError,
association,
getWorkerData
getWorkerData,
getOrderTime
}
return orderApi
}
......
......@@ -20,40 +20,25 @@
></Detail>
</view>
<view class="view-block u-flex u-row-between">
<view class="view-block u-flex u-row-between" v-for="(item, index) in list" :key="index">
<view class="u-flex-col l">
<view>
<u-image width="80rpx" height="80rpx" :src="imageUrl('quality-icon1.png')"></u-image>
<u-image width="60rpx" height="60rpx" :src="imageUrl(`quality-icon${index + 1}.png`)"></u-image>
</view>
<view class="name">系统接单时间</view>
<view class="value">2021.04.21 12:00:00</view>
<view class="name">实际接单时间</view>
<view class="value">2021.04.21 10:00:00</view>
<view class="result">
<text class="blue">接单准时</text>
<view class="name">预计{{ item.name }}时间</view>
<view class="value">{{ item.startTime }}</view>
<view class="name">实际{{ item.name }}时间</view>
<view class="value">{{ item.endTime }}</view>
<view class="result" v-if="item.flag === 'N'">
<text class="blue">{{ item.name }}准时</text>
</view>
</view>
<view class="r">
<u-image width="200rpx" height="200rpx" :src="imageUrl('quality-pass.png')"></u-image>
</view>
</view>
<view class="view-block u-flex u-row-between">
<view class="u-flex-col l">
<view>
<u-image width="80rpx" height="80rpx" :src="imageUrl('quality-icon2.png')"></u-image>
</view>
<view class="name">预约上门时间</view>
<view class="value">2021.04.21 12:00:00</view>
<view class="name">实际接单时间</view>
<view class="value">2021.04.21 10:00:00</view>
<view class="result">
<text>上门超时时长</text>
<text class="red">16小时30分钟</text>
<view class="result" v-if="item.flag === 'Y'">
<text>{{ item.name }}超时时长</text>
<text class="red">{{ item.outTime }}小时</text>
</view>
</view>
<view class="r">
<u-image width="200rpx" height="200rpx" :src="imageUrl('quality-reject.png')"></u-image>
<u-image width="200rpx" height="200rpx" :src="imageUrl(`quality-${item.flag === 'N' ? 'pass' : 'reject'}.png`)"></u-image>
</view>
</view>
</view>
......@@ -62,7 +47,12 @@
<script>
import Detail from '@/components/order/detail.vue'
const typeName = {
'take': '接单',
'app': '预约',
'checkTime': '上门',
'finish': '完工'
}
export default {
components: {
Detail
......@@ -74,8 +64,9 @@ export default {
background: {
backgroundColor: 'none',
},
orderId: 11918973, // 测试数据
order: {}
orderId: 11919156, // 测试数据
order: {},
list: []
}
},
computed: {
......@@ -87,14 +78,15 @@ export default {
}
this.loadOrderDetail()
this.getOrderTime()
},
methods: {
imageUrl(name) {
return `${process.uniEnv.qn_base_url}${name}`
},
goBack() {
uni.switchTab({
url:'pages/index/order'
uni.reLaunch({
url: '/pages/index/order?type=audit',
})
},
loadOrderDetail() {
......@@ -106,6 +98,19 @@ export default {
console.log(res.message, '获取订单详情失败!')
}
})
},
getOrderTime() {
this.$u.api.getOrderTime({id: this.orderId}).then(res => {
const data = res.data
if (data && data.length > 0) {
this.list = data.map(v => {
v.name = typeName[v.type]
v.startTime = this.$u.timeFormat(v.startTime, 'yyyy-mm-dd hh:MM')
v.endTime = this.$u.timeFormat(v.endTime, 'yyyy-mm-dd hh:MM')
return v
})
}
})
}
},
}
......@@ -154,12 +159,12 @@ export default {
.l {
.name {
color: #999;
font-size:40rpx;
font-size:36rpx;
padding-top: 30rpx;
}
.value {
color: #6A7D9E;
font-size:32rpx;
font-size:30rpx;
padding-top: 10rpx;
}
.result {
......
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