Skip to content

Commit e3b9a15

Browse files
YunaiVgitee-org
authored andcommitted
!239 分销员表格佣金字段格式化
Merge pull request !239 from 疯狂的世界/brokerage
2 parents 3c315cf + dbb87e3 commit e3b9a15

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

src/utils/formatter.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { fenToYuan } from '@/utils'
2+
import { TableColumnCtx } from 'element-plus'
3+
4+
// 格式化金额【分转元】
5+
export const fenToYuanFormat = (
6+
row: any,
7+
column: TableColumnCtx<any>,
8+
cellValue: any,
9+
index: number
10+
) => {
11+
return `¥${fenToYuan(cellValue)}`
12+
}

src/views/mall/trade/brokerage/user/index.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,29 @@
7373
align="center"
7474
prop="brokerageOrderPrice"
7575
min-width="110px"
76+
:formatter="fenToYuanFormat"
77+
/>
78+
<el-table-column
79+
label="已提现金额"
80+
align="center"
81+
prop="withdrawPrice"
82+
min-width="100px"
83+
:formatter="fenToYuanFormat"
7684
/>
77-
<el-table-column label="已提现金额" align="center" prop="withdrawPrice" min-width="100px" />
7885
<el-table-column label="已提现次数" align="center" prop="withdrawCount" min-width="100px" />
79-
<el-table-column label="未提现金额" align="center" prop="price" min-width="100px" />
86+
<el-table-column
87+
label="未提现金额"
88+
align="center"
89+
prop="price"
90+
min-width="100px"
91+
:formatter="fenToYuanFormat"
92+
/>
8093
<el-table-column
8194
label="冻结中佣金"
8295
align="center"
8396
prop="frozenPrice"
8497
min-width="100px"
98+
:formatter="fenToYuanFormat"
8599
/>
86100
<el-table-column label="推广资格" align="center" prop="brokerageEnabled" min-width="80px">
87101
<template #default="scope">
@@ -167,6 +181,7 @@
167181
import { dateFormatter } from '@/utils/formatTime'
168182
import * as BrokerageUserApi from '@/api/mall/trade/brokerage/user'
169183
import { checkPermi } from '@/utils/permission'
184+
import { fenToYuanFormat } from '@/utils/formatter'
170185
171186
defineOptions({ name: 'TradeBrokerageUser' })
172187

0 commit comments

Comments
 (0)