工作台订单统计
This commit is contained in:
parent
73a55d81ff
commit
771ca70c94
|
|
@ -49,6 +49,12 @@ class Api {
|
|||
let url = `${config.host}/worker/order_dispatch/workbenchOrderList`;
|
||||
return fetch.request('GET', url, data, true)
|
||||
}
|
||||
|
||||
// 统计工作台订单
|
||||
static countWorkbenchOrder() {
|
||||
let url = `${config.host}/worker/order_dispatch/countWorkbenchOrder`;
|
||||
return fetch.request('GET', url, {}, true)
|
||||
}
|
||||
}
|
||||
|
||||
export default Api
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<view class="ctr">
|
||||
<view class="ctr" v-if="data.list.length > 0 && countOrder !== undefined">
|
||||
<view class="fixed-top">
|
||||
<me-top title="工作台"></me-top>
|
||||
<view class="filter flex-sb line-after">
|
||||
<view v-for="(item, type) in filterType" :key="type" class="filter-item flex-c" @click="filter(type)">
|
||||
<view :class="['title', 'flex-c', data.type == type ? 'title-active' : '']">{{item.name}}({{item.num}})</view>
|
||||
<view :class="['title', 'flex-c', data.type == type ? 'title-active' : '']">{{item.name}}({{countOrder[type]}})</view>
|
||||
<view class="select-style" v-if="data.type == type"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -75,7 +75,6 @@
|
|||
import {onLoad, onShow} from '@dcloudio/uni-app'
|
||||
import {ref, reactive, computed, watch, inject} from 'vue'
|
||||
import MeIcon from "../../components/me-icon/me-icon";
|
||||
import MeButton from "../../components/me-button/me-button";
|
||||
import MeEmptySpace from "../../components/me-empty-space/me-empty-space.vue";
|
||||
import MeTop from "../../components/me-top/me-top.vue";
|
||||
import api from "../../api/api";
|
||||
|
|
@ -115,6 +114,7 @@ const init = () => {
|
|||
userLocation.lat = res.latitude
|
||||
data.page = 1
|
||||
getList()
|
||||
countWorkbenchOrder()
|
||||
},
|
||||
fail(err) {
|
||||
uni.showToast({
|
||||
|
|
@ -125,6 +125,13 @@ const init = () => {
|
|||
});
|
||||
}
|
||||
|
||||
const countOrder = ref({})
|
||||
const countWorkbenchOrder = () => {
|
||||
api.countWorkbenchOrder().then(res => {
|
||||
countOrder.value = res
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
const data = reactive({
|
||||
type: 'ongoing',
|
||||
page: 1,
|
||||
|
|
@ -158,22 +165,18 @@ const listMarginTop = computed(() => {
|
|||
const filterType = reactive({
|
||||
'ongoing': {
|
||||
name: '进行中',
|
||||
num: 2,
|
||||
},
|
||||
'today': {
|
||||
id: 2,
|
||||
name: '今日',
|
||||
num: 2,
|
||||
},
|
||||
'tomorrow': {
|
||||
id: 3,
|
||||
name: '明日',
|
||||
num: 0,
|
||||
},
|
||||
'all': {
|
||||
id: 4,
|
||||
name: '全部',
|
||||
num: 724,
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user