trade:微调 order 列表界面

This commit is contained in:
YunaiV 2023-10-01 23:44:38 +08:00
parent a5808c9e9c
commit 588ce1c9ae
8 changed files with 28 additions and 27 deletions

View File

@ -17,6 +17,6 @@ export interface WalletVO {
}
/** 查询用户钱包详情 */
export const getUserWallet = async (params: PayWalletUserReqVO) => {
return await request.get<WalletVO>({ url: `/pay/wallet/user-wallet`, params })
export const getWallet = async (params: PayWalletUserReqVO) => {
return await request.get<WalletVO>({ url: `/pay/wallet/get`, params })
}

View File

@ -392,23 +392,23 @@ const remainingRouter: AppRouteRecordRaw[] = [
]
},
{
path: '/trade', // 交易中心
path: '/mall/trade', // 交易中心
component: Layout,
meta: {
hidden: true
},
children: [
{
path: 'order/detail/:orderId(\\d+)',
path: 'order/detail/:id(\\d+)',
component: () => import('@/views/mall/trade/order/detail/index.vue'),
name: 'TradeOrderDetail',
meta: { title: '订单详情', icon: '', activeMenu: '/trade/trade/order' }
meta: { title: '订单详情', icon: 'ep:view', activeMenu: '/mall/trade/order' }
},
{
path: 'after-sale/detail/:orderId(\\d+)',
component: () => import('@/views/mall/trade/afterSale/detail/index.vue'),
name: 'TradeAfterSaleDetail',
meta: { title: '退款详情', icon: '', activeMenu: '/trade/trade/after-sale' }
meta: { title: '退款详情', icon: 'ep:view', activeMenu: '/mall/trade/after-sale' }
}
]
},

View File

