Compare commits

..

No commits in common. "d6631405705c8da3a4f1bb67110a1d781731db61" and "d81c6c1e3b788465eeb9c1d8d16978849f4218b6" have entirely different histories.

4 changed files with 35 additions and 75 deletions

View File

@ -2,7 +2,7 @@
import request from '@/utils/index' import request from '@/utils/index'
// 账单列表 // 账单列表
export const orderList = (params:any) => request.get('/v1/order/pay_list',{params}) export const orderList = () => request.get('/v1/order/pay_list')
// 我的订单 // 我的订单
export const useList = (params:any) => request.get('/v1/order/use_list',{params}) export const useList = () => request.get('/v1/order/use_list')

View File

@ -22,25 +22,17 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-table :dataSource="listData" :columns="columns" bordered :pagination="paginationState" @change="onTableChange">
<template #bodyCell="{ column, record }"> <a-table :dataSource="listData" :columns="columns" bordered :pagination="paginationState" @change="onTableChange"/>
<template v-if="column.key === 'created_at'">
<div>
{{ record.created_at ? dayjs(record.created_at).format('YYYY-MM-DD HH:mm') : '-' }}
</div>
</template>
</template>
</a-table>
</a-col> </a-col>
</a-row> </a-row>
</template> </template>
<script lang = "ts" setup> <script setup>
import { ref,onBeforeMount } from 'vue' import { ref,onBeforeMount } from 'vue'
import { usePagination } from '@/hooks' import { usePagination } from '@/hooks'
import { orderList } from '@/apis/admin'
import dayjs from 'dayjs'
// const listData=ref([ {title:1}]) // const listData=ref([ {title:1}])
// const paginationState=ref({ // const paginationState=ref({
// total: 0, // total: 0,
@ -51,29 +43,21 @@ import dayjs from 'dayjs'
// }) // })
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination() const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const columns = ref([ const columns = ref([
{ title: '日期', dataIndex: 'created_at', key: 'created_at' }, { title: '日期', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '交易类型', dataIndex: 'status', key: 'status' }, { title: '交易类型', dataIndex: 'transactionTime', key: 'transactionTime' },
{ title: '交易金额', dataIndex: 'amount', key: 'amount' }, { title: '交易金额', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '优惠金额', dataIndex: 'dis_count_amount', key: 'dis_count_amount' }, { title: '优惠金额', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '余额支付', dataIndex: 'real_amount', key: 'real_amount' }, { title: '余额支付', dataIndex: 'flowNum', key: 'flowNum' },
// { title: '', dataIndex: 'flowNum', key: 'flowNum' }, { title: '代金卷抵扣', dataIndex: 'flowNum', key: 'flowNum' },
]) ])
onBeforeMount(()=>{ onBeforeMount(()=>{
getPageList() getPageList()
}) })
const getPageList = async()=>{ const getPageList=()=>{
try { listData.value=[
const { pageSize, current } = paginationState {flowNum:1}
const res: any = await orderList({ pageSize: pageSize, pageNum: current }); ]
listData.value = res.list;
paginationState.total = res.count;
console.log('支付列表:', res);
// advantageList.value = list;
} catch (error: any) {
console.error('产品优势请求失败:', error);
}
} }
/** /**
* 分页 * 分页

View File

@ -4,9 +4,9 @@
<a-tab-pane key="1" tab="按日"> <a-tab-pane key="1" tab="按日">
<day-detail></day-detail> <day-detail></day-detail>
</a-tab-pane> </a-tab-pane>
<!-- <a-tab-pane key="2" tab="明细"> <a-tab-pane key="2" tab="明细">
<flowDetail /> <flowDetail />
</a-tab-pane> --> </a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>

View File

@ -34,31 +34,16 @@
<a-col :span="24"> <a-col :span="24">
<a-card> <a-card>
<a-table :dataSource="listData" :columns="columns" bordered :pagination="paginationState" <a-table :dataSource="listData" :columns="columns" bordered :pagination="paginationState"
@change="onTableChange"> @change="onTableChange" />
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'created_at'">
<div>
{{ record.created_at ? dayjs(record.created_at).format('YYYY-MM-DD HH:mm') : '-' }}
</div>
</template>
<template v-if="column.key === 'billing_end'">
<div>
{{ dayjs(record.billing_start).format('YYYY-MM-DD HH:mm') +"~" +dayjs(record.billing_end).format('YYYY-MM-DD HH:mm') }}
</div>
</template>
</template>
</a-table>
</a-card> </a-card>
</a-col> </a-col>
</a-row> </a-row>
</template> </template>
<script setup lang="ts"> <script setup>
import { ref, onBeforeMount } from 'vue' import { ref, onBeforeMount } from 'vue'
import { usePagination } from '@/hooks' import { usePagination } from '@/hooks'
import { useList } from '@/apis/admin'
import dayjs from 'dayjs'
// const listData=ref([ {title:1}]) // const listData=ref([ {title:1}])
// const paginationState=ref({ // const paginationState=ref({
// total: 0, // total: 0,
@ -67,7 +52,7 @@ import dayjs from 'dayjs'
// showTotal: (total) => ` ${total} `, // showTotal: (total) => ` ${total} `,
// pageSizeOptions: ['10', '20', '30', '40'], // pageSizeOptions: ['10', '20', '30', '40'],
// }) // })
const { listData, paginationState, resetPagination, searchFormData } = usePagination() const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const columns = ref([ const columns = ref([
// { title: '', dataIndex: 'flowNum', key: 'flowNum' }, // { title: '', dataIndex: 'flowNum', key: 'flowNum' },
// { title: '', dataIndex: 'transactionTime', key: 'transactionTime' }, // { title: '', dataIndex: 'transactionTime', key: 'transactionTime' },
@ -77,34 +62,25 @@ const columns = ref([
// { title: '', dataIndex: 'flowNum', key: 'flowNum' }, // { title: '', dataIndex: 'flowNum', key: 'flowNum' },
// { title: '', dataIndex: 'flowNum', key: 'flowNum' }, // { title: '', dataIndex: 'flowNum', key: 'flowNum' },
// { title: '', dataIndex: 'flowNum', key: 'flowNum' }, // { title: '', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '流水号', dataIndex: 'serial_number', key: 'serial_number' }, { title: '流水号', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '交易时间', dataIndex: 'created_at', key: 'created_at' }, { title: '交易时间', dataIndex: 'transactionTime', key: 'transactionTime' },
{ title: '主机ID', dataIndex: 'host_id', key: 'host_id' }, { title: '主机ID', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '实例ID', dataIndex: 'host_case_id', key: 'host_case_id' }, { title: '实例ID', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '算力型号', dataIndex: 'computing_power_model', key: 'computing_power_model' }, { title: '算力型号', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '算力数量', dataIndex: 'gpu_count', key: 'gpu_count' }, { title: '算力数量', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '计费时间范围', dataIndex: 'billing_end', key: 'billing_end' }, { title: '计费时间范围', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '计费时长', dataIndex: 'bill_time', key: 'bill_time' }, { title: '计费时长', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '单价', dataIndex: 'price', key: 'price' }, { title: '单价', dataIndex: 'flowNum', key: 'flowNum' },
{ title: '交易金额', dataIndex: 'real_amount', key: 'real_amount' }, { title: '交易金额', dataIndex: 'flowNum', key: 'flowNum' },
]) ])
onBeforeMount(() => { onBeforeMount(() => {
getPageList() getPageList()
}) })
const getPageList = () => {
const getPageList = async () => { listData.value = [
try { { flowNum: 1 }
const { pageSize, current } = paginationState ]
const res: any = await useList({ pageSize: pageSize, pageNum: current });
listData.value = res.list;
paginationState.total = res.count;
console.log('订单列表:', res);
// advantageList.value = list;
} catch (error: any) {
console.error('产品优势请求失败:', error);
}
} }
/** /**
* 分页 * 分页