更新工作台页面,优化交易数据展示,修复核销订单金额等数据展示错误,并调整相关API接口路径
This commit is contained in:
parent
80813bdab7
commit
19ee1b0087
|
@ -14,3 +14,30 @@ export function apiStoreExtractRemarks(params: any) {
|
|||
export function apiStoreExtractCashs(params: any) {
|
||||
return request.post({ url: '/workbench/delivery', params })
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 门店提现列表
|
||||
export function apiGetBasic(params: any) {
|
||||
return request.get({ url: '/workbench/get_basic', params })
|
||||
}
|
||||
|
||||
// 门店提现列表
|
||||
export function apiGetTrend(params: any) {
|
||||
return request.get({ url: '/workbench/get_trend', params })
|
||||
}
|
||||
|
||||
// 门店提现列表
|
||||
export function apiGetProductRanking(params: any) {
|
||||
return request.get({ url: '/workbench/get_product_ranking', params })
|
||||
}
|
||||
|
||||
|
||||
export function apidelivery(params: any) {
|
||||
return request.get({ url: '/workbench/delivery', params })
|
||||
}
|
||||
|
||||
|
||||
export function apideliveryOrder(params: any) {
|
||||
return request.get({ url: '/workbench/deliveryOrder', params })
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<el-table :data="pager.lists">
|
||||
<el-table-column label="订单号" prop="project_level_text" show-overflow-tooltip />
|
||||
<el-table-column label="用户信息" prop="total_investment" show-overflow-tooltip />
|
||||
<el-table-column label="实际支付" prop="total_investment" show-overflow-tooltip />
|
||||
<el-table-column label="订单号" prop="order_id" show-overflow-tooltip />
|
||||
<el-table-column label="用户信息" prop="nickname" show-overflow-tooltip />
|
||||
<el-table-column label="实际支付" prop="pay_price" show-overflow-tooltip />
|
||||
<el-table-column label="订单类型" prop="total_investment" show-overflow-tooltip />
|
||||
<el-table-column label="支付方式" prop="total_investment" show-overflow-tooltip />
|
||||
<el-table-column label="支付方式" prop="pay_type" show-overflow-tooltip />
|
||||
<el-table-column label="配送员名称" prop="total_investment" show-overflow-tooltip />
|
||||
<el-table-column label="下单时间" prop="total_investment" show-overflow-tooltip />
|
||||
<el-table-column label="下单时间" prop="create_time" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
|
@ -16,12 +16,21 @@
|
|||
<script lang="ts" setup name="manageProjectLists">
|
||||
import { ref, reactive } from "vue"
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { apiGoodsListLists, apiStatus, apiGoodsTypeLists } from '@/api/goodsList'
|
||||
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiGoodsListLists,
|
||||
import { apideliveryOrder } from '@/api/statistics'
|
||||
const props = defineProps({
|
||||
queryParams: {
|
||||
type: Object,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// getLists()
|
||||
|
||||
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apideliveryOrder,
|
||||
params: props.queryParams
|
||||
})
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
|
@ -5,25 +5,66 @@
|
|||
<!-- 业绩统计 -->
|
||||
<template>
|
||||
<el-card>
|
||||
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="时间筛选">
|
||||
<el-date-picker v-model="date" type="daterange" value-format="YYYY-MM-DD" range-separator="-"
|
||||
start-placeholder="开始时间" end-placeholder="结束时间" @change="deteToQuery" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card :key="date">
|
||||
<template #header>
|
||||
配送订单统计
|
||||
</template>
|
||||
<v-charts style="height: 350px" :option="sendOption" :autoresize="true" />
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-card :key="date">
|
||||
<template #header>
|
||||
配送订单统计
|
||||
</template>
|
||||
<sendData></sendData>
|
||||
<sendData :query-params="queryParams" :key="date"></sendData>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive } from "vue"
|
||||
import { ref, reactive, onMounted } from "vue"
|
||||
import vCharts from 'vue-echarts'
|
||||
import sendData from "../components/sendData.vue"
|
||||
import { apidelivery } from '@/api/statistics'
|
||||
|
||||
const date = ref([])
|
||||
const queryParams = reactive({
|
||||
start_time: "",
|
||||
end_time: "",
|
||||
})
|
||||
|
||||
const deteToQuery = () => {
|
||||
queryParams.start_time = date.value[0]
|
||||
queryParams.end_time = date.value[1]
|
||||
initPage()
|
||||
}
|
||||
|
||||
function getFirstAndLastDayOfCurrentMonth() {
|
||||
var today = new Date();
|
||||
var firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
|
||||
var lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
||||
var firstDayFormatted = formatDate(firstDay);
|
||||
var lastDayFormatted = formatDate(lastDay);
|
||||
return { firstDay: firstDayFormatted, lastDay: lastDayFormatted };
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
var year = date.getFullYear();
|
||||
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
var day = date.getDate().toString().padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
||||
date.value[0] = getFirstAndLastDayOfCurrentMonth().firstDay;
|
||||
date.value[1] = getFirstAndLastDayOfCurrentMonth().lastDay;
|
||||
|
||||
|
||||
|
||||
|
@ -53,5 +94,24 @@ const sendOption = reactive({
|
|||
|
||||
})
|
||||
|
||||
const getData = () => {
|
||||
|
||||
apidelivery(queryParams).then(res => {
|
||||
console.log(res)
|
||||
sendOption.xAxis.data = res.statistics.range
|
||||
sendOption.series[0].data = res.statistics.data.order_amount
|
||||
sendOption.series[1].data = res.statistics.data.user_number
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
const initPage = () => {
|
||||
getData()
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
deteToQuery()
|
||||
})
|
||||
</script>
|
|
@ -5,6 +5,7 @@
|
|||
<span class="text-2xl">商品概况</span>
|
||||
<div class="flex items-center text-sm">
|
||||
<span class="mr-4">时间筛选: </span>
|
||||
{{ startEndTime }}
|
||||
<el-date-picker v-model="startEndTime" type="daterange" range-separator="至" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" unlink-panels :shortcuts="shortcuts" />
|
||||
<el-button type="primary" class="ml-4" @click="getData">查询</el-button>
|
||||
|
@ -67,7 +68,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup name="product">
|
||||
// import { apiGetBasic, apiGetTrend, apiGetProductRanking } from '@/api/workbench'
|
||||
import { apiGetBasic, apiGetTrend, apiGetProductRanking } from '@/api/statistics'
|
||||
import moment from 'moment'
|
||||
import vCharts from 'vue-echarts'
|
||||
|
||||
|
@ -231,12 +232,36 @@ const basicList = reactive([
|
|||
}
|
||||
])
|
||||
const startEndTime = ref(['', '']);
|
||||
|
||||
function getFirstAndLastDayOfCurrentMonth() {
|
||||
var today = new Date();
|
||||
var firstDay = new Date(today.getFullYear(), today.getMonth(), 1);
|
||||
var lastDay = new Date(today.getFullYear(), today.getMonth() + 1, 0);
|
||||
var firstDayFormatted = formatDate(firstDay);
|
||||
var lastDayFormatted = formatDate(lastDay);
|
||||
return { firstDay: firstDayFormatted, lastDay: lastDayFormatted };
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
var year = date.getFullYear();
|
||||
var month = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
var day = date.getDate().toString().padStart(2, '0');
|
||||
return `${year}/${month}/${day}`;
|
||||
}
|
||||
|
||||
startEndTime.value[0] = getFirstAndLastDayOfCurrentMonth().firstDay;
|
||||
startEndTime.value[1] = getFirstAndLastDayOfCurrentMonth().lastDay;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 获取数据
|
||||
const getData = () => {
|
||||
let date = '';
|
||||
if (startEndTime.value[0] && startEndTime.value[1]) date = moment(startEndTime.value[0]).format('YYYY/MM/DD') + '-' + moment(startEndTime.value[1]).format('YYYY/MM/DD');
|
||||
|
||||
return
|
||||
apiGetBasic({
|
||||
date: date
|
||||
}).then(res => {
|
||||
|
@ -273,7 +298,6 @@ const getList = () => {
|
|||
let date = '';
|
||||
if (startEndTime.value[0] && startEndTime.value[1]) date = moment(startEndTime.value[0]).format('YYYY/MM/DD') + '-' + moment(startEndTime.value[1]).format('YYYY/MM/DD');
|
||||
|
||||
return
|
||||
apiGetProductRanking({
|
||||
date: date
|
||||
}).then(res => {
|
||||
|
|
Loading…
Reference in New Issue