@ -75,11 +75,11 @@
</template>
</el-table-column>
<el-table-column label="商品原价" prop="price" width="150">
<template #default="{ row }">{{ floatToFixed2(row.price) }}</template>
<template #default="{ row }">{{ fenToYuan(row.price) }}</template>
</el-table-column>
<el-table-column label="数量" prop="count" width="100" />
<el-table-column label="合计" prop="payPrice" width="150">
<template #default="{ row }">{{ floatToFixed2(row.payPrice) }}</template>
<template #default="{ row }">{{ fenToYuan(row.payPrice) }}</template>
</el-table-column>
<el-table-column label="售后状态" prop="afterSaleStatus" width="120">
<template #default="{ row }">
@ -97,32 +97,32 @@
</el-descriptions>
<el-descriptions :column="6">
<el-descriptions-item label="商品总额: ">
{{ floatToFixed2(formData.totalPrice!) }}
{{ fenToYuan(formData.totalPrice!) }}
</el-descriptions-item>
<el-descriptions-item label="运费金额: ">
{{ floatToFixed2(formData.deliveryPrice!) }}
{{ fenToYuan(formData.deliveryPrice!) }}
</el-descriptions-item>
<el-descriptions-item label="订单调价: ">
{{ floatToFixed2(formData.adjustPrice!) }}
{{ fenToYuan(formData.adjustPrice!) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label><span style="color: red">商品优惠: </span></template>
{{ floatToFixed2(formData.couponPrice!) }}
{{ fenToYuan(formData.couponPrice!) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label><span style="color: red">订单优惠: </span></template>
{{ floatToFixed2(formData.discountPrice!) }}
{{ fenToYuan(formData.discountPrice!) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label><span style="color: red">积分抵扣: </span></template>
{{ floatToFixed2(formData.pointPrice!) }}
{{ fenToYuan(formData.pointPrice!) }}
</el-descriptions-item>
<el-descriptions-item v-for="item in 5" :key="item" label-class-name="no-colon" />
<!-- 占位 -->
<el-descriptions-item label="应付金额: ">
{{ floatToFixed2(formData.payPrice!) }}
{{ fenToYuan(formData.payPrice!) }}
</el-descriptions-item>
</el-descriptions>
@ -187,7 +187,7 @@
</template>
<script lang="ts" setup>
import * as TradeOrderApi from '@/api/mall/trade/order'
import { floatToFixed2 } from '@/utils'
import { fenToYuan } from '@/utils'
import { formatDate } from '@/utils/formatTime'
import { DICT_TYPE, getDictLabel, getDictObj } from '@/utils/dict'
import OrderUpdateRemarkForm from '@/views/mall/trade/order/form/OrderUpdateRemarkForm.vue'
@ -243,11 +243,11 @@ const updatePrice = () => {
/** 获得详情 */
const { params } = useRoute() //
const getDetail = async () => {
const id = params.orderId as unknown as number
const id = params.id as unknown as number
if (id) {
const res = (await TradeOrderApi.getOrder(id)) as TradeOrderApi.OrderVO
//
if (res === null) {
if (!res) {
message.error('交易订单不存在')
close()
}

View File

@ -466,7 +466,7 @@ const imagePreview = (imgUrl: string) => {
/** 查看订单详情 */
const openDetail = (id: number) => {
push({ name: 'TradeOrderDetail', params: { orderId: id } })
push({ name: 'TradeOrderDetail', params: { id } })
}
/** 操作分发 */

View File

@ -28,19 +28,19 @@
<template #label>
<descriptions-item-label label=" 当前余额 " icon="svg-icon:member_balance" />
</template>
{{ wallet.balance || 0 }}
{{ fenToYuan(wallet.balance || 0) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<descriptions-item-label label=" 支出金额 " icon="svg-icon:member_expenditure_balance" />
</template>
{{ wallet.totalExpense || 0 }}
{{ fenToYuan(wallet.totalExpense || 0) }}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<descriptions-item-label label=" 充值金额 " icon="svg-icon:member_recharge_balance" />
</template>
{{ wallet.totalRecharge || 0 }}
{{ fenToYuan(wallet.totalRecharge || 0) }}
</el-descriptions-item>
</el-descriptions>
</template>
@ -49,6 +49,7 @@ import { DescriptionsItemLabel } from '@/components/Descriptions'
import * as UserApi from '@/api/member/user'
import * as WalletApi from '@/api/pay/wallet'
import { UserTypeEnum } from '@/utils/constants'
import { fenToYuan } from '@/utils'
const props = defineProps<{ user: UserApi.UserVO }>() //
const WALLET_INIT_DATA = {
@ -65,7 +66,7 @@ const getUserWallet = async () => {
return
}
const params = { userId: props.user.id, userType: UserTypeEnum.MEMBER }
wallet.value = (await WalletApi.getUserWallet(params)) || WALLET_INIT_DATA
wallet.value = (await WalletApi.getWallet(params)) || WALLET_INIT_DATA
}
/** 监听用户编号变化 */

View File

@ -182,9 +182,9 @@
<!-- 表单弹窗添加/修改 -->
<UserForm ref="formRef" @success="getList" />
<!-- 修改用户等级弹窗 -->
<UpdateLevelForm ref="updateLevelFormRef" @success="getList" />
<UserLevelUpdateForm ref="updateLevelFormRef" @success="getList" />
<!-- 修改用户积分弹窗 -->
<UpdatePointForm ref="updatePointFormRef" @success="getList" />
<UserPointUpdateForm ref="updatePointFormRef" @success="getList" />
<!-- 发送优惠券弹窗 -->
<CouponSendForm ref="couponSendFormRef" />
</template>
@ -196,8 +196,8 @@ import UserForm from './UserForm.vue'
import MemberTagSelect from '@/views/member/tag/components/MemberTagSelect.vue'
import MemberLevelSelect from '@/views/member/level/components/MemberLevelSelect.vue'
import MemberGroupSelect from '@/views/member/group/components/MemberGroupSelect.vue'
import UpdateLevelForm from './UpdateLevelForm.vue'
import UpdatePointForm from './UpdatePointForm.vue'
import UserLevelUpdateForm from './UserLevelUpdateForm.vue'
import UserPointUpdateForm from './UserPointUpdateForm.vue'
import CouponSendForm from '@/views/mall/promotion/coupon/components/CouponSendForm.vue'
import { checkPermi } from '@/utils/permission'